/* SAM Bid Simulator — single light theme matching marinade.finance. */
:root {
  --ground: #F7FAF8;
  --surface: #FFFFFF;
  --tint: #E8F6EE;
  --tint-2: #F0F5F2;
  --ink: #16211B;
  --ink-2: #3E4C45;
  --muted: #67766E;
  --line: #E2EAE5;
  --line-strong: #C9D6CE;
  --green: #0F8A57;
  --green-deep: #0B6B44;
  --mint: #91e4b7;
  --warn: #9A6A14;
  --warn-tint: #F7F0DC;
  --crit: #B23B2E;
  --crit-tint: #F9E9E6;
  --shadow: 0 1px 2px rgba(22,33,27,.05), 0 3px 12px rgba(22,33,27,.05);
  --shadow-pop: 0 6px 24px rgba(22,33,27,.12), 0 1px 3px rgba(22,33,27,.08);
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--ground); }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 42px 22px 72px; }
a { color: var(--green-deep); }
select:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }

/* ---- masthead ------------------------------------------------------------ */
.masthead h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.brandline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.brandtag { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--green); background: var(--tint); border-radius: 4px; padding: 3px 9px; }
.masthead .sub { color: var(--ink-2); max-width: 78ch; font-size: 15px; }

/* ---- stat strip ---------------------------------------------------------- */
.statstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 10px; margin: 26px 0 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; box-shadow: var(--shadow); }
.stat .k { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 19px; font-weight: 650; color: var(--ink); margin-top: 3px; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---- input panel --------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lbl { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.lbl .opt { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 4px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.finder { padding: 20px 20px 16px; }
.combo { position: relative; }
.combo-icon { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.combo input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--ground);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 13px 44px 13px 40px;
  transition: border-color .12s, background .12s;
}
.combo input::placeholder { color: var(--muted); }
.combo input:focus { background: var(--surface); border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(15,138,87,.14); }
.combo input.invalid { border-color: var(--crit); box-shadow: 0 0 0 3px rgba(178,59,46,.12); }
.combo-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.combo-clear:hover { background: var(--tint-2); color: var(--ink); }
.vlist {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop);
  max-height: 380px; overflow-y: auto; padding: 5px;
}
.vlist li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 9px 11px; border-radius: 6px; cursor: pointer; }
.vlist li[aria-selected="true"], .vlist li:hover { background: var(--tint); }
.vlist .vn { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; min-width: 0; }
.vlist .vn .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlist .vn .unnamed { font-weight: 500; color: var(--ink-2); font-style: italic; }
.vlist .vk { grid-column: 1; font-size: 12px; color: var(--muted); }
.vlist .vs { grid-column: 2; grid-row: 1 / span 2; font-size: 12.5px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.vlist .msg { display: block; padding: 12px 11px; color: var(--ink-2); font-size: 13.5px; cursor: default; }
.vlist .msg:hover { background: transparent; }
.vlist .msg strong { color: var(--ink); }
.finder-hint { margin-top: 8px; }
.finder-hint a { font-weight: 600; text-decoration: none; }
.finder-hint a:hover { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; padding: 1px 6px; line-height: 1.5; white-space: nowrap; }
.badge.select { background: var(--tint); color: var(--green-deep); }
.badge.winner { background: #EEF1FA; color: #3B4A8C; }
.badge.nodata { background: var(--warn-tint); color: var(--warn); }

.identity { border-top: 1px solid var(--line); padding: 14px 20px; background: var(--tint-2); }
.idrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.idname { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.idbadges { display: inline-flex; gap: 6px; }
.idmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.idvote { font-size: 12px; color: var(--ink-2); word-break: break-all; }
.idsep { color: var(--line-strong); }
.linkbtn { font: inherit; font-size: 12px; font-weight: 600; color: var(--green-deep); background: transparent; border: 0; padding: 0 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover { color: var(--green); }

.assumptions { display: grid; grid-template-columns: auto minmax(260px, 420px); gap: 10px 28px; align-items: start; padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.assumptions .span2 { grid-column: 1 / -1; max-width: 92ch; }
@media (max-width: 720px) { .assumptions { grid-template-columns: 1fr; } }
.field { min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; height: 40px; }
.seg button { font: inherit; font-size: 13px; padding: 0 14px; border: 0; background: var(--ground); color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--green); color: #fff; font-weight: 600; }
.inputwrap { display: flex; align-items: stretch; height: 40px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--ground); overflow: hidden; }
.inputwrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,138,87,.14); }
.inputwrap input { flex: 1 1 auto; min-width: 0; font: inherit; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 14px; color: var(--ink); background: transparent; border: 0; padding: 0 12px; }
.inputwrap input:focus { outline: none; }
.inputwrap .unit { display: flex; align-items: center; padding: 0 12px; font-size: 11.5px; color: var(--muted); background: var(--tint-2); border-left: 1px solid var(--line); white-space: nowrap; }

/* ---- cards --------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 18px; box-shadow: var(--shadow); }
.card h2 { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--green); font-weight: 700; margin-bottom: 14px; }
.gap-top { margin-top: 12px; }
.gap-top-sm { margin-top: 8px; }
.gap-top-lg { margin-top: 14px; }

.empty h2 { color: var(--muted); }
.emptylist { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 22px; }
.emptylist li { font-size: 13.5px; color: var(--ink-2); padding-left: 14px; border-left: 3px solid var(--mint); }
.emptylist strong { color: var(--ink); display: block; margin-bottom: 2px; }

.status { border-left: 4px solid var(--warn); color: var(--ink-2); }
.status.error { border-left-color: var(--crit); }
.status .linkbtn { font-size: 13px; }

.verdict { border-left: 4px solid var(--green); }
.verdict.negative { border-left-color: var(--warn); }
.verdict.blocked { border-left-color: var(--crit); }
.verdict .headline { font-size: 19px; font-weight: 600; line-height: 1.5; color: var(--ink); text-wrap: balance; letter-spacing: -0.01em; }
.verdict .headline .num { color: var(--green); }
.verdict .sub2 { font-size: 13.5px; margin-top: 12px; max-width: 86ch; color: var(--ink-2); }
.verdict .sub2 strong { color: var(--ink); }
.ladderbox { margin-top: 16px; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 600; padding: 2px 10px; white-space: nowrap; }
.pill.win { background: var(--tint); color: var(--green-deep); }
.pill.lose { background: var(--crit-tint); color: var(--crit); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.neutral { background: var(--tint-2); color: var(--ink-2); }

table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
td { padding: 10px; border-bottom: 1px solid var(--tint-2); vertical-align: top; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.num { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.tblwrap { overflow-x: auto; }
.pos { color: var(--green-deep); font-weight: 600; }
.neg { color: var(--crit); font-weight: 600; }
.topup { color: var(--warn); }
.rowlabel { font-weight: 600; color: var(--ink); font-family: "Instrument Sans", sans-serif; font-size: 13.5px; }
.rowsub { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; font-family: "Instrument Sans", sans-serif; }

.gates { display: flex; flex-wrap: wrap; gap: 8px; }
svg text { font-family: "IBM Plex Mono", monospace; }
.chartbox { position: relative; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--ink-2); margin: 0 2px 10px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--green); vertical-align: -1px; margin-right: 6px; }
.legend .ln { display: inline-block; width: 16px; height: 0; border-top: 2px dashed var(--ink-2); vertical-align: 3px; margin-right: 6px; }
.tooltip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; border-radius: 5px; padding: 5px 9px; opacity: 0; transition: opacity .1s; white-space: nowrap; z-index: 5; font-family: "IBM Plex Mono", monospace; }
@media (prefers-reduced-motion: reduce) { .tooltip, .combo input { transition: none; } }

.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.cta > * { min-width: 0; }
@media (max-width: 800px) { .cta { grid-template-columns: 1fr; } }
pre.cli {
  background: #16211B; color: #DDEBE2; border-radius: 8px; padding: 16px;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 1.65;
  overflow-x: auto; white-space: pre;
}
pre.cli .c { color: #8FA89A; }
pre.cli .g { color: var(--mint); }
.btnrow { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.btn { display: inline-block; text-align: center; font: inherit; font-size: 13.5px; font-weight: 600; border-radius: 6px; padding: 9px 14px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--green); color: #fff; border: 1px solid var(--green-deep); }
.btn.secondary { background: var(--surface); color: var(--green-deep); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--tint); }
.btn.primary:hover { background: var(--green-deep); }

.method { font-size: 13px; color: var(--ink-2); }
.method p { max-width: 92ch; margin-bottom: 10px; }
.method strong { color: var(--ink); }
details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
details[open] summary { margin-bottom: 10px; }
.footer { margin-top: 30px; font-size: 12px; color: var(--muted); }
