/* tradereplay.co — shared design tokens, reproduced from the canvas mockups
   (Chat/Run/Runs/Data/Connect/Auth/Pricing/Upgrade/Welcome/Billing .dc.html). */

:root {
  /* Readable look (docs/READABLE_SITE_PLAN.md): light only, Figtree, TradingView chart colors. */
  --paper: #FFFFFF;
  --ink: #171717;
  --muted: #525252;
  --border: #E6E6E6;
  --border-soft: #F0F0F0;
  --border-input: #DFDFDF;
  --chip-bg: #F2F2F2;
  --card-alt: #FAFAFA;
  --pill-bg: #F2F2F2;
  --green-bg: #E6F4F1;
  --green-fg: #067A67;
  --green: #067A67;
  --red-bg: #FDECEC;
  --red-fg: #D32F2F;
  --red: #D32F2F;
  --grey-fg: #8F8F8F;
  --accent: #2962FF;
  --option: #7E57C2;
  --amber: #B45309;
  --shadow: 0 8px 24px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
  --display: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --label: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body {
  margin: 0;
  font-family: var(--label);
  font-variant-numeric: tabular-nums;
  background: var(--paper);
  color: var(--ink);
}

a { color: var(--ink); }
a:hover { color: var(--muted); }

h1, h2, .font-display { font-family: var(--display); letter-spacing: -0.02em; }
h1 { font-weight: 600; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-weight: 600; }

code, pre { font-family: var(--mono); }
.mono { font-variant-numeric: tabular-nums; } /* numbers, not code: Figtree with tabular figures */
.pos { color: var(--green); }
.neg { color: var(--red); }
.nil { color: var(--muted); }

/* masthead: rendered by js/rail.js into <nav id="rail"> */
.rail { width: 100%; border-bottom: 1px solid var(--border); background: var(--paper); position: relative; }
.mh-top { max-width: 1192px; margin: 0 auto; padding: 8px 16px; min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.mh-title { font: 600 19px var(--display); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mh-title:hover { color: var(--ink); }
.mh-me { margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--border-input); border-radius: 50%; padding: 0; background: var(--card-alt); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font: 500 15px var(--label); text-decoration: none; cursor: pointer; }
.mh-me:hover { color: var(--ink); background: var(--chip-bg); }
.mh-me[aria-expanded="true"], .mh-me:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mh-signin { width: auto; height: 40px; border-radius: 6px; padding: 0 14px; font: 500 14px var(--label); white-space: nowrap; }
.mh-nav { display: flex; flex-wrap: wrap; gap: 2px; font-size: 15px; font-weight: 500; }
.mh-nav a { padding: 8px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.mh-nav a:hover { color: var(--ink); background: var(--card-alt); }
.mh-nav a[aria-current="page"] { color: var(--ink); background: var(--chip-bg); }
.mh-menu { position: absolute; top: 60px; right: max(16px, calc((100vw - 1192px) / 2 + 16px)); width: min(260px, calc(100vw - 32px)); background: var(--paper); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 200; overflow: hidden; }
.mh-who { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mh-who b { font: 600 15px var(--label); overflow-wrap: anywhere; }
.mh-who span { font: 13px var(--label); color: var(--muted); overflow-wrap: anywhere; }
.mh-menu a, .mh-menu button { display: block; width: 100%; padding: 10px 16px; border: 0; background: none; color: var(--ink); font: 400 14px var(--label); text-align: left; text-decoration: none; cursor: pointer; }
.mh-menu a:hover, .mh-menu button:hover, .mh-menu a:focus-visible, .mh-menu button:focus-visible { background: var(--card-alt); color: var(--ink); outline: 0; }
.mh-menu a[aria-current="page"] { background: var(--chip-bg); font-weight: 500; }
.mh-menu button { border-top: 1px solid var(--border); }

.page { min-height: 0; display: flex; flex-direction: column; flex-grow: 1; }
.content { width: 100%; max-width: 1192px; margin: 0 auto; padding: 28px 16px 48px; display: flex; flex-direction: column; gap: 22px; flex-grow: 1; min-width: 0; }

.eyebrow { font-size: 11px; font-weight: 600; }

.card { background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.card-pad { padding: 14px 0; }

.chip { background: transparent; padding: 0; border-radius: 0; font-size: 13px; font-family: var(--label); color: var(--muted); }
.chip + .chip { padding-left: 10px; border-left: 1px solid var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border-radius: 6px;
  font: 500 14px var(--label);
  text-decoration: none; cursor: pointer; border: 1px solid var(--border-input); background: var(--paper); color: var(--ink);
}
.btn:hover { color: var(--ink); background: var(--card-alt); }
.btn-primary, .btn-primary:hover { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2E2E2E; border-color: #2E2E2E; }
.btn:disabled { color: var(--grey-fg); border-color: var(--border); background: var(--card-alt); cursor: default; }

table.tr-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.stat-tile { background: transparent; border: 0; border-radius: 0; padding: 12px 20px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-tile .label { font-size: 13px; font-weight: 400; color: var(--muted); }
.stat-tile .value { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; }

.pill { font-size: 12px; padding: 2px 8px; border-radius: 4px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px; }
.modal { width: 400px; max-width: 100%; background: var(--paper); border: 1px solid var(--border); border-radius: 10px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }

input[type="text"], input[type="email"], input[type="password"], select {
  height: 40px; padding: 0 12px; border: 1px solid var(--border-input); border-radius: 6px; background: var(--paper);
  font: inherit; font-size: 14px; color: var(--ink); outline: none;
}
input[type="text"]:focus-visible, input[type="email"]:focus-visible, input[type="password"]:focus-visible, select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,255,.15); }
::placeholder { color: var(--muted); opacity: 1; }

.site-foot { width: 100%; max-width: 1192px; margin: 0 auto; padding: 0 16px 24px; font-size: 12px; }

/* ui.js (Lane C) */
[hidden] { display: none !important; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
.ui-spin {
  --spin-c: var(--ink);
  display: inline-block; width: 16px; height: 16px; flex: 0 0 auto;
  border: 2px solid var(--spin-c); border-right-color: transparent; border-radius: 999px;
  animation: ui-spin .7s linear infinite;
}
.is-busy { position: relative; color: transparent !important; cursor: default; }
.is-busy > :not(.ui-spin) { visibility: hidden; }
.is-busy > .ui-spin { position: absolute; inset: 0; margin: auto; }
.btn-primary.is-busy > .ui-spin { --spin-c: var(--paper); }
.err { flex-basis: 100%; margin-top: 6px; font-size: 13px; color: var(--red); overflow-wrap: anywhere; }
.ui-page-spin { display: flex; align-items: center; justify-content: center; min-height: 50vh; flex-grow: 1; }
.ui-page-spin .ui-spin { width: 28px; height: 28px; border-width: 3px; }

/* account (Lane C) */
.plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.plan-note { font-size: 14px; color: var(--muted); }
.plan-signout { align-self: flex-start; }
/* Delete account (docs/DELETE_ACCOUNT_PLAN.md D1, D2) */
.plan-delete { align-self: flex-start; margin-top: 24px; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--red); cursor: pointer; }
.plan-delete:hover { text-decoration: underline; }
.del-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.del-field input { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }

/* replays list (Lane R) */
.rl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rl-chips { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.rl-chip { height: 32px; padding: 0 12px; border-radius: 0; border: 1px solid var(--border-input); background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.rl-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.rl-card { overflow: hidden; border-top: 1px solid var(--border); }
.rl-scroll { overflow-x: auto; }
.rl-row { display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; min-width: 720px; border-bottom: 1px solid var(--border-soft); }
.rl-cols { display: grid; grid-template-columns: minmax(0,2fr) 150px 90px 90px 110px; gap: 12px; padding: 14px 0; align-items: center; }
.rl-colhead { font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border); }
.rl-colhead .rl-cols { padding: 10px 0; }
a.rl-cols { text-decoration: none; color: var(--ink); font-size: 14px; }
a.rl-cols:hover { background: var(--card-alt); }
.rl-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rl-one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rl-name { font: 600 15px var(--display); }
.rl-syms { font-size: 12px; color: var(--muted); font-family: var(--label); }
.rl-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rl-py { flex: 0 0 auto; padding: 1px 7px; border-radius: 4px; background: var(--chip-bg); color: var(--accent); font: 600 11px var(--label); }
.rl-instr { font-size: 13px; }
.rl-ret { font-family: var(--display); font-weight: 600; }
.rl-ret { color: var(--muted); }
.rl-pos { color: var(--green); }
.rl-neg { color: var(--red); }
.rl-saved { font-size: 12px; color: var(--muted); }
.rl-dots { width: 32px; height: 32px; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.rl-dots:hover, .rl-dots[aria-expanded="true"] { background: var(--card-alt); color: var(--ink); }
.rl-msg { padding: 14px 16px; font-size: 14px; color: var(--muted); }
.rl-msg.err { margin: 0; color: var(--red); }
.rl-more { display: flex; flex-direction: column; align-items: center; padding: 12px 16px; }
.rl-menu { position: fixed; z-index: 90; min-width: 140px; padding: 4px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow); }
.rl-menu button { height: 34px; padding: 0 12px; border: 0; border-radius: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.rl-menu button:hover, .rl-menu button:focus-visible { background: var(--card-alt); }
.rl-menu .rl-danger { color: var(--red); }
.rl-menu button { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-width: 200px; }
.rl-menu button:disabled { color: var(--grey-fg); cursor: default; background: none; }
.rl-menu .rl-sep { border-top: 1px solid var(--border-soft); }
.rl-menu .rl-n { font-family: var(--label); font-size: 12px; }

/* groups of replays (docs/GROUP_RUNS_PLAN.md D12) */
.rl-group { border-bottom: 1px solid var(--border); }
.rl-group > .rl-row { border-bottom: 0; }
div.rl-cols { font-size: 14px; }
.rl-gwho { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rl-caret { flex: 0 0 auto; width: 28px; height: 28px; border: 0; background: none; font-size: 13px; color: var(--ink); cursor: pointer; }
.rl-caret:hover { background: var(--card-alt); }
.rl-members { display: flex; flex-direction: column; padding: 0 44px 10px 36px; min-width: 720px; box-sizing: border-box; }
.rl-member { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border-soft); font-size: 14px; }
.rl-member a { font: 600 16px var(--display); color: var(--ink); text-decoration: none; }
.rl-member a:hover { text-decoration: underline; }
.rl-member .rl-n { font-family: var(--label); font-size: 12px; color: var(--muted); }
.rl-link { margin-left: auto; border: 0; background: none; font: inherit; font-size: 13px; text-decoration: underline; color: var(--ink); cursor: pointer; }
.rl-run-modal { width: min(760px, calc(100vw - 32px)); }

/* the Run line (js/run-line.js): replay page + group Run dialog */
.rn-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.rn-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 110px; min-width: 0; }
.rn-lbl { font-size: 11px; font-weight: 600; }
.rn-field input, .rn-field select { font: 16px var(--label); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding: 4px 0; color: var(--ink); min-width: 0; }
.rn-run { flex: 0 0 auto; padding: 0 28px; }
.rn-bars { display: flex; align-items: flex-end; gap: 12px; flex-basis: 100%; }
.rn-err { margin-top: 0; }
.rl-modal { width: min(400px, calc(100vw - 32px)); }
.rl-modal h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.rl-modal input[type="text"] { width: 100%; }
.rl-modal-line { font-size: 14px; color: var(--muted); }
.rl-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.modal .rl-actions .btn { padding: 0 14px; }
.btn-danger, .btn-danger:hover { border: 1px solid var(--border); background: var(--ink); color: var(--paper); }
.btn-danger.is-busy > .ui-spin { --spin-c: var(--paper); }
.btn-danger:disabled { opacity: 1; background: transparent; color: var(--grey-fg); border-color: var(--grey-fg); }

/* replays search + bulk delete (docs/REPLAYS_SEARCH_PLAN.md) */
.rl-top { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.rl-find { position: relative; z-index: 50; flex: 1 1 360px; max-width: 680px; min-width: 0; }
.rl-search { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 46px; padding: 5px 0; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; cursor: text; }
.rl-search:focus-within { border-bottom-width: 3px; }
.rl-search svg { flex: 0 0 auto; color: var(--muted); }
.rl-search input[type="text"] { flex: 1 1 140px; min-width: 0; height: 34px; padding: 0; border: 0; border-bottom: 0; outline: 0; background: transparent; font-size: 15px; }
.rl-tags { display: contents; }
.rl-tag { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 2px 0 10px; border-radius: 0; background: var(--pill-bg); font-size: 13px; white-space: nowrap; }
.rl-tag button { width: 24px; height: 24px; border: 0; border-radius: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.rl-tag button:hover { background: var(--border); color: var(--ink); }
.rl-drop { position: absolute; top: calc(100% + 8px); left: 0; width: 820px; max-width: calc(100vw - 32px); display: flex; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow); overflow: hidden; }
@media (max-width: 960px) { .rl-drop { width: auto; right: 0; max-width: none; } }
.rl-drop-l, .rl-drop-r { flex: 1 1 300px; min-width: 0; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; }
.rl-drop-l { border-right: 1px solid var(--border-soft); }
.rl-drop-r { background: var(--paper); }
.rl-drop-foot { flex: 1 1 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border-soft); }
.rl-grow { flex: 1; }
.rl-lbl { font-family: var(--label); font-size: 11px; color: var(--muted); }
.rl-lbl:not(:first-child) { margin-top: 10px; }
.rl-tks { display: flex; flex-wrap: wrap; gap: 8px; max-height: 220px; overflow-y: auto; }
.rl-tk { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 0; background: var(--paper); font-family: var(--label); font-size: 13px; color: var(--ink); cursor: pointer; }
.rl-tk:hover { border-color: var(--grey-fg); }
.rl-tk[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rl-n { font-family: var(--label); font-size: 11px; font-weight: 400; color: var(--muted); }
.rl-tk[aria-pressed="true"] .rl-n { color: var(--border-input); }
.rl-match { display: flex; align-items: baseline; gap: 10px; min-height: 36px; padding: 8px 10px; box-sizing: border-box; border-radius: 0; color: var(--ink); text-decoration: none; font-size: 14px; }
.rl-match:hover { background: var(--card-alt); }
.rl-match .rl-n { flex: 0 0 auto; font-size: 12px; }
.rl-opts { display: flex; flex-direction: column; gap: 2px; }
.rl-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.rl-opt:hover { background: var(--card-alt); }
.rl-opt[aria-pressed="true"] { background: var(--chip-bg); font-weight: 600; }
.rl-range { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.rl-range input { flex: 1 1 0; min-width: 0; height: 40px; padding: 0 10px; box-sizing: border-box; border: 1px solid var(--border-input); border-radius: 0; font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); }
.rl-range input:focus { outline: 0; border-color: var(--ink); }
.rl-ghost { border-color: transparent; background: none; }
.rl-bulk { gap: 8px; }

.rl-pick-modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; }
.rl-pick-tools { display: flex; gap: 4px; margin: -6px 0 -8px -10px; }
.rl-pick-tools .btn { padding: 0 10px; }
.rl-pick { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 0; }
.rl-pick-row { flex: 0 0 auto; display: grid; grid-template-columns: 22px 48px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--border-soft); background: var(--paper); font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.rl-pick-row:last-child { border-bottom: 0; }
.rl-pick-row:hover { background: var(--card-alt); }
.rl-pick-row[aria-pressed="true"] { background: var(--card-alt); font-weight: 600; }
.rl-pick-row:disabled { cursor: default; }
.rl-mark { width: 18px; height: 18px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 0; }
.rl-pick-row[aria-pressed="true"] .rl-mark { background: var(--ink); }
.rl-pick-row .rl-n { font-size: 12px; }
.rl-pick-ret { font-family: var(--label); font-size: 12px; }

/* data page (Lane D) */
.data-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.data-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.data-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.data-orats { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 8px; }
.data-orats[hidden], .data-orats > [hidden], #oratsModal[hidden], #upModal[hidden], .data-err[hidden] { display: none !important; }
.data-link { background: none; border: 0; padding: 0 2px; font: inherit; font-size: 12px; color: var(--ink); text-decoration: underline; cursor: pointer; }
.data-link:disabled { color: var(--muted); cursor: default; }
.data-ticker-input { width: 180px; font-family: var(--label); font-size: 13px; }
.data-card { overflow: hidden; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.data-row {
  display: grid; grid-template-columns: 90px minmax(0,1fr) minmax(0,1fr) minmax(0,160px);
  gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; align-items: center; min-width: 620px;
}
.data-row-head { padding: 8px 0; font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border); }
.data-scroll .data-row-head { position: sticky; top: 0; z-index: 1; background: var(--paper); }
.data-row-hit { background: var(--card-alt); }
.data-row-msg { padding: 11px 16px; }
.data-sym { font-weight: 600; }
.data-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.data-pill { background: transparent; border: 1px solid var(--border); color: var(--ink); white-space: nowrap; }
.data-st-loading { background: var(--chip-bg); }
.data-st-none { background: transparent; border: 1px solid var(--border-soft); color: var(--muted); }
.data-private { background: var(--card-alt); color: var(--muted); }
.data-range { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-bar { flex-grow: 1; height: 6px; background: var(--chip-bg); border-radius: 0; overflow: hidden; }
.data-bar-fill { display: block; height: 6px; background: var(--ink); border-radius: 0; }
.data-note { font-size: 12px; color: var(--muted); white-space: nowrap; }
.data-err { font-size: 13px; color: var(--red); }
.data-modal-line { font-size: 14px; }
.data-modal-link { font-size: 13px; }
.data-tools { padding: 10px 0; }
.data-search { width: 280px; max-width: 100%; height: 44px; font-family: var(--label); font-size: 13px; }
.data-scroll { max-height: 70vh; min-height: 240px; overflow: auto; }
.data-ticker-field { position: relative; display: inline-flex; }
.data-load-err { position: absolute; top: calc(100% + 4px); left: 0; white-space: nowrap; }
#upModal .modal, #oratsModal .modal { max-width: calc(100vw - 32px); }

/* trade settings (settings.html) */
.ts { }
.ts-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ts-save { display: flex; flex-direction: column; align-items: flex-end; max-width: 100%; }
.ts-save .btn { min-width: 96px; }
.ts-save .err { flex-basis: auto; text-align: right; }
.ts-tab { height: 38px; padding: 0 16px; }
.ts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ts-card { padding: 16px 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ts-card-title { margin: 0; font-size: 16px; font-weight: 600; }
.ts-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ts-lbl { font-size: 13px; color: var(--muted); }
.ts-input {
  display: flex; align-items: center; gap: 6px; height: 44px; padding: 0;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent;
}
.ts-input:focus-within { border-color: var(--ink); }
.ts-input:has(input[aria-invalid="true"]) { border-bottom-width: 4px; }
.ts-input input[type="text"], .ts-input input {
  flex: 1 1 auto; min-width: 0; width: 100%; border: 0; border-bottom: 0; outline: 0; padding: 0; background: transparent;
  font: 15px var(--label); color: var(--ink);
}
.ts-input input::placeholder { color: var(--grey-fg); }
.ts-affix { flex: 0 0 auto; color: var(--grey-fg); font: 13px var(--label); white-space: nowrap; }
.ts-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--border-input); border-radius: 0; overflow: hidden; }
.ts-seg button { height: 42px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.ts-seg button + button { border-left: 1px solid var(--border-input); }
.ts-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.ts-kelly { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.ts-kelly .ts-input { padding: 0 10px; gap: 4px; }
@media (max-width: 1000px) {
  .ts-grid { grid-template-columns: minmax(0, 1fr); }
}

/* data page — user data keys line (sheet strategies) */
.data-keys { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.data-keys .data-orats { margin-right: 0; }
.data-keys .data-orats:target { color: var(--ink); }
#keyModal[hidden] { display: none !important; }
#keyModal .modal { max-width: calc(100vw - 32px); }

/* my strategies (strategies.html, s.html) */
/* status = dot + word (READABLE_SITE_PLAN P4) */
.st-ok { color: var(--green); }
.st-warn { color: var(--amber); }
.st-grey { color: var(--muted); }
.st-pill::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 7px; vertical-align: 1px; }
.st-pill { font-size: 12px; padding: 3px 8px; border-radius: 0; justify-self: start; white-space: nowrap; }
.st-list .rl-row { grid-template-columns: minmax(0,1fr); min-width: 860px; }
.st-list .rl-cols { grid-template-columns: minmax(0,2fr) minmax(0,1.4fr) 150px 120px 80px 100px; }
.st-src { font-size: 12px; font-family: var(--label); color: var(--muted); }
.st-add { gap: 8px; }
.st-back { font-size: 13px; color: var(--muted); text-decoration: none; }
.st-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.st-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-title h1 { margin: 0; font-size: 24px; font-weight: 600; overflow-wrap: anywhere; }
.st-files { display: flex; gap: 6px; flex-wrap: wrap; }
.st-file { font-size: 12px; font-family: var(--label); padding: 4px 10px; border-radius: 0; background: var(--pill-bg); }
.st-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.st-tab { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; font: 600 12px var(--label); color: var(--muted); cursor: pointer; white-space: nowrap; }
.st-tab:first-child { padding-left: 0; }
.st-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.st-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; align-items: start; }
.st-card-title { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); font-family: var(--display); font-weight: 600; font-size: 14px; }
.st-banner { margin: 12px 16px 4px; padding: 10px 14px; border-radius: 0; background: var(--pill-bg); font-size: 13px; font-weight: 600; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.st-banner .btn { height: 32px; font-size: 12px; padding: 0 12px; }
.st-scroll { overflow-x: auto; }
.st-assets .st-arow { display: grid; grid-template-columns: 70px minmax(0,1.2fr) 80px 130px 150px; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; align-items: center; min-width: 600px; }
.st-assets .st-arow:last-child { border-bottom: 0; }
.st-colhead { font-size: 12px; color: var(--muted); font-family: var(--label); }
.st-assets .st-colhead { padding: 8px 16px; }
.st-tabname { font-family: var(--label); font-weight: 600; }
.st-more { padding: 10px 16px; font-size: 13px; color: var(--muted); }
.st-run { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.st-run-title { font-family: var(--display); font-weight: 600; font-size: 14px; }
.st-two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.st-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-field label { font-size: 12px; color: var(--muted); }
.st-field input[type="text"], .st-field select { height: 36px; padding: 0 10px; font-size: 13px; width: 100%; min-width: 0; }
.st-field input[type="text"] { font-family: var(--label); }
.st-run-btn { height: 40px; font-size: 14px; }
.st-run-btn:disabled { background: var(--grey-fg); color: var(--paper); }
.st-code pre { margin: 0; max-height: 60vh; overflow: auto; background: var(--card-alt); border-radius: 0; padding: 14px 16px; font-family: var(--mono); font-size: 12px; white-space: pre; }
.st-frow { display: grid; grid-template-columns: 130px minmax(0,1fr) minmax(0,1.3fr); gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; align-items: start; min-width: 640px; }
.st-frow.st-colhead { font-size: 12px; }
.st-frow code { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-xl { color: var(--ink); }
.st-stack { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) {
  .st-grid { grid-template-columns: minmax(0,1fr); }
}

/* Connections + Data market summary (docs/NEWSPRINT_SITE_PLAN.md) */
.cn { max-width: 720px; display: flex; flex-direction: column; gap: 18px; }
.cn h1 { margin: 0; }
.cn-list { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cn-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; padding: 18px 0; }
.cn-who { display: flex; flex-direction: column; gap: 4px; }
.cn-name { font: 600 18px var(--display); }
.cn-state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 7px; vertical-align: 1px; }
.cn-state { font: 15px var(--display); color: var(--muted); }
.cn-state.cn-on { color: var(--green); }
.cn-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; }
.dm-table th { padding: 8px 0; text-align: left; font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border); }
.dm-table td { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.dm-table tr:last-child td { border-bottom: 1px solid var(--border); }
.dm-table td:first-child { font: 600 20px var(--display); }
.dm-scroll { overflow-x: auto; }

/* Connect Claude */
.cc { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 32px 40px; }
.cc-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cc-side { border-left: 1px solid var(--border); padding-left: 40px; }
@media (max-width: 760px) { .cc-side { border-left: 0; padding-left: 0; } }
.cc-field { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.cc-url { display: flex; border: 1px solid var(--border); }
.cc-url code { flex: 1; min-width: 0; padding: 12px 14px; font-size: 15px; overflow-x: auto; white-space: nowrap; }
.cc-url .btn { border-width: 0 0 0 2px; flex: 0 0 auto; }
.cc-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.cc-steps li { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.cc-steps li span:first-child { font: 600 18px var(--display); width: 24px; flex: 0 0 auto; }
.cc-quote { margin: 0; font: 400 18px/1.5 var(--display); }
.cc-copy { align-self: flex-start; }

/* Sign-in tabs */
.si-tab[aria-selected="true"] { border-bottom: 1px solid var(--border) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Replays Manage (docs/TIDY_MENUS_PLAN.md D3) */
.rl-checkcol { display: none; }
.rl-managing .rl-row { grid-template-columns: 36px minmax(0,1fr) 44px; }
.rl-managing .rl-checkcol { display: block; }
.rl-managing a.rl-cols { cursor: pointer; }
.rl-check { width: 16px; height: 16px; margin: 0 0 0 4px; accent-color: var(--ink); cursor: pointer; }
.rl-manage { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.rl-manage-n { font-size: 14px; font-weight: 600; }
.rl-manage .rl-link { margin-left: 0; }
.rl-manage .btn { padding: 0 14px; }
