/* ---------- 01 hero + calculator ---------- */
.hero { padding: 28px 0 0; }
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.hero-no { grid-column: 1 / -1; grid-row: 1; display: flex; justify-content: space-between; gap: 16px; margin: 0 0 14px; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; }
.hero-no b { color: var(--cobalt-text); }
.hero h1 { grid-column: 1 / span 9; grid-row: 2; margin: 0 0 24px; font-size: clamp(30px, 4.05vw, 54px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 700; max-width: 17.5em; }
.hero-sub { grid-column: 10 / span 3; grid-row: 2; align-self: end; margin: 0 0 26px; font-size: 15px; line-height: 1.42; }

.calc { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; border-top: var(--rule) solid var(--ink); margin: 0; }
.calc-in { grid-column: 1 / span 7; padding: 22px 8px 26px 0; display: flex; flex-direction: column; gap: 18px; }
.calc-out { grid-column: 8 / span 5; border-left: var(--rule) solid var(--ink); padding: 22px 0 24px 28px; display: flex; flex-direction: column; min-width: 0; }
fieldset.f { border: 0; padding: 0; margin: 0; min-width: 0; }
.f legend, .f > label.lbl { display: block; padding: 0; margin-bottom: 8px; }
.f-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.f-head .lbl { margin: 0; }
.f-head .hint { font-family: var(--mono); font-size: 12px; color: var(--grey); }

/* selected stock line (phones) + segment short labels */
.chip-sel { display: none; font-family: var(--mono); font-size: 11.5px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.seg .sh { display: none; }
.chip { transition: background-color 120ms, color 120ms; }
.quick button, .seg button { transition: background-color 120ms; }

/* curl loading skeleton */
.res pre.loading { display: flex; flex-direction: column; gap: 10px; }
.sk { display: block; height: 11px; width: 72%; background: var(--wash); }
.sk.s { width: 44%; }
@media (prefers-reduced-motion: no-preference) { .sk { animation: skp 1.1s ease-in-out infinite alternate; } }
@keyframes skp { from { opacity: 1; } to { opacity: 0.45; } }

/* plan summary strip */
.plan-sum { margin: auto 0 0; padding-top: 12px; border-top: 2px solid var(--ink); font-family: var(--mono); font-size: 13px; line-height: 1.5; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.plan-sum b { font-weight: 600; }
.plan-sum .muted { color: var(--grey); }

/* stock chips */
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.chip { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 56px; padding: 7px 10px 9px; background: var(--bg); border: 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); cursor: pointer; text-align: left; min-width: 0; }
.chip .sym { font-family: var(--mono); font-weight: 600; font-size: 16px; letter-spacing: 0.01em; line-height: 1.15; }
.chip .nm { font-size: 12px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.2; }
.chip .thin { position: absolute; top: 6px; right: 6px; font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border: 1.5px solid currentColor; padding: 0 4px; line-height: 1.45; }
.chip:hover { background: var(--wash); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: inset 0 -5px 0 var(--cobalt); }
.chip[aria-pressed="true"] .nm { color: #CFCFCF; }

/* amount */
.amt-row { display: flex; gap: 12px; align-items: stretch; }
.amt-box { display: flex; align-items: center; border: 2px solid var(--ink); height: 56px; flex: 1 1 auto; min-width: 0; max-width: 260px; }
.amt-box:focus-within { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.amt-box input { border: 0; outline: 0; background: transparent; height: 100%; width: 100%; min-width: 0; padding: 0 12px; font-family: var(--mono); font-weight: 600; font-size: 28px; font-variant-numeric: tabular-nums; }
.amt-box span { font-family: var(--mono); font-size: 13px; font-weight: 600; padding: 0 12px; border-left: 2px solid var(--ink); height: 100%; display: flex; align-items: center; }
.quick { display: flex; border: 2px solid var(--ink); }
.quick button { min-width: 52px; height: 52px; border: 0; border-left: 2px solid var(--ink); background: var(--bg); font-family: var(--mono); font-weight: 600; font-size: 16px; cursor: pointer; }
.quick button:first-child { border-left: 0; }
.quick button:hover { background: var(--wash); }
.quick button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.amt-err { font-family: var(--mono); font-size: 12.5px; color: var(--cobalt-text); margin: 6px 0 0; min-height: 0; }

/* interval segment */
.seg { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--ink); }
.seg button { height: 48px; border: 0; border-left: 2px solid var(--ink); background: var(--bg); font-weight: 500; font-size: 15.5px; cursor: pointer; padding: 0 6px; line-height: 1.1; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--wash); }
.seg button[aria-pressed="true"] { font-weight: 700; }
.seg-line { position: absolute; left: 0; bottom: -2px; height: 5px; background: var(--cobalt); width: 25%; transition: transform 200ms cubic-bezier(.2,.7,.2,1); pointer-events: none; }

/* output */
.out-lbl { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.big { margin: 0; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.big-in { display: flex; align-items: center; gap: 12px; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; }
.big-in .arr { width: 46px; height: 20px; flex: none; }
.big-out { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 12px; margin-top: 2px; }
.big-out .n { font-size: clamp(40px, 6.4vw, 84px); line-height: 1; color: var(--cobalt); }
.big-out .s { font-size: clamp(22px, 2.6vw, 34px); line-height: 1; letter-spacing: -0.02em; }
.big.dim .n, .big.dim .s, .big.dim .big-in { opacity: 0.38; }
.meta { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; margin: 10px 0 0; color: var(--ink); }
.meta .sep { color: var(--grey); padding: 0 2px; }
.status { font-family: var(--mono); font-size: 12.5px; margin: 6px 0 0; color: var(--cobalt-text); font-weight: 600; }
.warn { font-family: var(--mono); font-size: 12.5px; margin: 8px 0 0; padding: 6px 10px; background: var(--cobalt); color: #fff; }
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.cells > div { padding: 9px 10px 10px 0; min-width: 0; }
.cells > div + div { border-left: 2px solid var(--ink); padding-left: 10px; }
.cells dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--grey); }
.cells dd { margin: 2px 0 0; font-family: var(--mono); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start { margin-top: 18px; min-height: 60px; font-size: 20px; justify-content: space-between; padding: 0 22px; }
.start .arr { width: 30px; height: 16px; }
.needs { margin: 10px 0 0; font-size: 14px; color: var(--grey); }

/* ---------- 02 curl ---------- */
.try { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 16px; }
.try { padding-left: var(--hang); }
.try-cmd { grid-column: 1 / -1; }
.try-res { grid-column: 1 / -1; }
.cmd { display: flex; align-items: stretch; border: 2px solid var(--ink); background: var(--ink); color: #fff; }
.cmd code { flex: 1; min-width: 0; padding: 16px 18px; font-size: 15px; overflow-x: auto; white-space: nowrap; }
.cmd code .p { color: #8C9BFF; user-select: none; }
.cmd button { border: 0; border-left: 2px solid #fff; background: var(--ink); color: #fff; font-family: var(--mono); font-weight: 600; font-size: 13px; padding: 0 18px; min-width: 88px; cursor: pointer; }
.cmd button:hover { background: var(--cobalt); }
.res { border: 2px solid var(--ink); border-top: 0; }
.res-head { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 12px; }
.res pre { margin: 0; padding: 14px; font-family: var(--mono); font-size: 13px; line-height: 1.6; overflow-x: auto; min-height: 120px; }
.res pre .k { color: var(--grey); }
.res pre .v { color: var(--cobalt-text); font-weight: 600; }

/* ---------- 03 live numbers ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.stat { padding: 18px 16px 4px 0; min-width: 0; }
.stat + .stat { border-left: 2px solid var(--ink); padding-left: 18px; }
.stat .v { display: block; font-weight: 700; font-size: clamp(44px, 6vw, 88px); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .v small { font-size: 0.32em; letter-spacing: 0; margin-left: 6px; font-weight: 500; }
.stat .k { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.stats-note { margin: 20px 0 0; font-family: var(--mono); font-size: 13px; color: var(--grey); }
.stats-note .tag { margin-right: 8px; }

/* ---------- 04 how ---------- */
.how { padding-left: var(--hang); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; }
.how-txt { grid-column: 1 / span 7; margin: 0; font-size: 21px; line-height: 1.4; letter-spacing: -0.01em; }
.how-txt span { display: block; margin-bottom: 14px; }
.how-txt span::before { content: attr(data-n); font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--cobalt-text); display: block; margin-bottom: 2px; letter-spacing: 0.06em; }
.how-side { grid-column: 9 / span 4; font-family: var(--mono); font-size: 13px; line-height: 1.6; margin: 0; padding-top: 4px; }
.how-side li { list-style: none; padding: 8px 0; border-top: 1px solid var(--ink); }
.how-side { padding-left: 0; }
.diagram { grid-column: 1 / -1; }
.diagram svg { width: 100%; height: auto; }
.diagram .v { display: none; }

/* ---------- 05 latest buys ---------- */
.buys { border-top: 2px solid var(--ink); }
.buy-row { display: grid; grid-template-columns: 90px 2fr 1.4fr 1fr 110px 24px; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 14px; text-decoration: none; font-variant-numeric: tabular-nums; }
.buy-row:hover { background: var(--wash); color: var(--ink); }
.buy-row .sym { font-weight: 600; font-size: 16px; }
.buy-row .amt b { color: var(--cobalt-text); }
.buy-row .who { color: var(--grey); }
.buy-row .t { color: var(--grey); text-align: right; }
.buy-row .go { text-align: right; }
.more { margin-top: 20px; }

/* ---------- 06 token ---------- */
.tok { padding-left: var(--hang); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 24px; align-items: start; }
.tok-big { grid-column: 1 / span 9; margin: 0; font-size: clamp(26px, 3vw, 40px); line-height: 1.08; font-weight: 700; letter-spacing: -0.025em; }
.tok-small { grid-column: 1 / span 8; margin: 0; font-size: 18px; }
.tiers { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.tier { padding: 14px 16px 16px 0; }
.tier + .tier { border-left: 2px solid var(--ink); padding-left: 16px; }
.tier .cap { display: block; font-weight: 700; font-size: clamp(36px, 4.4vw, 60px); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tier .cap small { font-size: 0.34em; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.tier .req { display: block; margin-top: 8px; font-family: var(--mono); font-size: 12.5px; }
.tier:last-child .cap { color: var(--cobalt); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero h1 { grid-column: 1 / -1; margin-bottom: 18px; }
  .hero-sub { grid-column: 1 / span 9; grid-row: 5; align-self: start; margin: 22px 0 0; }
  .calc { grid-row: 3; column-gap: 20px; }
  .calc-in { grid-column: 1 / span 7; }
  .calc-out { grid-column: 8 / span 5; padding-left: 20px; }
  .chip { padding: 7px 8px 9px; }
  .chip .nm { font-size: 11px; }
  .chip .thin { top: 3px; right: 3px; font-size: 8.5px; padding: 0 3px; border-color: var(--cobalt-text); color: var(--cobalt-text); }
  .chip[aria-pressed="true"] .thin { color: #fff; border-color: #fff; }
  .chip .tp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .out-lbl .opt { display: none; }
  .cells dd { white-space: normal; }
  .hero { padding-bottom: 32px; }
  .big-out .n { font-size: clamp(40px, 6vw, 72px); }
  .cells { grid-template-columns: 1fr 1fr; }
  .cells > div:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 2px solid var(--ink); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 2px solid var(--ink); }
}
@media (max-width: 900px) {
  .amt-row { flex-wrap: wrap; }
  .amt-box { flex: 1 1 140px; }
  .seg button { font-size: 14px; }
  .seg .lg { display: none; } .seg .sh { display: inline; }
  .how-txt { grid-column: 1 / -1; }
  .how-side { grid-column: 1 / -1; }
  .tok-big, .tok-small, .tiers { grid-column: 1 / -1; }
  .buy-row { grid-template-columns: 70px 1fr auto 24px; }
  .buy-row .who, .buy-row .t { display: none; }
}
@media (max-width: 760px) {
  .calc-in { grid-column: 1 / -1; padding-right: 0; }
  .calc-out { grid-column: 1 / -1; border-left: 0; border-top: var(--rule) solid var(--ink); padding: 20px 0 22px; }
  .chip .nm { font-size: 12px; }
}
@media (max-width: 700px) {
  .hero { padding-top: 12px; }
  .hero-grid { column-gap: 12px; }
  .hero-no { display: none; }
  .hero h1 { font-size: 24px; line-height: 1.04; letter-spacing: -0.03em; margin-bottom: 10px; }
  .f-amt .f-head, .f-int legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .out-lbl { display: none; }
  .plan-sum { display: none; }
  .hero-sub { grid-column: 1 / -1; grid-row: 5; margin: 18px 0 8px; font-size: 15px; }
  .calc { grid-row: 3; border-bottom: 0; }
  .calc-in { padding: 10px 0 12px; gap: 10px; }
  .f legend, .f > label.lbl, .f-head { margin-bottom: 6px; }
  .lbl { font-size: 11px; }
  .chips { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .chip { min-height: 44px; padding: 0; align-items: center; }
  .chip .sym { font-size: 14px; }
  .chip .nm { display: none; }
  .chip .thin { position: static; margin-top: 1px; font-size: 8.5px; line-height: 1.3; padding: 0 3px; }
  .chip-sel { display: block; }
  #stocks-state { display: none; }
  .amt-row { gap: 8px; }
  .amt-box { height: 48px; flex: 1 1 0; max-width: none; }
  .amt-box input { font-size: 22px; padding: 0 8px; }
  .amt-box span { padding: 0 8px; font-size: 11.5px; }
  .quick button { min-width: 44px; height: 44px; font-size: 14px; }
  .seg button { height: 44px; font-size: 14px; padding: 0 3px; }
  .calc-out { padding: 10px 0 18px; }
  .out-lbl { margin-bottom: 4px; }
  .out-lbl .opt { display: none; }
  .big-in { font-size: 17px; gap: 8px; }
  .big-in .arr { width: 30px; height: 14px; }
  .big-out { column-gap: 8px; }
  .big-out .n { font-size: 40px; }
  .big-out .s { font-size: 22px; }
  .meta { font-size: 11px; margin-top: 6px; }
  .start { order: 5; margin-top: 10px; min-height: 50px; font-size: 18px; }
  .needs { order: 6; font-size: 13px; }
  .cells { order: 7; margin-top: 14px; }
  .cells > div { padding-right: 6px; }
  .cells > div + div { padding-left: 8px; }
  .cells dt { font-size: 10px; }
  .cells dd { font-size: 12.5px; }
  .cmd code { font-size: 12px; padding: 12px; white-space: normal; word-break: break-all; overflow: visible; line-height: 1.5; }
  .cmd button { min-width: 64px; padding: 0 10px; }
  .res pre { font-size: 12px; }
  .stat .v { font-size: 44px; }
  .stat { padding-right: 8px; }
  .stat + .stat { padding-left: 12px; }
  .how-txt { font-size: 18px; }
  .diagram .h { display: none; }
  .diagram .v { display: block; max-width: 340px; }
  .buy-row { gap: 8px; font-size: 12.5px; grid-template-columns: 50px 1fr auto 16px; }
  .buy-row .sym { font-size: 14px; }
  .tier .req { font-size: 11px; }
  .tier .cap { font-size: 30px; }
  .tier .cap small { display: block; margin: 4px 0 0; font-size: 11px; font-family: var(--mono); }
  .tier { padding-right: 8px; }
  .tier + .tier { padding-left: 8px; }
}
