/* Editorial cover layout — quiet, reserved, matte. Gold only as a mark. */
:root {
  --cream: #f1eee8;
  --paper: #f7f5f0;
  --foam: #f3f0ea;
  --ink: #1b1815;
  --brown: #1b1815;
  --brown-soft: #6b655e;
  --gold: #8e7a61;
  --gold-bright: #9a866c;
  --gold-dim: rgba(142, 122, 97, 0.12);
  --line: #d8d3cb;
  --line-soft: #e6e2db;
  --rust: #6e433c;
  --good: #3d4a40;
  --ok-bg: #eef0ed;
  --warn-bg: #f3f0ea;
  --fail-bg: #f3eeea;
  --shadow: 0 22px 56px rgba(27, 24, 21, 0.045);
  --radius: 2px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", "PMingLiU", "Songti TC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  min-height: 100%;
  background-color: var(--cream);
  scroll-padding-top: var(--header-offset, 160px);
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  max-width: 100%;
  position: relative;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse 70% 22% at 16% 8%, rgba(142, 122, 97, 0.07), transparent 72%),
    radial-gradient(ellipse 60% 18% at 88% 20%, rgba(27, 24, 21, 0.03), transparent 70%),
    radial-gradient(ellipse 80% 24% at 12% 52%, rgba(247, 245, 240, 0.9), transparent 74%),
    radial-gradient(ellipse 70% 18% at 90% 78%, rgba(142, 122, 97, 0.05), transparent 72%),
    repeating-linear-gradient(0deg, rgba(27, 24, 21, 0.016) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(27, 24, 21, 0.012) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(45deg, rgba(142, 122, 97, 0.02) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #f4f1eb 0%, #f1eee8 22%, #efebe4 52%, #ece7df 78%, #f3f0ea 100%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, no-repeat;
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 260px 260px, 260px 260px, 180px 180px, 100% 100%;
  background-attachment: scroll;
  font-family: var(--sans);
  line-height: 1.8;
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #e4ded4; color: var(--ink); }

img { max-width: 100%; height: auto; }
a { color: var(--ink); }
a:hover { color: #2a2622; }
.skip-link { position: absolute; left: -999px; top: 8px; }
.skip-link:focus { left: 8px; background: var(--paper); padding: 8px 12px; z-index: 20; }

.notice {
  margin: 0;
  padding: 14px 18px;
  text-align: center;
  font-weight: 600;
  line-height: 1.6;
  background: var(--ink);
  color: var(--cream);
}

.wrap {
  width: min(1100px, calc(100% - 48px));
  margin-inline: auto;
}

/* Thin gallery header: wordmark, nav and connect on one row */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(241, 238, 232, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(142, 122, 97, 0.22);
}
.site-header-inner {
  display: block;
  padding: 0;
}
.site-header-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 28px;
  width: 100%;
  min-height: 64px;
  padding: 6px 0;
}
.header-connect-btn {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
  min-height: 44px;
  min-width: 96px;
  max-width: min(52vw, 220px);
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  line-height: 1.2;
  z-index: 12;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(142, 122, 97, 0.12);
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  letter-spacing: 0.18em;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
}
.brand img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: cover;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(241, 238, 232, 0.35);
  background: var(--paper);
}
.brand::before {
  content: none;
  display: none;
}
.nav { display: flex; flex: 1 1 auto; gap: 4px 22px; flex-wrap: wrap; align-items: center; }
.nav a {
  text-decoration: none;
  color: var(--brown-soft);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { color: var(--ink); }


/* Mechanical time board — ink drums, ivory figures, copper hairline, locked alignment. */
.time-board {
  --reel-w: 48px;
  --reel-h: 70px;
  --reel-font: 36px;
  margin: 22px auto 8px;
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.time-board-label {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: none;
  color: var(--brown-soft);
  font-weight: 500;
  text-align: center;
  width: 100%;
}
.time-board-unavailable {
  display: none;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--brown-soft);
  text-align: center;
}
.time-board[data-state="unavailable"] .time-board-unavailable { display: block; }
.time-board[data-state="unavailable"] .time-board-units { display: none; }
.time-board[data-state="pending"] .time-board-units { display: none; }
.time-board-units {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0 16px;
  width: auto;
  max-width: 100%;
}
.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}
.time-unit-name {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-weight: 500;
  line-height: 1;
}
.reel-pair {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 3px;
  height: var(--reel-h);
}
.reel {
  display: block;
  width: var(--reel-w);
  height: var(--reel-h);
  flex: 0 0 var(--reel-w);
}
.reel-window {
  position: relative;
  display: block;
  width: var(--reel-w);
  height: var(--reel-h);
  overflow: hidden;
  background: #14110e;
  border: 1px solid rgba(142, 122, 97, 0.55);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(247, 245, 240, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
}
.reel-window::before,
.reel-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}
.reel-window::before {
  top: 0;
  height: 50%;
  border-bottom: 0;
  background: linear-gradient(to bottom, rgba(247, 245, 240, 0.05), rgba(247, 245, 240, 0));
}
.reel-window::after {
  top: 50%;
  bottom: auto;
  height: 1px;
  background: rgba(142, 122, 97, 0.42);
  transform: translateY(-0.5px);
}
.reel-track {
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}
.reel-track span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--reel-w);
  height: var(--reel-h);
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  font-size: var(--reel-font);
  line-height: 1;
  color: #f7f5f0;
}
.time-board[data-state="ready"] .reel-track,
.time-board[data-state="stopped"] .reel-track {
  transition: transform 0.48s cubic-bezier(0.65, 0.05, 0.36, 1);
}
.time-board-inline-label {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--brown-soft);
}
@media (prefers-reduced-motion: reduce) {
  .time-board[data-state="ready"] .reel-track,
  .time-board[data-state="stopped"] .reel-track {
    transition: none;
  }
}

