/* TESSERA 2.0 "Marigold" — visual language:
   cream paper surfaces, indigo ink outlines, hard offset shadows, leaf-cut corners,
   label-plate titles, Truchet tile mosaics. */
:root {
  --ink: #211a33; --ink2: #3a2f55; --ink3: #574a7a;
  --paper: #f3ead2; --paper2: #e6dabb; --paper3: #d3c59b; --cream: #f8f0da; --field: #fffaf0;
  --coral: #ec5b4a; --gold: #f2a93b; --teal: #23a6a0; --plum: #7a3b8f; --sky: #5aa9e6; --leaf: #7bbf5a;
  --spine: 66px; --bar: 58px;
  --shadow: rgba(10, 6, 25, .55);
  --font-ui: 'Pixelify Sans', 'Trebuchet MS', 'Verdana', system-ui, sans-serif;
  --font-mono: 'VT323', 'Courier New', monospace;
  --leaf-r: 10px 3px 10px 3px;
  --leaf-s: 6px 2px 6px 2px;
  --cur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='26' viewBox='0 0 22 26'%3E%3Cpath d='M2 2v19l5-4.5 3.500 7.500 3.500-1.700-3.500-7.300 7-.5z' fill='%23f2a93b' stroke='%23211a33' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, default;
  --cur-point: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='26' viewBox='0 0 22 26'%3E%3Cpath d='M2 2v19l5-4.5 3.500 7.500 3.500-1.700-3.500-7.300 7-.5z' fill='%23ec5b4a' stroke='%23211a33' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, pointer;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0a18; overscroll-behavior: none; }
body { font: 15px/1.3 var(--font-ui); color: var(--ink); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; cursor: var(--cur); touch-action: manipulation; }
button, a, [role=button], summary, select, input[type=range], input[type=checkbox], label { cursor: var(--cur-point); }
input[type=text], input[type=search], input[type=number], textarea { cursor: text; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; }
.win :focus:not(:focus-visible) { outline: none; }

/* ---- scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: var(--gold) var(--paper2); }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--paper2); border-left: 2px solid var(--ink); }
::-webkit-scrollbar-thumb { background: var(--gold); border: 2px solid var(--ink); border-radius: 6px 2px 6px 2px; }
::-webkit-scrollbar-corner { background: var(--paper2); }

/* ---- layout ---- */
#os { position: fixed; inset: 0; display: grid; grid-template-columns: var(--spine) 1fr; opacity: 1; }
#desk { grid-column: 2; grid-row: 1; position: relative; overflow: hidden; background: #1c2b45; min-width: 0; min-height: 0; }
#wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#icons { position: absolute; inset: 0; padding: 12px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 96px); grid-auto-columns: 100px; justify-content: start; align-content: start; pointer-events: none; z-index: 1; }
.dicon { pointer-events: auto; width: 94px; height: 92px; padding: 6px 0; background: transparent; border: 2px solid transparent; border-radius: var(--leaf-s); display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--cream); font-size: 13px; line-height: 1.05; text-align: center; overflow: visible; }
.dicon span { white-space: nowrap; }
.dicon svg { width: 44px; height: 44px; flex: none; filter: drop-shadow(2px 2px 0 rgba(10, 6, 25, .6)); transition: transform .15s; }
.dicon span { text-shadow: -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink), 1px 1px 0 var(--ink), 0 2px 0 var(--ink); padding: 0 3px; border-radius: 3px; }
.dicon:hover svg { transform: translateY(-2px) rotate(-3deg); }
.dicon.sel { border-color: rgba(248, 240, 218, .5); background: rgba(122, 59, 143, .55); }
.dicon.sel span { background: var(--gold); color: var(--ink); text-shadow: none; }

