/* Shared by index.html and top.html */
:root {
  --bg: #0e1319; --panel: #161b22; --line: #2a313b; --text: #e6edf3; --muted: #8b949e;
  --good: #3fb950; --bad: #f85149; --accent: #58a6ff;
  --paper: #f4f1e8; --ink: #2b2a27; --ink-muted: #77736a; --ink-good: #1f7a34; --ink-bad: #c93a32;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* layout rules below must not resurrect hidden blocks */
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

header { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.xlink { color: var(--muted); text-decoration: none; font-size: 15px; }
.xlink:hover { color: var(--text); }
header nav { display: flex; gap: 20px; }
.brand { white-space: nowrap; }

.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: start; padding: 48px 0 72px; } /* top-aligned: pill and title sit at the same spot on every page */
.pill-label { display: inline-block; font-size: 13px; color: var(--accent); border: 1px solid rgba(88, 166, 255, .4); border-radius: 999px; padding: 3px 12px; margin-bottom: 20px; }
h1 { font-size: 52px; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 20px; }
h1 span { color: var(--good); }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }

#form { display: flex; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
#form:focus-within { border-color: var(--accent); }
#wallet { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 12px; outline: none; }
button, .btn { border: 0; border-radius: 8px; background: var(--accent); color: #0b0f14; font: 600 16px system-ui, sans-serif; padding: 12px 20px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
button:disabled { opacity: .6; cursor: wait; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.trust { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 12px; }
#error { color: var(--bad); min-height: 24px; margin-top: 8px; }

/* Paper receipt, used for the example and for the real result */
.paper { position: relative; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 15px; padding: 24px 24px 20px; border-radius: 6px 6px 0 0; font-variant-numeric: tabular-nums; }
.paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 14px 10px repeat-x,
              linear-gradient(225deg, var(--paper) 50%, transparent 50%) 0 0 / 14px 10px repeat-x; }
.paper .title { text-align: center; font-weight: 700; letter-spacing: .12em; margin-bottom: 4px; }
.paper .sub-title { text-align: center; color: var(--ink-muted); font-size: 13px; margin-bottom: 14px; }
.rule { border-top: 2px dashed #c4bfb3; margin: 12px 0; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.row.indent { padding-left: 16px; } .row.indent2 { padding-left: 32px; color: var(--ink-muted); font-size: 14px; }
.row b { font-weight: 700; }
.row.total { align-items: baseline; font-weight: 700; }
.row.total .big { font-size: 34px; }
.paper .good { color: var(--ink-good); } .paper .bad { color: var(--ink-bad); }
.example { transform: rotate(2deg); max-width: 380px; justify-self: center; width: 100%; }
.example-caption { text-align: center; color: var(--muted); font-size: 14px; margin-top: 22px; transform: rotate(2deg); }

/* After a check the hero shrinks to a one-column search bar above the receipt */
/* Same container width on every page and state; only the content inside changes */
.hero.compact { grid-template-columns: 1fr; padding: 12px 0 28px; }
.hero.compact #form, .hero.compact #error, .hero.compact .trust { max-width: 680px; }
.hero.compact h1 { font-size: 30px; } .hero.compact .lead, .hero.compact .pill-label { display: none; }

/* Result */

/* Result: receipt on the left, one action panel on the right; on phones the panel goes under the receipt.
   Blocks change their content in place, they don't appear above the receipt, so nothing jumps. */
#result { padding: 8px 0 40px; }
.shared { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; align-items: start; }
.result-receipt { position: sticky; top: 16px; }
#unpriced { margin: 20px 0 0; }
.rank-line { text-align: center; font-size: 13px; color: var(--ink-muted); margin-top: 10px; }
.rank-line a { color: var(--ink); }
.verified-stamp { text-align: center; color: var(--ink-good); font-weight: 700; font-size: 13px; letter-spacing: .1em; margin: -2px 0 6px; }
.badge-ok { color: var(--good); margin-left: 4px; }
.good-text { color: var(--good); }
#verdict { font-size: 28px; line-height: 1.2; margin: 4px 0 14px; }
.owner { min-height: 44px; margin-bottom: 18px; }
#owner-ask { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.small-btn { padding: 8px 14px; font-size: 15px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
#owner-status .link-btn { font-size: 14px; }
.owner p { margin: 6px 0 0; } .owner p:empty { display: none; }
.err-text { color: var(--bad); margin: 6px 0 0; }
.actions { display: flex; gap: 10px; }
.actions .btn:first-child { flex: 2; } .actions .btn { flex: 1; }
.duel { border: 0; padding: 12px 0 0; }
.duel summary { font-weight: 500; color: var(--accent); }
#duel-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#duel-form input, .wl-row input { flex: 1 1 160px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; padding: 11px 12px; }
#duel-form input:focus, .wl-row input:focus { outline: none; border-color: var(--accent); }
.duel table td:first-child { color: var(--muted); }
.duel-verdict { font-weight: 700; margin: 12px 0; }
.waitlist { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 24px 0 0; }
.waitlist h3 { font-size: 18px; line-height: 1.3; margin: 0 0 4px; }
.waitlist > p { margin: 0 0 12px; }
.wl-row { display: flex; gap: 8px; }
.wl-row input#wl-link { font: 13px var(--mono); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
#wl-msg { margin: 8px 0 0; } #wl-msg:empty { display: none; } #wl-msg.err { color: var(--bad); }
.wl-done .place { margin: 0 0 10px; }
.wl-done .place b { font-size: 32px; color: var(--accent); font-variant-numeric: tabular-nums; }
.wl-done p { margin: 10px 0 0; }
.fine { font-size: 12px; color: var(--muted); margin: 10px 0 0 !important; }
.pools-details { margin-top: 32px; }
#card, #duel-card { display: none; }
/* A wallet with no positions: just the verdict and the waitlist */
#result.empty .result-receipt, #result.empty .actions, #result.empty .duel, #result.empty .pools-details { display: none; }
#result.empty .result-grid { grid-template-columns: 1fr; max-width: 640px; }

/* Fold-outs: one quiet panel each, no rules above and below */
details.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
details.panel + details.panel { margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
details.panel[open] > summary::after { content: '−'; }
details.panel p { color: var(--muted); max-width: 46em; }
details.panel[open] > summary { margin-bottom: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 12px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
td:not(:first-child), th:not(:first-child) { text-align: right; white-space: nowrap; }
td.good { color: var(--good); } td.bad { color: var(--bad); }
.tag { font-size: 12px; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; }

.more { padding: 0 0 40px; }
footer { padding: 32px 0 40px; font-size: 13px; color: var(--muted); }
footer a { color: var(--muted); }

@media (max-width: 860px) {
  .result-grid { grid-template-columns: 1fr; gap: 24px; }
  .result-receipt { position: static; max-width: 460px; width: 100%; margin: 0 auto; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 24px 0 48px; }
  h1 { font-size: 36px; }
  .lead { font-size: 17px; }
  .example, .example-caption { transform: none; }
}
@media (max-width: 520px) {
  header nav .xlink + .xlink { display: none; } /* phones: keep one nav link next to the logo */
  #form { flex-direction: column; }
  #verdict { font-size: 22px; }
  .waitlist { padding: 16px; }
}
