:root {
  --bg: #101218;
  --bg-elev: #171b24;
  --line: #2a3140;
  --text: #e8e4d9;
  --muted: #8b927e;
  --on: #3dba8a;
  --off: #e07a3d;
  --peak: #c9a227;
  --danger: #d45d5d;
  --info: #6ea8d8;
  --load-day-max: #163a72;
  --peak-predict: #ff7a00;
  --peak-predict-2: #c9a24a;
  --peak-predict-3: #8fa3bf;
  --mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { min-height: 100vh; background-image: linear-gradient(180deg, #141820 0%, #101218 40%); }

a { color: inherit; text-decoration: none; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px 48px; }

header.app {
  display: flex; align-items: center; gap: 24px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: rgba(16,18,24,.92); position: sticky; top: 0; z-index: 10;
  overflow: visible;
}
.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
}
.brand {
  font-weight: 650; letter-spacing: .08em; text-transform: uppercase; font-size: 13px;
  background: none; border: 0; padding: 0; color: inherit; font-family: inherit;
  cursor: pointer;
}
.brand-time {
  display: inline-block;
  vertical-align: baseline;
  font-size: 1em;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: inherit;
  color: var(--peak);
  background-color: var(--peak);
  background-image: linear-gradient(
    90deg,
    #a8841a 0%,
    #c9a227 18%,
    #ffe7a0 42%,
    #fffdf4 50%,
    #ffe7a0 58%,
    #c9a227 82%,
    #a8841a 100%
  );
  background-size: 200% 100%;
  background-repeat: repeat-x;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brand-time-wave 2s linear infinite alternate;
}
@keyframes brand-time-wave {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-time {
    animation: none;
    -webkit-text-fill-color: var(--peak);
    color: var(--peak);
    background-image: none;
  }
}
.brand:hover { color: var(--text); }
.brand.restarting { color: var(--peak); cursor: wait; }
.brand-ver {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--muted);
  line-height: 1;
  text-transform: none;
}
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a { padding: 6px 10px; border-radius: 4px; color: var(--muted); font-size: 13px; white-space: nowrap; }
nav a.active, nav a:hover { background: var(--bg-elev); color: var(--text); }

.chips { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 11px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 99px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .hint { margin-left: 0; }
.chip.ok { color: var(--on); border-color: #245c46; }
.chip.warn { color: var(--peak); border-color: #5c4a16; }
.chip.bad { color: var(--danger); border-color: #6a3030; }
.chip-eta {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 7.2ch;
  justify-content: center;
}
.chip-eta #refresh-eta { letter-spacing: .04em; }

h1 { font-size: 22px; font-weight: 550; margin: 28px 0 8px; }
.peak-forecast-flag {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .01em;
}
.peak-forecast-flag.frozen { color: var(--on); }
.peak-forecast-flag.live { color: var(--off); }
.lead { color: var(--muted); margin: 0 0 20px; }
.page-today .lead,
.page-yesterday .lead,
.page-tomorrow .lead {
  font-size: 9px;
  line-height: 1.4;
}

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.kpi { background: var(--bg-elev); border: 1px solid var(--line); padding: 14px 16px; }
.kpi .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-family: var(--mono); font-size: 28px; margin-top: 6px; }
.kpi.on .v { color: var(--on); }
.kpi.off .v { color: var(--off); }

.actions { display: flex; gap: 8px; margin: 12px 0 20px; }
button, .btn {
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; font: 13px var(--sans); cursor: pointer; border-radius: 2px;
}
button.primary { background: #c9a227; color: #16140c; border-color: #c9a227; font-weight: 600; }
button:hover { filter: brightness(1.08); }

.chart {
  height: 220px; display: flex; align-items: flex-end; gap: 3px;
  padding: 16px 8px 8px; background: var(--bg-elev); border: 1px solid var(--line);
}
.bar {
  flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative;
}
.bar .fill { width: 100%; }
.bar.on .fill { background: var(--on); }
.bar.off .fill { background: var(--off); }
.chart.power .bar.on.forecast .fill {
  background: repeating-linear-gradient(
    135deg,
    var(--on) 0 3px,
    #0e1a12 3px 6px
  );
}
.chart.power .bar.off.forecast .fill {
  background: repeating-linear-gradient(
    135deg,
    var(--off) 0 3px,
    #241410 3px 6px
  );
}
.chart.power .bar.peak::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--peak);
  z-index: 1;
  pointer-events: none;
}
.bar.peak { box-shadow: inset 0 -3px 0 var(--peak); }
@keyframes now-pulse {
  0%, 100% { filter: brightness(0.62); }
  50% { filter: brightness(1.55); }
}
.bar.now .fill {
  animation: now-pulse 1s ease-in-out infinite;
}
.bar .tip {
  display: none; position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px);
  background: #0c0e12; border: 1px solid var(--line); padding: 6px 8px; font-size: 11px;
  white-space: nowrap; z-index: 2;
}
.bar:hover .tip { display: block; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 18px; }
table.data th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; padding: 8px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 8px; border-bottom: 1px solid #222836; font-variant-numeric: tabular-nums; }
tr.off td.action { color: var(--off); font-weight: 600; }
tr.on td.action { color: var(--on); font-weight: 600; }
.badge {
  font-size: 10px; padding: 2px 6px; border-radius: 2px; border: 1px solid var(--line); color: var(--muted);
}
.badge.peak { color: var(--peak); border-color: #5c4a16; }
.badge.cleared { color: var(--on); }
.badge.forecast { color: var(--info); }

.warns { margin: 12px 0; padding: 10px 12px; border: 1px solid #5c4a16; color: var(--peak); font-size: 13px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }

.form { display: grid; grid-template-columns: 220px 1fr; gap: 10px 16px; max-width: 720px; }
.form label { color: var(--muted); align-self: center; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.form input, .form select {
  background: #0c0e12; color: var(--text); border: 1px solid var(--line); padding: 8px;
  font: 14px var(--mono);
}
.form .form-section {
  grid-column: 1 / -1;
  margin: 12px 0 2px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.form select:disabled, .form input:disabled { opacity: .55; cursor: not-allowed; }
.form .source-note {
  grid-column: 1 / -1;
  margin: 4px 0 8px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.form .source-note h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form .source-note p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.form .source-note p:last-child { margin-bottom: 0; }
.form .source-note a { color: var(--info); text-decoration: underline; }
.form .source-note .muted { font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card { background: var(--bg-elev); border: 1px solid var(--line); padding: 16px; }
.card h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .freshness { grid-template-columns: 1fr 1fr; }
  .price-block { grid-template-columns: 40px 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .chart.price .bar:nth-child(odd of .bar) .lbl { visibility: hidden; }
  .cards, .form { grid-template-columns: 1fr; }
  .chips { margin-left: 0; }
  header.app { flex-wrap: wrap; }
}

.legend { color: var(--muted); font-size: 12px; margin: 8px 0 16px; }
.page-today .legend,
.page-yesterday .legend,
.page-tomorrow .legend {
  font-size: 10px;
  line-height: 1.4;
}
.actions .hint { align-self: center; }

.block-title { font-size: 15px; font-weight: 550; margin: 22px 0 8px; }

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  margin: 8px 0 8px;
}
.charts-row .block-title { margin-top: 12px; }
.charts-row .legend { margin-bottom: 4px; min-height: 34px; }
.page-today .charts-row .legend,
.page-yesterday .charts-row .legend,
.page-tomorrow .charts-row .legend { min-height: 26px; }
.charts-row .price-block { grid-template-columns: 40px 1fr; gap: 6px; }
.charts-row .price-scale {
  font-size: 10px;
  padding: 16px 0 24px;
}
.charts-row .chart {
  height: 240px;
  gap: 2px;
  padding: 16px 6px 24px;
}
.charts-row .chart.price { height: 240px; padding: 16px 6px 24px; }
.chart.load {
  height: 240px;
  padding: 22px 6px 24px;
}
.chart.load .bar .fill { background: var(--on); }
.chart.load .bar.fact .fill { background: var(--on); }
.chart.load .bar.fact.day-max .fill,
.chart.load.compare .bar.fact.day-max .fill { background: var(--load-day-max); }
.chart.load .bar.plan .fill {
  background: repeating-linear-gradient(
    135deg,
    var(--on) 0 3px,
    #1a241c 3px 6px
  );
}
.chart.load .bar.plan.day-max .fill,
.chart.load.compare .bar.plan.day-max .fill {
  background: repeating-linear-gradient(
    135deg,
    var(--load-day-max) 0 3px,
    #0d1a2e 3px 6px
  );
}
.chart.load .bar.missing .fill { background: #222836; }
.chart.load.compare {
  align-items: stretch;
  gap: 3px;
  overflow: visible;
}
.chart.load.compare .hour {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}
.chart.load.compare .hour .pair {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 100%;
  width: 100%;
}
.chart.load.compare .hour .pair .bar {
  flex: 1;
  min-width: 0;
  height: 0;
}
.chart.load.compare .hour .pair .bar .fill {
  height: 100%;
}
.chart.load.compare .hour.peak { box-shadow: inset 0 -3px 0 var(--peak); }
.chart.load.compare .hour.predicted-peak::before,
.chart.load .bar.predicted-peak::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  color: #16140c;
  font-family: var(--mono);
  font-weight: 700;
  text-align: center;
  border-radius: 2px;
  z-index: 3;
  pointer-events: none;
}
.chart.load.compare .hour.rank-1::before,
.chart.load .bar.rank-1::before {
  content: "1";
  background: var(--peak-predict);
  color: #000;
  font-weight: 800;
  font-size: 13px;
  line-height: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
}
.chart.load.compare .hour.rank-2::before,
.chart.load .bar.rank-2::before {
  content: "2";
  background: var(--peak-predict-2);
  font-size: 10px;
  line-height: 13px;
  min-width: 13px;
  height: 13px;
  padding: 0 2px;
}
.chart.load.compare .hour.rank-3::before,
.chart.load .bar.rank-3::before {
  content: "3";
  background: var(--peak-predict-3);
  font-size: 10px;
  line-height: 13px;
  min-width: 13px;
  height: 13px;
  padding: 0 2px;
}
.chart.load.compare .hour.now .fill {
  animation: now-pulse 1s ease-in-out infinite;
}
.chart.load.compare .hour .tip {
  display: none; position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px);
  background: #0c0e12; border: 1px solid var(--line); padding: 6px 8px; font-size: 11px;
  white-space: nowrap; z-index: 2;
}
.chart.load.compare .hour:hover .tip { display: block; }
.chart.load.compare .hour .lbl {
  position: absolute; left: 0; right: 0; bottom: -18px;
  text-align: center; font-size: 9px; color: var(--muted); font-family: var(--mono);
}
.charts-row .chart.load.compare .hour:nth-child(even) .lbl { visibility: hidden; }
.chart.load .bar .lbl {
  position: absolute; left: 0; right: 0; bottom: -18px;
  text-align: center; font-size: 9px; color: var(--muted); font-family: var(--mono);
}
.charts-row .load-block .block-title { margin-top: 20px; }
.load-block { margin: 16px 0 8px; }
.charts-row .chart .bar .lbl {
  position: absolute; left: 0; right: 0; bottom: -18px;
  text-align: center; font-size: 9px; color: var(--muted); font-family: var(--mono);
}
.charts-row .chart .bar:nth-child(even of .bar) .lbl { visibility: hidden; }
.charts-row .chart.load.compare .hour.predicted-peak .lbl,
.charts-row .chart.load .bar.predicted-peak .lbl {
  visibility: visible;
  font-weight: 700;
}
.charts-row .chart.load.compare .hour.rank-1 .lbl,
.charts-row .chart.load .bar.rank-1 .lbl {
  color: var(--peak-predict);
  font-size: 12px;
}
.charts-row .chart.load.compare .hour.rank-2 .lbl,
.charts-row .chart.load .bar.rank-2 .lbl {
  color: var(--peak-predict-2);
  font-size: 10px;
}
.charts-row .chart.load.compare .hour.rank-3 .lbl,
.charts-row .chart.load .bar.rank-3 .lbl {
  color: var(--peak-predict-3);
  font-size: 10px;
}

.freshness {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 20px 0 8px;
}
.freshness .cell {
  background: var(--bg-elev); border: 1px solid var(--line); padding: 12px 14px;
}
.freshness .l {
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center;
}
.freshness .v { font-family: var(--mono); font-size: 18px; margin-top: 6px; }
.freshness .v.source { font-size: 15px; }
.freshness .v.ok { color: var(--on); }
.freshness .v.warn { color: var(--peak); }
.freshness .v.bad { color: var(--danger); }
.freshness .s { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.freshness .s a { color: var(--info); text-decoration: underline; }

.price-block {
  display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: stretch;
}
.price-scale {
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 16px 0 28px; text-align: right;
}
.chart.price {
  height: 260px; padding: 16px 8px 28px;
  align-items: stretch;
}
.chart.price .plot {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 3px;
}
.chart.price .price-avg {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
  border-top: 1px solid #7a1818;
  height: 0;
}
.chart.price .price-avg span {
  position: absolute;
  left: 2px;
  bottom: 3px;
  color: #7a1818;
  font: 600 11px var(--mono);
  letter-spacing: .02em;
  white-space: nowrap;
  background: rgba(16, 18, 24, .78);
  padding: 0 4px;
  line-height: 1.2;
}
.chart.price .bar .fill { background: var(--info); }
.chart.price .bar.cleared .fill { background: var(--info); }
.chart.price .bar.forecast .fill {
  background: repeating-linear-gradient(
    135deg,
    var(--info) 0 3px,
    #1a2430 3px 6px
  );
}
.chart.price .bar.peak.cleared .fill {
  background: var(--peak);
}
.chart.price .bar.peak.forecast .fill {
  background: repeating-linear-gradient(
    135deg,
    var(--peak) 0 3px,
    #1a1810 3px 6px
  );
}
.chart.price .bar .lbl {
  position: absolute; left: 0; right: 0; bottom: -18px;
  text-align: center; font-size: 9px; color: var(--muted); font-family: var(--mono);
}
.chart.price .bar.missing .fill,
.chart .bar.missing .fill { background: #222836; }
.badge.missing { color: var(--muted); }
table.data tr.missing td { color: var(--muted); }

.hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  vertical-align: middle;
}
.hint-q {
  width: 15px;
  height: 15px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  line-height: 1;
  background: var(--bg-elev);
}
.hint:hover .hint-q,
.hint:focus,
.hint:focus-within .hint-q {
  color: var(--peak);
  border-color: #5c4a16;
  outline: none;
}
.hint-pop {
  display: none;
  position: absolute;
  z-index: 80;
  width: min(380px, 78vw);
  background: #0c0e12;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  white-space: normal;
  top: calc(100% + 8px);
  left: 0;
}
.hint:hover .hint-pop,
.hint:focus-within .hint-pop { display: block; }
.hint.end .hint-pop { left: auto; right: 0; }
.hint-pop strong { display: block; color: var(--peak); font-size: 11px; margin-bottom: 6px; font-weight: 700; }
.hint-pop .hint-p { display: block; margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.4; font-weight: 400; }
.hint-pop .hint-p:last-child { margin-bottom: 0; }
table.data th .hint-pop { font-variant-numeric: normal; }
.mono { font-family: var(--mono); font-size: 12px; }

.peak-board {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.peak-board h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.peak-table { margin: 12px 0 16px; }
.peak-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: var(--muted); margin: 0 0 16px;
}
.peak-legend .swatch {
  display: inline-block; width: 10px; height: 10px; margin-right: 4px;
  vertical-align: -1px; border: 1px solid var(--line);
}
.peak-legend .swatch.work { background: hsl(43 55% 36%); }
.peak-legend .swatch.weekend { background: #181c24; }
.peak-legend .swatch.holiday { background: #2a1818; }
.peak-legend .swatch.today { outline: 1px solid var(--on); background: transparent; }

.peak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.peak-month h3 {
  margin: 0 0 8px; font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; gap: 4px;
}
.peak-month h3 span { color: var(--muted); font-weight: 400; font-size: 11px; font-family: var(--mono); }

.strip {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px;
  height: 18px; margin-bottom: 8px;
}
.strip .h {
  background: #1a1e28; position: relative; min-width: 0;
}
.strip .h.on { background: var(--peak); }
.strip .h .tip, .d .tip {
  display: none; position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%); background: #0c0e12; border: 1px solid var(--line);
  padding: 6px 8px; font-size: 11px; white-space: nowrap; z-index: 5;
  color: var(--text); font-family: var(--sans); font-weight: 400;
  letter-spacing: 0; text-transform: none;
}
.strip .h:hover .tip, .d:hover .tip { display: block; }

.cal-head, .cal-body {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.cal-head span {
  font-size: 10px; color: var(--muted); text-align: center; padding-bottom: 4px;
}
.d {
  aspect-ratio: 1; font-size: 10px; display: flex;
  align-items: center; justify-content: center;
  background: #141820; color: var(--muted); position: relative;
}
.d.pad { background: transparent; }
.d.weekend { background: #181c24; }
.d.holiday { background: #2a1818; color: var(--danger); }
.d.work {
  background: hsl(43 50% calc(16% + var(--p, 0) * 26%));
  color: var(--text);
}
.d.today { box-shadow: inset 0 0 0 1px var(--on); }

.banner {
  margin: 0;
  padding: 10px 20px;
  background: #2a2210;
  border-bottom: 1px solid #5c4a16;
  color: var(--peak);
  font-size: 13px;
}
.banner a { color: var(--peak); text-decoration: underline; }
.who {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  gap: 1px;
}
.who-login {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
.who-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: lowercase;
}
#logout-btn { padding: 4px 10px; font-size: 12px; }
.page-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: min(380px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 28px 24px;
}
.login-card .brand-block { margin-bottom: 8px; }
.login-brand {
  font-weight: 650; letter-spacing: .08em; text-transform: uppercase; font-size: 14px;
}
.login-form { display: grid; gap: 8px; }
.login-form label { color: var(--muted); font-size: 12px; }
.login-form input {
  background: #0c0e12; color: var(--text); border: 1px solid var(--line); padding: 8px;
  font: 14px var(--mono);
}
.login-error { color: var(--danger); min-height: 1.2em; font-size: 13px; margin: 4px 0 0; }
.compact-form { margin-bottom: 20px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.user-actions button { font-size: 12px; padding: 4px 8px; }
.roles-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.role-card { background: var(--bg-elev); border: 1px solid var(--line); padding: 16px; }
.role-card h3 { margin: 0 0 6px; font-size: 15px; }
.perm-grid { display: grid; gap: 6px; margin: 12px 0; }
.perm { color: var(--text); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.muted { color: var(--muted); font-size: 12px; }
.page-runs h2, .page-admin h2 { margin: 32px 0 8px; font-size: 16px; font-weight: 600; }
form.filters {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 12px 0 16px;
}
form.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
form.filters input, form.filters select {
  background: #0c0e12; color: var(--text); border: 1px solid var(--line); padding: 6px 8px;
  font: 13px var(--sans);
}
form.filters button { padding: 7px 12px; }
table.data td.reply {
  font-family: var(--mono); font-size: 12px; white-space: normal; overflow-wrap: anywhere;
  max-width: 52rem;
}
table.data td.empty-row { color: var(--muted); text-align: center; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sortable.sort-asc::after { content: " \2191"; }
th.sortable.sort-desc::after { content: " \2193"; }