/* First screen: masthead + mint console, not a stack of white cards */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px 80px;
  align-items: start;
  min-height: calc(100svh - 88px);
  padding: 72px 0 88px;
}
.stage-masthead { min-width: 0; padding-top: 12px; }
.stage-emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}
.kicker {
  margin: 0 0 22px;
  color: var(--gold);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 500;
}
h1 {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(44px, 8vw, 76px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.08em;
  color: var(--brown);
  text-align: center;
}
h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 16px auto 0;
  background: var(--gold);
  opacity: 0.7;
}
.stage-seal {
  margin: 0;
  width: 136px;
  height: 136px;
}
.stage-seal img {
  width: 136px;
  height: 136px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(142, 122, 97, 0.48);
  background: #fbfaf7;
  box-shadow:
    0 0 0 6px var(--paper),
    0 0 0 7px rgba(142, 122, 97, 0.32);
  display: block;
}
.fact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 28px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-soft);
  box-shadow: inset 0 1px 0 rgba(142, 122, 97, 0.16);
  color: var(--brown-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}
.fact-line li {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-weight: 500;
}
.fact-line li + li::before {
  content: "·";
  margin: 0 0.7em;
  color: var(--gold);
}
.stage-copy, .hero-copy {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.95;
  max-width: 32em;
  color: #3c3934;
}
#pageStatus { margin: 16px 0 0; font-size: 12px; letter-spacing: 0.06em; }

/* Mint console: paper panel with hairline frame, inset gold line, corner ticks */
.stage-console {
  min-width: 0;
  position: relative;
  padding: 36px 32px 32px;
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 1px rgba(142, 122, 97, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 22px 50px rgba(27, 24, 21, 0.045);
  background-image:
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold));
  background-size: 18px 1px, 1px 18px, 18px 1px, 1px 18px, 18px 1px, 1px 18px, 18px 1px, 1px 18px;
  background-position:
    12px 12px, 12px 12px,
    calc(100% - 12px) 12px, calc(100% - 12px) 12px,
    12px calc(100% - 12px), 12px calc(100% - 12px),
    calc(100% - 12px) calc(100% - 12px), calc(100% - 12px) calc(100% - 12px);
  background-repeat: no-repeat;
}
.stage-console .section-head { margin-bottom: 8px; }
.stage-console .section-head h2 { margin-bottom: 8px; }
.stage-console .quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin: 8px 0 4px;
  border-top: 1px solid var(--line-soft);
}
.stage-console .quote {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 16px 0;
  box-shadow: none;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 28px 26px;
}
.card h2, .section h2, .section h3, .instrument h2, .ledger h2, .rules-index h2, .folio h2, .stage-console h2 {
  margin: 0 0 18px;
  color: var(--brown);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.10em;
}
.section h3 { font-size: 1.15rem; }
.price-tag, .static-flag {
  display: inline-block;
  background: transparent;
  color: var(--brown-soft);
  border: 0;
  border-radius: 0;
  padding: 0 12px 0 0;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.field { margin: 20px 0; }
.field label { display: block; font-weight: 500; margin-bottom: 10px; letter-spacing: 0.08em; }
.stepper, .lookup-row { display: flex; gap: 8px; align-items: center; }
.stepper input, .lookup-row input, button, .locked { font: inherit; }
.stepper input, .lookup-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fbfaf7;
  border-radius: 2px;
  padding: 14px 16px;
  color: var(--ink);
}
.stepper input:focus, .lookup-row input:focus, textarea:focus, button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
.stepper button, .quick button, .btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  background: var(--ink);
  color: #f3f0eb;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.stepper button, .quick button { min-width: 44px; min-height: 44px; position: relative; z-index: 1; touch-action: manipulation; }
