:root {
  --color-primary: #f3b232;
  --color-primary-dark: #c37a14;
  --color-accent: #56b5a4;
  --color-bg: #f7f8fb;
  --color-surface: #ffffff;
  --color-border: #e3e6ec;
  --color-muted: #5c6474;
  --color-text: #1f2430;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background: var(--color-bg);
  color: var(--color-text);
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }
}

h1 {
  padding: 1.5rem;
  margin: 0;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

hr {
  margin: 0;
  border: none;
  height: 12px;
}

.zigzag-orange-white {
  background: linear-gradient(-135deg, var(--color-primary) 5px, transparent 0) 0 5px,
    linear-gradient(135deg, var(--color-primary) 5px, #fff 0) 0 5px;
  background-color: var(--color-primary);
  background-position: left bottom;
  background-repeat: repeat-x;
  background-size: 10px 10px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem 2.5rem;
  }
}

.section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  color: var(--color-primary-dark);
  letter-spacing: 0.03em;
}

.address-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.address-form input[type="text"] {
  flex: 1 1 280px;
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 1rem;
}

.address-form.is-loading input[type="text"],
.address-form.is-loading button {
  opacity: 0.6;
  cursor: not-allowed;
}

.address-form button[disabled] {
  pointer-events: none;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.stat-list .stat-item {
  background: #fef9f1;
  border: 1px solid #fde3b3;
  border-radius: var(--radius-md);
  padding: 1rem;
}

.stat-item dt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.stat-item dd {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
  word-break: break-word;
}

#account_address {
  display: inline-block;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  word-break: break-all;
  white-space: normal;
}

.totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.total-card {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, rgba(243, 178, 50, 0.12), rgba(86, 181, 164, 0.12));
}

.total-card .total-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.total-card .total-value {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.table-wrapper {
  position: relative;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.table-placeholder {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-muted);
  font-weight: 600;
  font-size: 1rem;
}

.table-wrapper.is-loading .table-placeholder {
  display: flex;
}

.table-wrapper.is-loading table {
  display: none;
}

.table-scroll {
  max-height: 420px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

thead {
  background: #f2f4f8;
}

th,
td {
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

tbody tr:nth-child(even) {
  background: #fdfdfd;
}

tbody tr:hover {
  background: rgba(243, 178, 50, 0.08);
}

.section-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button,
.section-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.button:focus-visible,
.section-actions button:focus-visible {
  outline: 3px solid rgba(86, 181, 164, 0.4);
  outline-offset: 2px;
}

.button-primary,
.address-form button {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(243, 178, 50, 0.35);
}

.button-secondary {
  background: #fff;
  border-color: var(--color-border);
  color: var(--color-text);
}

.button-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(86, 181, 164, 0.35);
}

.button-ghost {
  background: rgba(243, 178, 50, 0.12);
  color: var(--color-primary-dark);
  border-color: rgba(243, 178, 50, 0.35);
}

.button-link {
  background: transparent;
  color: var(--color-accent);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

.button[disabled],
.section-actions button[disabled],
.button.is-loading {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.button:hover,
.section-actions button:hover {
  transform: translateY(-1px);
}

.link-list,
.donation-list {
  margin: 0;
  padding-left: 1rem;
}

.link-list dd {
  margin-bottom: 0.5rem;
}

.donation-section h4 {
  margin-bottom: 0.6rem;
}

.donation-block + .donation-block {
  margin-top: 1rem;
}

.donation-list {
  list-style: none;
  padding: 0;
}

.donation-list li {
  margin-bottom: 0.5rem;
}

.donation-input {
  width: 100%;
  max-width: 460px;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

#clipboard {
  gap: 0.25rem;
}

@media (max-width: 600px) {
  h1 {
    flex-wrap: wrap;
    font-size: 1.5rem;
  }

  .address-form input[type="text"] {
    min-width: 100%;
  }

  th,
  td {
    font-size: 0.95rem;
  }

  .section {
    padding: 1.25rem;
  }
}
