/* Ignite StoryPulse — newsroom dashboard
   Brand: Ignite Television Brand Guidelines, Edition 01 · 2026
   Ignite Orange #F5821F · Broadcast Black #0F0D0C · Signal White · Ember #C2591B · Peach Static #F9B87A
   Lora for display, Inter for everything that works. Chevrons point right. Glow rises from a corner. */

:root {
  --orange: #F5821F;
  --ember: #C2591B;
  --peach: #F9B87A;
  --black: #0F0D0C;
  --white: #FFFFFF;
  --navy: #1E2733;
  --olive: #6F6C4B;

  --bg: #0F0D0C;
  --panel: #1A1613;
  --panel-2: #221D19;
  --panel-3: #2A2420;
  --line: #2E2823;
  --line-2: #3A332D;
  --ink: #FFFFFF;
  --ink-2: #CFC7BD;
  --ink-3: #8E867D;
  --ink-4: #6B645D;

  /* Data colours (validated for the dark surface): diverging blue ↔ ember, gray midpoint; single-hue orange for magnitude */
  --pos: #3987E5;
  --neu: #6B6762;
  --neg: #C2591B;
  --bar: #F5821F;
  --bar-soft: rgba(245, 130, 31, 0.28);
  --grid: #2C2825;
  --axis: #3A3531;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Lora', Georgia, 'Times New Roman', serif;
  --grain-url: none; /* drop the design desk's grain master at /assets/grain.png and set url('assets/grain.png') */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--peach); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--orange); color: var(--black); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background:
    var(--grain-url),
    linear-gradient(100deg, #F5821F 0%, #D0661F 22%, #8A3D12 46%, #2A1A10 70%, #0F0D0C 100%);
  background-blend-mode: soft-light, normal;
  border-bottom: 1px solid #000;
}
.topbar-inner {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  padding: 10px 20px; max-width: 1680px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 34px; width: auto; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark .ig { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--white); letter-spacing: -0.02em; }
.wordmark .band { font-family: var(--font-ui); font-weight: 800; font-size: 9.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--white); background: rgba(15, 13, 12, 0.55); padding: 3px 6px 2px; margin-top: 3px; border-radius: 2px; align-self: flex-start; }
.brand .sub { font-size: 11px; color: rgba(255, 255, 255, 0.75); letter-spacing: 0.04em; margin-left: 2px; }

