/* style.css — AI Governance Event Stream */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-display: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);

  --space-1:  0.25rem; --space-2:  0.5rem; --space-3:  0.75rem;
  --space-4:  1rem;    --space-5:  1.25rem; --space-6:  1.5rem;
  --space-8:  2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;

  --radius-sm: 0.375rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem;  --radius-xl: 1rem;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light mode */
:root, [data-theme="light"] {
  --color-bg:             #f7f6f2;
  --color-surface:        #f9f8f5;
  --color-surface-2:      #fbfbf9;
  --color-surface-offset: #f3f0ec;
  --color-surface-offset-2: #edeae5;
  --color-surface-dynamic: #e6e4df;
  --color-divider:        #dcd9d5;
  --color-border:         #d4d1ca;
  --color-text:           #28251d;
  --color-text-muted:     #7a7974;
  --color-text-faint:     #bab9b4;
  --color-text-inverse:   #f9f8f4;
  --color-primary:        #01696f;
  --color-primary-hover:  #0c4e54;
  --color-primary-highlight: #cedcd8;
  --color-error:          #a13544;
  --color-error-highlight: #dececb;
  --color-warning:        #9a6a00;
  --color-warning-highlight: #ece0bf;
  --color-success:        #437a22;
  --color-success-highlight: #d4dfcc;
  --color-blue:           #006494;
  --color-blue-highlight: #c6d8e4;
  --color-purple:         #7a39bb;
  --color-purple-highlight: #dacfde;
  --color-orange:         #da7101;
  --color-orange-highlight: #e7d7c4;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
}

