/* ═══════════════════════════════════════════════════════════════
   SANCTUM Dashboard — Stylesheet
   Palette: obsidian ground, antique gold inscriptions, parchment text.
   Typography: Cinzel (display), Newsreader (body), Inter (UI), JetBrains Mono (data).
   ═══════════════════════════════════════════════════════════════ */

/* PREVIEW STRIP — top of main, visible until live contracts wired up */
.preview-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  background: linear-gradient(90deg,
    rgba(232, 114, 60, 0.18) 0%,
    rgba(232, 114, 60, 0.10) 100%);
  border: 1px solid #E8723C;
  margin-top: 24px;
  margin-bottom: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  color: #EDE3CC;
  letter-spacing: 0.02em;
}
.preview-strip .preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E8723C;
  box-shadow: 0 0 10px rgba(232, 114, 60, 0.7);
  flex-shrink: 0;
  animation: preview-pulse 2.4s ease-in-out infinite;
}
@keyframes preview-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
.preview-strip .preview-label {
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 11px;
  color: #E8723C;
}
.preview-strip .preview-msg {
  color: #EDE3CC;
  opacity: 0.85;
  flex: 1;
}

/* Chain-status pill (lives in the right end of the preview strip) */
.chain-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.chain-status[data-state="connecting"] { color: #C8A653; opacity: 0.7; }
.chain-status[data-state="connected"]  { color: #6EBE7B; }                /* live green */
.chain-status[data-state="offline"]    { color: #C66660; }                /* dimmed red */
.chain-status[data-state="connected"]::before {
  content: "● ";
  color: #6EBE7B;
  animation: status-pulse 2s ease-in-out infinite;
}
.chain-status[data-state="offline"]::before { content: "● "; }
@keyframes status-pulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* One-shot brightness bloom each time chain.syncFromChain succeeds — confirms
   to the user that data just refreshed without needing to inspect numbers. */
.chain-status.sync-pulse {
  animation: chain-sync-pulse 0.9s ease-out;
}
@keyframes chain-sync-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(110, 190, 123, 0.55); }
  50%  { box-shadow: 0 0 0 4px rgba(110, 190, 123, 0.18); }
  100% { box-shadow: 0 0 0 8px rgba(110, 190, 123, 0); }
}

/* ─── Phase 1 progress bar — standalone, sits below preview strip ─── */
.phase-progress {
  margin: 14px 0 24px;
  padding: 0;
}

/* Once the curve caps and we enter Phase 2, the orange strip + progress bar
   are no longer relevant. JS toggles body.is-phase2; both collapse cleanly. */
body.is-phase2 .preview-strip,
body.is-phase2 .phase-progress { display: none; }
.phase-progress-track {
  position: relative;
  height: 10px;
  background: rgba(15, 12, 10, 0.6);
  border: 1px solid var(--gold-deep);
  overflow: hidden;
}
.phase-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep) 0%, var(--gold) 60%, var(--parchment-glow) 100%);
  box-shadow:
    inset 0 0 6px rgba(255, 230, 160, 0.35),
    0 0 14px rgba(200, 166, 83, 0.45);
  transition: width 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  position: relative;
}
/* Subtle sheen that drifts across the fill — gives it "alive" energy */
.phase-progress-fill::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg,
    rgba(255, 245, 220, 0) 0%,
    rgba(255, 245, 220, 0.35) 50%,
    rgba(255, 245, 220, 0) 100%);
  animation: phase-progress-sheen 3.6s ease-in-out infinite;
}
@keyframes phase-progress-sheen {
  0%   { transform: translateX(0); }
  100% { transform: translateX(350%); }
}

