/* KD: one bit. Black, off-white, one highlight. 1px lines, square corners, hard shadows, one typeface. */
.os {
  --os-bg: #0d0d0c; --panel: #121211; --well: #0a0a09; --ink: #efece4; --dim: #8a867b; --soft: #cfcabd; --line: #2e2d29; --hover: #1b1b19; --dark: #0d0d0c;
  --accent: #ffb000;
  --pixel: "VT323", "IBM Plex Mono", monospace;
  position: fixed; inset: 0; z-index: 20; background: var(--os-bg); color: var(--ink); font: 12px/1.5 var(--mono);
  opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s .5s;
}
.os.on { opacity: 1; visibility: visible; transition: opacity .5s ease, visibility 0s; }
.os::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 999; background: repeating-linear-gradient(rgba(0,0,0,.14) 0 1px, transparent 1px 3px); }
.os.no-scan::after { background: none; }
.os *, .os *::before, .os *::after { box-sizing: border-box; }
:where(.os) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
:where(.os) a { color: inherit; }
:where(.os) h3, :where(.os) h4, :where(.os) p, :where(.os) ol { margin: 0; }
.os [hidden] { display: none !important; }
.os :focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.os kbd { font: inherit; font-size: 10px; border: 1px solid currentColor; padding: 0 4px; opacity: .7; }
.os .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.os ::selection { background: var(--accent); color: var(--dark); }

/* scrollbars: a checker track and a plain thumb, like the rest */
.os ::-webkit-scrollbar { width: 13px; height: 13px; }
.os ::-webkit-scrollbar-track { background: repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 2px 2px; border-left: 1px solid var(--line); }
.os ::-webkit-scrollbar-thumb { background: var(--panel); border: 1px solid var(--dim); }
.os ::-webkit-scrollbar-thumb:hover { border-color: var(--ink); }
.os ::-webkit-scrollbar-corner { background: var(--panel); }
@supports not selector(::-webkit-scrollbar) { .os * { scrollbar-width: thin; scrollbar-color: var(--dim) var(--panel); } }

/* ---- type and small parts every app shares */
.os .label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.os .dim { color: var(--dim); }
.os h3 { font-size: 20px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.os .lede { font-size: 13px; color: var(--soft); max-width: 56ch; }
.os .prose { display: grid; gap: 10px; max-width: 62ch; color: var(--soft); }
.os .insp-no { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; letter-spacing: .04em; margin-bottom: 4px; }
.os .meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.os .meta dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding-top: 1px; }
.os .meta dd { margin: 0; }
.os .meta a { text-decoration: none; border-bottom: 1px solid var(--dim); }
.os .meta a:hover { border-color: var(--ink); }

.os .btn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border: 1px solid var(--dim); font-size: 12px; text-decoration: none; white-space: nowrap; background: var(--panel); }
.os .btn:hover { background: var(--ink); color: var(--dark); border-color: var(--ink); }
/* the default button gets the old double outline */
.os .btn.primary { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--ink); margin: 3px; }
.os .row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.os .seg { display: inline-flex; border: 1px solid var(--dim); }
.os .seg button { height: 24px; padding: 0 10px; font-size: 11px; }
.os .seg button + button { border-left: 1px solid var(--dim); }
.os .seg button:hover { background: var(--hover); }
.os .seg button[aria-pressed="true"] { background: var(--ink); color: var(--dark); }
.os .toolbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.os .toolbar .push { margin-left: auto; }
.os .pad { padding: 20px; }
.os .tog { position: relative; width: 36px; height: 18px; border: 1px solid var(--dim); }
.os .tog::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--dim); transition: transform .15s; }
.os .tog[aria-checked="true"] { border-color: var(--ink); }
.os .tog[aria-checked="true"]::after { background: var(--accent); transform: translateX(16px); }

