/* Desk and settlement pages. Same painted title and calm reading surface as the explorer. */
html { -webkit-text-size-adjust:100%; }
body { min-height:100vh; overflow-x:hidden; }
.wrap { width:100%; max-width:1080px; margin:0 auto; padding-left:16px; padding-right:16px; }
a { color:var(--blue); text-underline-offset:3px; }


.painted .wrap { position:relative; }
.painted :focus-visible { outline-color:#fff; }
.title-block { padding-top:clamp(36px, 8vh, 72px); padding-bottom:clamp(36px, 7vh, 64px); }
h1 { font-family:var(--display); font-weight:500; font-size:clamp(46px, 6.4vw, 84px); line-height:1.02; margin:0 0 14px; letter-spacing:-.008em; color:var(--on-sky); max-width:18ch; }
h1.long { font-size:clamp(38px, 4.4vw, 58px); line-height:1.06; max-width:24ch; }
.lede { font-size:clamp(18px, 1.9vw, 21px); line-height:1.45; margin:0; max-width:56ch; color:var(--on-sky-soft); }

h2 { font-family:var(--display); font-weight:500; font-size:clamp(30px, 3vw, 36px); line-height:1.15; margin:0 0 14px; }
h3 { font-weight:600; font-size:19px; margin:36px 0 10px; }
main { padding-top:clamp(28px, 5vh, 48px); padding-bottom:16px; }
.card { background:var(--surface); color:var(--ink); border-radius:var(--radius-lg); box-shadow:var(--shadow-soft); padding:26px 20px; margin:0 0 28px; min-width:0; }
.card h2, .card h3 { color:var(--ink); }
.hint { font-size:15px; line-height:1.5; color:var(--muted); margin:10px 0; max-width:74ch; }
.explain { font-size:18px; line-height:1.5; margin:4px 0 8px; color:var(--ink); max-width:62ch; }
.msg { font:400 15.5px/1.5 var(--sans); min-height:1.2em; margin:12px 0; color:var(--ink); }
.msg:empty { margin:0; min-height:0; }
.msg.warn { color:var(--loss); }

/* form */
.grid { display:grid; grid-template-columns:1fr; gap:18px; margin-top:20px; }
.grid label, label.inline { display:flex; flex-direction:column; gap:6px; font-weight:600; font-size:15px; color:var(--ink); min-width:0; }
.grid .span2 { grid-column:1 / -1; }
.grid .hint { margin:-8px 0 0; }
.grid .hint:empty { display:none; }
input, select { width:100%; min-width:0; height:46px; font-size:16.5px; font-weight:400; line-height:1.3; padding:0 12px; border:1px solid var(--line-strong); border-radius:var(--radius); background:var(--surface); color:var(--ink); transition:border-color .15s ease, box-shadow .15s ease; }
input:hover, select:hover { border-color:rgba(11,31,77,.38); }
input:focus, select:focus { outline:none; border-color:var(--blue); box-shadow:var(--ring); }
input[type=range] { padding:0; border:0; background:transparent; accent-color:var(--blue); height:32px; box-shadow:none; }
:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
@media (min-width:640px) { .grid .hint { margin:0; align-self:end; padding-bottom:11px; } .grid { grid-template-columns:1fr 1fr; } .card { padding:36px 40px; } .wrap { padding-left:32px; padding-right:32px; } }
@media (min-width:900px) { .grid { grid-template-columns:repeat(4, 1fr); } .grid .span2 { grid-column:span 2; } }

.modes { display:inline-flex; gap:4px; flex-wrap:wrap; margin:6px 0 4px; padding:4px; background:var(--wash); border-radius:12px; max-width:100%; }
.modes button { flex:1 1 auto; font:600 16px/1.2 var(--sans); padding:10px 18px; border-radius:9px; border:0; background:transparent; color:var(--muted); cursor:pointer; transition:background .15s ease, color .15s ease; }
.modes button:hover { color:var(--ink); }
.modes button[aria-selected=true] { background:var(--surface); color:var(--blue); box-shadow:0 1px 4px rgba(11,31,77,.12); }

.btn.solid { background:var(--blue); color:#fff; box-shadow:0 8px 22px rgba(2,60,150,.20); }
.btn.solid:hover { background:var(--blue-hover); }
.btn.ghost-dark { color:var(--ink); border:0; background:var(--wash); font-size:15.5px; font-weight:500; padding:12px 16px; line-height:1.25; text-align:left; justify-content:flex-start; }
.btn.ghost-dark:hover { color:var(--blue); background:rgba(2,60,150,.10); }
.btn:disabled { opacity:.5; cursor:default; transform:none; }
.row-controls { display:flex; flex-wrap:wrap; gap:16px 20px; align-items:flex-end; margin:18px 0 6px; }
.row-controls .inline { flex:0 1 170px; }
.row-controls .grow { flex:1 1 220px; }
.row-controls .btn { height:46px; }
.presets { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.presets .btn { flex:1 1 200px; }

/* fair value */
.fair { display:grid; grid-template-columns:auto 1fr; gap:6px 22px; align-items:baseline; margin:10px 0 12px; }
.fair .big { font:600 46px/1 var(--sans); letter-spacing:-.02em; font-variant-numeric:tabular-nums; color:var(--blue); }
.fair .why { font-size:16.5px; line-height:1.5; min-width:0; color:var(--muted); max-width:60ch; }
@media (max-width:420px) { .fair { grid-template-columns:1fr; } }

/* tables: hairlines only */
.scroll { overflow-x:auto; max-width:100%; -webkit-overflow-scrolling:touch; margin:14px 0; }
.scroll table { border-collapse:collapse; width:100%; min-width:560px; font-size:15px; }
th, td { padding:12px 14px; text-align:right; border-bottom:1px solid var(--line); white-space:nowrap; vertical-align:middle; }
th:first-child, td:first-child { text-align:left; padding-left:4px; }
th { font-weight:600; font-size:14px; color:var(--muted); background:var(--surface); position:sticky; top:0; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover td { background:var(--wash); }
td.wrapok, th.wrapok { white-space:normal; min-width:150px; }
th { vertical-align:bottom; }
/* Settlement tables hold long cells: let them wrap instead of running off the side. */
#pooled th, #pooled td, #second th, #second td, #rows th, #rows td { white-space:normal; }
#pooled td:first-child, #second td:first-child, #rows td:first-child { min-width:110px; }
tr.best td, tr.best:hover td { background:var(--blue-soft); }
tr.declined td { color:var(--muted); }
tr.liq td, tr.liq:hover td { background:rgba(179,56,44,.07); }
tr.vault td, tr.vault:hover td { background:var(--blue-soft); }
.tag { display:inline-block; font:600 12px/1 var(--sans); padding:4px 8px; border-radius:6px; background:var(--blue); color:#fff; margin-left:8px; vertical-align:1px; }
.gain { color:var(--gain); font-weight:600; }
.loss { color:var(--loss); font-weight:600; }
td .btn.solid { font:600 14.5px/1 var(--sans); padding:9px 14px; box-shadow:none; }

/* futures */
.summary { background:var(--wash); border-radius:12px; padding:20px 22px; margin:20px 0; font-size:17px; line-height:1.55; }
.summary p { margin:0 0 10px; }
.summary p:last-child { margin:0; }
.summary .k { font:400 14.5px/1.4 var(--sans); color:var(--muted); display:block; }
.facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:14px 18px; margin:0 0 14px; }
.facts div { min-width:0; }
.facts b { font:600 20px/1.25 var(--sans); font-variant-numeric:tabular-nums; }
.chart { margin:28px 0; min-width:0; }
.chart figcaption { font-weight:600; font-size:16px; margin-bottom:10px; }
.chart svg { display:block; max-width:100%; background:transparent; }
.chart text { font-family:var(--sans); font-size:13px; fill:var(--ink); }
.chart .axis { stroke:var(--line-strong); stroke-width:1; }
.chart .grid-l { stroke:var(--line); }
.chart .mark { stroke:var(--ember); stroke-dasharray:4 3; stroke-width:1.5; }
.chart .dim { fill:var(--muted); }

.notice { background:var(--amber-soft); border-radius:var(--radius); padding:12px 16px; margin:14px 0 0; font-size:15.5px; line-height:1.5; }
.notice a { color:var(--blue); font-weight:600; }
.grid .span3 { grid-column:1 / -1; }
@media (min-width:900px) { .grid .span3 { grid-column:span 3; } }

@media (max-width:639px) {
  body { font-size:16.5px; }
  .painted {
    background-position:0 0, 72% 38%;
    background-image:linear-gradient(180deg, rgba(2,40,110,.80) 0%, rgba(2,40,110,.68) 60%, rgba(2,40,110,.46) 100%), url("hero.webp");
  }
  .card { border-radius:14px; }

  /* Quotes as a stack on a phone, so every number and the Accept button are in view without side-scrolling. */
  #quotes { min-width:0; display:block; }
  #quotes thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #quotes tbody { display:block; }
  #quotes tr { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px 16px; padding:16px 12px; border-bottom:1px solid var(--line); border-radius:0; }
  #quotes tr:last-child { border-bottom:0; }
  #quotes tr.best { background:var(--blue-soft); border-radius:12px; border-bottom-color:transparent; }
  #quotes td { display:block; padding:0; border:0; text-align:left; white-space:normal; min-width:0; background:none; font-size:16px; }
  #quotes td:first-child { grid-column:1 / -1; font-weight:600; font-size:17px; }
  #quotes td:nth-child(n+2)::before { display:block; font-size:13.5px; line-height:1.3; color:var(--muted); margin-bottom:1px; }
  #quotes td:nth-child(2)::before { content:"Replies in"; }
  #quotes td:nth-child(3)::before { content:"YES bid / ask"; }
  #quotes td:nth-child(4)::before { content:"You pay per $1"; }
  #quotes td:nth-child(5)::before { content:"Fee on size"; }
  #quotes td:nth-child(6)::before { content:"Up to"; }
  #quotes td:nth-child(7)::before { content:"Total"; }
  #quotes td[colspan] { grid-column:1 / -1; color:var(--muted); }
  #quotes td[colspan]::before { content:none; }
  #quotes td:nth-child(8) { grid-column:1 / -1; }
  #quotes td:nth-child(8)::before { content:none; }
  #quotes td .btn.solid { width:100%; padding:12px 14px; font-size:16px; }
}