/* ─── Value-change halo: brief gold flash + lift on any updated number ─── */
.stat-value, .floor-value, .floor-pct {
  transition: color 0.6s ease, text-shadow 0.8s ease;
}
.value-flash {
  animation: value-flash-anim 1.5s ease-out;
}
@keyframes value-flash-anim {
  0%   { text-shadow: 0 0 14px rgba(200, 166, 83, 0.55), 0 0 24px rgba(200, 166, 83, 0.22); color: #F5EDD7; }
  60%  { text-shadow: 0 0  6px rgba(200, 166, 83, 0.18); }
  100% { text-shadow: none; }
}

/* Stronger version used for the hero floor value */
.value-flash-emphasis {
  animation: value-flash-hero 1.6s ease-out;
}
@keyframes value-flash-hero {
  0%   { text-shadow: 0 0 22px rgba(200, 166, 83, 0.75), 0 0 40px rgba(200, 166, 83, 0.35); color: #F5EDD7; }
  60%  { text-shadow: 0 0 10px rgba(200, 166, 83, 0.25); }
  100% { text-shadow: none; }
}

/* Stat card border-color flicker that pairs with value-flash */
.stat-card { transition: border-color 0.6s ease, box-shadow 0.4s ease; }
.stat-card:has(.value-flash) { border-color: var(--gold); }

/* Toast container — bottom right, non-blocking */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border: 1px solid;
  border-left-width: 3px;
  background: rgba(15, 12, 10, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: #EDE3CC;
  animation: toast-in 0.25s ease-out;
  word-break: break-word;
}
.toast-pending { border-color: #C8A653; }
.toast-success { border-color: #6EBE7B; color: #DCEFDC; }
.toast-error   { border-color: #C66660; color: #F5D5D2; }
.toast-warning { border-color: #E8723C; color: #F5D9C8; }
.toast-out { animation: toast-out 0.3s ease-in forwards; }
@keyframes toast-in {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateX(16px); opacity: 0; }
}

@media (max-width: 700px) {
  .preview-strip { padding: 8px 12px; gap: 8px; }
  .preview-strip .preview-label { display: none; }      /* save horizontal room */
  .preview-strip .preview-msg   { font-size: 11px; }
  .chain-status { font-size: 9px; padding: 3px 8px; }
  #toast-container { bottom: 80px; right: 12px; left: 12px; max-width: none; }
  .toast { font-size: 12px; padding: 10px 14px; }
}
@media (max-width: 420px) {
  /* Smallest phones — drop the chain pill from the strip (it's already
     visible via the wallet status when connected, and the user knows what
     chain their MetaMask is on). */
  .chain-status { display: none; }
}

:root {
  --obsidian: #0B0A08;
  --obsidian-2: #15120E;
  --obsidian-3: #211C16;
  --parchment: #EDE3CC;
  --parchment-mute: #A99E84;
  --parchment-glow: #F5EDD7;
  --gold: #C8A653;
  --gold-deep: #8E7330;
  --oxblood: #5B1A1E;
  --vesper: #3A2A55;
  --ember: #E8723C;
  --sidebar-w: 220px;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.78  0 0 0 0 0.65  0 0 0 0 0.32  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

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

html, body {
  height: 100%;
  background: var(--obsidian);
  color: var(--parchment);
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;          /* hard-block horizontal scroll on small screens */
}

body {
  display: flex;
  background-image: var(--grain), radial-gradient(ellipse at 50% 0%, #1A140A 0%, var(--obsidian) 50%);
  background-attachment: fixed;
}

/* ─── FONT CLASSES ─── */
.font-display { font-family: "Cinzel", "Trajan Pro", serif; font-weight: 600; }
.font-body    { font-family: "Newsreader", Georgia, serif; }
.font-ui      { font-family: "Inter", system-ui, sans-serif; }
.font-mono    { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--obsidian-2);
  border-right: 1px solid var(--gold-deep);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 32px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--parchment-mute);
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--parchment);
  background: var(--obsidian-3);
}

.nav-link.active {
  color: var(--gold);
  background: rgba(200, 166, 83, 0.08);
  box-shadow: inset 0 0 12px rgba(200, 166, 83, 0.06);
}

.nav-bottom {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--gold-deep);
  color: var(--gold);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
}

.connect-btn:hover {
  background: rgba(200, 166, 83, 0.1);
  border-color: var(--gold);
  color: var(--parchment-glow);
}

/* ═══ MAIN AREA ═══ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 0 48px 56px;
}

/* ═══ FLOOR BANNER ═══ */
.floor-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  background: var(--obsidian-2);
  border: 1px solid var(--gold-deep);
  margin-top: 24px;     /* breathing room from page top once Phase 1 strip is hidden;
                           collapses with progress-bar margin-bottom during Phase 1 */
  margin-bottom: 48px;
}

.floor-banner-inner {
  display: flex;
  align-items: center;          /* vertical-center FLOOR / price / arrow / delta */
  gap: 16px;
}

.floor-label {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--parchment-mute);
}

.floor-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 42px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.floor-arrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  color: var(--ember);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.floor-delta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.floor-inception {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: var(--parchment-mute);
  letter-spacing: 0.06em;
}

.floor-pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--gold);
}