.btn { min-height: 48px; }
.btn:disabled, button:disabled {
  cursor: not-allowed;
  background: #d5d0c8;
  color: #7a746c;
  border-color: transparent;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.quick button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.quick button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f3f0eb;
}

.quote-grid, .stat-grid, .lookup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}
.stat, .quote, .rule {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 16px 0;
}
.stat b, .quote b, .lookup-grid b {
  display: block;
  font-size: 11px;
  color: var(--brown-soft);
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.stat span, .quote span { font-size: 1.05rem; letter-spacing: 0.02em; }
.muted, .note { color: var(--brown-soft); font-size: 14px; line-height: 1.8; }
.feedback, .status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 2px;
  background: var(--warn-bg);
  border: 1px solid var(--line-soft);
  color: #3c3934;
}
.status:empty, .feedback:empty { display: none; }
.status-fail { background: var(--fail-bg); border-color: #e0d8d2; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.progress {
  height: 2px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 22px 0 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}

.section, .instrument, .ledger, .rules-index, .folio { padding: 56px 0; }
.section-head { margin-bottom: 24px; }
.section-head .price-tag,
.section-head .static-flag { margin-right: 8px; }

/* Quiet instrument: figures divided by hairlines, no boxed tiles */
.instrument {
  border-top: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(142, 122, 97, 0.22);
}
.instrument-figures,
.stat-grid.instrument-figures {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 8px 0 4px;
  border-top: 1px solid var(--line-soft);
}
.instrument-figures .stat {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 14px 16px 14px 0;
  box-shadow: none;
}
.instrument-figures .stat:last-child { border-right: 0; padding-right: 0; }

.ledger { border-top: 1px solid var(--line-soft); }
.lookup-grid {
  border-top: 1px solid var(--line-soft);
  margin-top: 8px;
}
.lookup-grid .stat {
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 12px 14px 0;
}

/* Rules as an editorial index, not seven identical cards */
.rules-index { border-top: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(142, 122, 97, 0.22); }
.rule-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
  counter-reset: rule;
}
.rule-index .rule {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 22px 0 20px;
  color: #3c3934;
  font-size: 14px;
  line-height: 1.85;
}
.rule-index .rule b {
  display: block;
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.tag {
  display: inline-block;
  font-size: 10px;
  padding: 0 0 0 10px;
  border: 0;
  border-radius: 0;
  background: none;
  margin-left: 4px;
  letter-spacing: 0.14em;
  color: var(--brown-soft);
  font-weight: 500;
  font-family: var(--sans);
}

.folio { border-top: 1px solid var(--line-soft); }
details.faq {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 4px 0;
  margin: 0;
}
.folio .section-head { border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(142, 122, 97, 0.18); padding-bottom: 16px; }
details.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brown);
  letter-spacing: 0.04em;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.45;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.contracts { display: flex; flex-wrap: wrap; gap: 10px; }
