/* Arthvyuh design system (approved 29 Sep 2026; spacing and hierarchy refined 30 Sep after the AlgoRooms
   comparison): neutral surfaces, restrained indigo, Inter 400/500, light and dark themes. */
/* Inter (SIL Open Font License 1.1, fonts/OFL.txt), self-hosted: pages load no third-party files.
   Variable font; one file per subset covers weights 400-500. The rupee sign has its own 1.2 KB file (16 Oct 2026: cut
   from inter-latin-ext with fontTools 4.62.1 + Brotli 1.2.0), so a page with prices no longer loads the 83 KB latin-ext
   file; that one is now fetched only for other accented letters (for example in a fund name). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/inter-rupee.woff2") format("woff2");
  unicode-range: U+20B9;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20B8, U+20BA-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched stand-in used only until Inter arrives: same line height and width, so the text does not jump when the font swaps in (29 Oct 2026) */
@font-face {
  font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 107.4%; ascent-override: 90.2%; descent-override: 22.5%; line-gap-override: 0%;
}
:root, :root[data-theme="light"] {
  --bg: #F3F4F8; --side: #FAFBFC; --surface: #FFFFFF; --inset: #F1F3F7;
  --text: #16202E; --text-2: #5A6678;
  --border: #E3E7EE; --control: #8C97A8;
  --primary: #4F46E5; --primary-hover: #4338CA; --on-primary: #FFFFFF; --primary-edge: #4F46E5;
  --link: #4338CA; --sel-bg: #EEF0FF; --sel-text: #3730A3;
  --pos: #157347; --neg: #B42318; --warn: #92400E; --focus: #4338CA;
  --pos-fill: rgba(21, 115, 71, .10); --neg-fill: rgba(180, 35, 24, .10); --warn-fill: rgba(146, 64, 14, .08);
  --itm: #FBF8EC; --shadow: 0 1px 2px rgba(22, 32, 46, .04);
  --logo-ring: #818CF8; --logo-line: #4F46E5; --logo-dot: #6366F1;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1116; --side: #14171D; --surface: #1A1D24; --inset: #232833;
  --text: #F1F3F5; --text-2: #A9B3C2;
  --border: #2E3440; --control: #6B778A;
  --primary: #4F46E5; --primary-hover: #4338CA; --on-primary: #FFFFFF; --primary-edge: #A5B4FC;
  --link: #A5B4FC; --sel-bg: #272650; --sel-text: #C7D2FE;
  --logo-ring: #6366F1; --logo-line: #A5B4FC; --logo-dot: #A5B4FC;
  --pos: #5DCEA0; --neg: #FF8A80; --warn: #F5C56B; --focus: #A5B4FC;
  --pos-fill: rgba(93, 206, 160, .14); --neg-fill: rgba(255, 138, 128, .14); --warn-fill: rgba(245, 197, 107, .12);
  --itm: #221F16; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", "Inter Fallback", "Segoe UI", sans-serif; font-size: 15px; font-weight: 400; line-height: 1.6;
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
b, strong { font-weight: 500; }
.num, td.num, .metric-value { font-variant-numeric: tabular-nums lining-nums; }
svg.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---- shell: sidebar, top bar, page ------------------------------------------------ */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
/* collapsible side menu: icons only, names on hover */
.nav-toggle { position: absolute; top: 18px; right: 10px; width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 8px;
  font-size: 15px; line-height: 1; color: var(--text-2); background: transparent; border-color: var(--border); }
.nav-toggle:hover { color: var(--text); background: var(--inset); }
.sub-ico { display: none; }
@media (min-width: 901px) {
  html.nav-collapsed .layout { grid-template-columns: 64px minmax(0, 1fr); }
  html.nav-collapsed aside { padding: 16px 8px; overflow-x: hidden; }
  html.nav-collapsed aside .brand { justify-content: center; margin: 2px 0 10px; font-size: 0; gap: 0; }
  html.nav-collapsed aside .brand span:not(.mark) { display: none; }
  html.nav-collapsed .nav-toggle { position: static; display: block; margin: 0 auto 14px; }
  html.nav-collapsed aside nav a { justify-content: center; padding-left: 0; padding-right: 0; }
  html.nav-collapsed aside nav a > span:not(.sub-ico), html.nav-collapsed aside nav .group { display: none; }
  html.nav-collapsed aside nav a.sub { padding-left: 0; }
  html.nav-collapsed aside nav a.sub::before { display: none; }
  html.nav-collapsed .sub-ico { display: inline-flex; }
  html.nav-collapsed aside .user .who > span:not(.avatar), html.nav-collapsed aside .user .admin { display: none; }
  html.nav-collapsed aside .user .who { justify-content: center; }
  html.nav-collapsed aside .user form button { font-size: 0; gap: 0; justify-content: center; width: 100%; }
}
@media (max-width: 900px) { .nav-toggle { display: none; } }
aside {
  background: var(--side); border-right: 1px solid var(--border);
  padding: 16px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; letter-spacing: -.5px;
  color: var(--text); text-decoration: none; margin: 2px 8px 22px; }
.brand span:not(.mark) { color: var(--link); margin-left: -10px; }
.logo { flex: none; display: block; }
.logo-ring { fill: none; stroke: var(--logo-ring); stroke-width: 4; }
.logo-line { fill: none; stroke: var(--logo-line); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.logo-dot { fill: var(--logo-dot); }
aside nav a, aside nav .group {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; margin-bottom: 4px;
  border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px;
}
aside nav a:hover { background: var(--inset); color: var(--text); }
aside nav a.on { background: var(--primary); color: var(--on-primary); font-weight: 500; }
aside nav .group { margin-bottom: 0; }
aside nav .group.open { color: var(--text); }
aside nav a.sub { min-height: 34px; padding-left: 42px; font-size: 14px; position: relative; }
aside nav a.sub::before { content: ""; position: absolute; left: 24px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: currentColor; opacity: .55; }
aside nav a.sub.on { background: var(--sel-bg); color: var(--sel-text); }
aside nav a.sub.on::before { opacity: 1; }
aside nav .count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: auto; border-radius: 9px; background: var(--primary);
  color: var(--on-primary); font-size: 12px; line-height: 18px; text-align: center; }
.user { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.user .who { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.user .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user .who small { display: block; color: var(--text-2); font-size: 12px; }
.user .who > span:last-child { min-width: 0; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--sel-bg); color: var(--sel-text); font-weight: 500; }
.user .admin { display: block; margin: 8px 0 0 44px; font-size: 13px; }
.user form { margin: 6px 0 0 36px; }

.page { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 28px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar .status { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.topbar .tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 99px; font-size: 13px;
  background: var(--inset); color: var(--text-2); text-decoration: none; white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--control); }
.chip.ok { background: var(--pos-fill); color: var(--pos); } .chip.ok i { background: var(--pos); }
.chip.warn { background: var(--warn-fill); color: var(--warn); } .chip.warn i { background: var(--warn); }
a.chip:hover { text-decoration: underline; }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
.icon-button:hover, .icon-button.on { color: var(--text); background: var(--inset); }
.icon-button .count { position: absolute; top: -6px; right: -6px; min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--primary); color: var(--on-primary); font-size: 12px; line-height: 18px; text-align: center; }
main { padding: 24px 28px 8px; max-width: 1600px; width: 100%; }
body[data-page="simulator"] main:has(.sim-app) { max-width: none; padding: 14px 16px 8px; }      /* the simulator uses the whole window */

h1 { font-size: 22px; font-weight: 500; line-height: 1.3; letter-spacing: -.4px; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 500; line-height: 1.45; letter-spacing: -.1px; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 500; line-height: 1.45; margin: 0 0 8px; }
p { margin: 0 0 12px; line-height: 1.65; }
p.lead { color: var(--text-2); font-size: 14px; margin: 0 0 20px; max-width: 820px; }
.muted, .help { color: var(--text-2); font-size: 13px; line-height: 1.6; }

/* ---- cards and grids ----------------------------------------------------------------- */
.panel, .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px;
  margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0;
}
.panel.inset { background: var(--inset); box-shadow: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.grid2 > .panel, .grid3 > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1 1 140px; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- metric values ------------------------------------------------------------------- */
.stat { background: var(--inset); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.stat .label { display: block; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.metric-value { display: block; font-size: 22px; font-weight: 500; line-height: 1.3; letter-spacing: -.4px;
  overflow-wrap: anywhere; }
.metric-value.small { font-size: 18px; letter-spacing: -.2px; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .zero { color: var(--text); }
/* one-line "label value" strip (market data, summaries) */
.kv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; font-size: 13px; }
.kv > span { color: var(--text-2); white-space: nowrap; }
.kv > span b { color: var(--text); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
.kv > span small { font-size: 12px; margin-left: 4px; }

/* ---- forms ---------------------------------------------------------------------------- */
label { display: block; color: var(--text-2); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 7px 10px; min-height: 36px;
  background: var(--surface); color: var(--text); border: 1px solid var(--control); border-radius: 8px;
  font: inherit; font-size: 14px;
}
input:hover, select:hover { border-color: var(--text-2); }
input:disabled, select:disabled { background: var(--inset); color: var(--text-2); border-color: var(--border); cursor: not-allowed; }
input[aria-invalid="true"] { border-color: var(--neg); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 16px; height: 16px; min-height: 0;
  margin: 0 8px 0 0; accent-color: var(--primary); vertical-align: -3px; }
.check { display: flex; flex-wrap: wrap; row-gap: 4px; align-items: center; color: var(--text); font-size: 14px; margin: 6px 0; min-width: 0; }
.check.disabled { color: var(--text-2); }

/* ---- buttons --------------------------------------------------------------------------- */
button, .button {
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; letter-spacing: normal;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--control); background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { background: var(--inset); }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary-edge); color: var(--on-primary); }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); }
button.primary:disabled, button.primary:disabled:hover { background: var(--inset); border-color: var(--border); color: var(--text-2); }
button.danger { color: var(--neg); }
button.ghost { border-color: transparent; background: transparent; color: var(--link); }
button.small, .button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
button.tiny { min-height: 24px; padding: 2px 7px; font-size: 12px; border-radius: 6px; }
@media (pointer: coarse) {          /* phones and tablets: a finger needs 44 px (tiny table buttons keep 24) */
  button:not(.tiny), .button:not(.tiny) { min-height: 44px !important; }   /* wins over page-level compact sizes */
}
button:disabled, button[aria-disabled="true"] { background: var(--inset); border-color: var(--border);
  color: var(--text-2); cursor: not-allowed; }
