:root {
  color-scheme: dark;
  --bg: #111213;
  --panel: #191b1d;
  --raised: #202225;
  --line: #343638;
  --text: #f6f3ec;
  --muted: #aaa9a5;
  --accent: #f1bd72;
  --olive: #a8c6a1;
  font: 15px/1.55 "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
a { color: var(--accent); text-underline-offset: .2em; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; letter-spacing: -.055em; text-wrap: balance; }
h2 { font-size: 1.12rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
p, small { color: var(--muted); }
.topbar { height: 71px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(16px, 3.5vw, 49px); border-bottom: 1px solid var(--line); background: #151617; }
.actions, .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar select { width: auto; }
.toolbar button { white-space: nowrap; }
.consent { grid-column: 1 / -1; font-size: .85rem; }
.consent input { width: auto; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid var(--line); background: #202123; border-radius: 5px; color: #ddd9d1; font-size: .75rem; white-space: nowrap; }
.chip.amber { color: var(--accent); border-color: #624d35; background: #272019; }
.chip.live { color: #c7ddc2; border-color: #43543e; background: #20291e; }
i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; vertical-align: .13em; }
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 71px); max-width: 1660px; margin: auto; }
.rail { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 36px 15px 29px; background: #151617; border-right: 1px solid var(--line); }
.rail nav { display: grid; gap: 4px; }
.rail button { border: 1px solid transparent; border-radius: 7px; padding: 9px 8px; text-align: left; color: #c2c1bc; background: transparent; display: flex; gap: 8px; align-items: center; font-size: .84rem; white-space: nowrap; }
.rail button:hover { background: var(--raised); }
.rail button[aria-current="page"] { background: #29221a; border-color: #59462f; color: var(--accent); }
.rail button span { width: 21px; text-align: center; font-size: 1.14rem; }
.rail-footer { border-top: 1px solid var(--line); margin: 0 5px; padding: 17px 1px 0; font-size: .82rem; }
.rail-footer span { color: var(--olive); }
.rail-footer i { margin-right: 4px; }
.rail-footer small { display: block; margin-top: 6px; }
main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 25px clamp(16px, 4.4vw, 70px) 18px; min-width: 0; }
.intro { padding: 6px 0 21px; }
.intro h1 { font-size: clamp(2.45rem, 4.6vw, 3.75rem); }
.intro p { max-width: 59ch; margin-top: 13px; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: clamp(15px, 2.6vw, 21px); min-width: 0; }
.panel-head, .view-head, .form-footer, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head { padding-bottom: 11px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-head p, .section-head p { margin-top: 3px; font-size: .88rem; }
.view-head { margin: 10px 0 25px; }
.view-head p { margin-top: 9px; }
.section-head { margin-bottom: 15px; }
.grid-two, .grid-market, .grid-dates, .cards, .stats { display: grid; gap: 11px; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-market { grid-template-columns: 1fr 1fr .8fr; gap: 8px; min-width: 0; }
.grid-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; }
.field label { font-size: .81rem; font-weight: 650; color: #dedbd3; }
.field label span { font-weight: 400; color: var(--muted); margin-left: 3px; }
.field small { font-size: .79rem; }
form > .field, .import-grid, #own-inputs { margin-top: 13px; }
input, select, textarea { width: 100%; min-width: 0; color: var(--text); padding: 8px 10px; border-radius: 6px; border: 1px solid #3d3e40; background: #131516; font-size: .88rem; }
input[readonly] { color: #dad6cc; }
input[type="file"] { padding: 7px; }
input::file-selector-button { font: inherit; padding: 3px 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 4px; color: var(--text); margin-right: 7px; }
input::placeholder { color: #8d8c88; }
textarea { resize: vertical; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #131516; }
.segmented button { border: 0; color: var(--muted); padding: 5px 9px; border-radius: 4px; background: transparent; font-size: .8rem; white-space: nowrap; }
.segmented button[aria-pressed="true"] { color: var(--accent); background: #2b231a; }
.primary, .secondary, .text-button { border-radius: 6px; padding: 7px 11px; font-size: .85rem; font-weight: 650; }
.primary { color: #21180e; background: var(--accent); border: 1px solid var(--accent); padding: 9px 13px; }
.primary:hover { background: #ffce89; }
.secondary { color: var(--text); background: #212325; border: 1px solid #3e3f41; }
.secondary:hover { background: #2d3032; }
.text-button { color: var(--accent); background: transparent; border: 1px solid transparent; padding: 4px 0; text-align: left; }
.text-button:hover { text-decoration: underline; }
.evidence-strip { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 13px; color: var(--muted); font-size: .81rem; }
.evidence-strip b { color: var(--accent); }
.form-footer { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 11px; }
.form-footer p { font-size: .82rem; }
.form-footer i { color: var(--olive); margin-right: 4px; }
.error { color: #ffad9f !important; }
.settings { margin-bottom: 20px; }
.settings .field { max-width: 310px; margin-top: 10px; }
.settings p, details p { margin-top: 9px; font-size: .86rem; }
details { margin-top: 10px; color: #dfdbd3; }
summary { cursor: pointer; font-size: .84rem; }
code { overflow-wrap: anywhere; }
.stack { display: grid; gap: 13px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 13px; }
.stat strong { display: block; font-size: clamp(1.2rem, 2.6vw, 2rem); line-height: 1.28; letter-spacing: -.045em; }
.stat span { color: var(--muted); font-size: .78rem; }
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 7px; background: #151719; padding: 12px; min-width: 0; }
.card p { font-size: .87rem; margin: 6px 0; overflow-wrap: anywhere; }
.card .chip { margin: 0 5px 5px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 550; white-space: nowrap; }
td.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
td:first-child { min-width: 198px; }
td .text-button { display: block; }
.row-note { display: block; color: var(--muted); font-size: .78rem; }
.table-scroll .chip { margin: 2px; }
.narrow-select { max-width: 210px; }
.subtle { color: var(--muted); font-size: .85rem; }
.inline-list { margin: 7px 0; padding-left: 20px; }
.inline-list li { padding: 4px 0; overflow-wrap: anywhere; }
.refs { list-style: none; padding: 0; margin: 0; }
.refs li { border-top: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
.refs li p { margin-top: 4px; font-size: .86rem; }
.refs .chip { margin-left: 5px; }
.ai-text, .saved-brief { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); margin-top: 12px; }
.question-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 8px; margin-top: 8px; }
@media (max-width: 880px) {
  .layout { grid-template-columns: 192px minmax(0, 1fr); }
  .rail { padding-inline: 9px; }
  .rail button { font-size: .73rem; gap: 4px; }
  main { padding-inline: 23px; }
}
@media (max-width: 740px) {
  .layout { display: block; }
  .rail { padding: 7px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail nav { display: flex; flex-wrap: wrap; gap: 3px; }
  .rail button { padding: 4px 7px; gap: 3px; }
  .rail button span { width: 15px; }
  .rail-footer { display: none; }
  main { padding: 14px 15px; }
  .intro { padding: 14px 0 20px; }
  .topbar { min-height: 60px; height: auto; padding-block: 9px; }
}
@media (max-width: 480px) {
  .grid-two, .cards, .question-form { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
