/* KmicOS '97 — system chrome: tokens, bevels, desktop, taskbar, Start menu, windows, boot, CRT, mobile. */
:root {
  --chrome: #d4cfc0;
  --chrome-hi: #fffcf2;
  --chrome-mid: #ebe6d6;
  --chrome-lo: #8b8574;
  --chrome-dk: #1f1d19;
  --paper: #fbf8ee;
  --ink: #141310;
  --muted: #5b5649;
  --teal: #0f6f6c;
  --teal-dk: #083f3d;
  --gold: #f2b705;
  --green: #0b6e4f;
  --red: #c1121f;
  --black: #111111;
  --phosphor: #39ff14;
  --sel: #0b6e4f;
  --sel-ink: #ffffff;
  --title-a: #062f24;
  --title-b: #0b6e4f;
  --title-c: #13a37a;
  --font-ui: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --font-px: 'VT323', 'IBM Plex Mono', monospace;
  --taskbar-h: 40px;
  --ease-pop: cubic-bezier(.2, 1.4, .4, 1);
  --kente: repeating-linear-gradient(90deg, var(--gold) 0 10px, var(--black) 10px 12px, var(--green) 12px 20px, var(--gold) 20px 24px, var(--red) 24px 32px, var(--black) 32px 34px);
  --bevel-out: inset -1px -1px var(--chrome-dk), inset 1px 1px var(--chrome-hi), inset -2px -2px var(--chrome-lo), inset 2px 2px var(--chrome-mid);
  --bevel-in: inset -1px -1px var(--chrome-hi), inset 1px 1px var(--chrome-lo), inset -2px -2px var(--chrome-mid), inset 2px 2px var(--chrome-dk);
  --bevel-field: inset -1px -1px var(--chrome-hi), inset 1px 1px var(--chrome-lo), inset -2px -2px var(--chrome-mid), inset 2px 2px var(--chrome-dk);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #050505;
  color: var(--ink);
  font: 13px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 20000; padding: 8px 12px; background: var(--gold); color: var(--ink); font-weight: 700; }
.skip-link:focus { top: 8px; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--teal); color: #fff; font-size: 18px; }

:focus { outline: none; }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
.desktop :focus-visible, .taskbar :focus-visible, .term-body :focus-visible { outline-color: var(--gold); }

/* ---------- bevel primitives ---------- */
.bevel { background: var(--chrome); box-shadow: var(--bevel-out); }
.field { background: var(--paper); box-shadow: var(--bevel-field); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 30px; padding: 4px 14px;
  background: var(--chrome); color: var(--ink);
  border: 0; border-radius: 0; box-shadow: var(--bevel-out);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--chrome-mid); }
.btn:active, .btn[aria-pressed="true"] { box-shadow: var(--bevel-in); padding: 5px 13px 3px 15px; }
.btn:focus-visible { outline: 1px dotted var(--ink); outline-offset: -6px; }
.btn:disabled { color: var(--chrome-lo); text-shadow: 1px 1px var(--chrome-hi); cursor: default; }
.btn-primary { box-shadow: 0 0 0 1px var(--ink), var(--bevel-out); font-weight: 700; }
.btn-primary:active { box-shadow: 0 0 0 1px var(--ink), var(--bevel-in); }
.btn-sq { min-width: 30px; padding: 4px 8px; }
.btn-link { box-shadow: none; background: none; text-decoration: underline; padding: 4px 6px; }
.btn-link:active { box-shadow: none; }
.input { width: 100%; min-height: 32px; padding: 5px 8px; border: 0; border-radius: 0; }
.input[aria-invalid="true"] { box-shadow: var(--bevel-field), 0 0 0 2px var(--red); }
.input:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }

