:root {
  color-scheme: light;
  --bg: #f3f7f4;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #5b6475;
  --line: #e2e7ee;
  --navy: #1b4d42;
  --accent: #3e8e7e;
  --accent-soft: #e7f1ee;
  --buy: #15803d;
  --sell: #b91c1c;
  --sma: #b45309;
  --now-bg: #e7f1ee;
  --now-ink: #1b4d42;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
/* One screen, no page scroll: header, one sentence, then list + chart fill the rest. */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid; grid-template-rows: auto auto 1fr; height: 100vh; overflow: hidden;
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--card); border-top: 3px solid var(--navy); border-bottom: 1px solid var(--line); }
h1 { font-size: 16px; margin: 0; color: var(--navy); letter-spacing: -0.01em; }
.data { font-size: 12px; color: var(--muted); margin: 6px 22px 0; }
.mine { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; font-size: 12.5px; white-space: nowrap; }
.mine input[type=number] { width: 50px; font: inherit; padding: 4px 6px; margin: 0 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); text-align: right; }
.mine .chk { display: flex; align-items: center; gap: 3px; cursor: pointer; }
.mine .sep { width: 1px; height: 18px; background: var(--line); }
.saved { color: var(--buy); font-size: 12px; min-width: 40px; }
.now { margin: 10px 20px 0; padding: 14px 18px; border-radius: 10px; background: var(--now-bg); color: var(--now-ink); font-size: 16px; font-weight: 500; border: 1px solid #c8e8d4; }
.now.buy { background: #ecfdf3; color: #14532d; border-color: #bbf7d0; }
.now.sell { background: #fef2f2; color: #7f1d1d; border-color: #fecaca; }
.main { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 12px; padding: 12px 20px 16px; min-height: 0; }
.list, .chart-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; min-height: 0; box-shadow: var(--shadow); }
.list { display: flex; flex-direction: column; }
.list-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--navy); }
.list-head .muted { display: block; font-weight: 400; font-size: 12px; }
#stocks { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#stocks li { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
#stocks li.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.up { color: var(--buy); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; color: #fff; white-space: nowrap; }
.tag.BUY { background: var(--buy); } .tag.SELL { background: var(--sell); }
.empty { padding: 14px; color: var(--muted); }
.foot { margin: 0; padding: 10px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.muted { color: var(--muted); }
.chart-wrap { display: flex; flex-direction: column; padding: 10px 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.chart-head .muted { font-size: 12px; }
.chart-head > div:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart { flex: 1; min-height: 0; }
.ohlc { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; padding: 6px 2px 8px; font-variant-numeric: tabular-nums; min-height: 30px; }
.ohlc b { font-weight: 600; margin-left: 4px; }
.ohlc .t { color: var(--muted); }
.ohlc .sma b { color: var(--sma); }
.ohlc .chg.up b { color: var(--buy); } .ohlc .chg.down b { color: var(--sell); }
.toggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.toggle button { font: inherit; font-size: 13px; padding: 5px 10px; border: none; background: transparent; color: var(--ink); cursor: pointer; }
.toggle button.on { background: var(--accent); color: #fff; }
@media (max-width: 800px) {
  body { overflow: auto; height: auto; }
  .main { grid-template-columns: minmax(0, 1fr); }
  .chart { height: 380px; }
}

.sub { padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); list-style: none; }
.tag.WAIT { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.tag.BREAKOUT, .tag.DIP { background: var(--accent); }
.tag.TARGET { background: var(--buy); }
.tag.STOP, .tag.BELOW_PM_LOW { background: var(--sell); }
.row3 { font-size: 12px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.row3 .g { color: var(--buy); } .row3 .r { color: var(--sell); }
.tag.OPEN { background: var(--accent); }
.tag.UP { background: var(--buy); } .tag.DOWN { background: var(--sell); }
.row3 .trades { color: var(--muted); }
.setup-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.setup-link.todo::after { content: " •"; color: var(--sma); }

/* Brand: stampede wordmark */
.brand { display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 24px; height: 24px; flex-shrink: 0; }
.brand span { font-weight: 800; font-size: 20px; color: var(--accent); letter-spacing: -0.03em; }
.brand em { font-style: normal; font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 6px; }
@media (max-width: 900px) { .brand em { display: none; } }
.brand-logo { height: 20px; width: auto; display: block; }
.brand-icon { height: 20px; width: auto; display: block; flex-shrink: 0; }

/* Header: price mode chip */
.price-mode { font-size: 12px; font-weight: 600; text-decoration: none; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.price-mode.practice { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.price-mode.live { color: var(--buy); background: var(--accent-soft); border-color: #bbf7d0; }

/* Stock list: one line per stock */
.cols, #stocks li { display: grid; grid-template-columns: minmax(46px, 1fr) 62px 58px 132px; align-items: center; gap: 8px; }
.cols { padding: 6px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafcfb; }
.cols span:nth-child(n+2), .price, .jump, .st { text-align: right; }
.price { font-variant-numeric: tabular-nums; color: var(--ink); }
#stocks li { padding: 11px 14px; }
#stocks li .sym { font-weight: 700; }
.jump { color: var(--buy); font-weight: 600; font-variant-numeric: tabular-nums; }
.st .tag { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Chart: our watermark instead of the library's logo */
.chart-box { position: relative; flex: 1; min-height: 0; display: flex; }
.chart-box .chart { flex: 1; }
.watermark { position: absolute; z-index: 5; left: 10px; top: 6px; display: flex; align-items: center; gap: 5px; opacity: 0.55; pointer-events: none; }
.watermark .mark { width: 18px; height: 18px; }
.watermark span { font-weight: 800; font-size: 13px; color: var(--accent); letter-spacing: -0.03em; }
.watermark .brand-logo { height: 14px; }
.credit { margin: 4px 0 0; font-size: 10px; color: var(--muted); text-align: right; }
.credit a { color: var(--muted); }

.chart-tools { display: flex; gap: 8px; align-items: center; }
.zoom { white-space: nowrap; font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.zoom:hover { border-color: var(--accent); color: var(--accent); }

/* Chart header: stock + one switch. Key lives at the bottom. */
.chart-head .title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chart-head .title strong { font-size: 18px; color: var(--navy); }
.chart-head .title .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ohlc { font-size: 12px; color: var(--muted); padding: 2px 2px 6px; min-height: 24px; }
.ohlc b { color: var(--ink); }
.chart-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 6px; font-size: 11px; color: var(--muted); }
.chart-foot #howto { line-height: 1.5; }
.chart-foot .credit { margin: 0; flex-shrink: 0; }

.add { display: flex; gap: 6px; margin-top: 8px; }
.add input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; text-transform: uppercase; }
.add input::placeholder { text-transform: none; }
.add button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.add-msg { display: block; font-size: 12px; font-weight: 400; margin-top: 4px; }
.tag.ADDED { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 500; }
.cn { font-size: 10px; font-weight: 700; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }

/* Zoom buttons (no pinch on most Windows computers) */
.zoomer { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.zoomer button { font: inherit; font-size: 16px; font-weight: 600; width: 32px; height: 30px; border: none; background: var(--card); color: var(--ink); cursor: pointer; }
.zoomer button + button { border-left: 1px solid var(--line); }
.zoomer button:hover { color: var(--accent); }
/* Scorecard under the chart */
.score { font-size: 13px; padding: 6px 2px 0; min-height: 22px; }
.score b.g { color: var(--buy); } .score b.r { color: var(--sell); }

/* Signals menu in the header */
.signals-menu { position: relative; }
.signals-menu summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.signals-menu summary::-webkit-details-marker { display: none; }
.signals-menu[open] summary { border-color: var(--accent); }
.signals-menu .menu { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 330px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); padding: 12px 14px; display: grid; gap: 8px; white-space: normal; font-size: 13px; }
.signals-menu .menu .chk { align-items: flex-start; }
.signals-menu .sub-opts { display: grid; gap: 6px; margin-left: 22px; padding-left: 10px; border-left: 2px solid var(--accent-soft); font-size: 12.5px; }
.signals-menu hr { border: none; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }

.day-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; align-self: center; }
.day-badge.today { background: #dcfce7; color: #166534; }
.day-badge.old { background: #fef3c7; color: #92400e; }

.saved-box { background: #dcfce7; color: #166534; border-radius: 10px; padding: 12px 14px; font-weight: 600; margin: 6px 0 10px; }
.linkbtn { background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0 0 0 8px; }

body.summary #rail { display: none; }
body.summary .steps { grid-template-columns: minmax(0, 720px); justify-content: center; }
.sum-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.sum-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.sum-row.ok .sum-ic { background: #dcfce7; color: #166534; }
.sum-row.todo .sum-ic { background: #fef3c7; color: #92400e; }
.sum-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sum-txt span { color: var(--muted); font-size: 14px; }
details.alt { margin: 18px 0 4px; }
details.alt > summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: 8px; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 12px 0 4px; }
.shot { margin: 0; }
.shot img { width: 100%; border: 1px solid var(--line); border-radius: 10px; display: block; }
.shot figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

.line-label { position: absolute; left: 8px; z-index: 3; pointer-events: none; color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; opacity: 0.92; }

.entry { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.entry input { width: 72px; font: inherit; font-size: 14px; font-weight: 600; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--card); }
.entry .g { color: #15803d; font-weight: 700; }
.entry .r { color: #b91c1c; font-weight: 700; }
.entry button { border: none; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 2px; }

.daily { border-top: 1px solid var(--line); }
.daily-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; text-align: left; font: inherit; font-size: 13px; padding: 10px 20px; border: none; background: var(--accent-soft); color: var(--ink); cursor: pointer; }
.daily-line > span:first-child { font-weight: 700; margin-right: 4px; }
.daily-line .more { margin-left: auto; color: var(--accent); font-weight: 600; }
.daily .g { color: #15803d; } .daily .r { color: #b91c1c; }
.daily-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.daily-table th, .daily-table td { padding: 5px 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.daily-table th:first-child, .daily-table td:first-child { text-align: left; padding-left: 20px; }
.daily-table th:last-child, .daily-table td:last-child { padding-right: 20px; }
.daily-table th { color: var(--muted); font-weight: 600; }
.daily-table tr.sum td { font-weight: 700; background: #f8faf9; }

#stocks .sym { white-space: nowrap; }

.line-way { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; align-self: center; }
.line-way.up { background: #dcfce7; color: #166534; }
.line-way.down { background: #fee2e2; color: #991b1b; }


.daily-note { font-size: 11px; color: var(--muted); margin: 0; padding: 6px 20px 2px; }
[data-explain] { cursor: help; text-decoration: underline dotted rgba(91, 100, 117, 0.6); text-underline-offset: 3px; }
.tag[data-explain=""] { text-decoration: none; cursor: inherit; }
i[data-explain] { font-style: normal; }
.line-label.tappable { pointer-events: auto; }
#stocks li.group { display: block; padding: 8px 20px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #3730a3; background: #f8f9ff; cursor: default; }
.explain-card { position: fixed; z-index: 50; width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); padding: 14px 16px 10px; font-size: 14px; line-height: 1.4; }
.explain-card.sheet { left: 50% !important; top: auto !important; bottom: 16px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); }
.explain-card h4 { margin: 0 24px 6px 0; font-size: 15px; color: var(--accent); }
.explain-card p { margin: 0 0 6px; }
.explain-card .what { font-weight: 600; }
.explain-card .why { color: var(--muted); }
.explain-card .nowline { background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; }
.explain-card .ok { color: #15803d; font-weight: 600; }
.explain-card .no { color: #b91c1c; font-weight: 600; }
.explain-card .fine { font-size: 11px; color: var(--muted); margin-top: 8px; }
.explain-card .x { position: absolute; top: 8px; right: 10px; border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }

/* ---------- phones ---------- */
@media (max-width: 800px) {
  header.top, .top { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  #mine { order: 3; width: 100%; flex-wrap: wrap; font-size: 13px; }
  .now { margin: 8px 16px; font-size: 14px; }
  .main { padding: 0 16px 16px; gap: 12px; }
  .chart-wrap { order: -1; }            /* the chart comes first on a phone */
  .chart-head { flex-wrap: wrap; }
  .chart-head .title { flex-wrap: wrap; row-gap: 6px; }
  .chart-tools { flex-wrap: wrap; width: 100%; }
  .entry { width: 100%; }
  .ohlc { font-size: 12px; gap: 8px; flex-wrap: wrap; }
  .chart { height: 340px; }
  #howto { font-size: 11px; }
  .explain-card { font-size: 15px; }
}

/* Never let the chart header push the chart off the right edge: it wraps instead. */
.chart-wrap { min-width: 0; }
.chart-head { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
.chart-head .title { min-width: 0; flex: 1 1 320px; }
.chart-tools { flex-wrap: wrap; justify-content: flex-end; }
.ohlc { flex-wrap: wrap; }

/* =================== Layout F: dark side tabs · chart · right panel =================== */
body { grid-template-rows: auto 1fr; background: #0b1f1a; }
.top { background: #0b1f1a; border: none; color: #d5e8dc; padding: 10px 20px; }
.top .brand span { color: #6ee7a0; }
.top .mine { color: #bfd8c8; }
.top .mine .sep { background: #2a4a38; }
.top .setup-link { color: #6ee7a0; }
.top .signals-menu > summary { color: #6ee7a0; border-color: #2a4a38; background: transparent; }
.top .mine input[type=number] { background: #163a27; border-color: #2a4a38; color: #eef3ef; }

.main { grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 14px; padding: 0 16px 16px 0; }
.list { border-radius: 0; box-shadow: none; }

/* left rail: folder tabs */
.rail { background: transparent; border: none; color: #eef3ef; padding: 4px 0 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.rail .list-head { border: none; color: #eef3ef; padding: 6px 16px 10px 22px; }
.rail .list-head .muted, .rail .list-head .muted span { color: #8fb3a0; }
#stocks { padding: 0; }
#stocks li.tab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 7px 30px; padding: 10px 14px; border: none; border-radius: 14px 0 0 14px; color: #14231a; box-shadow: none; transition: margin 0.15s; }
#stocks li.tab:nth-child(3n+2) { margin-left: 38px; }
#stocks li.tab:nth-child(3n) { margin-left: 24px; }
#stocks li.tab.hold { background: #bfe6cc; }
#stocks li.tab.sell { background: #f3c9c9; }
#stocks li.tab.wait { background: #dfe5e0; }
#stocks li.tab.on { margin-left: 10px; background: #f6f8f4; padding: 14px 16px; position: relative; z-index: 2; outline: 3px solid #6ee7a0; outline-offset: -3px; }
#stocks li.tab.on.sell { outline-color: #f87171; }
#stocks li.tab:hover:not(.on) { margin-left: 18px; }
.tab-main { display: flex; flex-direction: column; min-width: 0; }
.tab .sym { font-size: 17px; font-weight: 800; }
.tab.on .sym { font-size: 21px; }
.tab-sub { font-size: 12px; color: #4a5a50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .word { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 7px; text-decoration: none; }
.tab.hold .word { color: #166534; } .tab.sell .word { color: #7f1d1d; } .tab.wait .word { color: #4a5a50; }
.tab.on.hold .word { background: #3e8e7e; color: #fff; } .tab.on.sell .word { background: #b91c1c; color: #fff; } .tab.on.wait .word { background: #4a5a50; color: #fff; }
#stocks li.group { background: transparent; color: #8fb3a0; padding: 10px 22px 6px; font-size: 11px; }
#stocks li.empty { color: #bfd8c8; }
.rail .add { display: flex; gap: 6px; margin: 4px 0 0 30px; padding: 0 10px 0 0; }
.rail .add input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px dashed #3b5a48; border-radius: 12px 0 0 12px; background: transparent; color: #eef3ef; }
.rail .add button { font: inherit; font-weight: 600; padding: 8px 12px; border: none; border-radius: 10px; background: #1d4a33; color: #6ee7a0; cursor: pointer; }
.rail .add-msg { display: block; margin: 4px 16px 0 30px; font-size: 12px; color: #fca5a5; }
.rail .daily { margin: 10px 12px 0 22px; border: none; border-radius: 12px; overflow: hidden; flex-shrink: 0; max-height: 45vh; display: flex; flex-direction: column; }
.rail .daily-line { background: #163a27; color: #d5e8dc; padding: 10px 12px; flex-shrink: 0; }
.rail .daily-line .more { color: #6ee7a0; }
.rail .daily .g { color: #6ee7a0; } .rail .daily .r { color: #fca5a5; }
.rail .daily-note { color: #8fb3a0; padding: 6px 12px 2px; flex-shrink: 0; }
.rail .daily-table { background: #163a27; color: #d5e8dc; overflow-y: auto; display: block; }
.rail .daily-table th { color: #8fb3a0; } .rail .daily-table th, .rail .daily-table td { border-color: #24503a; }
.rail .daily-table tr.sum td { background: #1d4a33; }
.rail .foot { border: none; color: #6f8f7d; font-size: 11px; padding: 8px 12px 8px 22px; margin-top: auto; }

/* middle: the chart panel */
.chart-wrap { background: #f6f8f4; border: none; border-top: 6px solid transparent; border-left: 6px solid transparent; border-radius: 14px; padding: 12px 14px 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); margin: 10px 0; transition: border-color 0.15s; }
/* Bold accent tying the chart to whichever tab is highlighted in the list, not just the muted status color. */
.chart-wrap.status-hold { border-top-color: #6ee7a0; border-left-color: #6ee7a0; }
.chart-wrap.status-sell { border-top-color: #f87171; border-left-color: #f87171; }
.chart-wrap.status-wait { border-top-color: #6ee7a0; border-left-color: #6ee7a0; }
.chart-head .title { align-items: baseline; }
.chart-head .title strong { font-size: 28px; letter-spacing: -0.02em; color: #14231a; }
.sym-price { font-size: 20px; font-weight: 700; }
.sym-jump { font-size: 14px; font-weight: 700; color: var(--buy); }
.chart-wrap .now { margin: 6px 0 8px; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.tiles:empty { display: none; }
.tile { background: #fdfefb; border: 1px solid #dce5dd; border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; text-decoration: none; }
.tile span { font-size: 12px; color: #4a5a50; font-weight: 600; }
.tile b { font-size: 18px; font-weight: 800; color: #4a5a50; }
.tile.good b { color: #15803d; } .tile.bad b { color: #b91c1c; }
.chart-box { background: #fdfefb; border: 1px solid #dce5dd; border-radius: 14px; overflow: hidden; }
.vol-label { position: absolute; left: 8px; bottom: 60px; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: #4a5a50; background: rgba(253, 254, 251, 0.9); padding: 1px 6px; border-radius: 4px; pointer-events: none; z-index: 2; }
.chart-wrap .ohlc { padding: 8px 2px 2px; font-size: 12.5px; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #e3e9e4; padding-top: 8px; margin-top: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: #4a5a50; }
.lg-group { display: flex; gap: 14px; }
.lg { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.lg-note { color: #8a978e; }
.sw { display: inline-block; font-style: normal; }
.sw.avg { width: 22px; height: 4px; background: #d97706; border-radius: 2px; }
.sw.pmh { width: 22px; border-top: 2px dashed #0d9488; }
.sw.pml { width: 22px; border-top: 2px dashed #b45309; }
.sw.buy { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid #15803d; }
.sw.sell { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid #b91c1c; }
.sw.vol { width: 11px; height: 11px; background: #16a34a; box-shadow: 13px 0 0 #dc2626; margin-right: 13px; }

/* right: the answer, your exit, the checks */
.side { background: #eef3ef; border-radius: 14px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; margin: 10px 0 10px 0; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); }
.rule-card { border-radius: 16px; padding: 14px 16px; color: #fff; display: flex; flex-direction: column; }
.rule-card.buy { background: #3e8e7e; } .rule-card.sell { background: #b91c1c; } .rule-card.wait { background: #4a5a50; }
.rule-card small { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.85; }
.rule-card b { font-size: 36px; line-height: 1.05; font-weight: 800; margin: 2px 0 4px; text-decoration: none; }
.rule-card span { font-size: 13.5px; opacity: 0.95; }
.rule-card .you-in { display: block; margin-top: 4px; font-style: normal; font-weight: 700; }
.side .entry { display: flex; flex-direction: column; align-items: stretch; gap: 8px; background: #fdfefb; border: 1px solid #dce5dd; border-radius: 16px; padding: 14px; white-space: normal; }
.side .entry label { font-size: 13px; font-weight: 700; color: #4a5a50; }
.entry-row { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; color: #4a5a50; }
.side .entry input { width: 100%; font-size: 20px; padding: 8px 10px; background: #f6f8f4; }
.exits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ex { border-radius: 10px; padding: 8px 10px; }
.ex small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; }
.ex b { font-size: 19px; font-weight: 800; }
.ex.g { background: #e7f5ec; color: #166534; } .ex.r { background: #fdecec; color: #991b1b; }
.ex-note { font-size: 12px; color: #4a5a50; }
.ex-note button { border: none; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 0 0 0 4px; text-decoration: underline; }
.checks-card { background: #fdfefb; border: 1px solid #dce5dd; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.ch-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: #4a5a50; }
.ch-count { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef1ee; }
.ch-count.all { background: #3e8e7e; color: #fff; }
.ch { font-size: 14.5px; font-weight: 600; }
.ch.ok { color: #15803d; } .ch.no { color: #b91c1c; } .ch.skip { color: #8a978e; }
.ch-when { font-size: 11.5px; color: #8a978e; }
.side-foot { margin: auto 0 0; font-size: 11.5px; color: #4a5a50; }

/* phones: tabs across the top, then chart, then the panel */
@media (max-width: 900px) {
  body { grid-template-rows: auto auto; }
  .main { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .rail { padding: 0; }
  .rail .list-head { padding: 6px 16px; }
  #stocks { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px; }
  #stocks li.tab, #stocks li.tab:nth-child(3n), #stocks li.tab:nth-child(3n+2), #stocks li.tab.on { margin: 0; border-radius: 12px 12px 0 0; flex: 0 0 auto; padding: 8px 12px; }
  #stocks li.tab.on { padding: 10px 14px; }
  #stocks li.group { display: none; }
  .rail .add, .rail .add-msg, .rail .daily, .rail .foot { display: none; }
  .chart-wrap { border-radius: 0; order: 0; }
  .side { border-radius: 0; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile b { font-size: 15px; }
}

/* Wordmark: Archivo ExtraBold Italic, leaning forward like the mark */
.brand span, .brand-lg span { font-family: 'Archivo', -apple-system, sans-serif; font-style: italic; font-weight: 800; letter-spacing: -0.03em; }
.top .brand span { color: #f6f8f4; font-size: 22px; }
.brand .mark { width: 30px; height: 30px; }
.top .brand-logo { height: 26px; }
.top .brand-icon { height: 26px; }

/* market state pill in the header */
.top .brand { flex-shrink: 0; }
.mkt { font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; margin-right: auto; margin-left: 14px; display: inline-flex; align-items: center; gap: 7px; }
.mkt::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mkt.open { background: #14532d; color: #6ee7a0; }
.mkt.open::before { animation: mktPulse 1.8s infinite; }
.mkt.pre { background: #3b2f10; color: #fcd34d; }
.mkt.closed { background: #1d3328; color: #9fb8a8; }
@keyframes mktPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(110, 231, 160, 0.6); } 50% { box-shadow: 0 0 0 5px rgba(110, 231, 160, 0); } }
.chart-wrap .now[hidden] { display: none; }
@media (max-width: 900px) { .mkt { margin-left: 8px; font-size: 11px; } }

/* remove a stock you added */
.tab-x { border: none; background: transparent; color: #4a5a50; font-size: 16px; line-height: 1; padding: 2px 4px; margin-left: 2px; cursor: pointer; border-radius: 6px; opacity: 0.55; }
.tab-x:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.tab-x.confirm { opacity: 1; background: #b91c1c; color: #fff; font-size: 11px; font-weight: 800; padding: 4px 7px; }

/* joined during market hours: yellow so it stands out */
#stocks li.tab.late:not(.on) { background: #fde68a; }
.new-pill { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.03em; background: #b45309; color: #fff; padding: 1px 5px; border-radius: 5px; }

/* I got out at */
.got-out { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed #dce5dd; padding-top: 10px; margin-top: 4px; }
.got-out label { font-size: 13px; font-weight: 700; color: #4a5a50; }
.got-out-row { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #4a5a50; }
.got-out-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 7px 9px; border: 1px solid #dce5dd; border-radius: 9px; background: #f6f8f4; }
.got-out-row input#exitShares { font-size: 13px; }
#logTrade { font: inherit; font-weight: 700; padding: 9px; border: none; border-radius: 10px; background: #3e8e7e; color: #fff; cursor: pointer; }
.side .g, .ex-note .g { color: #15803d; } .side .r, .ex-note .r { color: #b91c1c; }
/* My trades card in the left rail */
.my-trades:empty { display: none; }
.my-trades { margin: 10px 12px 0 22px; background: #163a27; border-radius: 12px; padding: 10px 12px; color: #d5e8dc; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.mt-head { font-weight: 800; color: #eef3ef; font-size: 13px; }
.mt-line b { color: #eef3ef; margin-right: 4px; }
.my-trades .g { color: #6ee7a0; } .my-trades .r { color: #fca5a5; }
.mt-list { margin-top: 4px; border-top: 1px solid #24503a; padding-top: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.mt-list span { font-weight: 700; color: #eef3ef; margin-right: 4px; }

.past-trade { font-size: 12.5px; color: #4a5a50; }
.past-trade summary { cursor: pointer; font-weight: 700; color: var(--accent); margin: 4px 0; }
.past-trade .got-out-row { margin: 6px 0; }
#logPast { width: 100%; font: inherit; font-weight: 700; padding: 8px; border: none; border-radius: 10px; background: #3e8e7e; color: #fff; cursor: pointer; }

.mt-row { display: flex; align-items: center; gap: 4px; }
.mt-row b { margin-left: auto; }
.mt-x { border: none; background: transparent; color: #8fb3a0; font-size: 14px; cursor: pointer; padding: 0 4px; border-radius: 5px; }
.mt-x:hover { color: #eef3ef; }
.mt-x.confirm { background: #b91c1c; color: #fff; font-size: 10.5px; font-weight: 800; padding: 2px 6px; }
