/* BTC Strangle · Execution. Tokens and base components are shared with web/day.html. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #151a22; --muted: #5d6676; --line: #e1e5eb;
  --chip: #eceff4; --accent: #2b55c9; --accent-soft: rgba(43, 85, 201, .12);
  --up: #0c7d55; --down: #c23d33; --under: #9099a8; --up-soft: rgba(12, 125, 85, .1); --down-soft: rgba(194, 61, 51, .1);
  --warn: #a86a00; --warn-soft: rgba(168, 106, 0, .12);
  --c1: #2b55c9; --c2: #b5562d;
  --g-bg: #ffffff; --g-line: #747775; --g-ink: #1f1f1f; --g-state: 48, 48, 48;   /* Google's sign-in button, light */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --panel: #161a21; --ink: #e6eaf0; --muted: #96a0b0; --line: #262c36;
    --chip: #1e242e; --accent: #7b9bff; --accent-soft: rgba(123, 155, 255, .16);
    --up: #3fcf93; --down: #ff7a6b; --under: #5c6778; --up-soft: rgba(63, 207, 147, .12); --down-soft: rgba(255, 122, 107, .12);
    --warn: #f0b34a; --warn-soft: rgba(240, 179, 74, .14);
    --c1: #7b9bff; --c2: #f0925f;
    --g-bg: #131314; --g-line: #8e918f; --g-ink: #e3e3e3; --g-state: 255, 255, 255;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --panel: #161a21; --ink: #e6eaf0; --muted: #96a0b0; --line: #262c36;
  --chip: #1e242e; --accent: #7b9bff; --accent-soft: rgba(123, 155, 255, .16);
  --up: #3fcf93; --down: #ff7a6b; --under: #5c6778; --up-soft: rgba(63, 207, 147, .12); --down-soft: rgba(255, 122, 107, .12);
  --warn: #f0b34a; --warn-soft: rgba(240, 179, 74, .14);
  --c1: #7b9bff; --c2: #f0925f;
  --g-bg: #131314; --g-line: #8e918f; --g-ink: #e3e3e3; --g-state: 255, 255, 255;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-sans); }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: 20px; padding-block: 20px 64px; display: grid; gap: 18px; }
.wrap > *, .page > * { min-width: 0; }   /* grid items must not widen the column (nav scrolls inside itself on phones) */
@media (max-width: 560px) { .wrap { padding-inline: 16px; padding-top: 12px; } }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 24px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
a { color: var(--accent); }
code { font-family: var(--font-mono); font-size: 12.5px; }
.num, td.n, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); } .warnc { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

header.top { display: grid; gap: 4px; }
header.top.row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.takeaway { font-size: 14px; max-width: 80ch; margin: 0; color: var(--muted); }
.page { display: grid; gap: 18px; min-width: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel > .head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.panel > .head p { margin: 0; color: var(--muted); font-size: 13px; }

.chip { background: var(--chip); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; white-space: nowrap; }
.chip b { font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12px; }

/* form controls (from day.html, extended to text/select inputs) */
.ctl { display: grid; gap: 5px; align-content: start; min-width: 0; }
.ctl > label, .ctl > span.lbl { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: max-content; max-width: 100%; }
.seg button { border: 0; background: transparent; color: var(--ink); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--panel); }
.seg button:disabled { opacity: .45; cursor: default; }
.seg.sm button { padding: 4px 9px; font-size: 12px; }
input[type="number"], input[type="text"], input[type="password"], input[type="url"], input[type="email"], select {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; min-width: 0; max-width: 100%;
}
input[type="number"] { width: 92px; font-family: var(--font-mono); }
input.hhmm { width: 76px; font-family: var(--font-mono); }
input:disabled, select:disabled { opacity: .5; }
.form.locked input:read-only { background: var(--chip); border-color: transparent; cursor: default; }   /* Settings until Edit */
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 1px var(--down); }
select { padding-right: 6px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.toggle input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; margin: 0; transition: background .15s; flex: none; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); }
.toggle input:disabled { opacity: .5; cursor: progress; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--panel); font-weight: 500; }
.btn.primary:hover:not(:disabled) { color: var(--panel); filter: brightness(1.1); }
.btn.danger { background: var(--down); border-color: var(--down); color: var(--panel); font-weight: 600; }
.btn.danger:hover:not(:disabled) { color: var(--panel); border-color: var(--down); filter: brightness(1.1); }
.btn.danger-o { color: var(--down); border-color: var(--down); font-weight: 500; }
.btn.danger-o:hover:not(:disabled) { background: var(--down-soft); color: var(--down); border-color: var(--down); }
.btn.link { border: 0; background: none; padding: 3px 4px; color: var(--accent); }
.btn.link.del { color: var(--down); }
.btn.link:hover:not(:disabled) { text-decoration: underline; }

