/* ==========================================================================
   Design Tokens — Dark/Light Theme
   ========================================================================== */

:root {
  /* -- Spacing scale (4pt grid) -- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* -- Radius -- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* -- Typography scale (Plus Jakarta Sans) -- */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  --fs-display: clamp(2.5rem, 6vw, 4.5rem);   /* hero H1 */
  --fs-h2: clamp(1.75rem, 3.5vw, 2.75rem);     /* section H2 */
  --fs-h3: clamp(1.125rem, 1.5vw, 1.375rem);   /* card H3 */
  --fs-body-lg: clamp(1rem, 1.2vw, 1.125rem);  /* subheadline */
  --fs-body: clamp(0.875rem, 1vw, 1rem);        /* body */
  --fs-caption: clamp(0.75rem, 0.8vw, 0.8125rem); /* caption */
  --fs-mono: clamp(0.75rem, 0.8vw, 0.8125rem);

  --lh-tight: 1.05;
  --lh-heading: 1.2;
  --lh-body: 1.6;

  --ls-display: -0.02em;
  --ls-heading: -0.015em;
  --ls-label: 0.08em;

  /* -- Z-index scale -- */
  --z-dropdown: 50;
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* -- Container -- */
  --container-max: 1120px;
  --container-dash: 1200px;
  --container-pad-mobile: 16px;
  --container-pad-tablet: 24px;
  --container-pad-desktop: 32px;

  /* -- Motion -- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-entrance: 400ms;
}

/* -- Light theme (default root) -- */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --surface: #fafafa;
  --surface-hover: #f0f0f0;
  --text: #111111;
  --text-2: #555555;
  --text-3: #888888;
  --border: #e5e5e5;
  --accent: #111111;
  --accent-hover: #333333;
  --accent-text: #ffffff;
  --red: #fe2c55;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #555555;
  --info-bg: #f5f5f5;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.08);
  --glow-accent: 0 0 24px rgba(17,17,17,.08);
}

/* -- Dark theme -- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --text: #e8e8e8;
  --text-2: #999999;
  --text-3: #666666;
  --border: #222222;
  --accent: #ffffff;
  --accent-hover: #cccccc;
  --accent-text: #000000;
  --red: #fe2c55;
  --success: #3fb950;
  --success-bg: rgba(63,185,80,.12);
  --warning: #d29922;
  --warning-bg: rgba(210,153,34,.12);
  --danger: #f85149;
  --danger-bg: rgba(248,81,73,.12);
  --info: #999999;
  --info-bg: rgba(136,136,136,.1);
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.5);
  --glow-accent: 0 0 24px rgba(255,255,255,.04);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-underline-offset: 2px;
}
a:hover {
  text-decoration-color: var(--text);
}

code {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

img { max-width: 100%; display: block; }

.icon-svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}
.nav-link.active {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-name {
  font-size: 14px;
  color: var(--text-2);
}

/* Theme toggle */
.theme-seg {
  display: inline-flex;
  background: var(--bg-2);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 1px;
}

.theme-seg button {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  transition: background .15s, color .15s;
}

.theme-seg button:hover {
  color: var(--text-2);
}

.theme-seg button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ==========================================================================
   Buttons — T1.5/T1.6: sizes sm/md/lg, states, focus ring
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  min-height: 40px;
}
.btn:hover {
  background: var(--surface-hover);
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-3);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-accent:focus-visible {
  outline-color: var(--red);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
  min-height: 32px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 16px;
  border-radius: var(--radius-full);
  min-height: 48px;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-danger {
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-full { width: 100%; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}

.field-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  outline: none;
  min-height: 42px;
}
.input:focus {
  border-color: var(--accent);
}
.input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.input::placeholder {
  color: var(--text-3);
}

.input-sm {
  padding: 6px 10px;
  font-size: 14px;
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-2);
}

.check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Panel / Card
   ========================================================================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ==========================================================================
   Layout — Main
   ========================================================================== */

.main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--container-pad-mobile);
}

@media (min-width: 768px) {
  .main { padding: var(--sp-5) var(--container-pad-tablet); }
}
@media (min-width: 1024px) {
  .main { padding: var(--sp-6) var(--container-pad-desktop); }
}

/* Container utility — consistent width across all sections */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad-mobile);
  padding-right: var(--container-pad-mobile);
}
@media (min-width: 768px) {
  .container {
    padding-left: var(--container-pad-tablet);
    padding-right: var(--container-pad-tablet);
  }
}
@media (min-width: 1024px) {
  .container {
    padding-left: var(--container-pad-desktop);
    padding-right: var(--container-pad-desktop);
  }
}


/* ==========================================================================
   Donate Page
   ========================================================================== */

