/* MARKETS · the app's own parts on top of the builder's site.css (tokens: --bg --bg2 --bg3 --ink --ink2 --ink3 --line --line2 --accent,
   type: --f-display --f-body --f-mono). Owner: the Stage chat. YES / NO = the only colours. */
:root { --yes: #0b8f5f; --no: #d8383f; --yes-soft: color-mix(in srgb, var(--yes) 11%, var(--bg)); --no-soft: color-mix(in srgb, var(--no) 10%, var(--bg)); --warn: #b26a00; }
body { font-variant-numeric: tabular-nums; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---- the rail: CA slot, Sign in, the signed-in wallet ---- */
.L-rail .nav .links a.on { color: var(--ink); background: var(--bg3); }
.L-rail .rail-foot .ca { display: flex; height: 38px; padding: 0 6px 0 12px; gap: 8px; }
.L-rail .rail-foot .ca button { all: unset; cursor: pointer; flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.L-rail .rail-foot .ca a { width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r); color: var(--ink2); }
.L-rail .rail-foot .ca a:hover { background: var(--bg3); color: var(--ink); }
.btn[data-signin].is-in { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.btn[data-signin] [data-me-label] { font-family: var(--f-body); }
.btn[data-signin].is-in [data-me-label] { font-family: var(--f-mono); font-size: 13px; }
@media (max-width: 900px) {
  .L-rail .nav.rail { position: sticky; top: 0; z-index: 60; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 10px 14px; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
  .L-rail .nav.rail .brand { margin-right: auto; }
  .L-rail .rail-foot { display: flex !important; margin: 0; gap: 8px; align-items: center; }
  .L-rail .rail-foot .ca, .L-rail .rail-foot .k.live { display: none; }
  .L-rail .rail-foot .row { gap: 6px; } .L-rail .rail-foot .btn { height: 36px; padding: 0 14px; flex: none; }
  .L-rail .rail-foot .x { width: 36px; height: 36px; }
  .L-rail .nav .links { display: flex !important; flex-direction: row; order: 3; width: 100%; overflow-x: auto; gap: 2px; margin: 0 -6px; scrollbar-width: none; }
  .L-rail .nav .links::-webkit-scrollbar { display: none; }
  .L-rail .nav .links a { flex: none; padding: 6px 10px; font-size: 13.5px; }
  .L-rail .nav .links a i { display: none; }
}

/* ---- app pages ---- */
.app-main { padding: clamp(24px, 4vh, 44px) clamp(16px, 3.4vw, 56px) clamp(56px, 8vh, 96px); max-width: 1480px; }
.app-main h1 { font-family: var(--f-display); font-weight: var(--d-w); letter-spacing: var(--d-ls); font-size: clamp(28px, 2.8vw, 44px); line-height: 1.06; margin: 0; }
.app-main h2 { font-family: var(--f-display); font-weight: 600; font-size: 20px; letter-spacing: -.01em; margin: 0 0 14px; }
.app-main p { color: var(--ink2); }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink3); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--ink2); } .crumbs a:hover { color: var(--ink); }
.panel { border-radius: var(--r2); box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); padding: 18px; min-width: 0; }
.panel + .panel { margin-top: 14px; }
.panel h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.panel h2 small { font-family: var(--f-body); font-weight: 400; font-size: 13px; color: var(--ink3); }
.lab { font-size: 12px; color: var(--ink3); }
.empty { padding: 28px 14px; text-align: center; color: var(--ink2); font-size: 14.5px; line-height: 1.5; }
.y-c { color: var(--yes); } .n-c { color: var(--no); } .w-c { color: var(--warn); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r); font-size: 12px; font-weight: 600; background: var(--bg2); color: var(--ink2); white-space: nowrap; }
.pill.y { background: var(--yes-soft); color: var(--yes); } .pill.n { background: var(--no-soft); color: var(--no); } .pill.v { background: var(--bg2); color: var(--ink2); }
.pill.live { background: var(--bg2); color: var(--ink); } .pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--yes); margin-right: 6px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.ghost.sm { box-shadow: inset 0 0 0 1px var(--line2); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.y { background: var(--yes); color: #fff; } .btn.n { background: var(--no); color: #fff; }

/* tables: dense rows, numbers right */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; } .tbl td.r { font-family: var(--f-mono); }
.tbl td.wrap { white-space: normal; min-width: 180px; }
.tbl a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.tbl a:hover { text-decoration-color: var(--ink); }
.tbl-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }

/* tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r2); background: var(--bg2); }
.tabs button { height: 30px; padding: 0 12px; border-radius: var(--r); font-size: 13.5px; color: var(--ink2); cursor: pointer; }
.tabs button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 0 0 1px var(--line); }

/* ---- the market page ---- */
.mk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.mk-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.mk-head img, .mk-head .ph { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex: none; }
.mk-head .ph { display: grid; place-items: center; font-family: var(--f-mono); font-size: 13px; color: var(--ink3); }
.mk-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink3); margin-top: 8px; align-items: center; }
.mk-sub a { color: var(--ink2); } .mk-sub a:hover { color: var(--ink); }
.mk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); padding: 1px; margin-bottom: 14px; }
.mk-stats > div { padding: 12px 14px; min-width: 0; background: var(--bg); }
.mk-stats b { display: block; font-family: var(--f-mono); font-weight: 500; font-size: clamp(16px, 1.2vw, 18px); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-box { position: relative; height: clamp(260px, 40vh, 420px); }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.chart-read { position: absolute; top: 8px; left: 10px; font-family: var(--f-mono); font-size: 12px; color: var(--ink2); pointer-events: none; background: color-mix(in srgb, var(--bg) 88%, transparent); padding: 2px 6px; border-radius: var(--r); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink3); font-size: 14px; text-align: center; padding: 20px; }
.chart-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink3); margin-top: 10px; }
.chart-key i { display: inline-block; width: 14px; height: 0; border-top: 1.5px dashed var(--ink2); vertical-align: middle; margin-right: 6px; }
.chart-key i.band { height: 10px; border: 0; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.chart-key i.band2 { height: 10px; border: 0; background: color-mix(in srgb, var(--yes) 12%, transparent); }
.chart-key i.line { border-top: 1.5px solid var(--ink); }
.chart-key i.held { border-top: 2.4px solid var(--yes); }

/* the bet box */
.bet { position: sticky; top: 18px; }
.bet .odds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bet .side { all: unset; cursor: pointer; border-radius: var(--r2); padding: 12px 12px 10px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 4px; transition: box-shadow .2s, background .2s; }
.bet .side b { font-family: var(--f-mono); font-size: 22px; font-weight: 600; }
.bet .side span { font-size: 12px; color: var(--ink3); }
.bet .side.y b { color: var(--yes); } .bet .side.n b { color: var(--no); }
.bet .side.y.on { background: var(--yes-soft); box-shadow: inset 0 0 0 1.5px var(--yes); } .bet .side.n.on { background: var(--no-soft); box-shadow: inset 0 0 0 1.5px var(--no); }
.bet .side:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bet .amt { margin-top: 14px; display: flex; align-items: center; gap: 8px; border-radius: var(--r2); box-shadow: inset 0 0 0 1px var(--line2); padding: 0 12px; height: 50px; }
.bet .amt input { all: unset; flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 20px; }
.bet .amt span { color: var(--ink3); font-size: 14px; }
.bet .presets { display: flex; gap: 6px; margin-top: 8px; }
.bet .presets button { flex: 1; height: 30px; border-radius: var(--r); font-size: 13px; background: var(--bg2); color: var(--ink2); cursor: pointer; font-family: var(--f-mono); }
.bet .presets button:hover { color: var(--ink); background: var(--bg3); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 14px 0 0; font-size: 13.5px; }
.kv dt { color: var(--ink3); } .kv dd { margin: 0; text-align: right; font-family: var(--f-mono); color: var(--ink); white-space: nowrap; }
.kv dd.big { font-size: 16px; font-weight: 600; }
.bet .go { width: 100%; justify-content: center; margin-top: 14px; height: 50px; font-size: 15.5px; font-weight: 600; }
.bet .msg { margin-top: 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink2); min-height: 1.45em; }
.bet .msg.err { color: var(--no); } .bet .msg.ok { color: var(--yes); }
.bet .closed { text-align: center; padding: 18px 8px 6px; color: var(--ink2); font-size: 14px; }
.bet .closed b { display: block; font-family: var(--f-display); font-size: 26px; color: var(--ink); margin-bottom: 6px; }
.rules-list { margin: 0; padding: 0 0 0 18px; color: var(--ink2); font-size: 14px; line-height: 1.55; }
.rules-list li + li { margin-top: 6px; }
.rules-list b { color: var(--ink); font-weight: 600; }

