*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f8f7f4; --surface: #ffffff; --surface2: #f1f0ec;
  --border: rgba(0,0,0,0.10); --border2: rgba(0,0,0,0.18);
  --text: #1a1a18; --text2: #6b6b67; --text3: #9a9a95;
  --green: #1a9e72; --green-bg: #e8f7f2;
  --red: #d44f2a; --red-bg: #faeae4;
  --amber: #b87516; --amber-bg: #fdf3e0;
  --blue: #1a5fa8; --blue-bg: #e8f0fb;
  --purple: #5340b5; --purple-bg: #eeedfe;
  --orange: #c05621; --orange-bg: #fbead9;
  --radius: 10px; --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.07);
  /* Set from admob.js on the native builds once the AdMob plugin reports the
     real adaptive-banner height (it draws over the WebView, not inside its
     DOM, so nothing here knows about it otherwise). Stays 0 on web / with
     no banner shown, so this is a no-op there. */
  --ad-banner-height: 0px;
}
/* Dark palette — applied when the OS prefers dark AND the user hasn't
   explicitly picked Light in Settings, or when they've explicitly picked
   Dark regardless of OS setting. Both rules carry equal specificity
   (:root + one attribute selector each); values are identical either way,
   so which one "wins" doesn't matter — only which condition is true does. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --surface: #1e1e1c; --surface2: #272725;
    --border: rgba(255,255,255,0.10); --border2: rgba(255,255,255,0.18);
    --text: #eeecea; --text2: #9a9a95; --text3: #6b6b67;
    --green: #2ec98e; --green-bg: #0d3326;
    --red: #e87050; --red-bg: #3a1a0e;
    --amber: #e6a030; --amber-bg: #3a2800;
    --blue: #5a9de8; --blue-bg: #0c2548;
    --purple: #8f7eee; --purple-bg: #1e1a42;
    --orange: #e6813f; --orange-bg: #3a2010;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(255,255,255,0.07);
  }
}
:root[data-theme="dark"] {
  --bg: #141413; --surface: #1e1e1c; --surface2: #272725;
  --border: rgba(255,255,255,0.10); --border2: rgba(255,255,255,0.18);
  --text: #eeecea; --text2: #9a9a95; --text3: #6b6b67;
  --green: #2ec98e; --green-bg: #0d3326;
  --red: #e87050; --red-bg: #3a1a0e;
  --amber: #e6a030; --amber-bg: #3a2800;
  --blue: #5a9de8; --blue-bg: #0c2548;
  --purple: #8f7eee; --purple-bg: #1e1a42;
  --orange: #e6813f; --orange-bg: #3a2010;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(255,255,255,0.07);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; background: var(--bg); color: var(--text); min-height: 100vh; }

/* Header */
.header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 2rem; display: flex; align-items: center; gap: 1.5rem; position: sticky; top: 0; z-index: 100; }
.logo { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; padding: 1rem 0; white-space: nowrap; }
.logo span { color: var(--green); }
.nav { display: flex; gap: 2px; flex: 1; }
.nav button { padding: 6px 14px; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text2); font-weight: 500; transition: all 0.12s; white-space: nowrap; }
.nav button:hover { background: var(--surface2); color: var(--text); }
.nav button.active { background: var(--surface2); color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn { padding: 7px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border2); background: var(--surface); color: var(--text); transition: all 0.12s; white-space: nowrap; }
.btn:hover { background: var(--surface2); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { opacity: 0.85; }

/* Layout */
.main { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem calc(3rem + var(--ad-banner-height)); }

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Metrics row */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.metric { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.metric-label { font-size: 11px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.metric-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.neu { color: var(--text); }
.metric-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.card-title { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .data-mgmt-grid { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 560px) { .data-mgmt-grid { grid-template-columns: 1fr !important; } }

/* Charts */
.chart-wrap { position: relative; width: 100%; }
.period-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 8px; }
.period-btns { display: flex; gap: 3px; }
.period-btns button { padding: 4px 10px; font-size: 12px; border: 1px solid var(--border); background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--text2); transition: all 0.1s; }
.period-btns button.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.tag-call { background: var(--blue-bg); color: var(--blue); }
.tag-put { background: var(--red-bg); color: var(--red); }
.tag-cc { background: var(--green-bg); color: var(--green); }
.tag-csp { background: var(--purple-bg); color: var(--purple); }
.tag-short-call { background: var(--amber-bg); color: var(--amber); }
.tag-short-put { background: var(--orange-bg); color: var(--orange); }

/* Education tooltips */
.info-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 4px; vertical-align: middle;
  border-radius: 50%; border: none; background: var(--surface2); color: var(--text3);
  font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer; font-family: inherit;
}
.info-tip:hover, .info-tip:focus-visible { background: var(--blue-bg); color: var(--blue); }
.info-tip-popover {
  position: fixed; z-index: 1000; max-width: 320px; padding: 12px 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 13px; line-height: 1.45;
  display: none;
}
.info-tip-popover.open { display: block; }
.info-tip-popover .info-tip-title { font-weight: 700; margin-bottom: 4px; }
.info-tip-popover .info-tip-more { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--blue); cursor: pointer; }

