/* Charcoal workspace with violet accents. Event hues and the responsive player layout
   remain defined in styles.css; this layer owns shared UI surfaces. */
:root {
  --bg: #18181b;
  --panel: #222225;
  --panel-2: #2c2c31;
  --border: #3f3f46;
  --text: #f5f3fa;
  --muted: #b6b3c1;
  --accent: #c4a5ff;
  --primary: #7c3aed;
  --selected: #38264f;
  --radius: 8px;
  --radius-lg: 16px;
  --hit: 44px;
  --text-xs: 0.875rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --shadow: 0 16px 48px #08050d80;
}

body { font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; }
:where(a) { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font-family: inherit; }
button { font-weight: 600; }
button, button.tiny, button.ghost, a.button-like, .view-toggle button, #stream-view button, .timeline-primary-controls button { min-height: 44px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select { min-height: 44px; font-size: 16px; }
button, a, input, select { transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }

#live-broadcast { max-width: 100%; }
#live-console { min-width: 0; }
#live-console .console-workspace { min-height: 36rem; height: min(75vh, 60rem); }
#live-console .console-activity-head h4 { margin: 0; font-size: 14px; }
#live-recording-controls { margin-bottom: 1rem; }
@media (max-width: 1000px) {
  #live-console .console-workspace { height: auto; }
  #live-console .console-layout { max-height: 36rem; }
}
button:not(.ghost):not(.tab):not(.danger) { box-shadow: inset 0 1px 0 #ffffff12; }
button.ghost, button.tab { border-color: var(--border); }
button.ghost:hover { border-color: #866ba9; }
:where(button, a.button-like, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea {
  background: #1b1b1f;
  border-color: var(--border);
}
input:not([type='checkbox']):not([type='radio']):not([type='range']):focus,
select:focus, textarea:focus { border-color: var(--accent); }

.app-header { background: #1e1e22; }
.app-brand > .icon { width: 34px; height: 34px; padding: 8px; background: var(--selected); border-radius: 10px; }
.app-header h1 .icon-gift { color: var(--accent); }
.app-brand small { letter-spacing: 0.025em; }
.workspace-label { font-size: 12px; }
.workspace-kicker { color: var(--text); font-size: 10px; font-weight: 700; letter-spacing: 0.15em; margin-right: 14px; }
.header-overflow { gap: 12px; }
#logout { min-height: 44px; }
.app-nav .tab.active { background: var(--selected); color: var(--accent); }

main { padding: var(--space-6); }
.page-heading { margin-bottom: var(--space-6); }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: 0.18em; font-weight: 700; }
.page-heading h2 { line-height: 1.2; text-wrap: balance; font-size: 34px; font-weight: 650; letter-spacing: -0.045em; margin: 0.45rem 0 0.6rem; }
.page-description { font-size: 15px; line-height: 1.65; max-width: 68ch; color: var(--muted); }
#streams-count, #videos-count { display: inline-block; padding: 3px 9px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; }
#streams-count:empty, #videos-count:empty { display: none; }

.toolbar { background: var(--panel); padding: var(--space-5); border-radius: var(--radius-lg); box-shadow: none; }
.toolbar-row { gap: 1rem; flex-wrap: wrap; }
.toolbar-group { min-width: 0; flex-wrap: wrap; gap: 0.65rem; }
.toolbar form:has(input[type=search]) { flex: 1 1 240px; }
.toolbar input[type='search'] { padding-left: 0.85rem; min-width: min(240px, 100%); max-width: 100%; }
.view-toggle { background: #19191d; padding: 4px; border-radius: 10px; }
.view-toggle button { border-radius: 6px; }
.view-toggle button.active { background: var(--selected); color: var(--accent); }
.toolbar-panel:not([hidden]) { margin-top: 0.35rem; padding-top: 1rem; }
.group-title { font-size: 14px; letter-spacing: -0.01em; padding-bottom: 0.85rem; }
.stream-grid { gap: var(--space-5); }
.live-card, .stream-card { padding: var(--space-5); gap: 1rem; box-shadow: none; }
.live-card:hover, .stream-card:hover { background: #2b2833; border-top-color: #775c9b; border-right-color: #775c9b; border-bottom-color: #775c9b; }
.live-card-top { gap: 0.6rem; }
.live-chan { font-size: 15px; letter-spacing: -0.015em; }
.live-card-time { font-size: 14px; }
.live-card-viewers { padding: 0.35rem 0; }
.stream-len { font-size: 26px; font-weight: 650; letter-spacing: -0.04em; }
.live-now strong { font-size: 30px; letter-spacing: -0.04em; }
.stream-card .live-now strong { font-size: 22px; }
.live-card .counter-strip, .stream-card .counter-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}
.live-card .counter, .stream-card .counter { display: grid; grid-template-columns: 15px minmax(0, 1fr); align-items: center; gap: 0.1rem 0.4rem; }
.live-card .counter strong, .stream-card .counter strong { font-size: 16px; font-weight: 600; }
.live-card .counter-label, .stream-card .counter-label { grid-column: 2; font-size: 12px; line-height: 1.5; }
.live-card-foot { padding-top: 0.75rem; }
.pinned-live { padding-bottom: 1.5rem; margin-bottom: 1.75rem; }
.badge { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; padding: 3px 7px; }
.live-strip { background: #112721; border-color: #2b5144; }

.table-wrap { box-shadow: 0 5px 20px #00000012; }
th { background: #29292e; font-size: 14px; font-weight: 600; }
th, td { padding: 1rem 1.25rem; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { max-width: 100%; overflow-x: auto; }
tbody tr:focus-within { background: var(--selected); }
.group-head th { background: #322b3e; }
.group-head th > a { color: var(--text); }
.empty { border: 1px dashed var(--border); padding: 2.5rem 1.5rem; }
.settings-block, .channel-add-panel { box-shadow: 0 5px 20px #00000012; }
.settings-block, .channel-add-panel { padding: var(--space-5); margin-bottom: var(--space-5); }
.settings-block h3 { letter-spacing: -0.025em; }
.settings-group { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); }
.setting-help { font-size: 14px; line-height: 1.6; }
.settings-jump { gap: 0.5rem; }

.videos-list { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.videos-list .video-item { padding: 0.35rem 0.65rem; flex: 0 0 auto; gap: 0.2rem 0.75rem; border-bottom: 1px solid var(--border); }
.videos-list .video-list-head { font-size: 0.8rem; padding: 0.4rem 0.65rem; background: var(--panel); }
.files-nav { padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.files-nav .active { background: var(--selected); color: var(--accent); border-color: #76579c; }
.archive-card { border-radius: var(--radius-lg); padding: 1.25rem; }
.archive-card strong { font-size: 28px; letter-spacing: -0.035em; }
.videos-list .video-item.is-selected { background: var(--selected); box-shadow: inset 3px 0 var(--accent); }
.videos-player { padding: 1rem; }
#videos-player[data-stream-id] { gap: 0.75rem; }
.video-lifecycle-actions { gap: 0.75rem; flex-wrap: wrap; }
.videos-preview-head { line-height: 1.6; }
.videos-file-name { letter-spacing: -0.025em; }
.modal { border-radius: 18px; border-color: #5b4a70; box-shadow: 0 30px 100px #08050dc9; }
.modal::backdrop { background: #08060dc9; backdrop-filter: blur(6px); }
.modal-head { background: #27252e; padding: 1.15rem 1.5rem; }
.modal-tabs { background: #1e1e22; padding: 0.65rem 1.5rem; }
.modal-tabs button.tab.active { background: var(--selected); color: var(--accent); }
.person-primary-metrics > span { background: #2c2933; padding: 1.15rem; border-radius: 12px; }
.person-primary-metrics strong { font-size: 28px; }

#login-view { background: radial-gradient(ellipse at 50% 15%, #3a25566b 0, transparent 60%), var(--bg); }
.login-card { padding: 2.5rem; width: min(440px, 100%); border-radius: 20px; box-shadow: 0 24px 90px #0006; }
.login-mark { height: 52px; width: 52px; border: 1px solid #76579c; border-radius: 14px; }
.login-card h1 { font-size: 30px; }
.login-card input, .login-card button { min-height: 46px; }

@media (min-width: 1100px) {
  :root { --sidebar-w: 232px; --header-row: 4.25rem; }
  .app-header .app-brand { background: #1e1e22; padding-left: 1.5rem; font-size: 15px; }
  .app-nav { background: #1e1e22; padding: 2rem 1rem 1.25rem; gap: 0.5rem; }
  .nav-caption { padding-left: 0.85rem; padding-bottom: 1rem; font-size: 9px; letter-spacing: 0.17em; }
  .app-nav .tab { border-radius: 10px; min-height: 46px; padding: 0.7rem 0.85rem; font-size: 13px; }
  .app-nav .tab.active { border-color: #76579c; box-shadow: inset 3px 0 0 var(--accent); }
  main { padding-left: 2rem; padding-right: 2rem; }
  .app-nav .tab[data-tab="health"] { margin-top: 1.5rem; position: relative; }
  .app-nav .tab[data-tab="health"]::before { content: ""; position: absolute; top: -0.85rem; left: 0; right: 0; border-top: 1px solid var(--border); }
  .app-nav .tab[data-tab="settings"] { margin-top: 0; }
}

@media (min-width: 701px) and (max-width: 1099px) {
  .app-header { padding-left: 1rem; padding-right: 1rem; }
  main { padding-left: 2rem; padding-right: 2rem; }
}

@media (max-width: 700px) {
  .app-header { padding-left: 1rem; padding-right: 1rem; }
  .app-brand > .icon { width: 30px; height: 30px; padding: 7px; }
  .app-nav { background: #1e1e22; box-shadow: 0 -8px 24px #0003; }
  .app-nav .tab { border-radius: 8px; flex: 0 0 auto; min-width: 88px; padding-inline: 0.65rem; font-size: 12px; gap: 0.25rem; }
  .app-nav { scroll-padding-inline: 0.5rem; }
  .app-nav .tab > span { letter-spacing: 0; }
  .app-nav { justify-content: flex-start; }
  main { padding: 1.5rem max(1rem, env(safe-area-inset-left, 0px)) 1.5rem max(1rem, env(safe-area-inset-right, 0px)); }
  .page-heading { margin-bottom: 1.25rem; }
  .page-heading h2 { font-size: 28px; }
  .toolbar { padding: 1rem; }
  .toolbar input[type='search'] { min-width: 0; }
  .toolbar-row { gap: 0.75rem; }
  .toolbar-group > select { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .toolbar form:has(input[type=search]) { flex-basis: 100%; }
  .live-card, .stream-card { padding: 1rem; }
  .live-card .counter-strip, .stream-card .counter-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: 0.85rem 1rem; }
  .modal { border-radius: 0; }
  .modal-head { padding: 0.85rem; }
  .modal-tabs { padding: 0.5rem 0.75rem; }
  .login-card { padding: 1.75rem; }
  .login-card h1 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  button, a, input, select { transition: none; }
}

/* Comfortable broadcast browsing and a detail frame with navigation always
   visible while its content scrolls. */
#stream-view { gap: 4px; padding: 5px; border-radius: 12px; }
#stream-view button { min-height: 44px; padding: 0.5rem 0.85rem; border-radius: 8px; }
#stream-view button.active { box-shadow: inset 0 0 0 1px #c4a5ff40; }
.stream-card, .live-card { border-radius: var(--radius-lg); }
.live-card-foot { flex-wrap: wrap; gap: 0.65rem; }
.stream-open { white-space: nowrap; text-decoration: none; }
.stream-card .stream-open { margin-left: auto; }
.modal[data-kind='stream'] { width: min(96%, 1280px); background: #222225; }
.modal[data-kind='stream'] .crumbs {
  padding: 0.85rem 1.5rem;
  background: #1e1e22;
  border-bottom: 1px solid var(--border);
  gap: 0.65rem;
}
.modal[data-kind='stream'] .crumbs > a:first-child {
  color: var(--accent); font-weight: 600;
}
.modal[data-kind='stream'] .crumb-steppers a {
  min-height: 44px; padding: 0.4rem 0.7rem; border-radius: 8px;
}
.modal[data-kind='stream'] .modal-head { padding: 1.25rem 1.5rem; }
.modal[data-kind='stream'] .modal-head h3 { font-size: 20px; line-height: 1.5; }
.modal[data-kind='stream'] .modal-tabs {
  flex-wrap: wrap; gap: 0.5rem; padding: 0.85rem 1.5rem;
  mask-image: none; -webkit-mask-image: none;
}
.modal[data-kind='stream'] .tab-sep { display: none; }
.modal[data-kind='stream'] .modal-tabs button.tab {
  min-height: 44px; padding: 0.6rem 1rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px;
}
.modal[data-kind='stream'] .modal-tabs button.tab.active {
  background: var(--selected); border-color: #8664ad; color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.modal[data-kind='stream'] .modal-tabs button.tab.active::after { display: none; }
.modal[data-kind='stream'] .modal-body { padding: 1.5rem; }
.modal[data-kind='stream'] .modal-body:has(.console-workspace) { padding: 0.75rem; }
.modal[data-kind='stream'] .charts-page {
  --charts-warm: color-mix(in srgb, var(--accent-2) 4%, var(--panel-2));
  --charts-line: color-mix(in srgb, var(--accent-2) 8%, var(--border));
  gap: 1rem;
}
.modal[data-kind='stream'] .charts-nav {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.75rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel);
}
.modal[data-kind='stream'] .charts-nav .ghost.tiny {
  background: transparent; border-color: var(--border); border-radius: 8px;
  padding: 0.4rem 0.65rem;
}
.modal[data-kind='stream'] .charts-nav .ghost.tiny:hover { background: var(--selected); color: var(--accent); }
.modal[data-kind='stream'] .chart-section { padding: 1rem; gap: 0.75rem; border-radius: 14px; }
.modal[data-kind='stream'] .modal-body > h4 { margin-top: 1.5rem; margin-bottom: 0.85rem; }
.modal[data-kind='stream'] .modal-body > .counters {
  padding: 1.25rem; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 14px; margin: 1rem 0 1.5rem;
}
.modal[data-kind='stream'] .viz-filters:has([data-pv], [data-rv]) {
  padding: 0.65rem; gap: 0.5rem; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1.25rem;
}
.modal[data-kind='stream'] .viz-filters button.active {
  background: var(--selected); color: var(--accent); border-color: #8664ad;
}
@media (max-width: 700px) {
  #stream-view { width: 100%; }
  #stream-view button { flex: 1; padding: 0.5rem 0.4rem; }
  .modal[data-kind='stream'] { width: 100%; height: 100dvh; max-height: 100dvh; }
  .modal[data-kind='stream'] .crumbs { padding: max(0.65rem, var(--safe-top)) 0.85rem 0.65rem; gap: 0.4rem; }
  .modal[data-kind='stream'] .modal-head { padding: 0.85rem; }
  .modal[data-kind='stream'] .modal-head h3 { font-size: 16px; }
  .modal[data-kind='stream'] .modal-tabs {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0.65rem 0.85rem; gap: 0.4rem; overflow: visible;
  }
  .modal[data-kind='stream'] .modal-tabs button.tab {
    min-width: 0; min-height: 44px; padding: 0.5rem 0.25rem; font-size: 12px;
  }
  .modal[data-kind='stream'] .modal-body { padding: 1rem; }
}

/* Live console: a room-wide metric strip above a player and readable feed.
   The player and feed keep their DOM while the socket patches their contents. */
.modal[data-kind='stream']:has(.console-workspace) { width: min(97%, 1600px); }
.modal[data-kind='stream'] .stream-title-main { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.modal[data-kind='stream'] .stream-title-context {
  display: block; margin-top: 0.35rem; color: var(--muted);
  font-size: 12px; font-weight: 400; line-height: 1.5;
}
.modal[data-kind='stream'] .title-clock {
  margin-left: 0.35rem; padding-left: 0.75rem; border-left: 1px solid var(--border);
  font-size: 14px;
}
.modal[data-kind='stream']:has(.console-workspace) .crumbs { padding-top: 0.65rem; padding-bottom: 0.65rem; }
.modal[data-kind='stream']:has(.console-workspace) .modal-head { padding-top: 0.85rem; padding-bottom: 0.85rem; align-items: flex-start; }
.modal[data-kind='stream']:has(.console-workspace) .modal-tabs { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.modal[data-kind='stream'] .modal-body:has(.console-workspace) { padding: 1rem; }
.console-workspace {
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr); gap: 1rem;
}
.console-metrics { grid-column: 1 / -1; min-width: 0; font-variant-numeric: tabular-nums; }
.console-metrics .counter-strip.full {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem; padding: 0; margin: 0; background: none; border: 0;
}
.console-metrics .counter-strip.full .counter {
  display: grid; grid-template-columns: 1fr auto; gap: 0.25rem;
  padding: 0.8rem 1rem; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; min-width: 0;
}
.console-metrics .counter-strip.full .counter > .icon { grid-column: 2; grid-row: 1; color: var(--muted); width: 15px; height: 15px; }
.console-metrics .counter-strip.full strong {
  grid-column: 1; grid-row: 2; font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2; font-weight: 650; letter-spacing: -0.035em;
}
.console-metrics .counter-strip.full .counter-label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 11px; white-space: normal; }
.console-metrics .counter-strip.full .counter:has(#c-viewers) { border-color: #366359; background: #142c2a; }
.console-metrics #c-viewers { color: var(--accent); }
.console-secondary-metrics .counter-strip {
  display: flex; flex-wrap: wrap; gap: 0.45rem 1.5rem; padding: 0.65rem 0.25rem 0;
  margin: 0; background: none; border: 0; font-size: 12px;
}
.console-secondary-metrics .counter { gap: 0.35rem; }
.console-secondary-metrics .counter-label { color: var(--muted); font-size: 12px; }
.console-watch { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 0.75rem; overflow-y: auto; }
.console-preview { flex: 1 0 auto; min-height: 390px; padding: 1rem; border-radius: 14px; background: var(--panel); }
.console-preview .stream-video { gap: 0.65rem; }
.console-preview .detail-head { margin-bottom: 0; }
.console-preview .detail-head h4 { font-size: 13px; }
.console-preview .video-stage {
  flex: 1 1 auto; min-height: 180px; max-height: none; border-radius: 10px;
  background: #060a0f;
}
.console-preview .stream-video video { background: #060a0f; min-height: 0; }
.console-preview .stream-video > [data-video-health] { margin: 0; font-size: 11px; line-height: 1.6; }
.console-preview .recording-timeline { flex: 0 0 auto; margin: 0; padding: 0.5rem 0; }
.console-preview .recording-timeline input[type='range'] { accent-color: var(--accent); min-height: 24px; }
.console-preview .recording-timeline-actions { margin-top: 0.35rem; font-size: 12px; }
.console-preview [data-recording-live] { color: var(--accent); }
.console-panel { padding: 0.25rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); flex: 0 0 auto; max-height: 160px; overflow-y: auto; }
.console-panel .guests { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.6rem 0; margin: 0; border: 0; background: none; }
.console-panel .guests + .guests { border-top: 1px solid var(--border); }
.console-panel .guests > span:first-child { margin-right: auto; }
.console-panel .badge { padding: 4px 8px; font-size: 11px; text-decoration: none; }
.console-workspace .console-layout {
  position: relative; gap: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); overflow-y: auto;
}
/* Let activity scroll instead of shrinking the feed to zero. */
.console-workspace .console-layout :is(#console-feed, #console-history) {
  flex: 1 0 12rem;
  min-height: 12rem;
}
.console-activity-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 1rem 1rem 0.75rem; flex: 0 0 auto; }
.modal-body .console-activity-head h4 { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 14px; }
.console-activity-head h4 .icon { color: var(--accent); }
.console-activity-head .small { font-size: 11px; }
.console-feed-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 1rem 0.75rem; flex: 0 0 auto; }
.console-feed-filters button { border-color: transparent; background: transparent; color: var(--muted); padding: 0.4rem 0.65rem; min-height: 44px; }
.console-feed-filters button.active, .console-layout .span-bar button.active { background: var(--selected); border-color: #76579c; color: var(--accent); }
.console-layout .span-bar { padding: 0.65rem 1rem; margin: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #1e1e22; gap: 0.4rem; }
.console-layout .span-bar button { min-height: 44px; }
.console-range { min-width: 0; }
.console-range summary { color: var(--muted); cursor: pointer; font-size: 12px; padding: 0.45rem; border-radius: 6px; }
.console-range summary:hover { color: var(--text); }
.console-range-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem 0; }
.console-range[open] { flex-basis: 100%; }
.console-range-fields input[type='number'] { width: 4.5rem; min-height: 44px; padding: 0.35rem; }
.console-layout :is(#console-feed, #console-history) { background: #1c1c20; border-radius: 0; padding: 0.4rem 0; scrollbar-width: thin; scrollbar-color: #705986 transparent; }
.feed-content { flex: 1; min-width: 0; }
.console-layout :is(#console-feed, #console-history) .feed-row {
  align-items: baseline; padding: 0.65rem 0.85rem; gap: 0.75rem;
  font-size: 13px; line-height: 1.65; border-bottom: 1px solid #3f3f4680;
}
.console-layout :is(#console-feed, #console-history) .feed-time { flex-basis: 5rem; font-size: 10px; color: var(--muted); }
.console-layout :is(#console-feed, #console-history) .feed-content > .icon:first-child { margin-right: 0.3rem; color: var(--muted); }
.console-layout :is(#console-feed, #console-history) .feed-content > .feed-user { text-decoration: none; }
.console-layout :is(#console-feed, #console-history) .feed-user:hover { text-decoration: underline; }
.console-layout #console-feed .feed-gift { background: #7dd3fc09; }
.console-layout #console-feed .feed-like { background: #fb718505; }
.console-layout #console-feed .feed-enforcement { background: color-mix(in srgb, var(--danger) 18%, var(--panel)); }
.console-layout[data-feed-filter='comment'] .feed-row:not(.feed-comment),
.console-layout[data-feed-filter='gift'] .feed-row:not(.feed-gift),
.console-layout[data-feed-filter='like'] .feed-row:not(.feed-like),
.console-layout[data-feed-filter='signals'] .feed-row:is(.feed-comment, .feed-gift, .feed-like) { display: none; }
.console-feed-empty { display: none; position: absolute; bottom: 25%; left: 1rem; right: 1rem; text-align: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.console-layout:has(#console-feed:not([hidden])):is(
  [data-feed-filter='all']:not(:has(#console-feed .feed-row)),
  [data-feed-filter='comment']:not(:has(#console-feed .feed-comment)),
  [data-feed-filter='gift']:not(:has(#console-feed .feed-gift)),
  [data-feed-filter='like']:not(:has(#console-feed .feed-like)),
  [data-feed-filter='signals']:not(:has(#console-feed .feed-row:not(.feed-comment, .feed-gift, .feed-like)))
) .console-feed-empty { display: block; }

@media (max-width: 1100px) and (min-width: 1001px) {
  .console-metrics .counter-strip.full .counter { padding: 0.75rem; }
  .console-feed-filters { padding-left: 0.65rem; padding-right: 0.65rem; }
  .console-feed-filters button { padding-left: 0.45rem; padding-right: 0.45rem; }
}
@media (max-width: 1000px) {
  .modal[data-kind='stream'] .modal-body:has(.console-workspace) { overflow-y: auto; display: block; }
  .console-workspace {
    height: auto; min-height: 100%; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(440px, 1fr);
  }
  .console-metrics .counter-strip.full { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .console-watch { min-height: 480px; }
  .console-preview { min-height: 380px; }
  .console-workspace .console-layout { height: 560px; }
}
@media (max-width: 700px) {
  .modal[data-kind='stream']:has(.console-workspace) { width: 100%; height: var(--vvh); max-height: var(--vvh); }
  .modal[data-kind='stream'] .modal-body:has(.console-workspace) { padding: 0.75rem; }
  .modal[data-kind='stream'] .stream-title-context { font-size: 11px; }
  .console-workspace { gap: 0.75rem; }
  .console-metrics .counter-strip.full { gap: 0.4rem; }
  .console-metrics .counter-strip.full .counter { padding: 0.6rem; border-radius: 9px; }
  .console-metrics .counter-strip.full strong { font-size: 21px; }
  .console-metrics .counter-strip.full .counter-label { font-size: 10px; }
  .console-metrics .counter-strip.full .counter > .icon { width: 12px; height: 12px; }
  .console-secondary-metrics .counter-strip { gap: 0.35rem 0.75rem; }
  .console-preview { padding: 0.75rem; min-height: 450px; }
  .console-layout :is(#console-feed, #console-history) .feed-row { padding: 0.55rem 0.65rem; gap: 0.5rem; font-size: 12px; }
  .console-layout :is(#console-feed, #console-history) .feed-time { flex-basis: 4.3rem; font-size: 9px; }
  .console-activity-head, .console-layout .span-bar { padding-left: 0.75rem; padding-right: 0.75rem; }
  .console-feed-filters { padding-left: 0.75rem; padding-right: 0.75rem; gap: 0.15rem; }
  .console-feed-filters button { padding: 0.4rem 0.45rem; font-size: 11px; }
}

/* Broadcast timeline workspace. Keep embedded channel/person charts compact. */
#stream-timeline {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  --tl-lane: 30px; --tl-pad: 10px; --tl-h: 20px;
}
#stream-timeline.tl-comfortable { --tl-lane: 40px; --tl-pad: 12px; --tl-h: 28px; }
.tl-overview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem; padding-bottom: 1.25rem; }
.tl-eyebrow { display: block; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.35rem; }
.tl-overview h3 { font-size: 19px; letter-spacing: -0.025em; margin-bottom: 0.25rem; }
.tl-overview-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.tl-overview-stats > span { display: flex; flex-direction: column; color: var(--muted); font-size: 11px; }
.tl-overview-stats strong { color: var(--text); font-size: 23px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tl-overview-stats .tl-live-stat strong { color: var(--live); }
#stream-timeline .tl-legend { gap: 0.5rem; margin: 0 0 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
#stream-timeline .tl-legend-item { padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); font-size: 12px; gap: 0.4rem; }
#stream-timeline .tl-legend-item.active { border-color: var(--accent); background: var(--selected); }
#stream-timeline .tl-head { background: var(--panel); padding: 0.6rem 0; }
#stream-timeline .tl-month { color: var(--text); border: 0; margin: 0; padding: 1.2rem 0 0.65rem; font-size: 11px; }
#stream-timeline .tl-row:not(.tl-head):not(.tl-quiet) { padding: 0.65rem 0; margin: 0; }
#stream-timeline .tl-label { align-items: flex-start; gap: 0.25rem; padding-left: 0.3rem; }
#stream-timeline .tl-date { font-size: 13px; }
#stream-timeline .tl-dow { font-size: 10px; }
#stream-timeline .tl-track { border-radius: 8px; background-color: var(--bg); border-color: color-mix(in srgb, var(--border) 65%, transparent); }
#stream-timeline .tl-head .tl-track { background: transparent; border: 0; border-radius: 0; }
#stream-timeline .is-today .tl-track { background-color: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
#stream-timeline .tl-bar { border-radius: 5px; }
/* Recordings use the shared proportional breaks between segments. */
#stream-timeline .tl-bar .tl-evs { display: none; }
#stream-timeline .tl-gap span { background: var(--panel); }
.tl-help { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 0.85rem; color: var(--muted); font-size: 12px; }
.tl-help summary { cursor: pointer; width: fit-content; }
.tl-help summary:hover { color: var(--text); }
.tl-help .tl-caption { max-width: 85ch; line-height: 1.7; padding-top: 0.5rem; }
#stream-shape:has(.timeline-primary-controls) { padding: 0.75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.timeline-primary-controls button { min-height: 44px; }
.timeline-primary-controls [data-zoomread] { padding: 0.3rem 0.6rem; border-radius: 6px; background: var(--bg); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  #stream-timeline { padding: 0.75rem; border-radius: 12px; }
  .tl-overview { gap: 0.85rem; }
  .tl-overview h3 { font-size: 17px; }
  .tl-overview-stats { gap: 1.1rem; }
  .tl-overview-stats strong { font-size: 20px; }
  #stream-timeline .tl-row { grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0.4rem; }
  #stream-timeline.tl-by-channel .tl-row { grid-template-columns: 3.5rem 3rem minmax(0, 1fr); }
  #stream-timeline .tl-legend-item { padding: 0.3rem 0.4rem; }
}
@media (max-width: 700px) {
  #stream-timeline .tl-label { flex-direction: column; }
}

/* Carbon surfaces with a soft purple glow and consistent outlines. */
body { background: radial-gradient(ellipse at 88% 0%, #7c3aed18, transparent 46%), var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-header { border-bottom-color: #3f3f46; box-shadow: 0 8px 28px #09060e45; }
.app-brand > .icon { color: #fff; background: linear-gradient(145deg, #a66af0, #67359d); border-radius: 12px; box-shadow: 0 4px 18px #7c3aed55; }
.app-brand small { color: var(--muted); }
.app-nav .tab { color: var(--muted); }
.app-nav .tab:hover { background: #302938; color: var(--text); }
.app-nav .tab > .icon { opacity: 1; width: 19px; height: 19px; }
.app-nav .tab.active { background: linear-gradient(110deg, #4a315f, #38264f); color: #ead8ff; }
.page-heading h2 { font-weight: 700; color: var(--text); text-wrap: balance; }
.page-description { line-height: 1.7; }
.eyebrow { color: #d5b8ff; }
.toolbar { border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(145deg, #29262fe8, #222225f0); }
input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea { border-radius: 8px; }
input:not([type='checkbox']):not([type='radio']):not([type='range']):focus,
select:focus, textarea:focus { box-shadow: 0 0 0 3px #c4a5ff26; }
button { border-radius: 8px; }
button:not(.ghost):not(.tab):not(.danger):hover { filter: brightness(1.12); }
.live-card, .stream-card { background: linear-gradient(150deg, #2a272f, #222225 68%); box-shadow: 0 10px 28px #07050c38; }
.live-card, .stream-card { border-color: var(--border); }
.live-card .counter-strip, .stream-card .counter-strip { background: #18181b66; border-radius: 10px; padding: 0.85rem; }
.table-wrap { border-radius: var(--radius-lg); border: 1px solid var(--border); }
th { letter-spacing: 0.045em; }
tbody tr:hover { background: #c4a5ff12; }
.empty { border-radius: 14px; background: linear-gradient(145deg, #342a4385, #22222566); color: var(--muted); }
.settings-block, .channel-add-panel, .archive-card { border-radius: 16px; box-shadow: 0 10px 28px #07050c30; }
.settings-jump button, .files-nav button { border-radius: 9px; }
.login-card { background: #222225f5; border: 1px solid #604a78; }
.login-mark { color: #ead8ff; background: linear-gradient(145deg, #4a315f, #2d2638); }
.login-mark .icon { width: 28px; height: 28px; }
.login-card .attrib { font-size: 11px; letter-spacing: 0.025em; }
.modal-head, .modal-tabs { border-bottom-color: var(--border); }

@media (min-width: 1100px) {
  :root { --sidebar-w: 240px; }
  .app-nav { padding-top: 2.25rem; }
  .app-nav .tab { min-height: 48px; gap: 0.85rem; }
  .app-nav .tab.active { box-shadow: inset 3px 0 0 var(--accent); border-color: #76579c; }
  .workspace-kicker { border-right: 1px solid var(--border); padding-right: 16px; }
}
@media (max-width: 700px) {
  .app-nav .tab > .icon { display: block; width: 19px; height: 19px; }
  .app-nav .tab { gap: 0.3rem; }
  .page-heading h2 { font-size: 29px; }
}

/* Investigation and monitoring share the existing workspace surfaces. */
.coverage-panel, .moments-panel { margin-block: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.coverage-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: .75rem; align-items: center; margin-block: .6rem; font-size: .85rem; text-transform: capitalize; }
.coverage-track { position: relative; height: 16px; overflow: hidden; border-radius: 4px; background: #35575b; }
.coverage-gap, .coverage-unknown { position: absolute; top: 0; height: 100%; }
.coverage-gap { background: #d34f62; min-width: 2px; }
.coverage-unknown { left: 0; background: repeating-linear-gradient(135deg, #303645, #303645 4px, #555e71 4px, #555e71 8px); }
.coverage-panel li { margin-block: .65rem; }
.moment-form { display: grid; gap: 1.5rem; margin-block: 1.5rem; }
.moment-form label { display: grid; gap: .35rem; min-width: 0; }
.moment-form input, .moment-form textarea { width: 100%; box-sizing: border-box; }
.moment-range { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
.moment-range label { flex: 1 1 120px; }
.moment-form > button { justify-self: start; }
.saved-moment { border-top: 1px solid var(--border); padding-block: .8rem; }
.moment-note { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: .4rem; }
.moment-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.health-issues { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.5rem; margin-block: 1.5rem; }
.health-issue { padding: 1.5rem; border: 1px solid var(--border); border-left: 3px solid #e7b35b; border-radius: var(--radius-lg); background: var(--panel); overflow-wrap: anywhere; }
.health-error { border-left-color: #d34f62; }
#health-overview { max-width: 1200px; }
@media (max-width: 480px) { .coverage-row { grid-template-columns: 90px minmax(0, 1fr); gap: .4rem; } }
.tl-coverage-gap { position: absolute; inset-block: 0; background: repeating-linear-gradient(135deg, #d34f6280, #d34f6280 3px, #d34f6220 3px, #d34f6220 6px); min-width: 2px; pointer-events: auto; }
.moment-form[hidden], .moment-quick[hidden] { display: none; }
.moment-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.moment-quick span { flex: 1 1 14rem; min-width: 0; }
.moment-edit-form { gap: .75rem; margin-block: 0; }
.moment-edit-form .moment-actions { margin-top: 0; }
.moment-edit-form [data-moment-edit-status]:empty { display: none; }
[data-moment-exporting] { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
[data-moment-exporting] progress { flex: 1 1 8rem; min-width: 0; }
[data-moment-exporting] p { flex-basis: 100%; margin: 0; }
.tl-ev-filter-coverage { border-left-color: #d34f62; }

/* Shared outline icons: optical sizes for navigation, identity and metrics. */
.icon { width: 1.125em; height: 1.125em; }
.app-nav .tab > .icon { width: 22px; height: 22px; opacity: 0.9; }
.app-nav .tab.active > .icon { opacity: 1; }
.app-brand > .icon { width: 36px; height: 36px; padding: 6px; }
.counter > .icon { width: 18px; height: 18px; }
.live-now > .icon { width: 20px; height: 20px; }
.console-metrics .counter-strip.full .counter > .icon { width: 18px; height: 18px; }
#console-feed .icon, #console-history .icon { width: 18px; height: 18px; vertical-align: -0.2em; }
.live-card .counter, .stream-card .counter { grid-template-columns: 18px minmax(0, 1fr); }
@media (max-width: 700px) {
  .app-brand > .icon { width: 32px; height: 32px; padding: 5px; }
  .app-nav .tab > .icon { width: 22px; height: 22px; }
}

/* Broadcast identity and timing lead; supporting metrics remain easy to scan. */
.stream-grid :is(.live-card, .stream-card) { gap: 1.25rem; }
.stream-grid .live-chan { font-size: 18px; font-weight: 700; line-height: 1.4; }
.stream-grid .live-card-top .badge { flex-shrink: 0; }
.stream-grid .live-card-time { gap: 0.25rem; flex-direction: column; align-items: flex-start; }
.stream-grid .live-card-time .small { font-size: 14px; line-height: 1.5; }
.stream-grid .stream-len { font-size: 28px; line-height: 1.2; }
.stream-grid .live-elapsed { font-size: 24px; line-height: 1.2; }
.stream-grid .stream-card .live-now strong { font-size: 24px; font-weight: 600; }
.stream-grid :is(.live-now, .live-peak) .small,
.stream-grid .live-peak { font-size: 14px; line-height: 1.5; }
.stream-grid :is(.live-card, .stream-card) .counter-strip {
  background: transparent; border-radius: 0; padding: 0.85rem 0 0;
}
.stream-grid :is(.live-card, .stream-card) .counter strong { font-size: 15px; }
.stream-grid :is(.live-card, .stream-card) .counter-label {
  grid-column: 1 / -1; font-size: 13px; line-height: 1.5; white-space: normal; overflow-wrap: normal;
}
.stream-grid .counter .icon { opacity: 0.8; }
.stream-grid .live-card-foot { margin-top: auto; border-top: 1px solid var(--border); }
.stream-grid .live-card-foot :is(a.button-like, button) { min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 700px) {
  .stream-grid .live-chan { font-size: 17px; }
  .stream-grid .stream-len { font-size: 26px; }
}

/* Keep spacious controls within the existing responsive navigation and player frames. */
@media (max-width: 700px) {
  :root { --hit: 44px; }
  .toolbar form:has(input[type=search]), .toolbar input[type=search] { width: 100%; }
  .settings-block, .channel-add-panel, .health-issue { padding: 1rem; }
  .modal-body { padding: 1rem; }
}

/* A stacked library needs document scrolling: the filters and player must not
   consume the fixed-height grid and squeeze the recording list to a sliver. */
#app-view:has(#tab-videos:not(.hidden)) > main { padding-inline: 2rem; }
.videos-heading, #videos-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin-bottom: 0.45rem;
}
.videos-heading h2 { font-size: 1.45rem; margin: 0 auto 0 0; }
#videos-count { vertical-align: middle; padding: 1px 6px; font-weight: 500; }
#videos-saved-view { position: relative; }
#videos-saved-view summary { cursor: pointer; }
#videos-saved-view .research-save-bar {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 4;
  width: min(17rem, 80vw);
  margin: 0.35rem 0 0;
  padding: 0.65rem;
}
#videos-saved-view label { flex: 1 1 100%; }
#videos-filter-form { flex: 0 1 15rem; min-width: 0; }
#videos-channel, #videos-search { width: 100%; min-width: 0; }
#videos-channel { width: min(10rem, 100%); }
#videos-toolbar :is(input, select, button) { min-height: 2rem; padding-block: 0.25rem; }
#tab-videos #watched-word-recent {
  margin: 0 0 0.35rem;
  padding: 0.15rem 0;
  border: 0;
  font-size: 0.82rem;
}
.videos-list .video-item-name { flex-direction: row; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.videos-list .video-item-title { overflow-wrap: anywhere; }
.videos-list .video-item-by { overflow-wrap: anywhere; }
.videos-list .video-item-actions :is(button.tiny, a.tiny) { min-height: 2rem; padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.videos-list .video-item-status .badge { padding-block: 0; font-size: inherit; }
#videos-player[data-stream-id] { overflow-y: auto; }
.videos-workspace:has(#videos-player:not([hidden], [data-stream-id])) {
  grid-template-rows: auto minmax(0, 1fr);
}
.videos-workspace:not(:has(#videos-player[data-stream-id])) .videos-list .video-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "check open actions";
  align-items: center;
}
@media (max-width: 900px), (max-height: 620px) {
  #app-view:has(#tab-videos:not(.hidden)) { height: auto; min-height: 100dvh; overflow: visible; }
  #app-view:has(#tab-videos:not(.hidden)) > main,
  #tab-videos:not(.hidden) { overflow: visible; }
  .videos-workspace,
  .videos-workspace:has(#videos-player[data-stream-id]),
  .videos-workspace:has(#videos-player:not([hidden], [data-stream-id])) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    max-height: none;
    overflow: visible;
  }
  #videos-player[data-stream-id] { overflow: visible; }
  #videos-back { display: inline-flex; align-self: flex-start; scroll-margin-top: 1rem; }
  .videos-list { overflow: visible; }
}
@media (max-width: 700px) {
  #app-view:has(#tab-videos:not(.hidden)) > main { padding-inline: 1rem; }
  #stream-sort select { max-width: 120px; }
  .videos-heading { position: relative; }
  #videos-saved-view { position: static; }
  .videos-workspace:not(:has(#videos-player[data-stream-id])) .videos-list .video-item {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "check open" ". actions";
  }
  .videos-list .video-item-actions { gap: 0.5rem; }
}

/* People carries more columns than any other table, and since cells went to
   1rem 1.25rem the shared priority breakpoints (1200/900/700px) let it grow
   past its container at every width — the action buttons were cut off on the
   right. Its own thresholds come from the table's measured min-content width
   per tier (1649 / 1338 / 911px with the wrapping below) plus ~5% for longer
   real handles and channel names than the fixtures carry. */
#tab-people th { white-space: normal; }
#tab-people .row-actions { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
@container (max-width: 1730px) { #tab-people [data-priority="4"] { display: none; } }
@container (max-width: 1400px) { #tab-people [data-priority="3"] { display: none; } }
@container (max-width: 960px) { #tab-people [data-priority="2"] { display: none; } }
@container (max-width: 480px) { #tab-people th, #tab-people td { padding-left: 0.6rem; padding-right: 0.6rem; } }

/* Moments tab: the chosen broadcast with its moment form, beside every saved moment. */
.moments-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 38%); gap: 1rem; align-items: start; }
.moments-player, .moments-list { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); padding: 1rem; }
.moments-player-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.moments-player .stream-video { margin: 0; }
.moments-player .detail-head h4 { display: none; }
.moments-player .stream-video video { width: 100%; max-height: min(52vh, 34rem); background: #0b0b0f; border-radius: 12px; }
.moments-player .moments-panel { margin-bottom: 0; }
.moments-picker { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.moments-picker select { max-width: min(100%, 26rem); }
.moments-group { padding-block: .25rem .5rem; }
.moments-group + .moments-group { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .75rem; }
.moments-group.is-selected { box-shadow: inset 3px 0 var(--accent); padding-inline-start: .75rem; }
.moments-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
@media (max-width: 900px) {
  .moments-workspace { grid-template-columns: minmax(0, 1fr); }
  #tab-moments .toolbar-row, #tab-moments .toolbar-group { min-width: 0; max-width: 100%; }
  .moments-picker { display: grid; width: 100%; }
  .moments-picker select { width: 100%; max-width: 100%; min-width: 0; }
  #moments-search-form, #moments-search { width: 100%; }
}

/* Personal timeline appearance, shared by full and embedded timelines. */
.tl-appearance { margin: 0.75rem 0; border: 1px solid var(--border); border-radius: 10px; padding: 0.65rem 0.8rem; }
.tl-appearance summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.tl-appearance-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding-top: 0.8rem; }
.tl-appearance-fields label, .tl-custom-field { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-size: 12px; }
.tl-appearance-fields > .muted { flex-basis: 100%; }
.tl-appearance select, .tl-custom-field select { min-height: 36px; padding: 0.35rem; }
.tl input[type='color'] { width: 46px; height: 36px; padding: 3px; cursor: pointer; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.tl[data-tl-shape='pill'] .tl-bar, .tl[data-tl-shape='pill'] .tl-seg { border-radius: 999px !important; }
.tl[data-tl-shape='square'] .tl-bar, .tl[data-tl-shape='square'] .tl-seg { border-radius: 0 !important; }
.tl[data-tl-grid='subtle'] .tl-track { background-image: linear-gradient(to right, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px); background-size: calc(12.5% * var(--tl-z)) 100%; }
.tl[data-tl-grid='none'] .tl-track { background-image: none; }
.tl[style*='--tl-custom-bg'] .tl-row:not(.tl-head) .tl-track { background-color: var(--tl-custom-bg) !important; }

/* Keep repeated navigation out of the keyboard path when desired. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

/* Give People enough room to recognise a face and read account details. */
#people-table .people-identity { display: flex; align-items: center; gap: 0.85rem; min-width: 0; white-space: normal; }
#people-table .people-identity .avatar { width: 64px; height: 64px; flex: 0 0 64px; font-size: 26px; margin: 0; }
#people-table .people-identity-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; overflow-wrap: anywhere; }
#people-table .people-identity-text strong { line-height: 1.35; }
#people-table .people-profile-meta { font-size: 12px; line-height: 1.5; }
#people-table .people-row-badges { display: block; margin-top: 0.4rem; }
#people-table .people-row-badges:empty { display: none; }
#people-table .people-card .avatar { width: 96px; height: 96px; flex-basis: 96px; font-size: 36px; }
#people-table .people-card .live-chan { min-width: 0; width: 100%; }
#people-table .people-card .counter-strip { flex-wrap: wrap; }
#people-table .people-card-dates { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
#people-table .people-note { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 600px) {
  #people-table .people-identity { gap: 0.6rem; }
  #people-table .people-identity .avatar { width: 52px; height: 52px; flex-basis: 52px; }
  #people-table .people-card .avatar { width: 80px; height: 80px; flex-basis: 80px; }
}

.modal[data-kind='person'] .modal-head { align-items: flex-start; }
.modal[data-kind='person'] #overlay-title { flex: 1; margin: 0; }
.person-detail-heading { display: flex; align-items: center; gap: 1.4rem; }
.person-detail-heading > .avatar { width: 128px; height: 128px; flex: 0 0 128px; font-size: 48px; margin: 0; }
.person-detail-identity { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.person-detail-name { font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.person-detail-handle { font-size: 16px; font-weight: 400; }
.person-detail-status:empty { display: none; }
.person-detail-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.person-detail-summary { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem; margin-bottom: 1rem; }
.person-detail-summary h4 { margin-top: 0; }
.person-detail-summary .person-bio { font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.person-detail-history { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; border-top: 1px solid var(--border); padding-top: 0.85rem; margin-top: 0.85rem; }
@media (max-width: 600px) {
  .person-detail-heading { gap: 0.85rem; align-items: flex-start; }
  .person-detail-heading > .avatar { width: 88px; height: 88px; flex-basis: 88px; font-size: 36px; }
  .person-detail-name { font-size: 21px; }
  .person-detail-handle { font-size: 14px; }
  .person-detail-summary { padding: 0.85rem; }
}

/* Keep every section discoverable when the navigation becomes a scrolling bar. */
.section-picker { display: none; min-width: 0; }
#keyboard-help { white-space: nowrap; }
#keyboard-help kbd { margin-left: 0.35rem; color: var(--muted); }
@media (max-width: 700px) {
  .app-header .app-brand { min-width: 0; flex-shrink: 1; }
  .app-header .app-brand > span { overflow: hidden; text-overflow: ellipsis; }
  .section-picker { display: block; flex: 1; max-width: 11rem; }
  .section-picker select { width: 100%; min-height: 44px; font-size: 16px; }
  .header-actions { margin-left: 0; }
  #keyboard-help { width: 100%; justify-content: flex-start; }
}



/* Action glyphs follow the text scale; labels and 44px targets stay intact. */
button > .icon { width: 1em; height: 1em; }
button > .icon:first-child { margin-right: 0.3em; }
.view-toggle button > .icon { margin-right: 0.2em; }
.app-nav .tab > .icon { margin-right: 0; }
.app-nav .tab.active > .icon { opacity: 1; }
@media (max-width: 600px) {
  /* Four broadcast views share a narrow toolbar; their labels remain visible. */
  #stream-view button > .icon, #people-view button > .icon { display: none; }
}

/* Sending is a footer action; account setup is available without consuming
   the live feed's reading space. Errors and confirmations stay visible. */

/* Desktop density: reserve vertical space for the player and live activity.
   Touch layouts retain their larger controls. */
@media (min-width: 1001px) {
  .modal[data-kind='stream'] { font-size: 14px; }
  .modal[data-kind='stream'] button,
  .modal[data-kind='stream'] button.ghost,
  .modal[data-kind='stream'] .modal-tabs button.tab {
    min-height: 28px; padding: .25rem .55rem; font-size: 12px; border-radius: 6px;
  }
  .modal[data-kind='stream'] .crumbs,
  .modal[data-kind='stream']:has(.console-workspace) .crumbs { padding: .35rem .85rem; }
  .modal[data-kind='stream'] .crumb-steppers a { min-height: 28px; padding: .15rem .35rem; }
  .modal[data-kind='stream'] .modal-head,
  .modal[data-kind='stream']:has(.console-workspace) .modal-head { padding: .5rem .85rem; }
  .modal[data-kind='stream'] .modal-head h3 { font-size: 17px; }
  .modal[data-kind='stream'] .stream-title-context { margin-top: .1rem; font-size: 11px; }
  .modal[data-kind='stream'] .modal-tabs,
  .modal[data-kind='stream']:has(.console-workspace) .modal-tabs { gap: .25rem; padding: .35rem .85rem; }
  .modal[data-kind='stream'] .modal-body:has(.console-workspace) { padding: .65rem; }
  .console-workspace { gap: .65rem; }
  .console-metrics .counter-strip.full { gap: .4rem; }
  .console-metrics .counter-strip.full .counter { padding: .35rem .65rem; border-radius: 8px; gap: .1rem; }
  .console-metrics .counter-strip.full strong { font-size: 22px; }
  .console-secondary-metrics .counter-strip { padding-top: .3rem; gap: .25rem 1rem; font-size: 11px; }
  .console-watch { gap: .5rem; }
  .console-preview { flex: 1 1 auto; min-height: 280px; padding: .65rem; border-radius: 8px; }
  .console-preview .video-stage { min-height: 150px; }
  .console-preview .stream-video { gap: .35rem; }
  .console-preview .recording-timeline { padding: .2rem 0; }
  .console-preview .recording-timeline-actions { margin-top: .15rem; }
  .console-panel { padding: .15rem .65rem; border-radius: 8px; }
  .console-panel .guests { padding: .35rem 0; }
  .console-workspace .console-layout { border-radius: 8px; }
  .console-activity-head { padding: .35rem .65rem; }
  .modal-body .console-activity-head h4 { font-size: 12px; }
  .console-feed-filters { padding: 0 .65rem .3rem; gap: .2rem; }
  .console-layout .span-bar { padding: .3rem .65rem; }
  .console-range summary { padding: .2rem; font-size: 11px; }
  .console-workspace .console-layout :is(#console-feed, #console-history) { flex: 1 0 8rem; min-height: 8rem; }
  .console-layout :is(#console-feed, #console-history) .feed-row { padding: .35rem .65rem; line-height: 1.45; }
}


/* Archive research uses the dashboard's controls and adapts to narrow screens. */
.research-save-bar { padding: .75rem 0; border-bottom: 1px solid var(--border, #384052); margin-bottom: 1rem; }
.research-save-bar label, .research-filters label, #storage-policy label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; min-width: 0; }
.research-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .8rem; align-items: end; }
.research-filters input, .research-filters select, .research-save-bar input { width: 100%; min-width: 0; }
.research-group, .research-saved { margin: 1.2rem 0; }
.research-result { padding: .85rem 0; border-bottom: 1px solid var(--border, #384052); overflow-wrap: anywhere; }
.research-result p { margin: .35rem 0; }
.research-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .8rem; margin: 1rem 0; }
.research-summary article { border: 1px solid var(--border, #384052); border-radius: 10px; padding: 1rem; }
.research-summary strong { font-size: 1.5rem; }
.research-saved-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border, #384052); overflow-wrap: anywhere; }
.research-saved-row > div, .research-saved-row > a { min-width: 0; }
.research-channel-list { display: flex; flex-direction: column; gap: .5rem; }

/* Reference-style stream timeline: a continuous time ribbon and staggered cards. */
.stream-story { min-width: 0; }
.story-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: 1.2rem; }
.story-heading h3 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.04em; margin: .15rem 0; }
.story-controls, .story-search { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.story-controls label, .story-search label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; }
.story-controls input { width: 110px; }
.story-search { margin: .9rem 0; }
.story-filters { flex-wrap: wrap; }
.story-filters [aria-pressed="true"] { background: var(--accent, #2675a9); color: #fff; }
.story-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; padding: 0 0 1rem; scrollbar-width: auto; border: 1px solid var(--border, #48515d); border-radius: 12px; background: var(--surface, #121b26); }
.story-scroll:focus-visible { outline: 2px solid var(--accent, #69caff); outline-offset: 3px; }
.story-track { display: flex; width: max-content; min-width: 100%; padding: 24px 18px; margin: 0; list-style: none; align-items: flex-start; }
.story-event { --story-color: #487c94; --story-tint: #e1eff4; width: 224px; flex: 0 0 224px; margin: 0; padding: 0; }
.story-comment { --story-color: #24798a; --story-tint: #d9f3f5; }
.story-gift { --story-color: #ae5620; --story-tint: #ffebd4; }
.story-guest { --story-color: #667627; --story-tint: #edf1cf; }
.story-mod { --story-color: #a3315b; --story-tint: #ffe1ec; }
.story-room, .story-rank { --story-color: #7c5a9d; --story-tint: #eee2fa; }
.story-like { --story-color: #a14d25; --story-tint: #ffead6; }
.story-moment { --story-color: #8b681a; --story-tint: #fff1c6; }
.story-gap { --story-color: #ad3939; --story-tint: #ffe5e2; }
.story-symbol { height: 42px; text-align: center; color: var(--story-color); }
.story-symbol .icon { width: 28px; height: 28px; }
.story-time { background: var(--story-color); color: #fff; text-align: center; padding: 12px 4px; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.story-connector { height: 34px; width: 4px; margin: auto; background: var(--story-color); }
.story-event:nth-child(odd) .story-connector { height: 190px; }
.story-card { background: var(--story-tint); color: #17242b; border-top: 5px solid var(--story-color); border-radius: 9px; margin: 0 8px; padding: 15px; box-shadow: 0 6px 16px #0002; }
.story-card h4 { font-size: 1rem; color: #17242b; margin: .4rem 0 .6rem; overflow-wrap: anywhere; }
.story-kind { color: #35464e; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.story-card a { color: #174b68; text-decoration: underline; overflow-wrap: anywhere; }
.story-card .muted { color: #52616a; }
.story-text { font-size: .88rem; line-height: 1.5; max-height: 150px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: .65rem 0; }
.story-wall-clock { font-size: .75rem; color: #52616a; margin: .7rem 0; }
.story-play { font-size: .8rem; font-weight: 700; }
.story-pages { margin-top: .75rem; }
@media (max-width: 600px) { .story-event { width: 194px; flex-basis: 194px; } .story-track { padding-inline: 8px; } .story-event:nth-child(odd) .story-connector { height: 150px; } .story-heading { flex-wrap: wrap; } }
.story-heading { position: relative; display: block; text-align: center; padding: 1rem 90px 1.2rem; }
.story-heading h3 { font-size: clamp(1.6rem, 4vw, 3.2rem); font-weight: 850; line-height: 1.05; }
.story-heading > button { position: absolute; right: 0; top: 1rem; }
.story-heading .eyebrow { display: none; }
.story-options { border: 1px solid var(--border, #48515d); border-radius: 8px; padding: .65rem .85rem; margin-bottom: .8rem; }
.story-options summary { cursor: pointer; font-size: .85rem; }
.story-options[open] summary { margin-bottom: .8rem; }
.story-comment { --story-tint: #83d5db; }
.story-gift { --story-tint: #ffc078; }
.story-guest { --story-tint: #d8df95; }
.story-mod { --story-tint: #f4abc5; }
.story-room, .story-rank { --story-tint: #ccb4e9; }
.story-like { --story-tint: #ffc299; }
.story-moment { --story-tint: #f5d879; }
.story-gap { --story-tint: #f7aaa1; }
@media (max-width: 600px) { .story-heading { padding: .8rem 0; } .story-heading > button { position: static; margin-top: .4rem; } }
.stream-story .story-toolbar { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: .2rem 0; margin: .4rem 0 .7rem; min-height: 0; }
.story-heading { padding-block: .5rem .7rem; margin-bottom: .5rem; }

.story-zoom-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0; font-size: .8rem; }
.story-zoom-controls input[type="range"] { width: 130px; padding: 0; accent-color: var(--accent, #a78bfa); }
.story-zoom-controls output { min-width: 3.2rem; font-variant-numeric: tabular-nums; }
.story-time-zoom-label { margin-left: .6rem; }
.story-overview { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; padding: .8rem 0; font-size: .8rem; }
.story-overview strong { font-size: 1rem; }
.story-event { width: calc(224px * var(--story-zoom, 1)); flex-basis: calc(224px * var(--story-zoom, 1)); }
.story-time { font-size: calc(1.6rem * var(--story-zoom, 1)); }
.story-connector { height: calc(34px * var(--story-zoom, 1)); }
.story-event:nth-child(odd) .story-connector { height: calc(160px * var(--story-zoom, 1)); }
.story-card h4 { font-size: clamp(.85rem, calc(1rem * var(--story-zoom, 1)), 1.5rem); }
.story-text { font-size: clamp(.78rem, calc(.88rem * var(--story-zoom, 1)), 1.25rem); max-height: calc(150px * var(--story-zoom, 1)); }
.story-details { margin: .65rem 0; font-size: .78rem; border-top: 1px solid #17242b33; padding-top: .5rem; }
.story-details summary { cursor: pointer; font-weight: 650; }
.story-details dl { margin: .65rem 0 0; }
.story-details dt { color: #35464e; margin-top: .5rem; }
.story-details dd { margin: .1rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.story-duration { font-size: .8rem; font-weight: 650; }
@media (max-width: 600px) { .story-event { width: calc(194px * var(--story-zoom, 1)); flex-basis: calc(194px * var(--story-zoom, 1)); } .story-event:nth-child(odd) .story-connector { height: calc(130px * var(--story-zoom, 1)); } }

/* Hourly snapshots stay accessible independently of the event window. */
.story-hours { margin: 18px 0 24px; min-width: 0; }
.story-hour-heading, .story-hour-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.story-hour-heading h4 { margin: 0 0 8px; }
.story-hour-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.story-hour-card { flex: 0 0 min(300px, 85vw); border: 1px solid #3c596c; border-top: 4px solid #44c7d4; border-radius: 12px; padding: 16px; background: linear-gradient(145deg, #183444, #15232e); color: #eef7fa; scroll-snap-align: start; }
.story-hour-card:nth-child(3n+2) { border-top-color: #efb94d; }
.story-hour-card:nth-child(3n) { border-top-color: #d789bd; }
.story-hour-title span { font-size: 11px; color: #b4d9de; }
.story-hour-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; margin: 16px 0; }
.story-hour-metrics dt { font-size: 11px; color: #b9cbd4; }
.story-hour-metrics dd { margin: 3px 0 0; font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.story-hour-card details { margin: 12px 0; }
.story-hour-card .muted { color: #b9cbd4; }

/* Broadcast guest panel: overview, live seats, and a searchable visit history. */
.guest-workspace { display: grid; gap: 1.5rem; min-width: 0; }
.guest-workspace h4 { margin: 0; font-size: 1.05rem; }
.guest-workspace p { margin: 0.4rem 0 0; }
.guest-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.guest-heading h4 { font-size: 1.4rem; letter-spacing: -0.025em; }
.guest-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.guest-overview > div { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.guest-overview dt { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.8rem; }
.guest-overview dt .icon { color: var(--accent); }
.guest-overview dd { margin: 0.5rem 0; font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.guest-overview span { display: block; font-size: 0.75rem; color: var(--muted); }
.guest-live { padding: 1rem; border: 1px solid color-mix(in srgb, var(--live) 35%, var(--border)); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--live) 4%, var(--panel)); }
.guest-live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 0.75rem; margin-top: 1rem; }
.guest-live-card { min-width: 0; padding: 1rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.guest-live-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; overflow-wrap: anywhere; }
.guest-live-identity a { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; gap: 0.35rem; }
.guest-live-time { display: flex; align-items: center; gap: 0.4rem; margin: 0.65rem 0; color: var(--live); font-size: 0.8rem; }
.guest-live-time .dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--live); }
.guest-section { min-width: 0; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.guest-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 0.75rem; }
.guest-toolbar label { display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.8rem; }
.guest-toolbar .guest-search { flex: 1 1 220px; }
.guest-toolbar input, .guest-toolbar select { width: 100%; min-width: 0; }
.guest-filters { margin: 0; gap: 0.4rem; }
.guest-filters [aria-pressed=true] { border-color: var(--accent); background: var(--selected); color: var(--accent); }
.guest-workspace .guest-results { margin: 0.75rem 0; }
.guest-section > .table-wrap { margin-top: 1rem; }
.guest-section td:first-child { overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .guest-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .guest-workspace { gap: 1rem; }
  .guest-overview { gap: 0.5rem; }
  .guest-overview > div { padding: 0.8rem; border-radius: var(--radius); }
  .guest-overview dt { font-size: 0.75rem; }
  .guest-toolbar { gap: 0.75rem; }
  .guest-toolbar > label { flex: 1 1 100%; }
  .guest-live { padding: 0.8rem; }
  .guest-section { padding-top: 1rem; }
}
/* A vertical diary with one entry per recording and a local clock spine. */
.diary-timeline { max-width: 1100px; margin: 0 auto; }
.diary-timeline-caption { margin: 0 0 1.5rem; }
.diary-day + .diary-day { margin-top: 2rem; }
.diary-day-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding-bottom: 1rem; }
.diary-day-heading h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: .6rem; margin: 0; font-size: 15px; }
.diary-relative { color: var(--accent-2); }
.diary-entries { list-style: none; padding: 0; margin: 0; }
.diary-entry-row { position: relative; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1.5rem; padding: 0 0 1rem; }
.diary-entry-row::before { content: ''; position: absolute; left: 7rem; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.diary-entry-row::after { content: ''; position: absolute; left: calc(7rem - 4px); top: 1.3rem; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px var(--bg); }
.diary-entry-row:last-child { padding-bottom: 0; }
.diary-entry-time { padding-top: 1.1rem; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.diary-timeline .diary-entry { min-width: 0; padding: 1rem 1.25rem; gap: .75rem; }
.diary-entry-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.diary-entry-title { margin: 0; color: var(--text); overflow-wrap: anywhere; line-height: 1.5; }
.diary-entry-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: .75rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.diary-entry-stats dt { font-size: 11px; color: var(--muted); margin-bottom: .25rem; }
.diary-entry-stats dd { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.diary-entry-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: .5rem; }
.diary-entry-actions .button-like { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
@media (max-width: 600px) {
  .diary-entry-row { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding-left: 1.25rem; }
  .diary-entry-row::before { left: 4px; }
  .diary-entry-row::after { left: 0; top: .4rem; }
  .diary-entry-time { padding-top: 0; text-align: left; }
  .diary-timeline .diary-entry { padding: .85rem; }
  .diary-entry-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diary-entry-heading > .small { flex-basis: 100%; }
}