/* ---- proof ---- */
.proof-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border-radius: var(--r2); box-shadow: inset 0 0 0 1px var(--line); margin: 18px 0 14px; }
.proof-top > div { padding: 12px 14px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); min-width: 0; }
.proof-top b { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 15px; line-height: 1.4; margin-top: 4px; overflow-wrap: anywhere; }   /* values wrap: a cut date or count reads as broken */
.verdict { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.hash { font-family: var(--f-mono); font-size: 12px; color: var(--ink3); word-break: break-all; }
tr.dropped td { color: var(--ink3); text-decoration: line-through; text-decoration-color: var(--line2); }
tr.dropped td:last-child { text-decoration: none; }

/* ---- me / reserves ---- */
.me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
.stat-big { font-family: var(--f-mono); font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.02em; }
.res-bar { height: 10px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin: 12px 0 8px; display: flex; }
.res-bar i { display: block; height: 100%; background: var(--ink); } .res-bar i.short { background: var(--no); }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form .amt { flex: 1; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--r2); box-shadow: inset 0 0 0 1px var(--line2); }
.inline-form input { all: unset; flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 15px; }
.signin-card { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.signin-card .btn { margin-top: 18px; }

/* ---- the sign-in sheet + toasts ---- */
.sheet-bg { position: fixed; inset: 0; z-index: 200; background: rgba(10, 12, 16, .42); display: grid; place-items: center; padding: 16px; animation: fade .2s ease both; }
.sheet { width: min(420px, 100%); max-height: calc(100svh - 32px); overflow: auto; background: var(--bg); border-radius: var(--r2); padding: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4), inset 0 0 0 1px var(--line); }
.sheet h3 { margin: 0 0 4px; font-family: var(--f-display); font-size: 20px; }
.sheet p { margin: 0 0 14px; font-size: 14px; color: var(--ink2); line-height: 1.5; }
.sheet .wl { display: grid; gap: 8px; }
.sheet .wl button, .sheet .wl a { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: var(--r2); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.sheet .wl button:hover, .sheet .wl a:hover { background: var(--bg2); }
.sheet .wl img { width: 26px; height: 26px; border-radius: 6px; }
.sheet .wl em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--ink3); }
.sheet .x2 { float: right; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); cursor: pointer; }
.sheet .x2:hover { background: var(--bg2); }
.sheet .st { margin-top: 12px; font-size: 13.5px; color: var(--ink2); min-height: 1.4em; }
.sheet .st.err { color: var(--no); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r2); font-size: 14px; max-width: calc(100vw - 32px); animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* the coin page reuses the board; its strip is the board's (hidden: the coin's own numbers sit above) */
.app-c .tote .tt-strip { display: none; }
.app-c .hero-visual { position: relative; inset: auto; z-index: auto; }   /* the board part on the coin page flows in its panel (the home hero places it itself) */