/* ---- the Spine ---- */
#spine { grid-column: 1; grid-row: 1; position: relative; z-index: 5000; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 8px; background: linear-gradient(180deg, #2c2148, #1a1230); border-right: 2px solid var(--ink); box-shadow: inset -3px 0 0 #43376a, 4px 0 0 rgba(6, 3, 16, .35); min-height: 0; }
#spine::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 4px); }
#start { width: 50px; height: 50px; padding: 0; flex: none; display: grid; place-items: center; background: var(--cream); border: 2px solid var(--ink); border-radius: var(--leaf-r); box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); z-index: 1; transition: transform .12s; }
#start svg { width: 34px; height: 34px; display: block; }
#start:hover { transform: rotate(-4deg) scale(1.04); }
#start:active, #start[aria-expanded=true] { background: var(--gold); transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .45); }
#tasks { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; z-index: 1; }
#tasks::-webkit-scrollbar { display: none; }
.task { position: relative; flex: none; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .07); border: 2px solid transparent; border-radius: var(--leaf-s); transition: background .12s, transform .12s; }
.task svg { width: 28px; height: 28px; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .4)); }
.task::before { content: ''; position: absolute; left: -9px; top: 13px; width: 5px; height: 20px; background: var(--gold); border-radius: 0 3px 3px 0; opacity: .0; transition: opacity .15s, height .15s, top .15s; }
.task.open::before { opacity: .7; height: 8px; top: 19px; }
.task.active::before { opacity: 1; height: 24px; top: 11px; }
.task.active { background: var(--gold); border-color: var(--ink); box-shadow: 2px 2px 0 rgba(0, 0, 0, .4); }
.task.min svg { opacity: .45; }
.task:hover { background: rgba(255, 255, 255, .18); }
.task.active:hover { background: #f7bb5c; }
.task.pulse { animation: taskpulse .5s ease 2; }
@keyframes taskpulse { 50% { transform: scale(1.18); background: var(--coral); } }
#tray { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 1; }
#vol { width: 40px; height: 34px; padding: 0; display: grid; place-items: center; background: transparent; border: 2px solid transparent; border-radius: var(--leaf-s); }
#vol svg { width: 26px; height: 26px; }
#vol:hover { background: rgba(255, 255, 255, .15); }
#vol.off svg { opacity: .55; }
#clock { width: 52px; padding: 3px 0; background: #120c22; border: 2px solid var(--ink); border-radius: 4px; box-shadow: inset 0 0 0 2px #3a2f55; color: var(--gold); font-family: var(--font-mono); line-height: .8; display: flex; flex-direction: column; align-items: center; }
#clock span { font-size: 26px; text-shadow: 0 0 6px rgba(242, 169, 59, .6); }
#clock .mm { color: #f8c979; }
#clock:hover { background: #1c1236; }

/* ---- windows ---- */
.win { position: absolute; display: flex; flex-direction: column; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--leaf-r); box-shadow: 5px 5px 0 var(--shadow); overflow: hidden; outline: none; min-width: 0; will-change: transform; }
.win.active { box-shadow: 7px 7px 0 var(--shadow), 0 0 0 3px rgba(248, 240, 218, .18); }
.win.anim { transition: left .24s cubic-bezier(.2, .8, .2, 1), top .24s cubic-bezier(.2, .8, .2, 1), width .24s cubic-bezier(.2, .8, .2, 1), height .24s cubic-bezier(.2, .8, .2, 1); }
.win.opening { animation: winpop .26s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes winpop { from { transform: scale(.9) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.win.max { border-radius: 0; border-width: 0 0 0 0; box-shadow: none; }
.win.moving { box-shadow: 10px 12px 0 var(--shadow); }
.win-title { flex: none; height: 30px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 0 5px; background-color: #a89c86; border-bottom: 2px solid var(--ink); touch-action: none; }
.win.active .win-title { background-color: var(--accent); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .22) 0 2px, transparent 2px 7px); }
.win-title.dragging { cursor: grabbing; }
.win.max .win-title { border-radius: 0; }
.win-l { display: flex; align-items: center; min-width: 0; }
.win-icon { display: grid; place-items: center; width: 22px; height: 22px; background: var(--cream); border: 2px solid var(--ink); border-radius: 50%; overflow: hidden; }
.win-icon svg { width: 16px; height: 16px; }
.win-name { max-width: min(46vw, 420px); padding: 0 14px; height: 21px; line-height: 17px; background: var(--cream); border: 2px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; color: var(--ink); }
.win:not(.active) .win-name { background: #d9cfb8; color: #6b6480; }
.win-r { display: flex; justify-content: flex-end; gap: 4px; }
.wb { width: 22px; height: 22px; padding: 0; display: grid; place-items: center; background: var(--cream); border: 2px solid var(--ink); border-radius: 5px 1px 5px 1px; transition: transform .08s; }
.wb:hover { background: var(--gold); }
.wb.b-x:hover { background: var(--coral); }
.wb:active { transform: translate(1px, 1px); }
.win-body { flex: 1; min-height: 0; position: relative; overflow: hidden; background: var(--paper); display: flex; flex-direction: column; }
.win-status { flex: none; height: 24px; display: flex; align-items: center; gap: 12px; padding: 0 8px; background: var(--paper2); border-top: 2px solid var(--ink); font-size: 13px; white-space: nowrap; overflow: hidden; }
.win-status span { padding: 0 6px; border-left: 2px solid var(--paper3); }
.win-status span:first-child { border-left: 0; padding-left: 0; }
.rz { position: absolute; z-index: 3; touch-action: none; }
.rz-n, .rz-s { left: 12px; right: 12px; height: 7px; cursor: ns-resize; }
.rz-e, .rz-w { top: 12px; bottom: 12px; width: 7px; cursor: ew-resize; }
.rz-n { top: -2px; } .rz-s { bottom: -2px; } .rz-e { right: -2px; } .rz-w { left: -2px; }
.rz-ne, .rz-nw, .rz-se, .rz-sw { width: 16px; height: 16px; }
.rz-ne { top: -2px; right: -2px; cursor: nesw-resize; } .rz-nw { top: -2px; left: -2px; cursor: nwse-resize; }
.rz-se { bottom: -2px; right: -2px; cursor: nwse-resize; } .rz-sw { bottom: -2px; left: -2px; cursor: nesw-resize; }
.rz-se::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; background: linear-gradient(135deg, transparent 50%, var(--ink) 50% 58%, transparent 58% 72%, var(--ink) 72% 80%, transparent 80%); opacity: .55; }
.win.max .rz { display: none; }
.win.dialog { border-radius: 12px 3px 12px 3px; }
.scrim { position: absolute; inset: 0; background: rgba(13, 10, 24, .45); backdrop-filter: blur(1px); animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.snap-preview { position: absolute; background: rgba(242, 169, 59, .22); border: 3px dashed var(--gold); border-radius: 10px; pointer-events: none; transition: all .12s; }
.compact .b-max { display: none; }

/* ---- menus ---- */
.menubar { flex: none; display: flex; gap: 2px; padding: 2px 4px; background: var(--paper2); border-bottom: 2px solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.mb { flex: none; padding: 2px 10px; background: none; border: 0; border-radius: 4px; font-size: 14px; }
.mb:hover, .mb.open { background: var(--ink); color: var(--cream); }
#popups { position: fixed; inset: 0; pointer-events: none; z-index: 20000; }
#popups > * { pointer-events: auto; }
.menu { position: fixed; min-width: 190px; padding: 3px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--leaf-s); box-shadow: 4px 4px 0 var(--shadow); animation: menuin .09s ease-out; max-height: calc(100vh - 12px); overflow-y: auto; }
@keyframes menuin { from { opacity: 0; transform: translateY(-4px); } }
.mi { display: flex; align-items: center; width: 100%; gap: 6px; padding: 4px 8px 4px 4px; background: none; border: 0; border-radius: 3px; text-align: left; font-size: 14px; white-space: nowrap; }
.mi:hover:not(:disabled), .mi.hot { background: var(--ink); color: var(--cream); }
.mi:disabled { color: #9a8f74; cursor: default; }
.mchk { width: 14px; text-align: center; font-size: 10px; color: var(--coral); flex: none; }
.mlab { flex: 1; }
.mkey { margin-left: 18px; font-size: 12px; opacity: .6; }
.msep { height: 0; margin: 3px 4px; border-top: 2px dashed var(--paper3); }
.mhead { padding: 3px 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); }

/* ---- launcher ---- */
#launcher { position: fixed; left: calc(var(--spine) + 10px); top: 10px; z-index: 9000; width: 392px; max-width: calc(100vw - var(--spine) - 20px); max-height: calc(100vh - 20px); display: flex; flex-direction: column; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px 3px 14px 3px; box-shadow: 7px 7px 0 var(--shadow); overflow: hidden; transform-origin: 0 0; }
#launcher:not([hidden]) { animation: launchin .2s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes launchin { from { transform: scale(.85) translateX(-20px); opacity: 0; } }
.la-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--plum) repeating-linear-gradient(135deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 7px); border-bottom: 2px solid var(--ink); color: var(--cream); }
.la-head svg { width: 42px; height: 42px; flex: none; border: 2px solid var(--ink); }
.la-head b { display: block; font-size: 22px; letter-spacing: .18em; line-height: 1; }
.la-head small { font-size: 12px; opacity: .85; letter-spacing: .06em; }
.la-search { padding: 10px 12px 4px; }
.la-search input { width: 100%; }
.la-grid { padding: 8px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow-y: auto; }
.la { display: flex; align-items: center; gap: 10px; padding: 8px 9px; text-align: left; background: var(--cream); border: 2px solid var(--ink); border-radius: var(--leaf-s); box-shadow: 2px 2px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.la svg { width: 34px; height: 34px; flex: none; }
.la b { display: block; font-size: 15px; line-height: 1.05; }
.la small { display: block; font-size: 12px; color: var(--ink3); line-height: 1.1; margin-top: 2px; }
.la:hover, .la.hot { background: var(--gold); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.la:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.la-empty { grid-column: 1 / -1; padding: 12px; text-align: center; color: var(--ink3); }
.la-foot { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 2px dashed var(--paper3); flex-wrap: wrap; }
.la-foot .btn { flex: 1; white-space: nowrap; padding: 3px 8px; }

/* ---- widgets ---- */
.btn { padding: 3px 14px; background: var(--cream); border: 2px solid var(--ink); border-radius: var(--leaf-s); box-shadow: 2px 2px 0 var(--ink); font-size: 14px; transition: transform .06s, box-shadow .06s; }
.btn:hover { background: #fff5d8; }
.btn:active, .btn.on { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); background: var(--gold); }
.btn.primary { background: var(--gold); }
.btn.primary:hover { background: #f7bb5c; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.sm { padding: 1px 8px; font-size: 13px; }
.field { padding: 3px 7px; background: var(--field); border: 2px solid var(--ink); border-radius: 3px; font: inherit; color: var(--ink); box-shadow: inset 2px 2px 0 rgba(33, 26, 51, .18); -webkit-user-select: text; user-select: text; min-width: 0; }
.field:focus { outline: 3px solid rgba(90, 169, 230, .6); outline-offset: 0; }
select.field { padding-right: 4px; }
.sunken { background: var(--field); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 rgba(33, 26, 51, .18); }
input[type=range] { accent-color: var(--plum); }
input[type=checkbox], input[type=radio] { accent-color: var(--plum); width: 16px; height: 16px; }
.hint { color: var(--ink3); font-size: 13px; }

/* ---- dialogs ---- */
.dlg { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.dlg-top { display: flex; gap: 14px; align-items: flex-start; }
.dlg-icon { flex: none; }
.dlg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; -webkit-user-select: text; user-select: text; }
.dlg-msg { line-height: 1.35; }
.dlg-text .field { width: 100%; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- toasts ---- */
#toasts { position: fixed; right: 12px; bottom: 12px; z-index: 30000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; max-width: 340px; padding: 9px 12px; background: var(--cream); border: 2px solid var(--ink); border-radius: var(--leaf-s); box-shadow: 4px 4px 0 var(--shadow); transform: translateX(120%); transition: transform .3s cubic-bezier(.2, .9, .3, 1.1); font-size: 14px; }
.toast.in { transform: none; }
.toast-ic svg { display: block; }
.toast-tx b { display: block; font-size: 15px; }

/* ---- boot ---- */
#boot { position: fixed; inset: 0; z-index: 99999; background: #050308; color: #d9d2b4; font-family: var(--font-mono); overflow: hidden; cursor: none; }
#boot.gone { display: none; }
#boot .btn { color: var(--ink); font-size: 16px; padding: 4px 18px; text-shadow: none; }
.post { position: absolute; inset: 0; padding: 4vh 5vw; font-size: clamp(16px, 2.6vh, 24px); line-height: 1.12; text-shadow: 0 0 6px rgba(217, 210, 180, .45); white-space: pre-wrap; }
.post .hl { color: #ffd27a; }
.post .ok { color: #9be07a; }
.post .cur { display: inline-block; width: .55em; height: 1em; background: #d9d2b4; vertical-align: -.12em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.post .pl { position: absolute; right: 5vw; top: 4vh; width: clamp(60px, 9vw, 96px); opacity: .95; filter: saturate(.9); }
.splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; background: radial-gradient(circle at 50% 42%, #3a2a66 0%, #1b1430 48%, #0a0715 100%); opacity: 0; transition: opacity .5s; }
.splash.on { opacity: 1; }
.splash::before { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(242, 169, 59, .05) 0 6deg, transparent 6deg 12deg); animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sp-logo { position: relative; width: clamp(110px, 22vmin, 190px); height: clamp(110px, 22vmin, 190px); filter: drop-shadow(0 0 30px rgba(242, 169, 59, .35)); }
.sp-logo svg { width: 100%; height: 100%; overflow: visible; }
.sp-logo .lt { transform-box: fill-box; transform-origin: center; animation: tilein .9s cubic-bezier(.2, .9, .3, 1.15) both; }
.sp-logo .lt0 { animation-delay: .0s; } .sp-logo .lt1 { animation-delay: .18s; } .sp-logo .lt2 { animation-delay: .36s; } .sp-logo .lt3 { animation-delay: .54s; }
@keyframes tilein { from { transform: scale(0) rotate(-180deg); opacity: 0; } to { transform: none; opacity: 1; } }
.sp-word { position: relative; font-family: var(--font-ui); font-weight: 700; font-size: clamp(30px, 8vmin, 64px); color: #f8f0da; letter-spacing: .34em; padding-left: .34em; text-shadow: 3px 3px 0 #211a33, 0 0 30px rgba(242, 169, 59, .4); }
.sp-word span { display: inline-block; opacity: 0; transform: translateY(14px); animation: letterin .5s cubic-bezier(.2, .9, .3, 1.3) forwards; }
@keyframes letterin { to { opacity: 1; transform: none; } }
.sp-sub { position: relative; font-family: var(--font-ui); font-size: clamp(12px, 2.2vmin, 17px); letter-spacing: .32em; color: #f2a93b; opacity: 0; animation: fadeup .8s 1.0s forwards; text-transform: uppercase; }
.sp-bar { position: relative; display: flex; gap: 5px; margin-top: 1vh; opacity: 0; animation: fadeup .5s 1.1s forwards; }
.sp-bar i { width: clamp(12px, 3vmin, 22px); height: clamp(12px, 3vmin, 22px); background: #2b2147; border: 2px solid #4a3d75; transform: rotate(0deg); transition: background .2s, transform .35s, border-color .2s; }
.sp-bar i.on { background: var(--c); border-color: #f8f0da; transform: rotate(90deg); }
.sp-stat { position: relative; height: 1.4em; font-family: var(--font-mono); font-size: clamp(16px, 2.6vmin, 22px); color: #b9addb; letter-spacing: .06em; opacity: 0; animation: fadeup .5s 1.1s forwards; }
.sp-corp { position: absolute; bottom: 6vh; width: 100%; padding: 0 12px; text-align: center; font-family: var(--font-ui); font-size: 12px; letter-spacing: .16em; color: #6e619a; text-transform: uppercase; }
.crt { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%); mix-blend-mode: multiply; animation: crtflick .12s infinite; }
@keyframes crtflick { 50% { opacity: .93; } }
.skiphint { position: absolute; bottom: 2.5vh; right: 3vw; font-family: var(--font-mono); font-size: 16px; color: #6e619a; animation: blink 1.6s steps(1) infinite; }
.wipe { position: fixed; inset: 0; z-index: 99998; display: grid; pointer-events: none; }
.wipe i { background: #1b1430; transform: scale(1.02); transition: transform .5s cubic-bezier(.6, 0, .3, 1), opacity .5s; }
.wipe.go i { transform: scale(0) rotate(90deg); opacity: 0; }
.flash { position: fixed; inset: 0; z-index: 99997; background: #fff3d0; opacity: 0; pointer-events: none; }

/* ---- compact (phones) ---- */
@media (max-width: 720px) {
  .post .pl { display: none; }
  .skiphint { left: 0; right: 0; bottom: 2.5vh; text-align: center; }
  #os { grid-template-columns: 1fr; grid-template-rows: 1fr var(--bar); }
  #desk { grid-column: 1; grid-row: 1; }
  #spine { grid-column: 1; grid-row: 2; flex-direction: row; padding: 0 8px; gap: 8px; border-right: 0; border-top: 2px solid var(--ink); box-shadow: inset 0 3px 0 #43376a; align-items: center; padding-bottom: env(safe-area-inset-bottom, 0); }
  #start { width: 44px; height: 44px; }
  #tasks { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 0 4px; justify-content: flex-start; height: 100%; align-items: center; }
  .task { width: 42px; height: 42px; }
  .task::before { left: 10px; top: auto; bottom: -7px; width: 20px; height: 4px; border-radius: 3px 3px 0 0; }
  .task.open::before { width: 8px; height: 4px; left: 17px; top: auto; }
  .task.active::before { width: 24px; height: 4px; left: 9px; top: auto; }
  #tray { flex-direction: row; gap: 4px; }
  #clock { width: auto; flex-direction: row; padding: 2px 6px; gap: 0; }
  #clock span { font-size: 22px; }
  #clock .hh::after { content: ':'; }
  #vol { width: 34px; }
  #icons { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-columns: auto; grid-auto-rows: 96px; justify-content: stretch; padding: 14px 8px; gap: 4px; }
  .dicon { width: 100%; }
  #launcher { left: 8px; right: 8px; top: auto; bottom: calc(var(--bar) + 8px); width: auto; max-width: none; max-height: calc(100vh - var(--bar) - 20px); transform-origin: 0 100%; }
  .la-grid { grid-template-columns: 1fr 1fr; }
  #toasts { right: 8px; left: 8px; bottom: auto; top: 8px; align-items: stretch; }
  .toast { max-width: none; transform: translateY(-160%); }
  .win-name { max-width: 56vw; }
  .win.max .win-title { height: 34px; }
  .wb { width: 26px; height: 26px; }
}
@media (pointer: coarse) {
  .rz-n, .rz-s { height: 14px; } .rz-e, .rz-w { width: 14px; }
  .rz-ne, .rz-nw, .rz-se, .rz-sw { width: 26px; height: 26px; }
  .mb { padding: 6px 12px; } .mi { padding: 8px 10px 8px 4px; }
  .btn { padding: 6px 14px; }
  body { cursor: default; }
}
@media (prefers-reduced-motion: reduce) {
  .splash::before, .crt { animation: none; }
}
