Files
unkernel/web/src/style.css

784 lines
48 KiB
CSS

/* SPDX-License-Identifier: MIT */
/* Copyright (C) 2026 Pooya Parsa <pooya@pi0.io> */
/* The page's styles: Tailwind, with a black, minimal theme in the manner of
Vercel's Geist (Geist Sans and Geist Mono, a gray scale on black, one
accent per state): a desktop of slightly rounded windows on a dark
wallpaper with a translucent Dock, plain black menus and popovers
(.popover), macOS-like alerts, cards and toast on a flat near-black
surface (.alert, components/Dialog.tsx), and rounded buttons and fields
(.btn, .field). wterm brings its own stylesheet (src/boot.ts); its
colours and font are set on the terminals (#workspace .wterm) below.
In order: the theme and the tokens (sizes, stacking, materials; then the
platforms' and touch's values), the base, the components, then the
page's parts: the wallpaper, the windows, the terminals, the system apps,
the top bar, the Dock and the shortcuts HUD. */
@import "tailwindcss";
@import "@fontsource-variable/geist";
@import "@fontsource-variable/geist-mono";
/* ---- theme and tokens ---------------------------------------------------- */
@theme {
--font-sans: "Geist Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
--font-mono: "Geist Mono Variable", ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", "DejaVu Sans Mono", Menlo, Consolas, "Liberation Mono", monospace;
--color-bg: #000;
--color-surface: #0a0a0a;
--color-hover: #1a1a1a;
--color-line: #242424;
--color-line-strong: #333;
--color-fg: #ededed;
--color-muted: #a1a1a1;
--color-faint: #7d7d7d; /* 5:1 on black */
--color-ok: #45d483;
--color-warn: #f5a524;
--color-err: #ff6166;
--color-off: #8f8f8f;
--color-accent: #52a8ff;
}
:root {
color-scheme: dark;
--sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
--st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
/* The Dock's strip height (the workspace ends above it), without the bottom safe area. */
--dock-h: 60px;
/* Extra side padding of the Dock where the screen's or window's bottom corners are round (iOS and macOS, below). */
--sc: 0px;
/* The Dock's tiles; the window title bar, its compact strip, the resize
edges' width (components/Window.tsx) and the title buttons' width. */
--dock-tile: 40px;
--wm-title: 34px;
--wm-strip: 30px;
--wm-edge: 8px;
--wm-btn: 30px;
/* The top bar (#topbar below): its height; the space the workspace leaves
for it (none while the on-screen keyboard is up); the shadow of its text
and icons; its status cluster's padding and gap. */
--tb-h: 28px;
--tb-space: var(--tb-h);
--tb-shadow: 0 1px 2px rgb(0 0 0 / 55%);
--tb-pad: 3px;
--tb-gap: 1px;
/* Stacking, bottom to top. In #app (fixed, so a stacking context of its
own; components/App.tsx): the wallpaper; the desktop (#desktop, its workspace #workspace) and the
Dock (#dock), no z-index; the
Resume card over the desktop (Overlays.tsx); the top bar over it; the
guest's display covering the whole page, top bar and Dock included
(Display.tsx #fb-cover). Over #app, in <body>: the failure card before
the page module runs (index.html #boot-error, fallback 30), the
launcher, the shortcuts HUD while the prefix is armed (KeysHud.tsx),
the toast, and the menus (Menu.tsx, portaled into <body>);
the dialogs (Dialog.tsx) are native modal <dialog>s, in the top layer
over all of it. In the workspace (#workspace, isolated): the wallpaper
photo's credit, the windows (wm.ts and wmfx.ts set theirs inline: 2, 4,
6... by z-order, a closing ghost on an odd one, the snap preview at its
window's), and wland's container over every window (WaylandOutput.tsx). In a
window (.wm-win): its resize edges, a Wayland window's element over
them. Smaller numbers inside a component (Display.tsx's content,
Launcher.tsx's folder, the key hints) are local to that component's
own stacking context. */
--z-wallpaper: -1;
--z-resume: 20;
--z-topbar: 21;
--z-cover: 22;
--z-boot-error: 30;
--z-launcher: 35;
--z-hud: 38;
--z-toast: 40;
--z-menu: 50;
--z-credit: 0;
--z-wl-desktop: 10000;
--z-win-edge: 2;
--z-win-wland: 3;
/* Glass, the material of the Dock's pill (.dock-pill::before) and the snap
preview (.wm-snap): a dark tint (--glass-bg), the blur of what is
behind (--glass-blur), an edge brighter at the top than at the bottom
(--glass-border), a sheen down from the top (--glass-sheen), and the
shadows, the inset ones a light top edge and a dark bottom one
(--glass-shadow). */
--glass-bg: rgb(14 14 14 / 50%);
--glass-blur: blur(26px) saturate(1.8);
--glass-border: rgb(255 255 255 / 20%) rgb(255 255 255 / 11%) rgb(255 255 255 / 7%);
--glass-sheen: linear-gradient(rgb(255 255 255 / 9%), rgb(255 255 255 / 2%) 50%, rgb(255 255 255 / 0%));
--glass-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -1px 0 rgb(0 0 0 / 28%), 0 12px 36px rgb(0 0 0 / 45%), 0 2px 6px rgb(0 0 0 / 30%);
/* The shortcuts HUD's panel (.hud-panel below): the glass's blur under a
darker flat tint, so the keys read over a busy terminal. */
--hud-bg: rgb(14 14 14 / 62%);
/* Alerts, cards and the toast (.alert, .toast below): flat, no sheen and no blur. */
--alert-bg: #121212;
--alert-border: rgb(255 255 255 / 11%);
--alert-shadow: 0 24px 64px rgb(0 0 0 / 60%), 0 4px 14px rgb(0 0 0 / 40%);
--alert-dim: rgb(0 0 0 / 32%);
}
/* No backdrop blur: the tints alone, nearly opaque. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
:root { --glass-bg: rgb(18 18 18 / 94%); --hud-bg: rgb(18 18 18 / 95%); }
}
/* A macOS window outside fullscreen (main.tsx): its bottom corners are round. */
:root.mac-window { --sc: 8px; }
/* iOS (only its WebKit knows -webkit-touch-callout): the page keeps the top
safe area (status bar, notch, Dynamic Island) and three quarters of the
bottom one (25 px on a Face ID iPhone in portrait). The Dock sits that far
above the bottom edge, over the wallpaper that goes on under the home
indicator, and keeps its ends away from the round corners by half the
bottom inset. Not while the on-screen keyboard is up (App.tsx sets kb):
nothing is at the screen's bottom edge then. */
@supports (-webkit-touch-callout: none) {
:root { --sb: calc(env(safe-area-inset-bottom, 0px) * 0.75); --sc: calc(env(safe-area-inset-bottom, 0px) / 2); }
:root.kb { --sb: 0px; --sc: 0px; }
/* A home screen app (iOS 26+): iOS fades the page's top 20 px or so under
the status bar, and a page cannot turn that off, so what is at the top
starts below it. */
@media (display-mode: standalone) {
:root { --st: calc(env(safe-area-inset-top, 0px) + 24px); }
}
}
/* Touch (config.ts: a coarse pointer or a mobile user agent): wider targets.
--hit is a touch target's height (a button, a field, a tab strip; a title
button's width), --hit-pad a touch-sized button's side padding; only set
here, so only for rules under (pointer: coarse). */
@media (pointer: coarse) {
:root {
--hit: 40px; --hit-pad: 14px;
--wm-title: 40px; --wm-strip: 34px; --wm-edge: 14px; --wm-btn: var(--hit);
--tb-h: 32px;
}
}
/* ---- base ---------------------------------------------------------------- */
@layer base {
html, body {
height: 100%; overflow: hidden; overscroll-behavior: none;
background: var(--color-bg); color: var(--color-fg);
font: 14px/1.5 var(--font-sans);
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
/* Inside the Dock, where an outer ring would be clipped. */
#dock :focus-visible { outline-offset: -2px; }
[hidden] { display: none !important; }
}
/* ---- components: controls, popovers, alerts and the toast ----------------- */
@layer components {
/* Buttons, rounded as on macOS: secondary (a quiet light tint), primary
(white, black text) and danger (red, white text). .btn-alert: an
alert's or card's (Dialog.tsx), 44 px tall on coarse pointers.
aria-disabled dims one that keeps its focus (an untrusted OK). */
.btn {
@apply inline-flex h-8 items-center justify-center gap-2 rounded-lg border border-white/8 bg-white/9 px-3.5 font-sans text-[13px] font-medium whitespace-nowrap text-fg transition-colors select-none;
&:hover { @apply bg-white/14; }
&:active { @apply bg-white/18; }
&[aria-disabled="true"], &:disabled { @apply cursor-default opacity-50; }
}
.btn-primary {
@apply border-transparent bg-fg text-black;
&:hover, &:active { @apply bg-white; }
}
.btn-danger {
@apply border-transparent bg-[#d93036] text-white;
&:hover, &:active { @apply bg-[#e5484d]; }
}
.btn-sm { @apply h-7 rounded-md px-2.5 text-[12.5px]; }
.btn-alert {
@apply h-8 rounded-[9px] px-3.5;
@media (pointer: coarse) { height: 44px; border-radius: 12px; font-size: 14px; }
}
/* Menus and popovers (Menu.tsx): plain black, no
sheen and no blur, with a thin even edge. The corner radius is the
element's own (rounded-*). */
.popover {
border: 1px solid var(--color-line-strong); background: #000;
box-shadow: 0 12px 36px rgb(0 0 0 / 55%), 0 2px 6px rgb(0 0 0 / 35%);
}
/* Inputs, selects and text areas: rounded, a faint tint, the accent's ring when focused; their text in mono. */
.field {
@apply rounded-lg border border-white/12 bg-white/4 font-mono text-fg transition-[border-color,box-shadow] outline-none placeholder:text-faint;
&:hover { @apply border-white/20; }
&:focus-visible { @apply border-accent/70 outline-none ring-3 ring-accent/25; }
}
/* Range: a thin track, filled up to the thumb (--fill, set inline), and a
square thumb, var(--thumb) wide (set on a parent, so the tick labels
under it can line up with it). --tone: the track and thumb colour (the
CPUs slider: red past the suggested count). */
.slider {
appearance: none; height: 18px; background: transparent; cursor: pointer;
&::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--tone, var(--color-fg)) var(--fill), var(--color-line-strong) var(--fill)); }
&::-moz-range-track { height: 2px; background: linear-gradient(to right, var(--tone, var(--color-fg)) var(--fill), var(--color-line-strong) var(--fill)); }
&::-webkit-slider-thumb { appearance: none; width: var(--thumb, 12px); height: 14px; margin-top: -6px; background: var(--tone, var(--color-fg)); border: 2px solid var(--color-surface); box-sizing: content-box; }
&::-moz-range-thumb { width: var(--thumb, 12px); height: 14px; background: var(--tone, var(--color-fg)); border: 2px solid var(--color-surface); border-radius: 0; box-sizing: content-box; }
&:hover::-webkit-slider-thumb { background: var(--tone, #fff); }
&:hover::-moz-range-thumb { background: var(--tone, #fff); }
&:focus-visible { outline: none; }
&:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--color-accent); }
&:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--color-accent); }
}
/* Alerts, sheets and cards (components/Dialog.tsx: the confirm and paste
dialogs, the Resume card, the failure card) and the toast: a flat
near-black surface (--alert-bg) with a thin even edge and a soft shadow,
16 px corners, the text centred in Geist Sans. A modal one is a native
<dialog> (centred in the top layer, margin auto) over a light dim
(--alert-dim) with the page faintly blurred; .alert-top puts it near the
top instead (the paste dialog, clear of the on-screen keyboard). Each
scales and fades in; not with reduced motion (below). */
.alert {
width: min(280px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); margin: auto; padding: 20px;
overflow-y: auto; overscroll-behavior: contain;
border: 1px solid var(--alert-border); border-radius: 16px;
background: var(--alert-bg); color: var(--color-fg); box-shadow: var(--alert-shadow);
font: 13px/1.4 var(--font-sans); text-align: center;
animation: alert-in .18s cubic-bezier(.2, .8, .2, 1);
}
.alert-wide { width: min(360px, calc(100vw - 32px)); }
.alert-sheet { width: min(440px, calc(100vw - 24px)); }
dialog.alert::backdrop {
background: var(--alert-dim);
-webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
animation: alert-dim-in .18s ease-out;
}
dialog.alert-top { margin-top: max(calc(var(--st) + 12px), 12vh); }
.alert-title { margin-top: 12px; font-size: 13px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.alert-msg { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--color-muted); overflow-wrap: anywhere; }
.alert-detail {
max-height: 10rem; margin-top: 10px; padding: 6px 10px; overflow-y: auto;
border: 1px solid rgb(255 255 255 / 8%); border-radius: 8px; background: rgb(255 255 255 / 5%);
font: 11.5px/1.45 var(--font-mono); text-align: left; word-break: break-all; user-select: text; -webkit-user-select: text;
}
.alert-hint { margin-top: 8px; font-size: 11.5px; line-height: 1.45; color: var(--color-faint); }
/* The buttons: side by side, equal, cancel first; stacked, the default on top, once they do not fit. */
.alert-actions { display: flex; flex-wrap: wrap-reverse; gap: 8px; margin-top: 16px; }
.alert-actions > * { flex: 1 1 0; min-width: fit-content; }
/* The toast: a notification under the top bar, at the top right (in the
middle on narrow screens); it slides in and fades; only one with a
button takes presses. */
.toast {
position: fixed; z-index: var(--z-toast); top: calc(var(--st) + var(--tb-space) + 8px); right: max(10px, var(--sr));
display: flex; align-items: center; gap: 10px; max-width: min(380px, calc(100vw - 20px));
padding: 9px 12px 9px 10px; border: 1px solid var(--alert-border); border-radius: 14px;
background: var(--alert-bg); color: var(--color-fg); box-shadow: var(--alert-shadow);
font: 12.5px/1.4 var(--font-sans);
pointer-events: none; opacity: 0; translate: 0 -6px;
transition: opacity .18s, translate .18s cubic-bezier(.2, .8, .2, 1);
&[data-show] { opacity: 1; translate: 0 0; }
&[data-show][data-action] { pointer-events: auto; }
@media (pointer: coarse) { & .btn { height: var(--hit); padding-inline: var(--hit-pad); } }
@media (max-width: 639.98px) { right: auto; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px - var(--sl) - var(--sr)); }
}
}
/* An alert or card appearing (.alert), and a modal one's dim. */
@keyframes alert-in { from { opacity: 0; transform: scale(.96); } }
@keyframes alert-dim-in { from { opacity: 0; } }
/* ---- the wallpaper (components/Wallpaper.tsx, desktop.ts) -------------------
The default wallpaper: a faint light from the top, and the mark faintly
in the middle of the workspace. Another one (desktop.ts, Settings >
Desktop) is #wallpaper (components/Wallpaper.tsx): the first child of
#app, at --z-wallpaper (-1) in #app's stacking context (fixed), so over
#app's background and under everything else; a still layer, no pointer
events. Under it the mark goes (data-wallpaper-kind on the root). The
root's data-wallpaper="light|dark" and --wallpaper-luma (0 to 1, after
the dim) say how bright the wallpaper is under the top bar and the Dock. */
#app { background: radial-gradient(130% 90% at 50% -10%, #171717 0%, #070707 55%, #000 100%); }
#desktop {
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='.5' y='.5' width='31' height='31' rx='7.5' stroke-opacity='.05'/%3E%3Cpath d='M9 11l5.5 5L9 21M16.5 21.5H23' stroke-width='2.4' stroke-opacity='.07'/%3E%3C/svg%3E") center / 112px no-repeat;
}
:root[data-wallpaper-kind="preset"] #desktop, :root[data-wallpaper-kind="photo"] #desktop { background: none; }
.wallpaper { position: absolute; inset: 0; z-index: var(--z-wallpaper); overflow: hidden; pointer-events: none; contain: strict; }
.wallpaper > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.wallpaper > img { object-fit: cover; user-select: none; -webkit-user-select: none; }
.wallpaper > .wp-default { background: radial-gradient(130% 90% at 50% -10%, #171717 0%, #070707 55%, #000 100%); }
.wallpaper > .wp-in { animation: wp-in .45s ease-out both; }
.wallpaper > .wp-dim { transition: background-color .2s; }
@keyframes wp-in { from { opacity: 0; } }
/* The photo's credit (Wallpaper.tsx WallpaperCredit, in #workspace under the
windows): plain small text, faint on a dark wallpaper, dark on a light one.
Not selectable: a long press on the empty desktop would otherwise select
it, the only text there. */
.wp-credit {
position: absolute; right: 10px; bottom: 6px; z-index: var(--z-credit); max-width: 40%;
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
font-size: 10.5px; line-height: 1.3; color: rgb(255 255 255 / 38%); text-decoration: none;
transition: color .15s; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.wp-credit:hover, .wp-credit:focus-visible { color: rgb(255 255 255 / 80%); }
:root[data-wallpaper="light"] .wp-credit { color: rgb(0 0 0 / 42%); }
:root[data-wallpaper="light"] .wp-credit:hover, :root[data-wallpaper="light"] .wp-credit:focus-visible { color: rgb(0 0 0 / 78%); }
/* ---- the windows (components/Workspace.tsx, Window.tsx, SnapPreview.tsx; wm.ts) ----
A window: slightly rounded, a subtle border and shadow; the focused one a
little brighter. Maximized (and every window in compact mode) it is flat. */
.wm-win {
border: 1px solid #262626; border-radius: 10px; background: #0a0a0a;
box-shadow: 0 14px 40px rgb(0 0 0 / 50%), 0 2px 6px rgb(0 0 0 / 35%);
}
.wm-win[data-focused] { border-color: #363636; box-shadow: 0 22px 64px rgb(0 0 0 / 70%), 0 2px 8px rgb(0 0 0 / 40%); }
.wm-win[data-max] { border-width: 0; border-radius: 0; box-shadow: none; }
/* Hidden (Window.tsx data-hidden: minimized; in compact mode, not the top
one), except while it flies into the Dock (wmfx.ts data-fx "out"). */
.wm-win[data-hidden]:not([data-fx="out"]) { visibility: hidden; }
.wm-title {
height: var(--wm-title); border-radius: 9px 9px 0 0; border-bottom: 1px solid #1d1d1d;
background: #111; color: var(--color-muted); cursor: default;
}
.wm-win[data-focused] .wm-title { background: #161616; color: var(--color-fg); }
.wm-win[data-max] .wm-title { border-radius: 0; }
.wm-btn { width: var(--wm-btn); }
.wm-strip { height: var(--wm-strip); border-bottom: 1px solid var(--color-line); background: #0a0a0a; }
.wm-strip .wm-btn { width: 44px; }
/* A tab strip in it (wm.ts titleContent: the Terminal windows'): touch-sized tabs. */
@media (pointer: coarse) { .wm-strip:has(.tabs) { height: var(--hit); } }
/* The on-screen keyboard is up: every row counts. */
:root.kb .wm-strip { display: none; }
.wm-body { overflow: hidden; border-radius: 0 0 9px 9px; background: #000; }
.wm-win[data-frame="none"] .wm-body { border-radius: 9px; }
.wm-win[data-max] .wm-body { border-radius: 0; }
/* A Wayland app's window (wayland/host.ts): its popups (menus) reach past
it, so its body clips nothing. Frameless (the app draws its own frame and
shadow): no border, background or shadow either. Decorated (server-side
decorations: the WM's frame), the app's content reaches the bottom
corners, which are square. wland's window element sits above the resize
edges, so the app's own borders and shadows (canvases) take presses
before them. */
.wm-win[data-frame="none"]:has(> .wm-body[data-app="wayland"]) { border: 0; border-radius: 0; background: none; box-shadow: none; }
.wm-win[data-frame="normal"]:not([data-max]):has(> .wm-body[data-app="wayland"]) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wm-win .wm-body[data-app="wayland"] { overflow: visible; border-radius: 0; background: none; }
.wm-body[data-app="wayland"] > .wland-window { z-index: var(--z-win-wland); }
.wm-body[data-app="terminal"] { padding: 6px 2px 2px 10px; }
#app.compact .wm-body[data-app="terminal"] { padding: 4px 2px 2px 8px; }
/* Resize edges and corners, half outside the frame. */
.wm-edge { position: absolute; z-index: var(--z-win-edge); touch-action: none; }
.wm-edge-n, .wm-edge-s { left: var(--wm-edge); right: var(--wm-edge); height: var(--wm-edge); cursor: ns-resize; }
.wm-edge-e, .wm-edge-w { top: var(--wm-edge); bottom: var(--wm-edge); width: var(--wm-edge); cursor: ew-resize; }
.wm-edge-n { top: calc(var(--wm-edge) / -2); }
.wm-edge-s { bottom: calc(var(--wm-edge) / -2); }
.wm-edge-e { right: calc(var(--wm-edge) / -2); }
.wm-edge-w { left: calc(var(--wm-edge) / -2); }
.wm-edge-ne, .wm-edge-nw, .wm-edge-se, .wm-edge-sw { width: calc(var(--wm-edge) * 1.5); height: calc(var(--wm-edge) * 1.5); }
.wm-edge-ne { top: calc(var(--wm-edge) / -2); right: calc(var(--wm-edge) / -2); cursor: nesw-resize; }
.wm-edge-sw { bottom: calc(var(--wm-edge) / -2); left: calc(var(--wm-edge) / -2); cursor: nesw-resize; }
.wm-edge-nw { top: calc(var(--wm-edge) / -2); left: calc(var(--wm-edge) / -2); cursor: nwse-resize; }
.wm-edge-se { bottom: calc(var(--wm-edge) / -2); right: calc(var(--wm-edge) / -2); cursor: nwse-resize; }
/* A move or resize in progress (wm.ts follow()): nothing under the pointer takes it, no text is selected. */
:root.wm-dragging, :root.wm-dragging * { cursor: var(--wm-cursor) !important; user-select: none !important; -webkit-user-select: none !important; }
:root.wm-dragging iframe, :root.wm-dragging canvas { pointer-events: none; }
/* Where a moved window would snap (components/SnapPreview.tsx): a light
glass outline over the target, under the window; it fades and scales in
(data-on) and out. Maximized, its target meets the workspace's edges. */
.wm-snap {
position: absolute; pointer-events: none; border-radius: 12px;
border: 1px solid; border-color: var(--glass-border);
background: var(--glass-sheen), rgb(255 255 255 / 7%);
-webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 14%), 0 0 0 1px rgb(0 0 0 / 25%), 0 16px 48px rgb(0 0 0 / 35%);
opacity: 0; transform: scale(.97);
transition: opacity .12s ease-out, transform .16s cubic-bezier(.2, .8, .2, 1);
}
.wm-snap[data-on] { opacity: 1; transform: none; }
.wm-snap[data-zone="max"] { border-radius: 6px; }
/* ---- the terminals (wterm: terminal 0 is #term, boot.ts; the others are
.term-pty, wterms.ts), the tabs of the Terminal windows (termtabs.ts):
stacked in their window's box, so they share its size -------------------
Each is its own scroll container (wterm sets overflow-y once there is
scrollback), so it must not set overflow itself. The gutter keeps the
column count when the bar appears; phones draw their own overlay bar
while scrolling. Hidden tabs (and windows) are hidden with visibility
(and inert, termtabs.ts and Window.tsx), so they keep their size and
their grid. */
.term-stack { position: relative; width: 100%; height: 100%; }
.term-stack > .term-tab { position: absolute; inset: 0; }
.term-stack > .term-hidden { visibility: hidden; }
#workspace .wterm {
width: 100%; height: 100%; padding: 0; border-radius: 0; box-shadow: none;
scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #333 transparent;
overscroll-behavior: contain;
--term-font-family: var(--font-mono);
--term-fg: #ededed; --term-bg: #000; --term-cursor: #ededed;
--term-selection-bg: rgb(255 255 255 / 22%);
--term-color-0: #333333; --term-color-1: #ff6166; --term-color-2: #45d483; --term-color-3: #f5a524;
--term-color-4: #52a8ff; --term-color-5: #c472fb; --term-color-6: #0ac7b4; --term-color-7: #d4d4d4;
--term-color-8: #737373; --term-color-9: #ff8589; --term-color-10: #7ee2a8; --term-color-11: #ffc96b;
--term-color-12: #8ec5ff; --term-color-13: #d9a6fd; --term-color-14: #5fe0d0; --term-color-15: #ffffff;
}
/* A Terminal window's content is glass, focused or not: the desktop and the
windows behind show through the terminal, blurred. Only the content: the
border, the title bar and the tab strip stay solid. Not maximized ones
(nothing is behind them worth showing) and not in compact mode. Cells
with a colour of their own keep it. */
#app:not(.compact) .wm-win:not([data-max]):has(> .wm-body[data-app="terminal"]) { background: transparent; }
#app:not(.compact) .wm-win:not([data-max]) > .wm-body[data-app="terminal"] {
background: rgb(8 8 8 / 60%);
-webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
}
#app:not(.compact) .wm-win:not([data-max]) > .wm-body[data-app="terminal"] .wterm { background: transparent; }
.wm-win, .wm-title, .wm-strip, .wm-body { transition: background-color 0.18s; }
@media (prefers-reduced-motion: reduce) { .wm-win, .wm-title, .wm-strip, .wm-body { transition: none; } }
/* iOS zooms the page when a field under 16 px takes focus: wterm's hidden input inherits the terminal font. */
#app.mobile #workspace textarea { font-size: 16px !important; }
/* ---- the system apps (sysapps.ts: Settings and System, components/AppShell.tsx):
ordinary framed windows; their content fills the body. Coarse pointers
get touch-sized buttons and fields. */
.kw-app { width: 100%; height: 100%; }
@media (pointer: coarse) {
.kw-app .btn-sm { height: var(--hit); padding-inline: var(--hit-pad); }
.kw-app .field.h-8 { height: var(--hit); }
}
/* ---- the top bar (components/TopBar.tsx, #topbar): a thin strip across
the top, over the top safe area. The workspace (#workspace, Workspace.tsx)
starts --tb-space below the top safe area: the bar's height, or nothing
while the on-screen keyboard is up (kb, where the bar is hidden). Like
macOS's menu bar it has no background (nothing else is ever under it):
its text and icons read by their own soft shadow. Its tokens (--tb-*) are
on :root above. */
:root.kb { --tb-space: 0px; }
:root.kb #topbar { display: none; }
#topbar {
position: absolute; top: 0; left: 0; right: 0; z-index: var(--z-topbar);
display: flex; align-items: center; justify-content: space-between; gap: 12px;
height: calc(var(--st) + var(--tb-h));
padding: var(--st) max(6px, var(--sr)) 0 max(6px, var(--sl));
color: var(--color-fg); font-size: 13px; line-height: 1; white-space: nowrap; text-shadow: var(--tb-shadow);
user-select: none; -webkit-user-select: none;
}
#topbar :focus-visible { outline-offset: -2px; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 1px; height: 100%; min-width: 0; }
.tb-left { flex: 0 1 auto; }
/* The status cluster: each control as wide as its content plus --tb-pad a
side, --tb-gap between them, so the space between any two is even
(2 x --tb-pad + --tb-gap). */
.tb-right { flex: none; gap: var(--tb-gap); }
@layer components {
/* Its controls: faceless, muted until hovered, pressed or open (in the
components layer, so utilities such as text-err win). */
.tb-btn {
position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
height: calc(var(--tb-h) - 6px); min-width: 26px; padding: 0 6px; border-radius: 6px;
color: rgb(237 237 237 / 86%); transition: background-color .12s, color .12s;
&:hover, &[aria-expanded="true"], &[aria-pressed="true"] { background: rgb(255 255 255 / 13%); color: var(--color-fg); }
&:active { background: rgb(255 255 255 / 18%); }
& > svg { flex: none; filter: drop-shadow(var(--tb-shadow)); }
@media (pointer: coarse) { min-width: 34px; height: calc(var(--tb-h) - 4px); }
}
.tb-app { flex: 0 1 auto; min-width: 0; justify-content: flex-start; gap: 7px; padding: 0 8px; }
.tb-detail { color: rgb(237 237 237 / 55%); }
.tb-off { color: var(--color-faint); }
@media (max-width: 639.98px) { .tb-wide { display: none; } }
.tb-right .tb-btn {
min-width: 0; padding: 0 var(--tb-pad);
/* Touch: a larger target than it looks (the bar's height, a little past each side), no wider. */
@media (pointer: coarse) { &::after { content: ""; position: absolute; inset: -4px calc(-1 * var(--tb-pad)); } }
}
/* A resource: its icon and its bars, close together. */
.tb-meter { gap: 3px; }
}
/* The Control Center item (#tb-status, TopBar.tsx; its popover is
ControlCenter.tsx #tb-cc) shows the state: plain while the page boots and
runs, red on an error, dim once the kernel has stopped (green while
suspended: a utility on the button). */
#tb-status { color: var(--color-fg); }
#app[data-state="halted"] #tb-status { color: var(--color-off); }
#app[data-state="error"] #tb-status { color: var(--color-err); }
/* The resources (TopBar.tsx Bars: #tb-cpu, #tb-mem, #tb-disk, #tb-net, #tb-gpu):
slim bars (TopBar.tsx BAR_W x BAR_H) on faint tracks, filled in the
button's colour, amber or red when high (data-tone), dim once halted. */
.tb-track { fill: rgb(255 255 255 / 22%); }
.tb-btn[data-tone="warn"] { color: var(--color-warn); }
.tb-btn[data-tone="err"] { color: var(--color-err); }
#app[data-state="halted"] :is(#tb-cpu, #tb-mem, #tb-disk, #tb-net, #tb-gpu) { color: var(--color-off); }
/* Over a light wallpaper (desktop.ts: data-wallpaper on the root) the bar's
text and icons are dark with a light shadow, as on macOS. The amber and
red tones and the error state keep their colours. */
:root[data-wallpaper="light"] #topbar {
--tb-shadow: 0 1px 1px rgb(255 255 255 / 40%);
color: #111;
& .tb-btn:not([data-tone]) { color: rgb(17 17 17 / 88%); }
& .tb-btn:hover, & .tb-btn[aria-expanded="true"], & .tb-btn[aria-pressed="true"] { background: rgb(0 0 0 / 12%); }
& .tb-btn:not([data-tone]):is(:hover, [aria-expanded="true"], [aria-pressed="true"]) { color: #000; }
& .tb-btn:active { background: rgb(0 0 0 / 18%); }
& .tb-detail { color: rgb(17 17 17 / 60%); }
& .tb-off { color: rgb(17 17 17 / 50%); }
& .tb-track { fill: rgb(0 0 0 / 22%); }
}
:root[data-wallpaper="light"] #app:not([data-state="halted"], [data-state="error"]) #topbar #tb-status { color: #111; }
/* ---- the Dock (components/Dock.tsx): its strip (#dock) ends the workspace;
the pill floats on the wallpaper. */
#dock {
height: calc(var(--dock-h) + var(--sb));
padding: 0 max(8px, var(--sr), var(--sc)) var(--sb) max(8px, var(--sl), var(--sc));
font-size: 12px; line-height: 1;
}
/* The on-screen keyboard is up (App.tsx): the windows get the Dock's height (the key bar stays). */
:root.kb #dock { display: none; }
/* The pill: its glass (the --glass-* tokens) is a layer of its own under the
tiles (::before), so it can widen while they magnify (--grow-l, --grow-r:
Dock.tsx useMagnify) and so the menus inside the Dock blur the page behind
it rather than only the pill. The padding includes the glass's 1 px edge. */
.dock-pill {
position: relative; isolation: isolate;
display: flex; align-items: flex-start; gap: 4px; min-width: 0; max-width: 100%;
padding: 7px 7px 1px; border-radius: 17px;
}
.dock-pill::before {
content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; pointer-events: none;
left: calc(-1 * var(--grow-l, 0px)); right: calc(-1 * var(--grow-r, 0px));
border: 1px solid; border-color: var(--glass-border); border-radius: inherit;
background: var(--glass-sheen), var(--glass-bg);
-webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
box-shadow: var(--glass-shadow);
transition: left .14s ease-out, right .14s ease-out;
}
/* The window tiles scroll sideways only while they do not fit (data-scroll:
Dock.tsx useScrollFlag); otherwise nothing clips a magnified tile. */
.dock-apps { display: flex; align-items: flex-start; gap: 4px; min-width: 0; scrollbar-width: none; }
.dock-apps[data-scroll] { overflow-x: auto; }
.dock-apps::-webkit-scrollbar { display: none; }
.dock-sep {
flex: none; align-self: flex-start; width: 1px; height: calc(var(--dock-tile) - 12px); margin: 6px 3px 0;
background: rgb(255 255 255 / 16%); box-shadow: 1px 0 0 rgb(0 0 0 / 22%);
}
/* Magnification (Dock.tsx useMagnify): every item moves aside by --mx, a tile
grows by --m from its bottom edge (its dot, badge, hint and ring with it).
Nothing else scales a tile up (focus, a press): a scrolling strip would
clip it, so the other states stay within the face. */
.dock-pill > :not(.dock-apps), .dock-apps > * { transform: translateX(var(--mx, 0px)); transition: transform .14s ease-out, opacity .3s ease-out; }
.dock-pill .dock-tile { transform: translateX(var(--mx, 0px)) scale(var(--m, 1)); transform-origin: 50% 100%; }
/* A tile: the face, then a row for the running dot. The face is a faint dark
glass, so its icon (with a soft shadow) reads over a bright page as well
as over the wallpaper; hovered or pressed (its window has the focus), a
flat grey tint (lighter than the wallpaper, darker than a bright page)
and a brighter edge, the face's own size. */
/* A long press opens the tile's menu (Dock.tsx useTileMenu), not iOS's callout. */
.dock-tile { width: var(--dock-tile); height: calc(var(--dock-tile) + 7px); color: var(--color-fg); -webkit-touch-callout: none; }
.dock-face {
display: grid; place-items: center; width: var(--dock-tile); height: var(--dock-tile); border-radius: 11px;
border: 1px solid rgb(255 255 255 / 7%); background: rgb(0 0 0 / 24%);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.dock-face > svg { filter: drop-shadow(0 1px 1px rgb(0 0 0 / 45%)); }
/* An app's own colours (Dock.tsx Tile colors, as its launcher tile's): a round disc under its icon; the face stays the Dock's glass. */
.dock-disc { display: grid; place-items: center; width: 76%; height: 76%; border-radius: 50%; }
.dock-disc > svg { filter: drop-shadow(0 1px 1px rgb(0 0 0 / 45%)); }
.dock-tile:hover .dock-face {
border-color: rgb(255 255 255 / 16%); background: rgb(128 128 128 / 26%);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%);
}
.dock-tile:active .dock-face { transform: scale(.94); }
.dock-tile[aria-pressed="true"] .dock-face, .dock-tile[aria-expanded="true"] .dock-face {
border-color: rgb(255 255 255 / 26%); background: rgb(150 150 150 / 34%);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%);
}
/* The focus ring follows the face, inside it over its edge (a scrolling tile
strip clips what is outside), so it does not double a pressed face's edge. */
.dock-tile:focus-visible { outline: none; }
.dock-tile:focus-visible .dock-face { outline: 2px solid var(--color-accent); outline-offset: -2px; }
/* A pinned group's face (Dock.tsx GroupFace), the launcher's folder fan made
flat and small: the group's icon on its colour in front (the last card),
two cards in its first apps' colours tilted out behind it from their bottom
middle, a little further under the pointer; every card stays within the
face, so a scrolling strip clips nothing. */
.dock-fan { position: relative; display: block; width: 100%; height: 100%; }
.dock-fan > span {
position: absolute; left: 17%; top: 18%; width: 66%; height: 66%; border-radius: 26%;
transform-origin: 50% 100%; transform: translateX(var(--x, 0px)) rotate(var(--r, 0deg)) scale(var(--s, 1));
box-shadow: 0 1px 2px rgb(0 0 0 / 40%); transition: transform .15s ease-out;
}
.dock-fan > span[data-fan="r"] { --x: 16%; --r: 9deg; --s: .86; }
.dock-fan > span[data-fan="l"] { --x: -16%; --r: -9deg; --s: .86; }
.dock-fan > span:last-child { display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 600; line-height: 1; }
.dock-tile:not([data-off]):hover .dock-fan > span[data-fan] { transform: translateX(calc(var(--x) * 1.2)) rotate(calc(var(--r) * 1.2)) scale(var(--s)); }
@media (prefers-reduced-motion: reduce) { .dock-fan > span { transition: none; } }
/* No pinned or window tiles: the strip goes, and the separator after it. */
.dock-apps:empty { display: none; }
.dock-apps:empty + .dock-sep { display: none; }
/* The running dot, with a faint dark rim so it shows over a bright page too. */
.dock-dot { position: absolute; bottom: 1px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgb(255 255 255 / 80%); box-shadow: 0 0 0 1px rgb(0 0 0 / 30%); }
.dock-dot[data-dot="dim"] { background: rgb(255 255 255 / 38%); }
.dock-dot[data-dot="busy"] { background: var(--color-faint); animation: dock-busy 1s ease-in-out infinite alternate; }
.dock-dot[data-dot="error"] { background: var(--color-err); }
@keyframes dock-busy { to { opacity: .3; } }
/* A tile's label (Dock.tsx useDockLabel), as macOS names a Dock icon: one
line over the tile, flat black as the menus (.popover), its name, then
its state and key in a quieter tone (that part gives way first, then the
name ellipsises). In the Dock's root, outside the strip that clips while
it scrolls; z-index 1 in #app is over the windows (the workspace is
isolated) and under the menus (in <body>). Placed by a transform; no
pointer, no focus. It fades in briefly when it appears, not when it moves
to another tile, nor with reduced motion; none in compact mode. */
#dock-label {
position: absolute; top: 0; left: 0; z-index: 1;
display: flex; gap: 6px; max-width: min(280px, calc(100vw - 16px));
padding: 3px 8px; border: 1px solid var(--color-line-strong); border-radius: 7px;
background: #000; box-shadow: 0 4px 14px rgb(0 0 0 / 40%);
color: var(--color-fg); font: 500 12px/16px var(--font-sans); white-space: nowrap;
pointer-events: none; visibility: hidden; opacity: 0;
}
#dock-label[data-show] { visibility: visible; opacity: 1; transition: opacity .08s ease-out; }
#dock-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#dock-label > span + span { flex-shrink: 1000; color: var(--color-faint); font-weight: 400; }
#dock-label > span:empty { display: none; }
#app.compact #dock-label { display: none; }
@media (prefers-reduced-motion: reduce) { #dock-label[data-show] { transition: none; } }
/* A group's stack (DockStack.tsx #dock-stack, in <body>), as a macOS Dock
stack: a rounded panel of the Dock's glass (its edge, sheen, blur and
shadows) under the HUD's darker tint, so the names read over a busy
terminal, and a notch under it pointing at the tile (--notch: its middle
from the panel's left), the same tint and blur of its own, its slanted
edges drawn by its svg. Both grow out of the notch's tip with a short
spring (scale and fade); not when it replaces another stack (data-quick),
nor with reduced motion (the last rule of this file). */
.dock-stack-panel {
border: 1px solid; border-color: var(--glass-border); border-radius: 18px;
background: var(--glass-sheen), var(--hud-bg);
-webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
box-shadow: var(--glass-shadow);
transform-origin: var(--notch) calc(100% + 8px);
}
.dock-stack-notch {
position: absolute; top: calc(100% - 1px); left: calc(var(--notch) - 9px); width: 18px;
clip-path: polygon(0 0, 100% 0, 50% 100%);
background: var(--hud-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
transform-origin: 50% 100%;
}
.dock-stack-notch > svg { display: block; width: 100%; height: 100%; fill: none; stroke: rgb(255 255 255 / 11%); stroke-width: 2; }
.dock-stack-panel, .dock-stack-notch { animation: dock-stack-in .26s cubic-bezier(.3, 1.3, .55, 1) both; }
.dock-stack[data-quick] > * { animation: none; }
@keyframes dock-stack-in { from { opacity: 0; transform: scale(.35); } 45% { opacity: 1; } }
/* An app being installed (installer.ts): a thin bar over the bottom of its
tile's face, the Dock's (Dock.tsx) and the launcher's (Launcher.tsx), as
macOS draws a download on its Dock icon; white, red once failed, a
sliding piece while nothing is known yet. Placed by its tile. */
.tile-progress {
position: absolute; height: 3px; overflow: hidden; border-radius: 2px; pointer-events: none;
background: rgb(0 0 0 / 60%); box-shadow: 0 0 0 1px rgb(255 255 255 / 14%);
}
.tile-progress > span { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--color-fg); transition: width .3s ease-out; }
.tile-progress[data-failed] > span { background: var(--color-err); }
.tile-progress[data-indeterminate] > span { width: 40% !important; animation: inst-slide 1.3s ease-in-out infinite; }
.dock-tile > .tile-progress { left: 8px; right: 8px; bottom: calc(7px + 6px); }
/* The installer's progress bar (components/Installer.tsx): a flat track and
its fill in the accent (red once failed); indeterminate, a short piece
sliding across. */
.inst-bar { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: rgb(255 255 255 / 10%); }
.inst-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--color-accent); transition: width .3s ease-out; }
.inst-bar[data-failed] > span { background: var(--color-err); }
.inst-bar[data-indeterminate] > span { width: 30% !important; animation: inst-slide 1.3s ease-in-out infinite; }
@keyframes inst-slide { from { left: -40%; } to { left: 100%; } }
/* What needs a running system (store.ts isRunning: the Apps tile, a
Terminal window's +) while it does not run: dimmed, no hover, no press, no
menu (data-off, aria-disabled; Dock.tsx, Tabs.tsx); a press says why in a
toast. It fades in when the system runs, in place. */
.dock-tile[data-off] { opacity: .38; cursor: default; }
.dock-tile[data-off]:hover .dock-face {
border-color: rgb(255 255 255 / 7%); background: rgb(0 0 0 / 24%);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
}
.dock-tile[data-off]:active .dock-face { transform: none; }
.tabs > button[data-off] { opacity: .38; cursor: default; background: none; color: var(--color-faint); }
.tabs > button { transition: opacity .3s ease-out, background-color .15s, color .15s; }
/* ---- the shortcuts HUD (components/KeysHud.tsx) --------------------------
While the prefix is armed: a flat glass panel (the Dock's blur under
--hud-bg, an even thin edge, a drop shadow; no sheen, no gradient) with a
drawn keyboard (.kbd), or on compact screens a sheet with a list of the
bound keys (.hud-list). Only the bound keys take the pointer. */
.hud-panel {
border: 1px solid rgb(255 255 255 / 12%); border-radius: 18px;
background: var(--hud-bg);
-webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
box-shadow: 0 16px 48px rgb(0 0 0 / 45%), 0 2px 8px rgb(0 0 0 / 30%);
}
/* Its width is set (the keyboard inside is sized by it, so it cannot size it):
the screen's less the gutters, at most the keyboard at its largest keys, and
no wider than the screen's height leaves room for. */
.hud-full { width: min(100%, 1080px, calc((100dvh - 150px) * 3.3)); max-height: 100%; overflow: hidden; padding: clamp(10px, 1.5vw, 18px); }
.hud-sheet { width: min(calc(100% - 16px), 30rem); max-height: min(60dvh, 26rem); overflow-y: auto; overscroll-behavior: contain; padding: 10px; border-radius: 16px; }
/* A key cap in a line of text (the header, the launcher's hint). */
.hud-k {
display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .4em; border-radius: 5px;
border: 1px solid rgb(255 255 255 / 16%); background: rgb(255 255 255 / 8%);
font: 500 11px/1 var(--font-mono); color: var(--color-fg);
}
/* The groups' colours (keys.ts CommandGroup): a thin bar under a key's word. */
:is(.kbd, .hud-list) [data-group="term"] { --g: var(--color-ok); }
:is(.kbd, .hud-list) [data-group="window"] { --g: var(--color-accent); }
:is(.kbd, .hud-list) [data-group="app"] { --g: rgb(255 255 255 / 50%); }
:is(.kbd, .hud-list) [data-group="machine"] { --g: var(--color-warn); }
/* The drawn keyboard: a container, so its keys are sized by its width (cqi)
in the HUD and in Settings alike. --kp: the key pitch (a 1u key and the gap
after it), --kg: the gap; 18.4 pitches across (the main block's 15, a gap,
the arrows' 3). A key of w units is w pitches less one gap wide, so every
row of the main block is the same width. */
.kbd { container: kbd / inline-size; width: 100%; overflow-x: auto; scrollbar-width: none; }
.kbd-board {
--kp: clamp(24px, calc(100cqi / 18.4), 56px);
--kg: clamp(3px, calc(var(--kp) * .09), 5px);
--kl: clamp(8px, calc(var(--kp) * .2), 11px);
--kw: clamp(7.5px, calc(var(--kp) * .185), 10.5px);
--ki: clamp(12px, calc(var(--kp) * .34), 19px);
display: grid; grid-template-columns: auto auto; column-gap: calc(var(--kp) * .4); align-items: end; justify-content: center;
}
.kbd-rows { display: flex; flex-direction: column; gap: var(--kg); }
.kbd-row { display: flex; gap: var(--kg); }
.kbd-arrows { display: grid; grid-template-columns: repeat(3, calc(var(--kp) - var(--kg))); grid-auto-rows: calc(var(--kp) - var(--kg)); gap: var(--kg); }
.kbd-other { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--kg); margin-top: calc(var(--kg) * 3); }
.kbd-other-label { margin-right: 4px; font-size: var(--kl); color: var(--color-faint); }
/* A cap: dim while nothing is bound to it; lit (data-lit) with its legend in
the corner, its command's icon and word and its group's bar; faint: a
second key of a command, or a terminal's digit with no terminal open. */
.kc {
position: relative; flex: none;
width: calc(var(--w, 1) * var(--kp) - var(--kg)); height: calc(var(--kp) - var(--kg));
border-radius: calc(var(--kp) * .16); border: 1px solid rgb(255 255 255 / 6%);
background: rgb(255 255 255 / 3.5%); color: rgb(255 255 255 / 30%);
}
.kc[data-held] { border-color: rgb(245 165 36 / 45%); color: var(--color-warn); }
.kc[data-lit] { border-color: rgb(255 255 255 / 15%); background: rgb(255 255 255 / 11%); color: var(--color-fg); }
.kc[data-lit="faint"] { border-color: rgb(255 255 255 / 9%); background: rgb(255 255 255 / 6%); color: var(--color-muted); }
.kc[data-group]::after {
content: ""; position: absolute; left: 30%; right: 30%; bottom: calc(var(--kp) * .07); height: 2px; border-radius: 1px;
background: var(--g); opacity: .8; pointer-events: none;
}
.kc[data-lit="faint"]::after { opacity: .35; }
.kc-hit {
position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
padding: calc(var(--kp) * .14) 3px calc(var(--kp) * .1); border-radius: inherit; color: inherit;
}
button.kc-hit { pointer-events: auto; }
button.kc-hit:hover { background: rgb(255 255 255 / 8%); }
button.kc-hit:active { background: rgb(255 255 255 / 15%); }
.kc-hit > svg { flex: none; width: var(--ki); height: var(--ki); }
.kc-leg { position: absolute; top: calc(var(--kp) * .07); left: calc(var(--kp) * .11); font: 500 var(--kl)/1 var(--font-mono); white-space: nowrap; opacity: .75; }
.kc-word { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--kw); line-height: 1.15; }
/* A shifted key's own command on a cap that has one too (n, and N): a chip in the top right corner. */
.kc-shift {
position: absolute; top: 2px; right: 2px; min-width: calc(var(--kl) + 6px); padding: 1px 3px 2px; border-radius: 4px;
background: rgb(255 255 255 / 10%); box-shadow: inset 0 -2px 0 var(--g);
font: 500 var(--kl)/1 var(--font-mono); color: var(--color-fg);
}
button.kc-shift { pointer-events: auto; }
button.kc-shift:hover { background: rgb(255 255 255 / 20%); }
/* Small keys: the icon alone (a key without an icon keeps its word). */
@container kbd (max-width: 820px) { .kc[data-icon] .kc-word { display: none; } }
/* The compact list: a cap and a word per bound key. */
.hud-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 4px; }
.hud-item {
display: flex; align-items: center; gap: 8px; min-width: 0; height: 40px; padding: 0 8px; border-radius: 10px;
background: rgb(255 255 255 / 6%); color: var(--color-fg); font-size: 13px; text-align: left; touch-action: manipulation;
}
.hud-item:active { background: rgb(255 255 255 / 14%); }
.hud-item > kbd { flex: none; min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 4px; border-radius: 6px; background: rgb(255 255 255 / 12%); box-shadow: inset 0 -2px 0 var(--g); font: 500 12px/1 var(--font-mono); }
.hud-item > svg { flex: none; color: var(--color-muted); }
/* ---- reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after, ::backdrop { animation: none !important; transition: none !important; } }