.seg { display: inline-flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; border: 1px solid var(--control);
  border-radius: 8px; background: var(--surface); }
.seg button { border: 0; border-radius: 0; min-height: 34px; background: transparent; font-weight: 400; color: var(--text); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-text); font-weight: 500; }
.seg.icons { border-color: var(--border); }
.seg.icons button { min-height: 34px; padding: 0 9px; color: var(--text-2); }
.seg.icons button.on { color: var(--sel-text); }
/* chips: small toggle buttons in a row (periods, steps, filters) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 30px; padding: 4px 10px; font-size: 13px; font-weight: 400; border-color: var(--border); }
.chips button[aria-pressed="true"], .chips button.on { background: var(--sel-bg); color: var(--sel-text); border-color: var(--link); font-weight: 500; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  color: var(--text-2); font-weight: 400; min-height: 40px; padding: 7px 12px; }
.tabs button:hover { background: none; color: var(--text); }
.tabs button.on, .tabs button[aria-selected="true"] { color: var(--sel-text); border-bottom-color: var(--link); font-weight: 500; }
:root[data-theme="dark"] .tabs button.on { color: var(--link); }

/* ---- labels ------------------------------------------------------------------------------ */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; white-space: nowrap;
  font-size: 12px; line-height: 1.6; border: 1px solid var(--control); color: var(--text); background: var(--surface); }
.pill.side { font-weight: 500; }
.pill.lock { border-color: var(--link); color: var(--link); }
.pill.ok { border-color: var(--pos); color: var(--pos); }
.pill.live { border-color: var(--neg); color: var(--neg); background: var(--neg-fill); font-weight: 500; }
.pill.warn { border-color: var(--warn); color: var(--warn); }
.pill.bad { border-color: var(--neg); color: var(--neg); }
.bs { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; font-size: 12px; font-weight: 500; }
.bs.buy { background: var(--pos-fill); color: var(--pos); }
.bs.sell { background: var(--neg-fill); color: var(--neg); }

/* ---- builder pieces ------------------------------------------------------------------------ */
.leg { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: var(--inset); }
.leg input, .leg select { background: var(--surface); }
.leg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cond { display: grid; grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.cond .params { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cond .params input, .cond .params select { margin: 0; padding: 5px 7px; min-height: 32px; font-size: 13px; width: 88px; }
.section-label { font-size: 13px; color: var(--text-2); margin: 0 0 8px; }

/* ---- strategy cards -------------------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.card .title { font-size: 16px; font-weight: 500; letter-spacing: -.1px; line-height: 1.4; overflow-wrap: anywhere; }
.card .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.card .meta span { display: block; color: var(--text-2); font-size: 12px; }
.card .legs div { background: var(--inset); border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: 13px; }
.card .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.card .actions .primary { flex: 1; }
button.card-button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  white-space: normal; padding: 12px 14px; min-height: 72px; font-weight: 400; border-color: var(--border); border-radius: 12px; }
button.card-button b { font-weight: 500; }
button.card-button:hover { border-color: var(--link); background: var(--surface); }

/* ---- tables ------------------------------------------------------------------------------------ */
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.table-wrap.tall { max-height: 560px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--inset); position: sticky; top: 0; z-index: 1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--inset); }
table.dense th, table.dense td { padding: 6px 10px; }
td .secondary { color: var(--text-2); font-size: 12px; }

/* option chain */
.chain td { position: relative; }
.chain td.itm { background: var(--itm); }
.chain tr.atm td { background: var(--sel-bg); color: var(--sel-text); }
.chain tr.atm td.strike { font-weight: 500; }
.chain td.strike { text-align: center; }
.chain td.strike small { display: block; font-size: 12px; color: var(--text-2); line-height: 1.3; }
.chain tr.atm td.strike small { color: var(--sel-text); }
.chain .tag { display: inline-block; margin-left: 6px; font-size: 12px; padding: 0 6px; border-radius: 99px;
  border: 1px solid currentColor; }
.chain .delta { color: var(--text-2); font-size: 12px; }
.chain tr.atm .delta { color: var(--sel-text); }

/* ---- states ------------------------------------------------------------------------------------- */
.state { text-align: center; color: var(--text-2); padding: 32px 16px; font-size: 14px; }
.state strong { display: block; color: var(--text); font-weight: 500; margin-bottom: 4px; }
.state.error { color: var(--neg); }
.error { color: var(--neg); min-height: 20px; font-size: 13px; }
.error:not(:empty)::before { content: "⚠ "; }
.ok { color: var(--pos); font-size: 13px; }
.ok:not(:empty)::before { content: "✓ "; }
.note { border: 1px solid var(--border); border-left: 3px solid var(--warn); background: var(--surface);
  color: var(--text); padding: 12px 16px; border-radius: 0; margin-bottom: 16px; font-size: 13px; }
.note.done { border-left-color: var(--pos); }
.note .label { color: var(--warn); font-weight: 500; margin-right: 6px; }
.progress { height: 6px; background: var(--inset); border-radius: 9px; overflow: hidden; margin: 12px 0 6px; }
.progress div { height: 100%; background: var(--primary); width: 0; transition: width .4s; }

/* ---- charts ------------------------------------------------------------------------------------- */
.chart-box { position: relative; }
svg.chart { width: 100%; height: 280px; display: block; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .zero { stroke: var(--control); stroke-width: 1; stroke-dasharray: 4 4; }
svg.chart .axis { fill: var(--text-2); font-size: 12px; font-family: "Inter", "Inter Fallback", "Segoe UI", sans-serif; }
svg.chart .series { fill: none; stroke: var(--link); stroke-width: 2; }
svg.chart .dd { fill: var(--neg-fill); stroke: var(--neg); stroke-width: 1; stroke-dasharray: 3 3; }
svg.chart .oi-ce, .oi-legend i.oi-ce { fill: var(--neg); background: var(--neg); }
svg.chart .oi-pe, .oi-legend i.oi-pe { fill: var(--pos); background: var(--pos); }
svg.chart .axis.atm { fill: var(--text); font-weight: 500; }
.oi-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.oi-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
svg.chart .mtm-area { stroke: none; opacity: .14; }
svg.chart .mtm-area.up { fill: var(--pos); }
svg.chart .mtm-area.down { fill: var(--neg); }
svg.chart .marker { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 4 4; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--link); vertical-align: middle; margin-right: 6px; }
.legend i.dd { border-top: 1px dashed var(--neg); }
.legend i.zero { border-top: 1px dashed var(--control); }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
  white-space: nowrap; transform: translate(-50%, -110%); }

/* ---- dialog ------------------------------------------------------------------------------------- */
dialog { box-sizing: border-box; border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text);
  width: min(460px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(15, 17, 22, .45); }
dialog .body { padding: 20px; }
dialog .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
#deploy-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#deploy-dialog .body { min-height: 0; overflow-y: auto; }
#deploy-dialog .foot { flex-shrink: 0; }

