:root {
  color-scheme: light;
  --paper: #f4efe6;
  --paper-deep: #e7dfd0;
  --ink: #1c2928;
  --muted: #5a6763;
  --line: #bdb6a8;
  --teal: #126a63;
  --teal-dark: #0c4d48;
  --signal: #d95735;
  --signal-deep: #9e3823;
  --window: #fffdf7;
  --window-shadow: rgba(28, 41, 40, 0.2);
  --focus: #f6a634;
  --console-surface: #142523;
  --console-text: #fffdf7;
  --console-command: #ffe3a7;
  --console-error: #ffd5c2;
  --radius: 5px;
  --topbar-height: 72px;
  --dock-height: 76px;
}

body[data-theme="night"] {
  color-scheme: dark;
  --paper: #15201f;
  --paper-deep: #22302e;
  --ink: #eff1e9;
  --muted: #c3c8bd;
  --line: #62716e;
  --teal: #71d1c6;
  --teal-dark: #3caa9e;
  --signal: #ff956f;
  --signal-deep: #ffd0be;
  --window: #1d2927;
  --window-shadow: rgba(0, 0, 0, 0.4);
  --focus: #ffd063;
}

body[data-theme="moss"] {
  color-scheme: light;
  --paper: #edf0e5;
  --paper-deep: #dce3cf;
  --ink: #1f3025;
  --muted: #526052;
  --line: #aab5a1;
  --teal: #426c4c;
  --teal-dark: #28523a;
  --signal: #b04e30;
  --signal-deep: #87351e;
  --window: #fbfcf7;
  --window-shadow: rgba(31, 48, 37, 0.2);
  --focus: #d98d20;
}

body[data-theme="ember"] {
  color-scheme: light;
  --paper: #fbf0e7;
  --paper-deep: #f0dbc9;
  --ink: #342420;
  --muted: #6b554d;
  --line: #c8a899;
  --teal: #2d645e;
  --teal-dark: #1d4b47;
  --signal: #c44d2d;
  --signal-deep: #91341f;
  --window: #fffaf5;
  --window-shadow: rgba(52, 36, 32, 0.2);
  --focus: #d1841f;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  padding: 0.65rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: relative;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 0.7rem 1.1rem;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.brand-lockup,
.topbar-actions,
.window-heading-row,
.window-actions,
.intro-actions,
.snapshot-actions,
.command-dialog-header {
  display: flex;
  align-items: center;
}
.desk-mode-picker select { min-height: 2.5rem; padding: 0.42rem 0.55rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--window); color: var(--ink); font: inherit; font-size: 0.82rem; font-weight: 800; }
.desk-mode-picker select:hover { border-color: var(--teal); }