/* ---------- OS + desktop ---------- */
.os { position: fixed; inset: 0; }
.desktop {
  position: absolute; inset: 0 0 var(--taskbar-h) 0; overflow: hidden;
  background-color: var(--teal);
  background-image:
    radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(0, 0, 0, .38) 100%),
    linear-gradient(45deg, rgba(242, 183, 5, .07) 25%, transparent 25% 75%, rgba(242, 183, 5, .07) 75%),
    repeating-linear-gradient(90deg, transparent 0 40px, rgba(242, 183, 5, .13) 40px 52px, rgba(17, 17, 17, .22) 52px 56px, rgba(193, 18, 31, .14) 56px 64px, rgba(17, 17, 17, .22) 64px 68px, rgba(242, 183, 5, .13) 68px 80px, transparent 80px 160px),
    repeating-linear-gradient(0deg, transparent 0 64px, rgba(11, 110, 79, .35) 64px 76px, rgba(242, 183, 5, .10) 76px 80px, transparent 80px 160px);
  background-size: 100% 100%, 32px 32px, 160px 160px, 160px 160px;
}
.wallpaper-hero {
  position: absolute; right: clamp(16px, 4vw, 64px); bottom: clamp(16px, 4vh, 48px);
  text-align: right; pointer-events: none; user-select: none;
  color: var(--paper);
}
.wh-kicker { margin: 0; font: 22px/1 var(--font-px); letter-spacing: .12em; color: var(--gold); text-transform: uppercase; }
.wh-title {
  margin: 0; font: clamp(96px, 15vw, 230px)/.82 var(--font-px); letter-spacing: -.02em;
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--black), 12px 12px 0 rgba(0, 0, 0, .25);
}
.wh-title span { color: var(--gold); }
.wh-sub { margin: 10px 0 0; font: 26px/1 var(--font-px); color: var(--phosphor); text-shadow: 0 0 8px rgba(57, 255, 20, .6); }

.desktop-icons {
  position: absolute; inset: 10px auto 10px 8px; z-index: 1;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 88px); grid-auto-columns: 96px;
  gap: 4px; margin: 0; padding: 0; list-style: none;
}
.icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 92px; padding: 6px 2px; border: 0; background: none; cursor: pointer;
  color: #fff; text-decoration: none; text-align: center;
}
.icon-art { display: grid; place-items: center; width: 44px; height: 44px; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .45)); }
.icon-label { padding: 1px 4px; font-size: 12px; line-height: 1.25; text-shadow: 1px 1px 0 #000; }
.icon:hover .icon-art { transform: translateY(-2px); }
.icon:focus-visible { outline: none; }
.icon:focus-visible .icon-label, .icon:active .icon-label { background: var(--sel); outline: 1px dotted var(--gold); text-shadow: none; }
.icon:focus-visible .icon-art, .icon:active .icon-art { filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .45)) sepia(.6) hue-rotate(90deg); }
.icon-art { transition: transform .15s; }
.px-icon { image-rendering: pixelated; flex: none; }