@media (max-width: 1500px) { .mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .mk-grid { grid-template-columns: 1fr; } .bet { position: static; } }
@media (max-width: 760px) {
  .app-main { padding: 18px 14px 64px; }
  .mk-stats { grid-template-columns: 1fr 1fr; }
  .panel { padding: 14px; } .tbl-wrap { margin: 0 -14px; padding: 0 14px; }
  .tbl { font-size: 13px; } .tbl td, .tbl th { padding: 8px 7px; }
  .hide-sm { display: none; }
}

/* the base rate beside the odds (market page) and the data holes of a settled market */
.base-box { margin-top: 12px; padding: 12px; border-radius: var(--r2); background: var(--bg2); }
.base-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.base-h b { font-size: 18px; font-weight: 600; color: var(--ink); }
.base-box p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink2); }
.base-box p.lab { color: var(--ink3); font-size: 11.5px; }
.base-l { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.base-l li { display: grid; grid-template-columns: minmax(0, 1fr) 54px 50px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink3); }
.base-l li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.base-l li i { height: 5px; border-radius: 99px; background: var(--bg3); overflow: hidden; display: block; }
.base-l li i b { display: block; height: 100%; background: var(--ink3); border-radius: 99px; }
.base-l li em { font-style: normal; text-align: right; }
.base-l li.on { color: var(--ink); font-weight: 600; } .base-l li.on i b { background: var(--yes); }
.holes { margin-top: 16px; } .holes h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }

/* phone first: in one column the bet box follows the question and its numbers, before the chart and the lists */
@media (max-width: 1100px) {
  .mk-grid > div:first-child { display: contents; }
  .mk-grid > div:first-child > * { order: 3; margin: 0; }
  .mk-grid > div:first-child > .mk-head { order: 0; } .mk-grid > div:first-child > .mk-stats { order: 1; } .mk-grid > .bet { order: 2; }   /* specificity above the order: 3 rule */
  .mk-grid .panel + .panel { margin-top: 0; }
}

/* ---- escrow: the payment request (SPEC v1.7 §3b: no login, no wallet connect) ---- */
.addr-f { display: grid; gap: 6px; margin-top: 14px; }
.addr-f input { height: 38px; padding: 0 12px; border-radius: var(--r2); box-shadow: inset 0 0 0 1px var(--line2); border: 0; background: var(--bg); color: var(--ink); font-size: 12.5px; min-width: 0; }
.addr-f input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.pay { margin-top: 14px; padding: 14px; border-radius: var(--r2); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pay-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pay-h b { font-size: 16px; } .pay-h span { font-size: 13px; color: var(--ink3); }
.pay-g { display: grid; grid-template-columns: 164px minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 12px; }
.pay-g img { width: 164px; height: 164px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.pay-rows { display: grid; gap: 8px; min-width: 0; }
.pay-open { justify-content: center; height: 40px; font-size: 14px; }
.pay-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.pay-row b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pay-row .pill { cursor: pointer; border: 0; }
.pay-st { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink3); }
.pay-st li { padding-left: 18px; position: relative; line-height: 1.45; }
.pay-st li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line2); }
.pay-st li.on { color: var(--ink); } .pay-st li.on::before { box-shadow: none; background: var(--ink); animation: tt-pulse 2.4s infinite; }
.pay-st li.done { color: var(--ink2); } .pay-st li.done::before { box-shadow: none; background: var(--yes); }
.pay-st a { color: var(--ink); }
.pay-note { margin: 12px 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--ink2); }
.alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 12.5px; }
.alt a { color: var(--ink3); } .alt a:hover { color: var(--ink); }
@media (max-width: 420px) { .pay-g { grid-template-columns: 1fr; justify-items: center; } .pay-rows { width: 100%; } }
/* the address page and the look-up field */
.lookup { display: flex; gap: 8px; margin-top: 12px; }
.lookup input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: var(--r2); box-shadow: inset 0 0 0 1px var(--line2); border: 0; background: var(--bg); font-family: var(--f-mono); font-size: 13px; color: var(--ink); }
.lookup input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
/* a long row of tabs (the ledger's filters) swipes sideways on a phone instead of pushing the page wider */
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } .tabs button { flex: none; }