/* Dark mode */
[data-theme="dark"] {
  --color-bg:             #171614;
  --color-surface:        #1c1b19;
  --color-surface-2:      #201f1d;
  --color-surface-offset: #262522;
  --color-surface-offset-2: #2c2b28;
  --color-surface-dynamic: #353430;
  --color-divider:        #262523;
  --color-border:         #393836;
  --color-text:           #cdccca;
  --color-text-muted:     #797876;
  --color-text-faint:     #5a5957;
  --color-text-inverse:   #2b2a28;
  --color-primary:        #4f98a3;
  --color-primary-hover:  #227f8b;
  --color-primary-highlight: #313b3b;
  --color-error:          #dd6974;
  --color-error-highlight: #574848;
  --color-warning:        #e0b04a;
  --color-warning-highlight: #4a4130;
  --color-success:        #6daa45;
  --color-success-highlight: #3a4435;
  --color-blue:           #5591c7;
  --color-blue-highlight: #3a4550;
  --color-purple:         #a86fdf;
  --color-purple-highlight: #4e4652;
  --color-orange:         #fdab43;
  --color-orange-highlight: #564b3e;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:#171614;--color-surface:#1c1b19;--color-surface-2:#201f1d;
    --color-surface-offset:#262522;--color-surface-offset-2:#2c2b28;
    --color-surface-dynamic:#353430;--color-divider:#262523;--color-border:#393836;
    --color-text:#cdccca;--color-text-muted:#797876;--color-text-faint:#5a5957;
    --color-text-inverse:#2b2a28;--color-primary:#4f98a3;--color-primary-hover:#227f8b;
    --color-primary-highlight:#313b3b;--color-error:#dd6974;--color-error-highlight:#574848;
    --color-warning:#e0b04a;--color-warning-highlight:#4a4130;--color-success:#6daa45;
    --color-success-highlight:#3a4435;--color-blue:#5591c7;--color-blue-highlight:#3a4550;
    --color-purple:#a86fdf;--color-purple-highlight:#4e4652;--color-orange:#fdab43;
    --color-orange-highlight:#564b3e;
    --shadow-sm:0 1px 2px oklch(0 0 0 / 0.2);--shadow-md:0 4px 12px oklch(0 0 0 / 0.3);--shadow-lg:0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* ====== Layout ======
   Lab version: three columns on wide screens (overview · feed · send events), two columns on laptops and tablets
   (feed · one scrolling side column), and tabs on phones. */
html, body { height: 100%; overflow: hidden; margin: 0; }

.dashboard {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  height: calc(100dvh - var(--lab-bar-h, 0px)); /* the demo banner sits above */
}

.header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface);
  z-index: 10;
}
.header-left { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.header-right { display: flex; align-items: center; gap: var(--space-3); }
.logo-mark {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: var(--color-primary); border-radius: var(--radius-md); color: var(--color-text-inverse); flex-shrink: 0;
}
.site-title { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.site-subtitle { font-size: var(--text-xs); color: var(--color-text-muted); }
.status-pill {
  display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); min-height: 36px;
  border-radius: 9999px; background: var(--color-surface-offset); border: 1px solid var(--color-divider);
}

.tabbar { display: none; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.side-col { border-left: 1px solid var(--color-divider); background: var(--color-surface); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.panel { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
.panel + .panel { border-top: 1px solid var(--color-divider); }

@media (min-width: 1360px) {
  .main { grid-template-columns: 320px minmax(0, 1fr) 360px; }
  .side-col { display: contents; }
  .panel-overview { grid-column: 1; grid-row: 1; border-right: 1px solid var(--color-divider); }
  .feed-panel { grid-column: 2; grid-row: 1; }
  .panel-tools { grid-column: 3; grid-row: 1; border-left: 1px solid var(--color-divider); border-top: 0 !important; }
  .panel-overview, .panel-tools { background: var(--color-surface); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
}

/* Phones: one panel at a time, chosen from the tab bar; the page scrolls normally */
@media (max-width: 768px) {
  html, body { height: auto; overflow: visible; }
  .dashboard { height: auto; display: block; }
  .header { padding: var(--space-3) var(--space-4); position: sticky; top: var(--lab-bar-h, 0px); }
  .site-subtitle { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-1);
    padding: var(--space-2) var(--space-4); background: var(--color-surface); border-bottom: 1px solid var(--color-divider);
    position: sticky; top: calc(var(--lab-bar-h, 0px) + var(--header-h, 61px)); z-index: 9;
  }
  .tab {
    min-height: 44px; border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  }
  .tab[aria-selected="true"] { background: var(--color-primary-highlight); color: var(--color-text); }
  .tab .tab-count { font-family: var(--font-mono); font-size: 0.7rem; padding: 0 6px; border-radius: 9999px; background: var(--color-surface-dynamic); }
  .main { display: block; }
  .side-col { display: contents; }
  .main > .feed-panel, .panel-overview, .panel-tools { display: none; }
  .main[data-tab="feed"] > .feed-panel { display: block; }
  .main[data-tab="overview"] .panel-overview { display: flex; }
  .main[data-tab="tools"] .panel-tools { display: flex; }
  .panel { padding: var(--space-4); border-top: 0 !important; }
  .feed-panel { padding: var(--space-4) !important; }
  .status-text { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
}
@media (max-width: 560px) {
  .status-pill { display: none; } /* the Feed tab shows the count; Pause/Resume shows the state */
}

/* ====== Feed panel ====== */
.feed-panel { overflow-y: auto; overscroll-behavior: contain; padding: var(--space-6); min-height: 0; }
.feed-inner { max-width: 1040px; margin: 0 auto; }
.feed-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.feed-title { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.01em; }
.feed-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); margin-bottom: var(--space-3); }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-faint); pointer-events: none; }
.search-input, .source-select {
  width: 100%; min-height: 40px; border-radius: var(--radius-md); border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.search-input { padding: 0 var(--space-3) 0 36px; }
.source-select { padding: 0 var(--space-8) 0 var(--space-3); min-width: 180px; cursor: pointer; }
.search-input:focus, .source-select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-highlight); }
.search-input::placeholder { color: var(--color-text-faint); }
.feed-controls { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-4); }
.controls-sep { width: 1px; height: 22px; background: var(--color-divider); margin: 0 var(--space-1); }

.pill-btn {
  font-size: var(--text-xs); padding: 0 var(--space-3); min-height: 32px; border-radius: 9999px;
  background: var(--color-surface-offset); border: 1px solid var(--color-border); color: var(--color-text-muted);
  transition: background var(--transition-interactive), color var(--transition-interactive), border-color var(--transition-interactive);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.pill-btn:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.pill-btn.active { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); }
.pill-btn .dot { width: 7px; height: 7px; border-radius: 50%; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-success); animation: pulse-dot 2s infinite; flex-shrink: 0; }
.status-dot.paused { animation: none; background: var(--color-text-faint); }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.status-text { font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums lining-nums; }

