#os { position: fixed; inset: 0; overflow: hidden; overflow: clip; background: var(--bg); user-select: none; -webkit-user-select: none; touch-action: pan-y; }

/* Liquid Glass: one recipe for every floating surface. */
.panel, .dock, .toast {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(30px) saturate(190%);
    backdrop-filter: blur(30px) saturate(190%);
    border: 1px solid var(--glass-edge);
    box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 -1px 0 rgb(255 255 255 / 4%), var(--shadow-soft);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .panel, .dock, .toast { background: color-mix(in srgb, var(--window) 94%, transparent); }
}

/* Desktop and the two scenes. --p runs 0 (hands together) to 1 (hands parted). */
.desktop { position: absolute; inset: 0; --p: 0; }
.hands { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.create-folder {
    position: absolute; left: var(--tk-x, 50%); top: var(--tk-y, 50%);
    --size: clamp(46px, calc(var(--gap, 180px) * .44), 96px);
    display: grid; justify-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px;
    transform: translate(-50%, -46%) scale(calc(1 + var(--p) * 1.1));
    opacity: calc(1 - var(--p) * 2.8);
    cursor: pointer;
}
/* --glow (0 to 1) comes from the wallpaper each frame, so the folder swells in step with the dots beside it. */
.create-folder .file-icon { width: var(--size); height: calc(var(--size) * .86); scale: calc(1 + var(--glow, 0) * .09); filter: brightness(calc(1 + var(--glow, 0) * .32)) drop-shadow(0 6px 14px rgb(0 0 0 / 45%)); transition: translate .35s var(--ease); }
.create-folder:hover .file-icon, .create-folder:focus-visible .file-icon { translate: 0 -3px; }
.create-folder:active .file-icon { translate: 0 1px; }
.create-folder-name { scale: calc(1 + var(--glow, 0) * .07); }
.create-folder-name { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--fg); text-shadow: 0 1px 6px var(--bg); padding: 1px 8px; border-radius: 6px; }
.create-folder:focus-visible { outline: none; }
.create-folder:focus-visible .create-folder-name { background: var(--accent); color: #fff; text-shadow: none; }

.create-space {
    position: absolute; left: 50%; top: calc(var(--menubar) + 3vh); bottom: calc(var(--dock-size) + 44px);
    width: min(760px, calc(100vw - 2 * clamp(60px, 11vw, 190px)));
    transform: translateX(-50%) scale(calc(.84 + var(--p) * .16));
    opacity: clamp(0, calc((var(--p) - .32) * 2.2), 1);
    display: flex; flex-direction: column; justify-content: center; gap: clamp(16px, 4vh, 40px);
    pointer-events: none;
}
.desktop[data-scene='create'] .create-space { pointer-events: auto; }
.desktop[data-scene='create'] .create-folder { pointer-events: none; }
.create-head { display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; }
.create-back { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--fg-2); cursor: pointer; transition: background .2s, color .2s; }
.create-back:hover { background: var(--fill-2); color: var(--fg); }
.desk-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 4px; }
.desk-item {
    display: grid; justify-items: center; align-content: start; grid-template-rows: 60px auto; gap: 6px; width: 104px; padding: 10px 4px 8px; border-radius: 12px; cursor: pointer;
    opacity: clamp(0, calc((var(--p) - .34 - var(--i) * .03) * 4), 1);
    transform: translateY(calc((1 - var(--p)) * (14px + var(--i) * 3px)));
    transition: background .15s;
}
.desk-item:hover, .desk-item:focus-visible { background: var(--fill); outline: none; }
.desk-item:focus-visible .desk-item-name { background: var(--accent); color: #fff; }
.desk-item .file-icon, .desk-item .app-icon { width: 64px; height: 54px; margin-top: 4px; transition: transform .25s var(--ease); }
.desk-item .app-icon { width: 58px; height: 58px; margin-top: 0; }
.desk-item .file-icon-doc { margin-top: 2px; }
.desk-item:hover .file-icon, .desk-item:hover .app-icon { transform: translateY(-2px) scale(1.05); }
.desk-item-name { font-size: 12.5px; font-weight: 500; line-height: 1.25; text-align: center; padding: 1px 6px; border-radius: 5px; text-shadow: 0 1px 4px var(--bg); overflow-wrap: anywhere; }

/* File and app icons */
.file-icon { display: block; position: relative; flex: none; }
.file-icon-folder img { width: 100%; height: 100%; object-fit: contain; display: block; }
.file-icon-folder .glyph { position: absolute; left: 50%; top: 58%; width: 34%; height: auto; aspect-ratio: 1; transform: translate(-50%, -50%); color: rgb(9 78 160 / 55%); z-index: 1; }
.file-icon-doc { width: 46px !important; height: 56px !important; border-radius: 6px; background: linear-gradient(180deg, #fff, #e6e7eb); box-shadow: 0 2px 8px rgb(0 0 0 / 35%), inset 0 0 0 .5px rgb(0 0 0 / 14%); }
.file-icon-doc::before { content: ''; position: absolute; left: 8px; right: 8px; top: 11px; height: 22px; background: repeating-linear-gradient(180deg, #b9bcc6 0 2px, transparent 2px 6px); border-radius: 1px; }
.file-icon-tag { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 9px; font-weight: 700; letter-spacing: .04em; color: #6b6f7b; }
.file-icon-pdf .file-icon-tag { color: #d6362b; }
.file-icon-webloc .file-icon-tag { color: #1a7af0; }
.file-icon-photo { width: 62px !important; height: 50px !important; }
.file-icon-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 40%); display: block; }

.app-icon { display: block; position: relative; flex: none; width: 100%; aspect-ratio: 1; border-radius: 23.5%; overflow: hidden; color: #fff; background: #2a2a2e; box-shadow: 0 2px 6px rgb(0 0 0 / 32%), 0 0 0 .5px rgb(0 0 0 / 30%); }
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.app-icon[data-icon='kova'] { background: #fff; }
.app-icon[data-icon='kova'] img { object-fit: contain; }
.app-icon::after, .file-icon-logo::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 rgb(255 255 255 / 38%), inset 0 0 0 .5px rgb(255 255 255 / 16%); background: linear-gradient(180deg, rgb(255 255 255 / 14%), transparent 46%); pointer-events: none; }
.app-icon.is-native { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.app-icon.is-native::after { display: none; }
.app-icon.is-native img { inset: -4%; width: 108%; height: 108%; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 28%)); }
.app-icon .glyph { display: none; position: absolute; inset: 0; margin: auto; width: 52%; height: 52%; }
:root[data-icons='clear'] .app-icon, :root[data-icons='clear'] .app-icon.is-native { border-radius: 23.5%; overflow: hidden; background: linear-gradient(155deg, rgb(255 255 255 / 24%), rgb(255 255 255 / 7%)); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%), 0 3px 10px rgb(0 0 0 / 30%); }
:root[data-icons='clear'] .app-icon img { display: none; }
:root[data-icons='clear'] .app-icon .glyph { display: block; }
.app-icon-plain { background: var(--fill-2); box-shadow: none; display: grid; place-items: center; }
.app-icon-plain::after { display: none; }
.app-icon-plain .glyph { display: block; position: static; }
/* A book: its cover, portrait, with the spine catching light on the left. */
.file-icon-cover { width: fit-content !important; height: 58px !important; border-radius: 2px 3px 3px 2px; overflow: hidden; box-shadow: 0 2px 8px rgb(0 0 0 / 40%), 0 0 0 .5px rgb(0 0 0 / 18%); }
.file-icon-cover img { width: auto; height: 100%; display: block; }
.file-icon-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / 16%), rgb(255 255 255 / 22%) 5%, transparent 11%); }
/* A logo tile is drawn exactly like an app icon: same corners, edge, sheen and shadow. */
.file-icon-logo { width: 56px !important; height: 56px !important; border-radius: 23.5%; overflow: hidden; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 32%), 0 0 0 .5px rgb(0 0 0 / 30%); }
.file-icon-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Menu bar */
.menubar { position: absolute; inset: 0 0 auto 0; height: var(--menubar); z-index: 600; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; font-size: 13px; font-weight: 500; color: var(--fg); background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), transparent); transition: opacity .5s, transform .5s var(--ease); }
.menubar-left, .menubar-right, .menubar-menus { display: flex; align-items: center; min-width: 0; }
.menubar-right { gap: 2px; }
.menubar-item { height: 24px; padding: 0 9px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.menubar-item:hover, .menubar-item.is-open { background: var(--fill-2); }
.menubar-tk { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -.08em; padding: 0 10px 2px 8px; gap: 0; }
.menubar-tk span { color: var(--fg-3); }
.menubar-app { font-weight: 700; }
.menubar-icon { padding: 0 6px; }
.menubar-clock { font-variant-numeric: tabular-nums; gap: 8px; }
.menubar-spaces { gap: 5px; color: var(--fg-2); font-size: 12px; }
.menubar-spaces i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; transition: opacity .25s, transform .25s; }
.menubar-spaces[data-scene='home'] i:nth-child(1), .menubar-spaces[data-scene='create'] i:nth-child(2) { opacity: 1; transform: scale(1.2); color: var(--fg); }
.menubar-spaces span { margin-left: 2px; min-width: 38px; text-align: left; }
.menubar-ring { display: inline-flex; align-items: center; height: 22px; margin-right: 4px; border-radius: 999px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; overflow: hidden; }
.menubar-ring a { display: inline-flex; align-items: center; height: 100%; padding: 0 9px; text-decoration: none; color: var(--fg-2); transition: background .15s, color .15s; }
.menubar-ring a:hover, .menubar-ring a:focus-visible { background: var(--fill-2); color: var(--fg); outline-offset: -2px; }
.menubar-ring .webring-word, .menubar-ring .webring-long { display: none; }
.menubar-ring .webring-home { border-inline: 1px solid var(--line); padding: 0 8px; }
.webring-logo { display: block; width: 13px; height: 13px; }