.callout { background: var(--warn-soft); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 0; }
.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
.callout.bad { background: var(--down-soft); color: var(--down); }
.callout.bad b { color: var(--down); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.kpi .lbl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-family: var(--font-mono); font-size: 24px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--panel); position: sticky; top: 0; z-index: 1; vertical-align: bottom; }
td.n, th.n { text-align: right; }
td.long { white-space: normal; min-width: 150px; max-width: 320px; overflow-wrap: anywhere; }
#o-table.owners td.long { min-width: 120px; }
tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--chip) 55%, transparent); }
.scroll { overflow-x: auto; position: relative; }   /* relative: visually hidden (.sr) labels in a wide table stay inside it */
.why { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.why.SL { background: var(--down-soft); color: var(--down); }
.why.Target, .why.Overall, .why.Lock { background: var(--up-soft); color: var(--up); }
.why.added { background: var(--accent-soft); color: var(--accent); }
.why.warn { background: var(--warn-soft); color: var(--warn); }
.why.acc { background: var(--accent-soft); color: var(--accent); }
.why.err { background: var(--down-soft); color: var(--down); }
.why.dim { color: var(--muted); }
.why + .why { margin-left: 4px; }
.empty { color: var(--muted); padding: 18px 0; margin: 0; }
td.empty { padding: 18px 10px; white-space: normal; }
.note { font-size: 13px; color: var(--muted); max-width: 95ch; margin: 0; }
.hint { font-size: 12px; color: var(--muted); }
p.hint { margin: 0; }
.sell { color: var(--down); font-weight: 500; }
.buy { color: var(--up); font-weight: 500; }

/* top tabs */
/* ---- top bar: brand · tabs · theme glyph + account menu, in one row (tabs get their own row on narrow screens) */
.topbar { display: flex; align-items: center; gap: 6px 14px; padding: 6px 8px 6px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: relative; z-index: 20; }
.topbar .brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex: none; padding: 2px 4px 2px 0; border-radius: 8px; }
.topbar .brand .logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--c2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); flex: none; }
.brand-t { display: grid; line-height: 1.15; font-weight: 600; font-size: 13.5px; letter-spacing: .01em; white-space: nowrap; }
.brand-s { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tabs { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { text-decoration: none; color: var(--muted); font-size: 13.5px; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--accent-soft); }
.tabs a[aria-current="page"] { color: var(--panel); background: var(--accent); font-weight: 500; }
.tabs a:focus-visible, .topbar .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar .end { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .g { display: none; }
.theme-btn[data-mode="light"] .g-sun, .theme-btn[data-mode="dark"] .g-moon, .theme-btn[data-mode="system"] .g-auto { display: block; }
.theme-btn .g-auto .fill { fill: currentColor; stroke: none; }
.menu { position: relative; }
.env-badge { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.me { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; color: var(--ink); background: none; border: 1px solid transparent; border-radius: 999px; padding: 2px 8px 2px 2px; cursor: pointer; white-space: nowrap; }
.me:hover, .me[aria-expanded="true"] { background: var(--chip); }
.me .me-n { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.me .caret { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.me.adm .av { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--accent); }
.me-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.4); padding: 8px; z-index: 40; }
.me-who { display: flex; gap: 10px; align-items: flex-start; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); }
.me-id { display: grid; gap: 1px; min-width: 0; font-size: 13px; }
.me-id b { font-weight: 600; overflow-wrap: anywhere; }
.me-id span:not(.badge) { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.me-id .badge { justify-self: start; margin-top: 5px; }
.badge.user { background: var(--chip); color: var(--muted); text-transform: uppercase; }
.me-out { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px; }
.me-out:hover { background: var(--chip); color: var(--down); }
.me-out svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.av.lg { width: 40px; height: 40px; font-size: 16px; }
@media (max-width: 1100px) { .tabs a { padding: 7px 9px; } .topbar { gap: 6px 8px; } }
@media (max-width: 960px) {   /* tabs move to their own scrollable row under the brand and the account */
  .topbar { flex-wrap: wrap; }
  .tabs { order: 3; flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 6px; }
}
@media (max-width: 560px) {
  .brand-s { display: none; }
  .me .me-n, .me .caret { display: none; }   /* phones: the picture alone opens the menu */
  .me { padding: 2px; }
}

/* people: pictures (or initials), role badges, owner tags */
.av { width: 24px; height: 24px; border-radius: 50%; flex: none; object-fit: cover; background: var(--chip); }
.av.ini { display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 600; line-height: 1; user-select: none; }
.av.xs { width: 18px; height: 18px; font-size: 9.5px; }
.av.md { width: 32px; height: 32px; font-size: 13.5px; }
.badge.admin { background: var(--accent-soft); color: var(--accent); text-transform: uppercase; }
.badge.user { background: var(--chip); color: var(--muted); text-transform: uppercase; }
.owner { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; max-width: 100%; }
.owner .owner-n { overflow: hidden; text-overflow: ellipsis; }
.dep-title .owner { background: var(--chip); border-radius: 999px; padding: 2px 10px 2px 3px; font-size: 12.5px; }
p .owner { vertical-align: middle; }   /* inside running text: line the name up with the words around it */

/* mode and status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; letter-spacing: .07em; font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 1.5; white-space: nowrap; }
.badge.paper { background: var(--accent-soft); color: var(--accent); }
.badge.live { background: var(--down-soft); color: var(--down); font-weight: 700; box-shadow: inset 0 0 0 1px var(--down); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--down); }
.badge.testnet { background: var(--warn-soft); color: var(--warn); }
.badge.prod { background: var(--chip); color: var(--ink); }
.st { font-weight: 500; }
.st-entering, .st-closing, .st-missed { background: var(--warn-soft); color: var(--warn); }
.st-open { background: var(--accent-soft); color: var(--accent); }
.st-done { background: var(--up-soft); color: var(--up); }
.st-error { background: var(--down-soft); color: var(--down); }
.st-skipped, .st-paused { color: var(--muted); }

/* dashboard status strip */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 30px; padding: 12px 18px; }
.stat { display: grid; gap: 1px; min-width: 0; }
.stat .lbl { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat .val { font-size: 14px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.stat .val .num { font-size: 14.5px; }
.stat .val small { color: var(--muted); font-size: 12px; }
.stat .val small.warnc { color: var(--warn); }
.strip .kill { margin-left: auto; padding: 8px 16px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--under); flex: none; }
.dot.ok { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); animation: beat 2s ease-in-out infinite; }
.dot.stale { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.dead { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
@keyframes beat { 50% { box-shadow: 0 0 0 5px var(--up-soft); } }
@media (prefers-reduced-motion: reduce) { .dot.ok { animation: none; } }
@media (max-width: 560px) { .strip { gap: 10px 20px; padding: 12px 14px; } .strip .kill { width: 100%; margin-left: 0; } }

/* deployment cards */
.deps { display: grid; gap: 18px; }
.dep { display: grid; gap: 12px; }
.dep.live { border-color: var(--down); box-shadow: inset 4px 0 0 var(--down); }
.dep.off { opacity: .75; }
.dep-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.dep-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.dep-title h2 { overflow-wrap: anywhere; }
.dep-title .acct { font-size: 13px; color: var(--muted); }
.dep-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.when [data-cd] { color: var(--ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cfg { display: flex; flex-wrap: wrap; gap: 6px; }
.runnote { font-size: 13px; color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.leg { font-family: var(--font-mono); font-weight: 500; }
td .exits { font-size: 12px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); }
.working { display: flex; flex-wrap: wrap; gap: 8px; }
.working .w { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--warn-soft); padding: 5px 10px; border-radius: 8px; font-size: 13px; }
.working .w b { font-family: var(--font-mono); font-weight: 500; }
.spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--warn); border-right-color: transparent; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.dep-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.sums { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 13px; color: var(--muted); align-items: baseline; }
.sums b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); font-size: 15px; margin-left: 6px; }
.sums b.up { color: var(--up); } .sums b.down { color: var(--down); }

/* forms */
.toolbar { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; }
.toolbar .push { margin-left: auto; }
.form { display: grid; gap: 20px; }
.frow { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-start; }
.ctl.grow { flex: 1 1 240px; }
.ctl.grow input, .ctl.grow select { width: 100%; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.range input[type="number"] { width: 72px; }
.range .dash { color: var(--muted); }
.editor.live { border-color: var(--down); box-shadow: inset 4px 0 0 var(--down); }
.editor > .head { margin-bottom: 16px; }
details.adv { border-top: 1px solid var(--line); padding-top: 14px; }
details.adv summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.adv[open] summary { margin-bottom: 12px; }
details.adv .frow + .toggle { margin-top: 14px; }
.summary { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 0; display: grid; gap: 4px; }
.summary p { margin: 0; }
.summary .modeline { font-size: 13px; color: var(--muted); }
.summary .modeline.live { color: var(--down); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rowacts { display: inline-flex; gap: 2px; }

/* brokers */
tr.detail > td { white-space: normal; background: var(--bg); padding: 10px 12px 12px; }
tr.detail:hover > td { background: var(--bg); }
.detail .res { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.detail .res + .res, .detail .res + .postab, .detail .postab + .res { margin-top: 8px; }
.postab { max-width: 760px; margin-top: 6px; }
.postab table { font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.postab th { background: var(--panel); }
.ipnote code { background: var(--panel); padding: 1px 6px; border-radius: 4px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; cursor: pointer; max-width: 75ch; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check input[aria-invalid="true"] { outline: 2px solid var(--down); outline-offset: 2px; box-shadow: none; }
.check .mono { font-size: 12.5px; }

/* logs */
.logs { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.logs li { display: grid; grid-template-columns: 124px 64px minmax(0, 170px) minmax(0, 1fr); gap: 4px 12px; padding: 7px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.logs li:last-child { border-bottom: 0; }
.logs .ts { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.logs .dn { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logs .msg { overflow-wrap: anywhere; }
.logs li.error .msg { color: var(--down); }
@media (max-width: 640px) { .logs li { grid-template-columns: auto auto minmax(0, 1fr); } .logs .msg { grid-column: 1 / -1; } }
.page > .sec { display: contents; }   /* the admin console's sections: their panels sit in the page's grid */
.logs.sys li { grid-template-columns: 124px 64px minmax(0, 1fr); }   /* the system log: no deployment column */
.logs.owners li { grid-template-columns: 124px 64px minmax(0, 170px) minmax(0, 150px) minmax(0, 1fr); }
.logs .ow { min-width: 0; color: var(--muted); align-self: center; }
@media (max-width: 640px) { .logs.owners li { grid-template-columns: auto auto minmax(0, 1fr) auto; } .logs .ow .owner-n { display: none; } }

/* toast, dialog, login */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--up); border-radius: 8px; padding: 9px 12px; box-shadow: 0 10px 28px -12px rgba(0,0,0,.45); font-size: 13px; animation: tin .18s ease-out; pointer-events: auto; overflow-wrap: anywhere; }
.toast.err { border-left-color: var(--down); }
.toast.out { opacity: 0; transition: opacity .25s; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
dialog.dlg { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); padding: 20px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }
dialog.dlg::backdrop { background: rgba(10, 12, 16, .5); }
dialog.dlg h2 { margin-bottom: 8px; }
dialog.dlg p { margin: 0 0 18px; font-size: 14px; white-space: pre-line; }
dialog.dlg .actions { justify-content: flex-end; }
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.login { width: min(360px, 100%); display: grid; gap: 14px; padding: 24px; }
.login .brand { font-weight: 600; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.login input { width: 100%; font-size: 15px; padding: 8px 10px; }
.login .btn { padding: 8px 12px; font-size: 14px; }
.login .err { margin: 0; color: var(--down); font-size: 13px; }
.logs li.empty-li { display: block; padding: 0 4px; }
#b-table td, #u-table td { vertical-align: middle; }
@media (max-width: 560px) {   /* accounts and users tables stack on phones so results and actions stay readable */
  #b-table > thead, #u-table > thead { display: none; }
  #b-table, #b-table > tbody, #b-table > tbody > tr, #b-table > tbody > tr > td,
  #u-table, #u-table > tbody, #u-table > tbody > tr, #u-table > tbody > tr > td { display: block; width: 100%; }
  #b-table > tbody > tr:not(.detail), #u-table > tbody > tr { padding: 10px 0 6px; border-top: 1px solid var(--line); }
  #b-table > tbody > tr:first-child, #u-table > tbody > tr:first-child { border-top: 0; }
  #b-table > tbody > tr:not(.detail) > td, #u-table > tbody > tr > td { border: 0; padding: 2px 0; white-space: normal; }
  #b-table > tbody > tr.detail > td { border: 0; border-radius: 8px; }
  #b-table .rowacts, #u-table .rowacts { flex-wrap: wrap; gap: 4px; margin-top: 4px; }
  #u-table > tbody > tr > td.inl { display: inline-block; width: auto; margin-right: 6px; }
  #u-table td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); }
  #u-table td[data-l] .sub { display: inline; margin-left: 4px; }
}

/* ---- backtest learnings: editor sidebar, template cards, slippage curve, sizing ---- */
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .ed-grid { grid-template-columns: minmax(0, 1fr); } }
.hint.brk { white-space: normal; max-width: 280px; }
.hint.brk .btn.link { padding: 0 2px; font-size: 12px; }
input.money { width: 128px; }
.seg.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; width: 100%; border: 0; border-radius: 0; overflow: visible; }
.seg.opts button, .seg.opts button:last-child { display: grid; gap: 3px; text-align: left; align-content: start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; }
.seg.opts button:hover:not(:disabled) { border-color: var(--accent); }
.seg.opts button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.t-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.t-sum { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.seg.opts button[aria-pressed="true"] .t-sum { color: var(--ink); }

.bt { position: sticky; top: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; font-size: 13px; min-width: 0; }
@media (max-width: 1000px) { .bt { position: static; } }
.bt p { margin: 0; }
.bt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.bt-head h3 { font-size: 14px; }
.bt .meta { font-size: 12.5px; color: var(--muted); }
dl.bt-stats { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
dl.bt-stats dt, dl.bt-stats dd { padding: 5px 0; border-bottom: 1px solid var(--line); }
dl.bt-stats dt { color: var(--muted); font-size: 12.5px; }
dl.bt-stats dt small { font-size: 11px; }
dl.bt-stats dd { margin: 0; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
dl.bt-stats dt:last-of-type, dl.bt-stats dd:last-of-type { border-bottom: 0; }

figure.spark { margin: 0; display: grid; gap: 4px; }
.spark svg { display: block; width: 100%; height: auto; overflow: visible; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark line.zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; vector-effect: non-scaling-stroke; }
.spark line.be { stroke: var(--down); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.spark circle { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; }
.spark text { fill: var(--muted); font-size: 10px; font-family: var(--font-mono); }
.spark text.be { fill: var(--down); }
.spark figcaption { font-size: 12px; color: var(--muted); }

.sizing { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.sizing h4 { margin: 0; font-size: 13px; font-weight: 600; }
.sizing p { margin: 0; }

/* ---- dashboard: implied-move gauge, backtest-lows timeline, slippage tags ---- */
.dayctx { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px 28px; align-items: start; }
.imv { display: grid; gap: 5px; }
.imv-lbl { margin: 0; font-size: 13px; }
.imv-bar { position: relative; height: 8px; border-radius: 999px; background: var(--chip); }
.imv-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); }
.imv.warn .imv-fill { background: var(--warn); }
.imv.bad .imv-fill { background: var(--down); }
.imv-peak { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--muted); }
.imv-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--down); }
.imv-scale { position: relative; height: 15px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.imv-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.imv-scale span:first-child { transform: none; }
.imv-scale span:last-child { transform: translateX(-100%); }
.imv-scale .t { color: var(--down); }
.imv-note { margin: 2px 0 0; font-size: 12.5px; }
.tl { display: grid; grid-template-columns: auto auto minmax(60px, 1fr) auto; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.tl-cap { letter-spacing: .05em; text-transform: uppercase; }
.tl-t { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tl-bar { position: relative; height: 10px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.tl-seg { position: absolute; top: 0; bottom: 0; background: var(--down); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 0 1px var(--panel); }
.btref { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; color: var(--muted); }
.btref .num { color: var(--ink); }
td .sub { display: block; font-size: 11.5px; margin-top: 1px; }
.slip { font-size: 11.5px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- reports: live vs backtest cards ---- */
.ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.ins { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.ins.live { border-color: var(--down); box-shadow: inset 4px 0 0 var(--down); }
.ins-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ins-head h3 { overflow-wrap: anywhere; }
.ins .meta, .ins .drift { margin: 0; font-size: 13px; }
.ins .meta { color: var(--muted); }
table.cmp th, table.cmp td { padding: 5px 8px; }
table.cmp td .sub { color: var(--muted); }
.slips { display: grid; gap: 6px; }
.slips .lbl { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sl-row { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; }
.sl b { margin-left: 4px; }

/* ---- sign-in page and password forms ---- */
.login-wrap { width: min(400px, 100%); display: grid; gap: 14px; }
.login-wrap .login { width: 100%; padding: 24px; gap: 14px; }
.login-brand { margin: 0; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; font-size: 13.5px; letter-spacing: .02em; color: var(--ink); }
.login-brand .logo { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--c2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.login h1 { font-size: 20px; }
.login p { margin: 0; }
.login .hint code { font-size: 11.5px; background: var(--chip); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.pw { display: flex; align-items: center; gap: 4px; }
.pw input { flex: 1 1 auto; min-width: 0; }
.login .btn.link { padding: 4px 6px; font-size: 13px; justify-self: center; }
.login .pw .btn.link { justify-self: auto; }
#pw-form input[type="password"] { width: 220px; }
.login form { display: grid; gap: 14px; }
/* "Sign in with Google": Google's standard button, light or dark with the theme. 40px, logo left, Roboto Medium 14px */
.gbtn { display: grid; grid-template-columns: 20px minmax(0, 1fr) 20px; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border: 1px solid var(--g-line); border-radius: 4px; background-color: var(--g-bg); color: var(--g-ink);
  font: 500 14px/20px Roboto, Arial, var(--font-sans); letter-spacing: .25px; text-align: center; text-decoration: none;
  white-space: nowrap; transition: box-shadow .218s; }
.gbtn svg { display: block; width: 20px; height: 20px; }
.gbtn span { overflow: hidden; text-overflow: ellipsis; }
.gbtn:hover { background-image: linear-gradient(rgba(var(--g-state), .08), rgba(var(--g-state), .08));
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); }
.gbtn:active, .gbtn:focus-visible { background-image: linear-gradient(rgba(var(--g-state), .12), rgba(var(--g-state), .12)); }
.login-alt { border-top: 1px solid var(--line); padding-top: 12px; }
.login-alt > summary { cursor: pointer; font-size: 13px; color: var(--muted); width: max-content; max-width: 100%; }
.login-alt > summary:hover { color: var(--ink); }
.login-alt[open] > summary { margin-bottom: 14px; }

/* ---- users (admins) ---- */
.frow.bottom { align-items: flex-end; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-t { display: grid; min-width: 0; }
.who-t .sub { margin-top: 0; overflow-wrap: anywhere; }
#u-table tr.off .who { opacity: .6; }
.why.on { background: var(--up-soft); color: var(--up); }


/* ---- page info: the (i) at the top right of every page, with a short plain-words note */
.head-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.info { position: relative; flex: none; }
.info-btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.info-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.info-btn svg .dot { fill: currentColor; stroke: none; }
.info-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(320px, calc(100vw - 40px)); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: 0 14px 34px -14px rgba(0,0,0,.4); font-size: 13px; line-height: 1.5; text-align: left; white-space: normal; }
.info-pop p { margin: 0; }
.info-pop p + p { margin-top: 7px; }
.strip { position: relative; padding-right: 64px; }
.strip > .info { position: absolute; top: 12px; right: 14px; }
@media (max-width: 560px) { .strip { padding-right: 56px; } .strip > .info { right: 12px; } }
@media (max-width: 760px) {   /* narrow screens: the (i) stays in the header's top-right corner; other buttons wrap below */
  header.top { position: relative; padding-right: 44px; }
  header.top .info { position: absolute; top: 2px; right: 0; }
}