/* Ticker grid */
.ticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ticker-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.ticker-name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }
.ticker-pnl { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 4px; }
.ticker-meta { font-size: 11px; color: var(--text2); }
.wr-bar { height: 4px; border-radius: 2px; overflow: hidden; display: flex; margin-top: 10px; }
.wr-win { background: var(--green); }
.wr-loss { background: var(--red); }

/* Strat cards */
.strat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 1.5rem; }
.strat-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; }
.strat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.strat-name { font-size: 14px; font-weight: 600; }
.strat-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.strat-row:last-child { border-bottom: none; }
.strat-row span:last-child { font-weight: 600; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-open { background: var(--blue-bg); color: var(--blue); }
.badge-exp { background: var(--red-bg); color: var(--red); }
.badge-soon { background: var(--amber-bg); color: var(--amber); }

/* Mobile tables: stack each row as a label/value card instead of scrolling sideways.
   Cells get their data-label from app.js's applyMobileTableLabels(), which mirrors
   each column's <th> text onto its <td>s. */
@media (max-width: 700px) {
  .main table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .main table, .main table tbody, .main table tr { display: block; width: 100%; }
  .main table { border: none; }
  .main table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; padding: 4px 10px; background: var(--surface); }
  .main table tr:hover td { background: transparent; }
  .main table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; white-space: normal; border-bottom: 1px solid var(--border); }
  .main table td:last-child { border-bottom: none; }
  .main table td[data-label]::before { content: attr(data-label); font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; text-align: left; margin-right: auto; }
  .main table td:not([data-label]) { justify-content: flex-end; }
  .main table td[data-label=""]::before { content: none; }
  .main table td[colspan] { display: block; text-align: left; }

  /* Preserve the History tab's expand/collapse rows. The base .hist-child
     rules (display:none / .visible => table-row) have to be overridden
     explicitly in both directions here since they'd otherwise either outrank
     the generic "tr { display:block }" above (forcing collapsed rows visible)
     or leave expanded rows as table-row, which breaks the card layout. */
  .main table tr.hist-child:not(.visible) { display: none; }
  .main table tr.hist-child.visible { display: block; }

  /* Trim wide tables down to the columns that actually matter on a phone.
     Everything else is still in the data (Edit, or History/Wheel History's
     existing row-expand) — it just doesn't need to compete for space in a
     stacked card. Column positions are matched to each table's <thead>
     order, not to content, so :not([colspan]) keeps empty-state rows
     (which use a single colspan cell) from being caught by a hidden
     nth-child position. */
  #posBody tr > :is(td:nth-child(1), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(8), td:nth-child(9), td:nth-child(10)):not([colspan]) { display: none; }

  #histBody tr > :is(td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7), td:nth-child(8), td:nth-child(9), td:nth-child(10), td:nth-child(11), td:nth-child(12), td:nth-child(15)):not([colspan]) { display: none; }

  #wheelHistBody tr > :is(td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7), td:nth-child(8), td:nth-child(9), td:nth-child(10), td:nth-child(11), td:nth-child(12), td:nth-child(16)):not([colspan]) { display: none; }

  #stocksBody tr > :is(td:nth-child(1), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(8), td:nth-child(9)):not([colspan]) { display: none; }

  #stockHistBody tr > :is(td:nth-child(1), td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7), td:nth-child(10), td:nth-child(11)):not([colspan]) { display: none; }

  #wheelTradesBody tr > :is(td:nth-child(1), td:nth-child(4), td:nth-child(6), td:nth-child(7)):not([colspan]) { display: none; }
}

