/* v57.dev home: a macOS 27 desktop; an iPhone home screen on touch screens (Website/design/desktop.md).
   Sizes are points measured on macOS 27.2 and iOS 27.1 (1 pt = 1 CSS px). */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --accent: #0a7aff;
  --label: #fff;
  --label-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 6px rgba(0, 0, 0, .25);
  --info: rgba(255, 255, 255, .6);
  --glass: rgba(255, 255, 255, .22);
  --glass-edge: rgba(255, 255, 255, .42);
  --menu-bg: rgba(246, 246, 248, .78);
  --menu-ink: #1d1d1f;
  --menu-dim: rgba(29, 29, 31, .32);
  --menu-line: rgba(0, 0, 0, .1);
  --win: #ffffff;
  --win-side: #f1f1f3;
  --win-ink: #1d1d1f;
  --win-dim: #86868b;
  --win-line: rgba(0, 0, 0, .09);
  --win-stripe: #f4f4f6;
  --win-cap: rgba(255, 255, 255, .7);
  --win-cap-edge: rgba(0, 0, 0, .08);
  color-scheme: light;
}
/* Light wallpaper: macOS switches the menu bar and desktop labels to dark ink. */
:root.light-wall { --label: #1d1d1f; --label-shadow: 0 0 2px rgba(255, 255, 255, .95), 0 0 7px rgba(255, 255, 255, .8); --info: rgba(29, 29, 31, .6); }
@media (prefers-color-scheme: dark) {
  :root {
    --glass: rgba(40, 40, 46, .32);
    --glass-edge: rgba(255, 255, 255, .2);
    --menu-bg: rgba(40, 40, 44, .78);
    --menu-ink: #f2f2f7;
    --menu-dim: rgba(242, 242, 247, .32);
    --menu-line: rgba(255, 255, 255, .12);
    --win: #1e1e20;
    --win-side: #2a2a2d;
    --win-ink: #f2f2f7;
    --win-dim: #98989d;
    --win-line: rgba(255, 255, 255, .09);
    --win-stripe: #26262a;
    --win-cap: rgba(255, 255, 255, .08);
    --win-cap-edge: rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font: 13px/1.3 var(--font); -webkit-font-smoothing: antialiased; background: #0b0c0e; color: var(--label); user-select: none; -webkit-user-select: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: default; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { position: fixed; inset: 40px; background: #fff; color: #000; padding: 20px 40px; }
.wall { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
/* The birds that come close fly over the widgets, the windows and the Dock, under the menu bar and menus. */
.birds-front { z-index: 45; pointer-events: none; }
#birds-back { pointer-events: none; }

.mac, .phone { display: none; }
html.is-mac .mac, html.is-phone .phone { display: block; }

/* ---------- App icons ---------- */
/* .art is a square tile; full-bleed images are masked to the squircle at 80 % of it (macOS margins). */
.art { position: relative; display: block; width: var(--s); height: var(--s); flex: none; }
.art img { display: block; width: 100%; height: 100%; }
.art.full img, .art .glyph { position: absolute; inset: 10%; width: 80%; height: 80%; border-radius: 22.4%; box-shadow: 0 calc(var(--s) * .015) calc(var(--s) * .04) rgba(0, 0, 0, .28); }
.art .glyph {
  display: grid; place-items: center; color: #fff; font: 600 calc(var(--s) * .26)/1 ui-monospace, "SF Mono", Menlo, monospace;
  background: linear-gradient(#3a3a3f, #18181b); letter-spacing: -.04em;
}
.art.folder svg, .art.trash svg { display: block; width: 100%; height: 100%; }

/* ---------- Menu bar ---------- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; height: 28px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; padding: 0 21px 0 10px;
  color: var(--label); text-shadow: 0 0 6px rgba(0, 0, 0, .18);
}
:root.light-wall .menubar { text-shadow: none; }
.mb-left { display: flex; align-items: center; height: 100%; }
.mb-item { height: 22px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 500; }
.mb-item.logo { font-weight: 700; letter-spacing: -.02em; padding: 0 10px; }
.mb-item[aria-expanded="true"], .mb-item:hover { background: rgba(255, 255, 255, .22); }
:root.light-wall .mb-item[aria-expanded="true"], :root.light-wall .mb-item:hover { background: rgba(0, 0, 0, .08); }
.mb-right { display: flex; align-items: center; gap: 6px; }
.mb-extra { display: inline-flex; align-items: center; gap: 5px; }
.mb-extra svg { color: #ff3b5c; filter: drop-shadow(0 0 4px rgba(0, 0, 0, .2)); }
.mb-clock { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: pre; }

/* Menus (pull-down and context) */
.menu {
  position: fixed; z-index: 60; min-width: 190px; padding: 5px; border-radius: 12px;
  background: var(--menu-bg); color: var(--menu-ink); text-shadow: none;
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), inset 0 0 0 .5px rgba(255, 255, 255, .35), 0 12px 40px rgba(0, 0, 0, .28);
}
.menu[hidden] { display: none; }
.menu [role="menuitem"] {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%;
  height: 24px; padding: 0 10px; border-radius: 7px; font-size: 13px; text-align: left; white-space: nowrap;
}
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus { background: var(--accent); color: #fff; outline: none; }
.menu [role="menuitem"][aria-disabled="true"] { color: var(--menu-dim); background: none; }
.menu hr { border: 0; height: 1px; background: var(--menu-line); margin: 5px 10px; }

/* ---------- Desktop ---------- */
.desk { position: fixed; top: 28px; left: 0; right: 0; bottom: 98px; }
.icons {
  list-style: none; margin: 0; padding: 0; position: absolute; top: 12px; right: 10px; bottom: 0;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 104px); grid-auto-columns: 104px;
  direction: rtl; /* macOS fills the desktop from the top-right corner, columns going left */
}
.icons li { direction: ltr; }
.dicon {
  display: flex; flex-direction: column; align-items: center; width: 104px; padding-top: 4px; cursor: pointer; position: relative;
}
.dicon .art { --s: 64px; border-radius: 8px; }
.dicon:hover .art, .dicon:focus-visible .art { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
:root.light-wall .dicon:hover .art { background: rgba(0, 0, 0, .07); box-shadow: none; }
.dicon:focus-visible { outline: none; }
.dicon .name {
  margin-top: 3px; max-width: 96px; padding: 1px 5px; border-radius: 4px; font-size: 12px; line-height: 15px; text-align: center;
  color: var(--label); text-shadow: var(--label-shadow);
}
.dicon:focus-visible .name { background: #0a64d8; color: #fff; text-shadow: none; }
.dicon .info { font-size: 11px; line-height: 13px; color: var(--info); text-shadow: var(--label-shadow); font-weight: 500; }

/* Bounce: an app with nowhere to go yet, like macOS's "can't open" bounce */
@keyframes bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-14px); } 55% { transform: translateY(0); } 75% { transform: translateY(-5px); } }
.bouncing .art { animation: bounce .6s cubic-bezier(.3, .7, .4, 1); }

/* Tooltip (Dock names, "Coming soon") */
.tip {
  position: fixed; z-index: 70; padding: 4px 11px; border-radius: 8px; font-size: 13px; white-space: nowrap; pointer-events: none;
  background: var(--menu-bg); color: var(--menu-ink); text-shadow: none;
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), 0 6px 18px rgba(0, 0, 0, .25); transform: translate(-50%, -100%);
}
.tip[hidden] { display: none; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 40;
  height: 87px; padding: 0 12px; border-radius: 26px;
  background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 40px rgba(0, 0, 0, .28);
}
.dock ul { list-style: none; margin: 0; padding: 0; height: 100%; display: flex; align-items: center; }
.dock li { display: flex; }
.dock .tile { display: block; padding: 0 2px; cursor: pointer; }
.dock .art { --s: 67px; transition: transform .18s cubic-bezier(.3, .7, .4, 1); }
.dock .tile:hover .art { transform: translateY(-4px); }
.dock .tile:active .art { filter: brightness(.75); }
.dock .sep { width: 1px; height: 65px; margin: 0 9px; background: rgba(255, 255, 255, .4); }
:root.light-wall .dock .sep { background: rgba(0, 0, 0, .18); }

/* ---------- Windows ---------- */
.win {
  position: fixed; z-index: 30; display: flex; flex-direction: column; overflow: hidden;
  background: var(--win); color: var(--win-ink); border-radius: 22px; text-shadow: none;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25), 0 22px 70px rgba(0, 0, 0, .42);
}
.win.front { z-index: 31; }
.lights { display: flex; gap: 9px; position: absolute; left: 19px; top: 19px; z-index: 2; }
.lights span { width: 14px; height: 14px; border-radius: 50%; background: #d0d0d3; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.win.front .lights span:nth-child(1) { background: #ff5f57; }
.win.front .lights span:nth-child(2) { background: #febc2e; }
.win.front .lights span:nth-child(3) { background: #28c840; }
.lights .close { position: relative; }
.lights:hover .close::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; font: 600 12px/1 var(--font); color: rgba(0, 0, 0, .55); }

/* Finder */
.finder { width: 720px; height: 380px; }
.finder .body { flex: 1; display: flex; min-height: 0; }
.finder .side { width: 160px; flex: none; background: var(--win-side); padding: 56px 8px 8px; }
.side h3 { margin: 10px 8px 4px; font-size: 11px; font-weight: 600; color: var(--win-dim); }
.side button, .side a { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 13px; text-align: left; }
.side button[aria-current="true"] { background: rgba(0, 0, 0, .07); }
@media (prefers-color-scheme: dark) { .side button[aria-current="true"] { background: rgba(255, 255, 255, .1); } }
.side svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.finder .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toolbar { height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 10px; cursor: grab; }
.cap {
  display: flex; align-items: center; height: 35px; border-radius: 18px; padding: 0 4px;
  background: var(--win-cap); box-shadow: 0 0 0 .5px var(--win-cap-edge), 0 1px 4px rgba(0, 0, 0, .07);
}
.cap i { display: grid; place-items: center; width: 34px; height: 28px; color: var(--win-dim); }
.cap i.on { background: rgba(0, 0, 0, .07); border-radius: 14px; color: var(--win-ink); }
.cap i + i { border-left: 1px solid var(--win-line); }
.cap i.on + i, .cap i + i.on { border-left-color: transparent; }
.cap svg { width: 16px; height: 16px; }
.toolbar h2 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; white-space: nowrap; }
.cols, .row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 84px 130px; align-items: center; }
.cols { height: 22px; flex: none; margin: 0 8px; padding: 0 8px 0 30px; font-size: 12px; font-weight: 500; color: var(--win-dim); border-bottom: 1px solid var(--win-line); }
.cols span + span { border-left: 1px solid var(--win-line); padding-left: 8px; }
.cols .r, .row .r { text-align: right; padding-right: 10px; }
.rows { flex: 1; overflow: auto; padding: 4px 8px; }
.row { height: 20px; padding: 0 8px 0 10px; border-radius: 10px; font-size: 13px; white-space: nowrap; cursor: pointer; width: 100%; text-align: left; }
.row:nth-child(even) { background: var(--win-stripe); }
.row:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.row:focus-visible { outline: none; background: var(--accent); color: #fff; }
.row:focus-visible .d { color: rgba(255, 255, 255, .8); }
.row .n { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; }
.row .art { --s: 20px; }
.row .d { color: var(--win-dim); overflow: hidden; text-overflow: ellipsis; padding-left: 8px; }
.row.soon .n { color: var(--win-dim); }
.row .art.gone .glyph { background: linear-gradient(#c4c8ce, #969ca5); font: 600 calc(var(--s) * .4)/1 -apple-system, system-ui, sans-serif; letter-spacing: 0; }
.in-trash .cols, .in-trash .row { grid-template-columns: minmax(0, 1fr) 84px 160px 130px; }
.row .d.by { display: flex; align-items: center; gap: 4px; }
.row .d.by .by-s { margin-left: auto; padding-right: 4px; font-variant-numeric: tabular-nums; }
.row:focus-visible .d.by .by-s { color: rgba(255, 255, 255, .8); }
.row .d.by .art { --s: 16px; margin-left: -2px; }
.empty { flex: 1; display: grid; place-items: center; color: var(--win-dim); font-size: 13px; }
.statusbar { height: 28px; flex: none; display: grid; place-items: center; font-size: 12px; color: var(--win-dim); border-top: 1px solid var(--win-line); }

/* About v57 */
.about { width: 300px; padding: 46px 26px 22px; align-items: center; text-align: center; }
.about .toolbar { position: absolute; inset: 0 0 auto; height: 44px; }
.about .mark {
  width: 96px; height: 96px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(160deg, #ff3a63, #e3002f); color: #fff; font-size: 30px; font-weight: 800; letter-spacing: -.04em;
  box-shadow: 0 4px 14px rgba(255, 8, 64, .35);
}
.about h2 { margin: 14px 0 0; font-size: 22px; font-weight: 700; }
.about .sub { margin: 2px 0 14px; color: var(--win-dim); font-size: 11px; }
.about dl { display: grid; grid-template-columns: auto auto; gap: 3px 10px; margin: 0 0 14px; font-size: 11px; text-align: left; }
.about dt { text-align: right; font-weight: 600; }
.about dd { margin: 0; color: var(--win-dim); }
.about canvas { width: 248px; height: 70px; margin-bottom: 14px; }
.about .btn {
  display: inline-flex; align-items: center; height: 24px; padding: 0 14px; border-radius: 12px; font-size: 13px;
  background: var(--win-cap); box-shadow: 0 0 0 .5px var(--win-cap-edge), 0 1px 3px rgba(0, 0, 0, .1);
}
.about .btn:hover { background: var(--accent); color: #fff; }
.about .links { display: none; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 12px; font-size: 12px; }
.about .links.open { display: flex; }
.about .links a { color: var(--accent); }
.about .links a:hover { text-decoration: underline; }

/* ---------- Widgets ---------- */
/* --f is one widget point: 1px on the Mac (small widget 170), iPhone points scaled to 163 there. */
:root {
  --wbg: rgba(255, 255, 255, .86); --wink: #1d1d1f; --wdim: rgba(60, 60, 67, .62); --wfill: rgba(0, 0, 0, .07); --wred: #ff0840;
  --wseg: #fff; --heat0: rgba(0, 0, 0, .07); --heat1: #ffb3c2; --heat2: #ff7593; --heat3: #ff3a63; --heat4: #d4002f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --wbg: rgba(30, 30, 33, .8); --wink: #f2f2f7; --wdim: rgba(235, 235, 245, .6); --wfill: rgba(255, 255, 255, .1); --wred: #ff375f;
    --wseg: rgba(255, 255, 255, .2); --heat0: rgba(255, 255, 255, .09); --heat1: #5c1626; --heat2: #8f1b37; --heat3: #d21f4b; --heat4: #ff4d72;
  }
}
/* On the red wallpapers the widgets are dark glass in both appearances: the wallpaper shows through, blurred. */
:root.red-wall {
  --wbg: rgba(40, 10, 20, .34); --wink: #f2f2f7; --wdim: rgba(235, 235, 245, .6); --wfill: rgba(255, 255, 255, .1); --wred: #ff375f;
  --wseg: rgba(255, 255, 255, .2); --heat0: rgba(255, 255, 255, .09); --heat1: #5c1626; --heat2: #8f1b37; --heat3: #d21f4b; --heat4: #ff4d72;
}
:root.red-wall .w {
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 10px 40px rgba(0, 0, 0, .22);
}
.widgets {
  --f: 1px; --cell: 170px; --gap: 16px;
  position: absolute; left: 28px; display: grid; grid-auto-rows: var(--cell); gap: var(--gap);
  grid-auto-flow: row dense; align-content: start;
}
.w {
  position: relative; width: var(--cell); height: var(--cell); border-radius: calc(22 * var(--f)); padding: calc(14 * var(--f));
  display: flex; flex-direction: column; overflow: hidden; text-shadow: none; color: var(--wink);
  background: var(--wbg); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .08), 0 6px 22px rgba(0, 0, 0, .18);
  font-size: calc(12 * var(--f)); line-height: 1.3; user-select: none;
}
.w[hidden] { display: none; }
.w.medium { width: calc(var(--cell) * 2 + var(--gap)); grid-column: span 2; }
.w-head { display: flex; align-items: center; gap: calc(6 * var(--f)); font-size: calc(13 * var(--f)); }
.w-head svg { width: calc(15 * var(--f)); height: calc(15 * var(--f)); flex: none; }
.w-head b { font-weight: 600; }
.w-head .w-dim { margin-left: auto; font-size: calc(11.5 * var(--f)); }
.w-dim { color: var(--wdim); }
.w-k { color: var(--wred); font-weight: 700; font-size: calc(12 * var(--f)); }
.w-big { font-size: calc(32 * var(--f)); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.w-sub { margin: calc(6 * var(--f)) 0 calc(8 * var(--f)); color: var(--wdim); font-size: calc(12 * var(--f)); }
.w canvas { display: block; width: 100%; flex: 1; min-height: 0; margin-top: calc(8 * var(--f)); }
.w a { color: inherit; }

.w-support .pills { display: flex; flex-wrap: wrap; gap: calc(6 * var(--f)); margin-top: auto; }
.w-support .pills a, .w-support .pills button {
  padding: calc(5 * var(--f)) calc(10 * var(--f)); border-radius: 999px; font-size: calc(12 * var(--f)); font-weight: 500;
  background: var(--wfill); white-space: nowrap;
}
.w-support .pills a:first-child { background: var(--wred); color: #fff; }
.w-support .pills a:hover, .w-support .pills button:hover { background: var(--wred); color: #fff; cursor: pointer; }
.w-support .pills .copied, .w-support .pills .copied:hover { background: #1f9d55; color: #fff; }

.w-list { display: flex; flex-direction: column; justify-content: space-between; flex: 1; margin-top: calc(6 * var(--f)); }
.w-row { display: flex; align-items: center; gap: calc(7 * var(--f)); font-size: calc(12 * var(--f)); border-radius: calc(6 * var(--f)); }
a.w-row:hover { background: var(--wfill); }
.w-row .art { margin: calc(-2 * var(--f)) 0; }
.w-row .nm { width: calc(64 * var(--f)); flex: none; }
.w-row small { display: block; font-size: calc(11 * var(--f)); }
.w-updated .w-row .nm { width: auto; }
.w-row .bar { flex: 1; height: calc(6 * var(--f)); border-radius: 3px; background: var(--wfill); overflow: hidden; }
.w-row .bar i { display: block; height: 100%; border-radius: 3px; background: var(--wred); }
.w-row .num { width: calc(26 * var(--f)); text-align: right; font-variant-numeric: tabular-nums; }
/* The Apps widget: a column per app, the bar's number on top and the icon below. */
.w-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--n, 9), 1fr); gap: calc(4 * var(--f)); margin-top: calc(8 * var(--f)); }
.w-col { display: flex; flex-direction: column; align-items: center; gap: calc(5 * var(--f)); min-width: 0; padding: 0 0 calc(2 * var(--f)); border-radius: calc(6 * var(--f)); color: inherit; text-decoration: none; }
a.w-col:hover, a.w-col:focus-visible { background: var(--wfill); }
.w-col .track { flex: 1; align-self: stretch; display: flex; align-items: flex-end; justify-content: center; padding-top: calc(15 * var(--f)); }
.w-col .bar { position: relative; display: block; width: min(100%, calc(14 * var(--f))); border-radius: calc(4 * var(--f)) calc(4 * var(--f)) calc(2 * var(--f)) calc(2 * var(--f)); background: var(--wred); transition: height .35s cubic-bezier(.3, .7, .4, 1); }
.w-col .num { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: calc(3 * var(--f)); font-size: calc(10.5 * var(--f)); font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-col .art { margin: calc(-2 * var(--f)) 0; }
@media (prefers-reduced-motion: reduce) { .w-col .bar { transition: none; } }

.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: calc(3 * var(--f)); flex: 1; margin: calc(10 * var(--f)) 0 calc(6 * var(--f)); }
.heat i, .legend i { display: block; border-radius: calc(2.5 * var(--f)); }
.l0 { background: var(--heat0); } .l1 { background: var(--heat1); } .l2 { background: var(--heat2); } .l3 { background: var(--heat3); } .l4 { background: var(--heat4); }
.legend { display: flex; align-items: center; gap: calc(8 * var(--f)); font-size: calc(10.5 * var(--f)); min-height: calc(12 * var(--f)); }
.legend .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wink); }
.legend .key { display: flex; align-items: center; gap: calc(3 * var(--f)); margin-left: auto; }
.legend .key[hidden] { display: none; }
.heat i { cursor: pointer; }
.heat i.sel, .cal i.sel { box-shadow: 0 0 0 calc(1.5 * var(--f)) var(--wink); position: relative; z-index: 1; }
.heat:focus-visible, .cal:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.legend i { width: calc(9 * var(--f)); height: calc(9 * var(--f)); }

.w-clock { align-items: center; justify-content: center; padding: calc(10 * var(--f)); }
.w-clock .face { width: calc(124 * var(--f)); height: calc(124 * var(--f)); }
.face .dial { fill: #fff; stroke: rgba(0, 0, 0, .08); }
.face text { font: 600 9px var(--font); fill: #1d1d1f; }
.face line { stroke-linecap: round; }
.face .hh { stroke: #1d1d1f; stroke-width: 3.2; }
.face .mh { stroke: #1d1d1f; stroke-width: 2.2; }
.face .sh { stroke: #ff9500; stroke-width: 1; }
.face .pin { fill: #ff9500; }
@media (prefers-color-scheme: dark) {
  .face .dial { fill: #1c1c1e; stroke: rgba(255, 255, 255, .1); }
  .face text { fill: #f2f2f7; } .face .hh, .face .mh { stroke: #f2f2f7; }
}
.w-clock .city { margin-top: calc(4 * var(--f)); font-size: calc(11 * var(--f)); }

.w-lines .fact { display: flex; flex-direction: column; justify-content: center; flex: 1; border-radius: calc(8 * var(--f)); }
.w-lines .fact[href]:hover .w-big { color: var(--wred); }
.w-lines .fact .w-dim { font-size: calc(12.5 * var(--f)); }
.w-lines .dots { display: flex; gap: calc(5 * var(--f)); }
.w-lines .dots button { width: calc(7 * var(--f)); height: calc(7 * var(--f)); border-radius: 50%; background: var(--wfill); cursor: pointer; }
.w-lines .dots button[aria-current="true"] { background: var(--wred); }

.w-community .cta {
  display: flex; align-items: center; justify-content: center; height: calc(30 * var(--f)); border-radius: calc(9 * var(--f));
  font-weight: 600; font-size: calc(12.5 * var(--f)); color: #fff; margin-top: calc(6 * var(--f));
}
.w-community .w-sub { flex: 1; margin-bottom: 0; }
.cta.discord { background: #5865f2; }
.cta.github { background: #24292f; }
@media (prefers-color-scheme: dark) { .cta.github { background: #f2f2f7; color: #1d1d1f; } }
.cta:hover { filter: brightness(1.12); }

.w-calendar { padding-bottom: calc(10 * var(--f)); }
.w-calendar .w-k { letter-spacing: .02em; font-size: calc(11 * var(--f)); }
.cal-week, .cal { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-week { font-size: calc(8.5 * var(--f)); font-weight: 600; margin-top: calc(3 * var(--f)); }
.cal { grid-auto-rows: calc(14.5 * var(--f)); row-gap: calc(1 * var(--f)); margin: calc(2 * var(--f)) 0 auto; }
.cal i { font-style: normal; font-size: calc(9.5 * var(--f)); display: grid; place-items: center; border-radius: calc(4 * var(--f)); cursor: pointer; font-variant-numeric: tabular-nums; }
.cal .c1 { background: var(--heat1); } .cal .c2 { background: var(--heat2); } .cal .c3 { background: var(--heat3); color: #fff; } .cal .c4 { background: var(--heat4); color: #fff; }
@media (prefers-color-scheme: dark) { .cal .c1, .cal .c2 { color: #fff; } }
.cal i.today { box-shadow: inset 0 0 0 calc(1.5 * var(--f)) var(--wred); font-weight: 700; }
.w-calendar .read { font-size: calc(10.5 * var(--f)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Shared widget controls */
.seg { margin-left: auto; display: inline-flex; padding: calc(2 * var(--f)); border-radius: calc(7 * var(--f)); background: var(--wfill); }
.w-head .w-dim + .seg { margin-left: calc(8 * var(--f)); }
.seg button { font-size: calc(10.5 * var(--f)); padding: calc(2 * var(--f)) calc(7 * var(--f)); border-radius: calc(5 * var(--f)); color: var(--wdim); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--wseg); color: var(--wink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.pager { margin-left: auto; display: inline-flex; align-items: center; gap: calc(4 * var(--f)); }
.pager button {
  width: calc(20 * var(--f)); height: calc(20 * var(--f)); border-radius: 50%; display: grid; place-items: center;
  font-size: calc(14 * var(--f)); line-height: 1; color: var(--wink); background: var(--wfill); cursor: pointer;
}
.pager button:hover:not(:disabled) { background: var(--wred); color: #fff; }
.pager button:disabled { opacity: .3; cursor: default; }
.pager .pn { font-size: calc(11 * var(--f)); }
.w-commits canvas { cursor: crosshair; }
.w-commits .read { min-height: 2.6em; }
.w-sizes .total { font-size: calc(11.5 * var(--f)); }

/* Clock: analog or digital */
.flip { display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.flip .digital { display: none; flex-direction: column; align-items: center; height: calc(124 * var(--f)); justify-content: center; }
.w-clock.digital-on .face { display: none; }
.w-clock.digital-on .flip .digital { display: flex; }
.flip .dt { font-size: calc(34 * var(--f)); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.flip .dd { font-size: calc(11 * var(--f)); text-align: center; margin-top: calc(2 * var(--f)); }

/* Dragging a widget to a new place (Mac) */
.w.dragging { z-index: 20; cursor: grabbing; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
.w.drop-target { box-shadow: 0 0 0 2px var(--accent), 0 6px 22px rgba(0, 0, 0, .18); }

/* ---------- iPhone ---------- */
/* Laid out in iPhone points (402 wide); --u scales them to the screen, capped so iPads stay sane. */
.phone {
  --u: calc(min(100vw, 500px) / 402); position: fixed; inset: 0; left: 50%; width: min(100vw, 500px); transform: translateX(-50%);
  color: var(--label); padding-top: env(safe-area-inset-top);
}
.status { height: calc(54 * var(--u)); display: flex; align-items: center; justify-content: space-between; padding: 0 calc(30 * var(--u)) 0 calc(56 * var(--u)); font-weight: 600; font-size: calc(17 * var(--u)); text-shadow: 0 0 8px rgba(0, 0, 0, .15); }
.status-icons { display: flex; gap: 6px; align-items: center; }
.p-pages {
  position: absolute; left: 0; right: 0; top: calc(54 * var(--u) + env(safe-area-inset-top)); bottom: 0;
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.p-pages::-webkit-scrollbar { display: none; }
.p-page { flex: 0 0 100%; scroll-snap-align: start; overflow-y: auto; padding: calc(10 * var(--u)) 0 calc(160 * var(--u)); }
.p-dots { position: absolute; left: 0; right: 0; bottom: calc(130 * var(--u) + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: calc(8 * var(--u)); }
.p-dots button { width: calc(7 * var(--u)); height: calc(7 * var(--u)); border-radius: 50%; background: color-mix(in srgb, var(--label) 35%, transparent); }
.p-dots button[aria-current="true"] { background: var(--label); }
.phone { --f: calc(var(--u) * .9588); --cell: calc(163 * var(--u)); --gap: calc(19 * var(--u)); }
.pw { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; align-items: center; }
.pw.medium { grid-column: span 4; }
.pw .name { margin-top: calc(8 * var(--u)); font-size: calc(12 * var(--u)); color: var(--label); text-shadow: var(--label-shadow); }
.p-grid { display: grid; grid-template-columns: repeat(4, calc(92.6 * var(--u))); grid-auto-rows: calc(100 * var(--u)); justify-content: center; }
.pi { display: flex; flex-direction: column; align-items: center; -webkit-touch-callout: none; touch-action: manipulation; }
.pi .art { --s: calc(63 * var(--u) / .8); margin: calc(-7.9 * var(--u)) 0 calc(-5.4 * var(--u)); } /* the squircle inside is 63; the glass icons shadow below it */
.pi .name { margin-top: calc(8 * var(--u)); font-size: calc(12 * var(--u)); color: var(--label); text-shadow: var(--label-shadow); white-space: nowrap; }
.pi.lifted .art { transform: scale(1.12); transition: transform .2s; }
.p-dock {
  position: absolute; left: calc(17.5 * var(--u)); right: calc(17.5 * var(--u)); bottom: calc(19 * var(--u) + env(safe-area-inset-bottom));
  height: calc(101 * var(--u)); border-radius: calc(44 * var(--u));
  background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 8px 30px rgba(0, 0, 0, .18);
}
.p-dock > div { height: 100%; display: grid; grid-template-columns: repeat(4, calc(92.6 * var(--u))); justify-content: center; align-items: center; }
.p-dock .name { display: none; }
.pfolder .art { display: grid; place-items: center; }
.pfolder .box {
  width: calc(63 * var(--u)); height: calc(63 * var(--u)); border-radius: calc(14 * var(--u)); padding: calc(7 * var(--u));
  background: rgba(255, 255, 255, .28); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(3.5 * var(--u)); align-content: start;
}
.pfolder .box img, .pfolder .box b { width: 100%; aspect-ratio: 1; border-radius: 22%; display: block; object-fit: cover; }
.pfolder .box b { background: linear-gradient(#3a3a3f, #18181b); }

/* Folder overlay and long-press menu */
.overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.overlay h2 { margin: 0 0 18px; font-size: calc(28 * var(--u, 1px)); font-weight: 700; color: #fff; }
.overlay .panel {
  width: min(86vw, 340px); padding: 22px 12px; border-radius: 38px; background: rgba(255, 255, 255, .22);
  display: grid; grid-template-columns: repeat(3, 1fr); row-gap: 18px; justify-items: center;
}
.ctx-phone { position: fixed; z-index: 90; min-width: 230px; border-radius: 14px; overflow: hidden; background: rgba(250, 250, 252, .9); color: #1d1d1f; -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.ctx-phone a, .ctx-phone span { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 17px; border-top: .5px solid rgba(0, 0, 0, .15); }
.ctx-phone :first-child { border-top: 0; }
.ctx-phone span { color: rgba(0, 0, 0, .35); }
@media (prefers-color-scheme: dark) { .ctx-phone { background: rgba(44, 44, 48, .9); color: #fff; } .ctx-phone a, .ctx-phone span { border-top-color: rgba(255, 255, 255, .15); } .ctx-phone span { color: rgba(255, 255, 255, .35); } }

@media (prefers-reduced-motion: reduce) {
  .bouncing .art, .overlay { animation: none; }
  .dock .art { transition: none; }
}

/* ---------- Wallpaper ---------- */
.dock .wall-tile .glyph { background: linear-gradient(150deg, #3a0717, #c80c39 55%, #ff5a36); overflow: hidden; }
.dock .wall-tile .glyph::after {
  content: ""; width: 46%; height: 46%; border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7), 0 0 0 9px rgba(255, 255, 255, .14), 0 0 0 10px rgba(255, 255, 255, .3);
}
.walls { width: 640px; }
.walls .toolbar { padding-left: 84px; }
.wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; padding: 4px 18px 20px; }
.wall-grid button { display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer; }
.wall-grid canvas { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; margin-bottom: 4px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .18); }
.wall-grid button[aria-pressed="true"] canvas { box-shadow: 0 0 0 2px var(--win), 0 0 0 5px var(--accent); }
.wall-grid b { font-size: 13px; font-weight: 600; }
.wall-grid span { font-size: 11px; line-height: 14px; color: var(--win-dim); }