/* Menus */
.menu { position: absolute; z-index: 700; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); padding: 5px; border-radius: 13px; font-size: 13.5px; outline: none; animation: menu-in .14s var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-item { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 4px; width: 100%; height: 26px; padding: 0 9px 0 5px; border-radius: 7px; text-align: left; }
.menu-item:not(:disabled):hover, .menu-item:focus-visible { background: var(--accent); color: #fff; outline: none; }
.menu-item:not(:disabled):hover kbd, .menu-item:focus-visible kbd { color: rgb(255 255 255 / 80%); }
.menu-item:disabled { color: var(--fg-3); }
.menu-check { font-size: 11px; text-align: center; }
.menu-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu kbd { font: inherit; font-size: 12.5px; color: var(--fg-3); padding-left: 18px; }
.menu-sep { height: 1px; margin: 5px 9px; background: var(--line); }
.menu-heading { padding: 5px 9px 2px 25px; font-size: 11px; font-weight: 600; color: var(--fg-3); }

/* Dock */
.dock-wrap { position: absolute; inset: auto 0 8px 0; z-index: 500; display: flex; justify-content: center; pointer-events: none; transition: opacity .5s, transform .5s var(--ease); }
/* --dock-fit is the chosen icon size, shrunk when the window is too narrow to hold every icon plus room to magnify. */
.dock-wrap { --dock-fit: min(var(--dock-size), calc((100vw - 64px - var(--dock-count, 14) * 4px) / (var(--dock-count, 14) + 2.3))); }
.dock { pointer-events: auto; display: flex; align-items: flex-end; gap: 4px; height: calc(var(--dock-fit) + 14px); padding: 0 7px 7px; border-radius: calc(var(--dock-fit) * .26 + 8px); }
.dock-item { position: relative; flex: none; width: calc(var(--dock-fit) * var(--s, 1)); height: calc(var(--dock-fit) * var(--s, 1)); cursor: pointer; }
.dock-item .app-icon { width: 100%; height: 100%; }
.dock-item:active .app-icon { filter: brightness(.72); }
.dock-dot { position: absolute; left: 50%; bottom: -5px; width: 4px; height: 4px; border-radius: 50%; background: var(--fg); opacity: 0; transform: translateX(-50%); transition: opacity .2s; }
.dock-item.is-running .dock-dot { opacity: .8; }
.dock-tip { position: absolute; left: 50%; bottom: calc(100% + 14px); transform: translateX(-50%) translateY(4px); padding: 4px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--glass-bg); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow-soft); opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; }
.dock-item:hover .dock-tip, .dock-item:focus-visible .dock-tip { opacity: 1; transform: translateX(-50%); }
.dock-sep { align-self: center; width: 1px; height: calc(var(--dock-fit) * .7); margin: 0 4px 0; background: var(--line-strong); flex: none; }
.dock-item.is-bouncing .app-icon { animation: dock-bounce .9s cubic-bezier(.3, 0, .5, 1); }
@keyframes dock-bounce { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-34%); } 50% { transform: translateY(0); } 70% { transform: translateY(-14%); } }