.wallet-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tier-badge {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border: 1px solid var(--oxblood);
  color: var(--oxblood);
  background: rgba(91, 26, 30, 0.1);
}

.tier-badge.initiate { border-color: var(--gold-deep); color: var(--gold-deep); background: rgba(142, 115, 48, 0.1); }
.tier-badge.acolyte  { border-color: var(--gold); color: var(--gold); background: rgba(200, 166, 83, 0.08); }
.tier-badge.adept    { border-color: var(--gold); color: var(--gold); background: rgba(200, 166, 83, 0.12); }
.tier-badge.elder    { border-color: var(--gold); color: var(--parchment-glow); background: rgba(200, 166, 83, 0.18); }

.wallet-addr {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--parchment-mute);
}

/* ═══ PAGES ═══ */
.page { display: none; }
.page.active {
  display: block;
  padding-bottom: 48px;          /* prevents last-child margin from collapsing
                                    through the section, guarantees real space
                                    below the tier ladder / Pyre stats */
  animation: fadeIn 0.3s ease;
}

/* Centered action pages (Inscribe, Pledge, Leverage, Pyre).
   Higher specificity than .page.active so this layout wins.            */
.page.page-centered.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
}
.page-centered .page-header  { max-width: 640px; text-align: center; }
.page-centered .page-sub     { margin-left: auto; margin-right: auto; }
.page-centered .action-panel { margin: 0 auto; width: 100%; max-width: 480px; }
.page-centered .section-header { text-align: center; }
.page-centered .stats-grid     { margin-left: auto; margin-right: auto; }
/* Re-align inline text inside action panels so the inputs/rows read naturally */
.page-centered .input-label,
.page-centered .fee-row { text-align: left; }
.page-centered .fee-row > span:last-child { text-align: right; }
.page-centered .vow-warning { text-align: left; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 40px; }

.eyebrow {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 8px;
}

.page-title {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 42px;
  letter-spacing: 0.04em;
  color: var(--parchment);
  line-height: 1.1;
}

.page-sub {
  color: var(--parchment-mute);
  max-width: 560px;
  margin-top: 12px;
}

.section-header { margin-bottom: 24px; }
.section-header h2 {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.03em;
  color: var(--parchment);
}

/* ═══ DOCTRINE STRIP ═══ */
.doctrine-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0;
  margin-bottom: 40px;
  border: 1px solid var(--gold-deep);
  background: var(--obsidian-2);
  box-shadow: inset 0 0 40px rgba(200, 166, 83, 0.03);
}

.doctrine-line {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.doctrine-rule {
  width: 1px;
  height: 20px;
  background: var(--gold-deep);
}

/* ═══ STAT CARDS ═══ */
/* Auto-fit: at desktop width all 5 fit on one row; narrower screens wrap to 3,
   then 2, gracefully. Each card is at least 200px to keep numbers readable.    */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 56px;
}

.stats-grid.two-col   { grid-template-columns: repeat(2, 1fr); max-width: 720px;  margin: 0 auto 56px; }
.stats-grid.three-col { grid-template-columns: repeat(3, 1fr); max-width: 1080px; margin: 0 auto 56px; }

.stat-card {
  background: var(--obsidian-2);
  border: 1px solid var(--gold-deep);
  padding: 28px 28px 24px;
  min-height: 168px;
  display: grid;
  /* Three fixed-position rows so label / value / sub all line up across cards,
     regardless of how long each card's sub copy wraps. */
  grid-template-rows: 18px 1fr 36px;
  row-gap: 16px;
  transition: box-shadow 0.25s ease;
}

.stat-card:hover {
  box-shadow: inset 0 0 20px rgba(200, 166, 83, 0.05);
}

.stat-label {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--parchment-mute);
  margin: 0;
  align-self: start;
  line-height: 1.2;
}

.stat-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 36px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin: 0;
  align-self: center;
}

.stat-value.accent { color: var(--gold); }
.stat-value.ember  { color: var(--ember); }
.stat-value.vesper { color: #7B5EA7; }

.stat-sub {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--parchment-mute);
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1.4;
  align-self: end;
}

