/* The day-trade scanner. Built on the surf site's own tokens (surf.css),
   so it follows the same light and dark themes; green and red are the two
   colours added, because a trading screen without them is harder to read. */
:root { --up: #3ad29f; --down: #ff7a7a; --up-bg: rgba(58, 210, 159, .13); --down-bg: rgba(255, 122, 122, .13); }
@media (prefers-color-scheme: light) {
  :root { --up: #0f7b52; --down: #b3261e; --up-bg: #e3f4ec; --down-bg: #fdecea; }
}

.stk { max-width: 1100px; margin: 0 auto; padding: 16px 16px 48px; box-sizing: border-box; }
.stk h2 { font-size: 18px; margin: 0 0 4px; }
.stk-sub { margin: 0 0 12px; color: var(--dim); font-size: 14px; max-width: 70ch; }
.stk-section { margin-top: 26px; }
.up { color: var(--up); }
.down { color: var(--down); }
.num { font-variant-numeric: tabular-nums; }

.stk-status { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; color: var(--dim); }
.stk-pill { padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.stk-pill.open { background: var(--up-bg); color: var(--up); border-color: transparent; }
.stk-pill.closed, .stk-pill.pre { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.stk-refresh { margin-left: auto; font-variant-numeric: tabular-nums; }
.stk-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.stk-note[hidden] { display: none; }

.stk-picks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.stk-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--dim); font-size: 14px; }
.stk-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; display: grid; gap: 10px; }
.stk-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stk-rank { font-size: 12px; font-weight: 700; color: var(--sea); }
.stk-sym { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.stk-name { color: var(--dim); font-size: 13px; flex: 1 1 100%; margin-top: -8px; overflow-wrap: anywhere; }
.stk-price { margin-left: auto; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stk-score { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.stk-score-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.stk-score-bar i { display: block; height: 100%; background: var(--sea); border-radius: 3px; }
.stk-spark { width: 100%; height: 56px; display: block; }
.stk-spark .line { fill: none; stroke: var(--sea); stroke-width: 1.6; }
.stk-spark .vwap { fill: none; stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; }
.stk-why { margin: 0; padding-left: 1.1em; font-size: 13.5px; display: grid; gap: 3px; }
.stk-why li.caution { color: var(--warn); }
.stk-plan { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stk-plan strong { overflow-wrap: anywhere; }
.stk-plan div { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.stk-plan span { display: block; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.stk-plan strong { font-variant-numeric: tabular-nums; font-size: 14px; }
.stk-plan .stop strong { color: var(--down); }
.stk-plan .tgt strong { color: var(--up); }

.stk-card button, .stk-add button, .stk-pos button { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 8px 14px; border: 1px solid var(--sea); background: var(--sea); color: var(--bg); }
.stk-ghost, .stk-pos button { background: transparent !important; color: var(--sea) !important; }
.stk-card button:focus-visible, .stk-add button:focus-visible, .stk-pos button:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

.stk-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.stk-add label { display: grid; gap: 4px; font-size: 12px; color: var(--dim); }
.stk-add input { font: inherit; font-size: 15px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); width: 8.5em; box-sizing: border-box; }
.stk-err { color: var(--down); font-size: 14px; margin: 8px 0 0; }
.stk-err[hidden] { display: none; }
.stk-positions { display: grid; gap: 10px; margin-top: 14px; }
.stk-pos { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stk-pos.hold { border-left-color: var(--sea); }
.stk-pos.trim { border-left-color: var(--warn); }
.stk-pos.sell { border-left-color: var(--down); background: var(--down-bg); }
.stk-pos-act { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.stk-pos.hold .stk-pos-act { color: var(--sea); }
.stk-pos.trim .stk-pos-act { color: var(--warn); }
.stk-pos.check { border-left-color: var(--warn); }
.stk-pos.check .stk-pos-act { color: var(--warn); }
.stk-pos.sell .stk-pos-act { color: var(--down); }
.stk-pos-main { min-width: 0; }
.stk-pos-title { font-weight: 700; font-variant-numeric: tabular-nums; }
.stk-pos-why { font-size: 14px; margin-top: 2px; }
.stk-pos-levels { font-size: 12.5px; color: var(--dim); margin-top: 4px; font-variant-numeric: tabular-nums; }

.stk-replay-sum { font-size: 15px; margin: 0 0 10px; }
.stk-days { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.stk-day { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.stk-day-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 4px; }
.stk-day ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }

.stk-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.stk-table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.stk-table th, .stk-table td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.stk-table th:first-child, .stk-table td:first-child { text-align: left; }
.stk-table th { font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stk-table tr:last-child td { border-bottom: 0; }
.stk-table tr.stk-picked td:first-child { box-shadow: inset 3px 0 0 var(--sea); }
.stk-fine ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 14px; color: var(--dim); max-width: 75ch; }
.stk-fine strong { color: var(--ink); }

.stk-strat { margin: 0 0 4px; font-size: 15px; max-width: 75ch; }
.stk-strat-none { padding: 12px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.stk-sizing { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin: 10px 0 14px; }
.stk-sizing label { display: grid; gap: 4px; font-size: 12px; color: var(--dim); }
.stk-sizing input { font: inherit; font-size: 15px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); width: 9em; box-sizing: border-box; }
.stk-sizing .stk-sub { margin: 0 0 8px; }
.stk-size { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--sea); }
.stk-today h3 { font-size: 14px; margin: 16px 0 6px; color: var(--dim); }
.stk-today-list { margin: 0; padding-left: 1.1em; font-size: 14px; display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.stk-lab-set { display: block; font-size: 12px; color: var(--dim); font-weight: 400; white-space: normal; }
.stk-lab-table td:first-child { min-width: 12em; white-space: normal; }
.stk-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.stk-chip.yes { background: var(--up-bg); color: var(--up); }
.stk-chip.no { background: var(--down-bg); color: var(--down); }
.stk-lab-notes { margin: 12px 0 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 13.5px; color: var(--dim); max-width: 80ch; }
.stk-lab-notes strong { color: var(--ink); }

@media (max-width: 560px) {
  .stk-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stk-add label { flex: 1 1 40%; }
  .stk-add input { width: 100%; }
  .stk-add button { flex: 1 1 100%; }
  .stk-pos { grid-template-columns: minmax(0, 1fr) auto; }
  .stk-pos-act { grid-column: 1 / -1; }
  .stk-refresh { margin-left: 0; flex: 1 1 100%; }
}
.stk-lab-table th { white-space: normal; vertical-align: bottom; }
