:root {
  color-scheme: dark;
  font-family: ui-monospace, "Cascadia Code", "DejaVu Sans Mono", monospace;
  background: #0c0f12;
  color: #e7e9ec;
  --surface: #14181d;
  --edge: #2c333c;
  --muted: #a0a9b4;
  --accent: #f5a45d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; line-height: 1.6; }
h1, h2, p { margin: 0; }
button, a[href], summary, select, label[for], input[type="checkbox"], input[type="radio"], [role="button"], [role="tab"], [role="switch"] { cursor: pointer; }
button {
  min-height: 44px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: transparent;
  padding: 10px 14px;
  color: #e7e9ec;
  font: inherit;
  line-height: 1.5;
  transition: background .15s, border-color .15s;
}
button:hover:not(:disabled) { background: #252b33; border-color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
button:active:not(:disabled) { background: #343d48; transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled { color: var(--muted); border-style: dashed; cursor: not-allowed; }
.masthead, main, body > footer { width: min(100% - 64px, 1600px); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 28px; }
.identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.comment { color: var(--accent); font-size: 26px; }
h1 { font-size: 21px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.path, .identity p { color: var(--muted); }
.identity p { margin-top: 5px; font: 13px/1.5 system-ui, sans-serif; }
.connection { color: var(--muted); font-size: 12px; text-align: right; }
.connection[data-state="live"] { color: #82c7a5; }
.connection[data-state="stale"] { color: #e9c078; }
.connection[data-state="error"] { color: #f08088; }
nav { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--edge); margin-bottom: 24px; }
nav button { position: relative; border: 0; border-radius: 0; min-height: 54px; padding: 14px 18px; color: var(--muted); }
nav button span { margin-right: 8px; }
nav button.active { color: var(--accent); background: var(--surface); }
nav button.active::after { content: ""; position: absolute; height: 2px; background: var(--accent); inset: auto 0 -1px; }
nav small { font-size: 11px; }
.viewer { border: 1px solid var(--edge); border-radius: 6px; overflow: hidden; background: var(--surface); }
.viewer-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--edge); }
.viewer-heading h2 { font-size: 13px; font-weight: 500; }
#view-mode { color: var(--muted); font-size: 12px; }
#display { position: relative; aspect-ratio: 16 / 9; background: #0c0f12; }
#screen { display: block; width: 100%; height: 100%; object-fit: contain; }
#screen-state { position: absolute; inset: 0; padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; text-align: center; background: #0c0f12; }
#screen-state strong { font-weight: 500; }
#screen-state span { color: var(--muted); font: 13px/1.6 system-ui, sans-serif; }
#display:fullscreen { width: 100vw; height: 100dvh; aspect-ratio: auto; }
#exit-fullscreen { display: none; }
#display:fullscreen #exit-fullscreen { display: block; position: absolute; z-index: 2; top: 12px; right: 12px; max-width: calc(100% - 24px); background: var(--surface); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--edge); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
#pause[aria-pressed="true"] { border-color: var(--accent); border-style: double; }
kbd { color: var(--muted); font: inherit; font-size: 11px; margin-left: 10px; }
.details { min-height: 90px; padding: 16px 0 20px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
#feedback { color: #e9c078; min-height: 20px; margin-top: 4px; }
.readings { border-top: 1px solid var(--edge); padding-block: 20px 28px; }
.emergency-notice { padding: 20px; margin-bottom: 24px; background: var(--surface); border: 2px solid #f08088; overflow-wrap: anywhere; }
.emergency-notice h2 { color: #f08088; font-size: 22px; margin-bottom: 8px; }
.emergency-notice a { display: inline-block; min-height: 44px; padding: 8px; color: #f5a45d; text-decoration: underline; }
.emergency-notice a:hover { background: #252b33; text-decoration-thickness: 2px; }
.emergency-notice a:active { background: #343d48; }
.emergency-notice a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.readings h2 { font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 16px; }
summary { cursor: pointer; min-height: 44px; padding-block: 10px; color: inherit; }
summary:hover { color: var(--accent); }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#keynote-transcript { padding-left: 1.6em; font: 1rem/1.65 system-ui, sans-serif; overflow-wrap: anywhere; }
#keynote-transcript li { padding: 12px 0; }
#keynote-transcript h3 { font-size: 1.15em; margin: 0 0 8px; }
#keynote-transcript p { margin: 6px 0; color: var(--muted); }
#readings-state { color: var(--muted); font: 14px/1.6 system-ui, sans-serif; }
dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 32px; margin: 0; }
dl div { min-width: 0; animation: reading-enter 420ms cubic-bezier(.22, .61, .36, 1) both; }
dl div:nth-child(2) { animation-delay: 70ms; }
dl div:nth-child(3) { animation-delay: 140ms; }
dl div:nth-child(4) { animation-delay: 210ms; }
dl div:nth-child(5) { animation-delay: 280ms; }
dl div:nth-child(6) { animation-delay: 350ms; }
dl div:nth-child(7) { animation-delay: 420ms; }
dl div:nth-child(8) { animation-delay: 490ms; }
dl div[data-usage="normal"] dd { color: #82c7a5; }
dl div[data-usage="warning"] dd { color: #e9c078; }
dl div[data-usage="critical"] dd { color: #f08088; }
@keyframes reading-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
dt { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
dd { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
body > footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--edge); padding-block: 18px 28px; color: var(--muted); font: 12px/1.6 system-ui, sans-serif; }
@media (max-width: 760px) {
  .masthead, main, body > footer { width: calc(100% - 32px); }
  .masthead { align-items: flex-start; flex-direction: column; gap: 16px; padding-block: 22px; }
  .connection { text-align: left; }
  nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 16px; }
  nav button { text-align: left; font-size: 12px; padding: 12px 8px; }
  nav button span { margin-right: 4px; }
  .viewer-heading { padding: 12px; flex-wrap: wrap; gap: 4px 12px; }
  .toolbar { padding: 12px; align-items: stretch; }
  .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 0 100%; }
  .toolbar button { font-size: 12px; padding: 10px; }
  #intro { width: 100%; }
  #screen-state { gap: 4px; font-size: 12px; padding: 12px; }
  #screen-state span { font-size: 12px; }
  dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  dd { font-size: 16px; }
  body > footer { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  button:active:not(:disabled) { transform: none; }
}
