:root {
  color-scheme: light;
  --paper: #f8f7f3;
  --ink: #263b39;
  --body: #48534f;
  --green: #426345;
  --line: #d5d9d0;
  background: var(--paper);
  color: var(--body);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #688969; outline-offset: 3px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon {
  display: block;
  width: 21px;
  height: 21px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}
.shell { padding: 0 max(5.3vw, env(safe-area-inset-right)) 4rem max(5.3vw, env(safe-area-inset-left)); }
.mast {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: max(36px, env(safe-area-inset-top)) 0 25px;
  border-bottom: 1px solid var(--line);
}
.wordmark { font-size: 26px; line-height: 1.2; letter-spacing: -.065em; font-weight: 600; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--green); }
.mobile-title { display: none; }
.wall-clock { display: flex; align-items: center; gap: 9px; font-size: .79rem; color: var(--body); }
.wall-clock .icon { width: 16px; height: 16px; }
.wall-clock time { margin-left: 2px; font-family: ui-monospace, Consolas, monospace; font-size: .84rem; font-variant-numeric: tabular-nums; letter-spacing: .035em; color: var(--ink); }
main { max-width: 1560px; margin-inline: auto; }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: clamp(26px, 3.2vw, 56px) 0 clamp(26px, 2.75vw, 42px); }
h1, h2, p { margin: 0; }
.page-intro h1 { font: 400 clamp(48px, 4.4vw, 76px)/1.04 Georgia, "Times New Roman", serif; letter-spacing: -.055em; color: var(--ink); }
.page-intro p { font-size: clamp(.92rem, 1.12vw, 1.06rem); line-height: 1.5; margin-top: 10px; }
.open-display {
  border: 1px solid #3a573f;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  padding: 13px 19px;
  font-weight: 600;
  font-size: .875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 3px #263b3911;
}
.open-display .icon { width: 17px; height: 17px; stroke-width: 1.9; }
.open-display:hover { background: #345338; }
.intro-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px; }
.scene-jump { display: none; }
.launch-error a, .scene-jump { color: var(--green); text-underline-offset: .22em; }
.event-file-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin: -8px 0 23px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.event-file-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.event-file-actions button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fcfbf8; color: var(--ink); font-size: .82rem; font-weight: 550; }
.event-file-actions button:enabled:hover { background: #edf0e8; }
.event-file-actions button:disabled { opacity: .55; cursor: default; }
@media (max-width: 480px) {
  .event-file-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}
.event-file-tools p { font-size: .78rem; line-height: 1.5; color: var(--body); }
#event-file-status:empty { display: none; }
#event-file-status { flex-basis: 100%; color: var(--ink); }
.launch-error { margin: -12px 0 20px; padding: 12px 16px; border-left: 3px solid #a67948; }
.desk-grid { display: grid; grid-template-columns: minmax(0, 2.06fr) minmax(265px, 1fr); grid-template-areas: "preview library" "settings library"; gap: 20px clamp(22px, 2.3vw, 40px); align-items: start; align-content: start; grid-template-rows: auto 1fr; }
.preview-section { grid-area: preview; min-width: 0; }
.section-bar { display: flex; min-height: 27px; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.section-bar h2 { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.02rem; line-height: 1.3; letter-spacing: -.025em; color: var(--ink); }
.section-bar .icon { width: 18px; height: 18px; color: var(--green); }
.connection { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #d8dbd3; border-radius: 999px; padding: 4px 10px; color: #56635a; font-size: .72rem; line-height: 1.25; font-weight: 500; }
.connection i { display: block; border-radius: 50%; width: 6px; height: 6px; background: #80867f; }
.connection.connected { color: #35593b; border-color: #bacbb6; background: #eaf0e5; }
.connection.connected i { background: #517a4f; }
.preview-frame { background: #1b302a; border-radius: 12px; overflow: hidden; outline: 1px solid #17332712; }
#preview { width: 100%; aspect-ratio: 16/9; }
.settings-section { grid-area: settings; min-width: 0; }
.library { grid-area: library; min-width: 0; display: grid; gap: 16px; }
.scene-list { padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf8; }
.scene-choice {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  margin: 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: clamp(9px, .8vw, 14px) clamp(9px, .95vw, 16px);
  gap: 13px;
  min-height: 55px;
}
.scene-choice + .scene-choice { margin-top: 2px; }
.scene-choice:hover { background: #f1f2eb; }
.scene-choice[aria-pressed="true"] { background: #e7eddf; border-color: #c7d4bc; }
.scene-icon {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eff0ea;
  color: #526559;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}
.scene-icon .icon { width: 20px; height: 20px; }
[aria-pressed="true"] .scene-icon { background: #d9e4cd; color: #3a5c3c; }
.scene-text { display: flex; flex-direction: column; gap: 2px; }
.scene-name { font-size: .89rem; font-weight: 620; letter-spacing: -.015em; line-height: 1.35; }
.scene-detail { font-size: .745rem; color: #59645d; line-height: 1.3; }
.selection-check { display: none; margin-left: auto; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; place-items: center; background: #4f6e4d; color: #fff; }
.selection-check .icon { width: 12px; height: 12px; stroke-width: 2.5; }
[aria-pressed="true"] .selection-check { display: grid; }
.emergency-scene { margin: 7px 0 0; padding-top: 7px; border-top: 1px solid #e0e2d9; }
.emergency-scene .scene-icon { background: #f5e9e3; color: #95523e; }
.emergency-scene .scene-name { color: #864a39; }
.emergency-scene [aria-pressed="true"] { background: #f5e9e3; border-color: #dcc0b6; }
.emergency-scene .selection-check { background: #93523e; }
dialog { width: min(420px, calc(100% - 36px)); border: 1px solid var(--line); background: var(--paper); color: var(--body); padding: 26px; border-radius: 12px; box-shadow: 0 18px 70px #14292135; }
dialog::backdrop { background: #182a2566; }
dialog h2 { color: var(--ink); font-size: 1.35rem; }
dialog p { margin: 10px 0 20px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; }
.dialog-actions button { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; background: #fff; color: var(--ink); }
.dialog-actions .show-fire { color: #fff; background: #874635; border-color: #874635; }
.dialog-actions .replace-event { color: white; background: var(--green); border-color: var(--green); }
@media (min-width: 1720px) { .mast { max-width: 1800px; margin-inline: auto; } }
@media (max-width: 850px) and (min-width: 701px) {
  .shell { padding-inline: 4vw; }
  .desk-grid { grid-template-columns: minmax(0, 1fr) 250px; column-gap: 18px; }
  .scene-choice { padding: 8px; gap: 9px; }
}
@media (max-width: 700px) {
  .shell { padding: 0 max(18px, 5.3vw, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(18px, 5.3vw, env(safe-area-inset-left)); }
  .mast { padding-top: max(23px, calc(env(safe-area-inset-top) + 9px)); padding-bottom: 19px; }
  .wordmark { font-size: 23px; }
  .mobile-title { display: block; font-size: 1.06rem; font-weight: 500; color: var(--ink); letter-spacing: -.025em; text-align: right; }
  .wall-clock { display: none; }
  .page-intro { flex-wrap: wrap; align-items: start; gap: 14px; margin: 21px 0 24px; }
  .page-intro h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .page-intro p { margin: 0; }
  .open-display { padding: 10px 14px; min-height: 42px; }
  .event-file-actions button { min-height: 42px; }
  .scene-jump { display: inline-block; font-size: .84rem; font-weight: 550; padding: 10px 0; }
  #scenes-heading { scroll-margin-top: 12px; }
  .desk-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview" "settings" "library"; gap: 16px; }
  .library { margin-top: 5px; }
  .section-bar { margin-bottom: 10px; }
  .section-bar h2 { font-size: .95rem; }
  .scene-choice { min-height: 57px; }
}
@media (prefers-reduced-motion: no-preference) {
  .scene-choice, .open-display { transition: background-color .16s, border-color .16s; }
}