.donate {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--sp-5) var(--container-pad-mobile) var(--sp-8);
}

.donate-hero {
  position: relative;
  margin-bottom: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-align: center;
}

/* soft red glow banner behind the avatar */
.donate-cover {
  height: 120px;
  background:
    linear-gradient(to bottom, transparent 40%, var(--surface) 100%),
    radial-gradient(55% 120% at 50% 0%, color-mix(in srgb, var(--text) 12%, transparent), transparent 72%),
    var(--surface);
}

.donate-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--sp-5) var(--sp-5);
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 30px;
}

/* big profile photo that overlaps the cover */
.avatar-xl {
  width: 104px;
  height: 104px;
  font-size: 42px;
  margin-top: -52px;
  margin-bottom: var(--sp-3);
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--border), 0 12px 32px -12px rgba(0,0,0,.5);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.donate-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-3);
}
.kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}

.donate-profile h1 {
  font-size: clamp(1.375rem, 5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-heading);
  overflow-wrap: anywhere;
}

.donate-handle {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 2px;
}

.donate-bio {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
  margin-top: var(--sp-3);
  max-width: 420px;
  overflow-wrap: anywhere;
}

.donate-perks {
  list-style: none;
  margin-top: var(--sp-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: center;
}

.donate-perks li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-full);
}
.donate-perks svg { color: var(--text-3); flex-shrink: 0; }

/* Donate form */
.donate-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.step-title small {
  font-weight: 400;
  color: var(--text-3);
  font-size: 13px;
}

/* Amount grid */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.amount-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-4) var(--sp-2);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
  min-height: 80px;
}

.amount-card:hover {
  border-color: var(--text-3);
  transform: translateY(-1px);
}
.amount-card:active {
  transform: scale(.97);
}
.amount-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.amount-card.selected {
  border-color: var(--accent);
  background: var(--info-bg);
}

.amount-emoji {
  font-size: 20px;
  line-height: 1;
}

.amount-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.amount-value small {
  font-size: 12px;
  font-weight: 400;
  margin-right: 1px;
}

.amount-label {
  font-size: 11px;
  color: var(--text-3);
}

.other-text {
  font-size: 13px;
  font-weight: 600;
}

/* Money input */
.money-field {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--sp-4);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.money-field:focus-within {
  border-color: var(--accent);
}

.money-prefix {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  margin-right: 4px;
}

.money-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.money-input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

/* Summary */
.donate-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.donate-summary small {
  display: block;
  font-size: 13px;
  color: var(--text-3);
}

.donate-summary b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

/* Submit */
.donate-submit {
  margin-top: 16px;
}

.donate-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 12px;
}

/* ==========================================================================
   Checkout
   ========================================================================== */

.checkout-container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--sp-6) 0;
}

.checkout-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-bottom: var(--sp-5);
  padding: var(--sp-5) var(--sp-5) 0;
}

.checkout-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.checkout-msg {
  max-width: 240px;
  text-align: right;
  word-break: break-word;
}

.checkout-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.checkout-total {
  font-size: 16px;
}

.checkout-total b {
  color: var(--accent);
}

.qr-section {
  text-align: center;
  margin: var(--sp-5) 0;
}

.qr-box {
  display: inline-flex;
  background: #fff;
  padding: var(--sp-4);
  border-radius: var(--radius);
}

.qr-box canvas,
.qr-box svg {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

.qr-hint {
  font-size: 13px;
  margin-top: 10px;
}

.qr-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.qr-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qr-hint-small {
  font-size: 12px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.qr-placeholder {
  padding: var(--sp-6);
  background: var(--bg-2);
  border-radius: var(--radius);
  text-align: center;
}

.countdown {
  margin-top: 16px;
  font-size: 14px;
  color: var(--warning);
  font-weight: 600;
}

.checkout-status {
  text-align: center;
  margin-top: var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

/* ==========================================================================
   Thank You
   ========================================================================== */

.thanks-container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--sp-8) 0;
  text-align: center;
}

.thanks-panel {
  text-align: center;
}

.thanks-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.thanks-panel h1 {
  font-size: var(--fs-h2);
  font-weight: 800;
  margin-bottom: var(--sp-3);
}

.thanks-panel p {
  color: var(--text-2);
  margin-bottom: var(--sp-5);
}

.thanks-msg {
  font-style: italic;
  color: var(--text-2);
  border-left: 3px solid var(--accent);
  padding: var(--sp-2) var(--sp-4);
  margin: var(--sp-4) auto var(--sp-5);
  max-width: 320px;
  text-align: left;
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px);
  padding: var(--sp-7) var(--container-pad-mobile);
}