.sim-note {
  font-size: var(--text-xs); color: var(--color-text-muted); background: var(--color-surface-offset);
  border: 1px dashed var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); margin-bottom: var(--space-4); line-height: 1.55; max-width: none;
}
.result-line { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-3); display: flex; justify-content: space-between; gap: var(--space-3); }
.link-btn { color: var(--color-primary); font-size: var(--text-xs); font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* ====== Event cards ====== */
.event-list { display: flex; flex-direction: column; gap: var(--space-3); }
.event-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 3px solid var(--sev, var(--color-border));
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
  transition: box-shadow var(--transition-interactive), border-color var(--transition-interactive);
  animation: card-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.event-card:hover { box-shadow: var(--shadow-md); }
.event-card.is-new { box-shadow: 0 0 0 2px var(--color-primary-highlight); }
.event-card.is-acked { opacity: 0.78; }
.event-card[data-sev="critical"] { --sev: var(--color-error); }
.event-card[data-sev="high"] { --sev: var(--color-orange); }
.event-card[data-sev="warning"] { --sev: var(--color-warning); }
.event-card[data-sev="info"] { --sev: var(--color-blue); }
.event-card[data-sev="low"] { --sev: var(--color-success); }
@keyframes card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.event-top { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); flex-wrap: wrap; }
.severity-badge { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; padding: 2px var(--space-2); border-radius: 9999px; text-transform: uppercase; letter-spacing: 0.04em; }
.severity-critical { background: var(--color-error-highlight); color: var(--color-error); }
.severity-high     { background: var(--color-orange-highlight); color: var(--color-orange); }
.severity-warning  { background: var(--color-warning-highlight); color: var(--color-warning); }
.severity-info     { background: var(--color-blue-highlight); color: var(--color-blue); }
.severity-low      { background: var(--color-success-highlight); color: var(--color-success); }
.severity-unknown  { background: var(--color-surface-offset); color: var(--color-text-muted); }
.event-type-label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); }
.event-source { font-size: var(--text-xs); color: var(--color-primary); font-weight: 500; }
.event-time { font-size: var(--text-xs); color: var(--color-text-faint); margin-left: auto; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.event-id { font-family: var(--font-mono); font-size: 0.7rem; }
.event-summary { font-size: var(--text-sm); color: var(--color-text); line-height: 1.5; margin-bottom: var(--space-3); max-width: none; }
.event-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.event-btn {
  font-size: var(--text-xs); min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); color: var(--color-text-muted); background: transparent;
  display: inline-flex; align-items: center; gap: 6px; transition: all var(--transition-interactive);
}
.event-btn:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.event-btn.primary { border-color: var(--color-primary); color: var(--color-primary); }
.event-btn.primary:hover { background: var(--color-primary); color: var(--color-text-inverse); }
.ack-chip { font-size: var(--text-xs); color: var(--color-success); display: inline-flex; align-items: center; gap: 4px; }
.event-payload {
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.6; background: var(--color-surface-offset);
  border-radius: var(--radius-md); padding: var(--space-3); margin-top: var(--space-3); overflow-x: auto;
  white-space: pre-wrap; word-break: break-word; color: var(--color-text-muted); display: none;
}
.event-payload.open { display: block; }

/* ====== Side panels ====== */
.side-section h3 {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-muted); margin-bottom: var(--space-3); display: flex; justify-content: space-between; align-items: baseline;
}
.side-section h3 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--color-text-faint); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.stat-card {
  text-align: left; background: var(--color-surface-offset); border: 1px solid transparent; border-radius: var(--radius-md);
  padding: var(--space-3); min-height: 72px; transition: border-color var(--transition-interactive), background var(--transition-interactive);
}
.stat-card:hover { border-color: var(--color-border); background: var(--color-surface-dynamic); }
.stat-card.active { border-color: var(--color-primary); }
.stat-card.wide { grid-column: 1 / -1; }
.stat-value { font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; line-height: 1.2; }
.stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }

.attention {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  border: 1px solid var(--color-error-highlight); background: color-mix(in srgb, var(--color-error-highlight) 45%, transparent);
  border-radius: var(--radius-md); padding: var(--space-3);
}
.attention b { font-family: var(--font-mono); font-size: var(--text-lg); color: var(--color-error); }
.attention p { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.4; margin: 0; }
.attention .event-btn { white-space: nowrap; flex-shrink: 0; }
.attention.clear { border-color: var(--color-success-highlight); background: color-mix(in srgb, var(--color-success-highlight) 45%, transparent); }
.attention.clear b { color: var(--color-success); }

