/* Colors pulled from the Tiger Traders logo: black background, orange "T", khaki "T". */
:root {
  --bg: #0b0b0d; --sidebar: #0f0f12; --panel: #151518; --panel-hi: #1b1b1f; --border: #25252a;
  --text: #ededee; --khaki: #c4b69d; --muted: #8a8780;
  --orange: #f7941d; --orange-soft: rgba(247, 148, 29, 0.12); --orange-line: rgba(247, 148, 29, 0.35);
  --accent-grad: linear-gradient(135deg, #f9a53c, #f7941d);
  --discord: #5865f2; --danger: #e5484d;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 'DM Sans', system-ui, -apple-system, Segoe UI, sans-serif; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0 0 18px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; }
.muted, time { color: var(--muted); font-size: 14px; }
.label { font-size: 11px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }

/* ---------- App shell: sidebar + content ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px; padding: 20px 14px;
  background: var(--sidebar); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; padding: 0 6px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--khaki); font-weight: 500; }
.sidebar nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--orange-soft); color: var(--orange); }
.sidebar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--khaki); }
.me img { width: 26px; height: 26px; border-radius: 50%; }
.me .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me a { color: var(--muted); font-size: 12px; }

main { flex: 1; min-width: 0; padding: 28px 32px 64px; max-width: 1040px; }
main.wide { max-width: 1480px; }
main.solo { max-width: 460px; margin: 0 auto; padding: 14vh 16px 64px; }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Cards, buttons, forms ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.center { text-align: center; }
.logo-lg { width: 72px; height: 72px; border-radius: 50%; margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.post { color: var(--text); display: block; }
.post:hover { border-color: var(--orange); text-decoration: none; }
.post h2 { margin: 0 0 4px; }
.post p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
article { display: grid; gap: 14px; max-width: 820px; }
article h1 { margin: 0; }
.back { font-size: 14px; color: var(--muted); }

.btn { display: inline-block; background: var(--accent-grad); color: #111; border: 0; padding: 10px 18px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.discord { background: var(--discord); color: #fff; }
.btn.ghost { background: var(--panel-hi); color: var(--khaki); border: 1px solid var(--border); font-size: 13px; padding: 8px 12px; text-align: center; }
.error { color: var(--danger); }
.notice { background: var(--orange-soft); border: 1px solid var(--orange-line); color: var(--khaki); padding: 10px 14px; border-radius: 8px; }

.form { display: grid; gap: 14px; margin-bottom: 36px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--khaki); }
.form small { color: var(--muted); }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 9px 10px; font: inherit; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td { padding: 9px 6px; border-bottom: 1px solid var(--border); }
td form { margin: 0; }
.link-danger { background: none; border: 0; color: var(--danger); cursor: pointer; font: inherit; }

/* ---------- Smaller screens ---------- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .brand span, .me .name, .me img, .sidebar nav svg { display: none; }
  .brand img { width: 30px; height: 30px; }
  .sidebar nav { flex-direction: row; }
  .sidebar nav a { padding: 6px 7px; font-size: 13.5px; white-space: nowrap; }
  .wide-only { display: none; }
  .me a { white-space: nowrap; }
  .me { margin: 0 0 0 auto; padding: 0; border: 0; }
  main { padding: 16px; }
  .form .row { grid-template-columns: 1fr; }
}

/* ---------- Chart uploads (admin) ---------- */
.field { display: grid; gap: 6px; font-size: 13px; color: var(--khaki); }
.form .dropzone { display: block; padding: 22px 16px; text-align: center; border: 1.5px dashed var(--border); border-radius: 8px; color: var(--muted); cursor: pointer; background: var(--bg); }
.dropzone strong { color: var(--text); font-weight: 600; }
.dropzone:hover, .dropzone.over { border-color: var(--orange); background: var(--orange-soft); }
.dropzone input { display: none; }
.upload-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-preview { position: relative; }
.upload-preview img { display: block; height: 72px; border-radius: 6px; border: 1px solid var(--border); }
.upload-preview button { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }

/* ---------- Report page ---------- */
.report { max-width: 1100px; gap: 26px; }
.report header { display: grid; gap: 8px; }
.report h1 { font-size: 32px; font-weight: 500; letter-spacing: -0.015em; }
.accent-bar { width: 40px; height: 2px; background: var(--orange); margin: 6px 0 4px; }
.report .meta { margin: 0; color: var(--khaki); font-size: 14px; }
.report section { display: grid; gap: 12px; }
.report h2.label { margin: 0; font-size: 12px; letter-spacing: 0.12em; }
.report .video { max-width: 820px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 26px 28px; }
.analysis { font-size: 16px; line-height: 1.7; }
.analysis p { margin: 0 0 6px; overflow-wrap: anywhere; }
.analysis .gap { height: 14px; }
.tk { color: var(--orange); font-weight: 500; }
.chart { margin: 14px 0 22px; max-width: 620px; }
.chart figcaption { display: flex; justify-content: space-between; font-size: 13px; padding: 0 2px 6px; }
.chart figcaption span:first-child { color: var(--orange); font-weight: 600; }
.chart img { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; background: #000; }
.chart img:hover { border-color: var(--orange); }
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.88); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
@media (max-width: 760px) {
  .report h1 { font-size: 24px; }
  .panel { padding: 18px 16px; }
  .analysis { font-size: 15px; }
}

/* ---------- Shared bits ---------- */
.notes { white-space: pre-wrap; }
.chart-fallback { font-size: 13px; }
.link { background: none; border: 0; color: var(--orange); cursor: pointer; font: inherit; padding: 0; }
.summary { border-left: 3px solid var(--orange); background: var(--panel); border-radius: 0 8px 8px 0; padding: 14px 18px; font-size: 17px; line-height: 1.55; }
.summary p { margin: 0 0 4px; }
.summary p:last-child { margin: 0; }

/* ---------- Briefs home ---------- */
.latest { display: grid; gap: 14px; max-width: 900px; }
.latest h1 { font-size: 32px; font-weight: 500; letter-spacing: -0.015em; margin: 0; }
.latest .meta { margin: 0; color: var(--khaki); font-size: 14px; }
.latest .video { margin-top: 4px; }
.more { font-weight: 500; }
.archive { max-width: 900px; margin-top: 44px; display: grid; gap: 4px; }
.archive h2.label { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.12em; }
.archive-row { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; padding: 12px 14px; border-radius: 8px; color: var(--text); border: 1px solid transparent; }
.archive-row:hover { background: var(--panel); border-color: var(--border); text-decoration: none; }
.archive-row time { color: var(--khaki); }
.archive-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Watchlist ---------- */
.intro { margin: -8px 0 18px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; gap: 10px 28px; margin-bottom: 22px; font-size: 14px; color: var(--khaki); }
.legend div { display: flex; align-items: center; gap: 8px; }
.status { display: inline-block; min-width: 104px; text-align: center; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.status-buy-zone { background: rgba(52, 199, 123, 0.14); color: #4ad48d; }
.status-hold { background: rgba(196, 182, 157, 0.14); color: var(--khaki); }
.status-not-interested { background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.status-trim { background: rgba(247, 148, 29, 0.14); color: var(--orange); }
.status-unset { background: transparent; border: 1px dashed var(--border); color: var(--muted); font-weight: 500; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); color: var(--khaki); font-size: 13.5px; }
.tabs a span { color: var(--muted); margin-left: 3px; }
.tabs a:hover { border-color: var(--khaki); text-decoration: none; }
.tabs a.active { background: var(--orange-soft); border-color: var(--orange-line); color: var(--orange); }
.wl-ticker small { margin-left: 6px; font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.wl-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.px { font-weight: 600; }
.wl-ext { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wl-ext .px { font-weight: 500; color: var(--khaki); }
.session { font-size: 11px; font-weight: 600; margin-right: 8px; }
.session.pre { color: #f5c542; }
.session.post { color: #7b8cff; }
.wl-ma { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ma { font-weight: 600; }
.ma.up { color: #4ad48d; }
.ma.down { color: #f06a6a; }
.ma-val { display: block; font-size: 11px; color: var(--muted); }

/* Inline editing (admins) */
.status-edit { position: relative; display: inline-block; cursor: pointer; }
.status-edit select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; padding: 0; }
.status-edit:hover .status { outline: 1px solid var(--khaki); outline-offset: 1px; }
.status-edit:focus-within .status { outline: 1px solid var(--orange); outline-offset: 1px; }
input.inline { background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 5px 7px; margin: -6px 0 -6px -8px; color: inherit; font: inherit; width: 100%; min-width: 90px; }
input.inline.zone { width: 90px; field-sizing: content; min-width: 60px; max-width: 150px; font-weight: 600; }
.wl-note { min-width: 220px; }
input.inline::placeholder { color: transparent; }
tr:hover input.inline::placeholder { color: var(--muted); }
input.inline:hover { border-color: var(--border); }
input.inline:focus { border-color: var(--orange); background: var(--bg); outline: none; }
input.inline:focus::placeholder { color: var(--muted); }
.wl-zone { white-space: nowrap; }
.row-remove { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 4px; opacity: 0; }
tr:hover .row-remove, .row-remove:focus { opacity: 1; }
.row-remove:hover { color: var(--danger); background: rgba(229, 72, 77, 0.1); }
.watchlist tr.saved td { background: rgba(52, 199, 123, 0.08); transition: background 0.6s; }
.watchlist tr.error td { background: rgba(229, 72, 77, 0.1); }
.add-row input { background: transparent; border: 1px dashed var(--border); color: var(--text); }
.add-row input:focus { border-color: var(--orange); border-style: solid; outline: none; }
.add-row input.bad { border-color: var(--danger); }
.chg { margin-left: 8px; font-size: 12.5px; }
.chg.up { color: #4ad48d; }
.chg.down { color: #f06a6a; }
.in-zone { margin-left: 6px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: rgba(52, 199, 123, 0.16); color: #4ad48d; }
.small { font-size: 12.5px; margin-top: 10px; }
table.watchlist { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.watchlist th { white-space: nowrap; text-align: left; font-size: 13px; font-weight: 600; color: var(--khaki); padding: 12px 14px; border-bottom: 1px solid var(--border); }
.watchlist td { padding: 13px 14px; }
.watchlist th button.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.watchlist th button.sort:hover, .watchlist th button.sort:focus-visible { color: var(--text); }
.watchlist th button.sort[aria-sort] { color: var(--orange); }
.watchlist th button.sort .arrow::after { content: '↕'; opacity: 0.35; font-size: 10px; }
.watchlist th button.sort[aria-sort='ascending'] .arrow::after { content: '▲'; opacity: 1; }
.watchlist th button.sort[aria-sort='descending'] .arrow::after { content: '▼'; opacity: 1; }
.watchlist tr:last-child td { border-bottom: 0; }
.wl-ticker { font-weight: 700; font-size: 15px; }
.wl-zone { font-weight: 600; color: var(--text); white-space: nowrap; }
.wl-note { color: var(--khaki); }
.wl-updated { color: var(--muted); white-space: nowrap; font-size: 13px; }
.wl-actions { white-space: nowrap; text-align: right; }

/* ---------- Post form extras ---------- */
details.extras { border-top: 1px solid var(--border); padding-top: 12px; }
details.extras summary { cursor: pointer; color: var(--khaki); font-size: 14px; }
details.extras[open] { display: grid; gap: 14px; }
details.extras[open] summary { margin-bottom: 2px; }

@media (max-width: 760px) {
  .latest h1 { font-size: 24px; }
  .summary { font-size: 15px; }
  .archive-row { grid-template-columns: 1fr; gap: 4px; }
  .legend { grid-template-columns: 1fr; }
  /* Watchlist rows become stacked cards on phones. */
  .watchlist thead { display: none; }
  .watchlist, .watchlist tbody, .watchlist tr, .watchlist td { display: block; width: 100%; }
  .watchlist tr { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
  .watchlist td { padding: 0; border: 0; }
  .wl-ticker { grid-column: 1; } .watchlist td:nth-child(2) { grid-column: 2; text-align: right; }
  .wl-zone::before { content: 'Buy zone '; color: var(--muted); font-weight: 400; }
  .editable .wl-zone::before { content: none; }
  .wl-price, .wl-ext, .wl-ma, .wl-zone, .wl-note, .wl-updated, .wl-actions { grid-column: 1 / -1; text-align: left; }
  .wl-ma50::before { content: 'vs 50-day '; color: var(--muted); font-weight: 400; }
  .wl-ma200::before { content: 'vs 200-day '; color: var(--muted); font-weight: 400; }
  .ma-val { display: inline; margin-left: 6px; }
  .row-remove { opacity: 1; }
  input.inline::placeholder { color: var(--muted); }
  .wl-ext:has(.muted:only-child) { display: none; }
}