/* ═══ LEDGER PAGE ═══ */
.ledger-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 24px;
  border: 1px solid var(--gold-deep);
  background: var(--obsidian-2);
  color: var(--parchment-mute);
  text-align: center;
}
.ledger-empty.is-shown { display: flex; }
.ledger-empty svg { color: var(--gold); }
.ledger-empty-title {
  font-family: "Cinzel", serif;
  font-size: 18px;
  color: var(--parchment);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.ledger-empty-sub {
  font-family: "Inter", sans-serif;
  font-size: 13px;
}

.ledger-content { display: none; }
.ledger-content.is-shown { display: block; }

.ledger-identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px 28px;
  margin-bottom: 40px;
  border: 1px solid var(--gold-deep);
  background: var(--obsidian-2);
}
.ledger-identity-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ledger-identity-label {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--parchment-mute);
}
.ledger-identity-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  color: var(--parchment);
}
.ledger-identity-value .tier-badge { display: inline-block; }

/* Open Rites positions */
.ledger-positions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 56px;
}
.ledger-positions-empty {
  padding: 40px 24px;
  border: 1px dashed var(--gold-deep);
  background: var(--obsidian-2);
  color: var(--parchment-mute);
  text-align: center;
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: 14px;
}
.ledger-position {
  border: 1px solid var(--gold-deep);
  background: var(--obsidian-2);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ledger-position-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gold-deep);
}
.ledger-position-id {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.ledger-position-meta {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--parchment-mute);
  letter-spacing: 0.04em;
}
.ledger-position-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.lp-cell { display: flex; flex-direction: column; gap: 6px; }
.lp-cell-label {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  color: var(--parchment-mute);
}
.lp-cell-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  color: var(--parchment);
}
.lp-cell-value.accent { color: var(--gold); }
.lp-cell-unit {
  font-size: 11px;
  color: var(--parchment-mute);
  letter-spacing: 0.04em;
}

.ledger-position-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--gold-deep);
}

.secondary-btn {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-deep);
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.secondary-btn:hover:not(:disabled) {
  background: rgba(200, 166, 83, 0.06);
  border-color: var(--gold);
  color: var(--gold);
}
.secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--parchment-mute);
}

.ledger-position.is-overdue {
  border-color: var(--oxblood);
  box-shadow: inset 0 0 30px rgba(91, 26, 30, 0.08);
}
.ledger-position.is-overdue .ledger-position-id { color: var(--oxblood); }
.ledger-overdue {
  color: var(--oxblood);
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ═══ TIER LADDER ═══ */
.tier-ladder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tier-rung {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--obsidian-2);
  border: 1px solid var(--gold-deep);
  transition: box-shadow 0.25s ease;
}

.tier-rung:hover {
  box-shadow: inset 0 0 20px rgba(200, 166, 83, 0.06);
}

.tier-icon { width: 40px; height: 40px; }

.tier-name {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--parchment);
}

.tier-toll {
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  color: var(--gold);
}

.tier-tenure {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 9.5px;
  color: var(--parchment-mute);
}

.tier-rung.heretic .tier-name { color: var(--oxblood); }
.tier-rung.heretic .tier-toll { color: var(--ember); }

/* Highlight the user's current tier in the ladder */
.tier-rung.is-current {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), inset 0 0 24px rgba(200, 166, 83, 0.10);
}
.tier-rung.is-current .tier-name {
  color: var(--parchment-glow);
}

/* Sub-line under "Ward of the Threshold" header */
.ward-sub {
  margin-top: 12px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--parchment-mute);
  max-width: 720px;
}

/* Inline warning inside an action panel — used on Surrender + Pledge */
.vow-warning {
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-left: 2px solid var(--gold-deep);
  background: rgba(142, 115, 48, 0.05);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--parchment-mute);
}

/* Hold-streak readout next to the wallet address in the floor banner */
.wallet-streak {
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--parchment-mute);
  text-align: right;
}
.wallet-streak.is-empty { display: none; }

/* ─── Phase-1 lock banner (Pledge + Leverage) ───────────────────────── */
.phase-lock {
  display: none;                                /* JS adds .is-shown */
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 24px;
  max-width: 480px;
  width: 100%;
  background: rgba(232, 114, 60, 0.08);
  border: 1px solid var(--ember);
  border-left-width: 3px;
  text-align: left;
}
.phase-lock.is-shown { display: flex; }
.phase-lock-icon {
  color: var(--ember);
  flex-shrink: 0;
}
.phase-lock-title {
  font-family: "Cinzel", serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--ember);
  margin-bottom: 4px;
}
.phase-lock-sub {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  line-height: 1.45;
  color: var(--parchment-mute);
}

/* When phase-locked, dim the action panel + disable interaction */
.action-panel.is-phase-locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.4);
}