.chart-box { background: var(--color-surface-offset); border-radius: var(--radius-md); padding: var(--space-3) var(--space-3) var(--space-2); }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-box .axis { stroke: var(--color-divider); stroke-width: 1; }
.chart-box .tick { fill: var(--color-text-faint); font-family: var(--font-mono); font-size: 9px; }
.chart-box .b-critical { fill: var(--color-error); }
.chart-box .b-high { fill: var(--color-orange); }
.chart-box .b-warning { fill: var(--color-warning); }
.chart-box .b-info { fill: var(--color-blue); }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); font-size: 0.7rem; color: var(--color-text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.source-list { display: flex; flex-direction: column; gap: 2px; }
.source-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 72px 28px; align-items: center; gap: var(--space-2);
  text-align: left; padding: var(--space-2); border-radius: var(--radius-sm); min-height: 36px; font-size: var(--text-xs);
  transition: background var(--transition-interactive);
}
.source-row:hover { background: var(--color-surface-dynamic); }
.source-row.active { background: var(--color-primary-highlight); }
.source-row .name { color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row .bar { height: 6px; border-radius: 9999px; background: var(--color-surface-dynamic); overflow: hidden; }
.source-row .bar i { display: block; height: 100%; background: var(--color-primary); border-radius: 9999px; }
.source-row .n { font-family: var(--font-mono); color: var(--color-text-muted); text-align: right; }

.endpoint-box, .curl-box { background: var(--color-surface-offset); border-radius: var(--radius-md); padding: var(--space-3); }
.endpoint-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-1); }
.endpoint-url { font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-primary); word-break: break-all; line-height: 1.5; user-select: all; }
.copy-btn {
  margin-top: var(--space-2); font-size: var(--text-xs); min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-sm);
  background: var(--color-surface-dynamic); border: 1px solid var(--color-border); color: var(--color-text-muted); transition: all var(--transition-interactive);
}
.copy-btn:hover { background: var(--color-primary); color: var(--color-text-inverse); }
.test-btn {
  width: 100%; font-size: var(--text-sm); font-weight: 500; min-height: 44px; border-radius: var(--radius-md);
  background: var(--color-primary); color: var(--color-text-inverse); transition: background var(--transition-interactive), transform var(--transition-interactive);
}
.test-btn:hover { background: var(--color-primary-hover); }
.test-btn:active { transform: scale(0.98); }
.curl-box { font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.7; color: var(--color-text-muted); word-break: break-all; white-space: pre-wrap; }
.endpoint-hint, .form-hint { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-2); line-height: 1.5; max-width: none; }
.form-hint.ok { color: var(--color-success); }
.form-hint.err { color: var(--color-error); }
.json-input {
  width: 100%; min-height: 160px; resize: vertical; font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.6;
  background: var(--color-surface-offset); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3);
}
.json-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-highlight); }
.ingest-btn {
  margin-top: var(--space-2); width: 100%; font-size: var(--text-sm); font-weight: 500; min-height: 40px; border-radius: var(--radius-md);
  border: 1px solid var(--color-primary); color: var(--color-primary); transition: all var(--transition-interactive);
}
.ingest-btn:hover { background: var(--color-primary); color: var(--color-text-inverse); }

.pause-btn, .theme-toggle {
  min-height: 36px; border-radius: var(--radius-md); color: var(--color-text-muted); border: 1px solid var(--color-border);
  background: var(--color-surface); transition: all var(--transition-interactive); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.pause-btn { padding: 0 var(--space-3); font-size: var(--text-xs); font-weight: 500; }
.theme-toggle { width: 36px; }
.pause-btn:hover, .theme-toggle:hover { background: var(--color-surface-dynamic); color: var(--color-text); }

/* Touch screens and narrower layouts: 44px targets */
@media (max-width: 1024px), (pointer: coarse) {
  .pill-btn, .event-btn, .copy-btn, .ingest-btn, .search-input, .source-select { min-height: 44px; }
  .pause-btn, .theme-toggle, .status-pill { min-height: 44px; }
  .theme-toggle { width: 44px; }
  .source-row { min-height: 44px; }
  /* inline text buttons keep their look but get a 44px hit area */
  .link-btn { padding: 13px 8px; margin: -13px -8px; }
  .event-top .link-btn { padding: 13px 6px; margin: -13px -2px; }
}
@media (max-width: 560px) {
  .toolbar { grid-template-columns: 1fr; }
  .source-select { min-width: 0; }
  .controls-sep { display: none; }
  .event-card { padding: var(--space-3) var(--space-4); }
  .event-time { margin-left: 0; width: 100%; order: 5; }
}

/* ====== Empty state ====== */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--space-12) var(--space-6); color: var(--color-text-faint); border: 1px dashed var(--color-border); border-radius: var(--radius-lg); }
.empty-state svg { margin-bottom: var(--space-4); opacity: 0.5; }
.empty-state p { font-size: var(--text-sm); max-width: 36ch; color: var(--color-text-muted); }
.empty-state .event-btn { margin-top: var(--space-4); }

/* ====== Skeleton ====== */
.skeleton-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.skeleton-line { height: 12px; background: var(--color-surface-offset); border-radius: var(--radius-sm); animation: skeleton-pulse 1.5s ease-in-out infinite; }
.skeleton-line.w60 { width: 60%; } .skeleton-line.w80 { width: 80%; } .skeleton-line.w40 { width: 40%; }
.skeleton-line + .skeleton-line { margin-top: var(--space-2); }
@keyframes skeleton-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--color-text); color: var(--color-bg); font-size: var(--text-xs); padding: var(--space-2) var(--space-4);
  border-radius: 9999px; box-shadow: var(--shadow-lg); transition: all 200ms ease; max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
