/* Inter and JetBrains Mono, served with the page from node_modules: it is cross-origin isolated
   (server.mjs), so it loads nothing from elsewhere. */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url("./node_modules/@fontsource/inter/files/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url("./node_modules/@fontsource/inter/files/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url("./node_modules/@fontsource/inter/files/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url("./node_modules/@fontsource/inter/files/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("./node_modules/@fontsource/jetbrains-mono/files/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500 700; font-display: swap; src: url("./node_modules/@fontsource/jetbrains-mono/files/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  /* The user's blue pen; with a red ring at its tip over what a click does. */
  --pen-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><g transform='translate(3 29) rotate(-45) scale(.29 .42)'><path d='M-5 0L16-6H98V-8.5H122L126 0L122 6H16Z' fill='white' opacity='.85'/><path d='M0 0C3.5-.5 9-3 16.5-3.6V3.6C9 3 3.5.5 0 0Z' fill='%23d2b16b' stroke='%236e5427' stroke-width='.6'/><path d='M1.2 0H11.4' stroke='%234d3b18' stroke-width='.8'/><path d='M15.5-3.5 29.8-4.1V4.1L15.5 3.5Z' fill='%231a1e27'/><rect x='29.8' y='-4.3' width='1.6' height='8.6' fill='%23c5a263'/><rect x='31.4' y='-4.5' width='56.6' height='9' fill='%23262d3d'/><path d='M88-5H120A4 5 0 0 1 120 5H88Z' fill='%231d2330'/><rect x='88' y='-5.1' width='2.4' height='10.2' fill='%23c5a263'/><path d='M99.6-6.9H119.2Q120.6-6.9 120.6-5.5V-4.8H99.6Z' fill='%23c5a263'/><rect x='33' y='-3' width='53' height='1.4' fill='%235d6984'/></g></svg>") 3 29, auto;
  --pen-tap-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><circle cx='3' cy='29' r='2.8' fill='none' stroke='%23c0392b' stroke-width='1.2'/><g transform='translate(3 29) rotate(-45) scale(.29 .42)'><path d='M-5 0L16-6H98V-8.5H122L126 0L122 6H16Z' fill='white' opacity='.85'/><path d='M0 0C3.5-.5 9-3 16.5-3.6V3.6C9 3 3.5.5 0 0Z' fill='%23d2b16b' stroke='%236e5427' stroke-width='.6'/><path d='M1.2 0H11.4' stroke='%234d3b18' stroke-width='.8'/><path d='M15.5-3.5 29.8-4.1V4.1L15.5 3.5Z' fill='%231a1e27'/><rect x='29.8' y='-4.3' width='1.6' height='8.6' fill='%23c5a263'/><rect x='31.4' y='-4.5' width='56.6' height='9' fill='%23262d3d'/><path d='M88-5H120A4 5 0 0 1 120 5H88Z' fill='%231d2330'/><rect x='88' y='-5.1' width='2.4' height='10.2' fill='%23c5a263'/><path d='M99.6-6.9H119.2Q120.6-6.9 120.6-5.5V-4.8H99.6Z' fill='%23c5a263'/><rect x='33' y='-3' width='53' height='1.4' fill='%235d6984'/></g></svg>") 3 29, pointer;
  /* The pointer: the system's, until the user picks up the pen to doodle (sketch.js). */
  --pen: default;
  --pen-tap: pointer;
  --ink: #16181d;
  --quiet: #4a5060;
  --faint: #6b7080;
  --line: #e3e3de;
  --paper: #f6f6f3;
  --card: #ffffff;
  --accent: #2f5bea;
  --accent-soft: #e8edfc;
  --red: #b3261e;
  --hood: #0e1116;
  --hood-ink: #d6dce4;
  --hood-quiet: #8a94a6;
  --hood-line: #1c222b;
  --hood-card: #161b22;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--sans); cursor: var(--pen); }
:is(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, [contenteditable="true"]) { cursor: var(--pen-image); }
body.doodling { --pen: var(--pen-image); --pen-tap: var(--pen-tap-image); }
/* Penelope ate the pen (penelope.js pounce). */
body.pen-eaten, body.pen-eaten * { cursor: none !important; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
button { font: inherit; cursor: var(--pen-tap); }
button:disabled { cursor: var(--pen); opacity: .6; }
input, textarea { font: inherit; padding: 10px 12px; border: 1px solid #d5d7dd; border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; }
a { color: var(--accent); }
a:hover { color: #1e3fb0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.quiet { color: var(--quiet); margin: 0; }
[hidden] { display: none !important; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.brand strong { color: var(--ink); font-size: 17px; }
.tagline { color: #5b6170; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { padding: 4px 8px; border-radius: 6px; background: #eef1fb; font: 12px var(--mono); color: #3d4350; }
.chips .inline { font: 12px var(--mono); }
.peek { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--hood); color: #fff; font: 500 12px var(--mono); }
.peek[aria-expanded=true] { background: #232a35; }

/* The app on top; the machine below it, when peeked at. */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.app { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.hood { flex: 0 0 46vh; min-height: 0; display: flex; flex-direction: column; background: var(--hood); color: var(--hood-ink); border-top: 1px solid #000; }
/* Closed, it keeps its size off screen, so the terminal keeps its rows and columns. */
.hood:not(.open) { position: fixed; top: 100vh; left: 0; right: 0; height: 46vh; visibility: hidden; }

.sidebar { flex: 0 0 260px; padding: 20px 16px; border-right: 1px solid var(--line); background: #fbfbf9; display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.new { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
/* The list scrolls on its own, so the load bar, the desk pen and the notebook stay in view. */
.meetings { display: flex; flex-direction: column; gap: 2px; flex: 0 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width: 900px) { .meetings { flex-shrink: 0; max-height: 40vh; } }
.sidehead { padding: 12px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.meeting { width: 100%; text-align: left; padding: 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); display: flex; flex-direction: column; }
.meeting:hover { background: #f0f2f8; }
.meeting[aria-current=true] { background: var(--accent-soft); }
.meeting strong { font-size: 14px; }
.meeting span { font-size: 12px; color: var(--quiet); }
.empty { padding: 8px; }
.notebook { margin-top: auto; padding: 8px; font-size: 12px; color: var(--quiet); display: flex; flex-direction: column; gap: 2px; }
.notebook code { font-size: 11px; }

.content { flex: 1; min-width: 0; overflow: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.content h1 { margin: 0; font-size: 24px; font-weight: 700; }
.content h2 { margin: 0 0 10px; font-size: 15px; }
.setup { display: flex; flex-wrap: wrap; gap: 18px; }
.setup .card { flex: 1 1 320px; }
.callback { width: 100%; max-width: 560px; margin: 48px auto; padding: 0 16px; font-size: 16px; }
.card { padding: 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row input { flex: 1 1 200px; }
.primary, .secondary, .dark { min-height: 44px; padding: 0 16px; border-radius: 8px; font-weight: 600; }
.primary { border: 0; background: var(--accent); color: #fff; }
.secondary { border: 1px solid #d5d7dd; background: #fff; color: var(--ink); font-weight: 500; }
.dark { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--ink); color: #fff; }
.inline { border: 0; padding: 0; background: none; color: var(--accent); text-decoration: underline; }
.status:empty { display: none; }
.status { margin: 0; padding: 10px 12px; border-radius: 8px; background: #eef1fb; }

.meeting-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.meeting-head .quiet { font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.recbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px; }
.rec-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rec-quiet { margin: 0; padding: 12px 16px; border: 1px solid #e0a800; border-radius: 10px; background: #fff8e1; }
.rec-state.live { color: var(--red); }
.rec-state.live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.wave { flex: 1 1 200px; height: 32px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; overflow: hidden; }
.wave span { flex: 0 0 3px; border-radius: 2px; background: var(--accent); }
.rec-inputs { font-size: 13px; }
.stages { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0 0 0 20px; color: var(--faint); font-size: 13px; }
.stages .done { color: var(--ink); font-weight: 600; }
.stages .done::marker { color: var(--accent); }
.time-left { margin: 0; color: var(--quiet); font-size: 13px; }
.meeting.failed span { color: var(--red); }
.cards { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.summary { flex: 1 1 280px; min-width: 0; }
.transcript { flex: 1.4 1 320px; min-width: 0; }
.prose { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 { font-size: 15px; margin: 14px 0 6px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose em { color: var(--quiet); }
.history { margin: 0; padding: 12px 16px 12px 32px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font: 12.5px/1.7 var(--mono); }

/* Under the hood. */
.hoodhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 18px; border-bottom: 1px solid var(--hood-line); }
.hoodhead strong { color: #fff; }
[role=tablist] { display: flex; gap: 4px; margin-right: auto; }
[role=tab] { min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: #a9b2c0; font: 500 12px var(--mono); }
[role=tab][aria-selected=true] { background: #232a35; color: #fff; }
.close { width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: #a9b2c0; }
.panels { position: relative; flex: 1; min-height: 0; }
.panel { position: absolute; inset: 0; overflow: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 12.5px; }
.panel:not(.active) { visibility: hidden; pointer-events: none; }
.panel h2 { margin: 6px 0 0; font: 600 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--hood-quiet); }
.panel[data-panel=terminal] { padding: 8px; background: #1e1e1e; }
#terminal { height: 100%; }
.panel[data-panel=activity] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: auto auto minmax(0, 1fr); gap: 8px 24px; }
.panel[data-panel=activity] > .last, .panel[data-panel=activity] > #hood-idle { grid-column: 1 / -1; }
.activity-col { display: flex; flex-direction: column; gap: 8px; min-height: 0; }

.last { padding: 12px; border-radius: 10px; background: var(--hood-card); border: 1px solid #2a3240; font-family: var(--sans); }
.last .quiet, #hood-idle { color: #a9b2c0; font-size: 12px; font-family: var(--sans); }
.last strong { color: #fff; }
.last code { display: block; margin-top: 4px; color: #fff; white-space: pre-wrap; word-break: break-word; }
.last .hint { margin-top: 6px; }
.tree, .log { list-style: none; margin: 0; padding: 0; }
.tree { overflow: auto; }
.tree li { display: flex; gap: 8px; align-items: baseline; line-height: 1.8; white-space: nowrap; }
.tree .pid { color: var(--hood-quiet); min-width: 3ch; text-align: right; }
.tree .lines { color: #4a5363; white-space: pre; }
.tree .name { overflow: hidden; text-overflow: ellipsis; color: #fff; }
.tree .about { color: var(--hood-quiet); }
.state { padding: 0 6px; border-radius: 4px; font-size: 11px; }
.state.running { background: #1e3a2f; color: #8fe0b8; }
.state.recording { background: #3a2a16; color: #f2b872; }
.state.ok { background: #232a35; color: #a9b2c0; }
.state.failed { background: #3a1e1e; color: #f2a0a0; }
.loghead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.filters { display: flex; gap: 4px; }
.tag { display: inline-block; align-self: start; justify-self: start; padding: 1px 6px; border: 0; border-radius: 4px; font: 600 11px var(--mono); }
.filters .tag[aria-pressed=false] { opacity: .35; }
.tag.exec { background: #1c2a4a; color: #9dbbff; }
.tag.exit { background: #232a35; color: #c4cbd6; }
.tag.net { background: #3a2a16; color: #f2b872; }
.tag.fs { background: #163536; color: #7fdcd0; }
.tag.audio { background: #2e2342; color: #c9b0f5; }
.log { flex: 1; min-height: 120px; overflow: auto; padding: 4px 10px; border-radius: 10px; background: #0a0d11; border: 1px solid var(--hood-line); }
.log li { display: grid; grid-template-columns: 92px 52px minmax(0, 1fr) auto; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--hood-line); }
.log time, .log .from { color: var(--hood-quiet); }
.log li span:nth-child(3) { word-break: break-word; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--hood-line); vertical-align: top; }
th { color: var(--hood-quiet); font-weight: 500; }
td:first-child { word-break: break-all; color: #fff; }

.players { position: fixed; bottom: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.player { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 6px; background: #333; }
.player button { border: 0; background: none; color: #ccc; font-size: 16px; }

@media (max-width: 900px) {
  .app { flex-direction: column; overflow: auto; }
  .sidebar { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .content { overflow: visible; }
  .panel[data-panel=activity] { display: flex; }
  .log li { grid-template-columns: 80px 48px minmax(0, 1fr); }
  .log .from { display: none; }
}
.notebook .inline { align-self: flex-start; margin-top: 4px; }
.space select { flex: 1 1 200px; min-height: 44px; padding: 0 10px; font: inherit; }
.recording { width: 100%; max-width: 560px; }
.speaker { display: grid; grid-template-columns: minmax(8em, auto) minmax(0, 1fr); gap: 2px 12px; align-items: baseline; }
.speaker q { color: var(--quiet); overflow-wrap: anywhere; }
.speaker input { grid-column: 1 / -1; }
.prose code { overflow-wrap: anywhere; white-space: normal; }

/* Notes about a failure: hung under the peek button, their arrow on it. */
.notes { position: fixed; z-index: 30; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 16px)); }
.notes[hidden] { display: none; }
.note { position: relative; padding: 12px 36px 12px 14px; border-radius: 10px; background: var(--hood); color: var(--hood-ink); border-left: 4px solid var(--red); box-shadow: 0 8px 24px rgb(14 17 22 / 28%); font-size: 13px; animation: note-in .18s ease-out; }
.note.warn { border-left-color: #c98a12; }
.note:first-child::before { content: ""; position: absolute; top: -8px; right: calc(var(--arrow, 60px) - 8px); border: 8px solid transparent; border-top: 0; border-bottom-color: var(--hood); }
.note strong { display: block; color: #fff; }
.note p { margin: 4px 0 0; overflow-wrap: anywhere; }
.note-detail { color: var(--hood-ink); }
.note-hint { color: #9fd0ff; }
.note-code { display: inline-block; margin-top: 6px; padding: 1px 6px; border-radius: 4px; background: var(--hood-card); color: var(--hood-quiet); }
.note-close { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--hood-quiet); font-size: 12px; }
.note-close:hover { background: var(--hood-card); color: #fff; }
.note-cause { margin: 8px 0 0; padding: 6px 8px; max-height: 9.5em; overflow: auto; border-radius: 6px; background: var(--hood-card); color: var(--hood-ink); font: 11.5px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-log, .runlog-log { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-log { margin-top: 10px; }
.note-log button, .runlog-log button { min-height: 26px; padding: 0 10px; border: 1px solid #3a4352; border-radius: 6px; background: none; color: #fff; font: 500 12px var(--mono); }
.note-log .note-copy { border-color: #fff; background: #fff; color: var(--hood); }
.note-log button:hover, .runlog-log button:hover { border-color: #fff; }
.note-said, .runlog-said { flex-basis: 100%; margin: 0; color: #ffb4a8; }
/* Penelope stands over the peek's bottom right corner. */
.panel[data-panel=runlogs] { padding-right: 130px; }
.runlogs { margin: 0; padding: 0; list-style: none; }
.runlog { display: grid; grid-template-columns: 8.5em minmax(0, 1.2fr) minmax(0, 1fr) 5em auto; align-items: center; gap: 4px 14px; padding: 7px 0; border-bottom: 1px solid #232a35; }
.runlog-when, .runlog-size { color: var(--hood-quiet); }
.runlog-what, .runlog-how { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runlog.failed .runlog-how { color: #ff8a7a; }
.runlog.clean .runlog-how, .runlog.running .runlog-how { color: var(--hood-quiet); }
@media (max-width: 700px) { .runlog { grid-template-columns: 1fr 1fr; } }
.note-peek { display: block; margin-top: 10px; padding: 0; border: 0; background: none; color: #fff; font: 500 12px var(--mono); text-decoration: underline; text-underline-offset: 3px; }
.peek.nudge { animation: peek-nudge 1.6s ease-in-out infinite; }
@keyframes note-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes peek-nudge { 50% { box-shadow: 0 0 0 5px rgb(179 38 30 / 30%); } }
@media (prefers-reduced-motion: reduce) {
  .note, .peek.nudge { animation: none; }
  .peek.nudge { box-shadow: 0 0 0 3px rgb(179 38 30 / 45%); }
}

.download { display: inline-block; margin: 6px 0 0; font-size: 13px; }
.download[hidden] { display: none; }
