/* Panel theme: shares the design language of the marketing site (site/index.html)
   — paper background, ink text, hairline rules, square corners, serif display
   headings, monospace labels. Light-only by design. */
:root {
  color-scheme: light;
  --paper: #f7f8f6;
  --ink: #16211f;
  --muted: #5c6b66;
  --rule: #d8ded9;
  --green: #0e7a52;
  --red: #b5483f;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  /* chart colors (names are a JS contract — panel.js reads them at load) */
  --chart-up: #0e7a52; --chart-down: #b5483f;
  --sma-fast: #3a6ea5; --sma-slow: #b07d2f; --rsi-line: #6b5ca8;
  --chart-text: #5c6b66; --chart-grid: #d8ded988;
}
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131917;
  --ink: #e8ece9;
  --muted: #93a29c;
  --rule: #2a332f;
  --green: #35b183;
  --red: #d97a6f;
  --chart-up: #35b183; --chart-down: #d97a6f;
  --sma-fast: #6d9fd4; --sma-slow: #cfa050; --rsi-line: #9d8fd6;
  --chart-text: #93a29c; --chart-grid: #2a332f88;
}
body { font-family: var(--sans); background: var(--paper); color: var(--ink);
  margin: 0; padding: 1.5rem; max-width: 1100px; margin-inline: auto; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; margin-top: 2rem; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--rule); }
th { font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.up { color: var(--green); } .down { color: var(--red); }
.badge { font-family: var(--mono); padding: .1rem .5rem; font-size: .72rem;
  font-weight: 600; letter-spacing: .04em; border: 1px solid currentColor; }
.long { background: #0e7a5214; color: var(--green); } .short { background: #b5483f14; color: var(--red); }
.close-b { background: #5c6b6614; color: var(--muted); }
.paper { background: #3a6ea514; color: #3a6ea5; } .live { background: #b5483f14; color: var(--red); }
.auto-badge { background: var(--red); color: var(--paper); border-color: var(--red); }
.card { border: 1px solid var(--rule); background: var(--paper); padding: 1rem; margin: .8rem 0; }
.review { font-size: .85rem; color: var(--muted); margin: .5rem 0; }
.stance-agree { color: var(--green); } .stance-disagree { color: var(--red); }
.stance-neutral, .stance-unavailable, .stance-pending { color: var(--muted); }
button { font-family: var(--mono); font-size: .82rem; padding: .35rem .9rem;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; transition: background .15s, color .15s; }
button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
button:disabled { opacity: .5; cursor: default; }
.approve { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.approve:hover:not(:disabled) { background: var(--green); border-color: var(--green); color: var(--paper); }
.danger { border-color: var(--red); color: var(--red); }
.danger:hover:not(:disabled) { background: var(--red); color: var(--paper); }
.danger-solid { background: var(--red); color: var(--paper); border-color: var(--red); }
.danger-solid:hover:not(:disabled) { background: #9c3a32; border-color: #9c3a32; color: var(--paper); }
input, select, textarea { font-family: inherit; font-size: .9rem;
  border: 1px solid var(--rule); background: var(--paper); color: inherit; padding: .3rem .5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
.warn { background: #b5483f10; border: 1px solid var(--red); padding: .6rem 1rem; margin: .5rem 0; }
.ok { background: #0e7a5210; border: 1px solid var(--green); padding: .6rem 1rem; margin: .5rem 0; }
.muted { color: var(--muted); font-size: .85rem; }
.statusbar { font-family: var(--mono); font-size: .78rem; padding: .45rem .8rem;
  border: 1px solid var(--rule); margin: .6rem 0; display: flex;
  flex-wrap: wrap; gap: 1rem; position: sticky; top: 0; backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--paper) 85%, transparent); z-index: 10; }
.statusbar .stale { color: var(--red); font-weight: 600; }
.statusbar .live-dot { color: var(--green); } .statusbar .dead-dot { color: var(--red); }
.chart-tabs button, .tf-tabs button { margin-right: .3rem; }
.chart-tabs button.active, .tf-tabs button.active,
.page-tabs button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chart-legend { font-family: var(--mono); font-size: .74rem; color: var(--muted); margin: .4rem 0; }
.chart-legend .key { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: .3rem; }
#price-chart { height: 300px; } #rsi-chart { height: 110px; } #equity-chart { height: 160px; }
.impact { font-family: var(--mono); font-weight: 600; font-size: .76rem; }
.impact.bullish { color: var(--green); } .impact.bearish { color: var(--red); } .impact.neutral { color: var(--muted); }
.news-list li { margin: .3rem 0; font-size: .9rem; }
.news-list a { text-decoration: none; }
.news-list a:hover { text-decoration: underline; }
.bracket-line { font-family: var(--mono); font-size: .82rem; margin: .3rem 0; }
.stats { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .95rem; margin: .6rem 0; }
.stats div span { display: block; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* --- SaaS chrome: nav, auth forms, footer, ads ------------------------------ */
.topnav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule); padding-bottom: .8rem; margin-bottom: 1rem; }
.topnav .brand { font-family: var(--mono); font-size: .95rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; }
.topnav .brand .tld { color: var(--muted); font-weight: 400; }
.topnav a { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em;
  color: var(--muted); text-decoration: none; }
.topnav a.active, .topnav a:hover { color: var(--ink); }
.topnav .spacer { flex: 1; }
.auth-card { max-width: 380px; margin: 4rem auto; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text] {
  width: 100%; box-sizing: border-box; padding: .5rem .6rem; margin: .3rem 0 .8rem; }
.auth-card button { width: 100%; }
.form-error { color: var(--red); font-size: .85rem; margin: .4rem 0; }
.footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; color: var(--muted); }
.ad-slot { margin: .8rem 0; text-align: center; }
.ad-slot:empty { display: none; }
.page-tabs { display: flex; gap: .4rem; margin: 1rem 0; border-bottom: 1px solid var(--rule); padding-bottom: .6rem; }
.help { margin: .2rem 0 .6rem; }
.strategy-card .lock { opacity: .7; }
.strategy-card.locked { opacity: .65; border-style: dashed; }

/* --- mobile ------------------------------------------------------------- */
/* wide tables scroll inside their container instead of overflowing the page */
#positions, #closed, #market, #decisions, #stats, #strategy-health,
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
  body { padding: .75rem; }
  input, select, textarea { font-size: 16px; } /* stops iOS zoom-on-focus */
  button { padding: .55rem 1rem; }
  table { font-size: .8rem; }
  th, td { padding: .35rem .4rem; }
  .statusbar { position: static; }
  .auth-card { margin: 1.5rem auto; }
  .page-tabs, .chart-tabs, .tf-tabs { display: flex; overflow-x: auto; }
  .page-tabs button, .chart-tabs button, .tf-tabs button { white-space: nowrap; flex-shrink: 0; }
  #price-chart { height: 240px; }
  .topnav { gap: .6rem; }
}
