/* Trade Relay mockups: one shared stylesheet. Visual system follows Trade Scout (same tokens as src/orderrelay/web/app.css). */
:root {
  --bg: #0B0F14; --panel: #111821; --panel2: #0F151D; --hover: #141D28; --sel: #13202F;
  --line: #222E3C; --line2: #2E3E52; --line3: #3A4B60;
  --text: #E6EDF3; --text2: #C9D1D9; --muted: #8B97A6; --dim: #5C6878;
  --blue: #4C9EFF; --blue-bg: #13263D; --blue-bd: #24446A;
  --green: #3DD68C; --green-bg: #10291F; --green-bd: #1F5A40;
  --amber: #F0B37E; --amber-bg: #3A2A12; --amber-bd: #6A4A20;
  --red: #F87171; --red-bg: #3A1618; --red-bd: #5A2A2E;
  --purple: #C4A7FF; --purple-bg: #2A1F45; --purple-bd: #4A3A7A;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 10px; --r-sm: 6px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
h3 { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
p { margin: 0; }
.mono, .num { font-family: var(--mono); } .num { white-space: nowrap; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12px; } .xs { font-size: 11px; }
.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--amber); } .info { color: var(--blue); }
.r { text-align: right; } .c { text-align: center; } .nowrap { white-space: nowrap; }
.grow { flex: 1; } .row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: var(--s4); }
[hidden] { display: none !important; }