/* ---------- windows ---------- */
.windows { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.win {
  position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column;
  min-width: 280px; min-height: 180px; max-width: 100%; max-height: 100%;
  padding: 3px;
  background: var(--chrome);
  box-shadow: var(--bevel-out), 8px 10px 0 rgba(0, 0, 0, .28);
  resize: both; overflow: hidden;
  pointer-events: auto;
  transform-origin: 50% 40%;
}
.win:focus-visible { outline: 2px dashed var(--gold); outline-offset: 2px; }
.win.is-max { translate: 0 0 !important; width: 100% !important; height: 100% !important; resize: none; box-shadow: var(--bevel-out); }
.win.is-dragging { opacity: .92; }
.win.is-opening { animation: win-in .24s var(--ease-pop) both; }
.win.is-leaving { animation: win-out .18s ease-in both; pointer-events: none; }
.win.is-flying { animation: win-fly 1.6s ease-in-out; }
@keyframes win-in { from { scale: .55; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes win-out { to { scale: .7; opacity: 0; } }
@keyframes win-fly { 30% { rotate: -6deg; transform: translate(-40px, -30px); } 60% { rotate: 8deg; transform: translate(60px, -90px) scale(.9); } }

.win-bar {
  display: flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 3px 0 6px;
  background: linear-gradient(90deg, #6f6a5c, #a39d8b);
  color: var(--chrome-mid);
  cursor: default; touch-action: none; user-select: none;
}
.win.is-active .win-bar { background: linear-gradient(90deg, var(--title-a), var(--title-b) 55%, var(--title-c)); color: #fff; }
.win-title-text { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.win-ctrls { display: flex; gap: 2px; }
.win-ctrl {
  display: grid; place-items: center; width: 24px; height: 21px; padding: 0;
  border: 0; background: var(--chrome); box-shadow: var(--bevel-out); cursor: pointer;
}
.win-ctrl:active { box-shadow: var(--bevel-in); }
.win-ctrl:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }
.win-ctrl:last-child { margin-left: 3px; }
.glyph { position: relative; display: block; width: 10px; height: 9px; }
.glyph-min::after { content: ''; position: absolute; left: 1px; right: 1px; bottom: 0; height: 2px; background: var(--ink); }
.glyph-max { box-shadow: inset 0 2px var(--ink), inset 0 0 0 1px var(--ink); }
.glyph-restore::before, .glyph-restore::after { content: ''; position: absolute; width: 7px; height: 6px; box-shadow: inset 0 2px var(--ink), inset 0 0 0 1px var(--ink); background: var(--chrome); }
.glyph-restore::before { right: 0; top: 0; }
.glyph-restore::after { left: 0; bottom: 0; }
.glyph-close::before, .glyph-close::after { content: ''; position: absolute; left: 0; top: 3.5px; width: 10px; height: 2px; background: var(--ink); rotate: 45deg; }
.glyph-close::after { rotate: -45deg; }
.kente-rule { height: 4px; margin: 2px 0 0; background: var(--kente); background-size: 34px 100%; }
.win:not(.is-active) .kente-rule { filter: grayscale(1) opacity(.5); }
.win-body { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 10px; }

/* ---------- taskbar ---------- */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9000;
  display: flex; align-items: center; gap: 4px;
  height: var(--taskbar-h); padding: 4px 4px 3px;
  background: var(--chrome);
  box-shadow: inset 0 1px var(--chrome-mid), inset 0 2px var(--chrome-hi);
}
.start { gap: 7px; height: 32px; padding: 2px 10px 2px 6px; font-weight: 700; }
.start[aria-expanded="true"] { box-shadow: var(--bevel-in); }
.start-text { font-size: 14px; letter-spacing: -.01em; }
.start-text b { color: var(--green); }
.start-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; transform: skewY(-8deg); }
.start-logo i { width: 9px; height: 8px; background: var(--gold); }
.start-logo i:nth-child(2) { background: var(--green); }
.start-logo i:nth-child(3) { background: var(--red); }
.start-logo i:nth-child(4) { background: var(--black); }
.quick { display: flex; gap: 2px; padding: 0 6px; border-left: 2px groove var(--chrome-hi); border-right: 2px groove var(--chrome-hi); }
.quick-btn, .tray-bag {
  position: relative; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 4px;
  border: 0; background: none; cursor: pointer;
}
.quick-btn:hover, .tray-bag:hover { box-shadow: var(--bevel-out); }
.quick-btn:active, .tray-bag:active { box-shadow: var(--bevel-in); }
.q-label { display: none; }
.quick-mobile { display: none; }
.tasks { display: flex; flex: 1; gap: 4px; min-width: 0; overflow: hidden; }
.task {
  display: flex; align-items: center; gap: 6px; flex: 0 1 180px; min-width: 40px; height: 30px; padding: 0 8px;
  border: 0; background: var(--chrome); box-shadow: var(--bevel-out); cursor: pointer; text-align: left;
}
.task-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.task.is-active {
  box-shadow: var(--bevel-in); font-weight: 700;
  background: repeating-conic-gradient(var(--chrome-hi) 0 25%, var(--chrome) 0 50%) 0 0 / 2px 2px;
}
.tray { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 4px; box-shadow: var(--bevel-field); background: var(--chrome); }
.bag-count {
  position: absolute; top: -3px; right: -6px; min-width: 18px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; font: 16px/16px var(--font-px); text-align: center;
  box-shadow: 1px 1px 0 var(--ink);
}
.bag-count.is-zero { background: var(--chrome-lo); }
.tray-bag.is-bump .bag-count { animation: bump .5s var(--ease-pop); }
@keyframes bump { 30% { transform: scale(1.6) rotate(-8deg); } }
.clock { min-width: 44px; font-size: 12px; text-align: right; }

/* ---------- Start menu ---------- */
.menu { margin: 0; padding: 3px; list-style: none; }
.start-menu {
  position: absolute; left: 2px; bottom: calc(var(--taskbar-h) - 2px); z-index: 9500;
  width: 270px; padding-left: 34px;
}
.start-menu::before {
  content: "KmicOS '97"; position: absolute; left: 3px; top: 3px; bottom: 3px; width: 28px;
  display: flex; align-items: center; justify-content: flex-end; padding: 10px 0;
  background: linear-gradient(0deg, var(--title-a), var(--green) 50%, var(--gold));
  color: #fff; font: 26px/1 var(--font-px); letter-spacing: .06em;
  writing-mode: vertical-rl; rotate: 180deg;
}
.menu-li { position: relative; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 4px 10px 4px 6px;
  border: 0; background: none; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible, .menu-item[aria-expanded="true"] { background: var(--sel); color: var(--sel-ink); outline: none; }
.menu-label { flex: 1; }
.menu-arrow { font-size: 9px; }
.menu-check { width: 20px; text-align: center; font-weight: 700; visibility: hidden; }
[aria-checked="true"] > .menu-check { visibility: visible; }
.menu-sep { height: 2px; margin: 4px 2px; border-top: 1px solid var(--chrome-lo); border-bottom: 1px solid var(--chrome-hi); }
.submenu { position: absolute; left: calc(100% - 4px); top: -3px; z-index: 2; display: none; width: 220px; }
.menu-item[aria-expanded="true"] + .submenu { display: block; }

/* ---------- balloon + Kofi ---------- */
.balloon {
  position: absolute; right: 8px; bottom: calc(var(--taskbar-h) + 10px); z-index: 9400;
  max-width: min(340px, calc(100vw - 16px)); padding: 10px 12px;
  background: #fffbd8; box-shadow: 0 0 0 1px var(--ink), 4px 4px 0 rgba(0, 0, 0, .3);
}
.balloon::after { content: ''; position: absolute; right: 34px; bottom: -9px; width: 14px; height: 14px; background: #fffbd8; box-shadow: 1px 1px 0 var(--ink); rotate: 45deg; }
.balloon.is-in { animation: pop-in .3s var(--ease-pop); }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }

.kofi { position: absolute; right: 18px; bottom: calc(var(--taskbar-h) + 14px); z-index: 9300; display: flex; align-items: flex-end; gap: 6px; animation: pop-in .4s var(--ease-pop); }
.kofi-bubble { position: relative; width: 270px; padding: 12px; margin-bottom: 70px; background: #fffbd8; box-shadow: 0 0 0 1px var(--ink), 5px 5px 0 rgba(0, 0, 0, .3); }
.kofi-bubble::after { content: ''; position: absolute; right: -9px; bottom: 22px; width: 14px; height: 14px; background: #fffbd8; box-shadow: 1px -1px 0 var(--ink); rotate: 45deg; }
.kofi-name { margin: 0 0 4px; font-weight: 700; color: var(--green); }
.kofi-tip { margin: 0 0 10px; }
.kofi-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.kofi-actions .btn { min-height: 26px; padding: 2px 8px; font-size: 12px; }
.kofi-clip { flex: none; filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, .35)); animation: kofi-bob 2.4s ease-in-out infinite; }
.kofi-pupil { animation: kofi-look 5s steps(1) infinite; }
@keyframes kofi-bob { 50% { transform: translateY(-5px) rotate(-3deg); } }
@keyframes kofi-look { 40% { transform: translate(-5px, -2px); } 70% { transform: translate(0, 0); } }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 12000; overflow: hidden; background: #000; color: #c7c7c7; font: 22px/1.15 var(--font-px); cursor: pointer; transition: opacity .45s ease, transform .45s ease; }
.boot.is-done { opacity: 0; transform: scale(1.04); pointer-events: none; }
.bios { padding: clamp(16px, 4vw, 48px); animation: crt-on .9s ease-out both, rgb-flicker 2.6s steps(2) 1; text-shadow: -1.5px 0 rgba(255, 30, 80, .55), 1.5px 0 rgba(30, 220, 255, .5); }
.boot.is-splash .bios { display: none; }
.bios-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bios-head { flex-direction: row-reverse; }
.bios-brand { margin: 0; color: var(--phosphor); font-size: 34px; line-height: .9; }
.bios-brand small { font-size: 18px; color: #9adf8c; }
.bios-badge { display: grid; grid-template-columns: repeat(2, 26px); gap: 4px; transform: skewY(-10deg); }
.bios-badge span { height: 22px; background: var(--gold); }
.bios-badge span:nth-child(2) { background: var(--green); }
.bios-badge span:nth-child(3) { background: var(--red); }
.bios-badge span:nth-child(4) { background: #444; }
.bios-log { min-height: 11em; margin-top: 18px; }
.bios-log p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.progress { position: relative; height: 22px; overflow: hidden; padding: 3px; }
.progress-fill {
  height: 100%; transform: scaleX(0); transform-origin: left;
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, transparent 12px 15px);
  transition: transform .6s steps(12, end);
}
.bios-progress { max-width: 520px; margin-top: 18px; box-shadow: inset 0 0 0 2px #555; }
.bios-progress .progress-fill { background: repeating-linear-gradient(90deg, var(--phosphor) 0 14px, transparent 14px 18px); transition-duration: .8s; }
.bios-gate { margin: 22px 0 0; color: var(--phosphor); text-shadow: 0 0 8px rgba(57, 255, 20, .7); font-size: 26px; }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.boot-skip { position: absolute; right: 16px; bottom: 16px; padding: 6px 12px; border: 1px solid #555; background: #000; color: #9a9a9a; font: 20px var(--font-px); cursor: pointer; }
.boot-skip:hover, .boot-skip:focus-visible { color: var(--phosphor); border-color: var(--phosphor); outline: none; }
.splash { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: radial-gradient(circle at 50% 45%, #0f6f6c, #031c1b 75%); animation: splash-in .5s ease-out both; }
.splash-flag { display: grid; grid-template-columns: repeat(2, 56px); gap: 6px; transform: skewY(-10deg); animation: flag-wave 1.6s ease-in-out infinite; }
.splash-flag span { height: 48px; background: var(--gold); }
.splash-flag span:nth-child(2) { background: var(--green); box-shadow: inset 0 0 0 2px #0d8a64; }
.splash-flag span:nth-child(3) { background: var(--red); }
.splash-flag span:nth-child(4) { background: var(--black); }
.splash-name { margin: 8px 0 0; color: #fff; font: clamp(72px, 12vw, 140px)/.85 var(--font-px); text-shadow: 4px 4px 0 var(--black); }
.splash-name b { color: var(--gold); font-weight: 400; }
.splash-name sup { font-size: .35em; color: var(--phosphor); }
.splash-tag { margin: 0; color: var(--chrome); font: 24px var(--font-px); letter-spacing: .08em; }
.splash-bar { position: relative; width: 220px; height: 16px; margin-top: 14px; overflow: hidden; box-shadow: var(--bevel-field); background: #021312; }
.splash-bar span { position: absolute; inset: 3px auto 3px 0; width: 56px; background: repeating-linear-gradient(90deg, var(--gold) 0 10px, transparent 10px 14px); animation: slide 1.1s linear infinite; }
@keyframes slide { from { transform: translateX(-60px); } to { transform: translateX(230px); } }
@keyframes splash-in { from { opacity: 0; filter: brightness(3); } }
@keyframes flag-wave { 50% { transform: skewY(-4deg) translateY(-4px); } }
@keyframes crt-on { 0% { transform: scale(1, .004); filter: brightness(5); opacity: 0; } 40% { transform: scale(1, .004); opacity: 1; } 70% { transform: scale(1, 1.03); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
@keyframes rgb-flicker { 0%, 100% { opacity: 1; } 8% { opacity: .82; } 12% { opacity: 1; } 47% { opacity: .9; } 50% { opacity: 1; } }

/* ---------- CRT overlay ---------- */
.crt {
  position: fixed; inset: 0; z-index: 15000; pointer-events: none;
  border-radius: 26px / 20px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .13) 0 1px, transparent 1px 3px),
    radial-gradient(130% 110% at 50% 50%, transparent 58%, rgba(0, 0, 0, .42) 100%);
  box-shadow: 0 0 0 40px #050505, inset 0 0 90px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .05);
  animation: crt-breathe 7s ease-in-out infinite;
}
.crt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, .06), transparent 30%); }
@keyframes crt-breathe { 50% { opacity: .86; } }
.no-crt .crt { display: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .crt { animation: none; }
  .kofi-clip, .kofi-pupil, .caret { animation: none !important; }
}

/* ---------- KmicOS Mobile (< 768px) ---------- */
@media (max-width: 767px) {
  :root { --taskbar-h: 64px; }
  body { font-size: 14px; }
  .crt { border-radius: 0; box-shadow: inset 0 0 60px rgba(0, 0, 0, .3); }
  .desktop { background-size: 100% 100%, 24px 24px, 120px 120px, 120px 120px; }
  .wallpaper-hero { left: 16px; right: 16px; top: 18px; bottom: auto; text-align: left; }
  .wh-title { font-size: clamp(76px, 26vw, 120px); text-shadow: 3px 3px 0 var(--red), 6px 6px 0 var(--black); }
  .wh-kicker { font-size: 18px; }
  .wh-sub { font-size: 20px; margin-top: 6px; }
  .desktop-icons {
    inset: auto 0 0 0; top: clamp(170px, 38vw, 200px); padding: 8px 16px 16px;
    grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); grid-auto-columns: auto;
    align-content: start; gap: 6px; overflow-y: auto;
  }
  .icon { width: 100%; padding: 8px 0; }
  .icon-art { width: 52px; height: 52px; padding: 6px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12); }
  .icon-art .px-icon { width: 40px; height: 40px; }

  .taskbar { gap: 0; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); box-shadow: inset 0 2px var(--chrome-hi), 0 -2px 0 var(--chrome-dk); }
  .start, .quick-btn, .tray-bag {
    flex: 1 1 0; min-width: 0; height: 54px; flex-direction: column; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 2px;
  }
  .start { box-shadow: none; background: none; }
  .start[aria-expanded="true"] { box-shadow: var(--bevel-in); }
  .start-text { font-size: 11px; }
  .quick { display: contents; }
  .quick-mobile { display: flex; }
  .q-label { display: block; font-size: 11px; line-height: 1; }
  .tasks, .clock { display: none; }
  .tray { display: contents; }
  .bag-count { top: 2px; right: calc(50% - 22px); }

  .windows { inset: 0; }
  .win, .win.is-max {
    position: fixed; inset: 6px 0 var(--taskbar-h) 0;
    width: auto !important; height: auto !important; min-width: 0; translate: none !important;
    resize: none; box-shadow: var(--bevel-out), 0 -6px 0 rgba(0, 0, 0, .25);
  }
  .win.is-opening { animation: sheet-in .28s cubic-bezier(.2, .9, .3, 1) both; }
  .win.is-leaving { animation: sheet-out .2s ease-in both; }
  .win-bar { height: 40px; }
  .win-ctrl { width: 36px; height: 30px; }
  .win-ctrl[aria-label="Maximise"], .win-ctrl[aria-label="Restore"] { display: none; }
  .win-body { padding: 10px; }

  .start-menu { left: 0; right: 0; width: auto; bottom: var(--taskbar-h); max-height: calc(100% - var(--taskbar-h) - 20px); overflow-y: auto; }
  .submenu { position: static; width: auto; margin-left: 16px; box-shadow: inset 2px 0 var(--chrome-lo); }
  .menu-item { min-height: 44px; }

  .kofi { right: 8px; left: 8px; justify-content: flex-end; }
  .kofi-bubble { width: auto; flex: 1; margin-bottom: 40px; }
  .kofi-clip { width: 56px; height: 92px; }
  .balloon { left: 8px; right: 8px; max-width: none; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