/* a picture: one-bit first, developing into the real thing */
.os .plate { position: relative; aspect-ratio: 16 / 10; background: var(--well); border: 1px solid var(--line); overflow: hidden; }
.os .plate canvas, .os .plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.os .plate canvas { image-rendering: pixelated; }
.os .plate img { opacity: 0; filter: grayscale(1) contrast(1.1); }
.os .plate.dev img { opacity: 1; filter: none; transition: opacity .5s ease, filter .8s ease .2s; }
.os .plate.empty { background: repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 4px 4px; }
.os .plate.empty::after { content: "No picture yet"; position: absolute; inset: auto 0 10px; text-align: center; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

/* a list with column headings */
.os .tbl { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.os .tbl-head, .os .tbl-row { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; padding: 0 12px; }
.os .tbl-head { flex: none; height: 24px; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.os .tbl-rows { flex: 1; overflow-y: auto; padding: 4px 0; outline: none; }
.os .tbl-row { height: 28px; cursor: default; font-variant-numeric: tabular-nums; }
.os .tbl-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os .tbl-row:hover { background: var(--hover); }
.os .tbl-row.on { background: var(--ink); color: var(--dark); }
.os .tbl-row.on .dim { color: var(--dark); }

/* ---- boot, and BASIC full screen */
.os-boot { position: absolute; inset: 0; padding: clamp(24px, 6vh, 64px) clamp(20px, 8vw, 120px); overflow-y: auto; box-shadow: inset 0 0 0 clamp(14px, 3vw, 36px) #1b1a17; }
.term { font: 22px/1.25 var(--pixel); letter-spacing: .02em; }
.term-out { margin: 0; white-space: pre-wrap; font: inherit; color: var(--ink); }
.term-line { display: block; }
.term-in { width: 100%; font: inherit; color: var(--ink); background: transparent; border: 0; outline: none; text-transform: uppercase; caret-color: var(--accent); padding: 0; }
.os .term-in:focus-visible { outline: none; }

/* ---- the desktop */
.os-desk { position: absolute; inset: 0; display: flex; flex-direction: column; }
.os[data-pattern="dots"] .os-desk { background-image: radial-gradient(rgba(239,236,228,.08) 1px, transparent 1.4px); background-size: 14px 14px; }
.os[data-pattern="grid"] .os-desk { background-image: linear-gradient(rgba(239,236,228,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(239,236,228,.05) 1px, transparent 1px); background-size: 24px 24px; }
.os[data-pattern="checker"] .os-desk { background-image: repeating-conic-gradient(rgba(239,236,228,.05) 0 25%, transparent 0 50%); background-size: 4px 4px; }

.os-menubar { flex: none; height: 26px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; background: var(--ink); color: var(--dark); position: relative; z-index: 900; }
.os-menus { display: flex; height: 100%; }
.os-menu { position: relative; display: flex; }
.os-menu-title { padding: 0 10px; font-weight: 600; line-height: 26px; }
.os-menu.open .os-menu-title { background: var(--dark); color: var(--ink); }
.os-menu-list { position: absolute; top: 26px; left: 0; min-width: 220px; padding: 3px 0; background: var(--ink); color: var(--dark); border: 1px solid var(--dark); box-shadow: 3px 3px 0 rgba(0,0,0,.55); display: none; z-index: 950; }
.os-menu.open .os-menu-list, .os-ctx { display: block; }
.os-ctx { position: fixed; }
.os-menu-list button { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; width: 100%; padding: 3px 14px 3px 6px; white-space: nowrap; }
.os-menu-list button:hover:not(:disabled), .os-menu-list button:focus-visible { background: var(--dark); color: var(--ink); outline: none; }
.os-menu-list button:disabled { color: #a29e92; cursor: default; }
.os-menu-list .mk { font-size: 11px; }
.os-menu-list kbd { margin-left: 18px; }
.os-menu-list hr { border: 0; border-top: 1px dotted var(--dark); margin: 3px 0; }
.os-status { display: flex; align-items: center; gap: 16px; }
.os-status button { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
.os-status .led { background: #a29e92; }
.os-status button:hover { text-decoration: underline; text-underline-offset: 3px; }

.os-icons { position: absolute; inset: 26px 0 30px 0; }
.os-icon { position: absolute; width: 96px; display: grid; justify-items: center; gap: 4px; padding: 6px 4px; touch-action: none; }
.os-icon .ico { width: 64px; height: 64px; image-rendering: pixelated; }
.os-icon .ico.inv, .os-icon.sel .ico:not(.inv) { display: none; }
.os-icon.sel .ico.inv { display: block; }
.os-icon span { font-size: 11px; line-height: 1.35; padding: 0 5px; text-align: center; background: var(--os-bg); }
.os-icon.sel span { background: var(--ink); color: var(--dark); }
.os-icon:focus-visible { outline: none; }
.os-icon.drag { opacity: .75; z-index: 5; }

.os-windows { position: relative; flex: 1; pointer-events: none; }
.os-windows .win { pointer-events: auto; }

.os-taskbar { flex: none; height: 30px; display: flex; align-items: center; gap: 12px; padding: 0 8px; border-top: 1px solid var(--ink); background: var(--well); position: relative; z-index: 900; }
.os-tasks { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.os-tasks::-webkit-scrollbar { display: none; }
.os-task { flex: none; height: 22px; padding: 0 12px; font-size: 11px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.os-task:hover { border-color: var(--ink); color: var(--ink); }
.os-task.on { background: var(--ink); color: var(--dark); border-color: var(--ink); }
.os-task.min { border-style: dashed; }
.os-tray { flex: none; display: flex; gap: 16px; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---- windows */
.win { position: absolute; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); min-width: 320px; min-height: 200px; transform-origin: 0 0; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; box-shadow: none; }
.win.min { display: none; }
.win-bar { flex: none; height: 24px; display: flex; align-items: center; gap: 8px; padding: 0 5px; border-bottom: 1px solid var(--ink); cursor: grab; user-select: none; touch-action: none; }
.win.moving .win-bar { cursor: grabbing; }
/* the active window wears the stripes */
.win.active .win-bar { background: repeating-linear-gradient(var(--ink) 0 1px, transparent 1px 3px) 5px 6px / calc(100% - 10px) 11px no-repeat; }
.win-title { flex: 1; min-width: 0; text-align: center; font-size: 12px; font-weight: 600; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-title span { background: var(--panel); padding: 0 10px; }
.win-ctl { display: flex; gap: 3px; flex: none; background: var(--panel); padding-left: 6px; }
.win-ctl button { position: relative; width: 17px; height: 15px; border: 1px solid var(--ink); background: var(--panel); }
.win-ctl button::before, .win-ctl button::after { content: ""; position: absolute; background: var(--ink); }
.win-min::before { left: 3px; right: 3px; bottom: 3px; height: 1px; }
.win-max::before { inset: 2px 3px; background: transparent !important; border: 1px solid var(--ink); border-top-width: 2px; }
.win-close::before, .win-close::after { left: 50%; top: 50%; width: 9px; height: 1px; }
.win-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.win-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.win-ctl button:hover { background: var(--ink); }
.win-ctl button:hover::before, .win-ctl button:hover::after { background: var(--dark); border-color: var(--dark); }
.win-ctl .win-close:hover { background: var(--accent); border-color: var(--accent); }
.win:not(.active) { border-color: var(--line); }
.win:not(.active) .win-bar { border-bottom-color: var(--line); }
.win:not(.active) .win-title { color: var(--dim); font-weight: 500; }
.win:not(.active) .win-ctl { opacity: .35; }
.win-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.win-status { flex: none; height: 22px; padding: 0 22px 0 10px; border-top: 1px solid var(--line); font-size: 11px; line-height: 21px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-grip { position: absolute; right: 1px; bottom: 1px; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 0 55%, var(--dim) 55% 61%, transparent 61% 72%, var(--dim) 72% 78%, transparent 78%); }
.win.max .win-grip { display: none; }
.win-back { display: none; }
/* a page inside a window would swallow the pointer mid-drag */
.os.dragging iframe { pointer-events: none; }
.os.inverted { filter: invert(1); }

/* ---- dialogs */
.os-dialog { position: absolute; inset: 0; z-index: 960; display: grid; place-items: center; background: rgba(0,0,0,.3); }
.os-dialog .dlg { position: relative; width: min(420px, calc(100% - 32px)); min-height: 0; box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--ink), 4px 4px 0 rgba(0,0,0,.6); padding: 22px; gap: 18px; }
.dlg-body { display: flex; gap: 16px; align-items: flex-start; }
.dlg-ico .ico { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
.dlg-body p { padding-top: 6px; line-height: 1.6; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }

/* ---- two panes: a list and what's selected */
.split { display: grid; grid-template-columns: 1fr 300px; overflow: hidden; }
.split > * { min-height: 0; }
.insp, .note-page, .dial-pane { overflow-y: auto; border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.insp h3 { font-size: 17px; }
.insp .row-btns { margin-top: auto; padding-top: 4px; }

/* ---- a release, opened */
/* a release, written up as a case study */
.doc { container: doc / inline-size; padding-bottom: 56px; }
.doc .doc-hero .plate { aspect-ratio: auto; height: clamp(220px, 46cqw, 520px); border: 0; border-bottom: 1px solid var(--line); }
.cs { max-width: 1560px; margin: 0 auto; padding: 0 clamp(18px, 4cqw, 48px); }
.cs-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px 56px; padding: 36px 0 32px; border-bottom: 1px solid var(--line); }
.cs-top h3 { font-size: clamp(28px, 4.4cqw, 48px); letter-spacing: -.03em; line-height: 1; margin: 6px 0 14px; }
.cs-top .lede { font-size: 15px; line-height: 1.55; max-width: 48ch; }
.cs-side { display: grid; gap: 18px; align-content: start; padding-top: 22px; }
.cs-side .meta { gap: 8px 22px; }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; border-bottom: 1px solid var(--line); }
.cs-facts > div { padding: 22px 18px 20px 0; }
.cs-facts > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.cs-facts dt { font: 44px/1 var(--pixel); color: var(--ink); }
.cs-facts dd { margin: 8px 0 0; color: var(--dim); font-size: 11px; }
.cs-sec { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px 48px; padding: 40px 0; border-bottom: 1px solid var(--line); }
.cs-h { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; display: grid; gap: 6px; align-content: start; }
.cs-h span { font: 40px/1 var(--pixel); letter-spacing: 0; color: var(--accent); }
.cs-c { display: grid; grid-template-columns: minmax(0, 68ch) minmax(0, 1fr); gap: 28px 64px; min-width: 0; align-items: start; }
.cs-c > * { grid-column: 1 / -1; }
.cs-c > .prose { grid-column: 1; }
.cs-c .prose { font-size: 13px; line-height: 1.7; max-width: 68ch; gap: 14px; }
.cs-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cs-grid li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 20px 22px; display: grid; gap: 6px; align-content: start; }
.cs-grid .cs-n { font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }
.cs-grid b { font-size: 13px; font-weight: 600; }
.cs-grid p { color: var(--dim); line-height: 1.6; }
.cs-rows { border-top: 1px solid var(--ink); }
.cs-rows > div { display: grid; grid-template-columns: 170px 110px minmax(0, 1fr) 220px; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.cs-rows span:first-child { font: 34px/1 var(--pixel); letter-spacing: .02em; }
.cs-rows span:nth-child(2), .cs-rows span:last-child { color: var(--dim); }
.cs-rows span:nth-child(3) { font-size: 15px; color: var(--ink); }
.cs-fig { padding: 40px 0; border-bottom: 1px solid var(--line); }
.cs-body { padding: 32px 0; font-size: 13px; line-height: 1.7; }
.doc-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 40px; }
.doc-gallery:empty { display: none; }
@container doc (max-width: 1200px) { .cs-c { grid-template-columns: 1fr; }  }
@container doc (max-width: 760px) {
  .cs-top, .cs-sec, .cs-c { grid-template-columns: 1fr; }
    .cs-grid { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); }
  .cs-side { padding-top: 0; }
  .cs-sec { padding: 28px 0; gap: 14px; }
  .cs-h { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 12px; }
  .cs-h span { font-size: 28px; }
  .cs-rows > div { grid-template-columns: 1fr; gap: 2px; }
  .cs-facts > div { padding: 16px 12px 14px 0; }
  .cs-facts > div + div { padding-left: 12px; }
  .cs-facts dt { font-size: 34px; }
}
@container doc (max-width: 480px) { .cs-grid { grid-template-columns: 1fr; } }

/* ---- extension disk */
.disk { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.disk-top { display: flex; gap: 14px; align-items: center; }
.disk-top .ico { width: 64px; height: 64px; image-rendering: pixelated; display: block; }

/* ---- Darkroom */
.dr { display: flex; flex-direction: column; }
.dr-sheet-wrap { display: flex; flex-direction: column; }
.dr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 14px; padding: 16px; align-content: start; }
.dr-thumb { display: grid; gap: 6px; font-size: 11px; color: var(--dim); }
.dr-thumb[hidden] { display: none; }
.dr-thumb .plate { aspect-ratio: 3 / 2; }
.dr-thumb:hover .plate { border-color: var(--ink); }
.dr-thumb:hover { color: var(--ink); }
.dr-cap b { font-weight: 500; color: var(--ink); margin-right: 4px; }
.dr-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dr-dev { display: flex; align-items: center; gap: 8px; }
.dr-dev input { width: 140px; }
/* a slider drawn like everything else: a 1px track and a square knob */
.os input[type="range"] { -webkit-appearance: none; appearance: none; height: 16px; background: linear-gradient(var(--dim), var(--dim)) center / 100% 1px no-repeat; cursor: pointer; }
.os input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 15px; background: var(--panel); border: 1px solid var(--ink); }
.os input[type="range"]::-moz-range-thumb { width: 9px; height: 15px; border-radius: 0; background: var(--panel); border: 1px solid var(--ink); }
.os input[type="range"]:hover::-webkit-slider-thumb { background: var(--ink); }
.dr-stage { position: relative; flex: 1; min-height: 160px; background: var(--well); }
.dr-stage canvas, .dr-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.dr-stage canvas { image-rendering: pixelated; }
.dr-stage img { opacity: 0; }
.dr-nav button { width: 28px; font-size: 15px; padding: 0; }
/* Garage: the car's side view on the left, its card on the right */
.gr-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.gr-card { padding: 18px 18px 22px; border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.gr-card h3 { font-size: 16px; font-weight: 500; }
.gr-lede { color: var(--ink); }
.gr-story { color: var(--dim); }
.gr-traits { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.gr-traits li { padding-left: 14px; position: relative; }
.gr-traits li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 1px; background: var(--accent); }
.gr-3d { position: absolute; inset: 0; background: #efece4; }
.gr-load { position: absolute; left: 50%; top: 50%; translate: -50% -50%; color: #5d5a52; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; pointer-events: none; }
.gr-mine { font: 400 20px/1.25 "Cedarville Cursive", cursive; color: #c9b48a; }
.gr-credit { margin-top: auto; font-size: 10px; }
.os.phone .gr-body { grid-template-columns: 1fr; grid-template-rows: minmax(180px, 45%) 1fr; }
.os.phone .gr-card { border-left: 0; border-top: 1px solid var(--line); }

/* Apex: a grid of cars, then the circuit with a timing HUD over it */
.rc { display: flex; flex-direction: column; }
.rc-pick, .rc-race { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rc [hidden] { display: none !important; }
.rc-grid { flex: 1; overflow: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; align-content: start; }
.rc-car { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px; text-align: left; border: 1px solid var(--line); background: var(--well); }
.rc-car:hover, .rc-car:focus-visible { border-color: var(--ink); outline: none; }
.rc-car img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #efece4; }
.rc-car-name { color: var(--ink); }
.rc-stats { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 3px 8px; font-size: 10px; color: var(--dim); }
.rc-stats i { height: 3px; background: linear-gradient(90deg, var(--accent) calc(var(--k) * 100%), var(--line) 0); }
.rc-name { color: var(--ink); }
.rc-stage { position: relative; flex: 1; min-height: 200px; background: #0d0d0c; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.rc-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rc-hud { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: rgba(13,13,12,.62); pointer-events: none; }
.rc-time { font: 500 26px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-sub, .rc-speed { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.rc-speed { position: absolute; right: 10px; bottom: 10px; padding: 6px 8px; background: rgba(13,13,12,.62); pointer-events: none; }
.rc-speed b { font: 500 26px/1 var(--mono); color: var(--ink); }
.rc-map { position: absolute; right: 12px; top: 12px; width: 180px; height: 150px; pointer-events: none; }
.rc-map polyline { fill: none; stroke: #8a867b; stroke-width: 9; stroke-linejoin: round; opacity: .6; }
.rc-map rect { fill: #efece4; }
.rc-map circle { fill: var(--accent); }
.rc-msg { position: absolute; left: 50%; top: 28%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.rc-msg b { font: 500 34px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-msg span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.rc-lights { position: absolute; left: 50%; top: 18%; translate: -50% 0; display: flex; gap: 12px; padding: 10px 14px; background: rgba(13,13,12,.7); border: 1px solid var(--line); pointer-events: none; }
.rc-lights i { width: 18px; height: 18px; border-radius: 50%; background: #241c08; }
.rc-lights i.on { background: var(--accent); box-shadow: 0 0 12px rgba(255,176,0,.6); }
.rc-gear { margin-right: 10px; color: var(--accent); font: 500 18px/1 var(--mono); }
.rc-credit { flex: none; margin: 0; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 10px; }
.rc-credit a { color: inherit; }
.rc-load { position: absolute; left: 50%; top: 50%; translate: -50% -50%; color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; pointer-events: none; }
.rc-touch { position: absolute; inset: auto 10px 46px; display: flex; justify-content: space-between; pointer-events: none; }
.rc-touch span { display: flex; gap: 10px; }
.rc-touch button { pointer-events: auto; width: 64px; height: 64px; border: 1px solid var(--dim); background: rgba(13,13,12,.55); color: var(--ink); font-size: 13px; touch-action: none; }
.rc-touch button:active { background: var(--ink); color: var(--dark); }

/* ---- Notes */
.split.notes { grid-template-columns: 280px 1fr; }
.notes .note-page { order: 2; padding: 24px 28px; gap: 14px; }
.notes .note-page h3 { font-size: 22px; }

/* ---- Changelog */
.cl { padding: 22px 26px 30px; }
.cl header { display: grid; gap: 4px; margin-bottom: 8px; }
.cl h4 { margin: 22px 0 6px; }
.cl ol { list-style: none; padding: 0; }
.cl li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px dotted var(--line); }
.cl-no, .cl-day { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 11px; }
.cl li button:hover { text-decoration: underline; text-underline-offset: 3px; }
.cl li.major span:not(.cl-no):not(.cl-day) { font-weight: 600; }
.cl li.major .cl-no { color: var(--ink); }

/* ---- Trash */
.trash { display: flex; flex-direction: column; }
.trash .tbl { flex: 1; }

/* ---- Control Panel */
.cp { padding: 6px 0; }
.cp-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.cp-row:last-child { border-bottom: 0; }
.cp-row > .tog, .cp-row > .btn { justify-self: start; }
.cp-swatches, .cp-pats { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-swatches button, .cp-pats button { display: grid; justify-items: center; gap: 4px; padding: 5px; font-size: 10px; color: var(--dim); border: 1px solid transparent; }
.cp-swatches button:hover, .cp-pats button:hover { color: var(--ink); }
.cp-swatches button[aria-pressed="true"], .cp-pats button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.cp-swatches i { width: 40px; height: 22px; border: 1px solid var(--line); }
.cp-pats i { width: 48px; height: 32px; border: 1px solid var(--line); background-color: var(--os-bg); }
.cp-pats .pat-dots { background-image: radial-gradient(rgba(239,236,228,.3) 1px, transparent 1.4px); background-size: 7px 7px; }
.cp-pats .pat-grid { background-image: linear-gradient(rgba(239,236,228,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(239,236,228,.18) 1px, transparent 1px); background-size: 8px 8px; }
.cp-pats .pat-checker { background-image: repeating-conic-gradient(rgba(239,236,228,.22) 0 25%, transparent 0 50%); background-size: 4px 4px; }

/* ---- Snake */

/* ---- About KD */
.ab-head { display: flex; gap: 18px; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.ab-head .ico { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
.ab-head .ab-ico { display: block; }
.ab-head h3 { font-size: 28px; }
.ab-ver { font-variant-numeric: tabular-nums; }
.ab > .meta { padding: 18px 24px; }
.ab-up { font-variant-numeric: tabular-nums; }
.ab-me { padding: 18px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.ab-who { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: start; }
.ab-pic .plate { aspect-ratio: 4 / 5; }
.ab-who > div:last-child { display: grid; gap: 8px; color: var(--soft); }
.ab-name { color: var(--ink); font-weight: 600; font-size: 14px; }

/* BASIC inside a window */
.win-body.term { padding: 12px 16px; background: var(--well); font-size: 20px; }



/* ---- Read Me */
.readme { padding: 22px 24px; display: grid; gap: 16px; align-content: start; }
.readme-top { display: flex; gap: 16px; align-items: center; }
.readme .ico, .dial-head .ico, .ph-card .ico { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
.readme-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.readme-list li { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--line); }
.readme-list button { font-weight: 600; }
.readme-list button:hover, .cv-row button:hover b, .dial-hint button { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Résumé */
.cv { display: flex; flex-direction: column; }
.cv-page { padding: 26px 30px 34px; display: grid; gap: 22px; max-width: 720px; }
.cv-page header { display: grid; gap: 6px; }
.cv-page h3 { font-size: 26px; }
.cv-page section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.cv-row { display: grid; grid-template-columns: 96px 1fr; gap: 16px; }
.cv-row p + p { margin-top: 2px; }
.cv-when { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 11px; padding-top: 2px; }
.cv-page a { text-decoration: none; border-bottom: 1px solid var(--dim); }

/* ---- Dial-Up */
.split.dial { grid-template-columns: 300px 1fr; }
.split.dial .tbl { order: 0; }
.dial-pane { gap: 14px; }
.dial-head { display: flex; gap: 14px; align-items: center; }
.dial-log { margin: 0; min-height: 150px; flex: 1; max-height: 240px; overflow: auto; background: var(--well); border: 1px solid var(--line); padding: 10px 12px; font: 19px/1.2 var(--pixel); color: var(--ink); white-space: pre-wrap; }

/* ---- the web, inside a window */
.web { display: flex; flex-direction: column; overflow: hidden; }
.web iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.web-addr { flex: 1; min-width: 0; max-width: 440px; padding: 3px 10px; border: 1px solid var(--line); color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mats { margin: 6px 0 0; padding-left: 16px; color: var(--soft); }
.mats li::marker { color: var(--dim); }

/* ---- Paint */
.paint { display: flex; flex-direction: column; overflow: hidden; }
.paint > .toolbar:last-child { border-bottom: 0; border-top: 1px solid var(--line); }
.pt-tools { flex-wrap: wrap; }
.pt-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--well) repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 4px 4px; }
.pt-stage canvas { image-rendering: pixelated; outline: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); cursor: crosshair; touch-action: none; }
.pt-pats { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-pats button { padding: 2px; border: 1px solid var(--line); }
.pt-pats button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pt-pats canvas { width: 16px; height: 16px; display: block; image-rendering: pixelated; }

/* ---- Puzzle */

/* ---- screensaver */
.os-saver { position: fixed; inset: 0; z-index: 1000; background: #060606; cursor: none; }
.os-saver canvas { width: 100%; height: 100%; display: block; }

/* ---- the phone: same machine, arranged for a thumb */
.os.phone .os-desk { overflow: hidden; }
.ph-status { flex: none; height: 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 12px; background: var(--ink); color: var(--dark); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; z-index: 900; }
.ph-status > :first-child { justify-self: start; }
.ph-status > :last-child { justify-self: end; font-weight: 500; }
.ph-home { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 22px; }
.ph-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.ph-card h3 { font-size: 22px; }
.os.phone .os-icons { position: static; inset: auto; }
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 0; }
.ph-dock { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ink); background: var(--well); }
.os.phone .os-icon { position: static; width: auto; padding: 4px 0; }
.os.phone .os-icon span { font-size: 11px; }
.os.phone .os-windows { position: absolute; inset: 28px 0 0; z-index: 800; }
.os.phone .win { position: absolute; inset: 0; width: auto; height: auto; min-width: 0; border: 0; box-shadow: none; }
.os.phone .win-bar { height: 44px; padding: 0 8px; }
.os.phone .win.active .win-bar { background-position: 8px 16px; background-size: calc(100% - 16px) 11px; }
.os.phone .win-back { display: block; flex: none; width: 76px; height: 30px; text-align: left; padding: 0 8px; font-size: 13px; background: var(--panel); }
.os.phone .win-bar::after { content: ""; flex: none; width: 76px; }
.os.phone .win-ctl, .os.phone .win-grip { display: none; }
.os.phone .win-title { font-size: 13px; }
.os.phone .win-status { padding-bottom: env(safe-area-inset-bottom); }
.os.phone .split, .os.phone .split.notes, .os.phone .split.dial { grid-template-columns: 1fr; grid-template-rows: minmax(150px, 38%) 1fr; }
.os.phone .insp, .os.phone .note-page, .os.phone .dial-pane { border-left: 0; border-top: 1px solid var(--line); }
.os.phone .notes .note-page { order: 0; }
/* a tap opens the thing itself, so lists that only preview what's selected are just lists here */
.os.phone .split > .insp { display: none; }
.os.phone .split:has(> .insp) { grid-template-rows: 1fr; }
.os.phone ::-webkit-scrollbar { width: 3px; height: 3px; }
.os.phone ::-webkit-scrollbar-track { background: none; border: 0; }
.os.phone ::-webkit-scrollbar-thumb { background: var(--dim); border: 0; }
.os.phone .tbl-row { height: 40px; }
.os.phone .term { font-size: 18px; }
.os.phone .cp-row { grid-template-columns: 1fr; gap: 8px; }
.os.phone .cv-page { padding: 20px 18px 28px; }
.os.phone .cv-row { grid-template-columns: 1fr; gap: 2px; }
.os.phone .os-dialog .dlg-body { flex-direction: column; }

/* ---- the résumé, on paper */
#kd-print { display: none; }
@media print {
  @page { margin: 16mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(#kd-print) { display: none !important; }
  #kd-print { display: block; color: #111; font: 9.5pt/1.5 "IBM Plex Mono", monospace; }
  #kd-print * { box-sizing: border-box; margin: 0; }
  #kd-print .cv-page { display: grid; gap: 14pt; }
  #kd-print h3 { font-size: 20pt; line-height: 1.1; font-weight: 600; }
  #kd-print .lede { font-size: 11pt; margin-top: 4pt; }
  #kd-print .dim, #kd-print .label, #kd-print .cv-when, #kd-print dt { color: #666; }
  #kd-print .label, #kd-print dt { font-size: 7.5pt; letter-spacing: .14em; text-transform: uppercase; }
  #kd-print section { display: grid; gap: 7pt; padding-top: 10pt; border-top: .5pt solid #bbb; break-inside: avoid; }
  #kd-print .cv-row { display: grid; grid-template-columns: 70pt 1fr; gap: 10pt; }
  #kd-print .meta { display: grid; grid-template-columns: max-content 1fr; gap: 3pt 14pt; }
  #kd-print dd { margin: 0; }
  #kd-print a { color: inherit; text-decoration: none; }
  #kd-print button { all: unset; }
}
@media (prefers-reduced-motion: reduce) { .os { transition: none; } .os .plate.dev img { transition: none; } }
.rc-secs { display: flex; gap: 4px; margin-top: 4px; }
.rc-secs i { font: 500 10px/1 var(--mono); font-style: normal; font-variant-numeric: tabular-nums; padding: 3px 5px; min-width: 22px; color: var(--dim); background: rgba(13,13,12,.6); border-left: 2px solid #4a4740; }
.rc-secs i.p { color: #c9a2ff; border-color: #a855f7; } .rc-secs i.g { color: #7ee2a8; border-color: #22c55e; } .rc-secs i.y { color: #ffe27a; border-color: #facc15; }
.rc-secs i.old { opacity: .45; }
.rc-map polyline.p { stroke: #a855f7; opacity: 1; } .rc-map polyline.g { stroke: #22c55e; opacity: 1; } .rc-map polyline.y { stroke: #facc15; opacity: 1; }
.rc-map polyline.old { opacity: .35; }
.rc-map circle.rv { fill: #efece4; opacity: .8; }
.rc-results { position: absolute; left: 50%; top: 50%; translate: -50% -50%; min-width: 280px; padding: 14px 16px; background: rgba(13,13,12,.88); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.rc-results b { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.rc-results ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 3px; font-variant-numeric: tabular-nums; }
.rc-results li span:first-child { display: inline-block; min-width: 170px; }
.rc-results li.me { color: var(--accent); }
.games { padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; align-content: start; overflow: auto; }
.gm { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--line); background: var(--well); text-align: left; }
.gm:hover, .gm:focus-visible { border-color: var(--ink); outline: none; }
.gm-ic img { width: 40px; height: 40px; image-rendering: pixelated; margin-bottom: 4px; }
.gm b { color: var(--ink); font-weight: 500; }
.gm .dim { font-size: 11px; }

/* the small games: a toolbar, a stage, and a hint */
.gx { display: flex; flex-direction: column; overflow: hidden; }
.gx-step { font-variant-numeric: tabular-nums; }
.lo { display: grid; place-content: center; justify-items: center; gap: 14px; padding: 20px; background: var(--well); cursor: pointer; user-select: none; touch-action: manipulation; text-align: center; }
.lo-gantry { display: flex; gap: 10px; padding: 12px 14px; background: #050505; border: 1px solid var(--line); }
.lo-gantry span { display: grid; gap: 8px; }
.lo-gantry i { width: 34px; height: 34px; border-radius: 50%; background: #241c08; }
.lo-gantry span.on i { background: var(--accent); box-shadow: 0 0 14px rgba(255,176,0,.6); }
.lo-time { font-size: 44px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.lo-time.good { color: var(--accent); } .lo-time.bad { color: #e5484d; }
.lo-msg { max-width: 360px; }
.gq-stage { flex: 1; min-height: 0; position: relative; background: var(--well); }
.gq-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.gq-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); transform-origin: left; }
.gq-ask { padding: 10px 14px 0; font-weight: 500; border-top: 1px solid var(--line); }
.gq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px 12px; }
.os .gq-opt { justify-content: flex-start; height: 34px; }
.gq-opt.right { background: #22c55e; color: var(--dark); border-color: #22c55e; }
.gq-opt.wrong { border-color: #e5484d; color: #e5484d; }
.gq-opt:disabled { opacity: 1; cursor: default; }
.gq-score { font-variant-numeric: tabular-nums; color: var(--accent); }
.os.phone .gq-opts { grid-template-columns: 1fr; }
/* the arcade games: a pixel canvas blown up with hard edges, a message laid over it, and buttons for thumbs */
.ax-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; background: #050505; touch-action: none; user-select: none; -webkit-user-select: none; }
.ax-cv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.ax-over { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 16px; pointer-events: none; background: rgba(5,5,5,.55); }
.ax-over[hidden] { display: none; }
.ax-over b { font-size: 20px; font-weight: 500; color: var(--accent); }
.ax-pad { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.ax-pad .btn { flex: 1; height: 44px; justify-content: center; touch-action: none; }
.ax .ax-l, .ax .ax-r { font-variant-numeric: tabular-nums; }
/* Sound Board: the desk as a groovebox */
.sb { display: flex; flex-direction: column; overflow: auto; background: var(--well); }
.sb-deck { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.os .sb-play { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--dim); border-bottom-width: 3px; background: var(--os-bg); }
.sb-play i { width: 0; height: 0; border: 7px solid transparent; border-left: 11px solid var(--accent); border-right: 0; }
.os .sb-play.on { border-bottom-width: 1px; translate: 0 2px; } .sb-play.on i { border: 0; width: 11px; height: 11px; background: var(--accent); }
.sb-scope { width: 100%; height: 40px; border: 1px solid var(--line); }
.sb-knob { display: grid; grid-template-columns: auto 90px 36px; gap: 8px; align-items: center; font-size: 11px; color: var(--dim); }
.sb-knob input { width: 90px; accent-color: var(--accent); } .sb-knob b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.sb-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px 0; font-size: 11px; }
.sb-grid { display: grid; grid-template-columns: 150px 1fr; gap: 5px 10px; padding: 12px 14px 14px; align-content: start; }
.os .sb-row { display: flex; align-items: center; gap: 8px; text-align: left; font-size: 11px; color: var(--dim); padding: 0; }
.sb-ic { width: 24px; height: 24px; image-rendering: pixelated; flex: none; transition: transform .12s ease-out; }
.sb-row span { flex: 1; white-space: nowrap; } .sb-row kbd { opacity: .5; }
.sb-row:hover, .sb-row.hit { color: var(--ink); }
.sb-row.hit .sb-ic { animation: sb-hop .22s ease-out; } @keyframes sb-hop { 30% { transform: translateY(-4px) scale(1.12); } }
.sb-steps { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.sb-steps .sb-cell:nth-child(4n+1):not(:first-child) { margin-left: 6px; } /* beats grouped in fours */
.sb-cell { height: 24px; border: 1px solid #2a2925; border-bottom-width: 2px; background: #141412; }
.sb-cell:hover { border-color: var(--dim); }
.sb-cell.on { background: var(--ink); border-color: #b8b2a4; }
.sb-cell.now { background: #26241f; } .sb-cell.on.now { background: var(--accent); border-color: #b87a00; box-shadow: 0 0 10px rgba(255,176,0,.45); }
@media (prefers-reduced-motion: reduce) { .sb-row.hit .sb-ic { animation: none; } }
.os.phone .sb-deck { grid-template-columns: auto 1fr; } .os.phone .sb-grid { grid-template-columns: 40px 1fr; } .os.phone .sb-row span, .os.phone .sb-row kbd { display: none; } .os.phone .sb-cell { height: 20px; }
.ct-shop { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.os .ct-brew { height: auto; justify-content: center; font-size: 14px; background: var(--ink); color: var(--dark); border-color: var(--ink); }
.os .ct-brew:disabled { background: var(--panel); color: var(--dim); border-color: var(--line); }
.ct-ups { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.os .ct-up { height: auto; padding: 6px 8px; display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 0 6px; white-space: normal; }
.os .ct-up b { font-weight: 500; font-size: 11px; } .ct-up span { grid-column: 1; font-size: 10px; } .ct-up i { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; color: var(--accent); }
.os .ct-up:disabled { opacity: .45; }
.os.phone .ct-shop { grid-template-columns: 1fr; } .os.phone .ct-brew { height: 44px; }

/* ============ extras.js: the lived-in desktop ============ */
/* the sky: a faint glow at the top of the desktop in the colour of my hour */
.os-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(120% 70% at 50% -10%, var(--sky, transparent), transparent 70%); transition: background 2s; }
/* an icon stirring */
.os-icon.stir .ico:not(.inv) { animation: stir .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes stir { 30% { translate: 0 -5px; } 60% { translate: 0 0; } 75% { translate: 0 -2px; } }
/* unread letters */
.os-icon .badge { position: absolute; top: 2px; right: 18px; min-width: 18px; height: 18px; padding: 0 4px; font: 600 11px/18px var(--mono); font-style: normal; text-align: center; background: var(--accent); color: var(--dark); box-shadow: 2px 2px 0 rgba(0,0,0,.6); }

/* notifications */
.toasts { position: absolute; top: 34px; left: 50%; translate: -50% 0; z-index: 940; display: grid; gap: 8px; width: min(340px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 36px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; background: var(--panel); border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); animation: toast-in .32s cubic-bezier(.16, 1, .3, 1); }
.toast.out { opacity: 0; translate: 16px 0; transition: opacity .24s, translate .24s; }
.toast-ico .ico { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.toast p { line-height: 1.45; }
.toast-x { width: 22px; height: 22px; color: var(--dim); }
.toast-x:hover { color: var(--ink); }
@keyframes toast-in { from { opacity: 0; translate: 24px 0; } }

/* Mail */
.mail { display: grid; grid-template-columns: 240px 1fr; height: 100%; }
.mail-list { list-style: none; margin: 0; padding: 0; border-right: 1px solid var(--line); overflow-y: auto; }
.mail-list button { display: grid; gap: 2px; width: 100%; padding: 10px 12px 10px 24px; border-bottom: 1px dotted var(--line); position: relative; }
.mail-list button span { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-list button.new::before { content: ''; position: absolute; left: 9px; top: 15px; width: 7px; height: 7px; background: var(--accent); }
.mail-list button.new b { font-weight: 700; }
.mail-list button[aria-selected="true"] { background: var(--ink); color: var(--dark); }
.mail-list button[aria-selected="true"] span { color: #4a4740; }
.mail-read { overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; line-height: 1.65; }
.mail-read header { border-bottom: 1px solid var(--line); padding-bottom: 10px; display: grid; gap: 8px; }
.mail-read h3 { font-size: 16px; }
.mail-read dl { display: grid; grid-template-columns: 48px 1fr; gap: 2px 8px; margin: 0; color: var(--dim); font-size: 11px; }
.mail-read dd { margin: 0; color: var(--ink); }
.mail-read .sign { font: 400 22px/1 "Cedarville Cursive", cursive; color: #c9b48a; }
.mail-read footer { margin-top: auto; padding-top: 12px; border-top: 1px dotted var(--line); }

/* ⌘K */
.os-find kbd { margin-left: 2px; }
.kpal { position: absolute; inset: 0; z-index: 970; background: rgba(0,0,0,.35); display: grid; justify-items: center; align-items: start; padding-top: 14vh; }
.kpal-box { width: min(560px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--ink); box-shadow: 6px 6px 0 rgba(0,0,0,.6); animation: toast-in .2s ease-out; }
.kpal input { width: 100%; height: 46px; padding: 0 16px; font: 500 15px var(--mono); color: var(--ink); background: var(--well); border: 0; border-bottom: 1px solid var(--line); outline: none; }
.kpal ul { list-style: none; margin: 0; padding: 4px 0; max-height: 50vh; overflow-y: auto; }
.kpal li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px; cursor: pointer; }
.kpal li[aria-selected="true"] { background: var(--ink); color: var(--dark); }
.kpal li[aria-selected="true"] .dim { color: #4a4740; }
.kpal-box > p { padding: 8px 16px; border-top: 1px dotted var(--line); font-size: 11px; }

/* desk accessories: small fixed windows on the desktop, in the windows' own frame (striped bar, 1px ink, hard shadow) */
.accs { position: absolute; right: 126px; top: 14px; width: 232px; display: grid; gap: 16px; }
.acc { position: relative; width: 100%; background: var(--panel); border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.acc-bar { height: 22px; border-bottom: 1px solid var(--ink); background: repeating-linear-gradient(var(--ink) 0 1px, transparent 1px 3px) 5px 5px / calc(100% - 10px) 11px no-repeat; }
.acc-bar h2 { margin: 0; text-align: center; font-size: 11px; font-weight: 600; line-height: 22px; }
.acc-bar span { background: var(--panel); padding: 0 8px; }
.acc-body { padding: 10px 12px; display: grid; gap: 4px; font-size: 11px; line-height: 1.5; }
.today-row { display: grid; grid-template-columns: 76px 1fr; gap: 6px; }
.pin .acc-body { gap: 10px; }
.pin canvas { width: 100%; aspect-ratio: 16 / 9; display: block; image-rendering: pixelated; cursor: pointer; border: 1px solid var(--line); }
.pin p { display: grid; gap: 2px; }
.pin .btn { justify-self: start; }
@media (max-width: 1100px), (max-height: 560px) { .accs { display: none; } }

/* the radio: a desk accessory */
.radio-face { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.radio-ico .ico { width: 48px; height: 48px; image-rendering: pixelated; display: block; }
.radio-lcd { display: grid; gap: 3px; padding: 6px 8px; background: var(--well); border: 1px solid var(--line); }
.radio-lcd b { font-size: 12px; }
.radio-state { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.radio.on .radio-state { color: var(--accent); }
.radio-eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.radio-eq i { width: 4px; height: 2px; background: var(--dim); }
.radio.on .radio-eq i { background: var(--ink); animation: eq .55s ease-in-out infinite alternate; }
.radio.on .radio-eq i:nth-child(2) { animation-delay: -.2s; } .radio.on .radio-eq i:nth-child(3) { animation-delay: -.4s; } .radio.on .radio-eq i:nth-child(4) { animation-delay: -.1s; } .radio.on .radio-eq i:nth-child(5) { animation-delay: -.3s; }
.radio-keys { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; }
.radio-keys .btn { justify-content: center; margin: 0; }
@keyframes eq { to { height: 12px; } }

/* the desk cat, and what it says */
.pet { position: absolute; left: 0; top: 0; width: 80px; height: 50px; }
.pet-me { width: 80px; height: 50px; padding: 0; cursor: pointer; }
.pet-me canvas { width: 80px; height: 50px; image-rendering: pixelated; display: block; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.6)); }
.pet-me.hopping { animation: hop .62s linear; transform-origin: 50% 100%; }
.pet-me.wiggle { animation: wiggle .16s steps(2) infinite; transform-origin: 50% 100%; }
@keyframes hop {
  0% { transform: scale(1.1, .82); }
  15% { transform: translateY(0) scale(.92, 1.12); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  50% { transform: translateY(-74px) scale(1); animation-timing-function: cubic-bezier(.6, 0, .8, .3); }
  85% { transform: translateY(0) scale(.95, 1.06); }
  92% { transform: scale(1.14, .8); }
  100% { transform: none; }
}
@keyframes wiggle { 50% { transform: translateX(2px) rotate(-2deg); } }
/* the speech bubble: a pixel balloon with stepped corners and a staircase tail */
.pet-say { position: absolute; left: 6px; bottom: calc(100% + 14px); width: max-content; max-width: 280px; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.65)); transform-origin: 14px calc(100% + 14px); }
.pet-say.pop { animation: bubble .32s steps(4, end); }
@keyframes bubble { 0% { scale: .4; opacity: 0; } 50% { scale: 1.08; opacity: 1; } 100% { scale: 1; } }
.pet-bub { position: relative; padding: 10px 30px 12px 14px; background: var(--ink); color: var(--dark); line-height: 1.5;
  clip-path: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px)); }
.pet-who { display: block; font: 20px/1 var(--pixel); letter-spacing: .02em; color: #7a7466; margin-bottom: 3px; }
.pet-bub p { min-height: 1.5em; }
.pet-tail { position: absolute; left: 14px; top: calc(100% - 1px); width: 16px; height: 12px; background: var(--ink); clip-path: polygon(0 0, 16px 0, 16px 3px, 12px 3px, 12px 6px, 8px 6px, 8px 9px, 4px 9px, 4px 12px, 0 12px); }
.pet-say.flip { left: auto; right: 6px; transform-origin: calc(100% - 14px) calc(100% + 14px); } .pet-say.flip .pet-tail { left: auto; right: 14px; scale: -1 1; }
.pet-say.below { bottom: auto; top: calc(100% + 14px); transform-origin: 14px -14px; } .pet-say.below .pet-tail { top: auto; bottom: calc(100% - 1px); scale: 1 -1; } .pet-say.below.flip .pet-tail { scale: -1 -1; }
.pet-x { position: absolute; top: 6px; right: 8px; width: 18px; height: 18px; color: #7a7466; } .pet-x:hover { color: var(--dark); }
@media (prefers-reduced-motion: reduce) { .pet-me.hopping, .pet-me.wiggle, .pet-say.pop { animation: none; } }
.pet-z { position: absolute; left: 52px; top: -10px; font: 600 14px var(--mono); color: var(--dim); opacity: 0; pointer-events: none; }
.pet.zz .pet-z { opacity: 1; } .pet.zz .pet-z::before { content: 'z'; animation: zz 2.4s infinite; display: inline-block; }
.pet.fed::after { content: '♥'; position: absolute; left: 50px; top: -12px; font-size: 18px; color: var(--accent); animation: heart .9s ease-out forwards; pointer-events: none; }
.os.no-pet .pet { display: none; }
@keyframes zz { 0% { translate: 0 0; opacity: 0; } 30% { opacity: 1; } 100% { translate: 8px -12px; opacity: 0; } }
@keyframes heart { to { translate: 0 -22px; opacity: 0; } }

/* Visitors */
.visitors { display: grid; grid-template-columns: 1fr 250px; height: 100%; }
.vis-map { position: relative; background: #0a0a09; display: grid; place-items: center; overflow: hidden; }
.vis-map canvas { width: 100%; height: auto; max-height: 100%; display: block; }
.vis-tip { position: absolute; translate: 12px -50%; white-space: pre; pointer-events: none; padding: 4px 8px; background: var(--ink); color: var(--dark); font-size: 11px; }
.vis-side { border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.vis-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vis-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; border-bottom: 1px dotted var(--line); padding-bottom: 5px; }
.vis-side .small { margin-top: auto; font-size: 11px; line-height: 1.5; }

/* Postcard */
.postcard { display: flex; flex-direction: column; gap: 12px; padding: 14px; height: 100%; overflow: hidden; }
.pc-pick > * { min-width: 0; }
.pc-pick { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: 11px; }
.pc-photos, .pc-stamps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pc-photos button { width: 46px; height: 34px; flex: none; padding: 0; border: 1px solid var(--line); }
.pc-photos canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.pc-photos button[aria-pressed="true"], .pc-stamps button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.stamp { display: block; width: 34px; height: 40px; padding: 4px; background: #f1ece0; border: 3px dotted #0d0d0c; outline: 1px solid #f1ece0; }
.stamp .ico { width: 100%; height: 100%; image-rendering: pixelated; filter: invert(1); object-fit: contain; }
.stamp.big { width: 58px; height: 68px; justify-self: end; }
.pc-card { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 38% 1fr; background: #f1ece0; color: #0d0d0c; box-shadow: 5px 5px 0 rgba(0,0,0,.55); transition: translate .6s cubic-bezier(.5, 0, .75, 0), rotate .6s, opacity .6s .3s; }
.pc-front { padding: 12px; border-right: 1px dashed #b8b0a0; }
.pc-front { display: grid; place-items: center; min-height: 0; overflow: hidden; }
.pc-front canvas { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; }
.pc-back { display: grid; grid-template-columns: 1fr 170px; gap: 14px; padding: 14px; min-height: 0; }
.pc-back textarea { resize: none; border: 0; background: repeating-linear-gradient(transparent 0 29px, #cfc6b4 29px 30px); font: 400 22px/30px "Cedarville Cursive", cursive; color: #22357f; outline: none; padding: 0; }
.pc-right { display: flex; flex-direction: column; gap: 12px; border-left: 1px solid #cfc6b4; padding-left: 14px; }
.pc-to { font: 500 12px/1.9 var(--mono); border-bottom: 1px solid #cfc6b4; }
.pc-from { display: grid; gap: 4px; font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #6a6458; }
.pc-from input { font: 400 20px "Cedarville Cursive", cursive; color: #22357f; border: 0; border-bottom: 1px solid #cfc6b4; background: none; outline: none; padding: 2px 0; text-transform: none; letter-spacing: 0; }
.pc-card .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.pc-mark { position: absolute; right: 52px; top: 30px; padding: 8px 12px; border: 2px solid #8a2a2a; border-radius: 50%; color: #8a2a2a; font: 700 10px/1.3 var(--mono); letter-spacing: .1em; text-align: center; rotate: -14deg; opacity: 0; scale: 1.6; transition: opacity .2s, scale .25s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.pc-card.sent .pc-mark { opacity: .85; scale: 1; }
.pc-card.sent { translate: 0 -12px; rotate: -1deg; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* SECRET.PRG */
.secret .ax-stage { background: #000; }

/* phones: the apps, without the desktop's extras */
.os.phone .mail, .os.phone .visitors { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.os.phone .mail-list { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--line); }
.os.phone .vis-side { border-left: 0; border-top: 1px solid var(--line); }
.os.phone .pc-card { grid-template-columns: 1fr; } .os.phone .pc-front { display: none; } .os.phone .pc-back { grid-template-columns: 1fr; }

/* ============ workshop.js ============ */
/* Install KD.exe: a setup wizard */
.setup { display: grid; grid-template-columns: 150px 1fr; grid-template-rows: 1fr auto; height: 100%; }
.setup-side { grid-row: 1 / 3; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 16px 14px; background: repeating-linear-gradient(var(--ink) 0 1px, transparent 1px 4px); border-right: 1px solid var(--ink); }
.setup-side b, .setup-side > span:last-child { background: var(--panel); padding: 2px 6px; justify-self: start; width: max-content; }
.setup-side b { font-size: 15px; }
.setup-ico { background: var(--panel); padding: 6px; width: max-content; margin-bottom: auto; border: 1px solid var(--ink); }
.setup-ico .ico { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
.setup-main { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; line-height: 1.6; overflow-y: auto; }
.setup-main h3 { font-size: 15px; }
.setup-lic { margin: 0; padding: 10px 12px; background: var(--well); border: 1px solid var(--line); white-space: pre-wrap; font: 12px/1.6 var(--mono); max-height: 170px; overflow-y: auto; }
.setup-check, .setup-modes label, .setup-comps label { display: flex; align-items: center; gap: 8px; }
.setup-comps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setup-comps fieldset { border: 1px solid var(--line); margin: 0; padding: 8px 10px; display: grid; gap: 3px; font-size: 11px; max-height: 190px; overflow-y: auto; }
.setup-comps legend { padding: 0 4px; color: var(--dim); }
.setup-path { padding: 8px 10px; border: 1px solid var(--ink); background: var(--well); }
.setup-modes { display: grid; gap: 4px; }
.setup-bar { height: 18px; border: 1px solid var(--ink); padding: 2px; }
.setup-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 12px); transition: width .2s; }
.setup-log { margin: 0; color: var(--dim); font: 11px/1.6 var(--mono); min-height: 6.4em; white-space: pre-wrap; }
.setup-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.setup-step { margin-right: auto; font-size: 11px; }
.setup input[type="checkbox"], .setup input[type="radio"] { accent-color: var(--accent); }

/* Print: the printer slides down from the top; the paper feeds out of it and tears off */
.printer { position: absolute; inset: 0; z-index: 975; background: rgba(0,0,0,.45); display: flex; flex-direction: column; align-items: center; padding-top: 30px; }
.printer-head { width: min(700px, calc(100% - 24px)); height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--panel); border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); position: relative; z-index: 2; font-size: 11px; letter-spacing: .14em; }
.printer-head::after { content: ''; position: absolute; left: 30px; right: 30px; bottom: 6px; height: 4px; background: #000; }
.printer-led { width: 8px; height: 8px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.printer-out { width: min(640px, calc(100% - 60px)); flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin-top: -10px; }
.printer-paper { position: relative; }
.printer-paper canvas { width: 100%; height: auto; display: block; box-shadow: 4px 6px 0 rgba(0,0,0,.5); }
.printer-paper.torn { animation: tear .5s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.printer-paper.torn canvas { clip-path: polygon(0 6px, 4% 0, 8% 7px, 12% 1px, 16% 6px, 20% 0, 24% 7px, 28% 2px, 32% 6px, 36% 0, 40% 7px, 44% 1px, 48% 6px, 52% 0, 56% 7px, 60% 2px, 64% 6px, 68% 0, 72% 7px, 76% 1px, 80% 6px, 84% 0, 88% 7px, 92% 2px, 96% 6px, 100% 0, 100% 100%, 0 100%); }
.printer-btns { display: flex; gap: 8px; padding: 12px 0 16px; }
@keyframes tear { to { translate: 0 14px; rotate: -1deg; } }
@keyframes blink { 50% { opacity: 0; } }

/* Crit: a draft with notes pinned to it */
.crit { display: flex; flex-direction: column; height: 100%; }
.crit-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.crit-top p { margin-top: 2px; font-size: 11px; }
.crit-tog { display: flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; }
.crit-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 18px; background: var(--well); overflow: auto; }
.crit-board { position: relative; cursor: crosshair; line-height: 0; box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.crit-board img { max-width: 100%; max-height: calc(100% - 4px); display: block; user-select: none; }
.crit-pin { position: absolute; translate: -50% -100%; line-height: 1.4; cursor: pointer; }
.crit-pin > b { display: grid; place-items: center; width: 24px; height: 24px; background: var(--accent); color: var(--dark); font: 700 11px var(--mono); border: 1px solid var(--dark); box-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.crit-note { position: absolute; left: 30px; top: 0; width: 220px; padding: 8px 10px; background: var(--ink); color: var(--dark); text-align: left; box-shadow: 3px 3px 0 rgba(0,0,0,.6); display: none; gap: 4px; font-size: 12px; }
.crit-note em { font-style: normal; font-size: 10px; color: #6a6458; }
.crit-pin:hover .crit-note, .crit-pin.open .crit-note, .crit-pin:focus-visible .crit-note { display: grid; z-index: 3; }
.crit-board.quiet .crit-pin { display: none; }
.crit-new { position: absolute; width: 250px; padding: 10px; background: var(--panel); border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); display: grid; gap: 8px; line-height: 1.5; cursor: default; z-index: 4; translate: 12px -12px; }
.crit-new.left { translate: calc(-100% - 12px) -12px; } .crit-new.up { translate: 12px calc(-100% + 12px); } .crit-new.left.up { translate: calc(-100% - 12px) calc(-100% + 12px); }
.crit-new textarea { height: 80px; resize: none; padding: 6px 8px; font: 12px/1.5 var(--mono); color: var(--ink); background: var(--well); border: 1px solid var(--line); outline: none; }
.crit-new .row-btns { justify-content: flex-end; align-items: center; }
.crit-new .crit-msg { margin-right: auto; font-size: 11px; }
.crit-new .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.crit-dot { position: absolute; width: 10px; height: 10px; background: var(--accent); left: -17px; top: 7px; }
.crit-new.left .crit-dot { left: auto; right: -17px; }

/* the Console: cartridges on a shelf, a KD-64 and its TV */
.console { display: grid; grid-template-columns: 230px 1fr; height: 100%; }
.carts { border-right: 1px solid var(--line); padding: 12px; display: grid; align-content: start; gap: 10px; overflow-y: auto; background: var(--well); }
.cart { display: grid; grid-template-rows: 10px 1fr; height: 76px; background: #3a3833; border: 1px solid var(--ink); box-shadow: 3px 3px 0 rgba(0,0,0,.6); text-align: left; transition: translate .15s, opacity .2s; }
.cart:hover { translate: 4px 0; }
.cart.used { opacity: .25; pointer-events: none; }
.cart-ridge { background: repeating-linear-gradient(90deg, #2a2925 0 3px, #4a4740 3px 6px); border-bottom: 1px solid var(--ink); }
.cart-label { margin: 6px 10px 8px; padding: 6px 8px; background: var(--ink); color: var(--dark); display: grid; gap: 2px; }
.cart-label b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-label span { font-size: 10px; color: #6a6458; }
.cart-fly { position: fixed; z-index: 980; margin: 0; pointer-events: none; }
.kd64 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 16px; min-width: 0; min-height: 0; height: 100%; }
.kd64-tv { height: calc(100% - 96px); max-height: 440px; width: auto; max-width: 100%; aspect-ratio: 4 / 3; padding: 18px; background: #262522; border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.kd64-screen { position: relative; width: 100%; height: 100%; background: #080c0a; color: #cfeee0; font-family: VT323, var(--mono); font-size: 22px; line-height: 1.25; overflow: hidden; cursor: pointer; text-shadow: 0 0 6px rgba(160,255,210,.35); border-radius: 10px / 14px; }
.kd64-screen::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(rgba(0,0,0,.25) 0 1px, transparent 1px 3px); pointer-events: none; }
.kd64-idle, .kd64-title { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 20px; }
.kd64-idle b { font-size: 44px; letter-spacing: .1em; }
.kd64-title h3 { font: inherit; font-size: 46px; line-height: 1; }
.kd64-title p { animation: blink 1.06s steps(1) infinite; }
.kd64-title .row-btns { font-family: var(--mono); font-size: 12px; text-shadow: none; flex-wrap: wrap; justify-content: center; }
.kd64-text { padding: 26px 30px; display: grid; gap: 12px; align-content: center; height: 100%; }
.kd64-text h4 { font: inherit; font-size: 30px; }
.kd64-text dl { display: grid; grid-template-columns: 80px 1fr; gap: 2px 10px; margin: 0; }
.kd64-text dt { opacity: .6; } .kd64-text dd { margin: 0; }
.kd64-pic { position: absolute; inset: 18px 18px 34px; display: grid; place-items: center; }
.kd64-pic canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.kd64-boot { margin: 0; padding: 26px 30px; font: inherit; }
.kd64-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; }
.kd64-dots i { width: 6px; height: 6px; background: currentColor; opacity: .25; } .kd64-dots i.on { opacity: 1; }
.kd64-unit { width: min(80%, 440px); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 14px; padding: 12px 16px; margin-top: -1px; background: #33312c; border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.kd64-slot { grid-column: 1 / 3; height: 26px; background: #000; border: 1px solid #55524a; display: grid; place-items: center; padding: 0 6px; }
.kd64-slot span { font-size: 11px; color: var(--dark); background: var(--ink); padding: 0 8px; line-height: 18px; opacity: 0; transition: opacity .2s; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kd64-slot span.in { opacity: 1; }
.kd64-name { font-size: 12px; letter-spacing: .3em; color: var(--dim); }
.kd64-pad { display: flex; gap: 6px; }
.os.phone .console { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .os.phone .carts { display: flex; overflow-x: auto; } .os.phone .cart { width: 180px; flex: none; }
.os.phone .setup { grid-template-columns: 1fr; } .os.phone .setup-side { display: none; }

/* Dial-Up: a Rolodex and a rotary dial */
.dial2 { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); height: 100%; }
.rolo { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-right: 1px solid var(--line); min-width: 0; }
.rolo-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.rolo-tabs button { font-size: 11px; padding: 3px 8px; border: 1px solid var(--line); color: var(--dim); }
.rolo-tabs button[aria-selected="true"] { background: var(--ink); color: var(--dark); border-color: var(--ink); }
.rolo-stack { position: relative; flex: 1; min-height: 0; display: grid; padding-top: 12px; }
.rolo-stack > i { position: absolute; left: 12px; right: 12px; top: 0; height: 20px; background: var(--panel); border: 1px solid var(--line); }
.rolo-stack > i + i { left: 6px; right: 6px; top: 6px; border-color: var(--dim); }
.rolo-card { position: relative; background: var(--panel); border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); padding: 30px 22px 18px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto 1fr; column-gap: 16px; row-gap: 4px; transform-origin: 50% 100%; overflow: hidden; }
.rolo-tab { position: absolute; top: 0; left: 0; font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; background: var(--ink); color: var(--dark); padding: 3px 10px; }
.rolo-ico { grid-row: 1 / 3; } .rolo-ico .ico { width: 56px; height: 56px; image-rendering: pixelated; display: block; }
.rolo-card h3 { font-size: 20px; align-self: end; }
.rolo-card > p { color: var(--dim); }
.rolo-card dl { grid-column: 1 / 3; display: grid; grid-template-columns: 90px 1fr; gap: 10px; margin: 18px 0 0; padding-top: 14px; border-top: 1px dotted var(--line); align-items: baseline; align-content: start; }
.rolo-card dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.rolo-card dd { margin: 0; font-size: 13px; }
.rolo-card dd b { font: 400 34px/1 VT323, var(--mono); color: var(--accent); }
.rolo-btns { grid-column: 1 / 3; margin-top: 14px; flex-wrap: wrap; align-self: end; }
.rolo-stamp { position: absolute; right: 18px; top: 40px; padding: 6px 12px; border: 2px solid var(--accent); color: var(--accent); font: 700 13px var(--mono); letter-spacing: .16em; text-transform: uppercase; rotate: -10deg; opacity: 0; scale: 1.8; transition: opacity .2s, scale .3s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.rolo-card.connected .rolo-stamp { opacity: 1; scale: 1; }
.rolo-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.phone { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px; min-width: 0; min-height: 0; }
.phone-lcd { align-self: stretch; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--well); border: 1px solid var(--line); font: 400 22px/1 VT323, var(--mono); color: #cfeee0; letter-spacing: .06em; }
.phone-led { width: 8px; height: 8px; background: #3a3833; }
.dial2.calling .phone-led { background: var(--accent); animation: blink 1s steps(1) infinite; }
.rotary { flex: 1; min-height: 0; width: 100%; max-width: 320px; touch-action: none; user-select: none; }
.rot-base { fill: #1b1a18; stroke: var(--ink); stroke-width: 1.5; }
.rot-digit { fill: var(--ink); font: 400 26px VT323, var(--mono); text-anchor: middle; pointer-events: none; }
.rot-plate { transform-origin: 150px 150px; }
.rot-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.rot-hole { fill: rgba(0,0,0,0); stroke: var(--ink); stroke-width: 2; cursor: grab; }
.rot-hole:hover, .rot-hole:focus-visible { fill: rgba(255,176,0,.18); stroke: var(--accent); outline: none; }
.rot-hub { fill: var(--panel); stroke: var(--ink); stroke-width: 2; }
.rot-hubt { fill: var(--ink); font: 700 22px var(--mono); text-anchor: middle; pointer-events: none; }
.rot-hubs { fill: var(--dim); font: 600 8px var(--mono); letter-spacing: .12em; text-anchor: middle; pointer-events: none; }
.rot-stop { stroke: var(--accent); stroke-width: 6; stroke-linecap: square; fill: none; }
.phone-log { margin: 0; align-self: stretch; min-height: 3.6em; font: 400 18px/1.2 VT323, var(--mono); color: var(--dim); white-space: pre-wrap; text-align: center; }
.os.phone .dial2 { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; } .os.phone .rolo { border-right: 0; border-bottom: 1px solid var(--line); } .os.phone .rotary { max-width: 260px; }

/* phones: notifications sit just above the dock, out of the way of the home screen */
.os.phone .toasts { top: auto; bottom: 96px; width: calc(100% - 20px); }

/* Apex on a phone held upright: a nudge to turn it sideways (or play anyway) */
.rc-rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  .rc-rotate { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; background: rgba(13,13,12,.92); }
  .rc-rotate b { font-size: 46px; animation: turn 2.4s ease-in-out infinite; }
  .rc-rotate p { max-width: 240px; line-height: 1.5; }
}
@keyframes turn { 0%, 30% { rotate: 0deg; } 60%, 100% { rotate: 90deg; } }

/* Work and Play: the switch in the menu bar, and what Work leaves out */
.os-mode { display: flex; border: 1px solid currentColor; }
.os-mode button { padding: 1px 9px; font-size: 11px; letter-spacing: .06em; }
.os-status .os-mode button:hover { text-decoration: none; background: rgba(0,0,0,.08); }
.os-mode button[aria-pressed="true"] { background: var(--dark); color: var(--ink); }
.os-status .os-mode button[aria-pressed="true"]:hover { background: var(--dark); }
.ph-mode { margin: 12px 0 0; border-color: var(--ink); color: var(--ink); }
.ph-mode button { flex: 1; padding: 8px 0; text-align: center; font-size: 12px; }
.ph-mode button[aria-pressed="true"] { background: var(--ink); color: var(--dark); }
.os.work .pet, .os.work .acc.radio, .os.work .toasts { display: none; }

/* Work: the same machine on paper. Calm, light and editorial, for someone reading rather than playing. */
.os.work { --os-bg: #e9e5da; --panel: #f4f1e9; --well: #dfdace; --ink: #17160f; --dim: #6c675b; --soft: #3b382f; --line: #cdc7b8; --hover: #e2ddd0; --dark: #f4f1e9; }
.os.work::after { background: none; }
.os.work .os-icons { display: none; }
.os.work .ph-grid { display: none; }
.work-home { position: absolute; inset: 0; overflow: auto; padding: 44px clamp(20px, 5vw, 72px) 120px; color: var(--ink); }
.os.phone .work-home { position: static; padding: 18px 0 40px; overflow: visible; }
.wh { max-width: 1240px; margin: 0 auto; display: grid; gap: 56px; }
.wh h2 { margin: 0 0 16px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: flex; justify-content: space-between; align-items: baseline; }
.wh h2 button { font-size: 11px; letter-spacing: .06em; text-transform: none; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.wh-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; padding-bottom: 36px; border-bottom: 1px solid var(--ink); }
.wh-top h1 { margin: 6px 0 14px; font-size: clamp(34px, 5vw, 60px); line-height: .98; letter-spacing: -.035em; font-weight: 600; }
.wh-kick { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.wh-lede { font-size: 16px; line-height: 1.5; max-width: 40ch; }
.wh-bio { margin-top: 10px; color: var(--soft); line-height: 1.65; max-width: 58ch; }
.wh-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.wh-card { display: grid; gap: 10px; align-content: start; text-align: left; padding: 0; }
.wh-card .plate { border-color: var(--line); }
.wh-card:hover .plate { border-color: var(--ink); }
.wh-meta { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.wh-card h3 { font-size: 17px; margin: 0; }
.wh-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.wh-card p { color: var(--soft); line-height: 1.55; }
.wh-two { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.wh-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.wh-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.wh-list b { font-weight: 600; } .wh-list span { color: var(--dim); font-size: 11px; white-space: nowrap; }
.wh-list button { text-align: left; } .wh-list button:hover b { text-decoration: underline; text-underline-offset: 3px; }
.wh-photos { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.wh-photos button { padding: 0; aspect-ratio: 1; overflow: hidden; background: var(--well); }
.wh-photos img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1); transition: filter .3s; }
.wh-photos button:hover img { filter: none; }
@media (max-width: 760px) { .wh-top, .wh-two { grid-template-columns: 1fr; } .wh-acts { justify-content: flex-start; } .wh-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); } .wh { gap: 40px; } }