/* ═══ ACTION PANEL ═══ */
.action-panel {
  max-width: 480px;
  background: var(--obsidian-2);
  border: 1px solid var(--gold-deep);
  padding: 32px;
}

.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--gold-deep);
}

.tab {
  flex: 1;
  padding: 12px 0;
  background: transparent;
  border: none;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--parchment-mute);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.tab:hover { color: var(--parchment); }
.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

.input-group { margin-bottom: 16px; }

.input-label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--parchment-mute);
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  align-items: center;
  background: var(--obsidian);
  border: 1px solid var(--obsidian-3);
  padding: 4px;
  transition: border-color 0.2s;
}

.input-row:focus-within { border-color: var(--gold-deep); }

.token-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--parchment);
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  padding: 12px 14px;
  font-variant-numeric: tabular-nums;
}

.token-input::placeholder { color: var(--obsidian-3); }
.token-input::-webkit-outer-spin-button,
.token-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.token-input[type=number] { -moz-appearance: textfield; }

.token-tag {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--parchment-mute);
  padding: 8px 16px;
  white-space: nowrap;
}

.token-tag.sanctum { color: var(--gold); }

.swap-arrow {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--parchment-mute);
  letter-spacing: 0.02em;
}

.fee-value {
  font-family: "JetBrains Mono", monospace;
  color: var(--gold);
  font-size: 13px;
}
.fee-value.accent { color: var(--gold); }

.primary-btn {
  width: 100%;
  margin-top: 20px;
  padding: 16px 24px;
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--parchment);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.primary-btn:hover {
  background: rgba(200, 166, 83, 0.12);
  color: var(--parchment-glow);
  box-shadow: inset 0 0 24px rgba(200, 166, 83, 0.08);
}

.primary-btn.secondary {
  border-color: var(--gold-deep);
  color: var(--parchment-mute);
}

.primary-btn.secondary:hover {
  border-color: var(--gold);
  color: var(--parchment);
}

/* ─── DURATION BUTTONS ─── */
.duration-options {
  display: flex;
  gap: 8px;
}

.dur-btn {
  flex: 1;
  padding: 10px 0;
  background: var(--obsidian);
  border: 1px solid var(--obsidian-3);
  color: var(--parchment-mute);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.dur-btn:hover {
  border-color: var(--gold-deep);
  color: var(--parchment);
}

.dur-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 166, 83, 0.06);
}

/* Locked — duration exceeds the contract's current maxLoanDuration.
   Visually muted, cursor disabled, not interactive.                */
.dur-btn.dur-btn-locked,
.dur-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--obsidian-3);
  color: var(--parchment-mute);
  background: transparent;
}
.dur-btn.dur-btn-locked:hover,
.dur-btn:disabled:hover {
  border-color: var(--obsidian-3);
  color: var(--parchment-mute);
}

/* ─── PLEDGE TABLE ─── */
.pledge-empty {
  text-align: center;
  padding: 48px;
  color: var(--parchment-mute);
  font-family: "Newsreader", serif;
  font-size: 17px;
  border: 1px solid var(--obsidian-3);
  background: var(--obsidian-2);
}

/* ─── PYRE PAGE ─── */

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   Breakpoints:
     >=1025px : desktop (default styles)
      769-1024: tablet (compact sidebar)
      481- 768: large phone / phone landscape (bottom nav)
       <=480  : phone portrait (compact everything)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tablet: collapse sidebar to icons, keep left layout ─────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tier-ladder { grid-template-columns: repeat(2, 1fr); }
  .doctrine-strip { flex-direction: column; gap: 8px; padding: 24px; }
  .doctrine-rule { width: 80px; height: 1px; }

  .sidebar { width: 64px; }
  .sidebar .nav-link span,
  .sidebar .connect-btn span { display: none; }
  .sidebar .nav-link { justify-content: center; padding: 12px; }
  .sidebar .connect-btn { padding: 12px; }
  .main { margin-left: 64px; padding: 0 32px 80px; }

  .page-title { font-size: 36px; }
  .floor-value { font-size: 36px; }
}