/* Upload zone */
.upload-zone { border: 2px dashed var(--border2); border-radius: var(--radius); padding: 3rem 2rem; text-align: center; cursor: pointer; transition: all 0.15s; margin-bottom: 1rem; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--green); background: var(--green-bg); }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-zone h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.upload-zone p { font-size: 13px; color: var(--text2); }
.upload-zone input[type=file] { display: none; }
.col-chip { display: inline-block; background: var(--surface2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 4px; font-family: monospace; font-size: 12px; margin: 2px; }
.import-hint { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin-bottom: 1rem; font-size: 13px; line-height: 1.7; color: var(--text2); }
.import-hint strong { color: var(--text); }

/* Status bar */
.status-bar { padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 1rem; display: none; }
.status-bar.success { background: var(--green-bg); color: var(--green); display: block; }
.status-bar.error { background: var(--red-bg); color: var(--red); display: block; }

/* Win-rate mini bars */
.wr-mini { height: 6px; border-radius: 3px; overflow: hidden; background: var(--border); margin-top: 8px; }
.wr-mini-fill { height: 100%; border-radius: 3px; background: var(--green); }
.wr-mini-fill.neg { background: var(--red); }

/* Sort row */
.sort-row { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; }
.sort-row label { font-size: 12px; color: var(--text2); font-weight: 500; }
select { padding: 6px 12px; border: 1px solid var(--border2); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); color: var(--text); cursor: pointer; }

/* Empty state */
.empty { text-align: center; padding: 3rem; color: var(--text2); font-size: 14px; }
.empty-icon { font-size: 2rem; margin-bottom: 8px; }

/* Expandable history rows */
.hist-parent td { cursor: pointer; }
.hist-parent:hover td { background: var(--surface2) !important; }
.hist-parent .expand-icon { display:inline-block; width:18px; font-size:11px; color:var(--text3); transition:transform 0.15s; }
.hist-parent.expanded .expand-icon { transform: rotate(90deg); }
.hist-child td { background: var(--surface2); font-size:12px; }
.hist-child td:first-child { padding-left:32px; }
.hist-child:last-of-type td { border-bottom: 2px solid var(--border2); }
.hist-child { display:none; }
.hist-child.visible { display:table-row; }
.leg-badge { display:inline-block; padding:1px 6px; border-radius:3px; font-size:10px; font-weight:700; }
.leg-open   { background:var(--blue-bg);   color:var(--blue); }
.leg-closed { background:var(--green-bg);  color:var(--green); }
.leg-loss   { background:var(--red-bg);    color:var(--red); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text2); margin-bottom: 10px; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: middle; }

/* Overview top perf list */
.perf-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.perf-row:last-child { border-bottom: none; }

/* History table */
#view-history th, #view-history td { padding: 8px 5px !important; font-size: 12.5px; }
#view-history .table-wrap { overflow-x: auto; max-height: 70vh; }

/* Nav dropdown */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown button { padding: 6px 14px; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text2); font-weight: 500; white-space: nowrap; }
.dropdown-content { display: none; position: absolute; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); min-width: 160px; z-index: 101; padding: 4px 0; border: 1px solid var(--border); }
.dropdown-content button { display: block; width: 100%; text-align: left; padding: 8px 16px; border: none; background: transparent; color: var(--text); font-size: 13px; }
.dropdown-content button:hover { background: var(--surface2); }
.nav-dropdown:hover .dropdown-content, .nav-dropdown.active .dropdown-content { display: block; }

/* Mobile nav */
.nav-toggle { display: none; background: transparent; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text); padding: 6px 8px; border-radius: var(--radius-sm); }
.nav-toggle:hover { background: var(--surface2); }

@media (max-width: 860px) {
  .header { padding: 0 1rem; gap: 0.75rem; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  .nav.mobile-open { display: flex; }
  .nav > button, .nav-dropdown, .nav-dropdown button { width: 100%; margin-left: 0 !important; }
  .nav > button, .nav-dropdown > button { text-align: left; }
  .dropdown-content { position: static; box-shadow: none; border: none; background: transparent; padding: 0 0 0 12px; min-width: 0; }
  #logoutBtn { width: 100%; text-align: left; margin: 4px 0 0 !important; }
}

/* Ticker autocomplete dropdown */
.ticker-dropdown { display: none; position: absolute; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 200px; overflow-y: auto; width: 100%; z-index: 200; margin-top: 4px; }
.ticker-dropdown button { display: block; width: 100%; padding: 8px 12px; text-align: left; border: none; background: transparent; color: var(--text); font-size: 14px; cursor: pointer; }
.ticker-dropdown button:hover { background: var(--surface2); }

/* ─────────────────────────────────────────────────────────────────────────────
   FORM LAYOUT SYSTEM — single source of truth for #view-add and #stockForm
   ───────────────────────────────────────────────────────────────────────────── */

/* View wrapper */
#view-add { width: 100%; display: none; justify-content: center; padding: 24px; }
#view-add.active { display: flex; }

/* Card constraint */
#view-add .card { width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px; overflow-x: hidden; }

/* Section spacing & divider title */
.form-section { margin-bottom: 2rem; }
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 1rem; display: flex; align-items: center; gap: 8px;
}
.form-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Grid: 4 equal columns, fills the row ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem 1.5rem;
  width: 100%; min-width: 0; align-items: start;
}