.nav { display: flex; gap: 4px; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: rgba(255, 255, 255, 0.78); font-weight: 600; font-size: 13px; padding: 8px 12px; border-radius: 6px; white-space: nowrap;
  letter-spacing: 0.01em;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(15, 13, 12, 0.6); color: #fff; box-shadow: inset 0 -2px 0 var(--orange); }

.status { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, 0.85); white-space: nowrap; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(245, 130, 31, 0.6); animation: pulse 2.2s infinite; }
.live.off .dot { background: var(--ink-3); animation: none; box-shadow: none; }
.live.busy .dot { background: var(--peach); animation: pulse 0.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 130, 31, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(245, 130, 31, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 130, 31, 0); } }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: #fff; }
.clock small { font-weight: 500; color: rgba(255, 255, 255, 0.7); margin-left: 4px; }
.search { position: relative; }
.search input {
  background: rgba(15, 13, 12, 0.55); border: 1px solid rgba(255, 255, 255, 0.15); color: #fff; border-radius: 6px;
  padding: 7px 10px 7px 30px; width: 220px; outline: none;
}
.search input:focus { border-color: var(--peach); }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: rgba(255, 255, 255, 0.7); }
.btn-ghost { background: rgba(15, 13, 12, 0.45); border: 1px solid rgba(255, 255, 255, 0.15); color: #fff; padding: 7px 12px; border-radius: 6px; font-weight: 600; font-size: 12px; }
.btn-ghost:hover { border-color: #fff; }

/* chevron strip — the brand's direction-of-travel motif */
.chevron-strip { height: 6px; display: flex; max-width: 100%; }
.chevron-strip .bar { flex: 1; background: var(--orange); }
.chevron-strip .chev { width: 14px; background: linear-gradient(135deg, var(--orange) 50%, var(--black) 50%); }
.chevron-strip .chev + .chev { background: linear-gradient(135deg, var(--black) 50%, var(--orange) 50%); }
.chevron-strip .end { width: 120px; background: var(--black); }

/* ---------- layout ---------- */
.page { max-width: 1680px; margin: 0 auto; padding: 18px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head .kicker { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); font-weight: 800; margin-bottom: 4px; }
.page-head .lede { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid-wall { display: grid; grid-template-columns: 1.15fr 1.35fr 0.9fr; gap: 16px; align-items: start; }
.grid-wall > *, .grid-2 > *, .grid-3 > *, .story > *, .pulse > *, .ev > *, .opp > *, .event-card > *, .alerts .row > * { min-width: 0; }
@media (min-width: 1281px) {
  .grid-wall .scroll-col { max-height: calc(100vh - 250px); min-height: 420px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .grid-wall > .panel { position: sticky; top: 76px; }
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17px; }
.panel-head .kicker { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); font-weight: 800; display: block; margin-bottom: 2px; }
.panel-head .meta { color: var(--ink-3); font-size: 12px; }
.panel-body { padding: 10px 14px 14px; }
.panel-body.flush { padding: 0; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 0% 0%, rgba(245, 130, 31, 0.16), transparent 60%); pointer-events: none; }
.kpi .label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.kpi .value { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi .mix { display: flex; height: 6px; border-radius: 4px; overflow: hidden; margin-top: 10px; gap: 2px; background: transparent; }
.kpi .mix span { display: block; height: 100%; }
.kpi .mix .p { background: var(--pos); } .kpi .mix .n { background: var(--neu); } .kpi .mix .g { background: var(--neg); }
.kpi .legend { display: flex; gap: 10px; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.kpi .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* chips, tags, dots */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel-3); color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.chip.src { background: var(--panel-2); }
.chip.kw { background: rgba(245, 130, 31, 0.14); color: var(--peach); border-color: rgba(245, 130, 31, 0.35); }
.chip.cat { text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
.chip.tbc { background: rgba(249, 184, 122, 0.12); color: var(--peach); border-style: dashed; }
.chip.state { background: var(--navy); color: #cfd8e6; border-color: #2c3a4e; }
.chip.state.claimed { background: #3b2a12; color: var(--peach); border-color: #6b4a1f; }
.chip.state.covered { background: #1f3326; color: #b9e2c4; border-color: #2f5a3b; }
.chip.state.parked { background: #2a2420; color: var(--ink-3); }
.chip.ai { background: #1E2733; color: #9fc3ff; border-color: #2c3f5c; }
.topic { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.02em; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; background: var(--neu); flex: none; }
.sdot.positive { background: var(--pos); } .sdot.negative { background: var(--neg); }
.sent-label { font-size: 11px; color: var(--ink-3); }
.time { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.filters button.active { background: var(--orange); border-color: var(--orange); color: var(--black); }
.filters button:hover { border-color: var(--ink-3); }

/* buttons & forms */
.btn { background: var(--orange); color: var(--black); border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 700; font-size: 13px; }
.btn:hover { background: var(--peach); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.secondary { background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2); }
.btn.secondary:hover { background: var(--line-2); }
.btn.danger { background: transparent; color: var(--ember); border: 1px solid var(--ember); }
.btn:disabled { opacity: 0.5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.field input, .field select, .field textarea { background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; color: var(--ink); outline: none; min-width: 0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); }
select { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.form-grid .wide { grid-column: 1 / -1; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.story { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.15s; }
.story:hover { background: var(--panel-2); }
.story.new { box-shadow: inset 3px 0 0 var(--orange); }
.story .t { font-weight: 600; font-size: 13.5px; line-height: 1.35; color: var(--ink); }
.story .t a { color: inherit; }
.story .m { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.story .sum { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; line-height: 1.4; }
.story .when { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; padding-top: 2px; }

.pulse { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.pulse:hover { background: var(--panel-2); }
.pulse .rank { font-family: var(--font-display); font-size: 20px; color: var(--orange); line-height: 1; padding-top: 2px; }
.pulse .h { font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.3; }
.pulse .bar { height: 4px; background: var(--panel-3); border-radius: 3px; margin: 8px 0 6px; overflow: hidden; }
.pulse .bar i { display: block; height: 100%; background: var(--orange); border-radius: 3px; }
.pulse .m { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pulse .outlets { font-size: 12px; color: var(--ink-2); }
.pulse .outlets b { color: var(--ink); }

.alerts .row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.alerts .row:hover { background: var(--panel-2); }
.alerts .term { font-weight: 700; font-size: 13px; }
.alerts .count { font-family: var(--font-display); font-size: 18px; color: var(--orange); font-variant-numeric: tabular-nums; }
.alerts .count.zero { color: var(--ink-4); }
.alerts .latest { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ev { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ev .date { text-align: center; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 2px; line-height: 1.1; }
.ev .date b { display: block; font-family: var(--font-display); font-size: 19px; }
.ev .date span { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); font-weight: 800; }
.ev .title { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.ev .m { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.ev .cd { font-size: 12px; color: var(--ink-3); }
.ev .cd b { color: var(--peach); }

/* opportunities */
.opp { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.opp .score { text-align: center; }
.opp .score b { display: block; font-family: var(--font-display); font-size: 24px; color: var(--orange); line-height: 1; }
.opp .score span { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.opp .title { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.opp .why { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.opp .m { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

/* calendar */
.cal-month { margin-bottom: 18px; }
.cal-month h3 { font-size: 15px; color: var(--peach); padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.event-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: start; }
.event-card:hover { background: var(--panel-2); }
.event-card .date { text-align: center; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 2px; }
.event-card .date b { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1; }
.event-card .date span { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); font-weight: 800; margin-top: 2px; }
.event-card .date small { display: block; color: var(--ink-3); font-size: 10px; }
.event-card .title { font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.3; }
.event-card .desc { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.event-card .m { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.event-card .actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.event-card .opp-pill { font-family: var(--font-display); font-size: 20px; color: var(--orange); text-align: right; line-height: 1; }
.event-card .opp-pill small { display: block; font-family: var(--font-ui); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.angles { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 10px; grid-column: 1 / -1; }
.angles h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); font-weight: 800; }
.angles .hl { font-family: var(--font-display); font-size: 17px; margin-bottom: 4px; }
.angles .why { color: var(--ink-2); font-size: 13px; margin-bottom: 10px; }
.angles ul { margin: 0 0 10px; padding-left: 18px; }
.angles li { margin: 3px 0; font-size: 13px; }
.angles li .fmt { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--peach); font-weight: 800; margin-left: 6px; }
.angles li .who { color: var(--ink-3); font-size: 12px; }
.angles .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.angles .risk { font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 8px; }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-grid .dow { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; text-align: center; padding: 4px 0; }
.month-grid .day { min-height: 84px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 11px; }
.month-grid .day.pad { background: transparent; border-color: transparent; }
.month-grid .day.today { border-color: var(--orange); }
.month-grid .day .n { color: var(--ink-3); font-weight: 700; }
.month-grid .day .e { display: block; margin-top: 3px; padding: 2px 5px; background: var(--panel-3); border-left: 3px solid var(--orange); border-radius: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-grid .day .e.tbc { border-left-style: dashed; }
.month-grid .day .e.hol { border-left-color: var(--peach); }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-ui); fill: var(--ink-3); font-size: 11px; }
.chart .val { fill: var(--ink-2); font-weight: 600; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis line { stroke: var(--axis); stroke-width: 1; }
.chart .mark { cursor: pointer; }
.chart .mark:hover { opacity: 0.85; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; margin: 2px 0 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tooltip { position: fixed; z-index: 100; background: #fff; color: var(--black); font-size: 12px; padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow); pointer-events: none; display: none; max-width: 260px; }
.tooltip b { display: block; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.chart-foot button { background: none; border: 0; color: var(--ink-3); font-size: 11px; text-decoration: underline; padding: 0; }
.chart-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.chart-table th, .chart-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.chart-table td.num, .chart-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sparks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.spark { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.spark .n { font-weight: 700; font-size: 12.5px; display: flex; justify-content: space-between; }
.spark .n b { font-family: var(--font-display); color: var(--orange); }

/* ---------- brief ---------- */
.brief .narr { font-family: var(--font-display); font-size: 17px; line-height: 1.55; border-left: 4px solid var(--orange); padding: 6px 16px; margin: 8px 0 18px; color: var(--ink); }
.brief h3 { font-size: 15px; margin: 18px 0 8px; color: var(--peach); }
.brief ol, .brief ul { margin: 0; padding-left: 20px; }
.brief li { margin: 6px 0; }
.brief li .meta { color: var(--ink-3); font-size: 12px; }
.brief li ul li { font-size: 12.5px; margin: 2px 0; }

/* ---------- settings ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: #8fd3a2; } .err { color: var(--ember); } .muted { color: var(--ink-3); }
.switch { position: relative; width: 36px; height: 20px; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 999px; display: inline-block; vertical-align: middle; cursor: pointer; }
.switch i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-3); transition: all 0.15s; }
.switch.on { background: var(--orange); border-color: var(--orange); }
.switch.on i { left: 18px; background: var(--black); }
.switch.disabled { opacity: 0.5; cursor: default; }
.kw-list { display: flex; flex-wrap: wrap; gap: 8px; }
.kw { display: inline-flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 600; }
.kw.off { opacity: 0.5; }
.kw button { background: transparent; border: 0; color: var(--ink-3); font-size: 11px; padding: 2px 6px; border-radius: 999px; }
.kw button.on { color: var(--orange); }
.kw button:hover { background: var(--panel-3); color: var(--ink); }
.note { background: var(--panel-2); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); }
.note code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- drawer / modal ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 80; display: none; }
.drawer-bg.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); border-left: 1px solid var(--line-2); z-index: 90; transform: translateX(100%); transition: transform 0.2s; overflow-y: auto; box-shadow: var(--shadow); }
.drawer.open { transform: translateX(0); }
.drawer-head { position: sticky; top: 0; background: var(--panel); display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); z-index: 1; }
.drawer-body { padding: 16px; }
.drawer-body h2 { font-size: 20px; line-height: 1.3; }
.drawer .sum { color: var(--ink-2); font-size: 14px; margin: 10px 0; line-height: 1.5; }
.drawer .section { margin-top: 18px; }
.drawer .section h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); font-weight: 800; }
.drawer .sib { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.drawer .sib .time { margin-left: 6px; }
.state-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.state-row input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; color: var(--ink); width: 140px; }
.close { background: none; border: 0; color: var(--ink-3); font-size: 22px; line-height: 1; }
.close:hover { color: #fff; }

/* toast & overlay */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #fff; color: var(--black); font-weight: 600; font-size: 13px; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); border-left: 6px solid var(--orange); animation: rise 0.25s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay { position: fixed; inset: 0; background: linear-gradient(135deg, #F5821F 0%, #C2591B 30%, #2A1A10 65%, #0F0D0C 100%); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.overlay.open { display: flex; }
.login { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 28px; width: min(380px, 100%); box-shadow: var(--shadow); }
.login h1 { font-size: 24px; margin-bottom: 4px; }
.login p { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }
.login .err { margin-top: 8px; font-size: 12px; min-height: 16px; }
.empty { color: var(--ink-3); padding: 24px 14px; text-align: center; font-size: 13px; }
.loading { color: var(--ink-3); padding: 24px; text-align: center; }
.loading::after { content: ''; display: inline-block; width: 14px; height: 14px; border: 2px solid var(--orange); border-right-color: transparent; border-radius: 50%; margin-left: 8px; vertical-align: middle; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { color: var(--ink-3); font-size: 12px; }
footer { color: var(--ink-4); font-size: 11.5px; text-align: center; padding: 30px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .grid-wall { grid-template-columns: 1fr 1fr; }
  .grid-wall .col-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .kpis.four { grid-template-columns: repeat(2, 1fr); }
  .chart { overflow-x: auto; }
  .chart svg { min-width: 520px; }
  .topbar-inner { grid-template-columns: 1fr auto; gap: 10px; padding: 10px 16px; }
  .nav { grid-column: 1 / -1; justify-content: flex-start; }
  .search input { width: 150px; }
  .clock { display: none; }
  .grid-wall, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-wall .col-right { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 14px 16px 50px; }
  .event-card { grid-template-columns: 56px 1fr; }
  .event-card .actions { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .angles .cols { grid-template-columns: 1fr; }
  .month-grid .day { min-height: 56px; font-size: 10px; }
}
@media (max-width: 520px) {
  .kpis, .kpis.four { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 24px; }
  .search { display: none; }
  .page-head h1 { font-size: 23px; }
}
@media print {
  .topbar, .chevron-strip, .toolbar, .drawer, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border-color: #ccc; }
}