.contracts a {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.03em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer {
  border-top: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(142, 122, 97, 0.22);
  padding: 48px 0 64px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  color: var(--brown-soft);
  font-size: 13px;
  letter-spacing: 0.03em;
  line-height: 1.95;
}
.footer strong { color: var(--brown); font-weight: 600; }
.footer-media { margin: 18px 0 0; }


.lookup-mintable b { color: var(--brown); }
.lookup-mintable span { font-weight: 700; }
.lookup-row .btn, .lookup-row .btn-ghost { flex: 0 0 auto; white-space: nowrap; }
.section, .card, .instrument, .ledger, .stage, .stage-console { min-width: 0; }

body, p, li, .muted, .note, .hero-copy, .rule, .stat, .quote, summary, .notice, .status, .feedback {
  overflow-wrap: break-word;
  word-break: break-word;
}
#forge, #ai-draft, #scan, #progress, #lookup, #rules, #faq,
#forge h1, #ai-title, #scan-title, #progress-title, #lookup-title, #rules-title, #faq-title,
.section-head, .kicker {
  scroll-margin-top: max(var(--header-offset, 160px), calc(env(safe-area-inset-top, 0px) + var(--header-offset, 160px)));
}

.scan-connected-status { font-weight: 700; color: var(--brown); margin: 0 0 8px; font-size: 15px; }
.mint-actions { align-items: center; margin: 12px 0 8px; }
.refund-actions { margin-top: 10px; }

@media (max-width: 900px) {
  .stage {
    display: flex;
    flex-direction: column;
    gap: 36px;
    min-height: 0;
    padding: 40px 0 48px;
  }
  h1 { font-size: clamp(36px, 10vw, 52px); }
  .stage-seal, .stage-seal img { width: 120px; height: 120px; }
  .time-board { --reel-w: 40px; --reel-h: 60px; --reel-font: 30px; }
  .time-board-units { gap: 0 12px; }
  .stage-console { padding: 28px 20px 24px; }
  .instrument-figures,
  .stat-grid.instrument-figures,
  .rule-index,
  .quote-grid, .stat-grid, .lookup-grid { grid-template-columns: 1fr 1fr; }
  .instrument-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .instrument-figures .stat {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 14px 12px 14px 0;
  }
}

@media (max-width: 360px) {
  .stage-seal, .stage-seal img { width: 108px; height: 108px; }
  .time-board { --reel-w: 30px; --reel-h: 46px; --reel-font: 22px; }
  .time-board-units { gap: 0 6px; }
  .reel-pair { gap: 2px; }
}

@media (max-width: 800px) {
  .wrap { width: min(1100px, calc(100% - 24px)); }
  .site-header-top { min-height: 56px; flex-wrap: wrap; }
  .nav { flex: 1 1 100%; order: 3; gap: 0 16px; }
  .nav a { flex: 0 0 auto; white-space: nowrap; }
  .header-connect-btn { font-size: 12px; padding: 10px 12px; min-height: 44px; }
  .brand img { width: 22px; height: 22px; }
  .time-board { --reel-w: 36px; --reel-h: 54px; --reel-font: 26px; }
  .time-board-units { gap: 0 8px; }
  .stage-seal, .stage-seal img { width: 120px; height: 120px; }
  .card { padding: 22px 18px; }
  .section, .instrument, .ledger, .rules-index, .folio { padding: 40px 0; }
  .section-head { margin-bottom: 16px; }
  .rule-index, .quote-grid, .stat-grid, .lookup-grid { grid-template-columns: 1fr; }
  .actions .btn, .actions .btn-ghost { width: 100%; }
  input, textarea, #shareInput, #lookupHandleInput { font-size: 16px; }
}


.readonly-output.draft {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 16rem;
  margin: 0.75rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line, #d8d3cb);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-x: auto;
  resize: vertical;
}
.status-ok { color: var(--good); }
.status-blocked { color: var(--rust); }
.lookup-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: stretch; }
.lookup-row input { flex: 1 1 16rem; }
.lookup-mintable span { font-weight: 700; }

#inviteLinkCard { margin-top: 18px; }
#inviteLinkInput {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0.5rem 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line, #ddd4c6);
  border-radius: 12px;
  background: #fff;
  font: 0.85rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
#invite-link-title { margin: 0 0 8px; color: var(--brown, inherit); }

.actions[hidden], #inviteBindActions[hidden], #inviteLinkCard[hidden], #lookupResult[hidden] {
  display: none !important;
}