.brand-lockup { gap: 0.7rem; }
.brand-mark { width: 2.25rem; height: 2.25rem; color: var(--signal); }
.eyebrow,
.window-kicker {
  margin: 0;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.brand-name { margin: 0.12rem 0 0; font-size: 1rem; font-weight: 800; }
.topbar-actions { gap: 0.55rem; }
.clock { min-width: 10.8rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.window-strip {
  display: flex;
  max-width: min(28vw, 20rem);
  gap: 0.3rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.window-strip-item,
.window-strip-empty {
  min-height: 2.25rem;
  flex: 0 0 auto;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--window);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.window-strip-item:hover,
.window-strip-item[aria-current="true"] { border-color: var(--teal); color: var(--ink); }
.window-strip-item[aria-current="true"] { background: var(--paper-deep); }
.window-strip-empty { display: grid; place-items: center; border-style: dashed; }

.quiet-button,
.primary-button,
.text-button,
.command-button,
.dock-item,
.window-action,
.command-result {
  border: 0;
  border-radius: var(--radius);
}

.quiet-button,
.text-button {
  padding: 0.58rem 0.72rem;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}
.quiet-button:hover,
.text-button:hover { background: var(--paper-deep); }

.primary-button {
  padding: 0.66rem 0.86rem;
  border: 2px solid var(--teal-dark);
  background: var(--teal);
  color: #fffdf7;
  font-weight: 800;
}
.primary-button:hover { background: var(--teal-dark); }

.command-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.56rem 0.72rem;
  border: 2px solid var(--ink);
  background: var(--window);
  color: var(--ink);
  font-weight: 800;
}
.command-button svg { width: 1rem; height: 1rem; }
kbd {
  padding: 0.12rem 0.28rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--window);
  color: var(--ink);
  font-size: 0.72em;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.desktop {
  position: relative;
  min-height: calc(100vh - var(--topbar-height) - var(--dock-height));
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--signal) 22%, transparent) 0 0.18rem, transparent 0.22rem) 0 0 / 1.7rem 1.7rem,
    radial-gradient(circle at 72% 32%, color-mix(in srgb, var(--teal) 18%, transparent) 0 0.12rem, transparent 0.16rem) 0 0 / 2.1rem 2.1rem,
    linear-gradient(135deg, color-mix(in srgb, var(--paper) 82%, var(--paper-deep)) 0%, var(--paper-deep) 100%);
  isolation: isolate;
}
.desktop::before,
.desktop::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}
.desktop::before {
  top: 1.4rem;
  right: 3rem;
  width: 12rem;
  height: 12rem;
  border: 2px solid var(--line);
  border-radius: 50%;
}
.desktop::after {
  bottom: 2rem;
  left: 27%;
  width: 6rem;
  height: 6rem;
  border: 2px solid var(--line);
  transform: rotate(15deg);
}
.desktop[data-wallpaper="custom"] {
  background-color: var(--paper-deep);
  background-image: linear-gradient(color-mix(in srgb, var(--paper-deep) 72%, transparent), color-mix(in srgb, var(--paper-deep) 72%, transparent)), var(--custom-wallpaper);
  background-position: center;
  background-size: cover;
}
.desktop-label {
  position: absolute;
  right: 1.15rem;
  bottom: 1rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.landing-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(39rem, calc(100% - 2rem));
  gap: 0.85rem;
  margin: clamp(3rem, 12vh, 8rem) auto 0;
  padding: clamp(1.35rem, 4vw, 2.4rem);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--window) 94%, transparent);
  box-shadow: 8px 9px 0 var(--window-shadow);
}
.landing-panel h1 { margin: 0; max-width: 12ch; font-size: clamp(2.25rem, 6vw, 4.9rem); letter-spacing: -0.06em; line-height: 0.9; }
.landing-panel > p:not(.window-kicker):not(.small-note) { max-width: 56ch; margin: 0; color: var(--muted); line-height: 1.55; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.desk-modes { display: grid; gap: 0.55rem; max-width: 42rem; padding: 0.85rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.desk-modes h2 { margin: 0; font-size: 1rem; }
.desk-modes .small-note { margin: 0; }
.desk-mode-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.desk-mode { display: grid; gap: 0.2rem; min-height: 4.4rem; padding: 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--window); color: var(--ink); text-align: left; font: inherit; }
.desk-mode strong { color: var(--teal-deep); font-size: 0.9rem; }
.desk-mode span { color: var(--muted); font-size: 0.75rem; line-height: 1.35; }
.desk-mode:hover { border-color: var(--teal); background: var(--paper-deep); }
.landing-recents { display: grid; gap: 0.55rem; max-width: 42rem; padding-top: 0.2rem; border-top: 1px solid var(--line); }
.landing-recents h2 { margin: 0; font-size: 1rem; }
.recent-apps { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.recent-app { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--window); color: var(--ink); font: inherit; font-size: 0.82rem; font-weight: 800; }
.recent-app:hover { border-color: var(--teal); color: var(--teal-deep); }
.recent-app-empty { margin: 0; color: var(--muted); font-size: 0.84rem; }

.os-window {
  position: absolute;
  z-index: 1;
  width: min(25rem, calc(100% - 1.5rem));
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--window);
  box-shadow: 5px 6px 0 var(--window-shadow);
  color: var(--ink);
}
.window-welcome { width: min(22rem, calc(100% - 1.5rem)); }
.window-projects { width: min(27rem, calc(100% - 1.5rem)); }
.window-notes { width: min(22rem, calc(100% - 1.5rem)); }
.window-toolbox { width: min(23rem, calc(100% - 1.5rem)); }
.window-themes { width: min(26rem, calc(100% - 1.5rem)); }
.window-notebook { width: min(24rem, calc(100% - 1.5rem)); }
.window-journal { width: min(26rem, calc(100% - 1.5rem)); }
.window-games { width: min(29rem, calc(100% - 1.5rem)); }
.window-snapshot { width: min(23rem, calc(100% - 1.5rem)); }
.window-console { width: min(31rem, calc(100% - 1.5rem)); }
.window-launchpad { width: min(24rem, calc(100% - 1.5rem)); }
.window-focus-list { width: min(25rem, calc(100% - 1.5rem)); }
.window-projects .window-body {
  max-height: min(29rem, calc(100vh - var(--topbar-height) - var(--dock-height) - 2.8rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.os-window[data-minimized="true"] .window-body { display: none; }
.os-window[hidden] { display: none; }
.os-window[data-maximized="true"] {
  top: 0.75rem !important;
  left: 0.75rem !important;
  display: flex;
  width: calc(100% - 1.5rem) !important;
  height: calc(100vh - var(--topbar-height) - var(--dock-height) - 1.5rem);
  max-height: none;
  flex-direction: column;
}
.os-window[data-maximized="true"] .window-body { flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; }
.os-window.window-projects[data-maximized="true"] .window-body { max-height: none; }

.window-titlebar {
  display: flex;
  align-items: center;
  min-height: 2.55rem;
  padding-left: 0.45rem;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: grab;
  user-select: none;
}
.window-titlebar:active { cursor: grabbing; }
.window-grip { display: inline-flex; gap: 0.16rem; margin-right: 0.5rem; }
.window-grip span { width: 0.2rem; height: 0.2rem; border-radius: 50%; background: currentColor; }
.window-icon { width: 1rem; height: 1rem; margin-right: 0.42rem; }
.window-title { flex: 1; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.window-actions { align-self: stretch; margin-left: auto; }
.window-action {
  display: grid;
  width: 2.55rem;
  height: 100%;
  place-items: center;
  border-left: 1px solid color-mix(in srgb, var(--paper) 40%, transparent);
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
}
.window-action:hover { background: color-mix(in srgb, var(--paper) 15%, transparent); }
.maximize-action { font-size: 1rem; }
.close-action:hover { background: var(--signal); color: #fffdf7; }

.window-body { padding: 1rem; }
.window-body h1,
.window-body h2 { margin: 0.28rem 0 0.62rem; color: var(--ink); letter-spacing: -0.035em; }
.window-body h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 0.98; }
.window-body h2 { font-size: 1.28rem; line-height: 1.05; }
.window-body p { line-height: 1.55; }
.intro-body > p:not(.window-kicker),
.notes-body > p:not(.window-kicker) { color: var(--muted); }
.intro-actions,
.snapshot-actions { flex-wrap: wrap; gap: 0.38rem; margin-top: 1rem; }
.small-note { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.82rem; }

.window-heading-row { align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.count-label { padding: 0.22rem 0.4rem; border: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.search-field,
.command-search { display: grid; gap: 0.32rem; margin: 0.85rem 0; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.search-field input,
.command-search input {
  width: 100%;
  padding: 0.64rem 0.68rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
.search-field input::placeholder,
.command-search input::placeholder { color: var(--muted); opacity: 0.9; }

.project-list { display: grid; gap: 0.55rem; }
.project-card { padding: 0.72rem; border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 45%, var(--window)); }
.project-card h3 { margin: 0; font-size: 1rem; }
.project-card p { margin: 0.32rem 0 0.65rem; color: var(--muted); font-size: 0.9rem; }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.project-tag { color: var(--teal); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.project-links { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.project-links a { color: var(--teal-dark); font-size: 0.78rem; font-weight: 800; }
.empty-search { margin: 0; padding: 1rem 0; color: var(--muted); }

.build-notes { display: grid; gap: 0.75rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.build-notes li { display: grid; grid-template-columns: 2.15rem 1fr; gap: 0.6rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.build-notes li:last-child { border: 0; padding-bottom: 0; }
.build-notes p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.build-notes strong { color: var(--ink); }
.note-number { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 2px solid var(--signal); color: var(--signal); font-size: 0.72rem; font-weight: 900; }

.tool-list { display: grid; gap: 0.42rem; padding: 0; margin: 0.9rem 0; list-style: none; }
.tool-list li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.tool-list span { color: var(--muted); font-size: 0.82rem; }
.tool-list strong { font-size: 0.88rem; text-align: right; }

.writing-body { display: grid; gap: 0.72rem; }
.writing-body h2 { margin-bottom: 0; }
.writing-body .writing-intro { margin: 0; }
.writing-field {
  display: grid;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}
.writing-field input,
.writing-field textarea {
  width: 100%;
  padding: 0.64rem 0.68rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}
.writing-field textarea { min-height: 8rem; resize: vertical; }
.writing-field input::placeholder,
.writing-field textarea::placeholder { color: var(--muted); opacity: 0.9; }
.writing-actions,
.voice-controls,
.confirm-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.speech-language { display: grid; gap: 0.28rem; color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.speech-language select { min-height: 2.45rem; padding: 0.36rem 0.45rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.writing-actions { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 0.72rem; }
.save-status { flex: 1 1 12rem; margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.danger-button {
  padding: 0.58rem 0.72rem;
  border: 2px solid var(--signal-deep);
  border-radius: var(--radius);
  background: var(--signal);
  color: #fffdf7;
  font-weight: 800;
}
.danger-button:hover { background: var(--signal-deep); }

.theme-body { display: grid; gap: 0.72rem; }
.theme-body h2 { margin-bottom: 0; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.theme-choice {
  display: grid;
  grid-template-columns: 1.55rem 1fr;
  column-gap: 0.46rem;
  align-items: center;
  padding: 0.58rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}
.theme-choice:hover,
.theme-choice[aria-pressed="true"] { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, var(--paper)); }
.theme-choice strong { font-size: 0.84rem; }
.theme-choice small { grid-column: 2; color: var(--muted); font-size: 0.7rem; }
.theme-swatch { grid-row: span 2; width: 1.45rem; height: 1.45rem; border: 1px solid var(--line); border-radius: 50%; }
.swatch-paper { background: #f4efe6; }
.swatch-night { background: #15201f; }
.swatch-moss { background: #426c4c; }
.swatch-ember { background: #c44d2d; }
.wallpaper-field { display: grid; gap: 0.32rem; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.wallpaper-field input { width: 100%; color: var(--ink); font-size: 0.78rem; }
.theme-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.games-body { display: grid; gap: 0.8rem; }
.games-body h2 { margin-bottom: 0; }
.game-tabs { display: flex; gap: 0.35rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.game-tabs button { padding: 0.48rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--ink); font-weight: 800; }
.game-tabs button[aria-selected="true"] { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, var(--paper)); }
.game-card {
  display: grid;
  gap: 0.62rem;
  padding: 0.78rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 45%, var(--window));
}
.game-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}
.game-label {
  margin: 0;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.game-heading h3 { margin: 0.2rem 0 0; font-size: 1rem; }
.game-score {
  flex: 0 0 auto;
  padding: 0.22rem 0.4rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.game-status {
  min-height: 2.9rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.game-actions { display: flex; flex-wrap: wrap; gap: 0.48rem; }
.desk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.42rem; }
.desk-grid-card {
  display: grid;
  min-height: 2.75rem;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
}
.desk-grid-card:hover:not(:disabled) { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, var(--paper)); }
.desk-grid-card[data-revealed="true"] { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 16%, var(--paper)); }
.desk-grid-card[data-matched="true"] { border-color: var(--signal); color: var(--signal-deep); opacity: 1; }

.console-body { display: grid; gap: 0.72rem; }
.console-body h2 { margin-bottom: 0; }
.console-boundary {
  margin: 0;
  padding: 0.68rem;
  border-left: 4px solid var(--signal);
  background: color-mix(in srgb, var(--signal) 9%, var(--paper));
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.45;
}
.console-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.5rem; }
.console-field { display: grid; gap: 0.32rem; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.console-field input {
  width: 100%;
  padding: 0.64rem 0.68rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.console-output {
  display: grid;
  gap: 0.38rem;
  min-height: 7rem;
  max-height: 12rem;
  overflow: auto;
  padding: 0.7rem;
  border: 2px solid var(--ink);
  background: var(--console-surface);
  color: var(--console-text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}
.console-output p { margin: 0; }
.console-output .console-input-line { color: var(--console-command); }
.console-output .console-error { color: var(--console-error); }
.console-output code { color: inherit; font: inherit; }
.console-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }
.console-actions .small-note { margin: 0; }

.launchpad-body { display: grid; gap: 0.72rem; }
.launchpad-body h2 { margin-bottom: 0; }
.launchpad-body > .small-note { margin: 0; }
.launchpad-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.42rem; }
.launchpad-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.38rem;
  padding: 0.58rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}
.launchpad-links a:hover { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, var(--paper)); }
.streak-card { display: grid; gap: 0.45rem; padding: 0.76rem; border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 45%, var(--window)); }
.streak-card h3 { margin: 0.2rem 0 0; font-size: 1rem; }
.streak-count { justify-self: start; padding: 0.25rem 0.45rem; border: 2px solid var(--signal); color: var(--signal-deep); font-size: 0.8rem; font-weight: 900; }
.streak-card .small-note { margin: 0; }

.focus-list-body { display: grid; gap: 0.72rem; }
.focus-list-body h2,
.focus-list-body > .small-note { margin: 0; }
.focus-list-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.5rem; }
.focus-list-form .primary-button { min-height: 2.7rem; }
.focus-list-items { display: grid; gap: 0.42rem; padding: 0; margin: 0; list-style: none; }
.focus-list-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 0.58rem; border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 45%, var(--window)); }
.focus-list-item input { width: 1.05rem; height: 1.05rem; accent-color: var(--teal); }
.focus-list-item span { overflow-wrap: anywhere; line-height: 1.35; }
.focus-list-item[data-done="true"] span { color: var(--muted); text-decoration: line-through; }
.focus-list-item button { padding: 0.28rem 0.42rem; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--ink); font-size: 0.76rem; font-weight: 800; }
.focus-list-item button:hover { border-color: var(--signal); color: var(--signal-deep); }

.dock {
  position: relative;
  z-index: 900;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: var(--dock-height);
  gap: 0.25rem;
  padding: 0.45rem;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}
.dock-item {
  display: grid;
  min-width: 4.4rem;
  min-height: 4rem;
  place-items: center;
  gap: 0.17rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
}
.dock-item svg { width: 1.45rem; height: 1.45rem; color: var(--teal); }
.dock-item:hover,
.dock-item[aria-pressed="true"] { background: var(--paper-deep); }

.command-dock {
  width: min(34rem, calc(100vw - 2rem));
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--window);
  color: var(--ink);
  box-shadow: 8px 9px 0 var(--window-shadow);
}
.command-dock::backdrop { background: rgba(20, 30, 29, 0.46); }
.command-dialog-header { justify-content: space-between; padding: 0.85rem 0.95rem; border-bottom: 2px solid var(--ink); background: var(--ink); color: var(--paper); }
.command-dialog-header .window-kicker { color: var(--focus); }
.command-dialog-header h2 { margin: 0.18rem 0 0; font-size: 1.1rem; }
.command-search { margin: 1rem; }
.command-results { display: grid; gap: 0.3rem; max-height: 18rem; padding: 0 1rem 1rem; overflow: auto; }
.command-result { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0.72rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-align: left; }
.command-result:hover,
.command-result[data-active="true"] { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, var(--paper)); }
.command-result small { color: var(--muted); }
.dialog-help { margin: 0; padding: 0.75rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.76rem; }

.confirm-dialog {
  width: min(28rem, calc(100vw - 2rem));
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--window);
  color: var(--ink);
  box-shadow: 8px 9px 0 var(--window-shadow);
}
.confirm-dialog::backdrop { background: rgba(20, 30, 29, 0.46); }
.confirm-dialog-body { padding: 1.1rem; }
.confirm-dialog-body h2 { margin: 0.3rem 0 0.55rem; letter-spacing: -0.03em; }
.confirm-dialog-body > p:not(.window-kicker) { color: var(--muted); line-height: 1.5; }
.confirm-actions { justify-content: flex-end; margin-top: 1rem; }

@media (max-width: 860px) {
  .topbar { align-items: flex-start; gap: 0.75rem; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .clock { min-width: 0; }
  .command-button kbd { display: none; }
  .window-strip { display: none; }
  .dock { overflow-x: auto; justify-content: flex-start; }
  .dock-item { flex: 0 0 auto; min-width: 4.8rem; }
}

@media (max-width: 767px) {
  body { overflow: auto; }
  .topbar { position: sticky; top: 0; min-height: auto; }
  .brand-lockup { align-items: flex-start; }
  .topbar-actions { justify-content: flex-start; }
  .clock { width: 100%; text-align: left; }
  .desktop { display: grid; min-height: auto; gap: 0.8rem; padding: 0.8rem 0.75rem; overflow: visible; }
  .desktop::before { top: 1rem; right: 1rem; width: 7rem; height: 7rem; }
  .desktop::after { display: none; }
  .desktop-label { display: none; }
  .landing-panel { width: 100%; margin: 0; }
  .os-window { position: relative !important; top: auto !important; left: auto !important; width: 100% !important; box-shadow: 3px 4px 0 var(--window-shadow); }
  .os-window[data-maximized="true"] { height: auto; }
  .window-projects .window-body { max-height: none; overflow: visible; }
  .window-titlebar { cursor: default; }
  .dock { position: sticky; bottom: 0; }
}

@media (max-width: 520px) {
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; }
  .command-button { margin-left: auto; }
  .window-heading-row { flex-direction: column; }
  .project-meta { align-items: flex-start; flex-direction: column; }
  .theme-grid { grid-template-columns: 1fr; }
  .game-heading { align-items: flex-start; flex-direction: column; }
  .desk-grid { gap: 0.36rem; }
  .console-form { grid-template-columns: 1fr; }
  .console-form .primary-button { justify-self: start; }
  .launchpad-links { grid-template-columns: 1fr; }
  .focus-list-form { grid-template-columns: 1fr; }
  .focus-list-form .primary-button { justify-self: start; }
  .desk-mode-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body[data-performance-mode="true"] *,
body[data-performance-mode="true"] *::before,
body[data-performance-mode="true"] *::after {
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
}