/* ─── Mobile: bottom-nav layout (<=768px) ─────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 15px; }

  /* Sidebar flips to a fixed bottom-nav strip
     IMPORTANT: do NOT use backdrop-filter here — it would create a containing
     block for any position:fixed descendants (Connect button), trapping them
     inside the sidebar instead of letting them float to the viewport. */
  .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--gold-deep);
    background: var(--obsidian);
  }
  .sidebar-logo { display: none; }

  .nav-section {
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    padding: 0;
    gap: 0;
    flex: 1;
  }

  .sidebar .nav-link {
    flex-direction: column;
    gap: 4px;
    padding: 8px 4px;
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    border-radius: 6px;
    justify-content: center;
    text-align: center;
  }
  .sidebar .nav-link svg { width: 22px; height: 22px; }
  .sidebar .nav-link span {
    display: block;
    font-size: 9px;
    letter-spacing: 0.06em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Hide low-priority Codex link from the bottom nav */
  #nav-codex { display: none; }

  /* Float the Connect button to a fixed top-right corner */
  .sidebar .nav-bottom {
    position: fixed;
    top: 0;
    right: 0;
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-right: calc(12px + env(safe-area-inset-right));
    background: none;
    z-index: 200;
    flex-direction: row;
  }
  .sidebar .connect-btn {
    padding: 8px 14px;
    font-size: 10px;
    letter-spacing: 0.1em;
    background: rgba(15, 12, 10, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .sidebar .connect-btn span { display: inline; }

  /* Main: clear bottom nav, give breathing room at top for floating Connect */
  .main {
    margin-left: 0;
    padding: 0 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  /* Preview strip tightens */
  .preview-strip {
    padding: 8px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .preview-strip .preview-label { font-size: 10px; letter-spacing: 0.18em; }
  .preview-strip .preview-msg { font-size: 11px; }

  /* Floor banner: stack vertically, fix wallet-status alignment */
  .floor-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    /* top right bottom left — right padding clears the floating Connect button */
    padding: 18px 110px 18px 18px;
    margin-bottom: 28px;
  }
  .floor-banner-inner {
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: baseline;
  }
  .floor-value { font-size: 36px; }
  .floor-arrow { font-size: 22px; }
  .floor-delta { flex-direction: row; gap: 10px; flex-wrap: wrap; align-items: baseline; }

  .wallet-status {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-right: 0;
  }
  .wallet-streak {
    text-align: left;
    margin-top: 0;
    flex-basis: 100%;
  }

  /* Page header tightens */
  .page-header { margin-bottom: 28px; }
  .page-title { font-size: 26px; line-height: 1.15; }
  .page-sub { font-size: 14px; margin-top: 8px; }
  .section-header h2 { font-size: 22px; }
  .section-header { margin-bottom: 18px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.14em; }

  .doctrine-strip { padding: 20px; margin-bottom: 28px; }
  .doctrine-line { font-size: 15px; text-align: center; }

  /* Stats grid: 2-col on mobile (denser than 1-col, better use of space) */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 36px; }
  .stat-card {
    padding: 14px 14px 12px;
    min-height: 124px;
    grid-template-rows: 14px 1fr 32px;
    row-gap: 10px;
  }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; letter-spacing: 0.08em; }
  .stat-sub { font-size: 11px; }

  /* Tier ladder: 2x2 grid, more compact rungs */
  .tier-ladder { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tier-rung { padding: 16px 8px; gap: 8px; }
  .tier-icon { width: 48px; height: 48px; }
  .tier-name { font-size: 13px; }
  .tier-toll { font-size: 16px; }
  .tier-tenure { font-size: 9px; }

  /* Ward sub-line */
  .ward-sub { font-size: 12px; margin-top: 10px; }

  /* Action panel: full width, less padding */
  .action-panel {
    max-width: 100%;
    padding: 20px 16px;
  }
  .tab { padding: 10px 0; font-size: 13px; }
  .input-group { margin-bottom: 14px; }
  .token-input { font-size: 18px; padding: 10px 12px; }
  .token-tag { padding: 8px 12px; font-size: 12px; }
  .input-label { font-size: 11px; }
  .fee-row { padding: 6px 0; font-size: 12px; }
  .fee-value { font-size: 12px; }
  .vow-warning { font-size: 11px; padding: 8px 12px; margin-top: 12px; }
  .primary-btn {
    padding: 14px 20px;
    font-size: 13px;
    min-height: 48px;          /* generous touch target */
  }

  /* Duration buttons wrap to 2 rows on phones so they aren't crushed */
  .duration-options { flex-wrap: wrap; gap: 6px; }
  .dur-btn {
    flex: 1 1 calc(33.333% - 4px); /* 3 per row */
    min-width: 0;
    padding: 10px 4px;
    font-size: 12px;
    min-height: 40px;
  }

  /* Pyre page */
  .stats-grid.two-col   { grid-template-columns: repeat(2, 1fr); }
  .stats-grid.three-col { grid-template-columns: 1fr; max-width: 480px; }

  /* Ledger page */
  .ledger-identity { grid-template-columns: 1fr; padding: 18px 20px; gap: 14px; }
  .ledger-position { padding: 16px 18px; }
  .ledger-position-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ledger-position-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lp-cell-value { font-size: 14px; }
  .ledger-position-actions { justify-content: stretch; }
  .ledger-position-actions .secondary-btn { flex: 1; min-height: 44px; }
}

/* ─── Small phones (<=480px): tighter still ───────────────────────── */
@media (max-width: 480px) {
  body { font-size: 14px; }

  .main { padding: 0 12px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* Floor banner: even more compact, allow more clearance for Connect */
  .floor-banner { padding: 14px 100px 14px 14px; }
  .floor-value { font-size: 30px; }
  .floor-arrow { font-size: 18px; }
  .floor-pct { font-size: 12px; }
  .floor-inception { font-size: 10px; }

  /* Preview strip: hide the label chip, keep the dot + message */
  .preview-strip .preview-label { display: none; }
  .preview-strip .preview-msg { font-size: 10px; }

  /* Page titles step down further */
  .page-title { font-size: 22px; }
  .page-sub { font-size: 13px; }
  .section-header h2 { font-size: 19px; }

  /* Doctrine: smaller, tighter */
  .doctrine-strip { padding: 14px; margin-bottom: 20px; }
  .doctrine-line { font-size: 13px; letter-spacing: 0.02em; }
  .doctrine-rule { width: 40px; }

  /* Stats: stack to single column for clarity at narrowest widths */
  .stats-grid { grid-template-columns: 1fr; gap: 8px; margin-bottom: 28px; }
  .stat-card {
    padding: 12px 14px;
    min-height: 0;
    grid-template-rows: 14px auto 28px;
    row-gap: 8px;
  }
  .stat-value { font-size: 20px; }

  /* Tier rungs slightly smaller */
  .tier-rung { padding: 14px 6px; }
  .tier-icon { width: 40px; height: 40px; }
  .tier-name { font-size: 12px; letter-spacing: 0.04em; }
  .tier-toll { font-size: 15px; }
  .tier-tenure { font-size: 8.5px; }

  /* Bottom nav labels even smaller, hard-bounded so 5 items always fit */
  .sidebar { padding: 6px 4px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .sidebar .nav-link {
    padding: 6px 1px;
    flex: 1 1 0;
    min-width: 0;
    max-width: 20%;
  }
  .sidebar .nav-link svg { width: 20px; height: 20px; }
  .sidebar .nav-link span {
    font-size: 8.5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  /* Connect: compact pill, tighter so it never spills the viewport */
  .sidebar .nav-bottom { padding: 10px; padding-right: max(10px, env(safe-area-inset-right)); padding-top: max(10px, env(safe-area-inset-top)); }
  .sidebar .connect-btn { padding: 6px 10px; font-size: 9px; letter-spacing: 0.06em; max-width: 110px; }

  /* Action panel: edge-to-edge content */
  .action-panel { padding: 16px 14px; }
  .token-input { font-size: 16px; }    /* >= 16px keeps iOS from zooming on focus */

  /* Duration buttons: 2 per row for clarity */
  .dur-btn { flex: 1 1 calc(50% - 4px); font-size: 11.5px; padding: 9px 4px; }
}

/* ─── Touch-device hover dampening ─────────────────────────────────── */
@media (hover: none) {
  .stat-card:hover,
  .tier-rung:hover { box-shadow: none; }
  .nav-link:hover { background: transparent; color: var(--parchment-mute); }
  .nav-link.active:hover {
    color: var(--gold);
    background: rgba(200, 166, 83, 0.08);
  }
}

/* ═══════════════════════════════════════════════════════════════
   CONSISTENT POLISH — subtle effects applied across every page.
   Goal: cohesive temple-of-gold feel without anything flashy.
   Effects: gentle glow on hover, staggered entry on page change,
   slow ember breathing on primary CTAs.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --glow-soft: 0 0 24px rgba(200, 166, 83, 0.06);
  --glow-emph: 0 0 32px rgba(200, 166, 83, 0.12);
  --glow-ember: 0 0 28px rgba(232, 114, 60, 0.10);
  --transition-fast: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 480ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Lift-and-glow on every "card" surface ─────────────────────── */
/* Applied uniformly so every box on every page feels alive. */
.stat-card,
.tier-rung,
.ledger-position,
.ledger-identity,
.action-panel,
.doctrine-strip {
  transition:
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

@media (hover: hover) {
  .stat-card:hover,
  .tier-rung:hover,
  .ledger-position:hover,
  .action-panel:hover {
    box-shadow: var(--glow-soft), inset 0 0 30px rgba(200, 166, 83, 0.04);
    border-color: rgba(200, 166, 83, 0.55);
    transform: translateY(-1px);
  }
}

/* ─── Page entry: staggered fade-in for grids and cards ─────────── */
.page.active .stats-grid > .stat-card,
.page.active .tier-ladder > .tier-rung,
.page.active .ledger-positions > .ledger-position {
  animation: card-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page.active .stats-grid > .stat-card:nth-child(1)             { animation-delay: 40ms; }
.page.active .stats-grid > .stat-card:nth-child(2)             { animation-delay: 80ms; }
.page.active .stats-grid > .stat-card:nth-child(3)             { animation-delay: 120ms; }
.page.active .stats-grid > .stat-card:nth-child(4)             { animation-delay: 160ms; }
.page.active .stats-grid > .stat-card:nth-child(5)             { animation-delay: 200ms; }
.page.active .tier-ladder > .tier-rung:nth-child(1)            { animation-delay: 60ms; }
.page.active .tier-ladder > .tier-rung:nth-child(2)            { animation-delay: 110ms; }
.page.active .tier-ladder > .tier-rung:nth-child(3)            { animation-delay: 160ms; }
.page.active .tier-ladder > .tier-rung:nth-child(4)            { animation-delay: 210ms; }

@keyframes card-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Page-header entry: title and eyebrow rise softly ──────────── */
.page.active .page-header > * {
  animation: header-rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.page.active .page-header > .eyebrow    { animation-delay: 20ms; }
.page.active .page-header > .page-title { animation-delay: 80ms; }
.page.active .page-header > .page-sub   { animation-delay: 140ms; }

@keyframes header-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Section headers (mid-page) get the same treatment ─────────── */
.page.active .section-header {
  animation: header-rise 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 240ms;
}

/* ─── Primary CTA: slow ember breathing when idle ──────────────── */
.primary-btn {
  position: relative;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.primary-btn:not(:disabled):not(:hover) {
  animation: cta-breath 4s ease-in-out infinite;
}

@keyframes cta-breath {
  0%, 100% { box-shadow: 0 0 0 rgba(200, 166, 83, 0); }
  50%      { box-shadow: 0 0 18px rgba(200, 166, 83, 0.16); }
}

.primary-btn:not(:disabled):hover {
  box-shadow: var(--glow-emph);
  transform: translateY(-1px);
}

.primary-btn:not(:disabled):active {
  transform: translateY(0);
}

/* ─── Secondary buttons (Ledger Repay/Close): match the language ── */
.secondary-btn {
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

@media (hover: hover) {
  .secondary-btn:hover:not(:disabled) {
    box-shadow: var(--glow-soft);
    transform: translateY(-1px);
  }
}

/* ─── Floor banner: slow gold border-glow breathing ─────────────── */
.floor-banner {
  position: relative;
  transition: box-shadow var(--transition-slow);
}
.floor-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(200, 166, 83, 0.04);
  animation: floor-glow 6s ease-in-out infinite;
}
@keyframes floor-glow {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ─── Nav link: subtle slide-in highlight on hover ──────────────── */
@media (hover: hover) {
  .nav-link {
    transition:
      color var(--transition-fast),
      background var(--transition-fast),
      transform var(--transition-fast);
  }
  .nav-link:not(.active):hover {
    transform: translateX(2px);
  }
}

/* ─── Tab buttons: underline grows in instead of snapping ───────── */
.tab {
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}

/* ─── Token input: focus state gets a soft gold ring ────────────── */
.token-input,
input.token-input {
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.token-input:focus,
input.token-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(200, 166, 83, 0.18);
}

/* ─── Duration buttons: match the rest ──────────────────────────── */
.dur-btn {
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}
@media (hover: hover) {
  .dur-btn:not(:disabled):not(.active):hover {
    border-color: rgba(200, 166, 83, 0.6);
    transform: translateY(-1px);
  }
}

/* ─── Tier badge: subtle scale-in on update ─────────────────────── */
.tier-badge {
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

/* ─── Respect users who prefer reduced motion ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