/* ---------- top bar (Trade Scout style) ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 14px; padding: 10px 24px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo svg { flex: none; }
.logo small { font-weight: 400; font-size: 12px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line2); margin-left: 3px; }
.nav { display: flex; gap: 6px; margin-left: 10px; }
.nav a, .ibtn, .navbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid var(--line2);
  border-radius: 7px; color: var(--text2); font-weight: 600; font-size: 13px; background: transparent; cursor: pointer; white-space: nowrap; }
.nav a:hover, .ibtn:hover, .navbtn:hover { background: #1C2836; text-decoration: none; }
.nav a.on { border-color: var(--blue); background: var(--blue-bg); color: #fff; }
.nav .more { position: relative; }
.menu { position: absolute; top: 38px; right: 0; min-width: 220px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); z-index: 40; }
.menu a { display: flex; justify-content: space-between; border: 0; height: auto; padding: 7px 10px; border-radius: 6px; font-weight: 500; color: var(--text2); }
.menu a:hover { background: #1C2836; } .menu .h { font-size: 10px; letter-spacing: .08em; color: var(--dim); padding: 8px 10px 3px; font-weight: 700; }
.menu .later { font-size: 11px; color: var(--dim); }
.status { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.conn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 1px solid var(--green-bd); background: var(--green-bg);
  border-radius: 7px; color: var(--green); font-size: 12px; font-weight: 600; white-space: nowrap; }
.conn:hover { text-decoration: none; filter: brightness(1.15); }
.conn.amber { border-color: var(--amber-bd); background: var(--amber-bg); color: var(--amber); }
.conn.red { border-color: var(--red-bd); background: var(--red-bg); color: var(--red); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot.live { box-shadow: 0 0 0 3px rgba(61,214,140,.18); }
.clock { font-family: var(--mono); font-size: 12px; color: var(--text2); white-space: nowrap; }
.ibtn { width: 32px; padding: 0; justify-content: center; position: relative; }
.ibtn.on { border-color: var(--purple-bd); background: var(--purple-bg); color: var(--purple); }
.badge { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 0 5px; line-height: 16px; }
.user { color: var(--muted); font-size: 13px; white-space: nowrap; }
.burger { display: none; }
.privacy-bar { display: none; background: var(--purple-bg); color: var(--purple); font-size: 12px; text-align: center; padding: 4px 16px; border-bottom: 1px solid var(--purple-bd); }
body.privacy .privacy-bar { display: block; }

/* notifications */
.notes { position: absolute; top: 40px; right: 0; width: 380px; max-width: calc(100vw - 32px); }
.nitem { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 9px 10px; border-radius: 6px; font-size: 13px; }
.nitem:hover { background: #17212D; } .nitem .t { color: var(--dim); font-size: 11px; font-family: var(--mono); }
.nitem .dot { margin-top: 6px; }

/* ---------- page ---------- */
main { padding: 20px 24px 48px; max-width: 1600px; margin: 0 auto; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead p { color: var(--muted); margin-top: 3px; }
.pagehead .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--dim); margin-bottom: 2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.grid > .card + .card { margin-top: 0; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .ftabs + .card { margin-top: 14px; }
.ch { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ch .note { color: var(--muted); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.cb { padding: 14px 16px; }
.grid { display: grid; gap: 14px; align-items: start; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: minmax(0, 1fr) 320px; }
.g-main2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--line2); border-radius: 7px; padding: 6px 12px;
  cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; }
.btn:hover { background: #1C2836; text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: var(--red-bd); } .btn.danger:hover { background: var(--red-bg); }
.btn.dangerfill { background: #C43D3D; border-color: #C43D3D; color: #fff; }
.btn.warnline { color: var(--amber); border-color: var(--amber-bd); } .btn.warnline:hover { background: var(--amber-bg); }
.btn.big { padding: 10px 16px; font-size: 14px; flex-direction: column; align-items: flex-start; gap: 1px; white-space: normal; text-align: left; }
.btn.big small { font-weight: 400; font-size: 12px; color: var(--muted); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.link { border: 0; padding: 0; color: var(--blue); font-weight: 500; background: none; }
.btn:disabled { opacity: .45; cursor: default; }

/* pills, tags */
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line2); border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 600;
  white-space: nowrap; line-height: 20px; color: var(--text2); }
.pill.blue, .pill.eval { color: var(--blue); border-color: var(--blue-bd); background: var(--blue-bg); }
.pill.green, .pill.funded, .pill.active { color: var(--green); border-color: var(--green-bd); background: var(--green-bg); }
.pill.amber, .pill.locked, .pill.halted { color: var(--amber); border-color: var(--amber-bd); background: var(--amber-bg); }
.pill.red, .pill.breached { color: var(--red); border-color: var(--red-bd); background: var(--red-bg); }
.pill.purple { color: var(--purple); border-color: var(--purple-bd); background: var(--purple-bg); }
.pill.grey { color: var(--muted); background: #17212D; }
.tag { display: inline-block; border-radius: 4px; padding: 0 5px; font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 16px; vertical-align: 1px; }
.tag.changed { color: var(--amber); border: 1px solid var(--amber-bd); background: var(--amber-bg); }
.tag.yours { color: var(--purple); border: 1px solid var(--purple-bd); background: var(--purple-bg); }
.tag.demo { color: var(--amber); border: 1px solid var(--amber-bd); }
.tag.live { color: var(--green); border: 1px solid var(--green-bd); }
.eff { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 0 6px; white-space: nowrap; line-height: 18px; display: inline-block; }
.eff.block { color: var(--amber); border: 1px solid var(--amber-bd); }
.eff.flat { color: var(--red); border: 1px solid var(--red-bd); }
.eff.watch { color: var(--muted); border: 1px solid var(--line2); }
.brk { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; background: #1B3A5E; color: #9CC8FF;
  font-size: 9px; font-weight: 800; flex: none; }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 14px; } th:last-child, td:last-child { padding-right: 14px; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
td.num, td .num { font-family: var(--mono); font-size: 13px; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--hover); }
tr.sel { background: var(--sel); } tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
tr.flag-red td:first-child { box-shadow: inset 3px 0 0 var(--red); } tr.flag-amber td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.acc { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-weight: 600; font-size: 13px; white-space: nowrap; }
.acc .sz { color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: 12px; }
.dots { color: var(--muted); cursor: pointer; padding: 0 6px; border-radius: 4px; letter-spacing: 1px; }
.dots:hover { background: #1C2836; color: var(--text); }
.bar { display: inline-block; width: 56px; height: 5px; background: #1F2A36; border-radius: 3px; vertical-align: middle; margin-left: 8px; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.bar.amber > i { background: var(--amber); } .bar.red > i { background: var(--red); }
.bar.wide { width: 100%; margin: 6px 0 0; display: block; }

/* period cards & KPI strip */

/* folder tabs (Trade Scout option B) */
.ftabs { display: flex; gap: 4px; background: var(--panel2); padding: 10px 14px 0; border-bottom: 1px solid var(--line3); overflow-x: auto; scrollbar-width: none; }
.ftabs.page { background: transparent; padding: 0 0 0; margin-bottom: 16px; }
.ftabs a, .ftabs button { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border: 1px solid var(--line2); border-bottom: 0; border-radius: 8px 8px 0 0;
  background: #17212D; color: var(--text2); font-weight: 600; font-size: 13px; cursor: pointer; margin-bottom: -1px; white-space: nowrap; }
.ftabs a:hover, .ftabs button:hover { background: #1C2836; text-decoration: none; }
.ftabs .on { background: var(--panel); border-color: var(--line3); color: #fff; box-shadow: inset 0 2px 0 var(--blue); }
.ftabs.page .on { background: var(--bg); }
.ftabs .count { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 500; }
.ftabs .today { background: var(--amber-bg); color: var(--amber); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 6px; line-height: 17px; }
.ftabs .red { background: var(--red-bg); color: var(--red); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 6px; line-height: 17px; }
.ftabs .soon, .ftabs .later-item { color: var(--dim); border-style: dashed; }
.menu a.later-item { color: var(--dim); }

/* selected-item panel */
.phead { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.phead .id { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.phead .meta { color: var(--muted); font-size: 13px; flex: 1; min-width: 200px; }

/* chips, segmented, filters */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 999px; padding: 3px 11px; background: transparent;
  cursor: pointer; font-size: 13px; color: var(--text2); white-space: nowrap; }
.chip b { font-family: var(--mono); font-weight: 600; }
.chip.on { border-color: var(--blue); background: var(--blue-bg); color: #fff; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button { background: transparent; border: 1px solid var(--line2); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.on { border-color: var(--blue); background: var(--blue-bg); color: #fff; }
.in, select.in, textarea.in { background: #0B1118; border: 1px solid var(--line2); border-radius: 6px; padding: 6px 9px; font-family: var(--mono); font-size: 13px; width: 150px; max-width: 100%; }
.in.w { width: 100%; } .in.sm { width: 100px; } .in.xs { width: 72px; }
.in.search { font-family: var(--sans); width: 260px; padding-left: 30px; background: #0B1118 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238B97A6' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M9.5 9.5 13 13'/%3E%3C/svg%3E") no-repeat 10px 50%; }
.in.changed { border-color: var(--amber); } .in::placeholder { color: var(--dim); font-style: italic; }
.in:focus { outline: 1px solid var(--blue); border-color: var(--blue); }
textarea.in { width: 100%; resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 4px; } .field > label { font-size: 12px; color: var(--muted); }
.under { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* switch */
.sw { width: 34px; height: 18px; border-radius: 9px; background: #2B3542; border: 0; position: relative; cursor: pointer; flex: none; padding: 0; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #8B97A6; transition: left .12s; }
.sw.on { background: var(--blue); } .sw.on::after { left: 19px; background: #fff; }
.sw.red.on { background: #C43D3D; }
.swrow { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.swrow:last-child { border-bottom: 0; } .swrow .n { font-weight: 600; } .swrow .d { font-size: 12px; color: var(--muted); }
.swrow .sw { margin-top: 2px; }

/* tooltip: plain-English explanations of trading terms */
.tip { border-bottom: 1px dotted var(--muted); cursor: help; position: relative; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; width: max-content; max-width: 260px;
  background: #1C2836; border: 1px solid var(--line3); color: var(--text); font: 400 12px/1.45 var(--sans); letter-spacing: 0; text-transform: none;
  padding: 7px 10px; border-radius: 7px; box-shadow: 0 8px 20px rgba(0,0,0,.4); white-space: normal; }
th .tip:hover::after { top: calc(100% + 4px); }
.tip.right:hover::after { left: auto; right: 0; }

/* callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.callout.blue { border-color: var(--blue-bd); background: var(--blue-bg); }
.callout.amber { border-color: var(--amber-bd); background: var(--amber-bg); }
.callout.red { border-color: var(--red-bd); background: var(--red-bg); }
.callout.green { border-color: var(--green-bd); background: var(--green-bg); }
.callout .ic { font-weight: 800; flex: none; width: 18px; text-align: center; }

/* health banner on the dashboard: one line that answers "is everything OK?" */
.health { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--amber-bd); background: linear-gradient(0deg, var(--amber-bg), var(--amber-bg)); flex-wrap: wrap; }
.health .big { font-weight: 700; font-size: 15px; color: var(--amber); }
.health .items { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }

/* "N things need you" strip at the top of the Trade Desk */
.needs { border: 1px solid var(--amber-bd); border-radius: var(--r); background: #1A160F; padding: 10px 14px 12px; }
.needs-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.needs-h .big { font-weight: 700; font-size: 15px; color: var(--amber); }
.needs-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ni { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--amber); border-radius: 7px; padding: 7px 10px; font-size: 13px; min-width: 0; }
.ni.red { border-left-color: var(--red); } .ni .d { color: var(--muted); font-size: 12px; } .ni .btn { flex: none; }
.needs.ok { border-color: var(--green-bd); background: var(--green-bg); } .needs.ok .big { color: var(--green); }

/* Today's P&L strip: slim by default, opens to the full chart */
.pnlbar { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 16px; width: 100%; padding: 9px 16px; flex-wrap: wrap; }
.pnlbar:hover { background: var(--hover); } .pnlbar:focus-visible { outline: 1px solid var(--blue); }
.minispark { flex: 1; min-width: 120px; height: 28px; }
.pnlchart { height: 172px; } .pnlchart text { font-size: 11px; fill: #8B97A6; }
/* period figures in the chart header: Today big, then This week and This month */
.mfig { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; } .mfig .mbig { font-size: 22px; }
.msep { padding-left: 12px; border-left: 1px solid var(--line2); gap: 6px; } .msep b { font-size: 15px; }
.pnlbar { gap: 12px; padding-top: 11px; padding-bottom: 11px; } .pnlbar h3, .pnlmore { white-space: nowrap; } .pnlmore { margin-left: auto; }
.pnlstrip:not(.open) .minispark { min-width: 60px; }
@media (min-width: 1201px) { .pnlbar { flex-wrap: nowrap; } }
.pnlstrip .pnlbody, .pnlstrip .when-open { display: none; } .pnlstrip.open .pnlbody { display: block; } .pnlstrip.open .when-open { display: inline; }
.pnlstrip.open .when-closed, .pnlstrip.open .minispark { display: none; } .pnlstrip.open .pnlbar { border-bottom: 1px solid var(--line); }
/* accounts table: sort, group by firm, row menu */
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--text); } th .si { color: var(--dim); font-size: 10px; } th[data-dir="asc"] .si, th[data-dir="desc"] .si { color: var(--blue); }
.v-grouped { display: none; } .grouped .v-grouped { display: table-row-group; } .grouped .v-flat { display: none; }
tr.grp td { background: var(--panel2); border-top: 1px solid var(--line3); padding-top: 7px; padding-bottom: 7px; }
.accts td:first-child { white-space: nowrap; }
.accts th, .accts td { padding-left: 7px; padding-right: 7px; } .accts th:first-child, .accts td:first-child { padding-left: 14px; } .accts th:last-child, .accts td:last-child { padding-right: 10px; }
button.dots { background: none; border: 0; font: inherit; font-size: 16px; line-height: 1; padding: 2px 6px; color: var(--muted); }
.rowmenu { position: absolute; top: 0; right: auto; width: 250px; }
.rowmenu .sep { border-top: 1px solid var(--line); margin: 5px 4px; }
.rowmenu a[data-acctdlg="flatten"] { color: var(--red); }
.btn.warnfill { background: #B7793F; border-color: #B7793F; color: #fff; }
.nitem.read { opacity: .55; }

/* lists */
.list > div { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.list > div:last-child { border-bottom: 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.kv > :last-child { font-family: var(--mono); text-align: right; }
.heads > div { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.heads > div:last-child { border-bottom: 0; } .heads .dot { margin-top: 6px; } .heads .d { color: var(--muted); font-size: 12px; }

/* status words used in signal lists */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st.filled { color: var(--green); } .st.blocked { color: var(--amber); } .st.rejected { color: var(--red); } .st.warned { color: #E8D27A; } .st.working { color: var(--blue); }

/* stacked bar (signal outcome mix) */
.mix { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #1F2A36; }
.mix i { display: block; height: 100%; }

/* ---------- step lists: Alert History rows, test sender ---------- */
.caret { display: inline-block; width: 16px; color: var(--muted); transition: transform .12s; }
tr.open .caret { transform: rotate(90deg); }
tr.detail > td { background: var(--panel2); padding: 0; }
.tl { position: relative; margin: 4px 0 0; padding: 0; list-style: none; }
.tl li { display: grid; grid-template-columns: 96px 18px minmax(0, 1fr) 64px; gap: 10px; align-items: start; position: relative; padding: 0 0 12px; }
.tl li::before { content: ""; position: absolute; left: 114px; top: 16px; bottom: -2px; border-left: 2px solid var(--line2); }
.tl li:last-child::before { display: none; }
.tl.simple li { grid-template-columns: 18px minmax(0, 1fr); } .tl.simple li::before { left: 7px; }
.tl .t { font-family: var(--mono); font-size: 12px; color: var(--text2); padding-top: 1px; white-space: nowrap; }
.tl .mk { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--green); background: var(--panel2); margin-top: 2px; position: relative; z-index: 1; }
.tl .mk.ok { background: var(--green); } .tl .mk.blk { border-color: var(--amber); background: var(--amber); } .tl .mk.rej { border-color: var(--red); background: var(--red); }
.tl .s { font-weight: 600; font-size: 13px; } .tl .s .muted { font-weight: 400; }
.tl .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tl .dt { font-family: var(--mono); font-size: 11px; color: var(--dim); text-align: right; padding-top: 2px; white-space: nowrap; }
.gl { margin-top: 6px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.gl > div { display: grid; grid-template-columns: 16px 150px minmax(0, 1fr); gap: 8px; padding: 4px 10px; font-size: 12px; border-bottom: 1px solid var(--line); align-items: baseline; }
.gl > div:last-child { border-bottom: 0; } .gl .ok { color: var(--green); } .gl .no { color: var(--amber); } .gl .na { color: var(--dim); }
.gl > div.hit { background: var(--amber-bg); }
pre.raw { margin: 0; background: #0B1118; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; font: 12px/1.55 var(--mono); color: var(--text2);
  white-space: pre-wrap; word-break: break-all; }
/* Command Builder: numbered steps; only step 1 is active on a fresh page */
.bstep { padding: 12px 0; border-bottom: 1px solid var(--line); } .bstep:first-child { padding-top: 0; } .bstep:last-child { border-bottom: 0; }
.bh { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cb-fresh .bstep:not(.s1) { opacity: .35; pointer-events: none; }
.cb-fresh .msg-actions .btn { opacity: .4; pointer-events: none; }
.msg-empty { display: none; color: var(--dim); } .cb-fresh .msg-empty { display: block; } .cb-fresh .msg-built { display: none; }
/* Alert History: the opened row */
.ahd { padding: 14px 18px 16px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; }
.ahd h3 { margin-bottom: 8px; }
.timing { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); }
.timing > div { padding: 10px 14px; } .timing > div + div { border-left: 1px solid var(--line2); }
.timing .k { font-size: 12px; color: var(--muted); } .timing .v { font-family: var(--mono); font-size: 24px; font-weight: 600; }
.copy.big .in { font-size: 16px; padding: 10px 12px; } .copy.big .btn { padding: 0 18px; }
.consent { max-width: 620px; padding-top: 48px; } .consent .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.possum { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 12px 16px; font-size: 13px; } .possum b { font-size: 15px; margin-left: 4px; }
td.ind2 { padding-left: 34px; }
.mirror .example { margin-top: 8px; border: 1px dashed var(--line2); border-radius: 7px; padding: 7px 10px; background: var(--panel2); }
.mirror > label { align-self: start; padding-top: 2px; }
.chans > div { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.chans > div:last-child { border-bottom: 0; }
.ngrid td.c, .ngrid th.c { text-align: center; width: 90px; }
.check.lockd { opacity: .55; pointer-events: none; } .check.off { border-style: dashed; opacity: .4; pointer-events: none; }
/* ATM status card on a position */
.atmcard { display: grid; grid-template-columns: repeat(4, auto) minmax(0, 1fr); gap: 6px 22px; align-items: baseline; }
@media (max-width: 760px) { .atmcard { grid-template-columns: 1fr 1fr; } }
.plainlist { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.75; }
.copyfrom { border: 1px solid var(--line); border-radius: 7px; background: #0B1118; padding: 6px 12px; }
.copyfrom .kv > :last-child { font-family: var(--sans); }
tr.newacct td { background: rgba(76,158,255,.06); }
details.allg { margin-top: 4px; } details.allg summary { cursor: pointer; font-size: 12px; color: var(--blue); width: max-content; }
.pill.yellow { color: #E8D27A; border-color: #5E5320; background: #2B2710; }

/* guards & rules (Accounts & Rules) */
.box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.box > h3 { display: flex; justify-content: space-between; margin-bottom: 4px; } .box > h3 .note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.rule { display: grid; grid-template-columns: 132px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start; }
.rule:last-child { border-bottom: 0; } .rule > label { padding-top: 5px; }
.money { position: relative; display: inline-block; } .money::before { content: "$"; position: absolute; left: 9px; top: 6px; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.money .in { padding-left: 20px; }
.tplbar { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.tplbar .lbl { font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 600; } .tplbar .name { font-weight: 700; font-size: 16px; }
.gsec { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .08em; color: var(--muted); margin: 12px 0 2px; font-weight: 600; text-transform: uppercase; }
.gsec span:last-child { letter-spacing: 0; font-weight: 400; text-transform: none; }
.rd { font-family: var(--mono); font-size: 12px; text-align: right; white-space: nowrap; } .rd.ok { color: var(--green); } .rd.near { color: var(--amber); } .rd.fired { color: var(--red); } .rd.off { color: var(--dim); }
.lock { color: var(--amber); font-size: 13px; text-align: center; }
/* Accounts & Rules: rules list and guard rows */
.new { font-size: 10px; font-weight: 700; color: var(--blue); border: 1px solid var(--blue-bd); border-radius: 4px; padding: 0 4px; vertical-align: 1px; }
.arcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.arcols .box { margin-bottom: 0; }
.rg { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin: 12px 0 2px; }
.rr { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px; align-items: center; padding: 5px 0; }
.rr > label { font-size: 13px; color: var(--text2); }
.gr { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.gr .d { font-size: 12px; color: var(--muted); } .gr.off b, .gr.off .d { opacity: .55; } .gr .sw { margin-top: 2px; }
details.goff { margin-top: 8px; } details.goff summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 4px 0; }
.arwrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; } .arwrap .arpanel { margin-top: 0; }
.alist a { display: flex; flex-direction: column; gap: 1px; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.alist a:last-child { border-bottom: 0; } .alist a:hover { background: var(--hover); text-decoration: none; }
.alist a.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--blue); }
.apick-select { display: none; }
.dtab td, .dtab th { padding: 7px 8px; }
@media (max-width: 1200px) { .arcols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .arwrap { grid-template-columns: minmax(0, 1fr); } .alist { display: none; } .apick-select { display: block; } .arpick { padding: 10px; } }
.savebar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* steps (wizard, builder) */
.steps { display: flex; gap: 0; margin: 4px 0 16px; counter-reset: s; }
.steps > div { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding-bottom: 8px; border-bottom: 2px solid var(--line2); }
.steps > div::before { counter-increment: s; content: counter(s); width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line3); display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.steps > div.done { color: var(--text2); border-color: var(--green); } .steps > div.done::before { content: "✓"; background: var(--green-bg); border-color: var(--green-bd); color: var(--green); }
.steps > div.on { color: #fff; border-color: var(--blue); font-weight: 600; } .steps > div.on::before { background: var(--blue); border-color: var(--blue); }
.opt { border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: transparent; text-align: left; }
.opt:hover { border-color: var(--line3); } .opt.on { border-color: var(--blue); background: #12202F; }
.opt .t { font-weight: 700; } .opt .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.check { width: 16px; height: 16px; border: 1px solid var(--line3); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-size: 11px; font-weight: 800; cursor: pointer; }
.check.on { background: var(--blue); border-color: var(--blue); color: #fff; } .check.on::after { content: "✓"; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(3, 6, 10, .74); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow: auto; z-index: 60; }
.dlg { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 20px 24px; width: 620px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.dlg.wide { width: 900px; } .dlg.mid { width: 740px; }
.dlg h2 { font-size: 20px; margin-bottom: 4px; } .dlg .lead { color: var(--muted); margin-bottom: 14px; }
.dlg .foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg .foot .note { margin-right: auto; color: var(--muted); font-size: 12px; }
.dlg.danger { border-color: var(--red-bd); } .dlg.danger h2 { color: var(--red); }
.effects { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 10px 0; }
.effects > div { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.effects > div:last-child { border-bottom: 0; }

/* copy field */
.copy { display: flex; gap: 0; } .copy .in { border-radius: 6px 0 0 6px; flex: 1; width: auto; min-width: 0; }
.copy .btn { border-radius: 0 6px 6px 0; border-left: 0; }

/* chart */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--dim); }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.gal a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--text); }
.gal a:hover { border-color: var(--blue-bd); background: #121C27; text-decoration: none; }
.gal .t { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; } .gal .d { color: var(--muted); font-size: 13px; margin-top: 4px; }
.gal .n { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1C2836; border: 1px solid var(--line2); border-radius: 8px; padding: 9px 16px; z-index: 70; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1600px) { .logo small { display: none; } }
@media (max-width: 1340px) { .clock { display: none; } }
@media (max-width: 1200px) {
  .g-main, .g-main2 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: 1fr 1fr; }
  .ahd { grid-template-columns: 1fr; }
  .nav { display: none; } .burger { display: inline-flex; }
  .nav.open { display: flex; position: absolute; top: 52px; left: 0; right: 0; flex-direction: column; background: var(--panel); border-bottom: 1px solid var(--line2); padding: 10px 16px; margin: 0; z-index: 35; }
  .nav.open a { justify-content: flex-start; } .nav.open .more .menu { position: static; box-shadow: none; margin-top: 6px; }
}
@media (max-width: 1200px) { .needs-items { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  main { padding: 14px 16px 40px; } .top-in { padding: 9px 16px; gap: 8px; }
  .user, .conn .lbl, .conn.sig, .acctbtn .lbl, .logo .word { display: none; }
  .pnlchart { height: auto; } .mfig { white-space: normal; flex-wrap: wrap; } .needs-items { grid-template-columns: 1fr; } .minispark { display: none; } .pnlbar { gap: 10px; } .g4 { grid-template-columns: 1fr; }
  .rule { grid-template-columns: 1fr; } .in.search { width: 100%; }
  .rr { grid-template-columns: 1fr; gap: 4px; } .gr { grid-template-columns: 38px minmax(0, 1fr); } .gr .rd, .gr .eff { grid-column: 2; text-align: left; }
  .tl li { grid-template-columns: 70px 16px minmax(0, 1fr); } .tl li::before { left: 87px; } .tl.simple li { grid-template-columns: 18px minmax(0, 1fr); } .tl.simple li::before { left: 7px; } .tl .dt { grid-column: 3; text-align: left; }
  .gl > div { grid-template-columns: 16px minmax(0, 1fr) auto; } .gl > div > :nth-child(3) { grid-column: 2 / -1; }
  .steps > div span { display: none; }
  h1 { font-size: 21px; }
  .hide-sm { display: none; }
}