/* Close/sell leg: 5 columns on one row */
#closedFields .form-grid { grid-template-columns: repeat(5, 1fr); }

/* Stock form: same 4-column system */
#stockForm .form-grid { grid-template-columns: repeat(4, 1fr); }

/* Responsive breakpoints */
@media (max-width: 900px) {
  .form-grid,
  #closedFields .form-grid,
  #stockForm .form-grid { grid-template-columns: repeat(2, 1fr); }
  #view-add { padding: 16px; }
  #view-add .card { padding: 18px; }
}
@media (max-width: 600px) {
  .form-grid,
  #closedFields .form-grid,
  #stockForm .form-grid { grid-template-columns: 1fr; }
}

/* ── Field wrapper ── */
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--text2); line-height: 1.35; }
.form-field.required label::after { content: ' *'; color: var(--red); }
/* Grid rows share a baseline for their inputs, but a label with a long hint
   (e.g. "Close Premium (auto-calculated: ...)") can wrap to 2 lines while its
   row-mates stay on 1 -- reserving 2 lines of height on every label keeps
   every input in a row starting at the same vertical position regardless of
   which labels happen to wrap at the current width. */
.form-grid .form-field label { min-height: 2.7em; }

/* ── Inputs — ONE definition, used everywhere ── */
.form-field input,
.form-field select,
#stockForm input,
#stockForm select {
  width: 100%; min-width: 0;
  height: 42px; padding: 0 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus, .form-field select:focus,
#stockForm input:focus, #stockForm select:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,158,114,0.12);
}
.form-field input::placeholder { color: var(--text3); }
.form-field input[disabled], .form-field input[readonly] {
  background: var(--surface2); color: var(--text2); cursor: not-allowed;
}
input[type="date"] { min-width: 0; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* P&L preview bar */
.pnl-preview {
  background: var(--surface2); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
  display: flex; gap: 2rem; flex-wrap: wrap; align-items: center;
}
.pnl-preview-item { display: flex; flex-direction: column; gap: 2px; }
.pnl-preview-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
.pnl-preview-value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

/* Form actions */
.form-actions {
  display: flex; gap: 10px; align-items: center;
  padding-top: 1rem; border-top: 1px solid var(--border); margin-top: 0.5rem;
}

/* Strategy type pills */
#typePillGroups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
@media (max-width: 700px) {
  #typePillGroups { grid-template-columns: 1fr; }
}
.type-pill-group { background: var(--surface2); border-radius: var(--radius-sm); padding: 10px 12px; }
.type-pill-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text3); margin-bottom: 6px; }
.type-pill-group-label .form-hint { display: block; text-transform: none; font-weight: 500; letter-spacing: normal; margin-top: 2px; }
#typeDisplay .type-pill { cursor: default; }
.type-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.type-pill { padding: 7px 14px; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border2); background: transparent; color: var(--text2); transition: all 0.12s; display: inline-flex; align-items: center; gap: 5px; }
.type-pill:hover { border-color: var(--text2); color: var(--text); }
.type-pill.active-call { background: var(--blue-bg); color: var(--blue); border-color: var(--blue); }
.type-pill.active-put { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.type-pill.active-cc { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.type-pill.active-csp { background: var(--purple-bg); color: var(--purple); border-color: var(--purple); }
.type-pill.active-short-call { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.type-pill.active-short-put { background: var(--orange-bg); color: var(--orange); border-color: var(--orange); }

/* Open/Closed status toggle */
.status-toggle { display: flex; background: var(--surface2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; width: fit-content; }
.status-toggle button { padding: 6px 18px; border: none; border-radius: 5px; font-size: 13px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text2); transition: all 0.12s; }
.status-toggle button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Closed fields dim when status is Open */
#closedFields { transition: opacity 0.2s; }
#closedFields.hidden { opacity: 0.35; pointer-events: none; }