.qr-stage { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 8px 0 0; }
.qr-box { min-height: 80px; padding: 16px; border: 1px solid var(--line, #ddd4c6); border-radius: 16px 16px 0 0; margin: 0; background: #fff; }
.qr-identity-panel {
  margin: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 16px 16px;
  background: var(--foam);
  color: var(--ink);
}
.qr-identity-row { display: flex; gap: 12px; align-items: baseline; margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
.qr-identity-label { flex: 0 0 4.2em; font-weight: 600; color: var(--brown-soft); }
.qr-identity-code, .qr-identity-status { display: block; margin: 0 0 8px; font-size: 16px; font-weight: 700; line-height: 1.45; color: var(--ink); }
.qr-identity-note { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--brown-soft); }
.qr-identity-panel[data-identity-state="live"] .qr-identity-code { color: var(--ink); }
.qr-svg { display: flex; justify-content: center; padding: 8px; }
.qr-svg svg { width: 220px; height: 220px; background: #fff; }
@media (max-width: 360px) {
  .stage-seal, .stage-seal img { width: 108px; height: 108px; }
  .time-board { --reel-w: 30px; --reel-h: 46px; --reel-font: 22px; }
  .time-board-units { gap: 0 6px; }
  .reel-pair { gap: 2px; }
}

@media (max-width: 800px) {
  .qr-svg svg { width: min(220px, 72vw); height: auto; aspect-ratio: 1; }
  .qr-identity-code, .qr-identity-status { font-size: 16px; }
}
#quoteDetail { white-space: pre-wrap; word-break: break-word; }

.qr-pairing-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  user-select: all;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0.4rem 0;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: rgba(27, 24, 21, 0.035);
}

.scan-connected-panel {
  margin: 0 0 8px;
  padding: 0;
  border: none;
  background: transparent;
}
.scan-invite-label {
  display: block;
  font-weight: 600;
  color: var(--brown);
  margin: 8px 0 6px;
  font-size: 14px;
}
#scanInviteLinkInput {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
}

.refund-actions { margin-top: 10px; }
.mint-actions { margin: 12px 0 8px; }

.connect-modal[hidden] { display: none !important; }
.connect-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px 16px;
  box-sizing: border-box;
}
.connect-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.42);
}
.connect-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(90vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(20, 16, 12, 0.20);
  padding: 18px 18px 22px;
  margin-top: 12px;
}
.connect-modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brown);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.connect-chooser h2,
.connect-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-family: var(--serif);
  letter-spacing: 0.06em;
}
.connect-chooser { padding-top: 4px; }
.connect-chooser-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.connect-panel .card { margin: 0; box-shadow: none; border: 0; padding: 0; background: transparent; }
.connect-panel .section-head { margin-bottom: 10px; }

.refund-modal-dialog {
  width: min(100%, 560px);
}
.refund-modal-actions { margin-top: 12px; }
#refundStatus,
#refundModalStatus {
  overflow: visible;
  max-height: none;
  white-space: normal;
  text-overflow: unset;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.55;
}
.refund-help {
  display: block;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--fail-bg);
  border: 1px solid var(--line);
  overflow: visible;
  max-height: none;
  white-space: normal;
  text-overflow: unset;
  overflow-wrap: break-word;
  word-break: break-word;
}
.refund-help[hidden] { display: none !important; }
.refund-help-reason {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--brown);
  overflow: visible;
  max-height: none;
  white-space: normal;
  text-overflow: unset;
}
.refund-help-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--brown);
}
.refund-help-method {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--brown);
  overflow: visible;
  max-height: none;
  white-space: normal;
  text-overflow: unset;
  overflow-wrap: break-word;
  word-break: break-word;
}
.refund-help.refund-help-settled {
  background: var(--ok-bg, #eef5f0);
}
#refundStatus.status-ok,
#refundModalStatus.status-ok {
  background: var(--ok-bg, #eef5f0);
  color: var(--good);
}
body.connect-modal-open,
body.refund-modal-open { overflow: hidden; }

@media (max-width: 390px) {
  .connect-modal { padding: 8px; }
  .connect-modal-dialog {
    width: 100%;
    max-height: 92vh;
    margin-top: 4px;
    padding: 12px 12px 16px;
    border-radius: 12px;
  }
  .connect-chooser-actions .btn { flex: 1 1 140px; min-height: 44px; }
}

.settle-rules { margin-top: 1.25rem; }
.settle-list { margin: 0.5rem 0 1rem; padding-left: 1.25rem; }
.settle-list li { margin: 0.35rem 0; }

pre.readonly-output {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