/* Windows layer */
.windows { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
.windows > * { pointer-events: auto; }
.snap-ghost { position: absolute; z-index: 5; border-radius: 14px; background: var(--fill-2); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; pointer-events: none !important; transition: opacity .15s, inset .2s var(--ease); inset: var(--ay, 30px) 40% auto 40%; height: var(--ah, 60vh); }
.snap-ghost[data-snap='maximized'] { opacity: 1; inset: calc(var(--ay) + 6px) 6px auto 6px; height: calc(var(--ah) - 12px); }
.snap-ghost[data-snap='left'] { opacity: 1; inset: calc(var(--ay) + 6px) calc(50% + 3px) auto 6px; height: calc(var(--ah) - 12px); }
.snap-ghost[data-snap='right'] { opacity: 1; inset: calc(var(--ay) + 6px) 6px auto calc(50% + 3px); height: calc(var(--ah) - 12px); }

/* Spotlight */
.spotlight-scrim { position: absolute; inset: 0; z-index: 800; display: flex; justify-content: center; align-items: flex-start; padding-top: min(22vh, 180px); }
.spotlight { width: min(640px, calc(100vw - 24px)); border-radius: 22px; overflow: hidden; animation: menu-in .18s var(--ease); }
.spotlight-field { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: var(--fg-2); }
.spotlight-input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font: 400 22px/1.2 var(--display); color: var(--fg); user-select: text; -webkit-user-select: text; }
.spotlight-input::placeholder { color: var(--fg-3); }
.spotlight-results { padding: 6px; border-top: 1px solid var(--line); max-height: min(52vh, 440px); overflow-y: auto; }
.spotlight-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 7px 10px; border-radius: 12px; text-align: left; }
.spotlight-row.is-active { background: var(--accent); color: #fff; }
.spotlight-row .app-icon, .spotlight-row .file-icon { width: 34px !important; height: 34px !important; }
.spotlight-row .file-icon-folder { height: 29px !important; }
.spotlight-row .file-icon-doc { width: 27px !important; margin-inline: auto; }
.spotlight-row .file-icon-cover { width: fit-content !important; margin-inline: auto; }
.spotlight-row .file-icon-doc::before, .spotlight-row .file-icon-tag { display: none; }
.spotlight-text { min-width: 0; }
.spotlight-text strong { display: block; font-weight: 500; font-size: 14.5px; }
.spotlight-text small { display: block; font-size: 12px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spotlight-row.is-active small, .spotlight-row.is-active .spotlight-kind { color: rgb(255 255 255 / 80%); }
.spotlight-kind { font-size: 12px; color: var(--fg-3); }
.spotlight-empty { padding: 18px; text-align: center; color: var(--fg-3); }

/* Control Center and shared controls */
.control-center { position: absolute; top: calc(var(--menubar) + 6px); right: 8px; z-index: 700; width: min(330px, calc(100vw - 16px)); padding: 10px; border-radius: 22px; display: grid; gap: 8px; animation: menu-in .16s var(--ease); }
.cc-tile { padding: 12px; border-radius: 15px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 10px; }
.cc-tile h3 { font-size: 12px; font-weight: 600; color: var(--fg-2); }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.cc-slider { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.cc-slider small { font-size: 11.5px; color: var(--fg-3); }
.cc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: 13px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.cc-button:hover { background: var(--fill-2); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 9px; background: var(--fill-2); }
.seg-option { height: 26px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--fg-2); cursor: pointer; }
.seg-option[aria-checked='true'] { background: color-mix(in srgb, var(--fg) 20%, transparent); color: var(--fg); box-shadow: 0 1px 3px rgb(0 0 0 / 25%); }
.swatches { display: flex; gap: 10px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; position: relative; }
.swatch[aria-checked='true']::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; cursor: pointer; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--fill-2); }
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--fill-2); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 40%), 0 0 0 .5px rgb(0 0 0 / 20%); }
.slider::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 40%); }
.switch { width: 40px; height: 24px; border-radius: 12px; background: var(--fill-2); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch i { position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 35%); transition: transform .22s var(--ease); }
.switch[aria-checked='true'] { background: #30d158; }
.switch[aria-checked='true'] i { transform: translateX(16px); }

/* Notifications */
.toasts { position: absolute; top: calc(var(--menubar) + 8px); right: 10px; z-index: 650; display: grid; gap: 8px; width: min(360px, calc(100vw - 20px)); }
.toast { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; padding: 12px; border-radius: 20px; animation: toast-in .5s var(--ease); }
.toast.is-leaving { animation: toast-out .3s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
.toast-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--fill-2); }
.toast-text strong { font-size: 13.5px; }
.toast-text p { font-size: 13px; color: var(--fg-2); line-height: 1.4; margin-top: 1px; }
.toast-actions { display: flex; gap: 8px; margin-top: 9px; }
.toast-actions button { height: 26px; padding: 0 12px; border-radius: 8px; background: var(--fill-2); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.toast-actions button:hover { background: var(--accent); color: #fff; }
.toast-close { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-3); cursor: pointer; }
.toast-close:hover { background: var(--fill-2); color: var(--fg); }

/* Lock screen */
.lock { position: absolute; inset: 0; z-index: 900; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: max(7vh, 40px) 20px max(6vh, 32px); outline: none; cursor: pointer; animation: lock-in .6s ease-out; }
@keyframes lock-in { from { opacity: 0; } }
.lock-top { text-align: center; }
.lock-date { font-family: var(--display); font-size: clamp(18px, 2.4vw, 26px); font-weight: 600; color: color-mix(in srgb, var(--fg) 82%, transparent); }
.lock-time { font-family: var(--display); font-size: clamp(96px, 17vw, 210px); font-weight: 700; line-height: .95; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--fg) 62%, transparent), color-mix(in srgb, var(--fg) 20%, transparent)); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 1px color-mix(in srgb, var(--fg) 22%, transparent); }
.lock-user { display: grid; justify-items: center; gap: 3px; cursor: pointer; }
.lock-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; grid-auto-flow: column; margin-bottom: 8px; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.08em; background: var(--glass-bg); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-shine); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.lock-avatar i { font-style: normal; color: var(--fg-3); }
.lock-user strong { font-size: 16px; }
.lock-user span { font-size: 13.5px; color: var(--fg-2); }
.lock-user small { margin-top: 14px; font-size: 12.5px; color: var(--fg-3); animation: lock-hint 2.6s ease-in-out infinite; }
@keyframes lock-hint { 50% { opacity: .45; } }
.lock.is-leaving { animation: lock-out .55s var(--ease) forwards; pointer-events: none; }
.lock-bar { display: none; }
:root[data-device='phone'] .lock { --lift: 0px; transform: translate3d(0, calc(var(--lift) * -1), 0); opacity: var(--fade, 1); touch-action: none; cursor: grab; }
:root[data-device='phone'] .lock.is-returning { transition: transform .3s var(--ease), opacity .3s; }
:root[data-device='phone'] .lock.is-lifting { animation: lock-lift .38s var(--ease) forwards; }
@keyframes lock-lift { to { transform: translate3d(0, -100%, 0); opacity: 0; } }
:root[data-device='phone'] .lock-bar { display: block; position: absolute; left: 50%; bottom: 9px; width: 134px; height: 5px; border-radius: 3px; background: var(--fg); opacity: .85; transform: translateX(-50%); }
:root[data-device='phone'] .lock-user small { margin-bottom: 14px; }
.lock.is-leaving .lock-top { transition: transform .55s var(--ease); transform: translateY(-60px); }
@keyframes lock-out { to { opacity: 0; } }
.is-locked .menubar { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.is-locked .dock-wrap { opacity: 0; transform: translateY(120%); pointer-events: none; }
.is-locked .windows, .is-locked .toasts { visibility: hidden; }

/* Phone: the same desktop becomes its iOS sibling. */
:root[data-device='phone'] { --menubar: 44px; --dock-size: 58px; }
:root[data-device='phone'] .menubar { padding: 0 14px; font-size: 15px; font-weight: 600; background: none; }
:root[data-device='phone'] .menubar-menus, :root[data-device='phone'] .menubar-date, :root[data-device='phone'] .menubar-spaces { display: none; }
:root[data-device='phone'] .menubar-item { height: 34px; }
:root[data-device='phone'] .menubar-icon { padding: 0 9px; }
:root[data-device='phone'] .menubar-ring { height: 30px; font-size: 13px; }
:root[data-device='phone'] .menubar-ring a { padding: 0 12px; min-width: 40px; justify-content: center; }
:root[data-device='phone'] .dock-wrap { bottom: max(14px, env(safe-area-inset-bottom)); --dock-fit: var(--dock-size); }
:root[data-device='phone'] .dock { gap: 16px; padding: 0 14px 12px; height: calc(var(--dock-size) + 24px); border-radius: 32px; }
:root[data-device='phone'] .dock-item:not([data-phone]), :root[data-device='phone'] .dock-sep, :root[data-device='phone'] .dock-tip, :root[data-device='phone'] .dock-dot { display: none; }
:root[data-device='phone'] .windows { z-index: 550; }
:root[data-device='phone'] .create-space { width: calc(100vw - 28px); top: calc(var(--menubar) + 8px); bottom: calc(var(--dock-size) + 60px); justify-content: flex-start; padding-top: 4vh; }
:root[data-device='phone'] .desk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 2px; }
:root[data-device='phone'] .desk-item { width: 100%; }
:root[data-device='phone'] .desk-item .app-icon { width: 60px; height: 60px; }
:root[data-device='phone'] .desk-item .file-icon-folder { width: 62px; height: 52px; }
:root[data-device='phone'] .desk-item-name { font-size: 11.5px; }
:root[data-device='phone'] .spotlight-scrim { padding-top: 60px; }
:root[data-device='phone'] .lock-time { font-size: 30vw; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Notification Center widgets */
.widgets { position: absolute; top: calc(var(--menubar) + 6px); right: 8px; bottom: calc(var(--dock-size) + 34px); z-index: 700; width: min(340px, calc(100vw - 16px)); padding: 14px; border-radius: 24px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; animation: toast-in .35s var(--ease); scrollbar-width: none; }
.widgets-date { display: grid; padding: 4px 6px 6px; }
.widgets-date strong { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.widgets-date span { font-size: 15px; color: var(--fg-2); }
.widget { padding: 12px 14px; border-radius: 18px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.widget h3 { font-size: 11.500px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.widget-list, .widget-awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.widget-list button, .widget-list a, .widget-post { color: inherit; text-decoration: none; display: grid; gap: 1px; width: 100%; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; text-align: left; cursor: pointer; }
.widget-list button:hover, .widget-list a:hover, .widget-post:hover { background: var(--fill-2); }
.widget strong { font-size: 14px; font-weight: 600; }
.widget-list span, .widget-post span, .widget-awards small { font-size: 12.500px; color: var(--fg-2); }
.widget-awards li { display: grid; grid-template-columns: 62px 1fr; align-items: baseline; gap: 8px; padding: 6px 0; }
.widget-awards li + li { border-top: 1px solid var(--line); }
.widget-awards b { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.widget-awards span { display: grid; }

/* Phone status bar and the row above the Dock */
.menubar-status, .phone-row { display: none; }
:root[data-device='phone'] .menubar-tk, :root[data-device='phone'] .menubar-icon { display: none; }
:root[data-device='phone'] .menubar { padding: 0 22px 0 26px; }
:root[data-device='phone'] .menubar-left { order: 2; }
:root[data-device='phone'] .menubar-right { flex: 1; justify-content: space-between; }
:root[data-device='phone'] .menubar-clock { order: -1; padding: 0; font-size: 16px; }
:root[data-device='phone'] .menubar-status { display: inline-flex; align-items: flex-end; gap: 2px; height: 34px; padding: 0 0 11px 10px; }
.menubar-status i { width: 3px; border-radius: 1px; background: currentColor; }
.menubar-status i:nth-child(1) { height: 4px; } .menubar-status i:nth-child(2) { height: 6px; } .menubar-status i:nth-child(3) { height: 9px; } .menubar-status i:nth-child(4) { height: 12px; }
.menubar-status b { width: 24px; height: 11.500px; margin-left: 6px; border-radius: 3.500px; background: currentColor; }
:root[data-device='phone'] .phone-row { position: absolute; left: 0; right: 0; bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--dock-size) + 38px); z-index: 500; display: flex; justify-content: center; align-items: center; gap: 10px; transition: opacity .5s; }
.phone-search, :root[data-device='phone'] .menubar-ring { height: 32px; border-radius: 16px; background: var(--glass-bg); box-shadow: inset 0 0 0 1px var(--glass-edge); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-size: 13px; }
.phone-search { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; color: var(--fg-2); font-weight: 500; }
:root[data-device='phone'] .menubar-ring { margin: 0; }
.is-locked .phone-row { opacity: 0; pointer-events: none; }
:root[data-device='phone'] .widgets { bottom: auto; max-height: calc(100% - 60px); }
.widget-films { list-style: none; margin: 0; padding: 0; }
.widget-films li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; }
.widget-films li + li { border-top: 1px solid var(--line); }
.widget-films a { min-width: 0; color: inherit; text-decoration: none; display: flex; align-items: baseline; gap: 6px; }
.widget-films a:hover strong { text-decoration: underline; }
.widget-films strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-films small { color: var(--fg-3); font-size: 12px; }
.widget-films span { color: #ffb020; font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
.widget-more { display: inline-block; margin-top: 8px; font-size: 12.500px; color: var(--accent); text-decoration: none; cursor: pointer; }

/* Dock auto-hide */
.dock-wrap.is-hidden { transform: translateY(calc(100% + 14px)); }
.dock-wrap.is-hidden .dock { pointer-events: none; }
.dock-edge { position: absolute; inset: auto 0 0 0; height: 5px; z-index: 499; }
:root[data-device='phone'] .dock-edge { display: none; }

/* Mission Control */
.mission { position: absolute; inset: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 62%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: lock-in .25s ease-out; }
.mission-spaces { position: absolute; inset: calc(var(--menubar) + 14px) 0 auto 0; display: flex; justify-content: center; gap: 14px; }
.mission-space { display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--fg-2); text-decoration: none; cursor: pointer; }
.mission-thumb { display: grid; place-items: center; width: 132px; height: 78px; border-radius: 10px; background: #000; box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .15s, transform .2s var(--ease); background-repeat: no-repeat; }
.mission-thumb-home { background-image: radial-gradient(circle at 50% 52%, #3aa4f6 0 5px, transparent 6px), linear-gradient(90deg, var(--ink) 0 38%, transparent 38% 62%, var(--ink) 62%); background-size: auto, 100% 12px; background-position: center, center; opacity: .95; }
.mission-thumb-create { background-image: radial-gradient(circle, #3aa4f6 0 4px, transparent 5px); background-size: 20px 20px; background-position: center; background-repeat: repeat; -webkit-mask: linear-gradient(#000, #000) center / 64% 40% no-repeat; mask: linear-gradient(#000, #000) center / 64% 40% no-repeat; background-color: transparent; }
.mission-space.is-current .mission-thumb { box-shadow: inset 0 0 0 2px var(--accent); }
.mission-space:hover .mission-thumb, .mission-space:focus-visible .mission-thumb { transform: translateY(-2px); }
.mission-space:hover, .mission-space.is-current { color: var(--fg); }
.mission-ring .mission-thumb { width: 96px; background: var(--fill); }
.mission-empty { position: absolute; inset: 55% 0 auto 0; text-align: center; color: var(--fg-3); }
.is-mission .window { transition: transform .38s var(--ease); cursor: pointer; }
.is-mission.is-mission-still .window { transition: none; }
.is-mission .window .window-shield { display: block !important; inset: 0; z-index: 9; }
.is-mission .window::after { content: attr(data-mission-title); position: absolute; left: 0; right: 0; bottom: calc(-32px / var(--ms, 1)); text-align: center; font-size: calc(14px / var(--ms, 1)); font-weight: 600; color: var(--fg); text-shadow: 0 1px 6px var(--bg); pointer-events: none; }
.is-mission .window { overflow: visible; }
.is-mission .window > .window-body, .is-mission .window > .window-bar { border-radius: inherit; }
.is-mission .dock-wrap { transform: translateY(calc(100% + 14px)); }

/* Phone App Library: the page to the right of the home screen */
.app-library { display: none; }
:root[data-device='phone'] .app-library { display: block; position: absolute; inset: 0; z-index: 520; }
.app-library.is-away { visibility: hidden; }
/* the veil covers the whole home screen and only fades, so no panel edge ever crosses the wallpaper */
.library-veil { position: absolute; inset: 0; opacity: var(--shown, 0); background: color-mix(in srgb, var(--bg) 58%, transparent); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); }
/* the apps slide in from the right, and come up to full strength a little after they start to move */
.library-page { position: absolute; inset: var(--menubar) 0 0 0; padding: 10px 20px 40px; overflow-y: auto; transform: translate3d(calc((1 - var(--shown, 0)) * 100%), 0, 0); opacity: clamp(0, calc(var(--shown, 0) * 1.6 - .15), 1); touch-action: pan-y; will-change: transform; }
.app-library.is-settling .library-page { transition: transform .34s var(--ease), opacity .34s var(--ease); }
.app-library.is-settling .library-veil { transition: opacity .34s var(--ease); }
.library-field { position: relative; display: block; height: 52px; margin: 6px 4px 22px; border-radius: 26px; color: var(--fg-2); background: color-mix(in srgb, var(--fg) 13%, transparent); box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), inset 0 0 0 1px rgb(255 255 255 / 10%), 0 8px 24px rgb(0 0 0 / 18%); }
/* the magnifier and the words sit centred together when the field is idle, and move to the left edge when it is in use */
.library-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; font: 500 20px var(--display); white-space: nowrap; pointer-events: none; }
.library-field:focus-within .library-hint, .library-field:has(.library-search:not(:placeholder-shown)) .library-hint { justify-content: flex-start; }
.library-field:has(.library-search:not(:placeholder-shown)) .library-hint span { visibility: hidden; }
.library-search { position: absolute; inset: 0; width: 100%; padding: 0 18px 0 47px; border-radius: inherit; background: none; border: 0; outline: 0; font: 500 20px var(--display); color: var(--fg); -webkit-appearance: none; appearance: none; user-select: text; -webkit-user-select: text; }
.library-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.library-pods { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; padding: 0 4px; }
.library-pod h3 { margin-top: 9px; text-align: center; font-size: 14px; font-weight: 500; color: var(--fg-2); }
.library-pod-icons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; aspect-ratio: 1; border-radius: 30px; background: color-mix(in srgb, var(--fg) 11%, transparent); box-shadow: inset 0 1px 0 rgb(255 255 255 / 20%), inset 0 0 0 1px rgb(255 255 255 / 9%), 0 10px 28px rgb(0 0 0 / 20%); }
.library-pod-icons button { display: grid; place-items: center; min-width: 0; cursor: pointer; }
.library-pod-icons .app-icon { width: 100%; height: auto; }
.library-pod-icons button:active .app-icon, .library-row:active .app-icon { filter: brightness(.75); }
.library-results { display: grid; padding: 0 6px; }
.library-row { display: flex; align-items: center; gap: 14px; padding: 9px 4px; font-size: 17px; text-align: left; color: var(--fg); }
.library-row + .library-row { border-top: 1px solid var(--line); }
.library-row .app-icon { width: 44px; height: 44px; }
.is-locked .app-library { visibility: hidden; }

/* Intro: paper from the first paint (set by the head script), then the canvas the signature is written on. */
html.js[data-intro]::before { content: ''; position: fixed; inset: 0; z-index: 940; background: #fdfdfb; }
.intro { position: fixed; inset: 0; z-index: 950; width: 100%; height: 100%; display: block; cursor: default; }