/* ---- responsive ------------------------------------------------------------------------------------ */
@media (max-width: 1100px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  /* phone: a calm top bar, four main places at the bottom, the full menu slides in from the left under More */
  .layout { grid-template-columns: minmax(0, 1fr); }
  aside { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(84vw, 320px); height: auto;
    transform: translateX(-105%); transition: transform .2s ease, visibility 0s linear .2s; border-right: 1px solid var(--border);
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; visibility: hidden; }
  /* closed, the menu is also hidden from the keyboard and screen readers (phone sweep, 16 Oct 2026): before, Tab walked
     through its 17 links off-screen before reaching the page */
  html.menu-open aside { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); visibility: visible; transition: transform .2s ease; }
  .menu-shade { position: fixed; inset: 0; z-index: 55; background: rgba(15, 17, 22, .45); }
  .brand { margin: 0 0 10px; }
  .top-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--text); text-decoration: none; }
  .top-brand > span > span { color: var(--link); }
  .topbar { padding: 10px 16px; position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
  .topbar .status, .topbar .theme-toggle { display: none; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 58px; padding: 6px 2px; border: 0; border-radius: 0; background: none; color: var(--text-2); font-size: 11px;
    font-weight: 500; text-decoration: none; }
  .bottom-nav svg.icon { width: 22px; height: 22px; }
  .bottom-nav .on { color: var(--link); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  main { padding: 14px 16px; }
  main > h1 { font-size: 22px; margin-bottom: 4px; }
  main > .lead.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px; }
  .lead-more { margin: 0 0 12px; font-size: 13px; }
  footer.legal { margin: 16px; font-size: 11px; }
  .promo-text > span, .promo-shine { display: none; }
  .promo { padding: 12px 14px; gap: 10px; }
  .promo-badge { width: 46px; height: 46px; }
  .promo-badge small { display: none; }
  .promo-cta { width: auto; padding: 6px 12px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .cond { grid-template-columns: minmax(0, 1fr); }
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label > .seg { display: flex; width: fit-content; max-width: 100%; margin-top: 4px; }
label > .seg button { color: var(--text); }
.row > label:has(> .seg) { flex: 0 1 auto; }
[hidden] { display: none !important; }
.cond .params label.param { margin: 0; font-size: 13px; }
.cond .params label.param input, .cond .params label.param select { margin-top: 2px; }
.auth { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.auth .brand { margin-bottom: 18px; }
footer.legal { margin: 20px 28px 12px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 12px; line-height: 1.6; max-width: 900px; }
.banner { background: var(--inset); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
ul.notes { list-style: none; margin: 0; padding: 0; }
ul.notes li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
ul.notes li:last-child { border-bottom: 0; }
ul.notes li.warn span:last-child::before { content: "⚠ "; }
@media (max-width: 600px) { ul.notes li { grid-template-columns: 1fr; gap: 2px; } }

/* ---- simulator ------------------------------------------------------------------------------------ */
select.compact, input.compact { width: auto; margin: 0; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.sim-bar { padding: 14px 16px; }
.sim-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sim-toolbar .chips { gap: 4px; }
.sim-toolbar .chips button { min-height: 32px; padding: 4px 9px; }
.sim-toolbar .play { margin-left: auto; min-width: 84px; }
.sim-info { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
/* fixed places for the figures: nothing moves sideways while the replay plays */
.sim-info.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px; }
.sim-info.kv > span { overflow: hidden; text-overflow: ellipsis; }
table.chain { table-layout: fixed; width: 100%; }
table.chain th, table.chain td { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
table.chain th.strike, table.chain td.strike { width: 118px; }
#side { min-height: 380px; }
#payoff { min-height: 260px; }
.sim-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.sim-grid .panel { margin-bottom: 18px; }
.expiry-chips { margin-bottom: 12px; }
.expiry-chips button { flex-direction: column; gap: 0; min-height: 44px; padding: 4px 12px; line-height: 1.25; }
.expiry-chips button small { font-size: 12px; color: var(--text-2); font-weight: 400; }
.expiry-chips button[aria-pressed="true"] small { color: var(--sel-text); }
.chain-stats { margin-bottom: 12px; }
.chain td.ltp { min-width: 132px; }
.chain .acts { display: inline-flex; gap: 3px; margin-right: 8px; opacity: 0; transition: opacity .12s; vertical-align: 1px; }
.chain tr:hover .acts, .chain .acts:focus-within { opacity: 1; }
.chain .acts button { min-width: 22px; padding: 0 5px; }
button.tiny.buy { color: var(--pos); border-color: var(--pos); }
button.tiny.sell { color: var(--neg); border-color: var(--neg); }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 150px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.structure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
button.structure { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 10px 12px; min-height: 0;
  border-color: var(--border); border-radius: 12px; font-weight: 400; white-space: normal; text-align: center; }
button.structure:hover { border-color: var(--link); background: var(--surface); }
button.structure b { font-weight: 500; font-size: 13px; }
button.structure .help { font-size: 12px; }
.mini-payoff { width: 100%; height: 54px; }
.mini-payoff.empty { display: grid; place-items: center; font-size: 12px; color: var(--text-2); }
.mini-payoff .gain, svg.payoff-chart .gain { fill: var(--pos-fill); }
.mini-payoff .loss, svg.payoff-chart .loss { fill: var(--neg-fill); }
.mini-payoff .edge { fill: none; stroke: var(--text-2); stroke-width: 1.5; }
.mini-payoff .axis-line { stroke: var(--border); stroke-width: 1; }
svg.payoff-chart { height: 300px; }
svg.payoff-chart .series.expiry { stroke: var(--link); stroke-width: 2; }
svg.payoff-chart .series.today { stroke: var(--warn); stroke-width: 1.6; stroke-dasharray: 5 4; }
svg.payoff-chart .sigma1 { fill: var(--inset); }
svg.payoff-chart .sigma2 { fill: var(--inset); opacity: .5; }
svg.payoff-chart .hover-line { stroke: var(--text-2); stroke-width: 1; }
.legend i.expiry { border-top: 2px solid var(--link); }
.legend i.today { border-top: 2px dashed var(--warn); }
.legend i.band { height: 10px; border: 0; background: var(--inset); vertical-align: -1px; }
.tooltip b { display: block; font-weight: 500; margin-bottom: 2px; }
.payoff-summary { margin-bottom: 12px; }
.iv-shift { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper .num { min-width: 18px; text-align: center; color: var(--text); font-weight: 500; }
.pos-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
tr.closed td { color: var(--text-2); }
@media (max-width: 1200px) { .sim-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- dashboard ------------------------------------------------------------------------------------ */
.dash-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.dash-top > .panel { margin-bottom: 0; }
.hero { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--primary); color: var(--on-primary); min-width: 0; }
.hero-body { padding: 20px; flex: 1; }
.hero h2 { color: inherit; opacity: .9; margin-bottom: 8px; }
.hero-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.hero-head h2 { margin: 0; }
.hero-seg { border-color: rgba(255, 255, 255, .45); background: transparent; }
.hero-seg button { color: var(--on-primary); min-height: 30px; padding: 0 10px; font-size: 13px; }
.hero-seg button + button { border-left-color: rgba(255, 255, 255, .3); }
.hero-seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .95); color: var(--primary); }
.hero-value { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.6px; line-height: 1.25; }
.hero-sub { display: block; font-size: 13px; opacity: .9; margin-top: 4px; }
.hero-foot { display: flex; justify-content: space-between; padding: 12px 20px; background: var(--primary-hover); color: var(--on-primary);
  text-decoration: none; font-weight: 500; font-size: 14px; }
.hero-foot:hover { text-decoration: underline; }
.broker-line { display: flex; align-items: center; gap: 12px; }
.broker-line > div { flex: 1; min-width: 0; }
.broker-logo { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--sel-bg);
  color: var(--sel-text); font-weight: 500; flex: none; }
.switch-row { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.switch-label { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.card .actions button.added { background: var(--pos-fill); color: var(--pos); border-color: transparent; cursor: default; opacity: 1; }
.warn-line { color: var(--warn); margin: 6px 0 0; }
.switch-btn { background: none; border: 0; padding: 4px 2px; margin: 0; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; min-height: 0; }
.switch-btn:hover .switch { filter: brightness(1.08); }
.switch-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.switch { position: relative; display: inline-block; width: 34px; height: 20px; border-radius: 99px; background: var(--control); flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 17px; }
ul.mini-list { list-style: none; margin: 0; padding: 0; }
ul.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
ul.mini-list li:last-child { border-bottom: 0; }
ul.mini-list b { display: block; font-size: 14px; }
ul.mini-list small { display: block; color: var(--text-2); font-size: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.section-head h2 { font-size: 18px; margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); font-size: 13px; margin: 0; }
.support { background: var(--sel-bg); border-color: transparent; }
.support h2 { color: var(--sel-text); }
.support p { color: var(--text-2); font-size: 13px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .dash-top, .cards.three { grid-template-columns: minmax(0, 1fr); } }

/* ---- strategy lists --------------------------------------------------------------------------------- */
.list-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.list-tools .search { width: min(320px, 100%); margin: 0; }
.list-tools .count { margin-left: auto; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-head .help { font-size: 12px; }
.card .actions.two > * { flex: 1; }
summary.icon-button.small { width: 30px; height: 30px; font-size: 16px; line-height: 1; }
.menu-body button.menu-item { display: flex; width: 100%; justify-content: flex-start; border: 0; background: none; min-height: 32px;
  padding: 4px 8px; font-weight: 400; border-radius: 6px; }
.menu-body button.menu-item:hover { background: var(--inset); }
.menu-body button.menu-item.danger { color: var(--neg); }

/* ---- strategy builder ------------------------------------------------------------------------------ */
.builder-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.builder-cols .col > .panel:last-child { margin-bottom: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.save-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; position: sticky; bottom: 12px; z-index: 4;
  box-shadow: 0 6px 24px rgba(22, 32, 46, .10); }
.save-bar .grow { flex: 1 1 320px; margin: 0; }
.save-bar .error { flex-basis: 100%; min-height: 0; }
@media (max-width: 1200px) { .builder-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---- backtest form -------------------------------------------------------------------------------- */
fieldset.picks { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 16px; }
label.pick { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 6px 12px 6px 10px; border: 1px solid var(--border);
  border-radius: 99px; color: var(--text); font-size: 14px; cursor: pointer; background: var(--surface); }
label.pick input { margin-right: 4px; }
label.pick small { color: var(--text-2); font-size: 12px; margin-left: 4px; }
label.pick:has(input:checked) { border-color: var(--link); background: var(--sel-bg); color: var(--sel-text); }
label.pick.disabled { color: var(--text-2); cursor: not-allowed; }
.bt-run { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }
.bt-run label { margin: 0; }
.bt-run input.compact { width: 160px; min-height: 36px; margin-top: 4px; }
.bt-run #run { margin-left: auto; }
.bt-run .help { align-self: center; }
.bt-run select.compact { margin-top: 4px; min-height: 36px; }
.bt-run select.compact.wide { min-width: 240px; }
.leg-grid { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 12px; }
.leg-grid > label { flex: 1 1 130px; margin: 0; min-width: 0; }
.leg-grid > label:first-child { flex: 0 0 76px; }
.leg-grid > label:has(> .seg) { flex: 0 0 auto; }
.exits { display: grid; gap: 10px; margin: 4px 0 12px; padding: 12px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.exit-row { display: grid; grid-template-columns: 104px repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.exit-row > label { margin: 0; }
.check.wide { flex-wrap: nowrap; align-items: flex-start; gap: 8px; }
.check.wide > input { margin-top: 3px; flex: none; }
.check.wide > span { flex: 1; min-width: 0; line-height: 1.5; }
.exit-row > .check { align-self: end; min-height: 36px; margin: 0; }
@media (max-width: 600px) { .exit-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.contact-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none; min-width: 0; transition: transform .12s, box-shadow .12s; }
.contact-tile:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(22, 32, 46, .10); }
.contact-tile b { display: block; font-size: 14px; }
.contact-tile small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-tile > span { min-width: 0; }
svg.brand-icon { width: 36px; height: 36px; flex: none; }
@media (max-width: 600px) { .contact-tiles { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .contact-tile { transition: none; } .contact-tile:hover { transform: none; } }

/* ---- sign-in pages --------------------------------------------------------------------------------- */
body.login-page { background: var(--surface); }
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: 40px 48px; background: #1E1B4B; color: #E0E7FF; }
.login-art::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 520px; height: 520px; border-radius: 50%;
  background: #4F46E5; opacity: .35; filter: blur(90px); animation: glow 9s ease-in-out infinite alternate; }
.login-art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(199, 210, 254, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(199, 210, 254, .07) 1px, transparent 1px);
  background-size: 44px 44px; animation: gridmove 24s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at 60% 55%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at 60% 55%, #000 30%, transparent 75%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .login-blob { position: absolute; z-index: 0; width: 380px; height: 380px; border-radius: 50%; left: -120px; bottom: -140px;
  background: #0EA5E9; opacity: .22; filter: blur(90px); animation: glow 12s ease-in-out infinite alternate-reverse; }
.login-stage { position: relative; }
.login-glass { position: absolute; z-index: 2; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(199, 210, 254, .22); backdrop-filter: blur(8px); color: #EEF2FF;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25); font-size: 13px; }
.login-glass b { display: block; font-weight: 500; color: #fff; }
.login-glass small { color: #C7D2FE; font-size: 12px; }
.login-glass.g1 { top: -6px; left: 4%; flex-direction: column; align-items: flex-start; width: 250px;
  animation: pop-in .6s 1.9s both, bob 6s 2.6s ease-in-out infinite; }
.login-glass.g2 { top: 36%; right: 2%; animation: pop-in .6s 2.4s both, bob 5s 3s ease-in-out infinite; }
.lg-label { color: #C7D2FE; }
.lg-bar { width: 100%; height: 6px; border-radius: 6px; background: rgba(199, 210, 254, .18); overflow: hidden; }
.lg-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #818CF8, #5DCEA0);
  animation: fill 2.2s 2.2s cubic-bezier(.3, .7, .3, 1) forwards; }
.lg-done { opacity: 0; color: #5DCEA0 !important; animation: fade .4s 4.4s forwards; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: #5DCEA0; box-shadow: 0 0 0 0 rgba(93, 206, 160, .6); animation: ring 2s infinite; }
.login-home { position: absolute; top: 22px; left: 26px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.login-home:hover { color: var(--text); }
.login-form { position: relative; }
.auth-card input { transition: border-color .15s, box-shadow .2s; }
.auth-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .16); outline: none; }
.auth-card button.primary.block { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.auth-card button.primary.block:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79, 70, 229, .28); }
.auth-card button.primary.block::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); }
.auth-card button.primary.block:hover::after { transform: translateX(120%); transition: transform .7s ease; }
.auth-card .stack > * { animation: rise .45s ease-out both; }
.auth-card .stack > :nth-child(2) { animation-delay: .06s; } .auth-card .stack > :nth-child(3) { animation-delay: .12s; }
.auth-card .stack > :nth-child(4) { animation-delay: .18s; } .auth-card .stack > :nth-child(5) { animation-delay: .24s; }
.auth-card .stack > :nth-child(6) { animation-delay: .3s; } .auth-card .stack > :nth-child(7) { animation-delay: .36s; }
.owner-renewals td { white-space: normal; vertical-align: top; }
.owner-renewals td.nowrap, .owner-renewals td.num { white-space: nowrap; }
.owner-renewals td.help { min-width: 220px; }
.owner-renewals summary { white-space: nowrap; cursor: pointer; }
.site-notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: var(--sel-bg); color: var(--sel-text);
  font-size: 14px; line-height: 1.5; }
/* two-step sign-in */
.auth-card .qr { display: block; margin: 4px auto 10px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.auth-card .setup-key { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 6px; background: var(--inset);
  font-size: 14px; letter-spacing: .5px; user-select: all; }
.auth-card .steps-list { margin: 0 0 12px; padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.auth-card .backup-codes { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0; margin: 0 0 18px; }
.auth-card .backup-codes code { display: block; text-align: center; padding: 8px; border-radius: 8px; background: var(--inset);
  font-size: 15px; letter-spacing: .5px; user-select: all; }
.auth-card .switch-line button.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; font-weight: 500;
  letter-spacing: -.5px; color: var(--text); margin-bottom: 18px; }
.auth-brand span:not(.mark) { color: var(--link); margin-left: -10px; }
.auth-card h1 { text-align: center; color: var(--primary); font-size: 28px; margin: 0 0 6px; }
:root[data-theme="dark"] .auth-card h1 { color: var(--link); }
.auth-card .sub { text-align: center; margin: 0 0 22px; }
.auth-card input:not([type="checkbox"]) { background: var(--inset); border: 1px solid transparent; border-radius: 8px; min-height: 48px; padding: 0 14px; }
.auth-card input:not([type="checkbox"]):focus { background: var(--surface); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border-radius: 8px;
  background: var(--inset); color: var(--text); text-decoration: none; font-weight: 500; transition: background .15s, box-shadow .15s; }
.google-btn:hover { background: var(--border); }
.or-line { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; color: var(--text-2); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-card .forgot { justify-self: end; align-self: flex-end; margin: -4px 0 0; font-size: 13px; text-decoration: none; }
.auth-card .stack { display: flex; flex-direction: column; gap: 12px; }
.auth-card button.primary.block { min-height: 48px; font-size: 15px; border-radius: 8px; }
.auth-card .switch-line { text-align: center; }
.dev-mail { white-space: pre-line; font-size: 13px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; width: 38px; padding: 0;
  display: grid; place-items: center; border: 0; background: transparent; color: var(--text-2); }
.pw-toggle:hover { color: var(--text); }
@keyframes gridmove { to { background-position: 44px 44px; } }
@keyframes fill { to { width: 100%; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(93, 206, 160, .55); } 70% { box-shadow: 0 0 0 9px rgba(93, 206, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(93, 206, 160, 0); } }
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 500; letter-spacing: -.5px; color: #fff; }
.login-brand span:not(.mark) { color: #A5B4FC; margin-left: -10px; }
.login-brand { --logo-ring: #A5B4FC; --logo-line: #fff; --logo-dot: #C7D2FE; }      /* on the purple panel */
.login-brand.small { --logo-ring: #818CF8; --logo-line: #4F46E5; --logo-dot: #6366F1; }
.login-brand.small { font-size: 20px; color: var(--text); margin-bottom: 26px; display: none; }
.login-brand.small span:not(.mark) { color: var(--link); }
.login-pitch h2 { font-size: 30px; line-height: 1.25; letter-spacing: -.6px; color: #fff; max-width: 480px; margin: 0 0 12px;
  animation: rise .7s ease-out both; }
.login-pitch p { color: #C7D2FE; max-width: 460px; font-size: 15px; animation: rise .7s .12s ease-out both; }
.login-chart { width: 100%; height: 230px; }
.login-chart .grid-lines line { stroke: rgba(199, 210, 254, .14); stroke-width: 1; }
.login-chart .candles rect { fill: #5DCEA0; opacity: 0; animation: candle .5s ease-out forwards; }
.login-chart .candles rect.down { fill: #FF8A80; }
.login-chart .area { fill: url(#lg-fill); opacity: 0; animation: fade 1s 1.6s ease-out forwards; }
.login-chart .line { fill: none; stroke: #A5B4FC; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 2.2s .3s ease-out forwards; }
.login-chart .dot { fill: #fff; opacity: 0; animation: fade .4s 2.4s forwards, pulse 1.8s 2.8s ease-in-out infinite; transform-origin: 520px 30px; }
.login-points { list-style: none; display: flex; gap: 28px; flex-wrap: wrap; margin: 0; padding: 0; }
.login-points li { animation: rise .6s ease-out both; }
.login-points li:nth-child(2) { animation-delay: .1s; } .login-points li:nth-child(3) { animation-delay: .2s; }
.login-points b { display: block; font-size: 20px; color: #fff; font-weight: 500; }
.login-points span { font-size: 13px; color: #C7D2FE; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); animation: rise .5s ease-out both; }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card .stack { margin-top: 22px; }
.auth-card input { min-height: 42px; }
button.block { width: 100%; min-height: 42px; }
.switch-line { margin-top: 18px; }
.legal-line { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
/* Arthvyuh's channels (templates/_social.html): colour mark + name, in a row or (landing footer) a column */
.follow-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; }
.follow-link:hover { color: var(--text); }
.follow-link svg.brand-icon { width: 22px; height: 22px; border-radius: 6px; }
.follow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.follow-row > b { font-size: 12px; font-weight: 600; color: var(--text-2); }
.login-follow { margin-top: 14px; font-size: 13px; }
.public-foot .follow-row { margin: 8px 0 10px; }
.login-chart .candles rect:nth-child(1) { animation-delay: .1s; } .login-chart .candles rect:nth-child(2) { animation-delay: .2s; }
.login-chart .candles rect:nth-child(3) { animation-delay: .3s; } .login-chart .candles rect:nth-child(4) { animation-delay: .4s; }
.login-chart .candles rect:nth-child(5) { animation-delay: .5s; } .login-chart .candles rect:nth-child(6) { animation-delay: .6s; }
.login-chart .candles rect:nth-child(7) { animation-delay: .7s; } .login-chart .candles rect:nth-child(8) { animation-delay: .8s; }
.login-chart .candles rect:nth-child(9) { animation-delay: .9s; } .login-chart .candles rect:nth-child(10) { animation-delay: 1s; }
.login-chart .candles rect:nth-child(11) { animation-delay: 1.1s; } .login-chart .candles rect:nth-child(12) { animation-delay: 1.2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes candle { from { opacity: 0; transform: translateY(12px); } to { opacity: .85; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { r: 5; } 50% { r: 8; } }
@keyframes glow { from { transform: translate(0, 0); } to { transform: translate(-60px, 40px); } }
@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .login-brand.small { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .login-art::before, .login-art::after, .login-blob, .login-glass, .login-glass *, .auth-card .stack > *, .login-pitch h2, .login-pitch p,
  .login-points li, .auth-card, .login-chart * { animation: none !important; }
  .lg-bar i { width: 100%; } .lg-done { opacity: 1; }
  .login-chart .candles rect { opacity: .85; } .login-chart .area, .login-chart .dot { opacity: 1; }
  .login-chart .line { stroke-dashoffset: 0; }
}

/* ---- public pages: risk disclosure, legal texts ------------------------------------------------------ */
body.public-page { background: var(--bg); }
.public-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.public-top .brand { margin: 0; }
.public-main { padding: 28px; max-width: 1180px; margin: 0 auto; }
.public-foot { max-width: 1180px; margin: 0 auto; padding: 18px 28px 28px; color: var(--text-2); font-size: 13px; }
.public-foot nav { margin-bottom: 6px; }
.risk-card { max-width: 760px; margin: 4vh auto; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--warn);
  border-radius: 14px; padding: 28px 32px; box-shadow: 0 16px 40px rgba(22, 32, 46, .10); animation: rise .35s ease-out both; }
.risk-modal { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px 28px;
  border: 1px solid var(--border); border-top: 4px solid var(--warn); border-radius: 16px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(15, 17, 22, .35); animation: rise .3s ease-out both; }
.risk-modal::backdrop { background: rgba(15, 17, 22, .45); backdrop-filter: blur(3px); }
.risk-modal h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 20px; }
.risk-modal ul.risk-points { margin: 14px 0; }
.risk-modal ul.risk-points li { padding: 10px 12px; font-size: 13px; }
.risk-modal .check { margin: 14px 0; }
.risk-modal button.block { min-height: 44px; font-size: 15px; }
.risk-modal button:disabled { opacity: .5; cursor: not-allowed; }
.risk-foot { margin: 10px 0 0; text-align: center; }
.risk-badge.small { width: 30px; height: 30px; font-size: 16px; margin: 0; }
body.risk-open .layout, body.risk-open .public-main { filter: blur(3px); pointer-events: none; user-select: none; }
.risk-badge { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--warn-fill);
  color: var(--warn); font-weight: 500; font-size: 20px; margin-bottom: 10px; }
ul.risk-points { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
ul.risk-points li { padding: 12px 14px; background: var(--inset); border-radius: 10px; font-size: 14px; line-height: 1.55; }
ul.risk-points b { display: block; margin-bottom: 2px; }
.risk-actions button { width: 100%; min-height: 44px; font-size: 15px; }
.risk-leave { text-align: center; margin: 8px 0; }
.error-card { max-width: 560px; margin: 8vh auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px; text-align: center; box-shadow: 0 16px 40px rgba(22, 32, 46, .10); animation: rise .35s ease-out both; }
.error-card .error-code { margin: 0 0 4px; font-size: 44px; font-weight: 500; letter-spacing: -1px; color: var(--link); }   /* dark: readable (was 2.7:1) */
.error-card h1 { margin: 0 0 8px; }
.error-card p { color: var(--text-2); }
.error-card .actions { justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.billing-dialog { width: min(440px, calc(100vw - 32px)); }
.billing-dialog h2 { font-size: 18px; margin-bottom: 4px; }
.billing-dialog .help { margin: 0 0 18px; }
.billing-dialog label { margin-bottom: 16px; color: var(--text); font-weight: 500; }
.billing-dialog input, .billing-dialog select { margin-top: 6px; font-weight: 400; }
.billing-dialog .error:empty { display: none; }
.billing-dialog label:last-of-type { margin-bottom: 4px; }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 18px; margin-top: 22px; }
.row-title { font-size: 20px; margin: 0 0 12px; }
.join-list { display: grid; gap: 14px; padding: 18px 20px; }
.join-item { display: flex; align-items: center; gap: 14px; }
.join-item svg { width: 36px; height: 36px; flex: none; }
.join-item b { flex: 1; font-weight: 500; }
.join-item .button { min-width: 72px; justify-content: center; }
.support-card { position: relative; overflow: hidden; border-radius: 14px; padding: 24px 26px; color: #fff;
  background: linear-gradient(120deg, #4338CA, #6366F1 60%, #818CF8); }
.support-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); }
.support-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 500; }
.support-card p { margin: 0 0 18px; opacity: .88; }
.support-actions { display: flex; flex-wrap: wrap; gap: 12px; position: relative; z-index: 1; }
.sup-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 10px; color: #fff;
  text-decoration: none; font-weight: 500; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .08);
  transition: background .15s, transform .15s; }
.sup-btn:hover { background: rgba(255, 255, 255, .18); transform: translateY(-1px); }
.sup-btn.solid { background: #fff; color: #312E81; border-color: #fff; }
.sup-btn svg { width: 18px; height: 18px; }
@media (max-width: 900px) { .join-row { grid-template-columns: 1fr; } }
/* ---- simulator, replay-deck layout (two-column style): top bar, chain on the left, analysis on the right,
   filling the window; nothing on the page moves while the replay plays ---- */
.sim-app { display: flex; flex-direction: column; gap: 12px; height: calc(100vh - 56px - 22px); min-height: 620px; }
.sim-top { padding: 10px 14px; margin: 0; }
.sim-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim-toolbar .sim-index { width: 130px; }
.sim-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 auto; }
.sim-steps button { min-height: 30px; padding: 2px 8px; font-size: 13px; background: transparent; border-color: transparent; }
.sim-steps button:hover { background: var(--inset); }
.sim-steps input[type="date"] { width: 150px; }
.sim-steps select { width: 64px; }
.sim-run { display: flex; align-items: center; gap: 6px; }
.sim-run select { width: 64px; }
.sim-run .play { min-width: 104px; }
.sim-info { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 18px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border); font-size: 13px; }
.sim-info > span { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .sim-info { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sim-info > span b { color: var(--text); font-weight: 500; margin-left: 5px; font-variant-numeric: tabular-nums; }
.sim-info > span small { margin-left: 4px; font-variant-numeric: tabular-nums; }
.sim-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: 12px; }
.sim-left, .sim-right { margin: 0; min-height: 0; display: flex; flex-direction: column; padding: 12px 14px; }
.sim-right { overflow-y: auto; }
.sim-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.sim-pane-head h2 { font-size: 15px; margin: 0; }
.expiry-carousel { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.expiry-carousel button { flex: none; display: flex; flex-direction: column; align-items: center; min-height: 40px; padding: 3px 12px;
  line-height: 1.25; background: transparent; border-color: transparent; font-size: 13px; }
.expiry-carousel button small { font-size: 12px; color: var(--text-2); }
.expiry-carousel button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-text); }
.expiry-carousel button[aria-pressed="true"] small { color: var(--sel-text); }
.chain-stats { display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 4px 12px; font-size: 13px;
  color: var(--text-2); margin-bottom: 8px; }
.chain-stats > span { white-space: nowrap; }
.chain-stats b { color: var(--text); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
.oi-split { display: inline-flex; align-items: center; gap: 6px; }
.oi-split b { margin: 0 !important; font-size: 12px; }
.oi-split i { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--pos); overflow: hidden; }
.oi-split em { display: block; height: 100%; background: var(--neg); }
.chain-wrap { flex: 1; min-height: 0; max-height: none !important; }
table.chain th.edge, table.chain td.edge { width: 58px; padding-left: 4px; padding-right: 4px; }
.chain td.edge { text-align: center; }
.chain td.edge .acts { margin: 0; display: none; opacity: 1; }
.chain tr:hover td.edge .acts, .chain td.edge .acts:focus-within { display: inline-flex; }
.chain td.edge .held { display: inline-flex; gap: 2px; }
.chain tr:hover td.edge .held { display: none; }
.sim-right svg.payoff-chart { height: 240px; }
.sim-right .payoff-summary { font-size: 13px; gap: 4px 18px; margin-bottom: 6px; }
.chain .held span { font-size: 12px; font-weight: 500; padding: 0 4px; border-radius: 4px; }
.chain .held .buy { background: var(--pos-fill); color: var(--pos); }
.chain .held .sell { background: var(--neg-fill); color: var(--neg); }
.sim-right .tabs { margin-bottom: 10px; flex: none; }
.sim-view { flex: none; min-height: 280px; }
.sim-view svg.chart { height: auto; }
.sim-right .payoff-summary { flex: none; }
.payoff-tools { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.positions-area { flex: none; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.small-tabs { margin-bottom: 8px; }
.small-tabs button { font-size: 13px; }
svg.strategy-chart .prem-line { fill: none; stroke: #8B5CF6; stroke-width: 2; }
svg.strategy-chart .spot-line { fill: none; stroke: var(--text-2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.oi-legend i.prem { background: #8B5CF6; }
.oi-legend i.spot { background: var(--text-2); }
@media (max-width: 1100px) {
  .sim-app { height: auto; }
  .sim-panes { grid-template-columns: minmax(0, 1fr); }
  .chain-wrap { max-height: 520px !important; }
  .sim-steps { margin: 0; }
}
/* backtest: TradingView-style equity and drawdown, broker-style P&L calendar */
svg.tv-chart { height: auto; }
svg.tv-chart .eq-up { fill: none; stroke: #16A34A; stroke-width: 2; }
svg.tv-chart .eq-down { fill: none; stroke: #DC2626; stroke-width: 2; }
svg.tv-chart .dd-bar { fill: #DC2626; opacity: .55; }
svg.tv-chart .cross { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; }
svg.tv-chart .cross-dot { fill: var(--surface); stroke: var(--link); stroke-width: 2; }
svg.tv-chart .pane-label { font-weight: 500; }
.legend i.eq { border-top: 2px solid #16A34A; }
.legend i.ddb { border: 0; height: 10px; width: 10px; background: #DC2626; opacity: .55; border-radius: 2px; }
.tv-tip { min-width: 170px; line-height: 1.5; }
.tv-tip b { display: block; margin-bottom: 2px; }
.month-tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.month-tile { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; border: 1px solid var(--border); min-height: 64px; }
.month-tile span { font-size: 12px; color: var(--text-2); }
.month-tile b { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.month-tile.pos b { color: var(--pos); }
.month-tile.neg b { color: var(--neg); }
.month-tile.empty { background: var(--inset); }
.heat-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.heat-month > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.heat-grid { display: grid; grid-template-rows: repeat(5, auto); grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: column; gap: 3px; max-width: 160px; }
.heat-grid i { display: block; aspect-ratio: 1; border-radius: 3px; }
.heat-grid i.pad { background: transparent; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.heat-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
@media (max-width: 1100px) { .month-tiles, .heat-months { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 560px) { .month-tiles, .heat-months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* launch offer banner (subscription and landing pages) */
.offer-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 0 0 16px; border-radius: 14px;
  background: linear-gradient(120deg, rgba(22, 163, 74, .14), rgba(79, 70, 229, .12)); border: 1px solid rgba(22, 163, 74, .35); }
.offer-banner > div { display: grid; gap: 2px; }
.offer-banner strong { font-size: 16px; font-weight: 500; }
.offer-banner span:not(.offer-tag) { font-size: 14px; color: var(--text-2); }
.offer-tag { flex: none; padding: 5px 10px; border-radius: 999px; background: #15803D; color: #fff; font-size: 12px; font-weight: 500;
  letter-spacing: 0;  }
.lp-offer { max-width: 760px; margin: 0 auto 26px; text-align: left; }
@media (max-width: 560px) { .offer-banner { flex-direction: column; align-items: flex-start; } }
/* FYERS account-opening offer (Broker page) */
.promo { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 18px 22px;
  margin: 4px 0 6px; border-radius: 16px; color: #fff; text-decoration: none;
  background: linear-gradient(120deg, #4F46E5, #9333EA 35%, #DB2777 55%, #2563EB 80%, #4F46E5);
  background-size: 300% 300%; animation: promo-in .7s cubic-bezier(.2, .9, .3, 1.2) both, promo-flow 6s ease-in-out infinite;
  box-shadow: 0 10px 28px -12px rgba(79, 70, 229, .7); transition: transform .2s ease, box-shadow .2s ease; }
.promo:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(79, 70, 229, .85); color: #fff; }
.promo:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.promo-shine { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .45) 50%, transparent 75%);
  transform: translateX(-100%); animation: promo-shine 2.4s ease-in-out infinite; pointer-events: none; }
.promo::after { content: ""; position: absolute; width: 180px; height: 180px; right: -40px; top: -90px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); animation: promo-orb 5s ease-in-out infinite; pointer-events: none; }
.promo-badge { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%;
  background: #FACC15; color: #1E1B4B; line-height: 1; text-align: center; animation: promo-bounce 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(250, 204, 21, .6); }
.promo-badge b { font-size: 22px; font-weight: 500; }
.promo-badge small { display: block; font-size: 12px; font-weight: 500; margin-top: -8px; }
.promo-text { flex: 1; min-width: 0; display: grid; gap: 4px; position: relative; z-index: 1; }
.promo-text strong { font-size: 16px; font-weight: 500; }
.promo-text span { font-size: 14px; opacity: .92; }
.promo-cta { flex: none; padding: 10px 18px; border-radius: 999px; background: #fff; color: #4338CA; font-weight: 500; font-size: 14px;
  white-space: nowrap; position: relative; z-index: 1; animation: promo-glow 1.8s ease-in-out infinite; }
.promo-cta span { display: inline-block; animation: promo-nudge 1.4s ease-in-out infinite; }
.promo-note { margin: 0 0 16px; font-size: 12px; }
@keyframes promo-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes promo-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes promo-bounce { 0%, 100% { transform: translateY(0) rotate(0); box-shadow: 0 0 0 0 rgba(250, 204, 21, .6); }
  20% { transform: translateY(-6px) rotate(-6deg); } 40% { transform: translateY(0) rotate(4deg); }
  60% { transform: translateY(-3px) rotate(-2deg); box-shadow: 0 0 0 12px rgba(250, 204, 21, 0); } 80% { transform: translateY(0) rotate(0); } }
@keyframes promo-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); } }
@keyframes promo-orb { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 20px); } }
@keyframes promo-shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes promo-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(250, 204, 21, .55); }
  50% { transform: scale(1.07); box-shadow: 0 0 0 10px rgba(250, 204, 21, 0); } }
@keyframes promo-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .promo, .promo::after, .promo-shine, .promo-badge, .promo-cta, .promo-cta span { animation: none; } }
@media (max-width: 560px) {
  .promo { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .promo-badge { width: 58px; height: 58px; }
  .promo-text { flex-basis: calc(100% - 74px); }
  .promo-cta { width: 100%; text-align: center; }
}
/* one light/dark button: the moon shows in light mode, the sun in dark mode */
.theme-toggle .when-dark { display: none; }
html[data-theme="dark"] .theme-toggle .when-dark { display: inline-flex; }
html[data-theme="dark"] .theme-toggle .when-light { display: none; }
.theme-toggle span { align-items: center; justify-content: center; }
.theme-toggle .when-light { display: inline-flex; }
/* template filters */
.tpl-tools { margin-bottom: 14px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.check-inline input { width: auto; min-height: 0; margin: 0; }
.tpl-tools .list-tools + .list-tools { margin-top: -4px; }
.tpl-select { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.tpl-select select { width: auto; min-width: 120px; }
.link-button { background: transparent; border-color: transparent; color: var(--link); padding: 0 6px; }
.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.legal-nav { position: sticky; top: 20px; display: grid; gap: 2px; }
.legal-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.legal-nav a:hover { background: var(--inset); color: var(--text); }
.legal-nav a.on { background: var(--sel-bg); color: var(--sel-text); font-weight: 500; }
.legal-doc { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 32px; max-width: 820px; }
.legal-doc h2 { font-size: 16px; margin: 22px 0 8px; }
.legal-doc p, .legal-doc li { font-size: 14px; line-height: 1.65; }
.legal-doc ul { padding-left: 20px; }
.draft-note { background: var(--warn-fill); color: var(--warn); padding: 8px 12px; border-radius: 8px; font-size: 13px; }
dl.contact-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; font-size: 14px; }
dl.contact-list dt { color: var(--text-2); }
dl.contact-list dd { margin: 0; }
@media (max-width: 800px) { .legal-layout { grid-template-columns: minmax(0, 1fr); } .legal-nav { position: static; display: flex; flex-wrap: wrap; }
  .risk-card, .legal-doc { padding: 20px; } .public-main { padding: 16px; } }

/* ---- subscription ------------------------------------------------------------------------------------ */
.plan-strip { display: grid; grid-template-columns: minmax(200px, 1.2fr) repeat(3, minmax(0, 1fr)); gap: 24px; align-items: center; }
.plan-name { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; margin: 2px 0; }
.meter .between { font-size: 13px; color: var(--text-2); }
.meter .bar { height: 6px; border-radius: 9px; background: var(--inset); overflow: hidden; margin-top: 6px; }
.meter .bar i { display: block; height: 100%; background: var(--primary); border-radius: 9px; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.price-card.featured { border: 2px solid var(--primary); }
.price-card h3 { font-size: 18px; margin: 0; }
.price-card .price { font-size: 30px; font-weight: 500; letter-spacing: -.6px; margin-top: 6px; }
.price-card .price small { font-size: 13px; color: var(--text-2); letter-spacing: 0; font-weight: 400; }
.price-card .per { min-height: 18px; }
.price-card .block { margin: 10px 0 12px; }
.price-card .ribbon { position: absolute; top: -11px; right: 18px; background: var(--primary); color: var(--on-primary); font-size: 12px;
  padding: 3px 10px; border-radius: 99px; }
.current-tag { margin: 10px 0 12px; padding: 9px; text-align: center; border-radius: 8px; background: var(--pos-fill); color: var(--pos); font-weight: 500; font-size: 14px; }
.current-tag.muted { background: var(--inset); color: var(--text-2); }
ul.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; }
ul.ticks li::before { content: "✓"; color: var(--pos); font-weight: 500; margin-right: 8px; }
.sub-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 14px; }
.faq details p { margin: 8px 0 0; color: var(--text-2); font-size: 14px; }
.receipt { max-width: 760px; margin: 2vh auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 32px; }
.receipt-parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; font-size: 14px; }
.receipt-parties > div { display: flex; flex-direction: column; gap: 2px; }
.receipt table { margin-bottom: 14px; }
.receipt tr.total td { border-top: 2px solid var(--border); }
.receipt-sign { text-align: right; font-size: 14px; margin: 18px 0; }
@media print { .public-top, .public-foot, #print { display: none; } .receipt { border: 0; box-shadow: none; } }
@media (max-width: 1000px) { .plan-strip, .price-grid, .receipt-parties { grid-template-columns: minmax(0, 1fr); } }
@media print { .receipt-parties { grid-template-columns: repeat(3, minmax(0, 1fr)); } .receipt { margin: 0 auto; padding: 0; } }   /* an invoice or a tax note fits one A4 page */

/* getting started */
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
ol.steps li { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
ol.steps li > div { flex: 1; min-width: 0; }
ol.steps b { display: block; font-size: 14px; }
ol.steps small { display: block; color: var(--text-2); font-size: 12px; }
ol.steps .tick { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%;
  border: 2px solid var(--control); color: var(--on-primary); font-size: 13px; }
ol.steps li.done { background: var(--inset); border-color: transparent; }
ol.steps li.done .tick { background: var(--pos); border-color: var(--pos); }
ol.steps li.next { border-color: var(--link); background: var(--sel-bg); }
.done-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.done-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px;
  color: var(--pos); background: var(--pos-fill); }
@media (max-width: 1100px) { ol.steps { grid-template-columns: minmax(0, 1fr); } }
.roll-dot { fill: var(--link); }

/* reports: strategy breakdown */
.report-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 16px; }
.breakdown { display: flex; align-items: center; gap: 20px; }
svg.donut { width: 150px; height: 150px; flex: none; }
.donut-label { fill: var(--text-2); font-size: 12px; }
.donut-value { fill: var(--text); font-size: 15px; font-weight: 500; }
ul.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; min-width: 0; flex: 1; }
ul.legend-list li { display: flex; align-items: center; gap: 8px; }
ul.legend-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
ul.legend-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-top .metrics { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .report-top { grid-template-columns: minmax(0, 1fr); } }
.danger-zone { border-color: var(--neg); }
.danger-zone h2 { color: var(--neg); }
.portfolio-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
section.portfolio { margin-bottom: 22px; }
section.portfolio > h2 { font-size: 15px; margin: 0 0 10px; }

/* ---- phones ---- */
@media (max-width: 560px) {
  /* iPhones zoom the page into any field whose text is smaller than 16px */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
  .sim-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .chain-stats > span { white-space: normal; }
  .oi-split i { width: 40px; }
  .chain-wrap { overflow-x: auto; }
  table.chain { min-width: 470px; }
  .tpl-select { width: 100%; justify-content: space-between; }
  .tpl-select select { flex: 1; max-width: 240px; }
  .breakdown { flex-wrap: wrap; }
  ul.legend-list { flex-basis: 100%; }
  .risk-modal { padding: 20px 18px; }
}

/* Paper trading */
.paper-status { gap: 8px; align-items: center; }
.paper-status a.pill { text-decoration: none; }
.paper-risk > label { display: flex; flex-direction: column; gap: 6px; }
.paper-capital { align-items: flex-end; }
.paper-capital > label { flex: 0 1 220px; }
.paper-steps { margin: 4px 0 0; padding-left: 20px; }
.paper-steps li + li { margin-top: 4px; }
.paper-how > summary { cursor: pointer; list-style: none; }
.paper-how > summary h2 { display: inline; }
.paper-how > summary::after { content: " +"; color: var(--text-2); }
.paper-how[open] > summary::after { content: " −"; }
.paper-how ul { margin-top: 12px; padding-left: 20px; }
.paper-how li + li { margin-top: 6px; }

/* Portfolio backtest */
label.pick .pick-lots { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; color: var(--text-2); font-size: 12px; }
label.pick .pick-lots input { width: 52px; padding: 2px 6px; height: 26px; margin: 0; }
.legend i.swatch.dashed { border-top: 2px dashed; }
.tv-tip i.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.portfolio-panel { border: 1px solid var(--link); }

/* Challenges */
.medal { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 600; color: #3b2a00; }
.medal.m1 { background: #F5C542; } .medal.m2 { background: #CBD5E1; color: #1e293b; } .medal.m3 { background: #D9A066; }
tr.me-row td { background: var(--inset); font-weight: 500; }
.join-box .row > label { flex: 1 1 260px; }
.past-challenges { list-style: none; padding: 0; margin: 0; }
.past-challenges li + li { margin-top: 8px; }
.past-challenges .winner { margin-left: 8px; white-space: nowrap; }
.badge-strip h2 { margin-bottom: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.win-badge { display: inline-flex; flex-direction: column; align-items: center; min-width: 108px; padding: 10px 12px 8px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--inset); font-weight: 600; font-size: 13px; text-align: center; }
.win-badge b { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  margin-bottom: 6px; font-size: 14px; color: #3b2a00; background: #E2E8F0; }
.win-badge small { font-weight: 400; color: var(--text-2); font-size: 11px; margin-top: 2px; }
.win-badge.gold b { background: #F5C542; } .win-badge.silver b { background: #CBD5E1; color: #1e293b; }
.win-badge.bronze b { background: #D9A066; } .win-badge.top10 b { background: #C7D2FE; color: #312E81; }
.win-badge.steady b { background: #A7F3D0; color: #065F46; } .win-badge.finisher b { background: #DDD6FE; color: #4C1D95; }
.badge-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.badge-chips .chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.badge-chips .chip.gold { background: #FEF3C7; color: #92400E; border-color: #F5C542; }
.badge-chips .chip.silver { background: #F1F5F9; color: #334155; border-color: #CBD5E1; }
.badge-chips .chip.bronze { background: #FDEBD3; color: #7C2D12; border-color: #D9A066; }
.badge-chips .chip.top10 { background: #EEF2FF; color: #3730A3; } .badge-chips .chip.steady { background: #ECFDF5; color: #065F46; }
.badge-chips .chip.finisher { background: #F5F3FF; color: #5B21B6; }

/* Model portfolio */
.model-chart { width: 100%; height: auto; }
.model-chart .model-line { fill: none; stroke: #16A34A; stroke-width: 2; }
.model-chart .model-area { fill: rgba(22, 163, 74, .10); }
.fy-table th[scope=row] { white-space: nowrap; }
.fy-table td.total { font-weight: 600; }
.fy-table tfoot td, .fy-table tfoot th { border-top: 1px solid var(--border); }
.model-lots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; }
.model-lots label { font-size: 13px; }
.model-lots input { width: 80px; }
.mix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; margin-top: 10px; }
.mix-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--inset); }
.mix-item.off { opacity: .55; }
.mix-item .check { margin: 0; font-size: 13px; }
.mix-lots { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; white-space: nowrap; font-size: 12px; color: var(--text-2); }
.mix-item .check { flex: 1 1 auto; min-width: 0; }
.mix-lots small { margin-right: 6px; }
.mix-lots input { width: 56px; padding: 2px 6px; height: 28px; margin: 0; flex: 0 0 auto; }
.mix-tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.mix-tag.default { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.mix-tag.custom { background: #FEF3C7; color: #92400E; border: 1px solid #F5C542; }
.mix-note { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--link); background: var(--inset); border-radius: 0; font-size: 13px; }
.mix-lots small.def { color: var(--text-2); margin-right: 6px; }
.qty-basis { white-space: normal; min-width: 220px; font-size: 12px; }
.auth-card a.button.block { display: flex; width: 100%; min-height: 48px; justify-content: center; align-items: center; font-size: 15px; border-radius: 8px; text-decoration: none; }
.plan-result { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--inset); }
.plan-result > p { margin: 0 0 10px; }
.plan-wait { margin-bottom: 10px; font-size: 14px; }
.plan-wait ul { margin: 6px 0 0 18px; padding: 0; }
.plan-wait li { color: var(--text-2); margin: 2px 0; }
.plan-from { color: var(--text-2); font-weight: 400; }
.static-ip .price-tag { background: #FEF3C7; color: #92400E; border-color: #FCD34D; font-weight: 600; }
.static-ip code { font-size: 15px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0; }
.plan-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.plan-card.recommended { border-color: var(--primary); }
.plan-card.chosen { box-shadow: 0 0 0 2px var(--primary); }
.plan-card h3 { margin: 0; font-size: 17px; }
.plan-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 6px; }
.plan-figs > div { display: flex; flex-direction: column; }
.plan-figs .label { font-size: 12px; color: var(--text-2); }
.plan-figs b { font-size: 16px; font-weight: 600; }
.plan-list { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; flex: 1; }
.plan-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 4px 0; border-top: 1px solid var(--border); }
.plan-list li small { grid-column: 1 / -1; }
.owner-tabs { align-items: center; }
.owner-tabs .tab-link { margin-left: auto; padding: 8px 12px; font-size: 14px; white-space: nowrap; }
.owner-tabs .tab-link + .tab-link { margin-left: 0; }
.tab-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; font-size: 11px; line-height: 18px; text-align: center; background: var(--inset); color: var(--text-2); }
.tab-count.warn { background: #FEF3C7; color: #92400E; }
.owner-panel > .panel:first-child { margin-top: 0; }
/* phone-only pieces stay hidden on larger screens */
.bottom-nav, .top-brand { display: none; }
@media (max-width: 900px) { .bottom-nav { display: grid; } .top-brand { display: inline-flex; } }
.plan-callout { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--primary); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; }
.plan-callout b { color: var(--link); white-space: nowrap; }
details.tpl-filters > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
  color: var(--link); margin: 6px 0; }
details.tpl-filters > summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) {
  .hero-seg { width: 100%; }
  .hero-seg button { flex: 1 1 0; padding: 0 6px; font-size: 12px; }
  select.wide, input.wide, .report-top select, .report-top input { max-width: 100%; }
  main label > select, main label > input { max-width: 100%; }
}
@media (max-width: 900px) {
  .bt-run { flex-wrap: wrap; grid-template-columns: minmax(0, 1fr); }
  .bt-run > * { min-width: 0; max-width: 100%; }
}
.plan-caution { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: #FEF3C7; color: #92400E; font-size: 12.5px; line-height: 1.45; }

/* Live order details stay readable without horizontal scrolling on a phone. */
.live-order-cards { display: none; }
.live-order-card { padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.live-order-card > small, .live-order-symbol { display: block; margin-top: 6px; }
.live-order-card p { margin: 8px 0 0; white-space: normal; }
#live-account-note { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .live-order-table { display: none; }
  .live-order-cards { display: block; }
  #live-pnl { align-items: flex-start; }
  #live-pnl > span { white-space: normal; }
}
/* Trading page: the account as FYERS shows it; tables on wide screens, one card per row on a phone. */
.trading-top { margin-bottom: 4px; }
.trading-top h1 { margin: 0; }
.tr-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tr-strip .help { display: block; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.tr-live { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 15px; font-weight: 500; color: var(--text-2); }
.tr-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--control); }
.tr-live.on { color: var(--pos); }
.tr-live.on i { background: var(--pos); animation: tr-pulse 2s ease-out infinite; }
@keyframes tr-pulse { 0% { box-shadow: 0 0 0 0 var(--pos-fill); } 60% { box-shadow: 0 0 0 6px var(--pos-fill); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .tr-live.on i { animation: none; } }
.tr-login { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
/* Live P&L positions (like a broker's): plain rows, open ones bold, closed ones faded; BUY / SELL tags */
tr.tr-row.open td { font-weight: 600; color: var(--text); }
tr.tr-row.closed td { color: var(--text-2); opacity: .7; }
.tr-side { display: inline-block; min-width: 38px; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600;
  letter-spacing: .03em; text-align: center; color: var(--text-2); background: var(--surface-2, rgba(127,127,127,.12)); }
.tr-side.buy { color: #2563EB; background: rgba(37,99,235,.12); }
.tr-side.sell { color: #EA580C; background: rgba(234,88,12,.12); }
td.tr-msg { white-space: normal; min-width: 180px; max-width: 420px; overflow-wrap: anywhere; }
td.tr-wrap { white-space: normal; min-width: 96px; max-width: 160px; }
.tr-cards { display: none; }
.tr-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 0 12px 10px; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent; overflow-wrap: anywhere; }
.tr-card.open .tr-sym { font-weight: 700; }
.tr-card.closed { opacity: .6; }
.tr-card .between { gap: 4px 12px; }
.tr-card p { margin: 4px 0 0; white-space: normal; }
.tr-legs { margin: 0; padding-left: 18px; font-size: 13px; }
table.tr-funds { max-width: 640px; }
@media (max-width: 900px) { .tr-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .tr-wide { display: none; }
  .tr-cards { display: block; }
  .tr-strip { gap: 8px; }
  .tr-strip .stat { padding: 10px 12px; }
  .tr-strip .metric-value.small { font-size: 16px; }
}

.phone-customize { display: none; }
.navigation-slot { display: grid; gap: 5px; margin: 12px 0; }
#navigation-dialog .foot { flex-wrap: wrap; }
#navigation-error { color: var(--neg); }
@media (max-width: 900px) {
  #side-menu .phone-pinned { display: none; }
  .phone-customize { display: block; margin: 8px 0; width: 100%; }
  #navigation-dialog { max-width: calc(100vw - 28px); }
}
/* a template's results for 1 lot and 2 lots (strategies.js lotResults) */
.lot-results { width: 100%; border-collapse: collapse; font-size: 13px; }
.lot-results th, .lot-results td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--border); }
.lot-results th[scope="row"] { text-align: left; font-weight: 400; color: var(--muted, inherit); }
.lot-results thead th.on { color: var(--text); text-decoration: underline; }

/* Broker: task-based layout using the existing type scale and theme tokens. */
body[data-page="broker"] main { max-width: none; }
.broker-page { width: 100%; }
.broker-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.broker-heading > a { font-size: 13px; white-space: nowrap; }
.broker-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); grid-template-areas: "connection daily" "preferences daily"; grid-template-rows: auto 1fr; gap: 20px; align-items: start; }
.broker-connection { grid-area: connection; }
.broker-daily { grid-area: daily; }
.broker-preferences { grid-area: preferences; }
.broker-layout > .panel { margin-bottom: 0; }
.broker-page .section-label { margin: 0 0 6px; }
.broker-page .panel { padding: 24px; }
.broker-page .panel-head { margin-bottom: 22px; }
.broker-page .panel-head h2 { margin: 0; }
.broker-intro { padding-bottom: 4px; }
.broker-intro h3 { margin-bottom: 6px; }
.broker-intro p { max-width: 60ch; }
.broker-connection .card { box-shadow: none; background: var(--inset); border-color: transparent; padding: 16px; }
.broker-connection .meta { gap: 16px; }
.broker-connection .meta > div { overflow-wrap: anywhere; }
.broker-disclosure { border-top: 1px solid var(--border); }
.broker-page .stack > .broker-disclosure + .broker-disclosure { margin-top: 0; }
.broker-disclosure > summary { cursor: pointer; padding: 16px 0; display: flex; align-items: center; gap: 10px; list-style: none; font-size: 14px; font-weight: 500; }
.broker-disclosure > summary::-webkit-details-marker { display: none; }
.broker-disclosure > summary::after { content: '+'; margin-left: auto; color: var(--text-2); font-size: 18px; font-weight: 400; }
.broker-disclosure[open] > summary::after { content: '−'; }
.broker-disclosure > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.broker-disclosure-body { padding: 0 0 18px; }
.broker-disclosure-body > :last-child { margin-bottom: 0; }
.broker-control { padding: 18px 0; border-top: 1px solid var(--border); }
.broker-control label, .broker-reminder-switch { color: var(--text); font-size: 14px; margin-bottom: 8px; }
.broker-control p { margin-bottom: 0; max-width: 52ch; padding-right: 25px; }
.broker-page input[type=checkbox] { flex-shrink: 0; }
.broker-page .broker-footnote { margin: 12px 0 0; }
.broker-notification-actions { align-items: center; margin: 16px 0 8px; }
.broker-page #rem-status:empty { display: none; }
.broker-daily > :last-child { margin-bottom: 18px; }
.broker-preferences > div:first-child { margin-bottom: 20px; }
.broker-preferences h2 { margin-bottom: 4px; }
.broker-preferences .broker-disclosure:last-child > summary { padding-bottom: 0; }
.broker-preferences .broker-disclosure:last-child[open] > summary { padding-bottom: 16px; }
.broker-referral { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.broker-referral img { flex-shrink: 0; }
.broker-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 24px; }
.broker-steps li { display: flex; align-items: start; gap: 8px; font-size: 13px; }
.broker-steps strong { display: block; font-weight: 500; }
.broker-steps small { display: block; color: var(--text-2); font-size: 12px; }
.broker-step-number { border: 1px solid var(--border); background: var(--inset); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; flex-shrink: 0; }
.broker-steps .complete .broker-step-number { color: var(--pos); }
.broker-instructions { padding-left: 20px; margin: 0; }
.broker-instructions li + li { margin-top: 14px; }
.broker-instructions .row { margin-top: 8px; align-items: center; }
.broker-page code { overflow-wrap: anywhere; word-break: break-word; }
.broker-manage { border-top: 1px solid var(--border); padding-top: 18px; }
.broker-pending { border-top: 1px solid var(--border); padding-top: 18px; }
@media (max-width: 1100px) {
  .broker-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "connection" "daily" "preferences"; }
  .broker-daily { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
}
@media (max-width: 640px) {
  .broker-page .panel { padding: 18px; }
  .broker-daily { display: block; }
  .broker-steps { grid-template-columns: 1fr; gap: 12px; }
  .broker-referral { align-items: start; flex-direction: column; }
  .broker-heading { align-items: start; }
}

/* Keep the referral visible and use the available page width. */
.broker-acquisition { margin: 0 0 20px; padding: 22px 24px; gap: 24px; animation: none; }
.broker-acquisition:hover { transform: none; }
.broker-acquisition::after { display: none; }
.broker-acquisition .promo-badge, .broker-acquisition .promo-cta { animation: none; }
.broker-acquisition .promo-text { gap: 6px; }
.broker-acquisition h2 { color: inherit; margin: 0; }
.broker-acquisition p { margin: 0; font-size: 14px; }
.broker-acquisition .broker-referral-journey { font-size: 13px; }
.broker-referral-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.broker-referral-actions .promo-cta { display: inline-block; text-decoration: none; width: auto; }
.broker-existing { color: inherit; font-size: 13px; text-underline-offset: 3px; }
.broker-existing:hover { color: inherit; }
.broker-acquisition .broker-referral-note { font-size: 12px; margin-top: 6px; }
.broker-referral-qr { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; flex: none; color: inherit; font-size: 12px; text-decoration: none; }
.broker-referral-qr:hover { color: inherit; }
.broker-referral-qr img { display: block; border-radius: 6px; }
.broker-referral-qr span { white-space: nowrap; }
#fyers-h { scroll-margin-top: 80px; }
@media (max-width: 900px) {
  .broker-acquisition { flex-wrap: wrap; }
  .broker-acquisition .promo-text { flex: 1 1 300px; }
}
@media (max-width: 640px) {
  .broker-acquisition { padding: 18px; gap: 16px; align-items: start; }
  .broker-acquisition .promo-badge { display: none; }
  .broker-acquisition .promo-text { flex-basis: 100%; }
  .broker-referral-actions { align-items: start; flex-direction: column; }
  .broker-referral-actions .promo-cta { white-space: normal; text-align: left; }
  .broker-referral-qr { grid-template-columns: 96px 1fr; align-items: center; justify-items: start; gap: 12px; }
  .broker-referral-qr img { width: 96px; height: 96px; }
  .broker-referral-qr span { white-space: normal; }
}

/* Guided strategy workspace: existing theme tokens and typography. */
body[data-page="builder"] main { max-width: none; }
.builder-import { margin-bottom: 20px; color: var(--text-2); font-size: 14px; }
.builder-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 8px; margin: 20px 0 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.builder-steps button { display: flex; align-items: center; gap: 10px; text-align: left; border-color: transparent; white-space: normal; background: transparent; padding: 12px; }
.builder-steps button.on { color: var(--sel-text); background: var(--sel-bg); }
.builder-step-number { display: inline-grid; place-items: center; flex: 0 0 26px; height: 26px; border: 1px solid var(--border); border-radius: 50%; font-size: 12px; }
.builder-steps button.on .builder-step-number { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.builder-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.builder-editor { min-width: 0; }
.builder-section-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 20px; }
.builder-section-heading h2 { margin: 0 0 5px; }
.builder-section-heading p { margin: 0; }
.builder-section-heading button { flex-shrink: 0; }
.builder-step-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0; }
.builder-step-actions .muted { font-size: 13px; }
.builder-overview { position: sticky; top: 20px; min-width: 0; overflow-wrap: anywhere; }
.builder-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.builder-summary-head h2 { margin: 0; }
.builder-summary-name { margin: 20px 0 4px; font-weight: 500; }
.builder-overview p { font-size: 13px; }
.builder-facts { margin: 18px 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; font-size: 12px; }
.builder-facts dt { color: var(--text-2); }
.builder-facts dd { margin: 0; text-align: right; }
.builder-summary-legs { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.builder-summary-legs > div { padding: 14px 0; }
.builder-summary-legs > div + div { border-top: 1px solid var(--border); }
.builder-summary-legs strong { font-size: 13px; }
.builder-summary-legs p { margin: 4px 0; }
.builder-summary-legs small { font-size: 12px; }
.builder-disclosure { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.builder-disclosure summary { cursor: pointer; font-size: 13px; color: var(--link); }
.builder-disclosure[open] summary { margin-bottom: 16px; }
.builder-review-row { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 18px 0; border-top: 1px solid var(--border); }
.builder-review-row > div { min-width: 0; overflow-wrap: anywhere; }
.builder-review-row > button { flex-shrink: 0; }
.builder-review-row h3 { margin: 0 0 8px; }
.builder-review-row p { margin: 6px 0; font-size: 13px; }
.builder-review-leg { padding: 12px 0; }
.builder-review-leg strong { font-size: 14px; }
.builder-save .error:not(:empty) { margin-top: 12px; }
#builder .cond { grid-template-columns: minmax(0,1fr) minmax(110px,.7fr) minmax(0,1fr) auto; }
#builder .cond select { max-width: 100%; }
@media (max-width: 1250px) {
  .builder-workspace { grid-template-columns: minmax(0,1fr) 265px; gap: 16px; }
  #builder .cond { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 1050px) {
  .builder-workspace { grid-template-columns: minmax(0,1fr); }
  .builder-overview { position: static; }
}
@media (max-width: 600px) {
  .builder-steps { gap: 4px; padding: 5px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .builder-steps button { gap: 6px; padding: 9px; font-size: 12px; }
  .builder-section-heading { flex-direction: column; gap: 10px; }
  .builder-step-actions { align-items: stretch; }
  .builder-step-actions .muted { max-width: 40%; }
  .builder-step-actions button { white-space: normal; }
  #builder .exit-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}

.builder-identity { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(0,1.3fr); gap: 24px; align-items: start; }
.builder-type-choice h2 { font-size: 14px; margin: 0 0 10px; }
.builder-type-choice p { font-size: 13px; margin: 8px 0 0; }
.builder-setup-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 18px; }
.builder-setup-grid .row { flex-wrap: wrap; }
@media (max-width: 1400px) { .builder-identity, .builder-setup-grid { grid-template-columns: minmax(0,1fr); gap: 12px; } }

@media (max-width: 600px) {
  #builder .seg { flex-wrap: wrap; overflow: visible; }
  .builder-type-choice > .seg { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .builder-type-choice > .seg button { white-space: normal; }
}

/* Touch screens (phone sweep, 16 Oct 2026): links that are controls, not words in a sentence, at least 44 px for a
   finger: the top-bar logo and bell, panel links, support buttons, the footer's legal links and the sign-in page links.
   Last in the file so page-level sizes (dashboard support buttons, the password toggle) do not undo it. Desktops with a
   mouse are unchanged. */
@media (pointer: coarse) {
  .top-brand, .panel-head > a, .sup-btn, footer.legal a, .login-home, .auth-card .forgot, .follow-link {
    display: inline-flex; align-items: center; min-height: 44px; }
  html body[data-page] .sup-btn { min-height: 44px; }        /* wins over dashboard.css's 38 px */
  footer.legal a { min-width: 44px; justify-content: center; }
  .topbar .icon-button { width: 44px; height: 44px; }
  .auth-card .pw-toggle { width: 44px; min-height: 44px; }
}

/* Touch screens, signed-in pages (phone sweep 2, 16 Oct 2026): text boxes, drop-downs, fold headings and the small
   icon menus at least 44 px for a finger; short segment and pill buttons at least 44 px wide. Like the button rule above,
   these win over page-level compact sizes. Desktops with a mouse are unchanged. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]), select, textarea {
    min-height: 44px !important; }
  details > summary { min-height: 44px; box-sizing: border-box; }
  summary.icon-button.small { width: 44px; height: 44px; }
  .seg button, .pill-tabs button { min-width: 44px; }
}

/* Sign-in and sign-up under 420 px (17 Oct 2026): "Arthvyuh home" on its own row above the card, not over the logo. */
@media (max-width: 420px) { .login-home { position: static; justify-self: start; margin: -24px 0 8px; } }

/* 10 Nov 2026 phone fixes (Sarathi / Surabhi's PA phone check): footer links get a 44 px tap area; the 404 / error card is easy to read in the dark look too */
.public-foot nav:not(.follow-row) a { display: inline-block; padding: 14px 6px; min-height: 44px; box-sizing: border-box; }
.public-foot p a { display: inline-block; padding: 12px 4px; min-height: 44px; box-sizing: border-box; }
.lp-foot nav a { display: block; padding: 11px 0; min-height: 44px; box-sizing: border-box; }
.error-card { border: 2px solid var(--control); }
.error-card h1 { color: var(--text); }
.error-card p { color: var(--text); }
.error-card .error-ref { color: var(--text-2); }
.error-card .actions .button { min-height: 44px; border: 1px solid var(--control); }
