/* Trade Journal — mobile-first. Phone layout by default; wider screens get a top nav and grids.
   Safe-area insets keep content clear of notches and home bars when wrapped as an iOS / Android app. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --text: #14181f; --muted: #626b78;
  --line: #e2e6ec; --brand: #0f766e; --brand-ink: #ffffff; --brand-soft: #e6f4f2;
  --pos: #12805c; --neg: #c2362f; --pos-soft: #e3f4ec; --neg-soft: #fbe9e7; --warn: #b7791f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px; --tap: 44px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --surface: #151b23; --surface-2: #1c2430; --text: #e8ecf1; --muted: #9aa5b4;
    --line: #283241; --brand: #2bb3a3; --brand-ink: #04201d; --brand-soft: #12302d;
    --pos: #3fcf8e; --neg: #ff7a6e; --pos-soft: #10291f; --neg-soft: #33171a; --warn: #e3a948;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #151b23; --surface-2: #1c2430; --text: #e8ecf1; --muted: #9aa5b4;
  --line: #283241; --brand: #2bb3a3; --brand-ink: #04201d; --brand-soft: #12302d;
  --pos: #3fcf8e; --neg: #ff7a6e; --pos-soft: #10291f; --neg-soft: #33171a; --warn: #e3a948;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(72px + var(--sab)); /* room for the bottom tab bar on phones */
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
b { font-weight: 650; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: calc(16px + var(--sal)); padding-right: calc(16px + var(--sar)); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* ---------- top bar + tabs (bottom bar on phones) ---------- */
.topbar {
  /* no backdrop-filter here: it would trap the fixed bottom tab bar inside the header */
  position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: calc(10px + var(--sat)) calc(16px + var(--sar)) 10px calc(16px + var(--sal));
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.brand-name { font-weight: 700; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px calc(6px + var(--sar)) calc(6px + var(--sab)) calc(6px + var(--sal));
}
.tabs button {
  flex: 1; min-height: 52px; border: 0; background: none; border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 11.5px; color: var(--muted); position: relative;
}
.tabs .ti { font-size: 18px; line-height: 1; }
.tabs button.active { color: var(--brand); font-weight: 650; }
.badge { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.badge[hidden] { display: none; }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tabs { position: static; border: 0; background: none; padding: 0; margin-left: auto; gap: 4px; }
  .tabs button { flex-direction: row; min-height: 38px; padding: 0 14px; font-size: 14px; gap: 6px; }
  .tabs .ti { display: none; }
  .tabs button.active { background: var(--brand-soft); }
  .badge { position: static; }
}

/* ---------- layout ---------- */
main { padding-top: 16px; padding-bottom: 24px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 14px; }
.h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 15.5px; margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.plain { margin: 0; padding-left: 18px; }

/* ---------- buttons & inputs ---------- */
.btn {
  min-height: var(--tap); padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); }
.btn.big { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.icon { width: var(--tap); height: var(--tap); border: 0; border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 16px; flex: none; }
select, input[type="search"], input:not([type]), textarea {
  min-height: var(--tap); width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 9px 12px; font-size: 16px; /* 16px stops iOS zooming into fields */
}
textarea { resize: vertical; line-height: 1.45; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.toolbar select { width: auto; }

/* ---------- empty state ---------- */
.hero { padding: 24px 18px; }
.hero h1 { font-size: 26px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.3px; }
.lead { font-size: 16px; color: var(--muted); margin: 0 0 6px; max-width: 640px; }
.hero .actions .btn { flex: 1 1 220px; }
.dropzone { margin-top: 14px; border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
@media (pointer: coarse) { .dropzone { display: none; } }
.howto { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.howto h3 { font-size: 14px; margin: 0 0 6px; }
.howto ol { margin: 0; padding-left: 20px; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.t-label { font-size: 12.5px; color: var(--muted); }
.t-val { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insights { margin: 0 0 4px; padding-left: 18px; }
.insights li { margin: 0 0 8px; }
.chart-meta { display: flex; justify-content: space-between; font-size: 12.5px; gap: 8px; }
.equity { width: 100%; height: 200px; display: block; margin: 6px 0; }
.equity .zero { stroke: var(--line); stroke-dasharray: 4 4; }
.equity .line { fill: none; stroke-width: 2.25; }
.equity.up .line { stroke: var(--pos); } .equity.up .area { fill: var(--pos-soft); }
.equity.down .line { stroke: var(--neg); } .equity.down .area { fill: var(--neg-soft); }
.hbars { display: grid; gap: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto 26px; align-items: center; gap: 8px; font-size: 13.5px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hb-bar { display: block; height: 100%; border-radius: 5px; }
.hb-bar.pos { background: var(--pos); } .hb-bar.neg { background: var(--neg); }
.hb-val { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; }
.hb-n { text-align: right; font-size: 12px; }

/* ---------- trades ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters input { grid-column: span 2; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } .filters input { grid-column: auto; } }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.trades { width: 100%; border-collapse: collapse; font-size: 14px; }
.trades th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.trades th.r { text-align: right; }
.trades td { padding: 12px; border-bottom: 1px solid var(--line); }
.trades tbody tr { cursor: pointer; }
.trades tbody tr:hover, .trades tbody tr:focus { background: var(--surface-2); outline: none; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; }
.pill.long { background: var(--pos-soft); color: var(--pos); } .pill.short { background: var(--neg-soft); color: var(--neg); }
.dot-todo { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.dot-ok { color: var(--pos); font-weight: 800; }
.warn { color: var(--warn); }
.ok-note { color: var(--pos); font-weight: 600; }
/* phones: turn table rows into cards */
@media (max-width: 759px) {
  .trades thead { display: none; }
  .trades, .trades tbody { display: block; }
  .trades tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .trades td { padding: 0; border: 0; }
  .trades td:nth-child(1) { grid-column: 1; grid-row: 2; font-size: 12.5px; color: var(--muted); }
  .trades td:nth-child(2) { grid-column: 1; grid-row: 1; }
  .trades td:nth-child(3) { display: none; }
  .trades td:nth-child(4), .trades td:nth-child(5), .trades td:nth-child(6), .trades td:nth-child(7) { display: none; }
  .trades td:nth-child(8) { grid-column: 2; grid-row: 1; }
  .trades td:nth-child(9) { grid-column: 1; grid-row: 3; font-size: 13px; }
  .trades td:nth-child(10) { grid-column: 2; grid-row: 2 / span 2; text-align: right; align-self: center; }
  .trades td[colspan] { grid-column: 1 / -1; padding: 16px 0; }
}

/* ---------- import mapper ---------- */
.mapper { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 10px 0; }
@media (min-width: 760px) { .mapper { grid-template-columns: repeat(3, 1fr); } }
.fld.need select { border-color: var(--warn); }

/* ---------- drawer (bottom sheet on phones, side panel on desktop) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 12, 18, .45); z-index: 40; }
.drawer {
  position: fixed; z-index: 50; background: var(--surface); display: flex; flex-direction: column;
  left: 0; right: 0; bottom: 0; top: calc(24px + var(--sat)); border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .25);
}
.drawer[hidden], .scrim[hidden] { display: none; }
@media (min-width: 760px) {
  .drawer { left: auto; top: 0; width: min(560px, 100%); border-radius: 0; box-shadow: -8px 0 40px rgba(0, 0, 0, .18); }
}
.dr-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); padding-top: max(14px, var(--sat)); }
@media (max-width: 759px) { .dr-head { padding-top: 14px; } }
.dr-title { flex: 1; min-width: 0; }
.dr-sym { font-weight: 750; font-size: 18px; }
.dr-pnl { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dr-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 16px; overscroll-behavior: contain; }
.dr-body h3 { font-size: 14px; margin: 16px 0 10px; display: flex; align-items: center; gap: 8px; }
.auto { font-size: 11px; font-weight: 650; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 99px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 420px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; font-size: 12px; min-width: 0; }
.fact b { font-size: 14.5px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details { margin-top: 10px; font-size: 13.5px; }
summary { cursor: pointer; color: var(--brand); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.mini td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.fld > span em { font-weight: 400; font-style: normal; font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 420px) { .row2 { grid-template-columns: 1fr 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }
.scale { display: flex; gap: 6px; }
.sc { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 650; }
.sc.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.shot-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-weight: 500; cursor: pointer; }
.shot img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; margin-bottom: 6px; }
.dr-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px calc(10px + var(--sab)); border-top: 1px solid var(--line); background: var(--surface); }
.dr-foot .status { flex: 1; font-size: 12.5px; color: var(--muted); min-width: 0; }
.dr-foot .status.ok { color: var(--pos); font-weight: 650; }
.dr-foot .btn:not(.primary) { padding: 0 12px; }

/* ---------- misc ---------- */
.banner { background: var(--brand-soft); color: var(--text); font-size: 13.5px; padding-top: 10px; padding-bottom: 10px; border-radius: 0 0 12px 12px; }
.foot { font-size: 12px; color: var(--muted); padding-top: 8px; padding-bottom: 24px; text-align: center; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + var(--sab)); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
@media (min-width: 760px) { .toast { bottom: 24px; } }

/* ---------- login ---------- */
body.signed-out { padding-bottom: 0; }
body.signed-out .topbar, body.signed-out #banner { display: none; }
.auth { max-width: 420px; margin: 0 auto; padding-top: calc(28px + var(--sat)); }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.auth-card { padding: 22px 18px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 10px; padding: 4px; margin: 16px 0; }
.seg-btn { min-height: 40px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.phone-in { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.phone-in:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.phone-in .cc { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-weight: 600; border-right: 1px solid var(--line); }
.phone-in input { border: 0; border-radius: 0; outline: none; }
.otp { font-size: 24px !important; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.btn.full { width: 100%; margin-top: 10px; }
.auth-err { color: var(--neg); font-size: 13.5px; margin: -4px 0 6px; }
.test-note { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; letter-spacing: 2px; }

/* ---------- account + pro ---------- */
.acct-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.acct-row .actions { margin-top: 0; }
.pro-tag { font-size: 10.5px; font-weight: 750; letter-spacing: .6px; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; vertical-align: 2px; margin-left: 4px; }
.card.locked { position: relative; overflow: hidden; }
.lock-preview { filter: blur(5px); opacity: .55; pointer-events: none; user-select: none; display: grid; gap: 8px; }
.lock-cta { position: absolute; inset: 44px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.lock-ico { font-size: 20px; }
.teaser { background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); }
.teaser p { margin: 0 0 4px; max-width: 640px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 16px 0; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.plan.best { border: 2px solid var(--brand); }
.plan-label { font-weight: 650; }
.plan-price { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.compare { display: grid; grid-template-columns: 1fr; gap: 6px 24px; }
@media (min-width: 700px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare h3 { font-size: 14px; margin: 8px 0 6px; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 24px; margin-bottom: 9px; }
.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--muted); font-weight: 800; }
.ticks.pro li::before { color: var(--brand); }

.seats { margin-top: 6px; font-size: 12.5px; font-weight: 650; color: var(--warn); }

/* ---------- policy pages ---------- */
.doc-page { padding-bottom: 0; }
.doc { max-width: 760px; padding-top: calc(24px + var(--sat)); padding-bottom: 40px; }
.doc h1 { font-size: 26px; margin: 8px 0 4px; }
.doc h2 { font-size: 17px; margin: 26px 0 8px; }
.doc p, .doc li { line-height: 1.6; }
.doc a { color: var(--brand); }
.draft { background: var(--neg-soft); color: var(--neg); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 13.5px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
.auth a { color: var(--brand); }

/* ---------- XIRR what-ifs ---------- */
.whatif { display: grid; gap: 8px; margin-bottom: 8px; }
.wi-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.wi-row:last-child { border-bottom: 0; }
.wi-label { min-width: 0; }
.wi-vals { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- manual trade entry ---------- */
.add-trade h3 { font-size: 14px; margin: 14px 0 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row3 .fld:last-child { grid-column: span 2; }
@media (min-width: 620px) { .row3 { grid-template-columns: 1.2fr 1fr 1fr; } .row3 .fld:last-child { grid-column: auto; } }
.add-trade .seg { margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0 0 12px; min-height: 32px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
input[type="date"], input[type="time"] { min-height: var(--tap); width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 9px 12px; font-size: 16px; }
.demo-link { margin: 12px 0 0; }
.tb-actions { margin-top: 0; }
.dr-manual { padding: 0 16px calc(10px + var(--sab)); background: var(--surface); text-align: center; }
.danger-link { color: var(--neg) !important; font-size: 13px; }

/* ---------- symbol suggestions ---------- */
.sym-fld { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 15; margin-top: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .14); max-height: 320px; overflow-y: auto; }
.suggest[hidden] { display: none; }
.sug { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: baseline; width: 100%; text-align: left; border: 0;
  border-bottom: 1px solid var(--line); background: none; padding: 10px 12px; cursor: pointer; font-weight: 400; min-height: var(--tap); }
.sug:last-child { border-bottom: 0; }
.sug:hover, .sug:focus { background: var(--surface-2); outline: none; }
.sug b { font-variant-numeric: tabular-nums; }
.sug-name { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sug-ex { font-size: 11px; color: var(--muted); }
.seg3 { grid-template-columns: 1fr 1fr 1fr; }
.row3.fno { margin-top: 2px; }

#af-symbol { text-transform: uppercase; }
#af-symbol::placeholder { text-transform: none; }