.auth-panel {
  width: 100%;
  max-width: 380px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.auth-brand h1 {
  font-size: 22px;
}

.auth-sub {
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Error
   ========================================================================== */

.error-container {
  text-align: center;
  padding: 80px 20px;
}

.error-code {
  font-size: 64px;
  font-weight: 700;
  color: var(--text-3);
  line-height: 1;
}

.error-container h1 {
  font-size: 20px;
  margin: 12px 0 20px;
}

/* ==========================================================================
   Status Badges
   ========================================================================== */

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.status-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-paid {
  background: var(--success-bg);
  color: var(--success);
}

.status-expired, .status-canceled {
  background: var(--bg-2);
  color: var(--text-3);
}

.status-failed, .status-refunded {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ==========================================================================
   Toast / Flash
   ========================================================================== */

.toast {
  max-width: 560px;
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn .3s ease;
}

.toast-success {
  background: var(--success-bg);
  color: var(--success);
}

.toast-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.toast-info {
  background: var(--info-bg);
  color: var(--info);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Table
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.msg-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.muted { color: var(--text-2); }
.mono { font-family: var(--font-mono); font-size: var(--fs-mono); }

/* Section spacing utility */
.section {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-8);
}
@media (min-width: 768px) {
  .section {
    padding-top: var(--sp-9);
    padding-bottom: var(--sp-9);
  }
}
@media (min-width: 1024px) {
  .section {
    padding-top: var(--sp-10);
    padding-bottom: var(--sp-10);
  }
}

/* Section header */
.section-label {
  font-size: var(--fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--red);
  margin-bottom: var(--sp-3);
}
.section-heading {
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-heading);
  margin-bottom: var(--sp-2);
}
.section-desc {
  font-size: var(--fs-body-lg);
  color: var(--text-2);
  line-height: var(--lh-body);
  max-width: 540px;
}

/* Focus-visible for all interactive elements */
a:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Switch/Toggle */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
}
.switch input { display: none; }
.switch-track {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--duration-fast) var(--ease-out);
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-out);
}
.switch input:checked + .switch-track {
  background: var(--accent);
}
.switch input:checked + .switch-track::after {
  transform: translateX(18px);
  background: var(--accent-text);
}

/* Color input swatch */
.color-input {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.color-swatch {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: none; }
.color-swatch::-moz-color-swatch { border: none; }
.color-hex {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  width: 90px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-2);
}

.empty-state p:first-child {
  font-size: 16px;
  margin-bottom: 4px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.site-footer a {
  color: var(--text-3);
  text-decoration: none;
  margin: 0 4px;
}

.site-footer a:hover {
  color: var(--text-2);
  text-decoration: none;
}

.footer-sep {
  margin: 0 4px;
}

.site-footer p {
  margin-top: 6px;
}


/* ==========================================================================
   Footer v2 — 3 columns (used globally by footer.ejs partial)
   ========================================================================== */

.site-footer-v2 {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-7);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-8) var(--container-pad-mobile) var(--sp-6);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-7);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer-brand .brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-3);
  line-height: var(--lh-body);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-3);
  margin-bottom: var(--sp-1);
}

.footer-col a {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.footer-col a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--container-pad-mobile);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }

  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .checkout-row {
    font-size: 13px;
  }

  .table th, .table td {
    padding: 8px;
    font-size: 13px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
    padding: var(--sp-6) var(--container-pad-mobile) var(--sp-5);
  }
}

/* ==========================================================================
   Donate page: song request picker
   ========================================================================== */
.songpick-lock {
  font-size: 13px;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: var(--sp-3);
}
.songpick.is-locked .input { opacity: .5; cursor: not-allowed; }
.songpick[hidden], .songpick-chosen[hidden] { display: none; }

.songpick-results {
  list-style: none;
  margin-top: var(--sp-2);
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.songpick-results[hidden] { display: none; }
.songpick-results li + li { border-top: 1px solid var(--border); }
.songpick-status { padding: 12px 14px; font-size: 13px; color: var(--text-3); }
.songpick-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.songpick-result:hover,
.songpick-result:focus-visible { background: var(--surface-hover); outline: none; }
.songpick-result img,
.songpick-cover-ph,
.songpick-chosen img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-2);
}
.songpick-meta { min-width: 0; display: flex; flex-direction: column; }
.songpick-meta b {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.songpick-meta span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.songpick-chosen {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--text-3);
  border-radius: var(--radius);
}
.songpick-chosen .songpick-meta { flex: 1; }
.songpick-remove {
  flex-shrink: 0;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
}
.songpick-remove:hover { color: var(--text); border-color: var(--text-3); }
