/* Duo New Tab © 2026 DevRoshdi. All rights reserved. See LICENSE.txt. */
/* San Francisco, when it is installed on the computer (always on a Mac; on Windows after installing SF Pro). */
@font-face { font-family: "FT SF"; font-weight: 100 900; src: local("SF Pro"), local("SF Pro Text"), local("SF Pro Display"), local(".SFNS-Regular"); }
@font-face { font-family: "FT SF Rounded"; font-weight: 100 900; src: local("SF Pro Rounded"), local("SF Pro Rounded Regular"); }
/*
 * Inter (SIL OFL, bundled): the closest open font to San Francisco, used when SF is not available.
 * It is preloaded (newtab.html) and text waits for it (block), so it never swaps in mid-animation.
 */
@font-face { font-family: "FT Inter"; font-style: normal; font-weight: 100 900; font-display: block; src: url("fonts/inter-latin-opsz-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "FT Inter"; font-style: normal; font-weight: 100 900; font-display: block; src: url("fonts/inter-latin-ext-opsz-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* The Home Screen cell size, resolved where it is set and inherited as a plain length. */
@property --pitch { syntax: "<length>"; inherits: true; initial-value: 150px; }
/*
 * --k: how much bigger than its design a widget's type is drawn. Widgets were set for cells up to
 * 150px; on bigger screens the cells grow, and the type, which would otherwise stop at its largest
 * size, grows with them so a widget looks the same at every size (as on iPad).
 */
@property --k { syntax: "<number>"; inherits: true; initial-value: 1; }
/*
 * What a swipe changes every frame: how far the pages are dragged (--drag-x), which screen is showing
 * (--spread) and how far Today View is open (--t). They are not inherited: a plain custom property
 * changed on the strip of pages made the browser work out the styles of every icon inside it again,
 * 10 ms a frame (15 ms for --t, then on <body>); not inherited, 0.03 ms.
 */
@property --drag-x { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --spread { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --t { syntax: "<number>"; inherits: false; initial-value: 0; }

:root {
  /*
   * iOS motion. --smooth is the default iOS spring (no bounce): things moving from place to place.
   * --page is a scroll view settling on a page: it leaves at the speed of the swipe and slows into
   * place. --spring has a faint settle; --spring-pop is the lively one for things that pop out.
   */
  --smooth: linear(0, 0.078 5%, 0.235 10%, 0.401 15%, 0.549 20%, 0.669 25%, 0.762 30%, 0.831 35%, 0.882 40%, 0.918 45%, 0.944 50%, 0.962 55%, 0.974 60%, 0.982 65%, 0.988 70%, 0.992 75%, 0.995 80%, 0.998 90%, 1);
  --page: cubic-bezier(0.2, 0.86, 0.26, 1);
  --spring: linear(0, 0.074 4%, 0.276 9%, 0.546 15%, 0.778 22%, 0.92 29%, 0.991 36%, 1.019 43%, 1.022 50%, 1.013 58%, 1.004 67%, 0.999 80%, 1);
  --spring-pop: linear(0, 0.105 3.5%, 0.392 9%, 0.718 15%, 0.958 21.5%, 1.064 27%, 1.085 31%, 1.067 36%, 1.019 44%, 0.992 52%, 0.987 58%, 0.995 70%, 1.001 82%, 1);
  --scale: 1;
  --g: 0.4;            /* Liquid Glass: 0 = clear, 1 = tinted (set from settings) */
  --hue: 212;          /* tint for the Tinted icon style */
  --dim: 0;            /* extra wallpaper dimming, 0..0.7 */
  --font: "FT SF", -apple-system, BlinkMacSystemFont, "FT Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  --round: "FT SF Rounded", ui-rounded, var(--font);

  /* glass tone for chrome (dock, folders, pills, menus) */
  --tone: 255, 255, 255;
  --glass-bg: rgba(var(--tone), calc(0.1 + var(--g) * 0.24));
  --glass-blur: blur(calc(10px + var(--g) * 22px)) saturate(200%);
  --glass-edge: inset 0 1px 1px rgba(255, 255, 255, 0.5), inset 0 -1px 1px rgba(255, 255, 255, 0.12), 0 10px 34px rgba(0, 0, 0, 0.16);

  /* widgets */
  --w-bg: rgba(28, 28, 30, calc(0.62 + var(--g) * 0.3));
  --w-text: #fff;
  --w-muted: rgba(235, 235, 245, 0.62);
  --w-sep: rgba(255, 255, 255, 0.12);

  /* sheets and dialogs */
  --sheet: #1c1c1e;
  --cell: #2c2c2e;
  --cell-sep: rgba(84, 84, 88, 0.6);
  --label: #fff;
  --label2: rgba(235, 235, 245, 0.6);
  --fill: rgba(120, 120, 128, 0.32);
  /* iOS 26 system colours (dark), a little brighter than before */
  --tint: #0091ff;
  --red: #ff4245;
  --green: #30d158;
  color-scheme: dark;
}

body.mode-light {
  --w-bg: rgba(255, 255, 255, calc(0.8 + var(--g) * 0.18));
  --w-text: #000;
  --w-muted: rgba(60, 60, 67, 0.62);
  --w-sep: rgba(60, 60, 67, 0.16);
  --sheet: #f2f2f7;
  --cell: #fff;
  --cell-sep: rgba(60, 60, 67, 0.22);
  --label: #000;
  --label2: rgba(60, 60, 67, 0.6);
  --fill: rgba(120, 120, 128, 0.16);
  --tint: #0088ff;
  --red: #ff383c;
  --green: #34c759;
  color-scheme: light;
}
body.mode-dark { --tone: 40, 40, 46; --glass-bg: rgba(var(--tone), calc(0.16 + var(--g) * 0.4)); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.spotlight[hidden], .cc[hidden], .pages-view[hidden], .sheet-wrap[hidden], .menu[hidden], .menu-shade[hidden] { pointer-events: none; }
html, body { height: 100%; margin: 0; }
/* The page's own background; js/boot.js paints the remembered wallpaper here before anything else. */
html { background: #0b0d1c; }

body {
  overflow: hidden;
  background: transparent;
  color: #fff;
  font: 14px/1.3 var(--font);
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.9); outline-offset: 2px; }

/* The wallpaper is simply there when a tab opens; only later changes (in Settings) ease. */
.wallpaper { position: fixed; inset: 0; z-index: 0; }
.dimmer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; background: #000;
  opacity: calc(var(--dim) + 0.08);
}
/* Until js/shell.js draws the saved copy, the first frame is only the wallpaper (nothing to lay out). */
html.ft-wait body > :not(.wallpaper):not(.dimmer) { display: none !important; }
body.settled .wallpaper { transition: background 0.4s ease; }
body.settled .dimmer { transition: opacity 0.3s ease; }
body.mode-dark .dimmer { opacity: calc(var(--dim) + 0.2); }
body.wp-photo .dimmer { opacity: calc(var(--dim) + 0.16); }
body.wp-adaptive .dimmer { opacity: var(--dim); }

/* ---------- Liquid Glass ---------- */

.glass, .dock, .page-pill, .glass-pill, .glass-circle, .folder-tile, .folder-platter, .lib-card, .lib-search, .cc-mod, .menu, .sp-field, .sheet {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
}
/* Specular rim: a bright edge top-left fading to a fainter one bottom-right. */
.dock::before, .page-pill::before, .glass-pill::before, .glass-circle::before, .folder-platter::before, .lib-card::before,
.lib-search::before, .cc-mod::before, .menu::before, .sp-field::before, .sheet::before, .widget::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0.02) 62%, rgba(255, 255, 255, 0.36));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
body.mode-dark .dock::before, body.mode-dark .page-pill::before, body.mode-dark .folder-platter::before, body.mode-dark .menu::before,
body.mode-dark .cc-mod::before, body.mode-dark .widget::before, body.mode-dark .lib-card::before {
  opacity: 0.75;
}

/* ---------- status bar ---------- */

/*
 * The time over the status circle in the top corner: centred on the Dock's middle, and as far from the
 * top of the screen as from its right edge (--sb-top, worked out by placeStatus in js/newtab.js as the
 * Dock changes). Under the app windows (.ft-apps, 40), over everything else on the Home Screen.
 */
.statusbar {
  position: fixed; top: var(--sb-top, 30px); right: calc(var(--stage-right) + var(--dock-w) / 2); z-index: 39; translate: 50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
  color: #fff; transition: color 0.3s ease, opacity 0.2s ease, visibility 0s linear 0s;
}
/* In edit mode (icons jiggling) the Edit, Add Widget and Done buttons take the top of the screen, so the time and status step aside. */
body.editing .statusbar { opacity: 0; visibility: hidden; transition: color 0.3s ease, opacity 0.2s ease, visibility 0s linear 0.2s; }
/*
 * Like iPadOS, the time and status turn black over a light wallpaper and white over a dark one
 * (body.sb-dark is worked out from the wallpaper under the bar). Spotlight, Control Center and Edit
 * Pages darken the screen, so the bar is white over them.
 */
body.sb-dark .statusbar { color: #000; }
body.sb-dark:has(#spotlight:not([hidden]), #cc:not([hidden]), #pagesView:not([hidden])) .statusbar { color: #fff; }
/*
 * 15px at the usual cell size, a little larger on very large screens. As wide as the widest time it
 * shows (placeStatus sets min-width), so its gaps from the edges stay put as the minutes go by.
 */
.sb-time { font: 500 clamp(14px, calc(var(--pitch, 133px) * 0.11), 19px)/1 var(--font); letter-spacing: -0.005em; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; pointer-events: auto; }
/*
 * iPhone's alarm icon, just left of the time's text while any alarm is on (js/newtab.js), in the
 * time's colour. It hangs outside the text, so the time does not move when it comes and goes.
 */
.sb-t { position: relative; }
.sb-alarm { position: absolute; right: 100%; top: 50%; translate: -0.3em -53%; display: block; width: 1em; height: 1em; pointer-events: none; }
.sb-alarm[hidden] { display: none; }
.sb-alarm svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sb-alarm-body, .sb-alarm-bells { fill: currentColor; }
.sb-alarm-legs { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/*
 * iPhone Duo: battery, Wi-Fi and signal share one circle, under the time. Hovering lights a round halo just outside the ring ; pressing shrinks it a little, as a button does on iPad.
 */
.sb-right {
  pointer-events: auto; position: relative; display: flex; align-items: center; gap: 7px; height: var(--sb-ring); padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, scale 0.3s var(--spring-pop);
}
.sb-right:hover { background: rgba(255, 255, 255, 0.16); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16); }
body.sb-dark .sb-right:hover { background: rgba(0, 0, 0, 0.08); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08); }
.sb-right:focus-visible { outline: 2px solid var(--tint, #0a84ff); outline-offset: 4px; }
.sb-right:active { scale: 0.92; }
/* The battery percentage, beside the circle on its left: the circle itself stays centred under the time. */
.sb-pct { position: absolute; right: calc(100% + 8px); top: 50%; translate: 0 -50%; font: 600 17px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.sb-ring { display: block; flex: none; width: var(--sb-ring); height: var(--sb-ring); overflow: visible; }
.sb-ring path { fill: none; stroke-width: 3; stroke-linecap: round; }
.sb-ring .ring-track { stroke: currentColor; stroke-opacity: 0.3; }
.sb-ring .ring-level { stroke: currentColor; transition: stroke-dasharray 0.6s var(--spring), stroke 0.3s; }
.sb-ring.charging .ring-level { stroke: #34c759; }
.sb-ring.low .ring-level { stroke: #ff3b30; }
.sb-ring .ring-wifi path { fill: currentColor; stroke: none; transition: opacity 0.2s; }
.sb-ring[data-bars="2"] .ring-wifi .a3, .sb-ring[data-bars="1"] .ring-wifi .a3, .sb-ring[data-bars="1"] .ring-wifi .a2 { opacity: 0.3; }
.sb-ring.offline .ring-wifi path { opacity: 0.3; }
.sb-ring .ring-dots circle { fill: currentColor; opacity: 0.3; transition: opacity 0.2s; }
.sb-ring .ring-dots circle.on { opacity: 1; }
/* Kept for the battery module in Control Center. */
.sb-battery { width: 28px; height: 13px; overflow: visible; }
.sb-battery .bat-num { font: 700 9.6px var(--round); letter-spacing: -0.02em; fill: #000; }
.sb-battery .bat-outline { fill: none; stroke: currentColor; stroke-opacity: 0.38; }
.sb-battery .bat-inner { fill: currentColor; }
.sb-battery .bat-cap { fill: currentColor; fill-opacity: 0.4; }
.sb-battery .bat-pctg { display: none; }
.sb-battery .bat-body { fill: currentColor; fill-opacity: 0.38; }
.sb-battery .bat-fill { fill: currentColor; }
.sb-battery.with-pct .bat-outline, .sb-battery.with-pct .bat-inner { display: none; }
.sb-battery.with-pct .bat-pctg { display: inline; }
.sb-battery.charging .bat-inner, .sb-battery.charging .bat-fill { fill: #34c759; }
.sb-battery.low .bat-inner, .sb-battery.low .bat-fill { fill: #ff3b30; }
.sb-bolt { width: 7px; height: 11px; fill: currentColor; }

/* ---------- stage ---------- */

.stage {
  position: relative; z-index: 1; height: 100vh;
  /*
   * Its one row is as tall as the stage, said outright: left to size itself, the row measured the
   * pages at no height first and then at their own, so each page (whose grid is sized from the page,
   * newtab.css .grid) worked its icons and widgets out twice whenever anything on the stage changed,
   * 30 ms each time (a page dot drawn, a word in a widget); 1 ms now.
   */
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); gap: var(--stage-gap);
  padding: 40px var(--stage-right) 14px var(--stage-left);
  opacity: 0; transition: opacity 0.3s ease, translate 0.5s var(--page), scale 0.45s var(--smooth);
  /*
   * Moved and scaled even at rest (by nothing): going from none to a value changes what the stage's
   * contents are placed against, which made opening Today View lay the whole Home Screen out again.
   */
  translate: 0 0; scale: 1;
}
body.ready .stage { opacity: 1; }

/* ---------- widgets ---------- */

/*
 * Today View. Hidden until you swipe right on the first page; then the widget column slides in from
 * the left over the Home Screen, which blurs and eases aside. --t (0…1) is how far it is open, set
 * on the three things that use it (setToday): the shade, the widget column and the stage.
 */
/*
 * The Dock's icons are the size of the page's (as on iPad). The page's cell is worked out here from
 * the window, the same way as the 7 × 5 grid, not read from the page: the Dock's width sets the page's
 * width, so reading it back would go round in a loop. --dk-pw and --dk-ph are the page's size: the
 * window less the status bar, page dots, margins and Dock.
 */
body {
  --dk-pw: min(100vw - 160px, 1820px);
  --dk-ph: min(100vh - 116px, 1300px);
  --dk-cell: min(var(--dk-pw) / 7, var(--dk-ph) / 5);
  /*
   * The Dock's icon: the page's size, but never so large that a full Dock (about 9 icons tall with
   * its gaps) would not fit under the time and status circle in the top corner, whose gap from the
   * top grows with the Dock's width (about 0.72 of an icon), whatever the icon size setting.
   */
  --dock-icon: clamp(32px, min(calc(clamp(40px, var(--dk-cell) * 0.47, 120px) * var(--scale)), (100vh - 96px) / 9.72), 140px);
  /* The stage's right margin, and the Dock's width (its icons plus 0.22 of an icon each side). */
  --stage-right: 16px;
  --stage-left: 14px;
  --stage-gap: 10px;
  --dock-w: calc(var(--dock-icon) * 1.44);
  /* How far the App Library moves right to sit in the middle of the screen while the Dock is away. */
  --lib-shift: calc((var(--dock-w) + var(--stage-gap) + var(--stage-right) - var(--stage-left)) / 2);
  --sb-ring: 52px;
}
.today-view { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
body.today-shown .today-view { pointer-events: auto; }
.today-shade {
  position: absolute; inset: 0; opacity: var(--t);
  background: rgba(0, 0, 0, 0.14); -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%);
  transition: opacity 0.4s ease;
}
.widgets {
  position: absolute; top: 0; bottom: 0; left: 0; width: calc(var(--pitch, 150px) * 2 + 40px);
  display: flex; flex-direction: column; gap: 10px; padding: 46px 12px 28px 28px;
  overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
  translate: calc((var(--t) - 1) * 104%) 0;
  transition: translate 0.5s var(--page);
}
/*
 * The Home Screen eases to the right and back as Today View comes in. Marked as moving meanwhile, so
 * while a finger draws it a little smaller every frame it is shrunk as drawn, not drawn again at
 * each size (that dropped a frame or two in most swipes; it is blurred behind the shade then anyway).
 */
body.today-shown .stage { translate: calc(var(--t) * 56px) 0; scale: calc(1 - var(--t) * 0.03); will-change: translate, scale; }
body.today-live .widgets, body.today-live .today-shade, body.today-live .stage { transition: none; }
/* Today View: two cells wide, the same cells and widget sizes as the Home Screen. */
.today-list {
  display: grid; grid-template-columns: repeat(2, var(--pitch, 150px)); grid-auto-rows: var(--pitch, 150px); grid-auto-flow: row dense;
  flex: none; align-content: start; justify-content: center; min-height: var(--pitch, 150px); border-radius: 26px;
}
.today-list.drop-target { background: rgba(255, 255, 255, 0.08); }
.today-list .widgets-empty { grid-column: span 2; align-self: start; margin: 10px; }
.widgets::-webkit-scrollbar { display: none; }

.widget {
  position: relative; min-width: 0; border-radius: 24px; color: var(--w-text);
  background: var(--w-bg);
  -webkit-backdrop-filter: blur(calc(14px + var(--g) * 22px)) saturate(185%);
  backdrop-filter: blur(calc(14px + var(--g) * 22px)) saturate(185%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}
/* Light widgets read as white cards, as on iPad, so the wallpaper colour behind is not boosted. */
body.mode-light .widget { -webkit-backdrop-filter: blur(30px) saturate(110%); backdrop-filter: blur(30px) saturate(110%); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); }
.wgt-card { width: 100%; min-height: 0; border-radius: 24px; overflow: hidden; container-type: size; --k: max(1, tan(atan2(var(--pitch), 150px))); }
.widget-body { position: relative; height: 100%; padding: 15px 16px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
/* In jiggle mode widgets are moved, not used. */
body.editing .wgt .widget-body { pointer-events: none; }

.w-title { font-size: calc(12.5px * var(--k)); font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; color: #ff453a; }
.w-sub { font-size: calc(12px * var(--k)); color: var(--w-muted); font-weight: 500; }
.w-empty { font-size: calc(13px * var(--k)); color: var(--w-muted); padding: 6px 0; list-style: none; }
.w-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

/*
 * Digital Clock (small), as in the Clock app: the city at the top, the time in large digits filling
 * the width, the day and difference from here at the bottom. White while it is day in that city,
 * black at night; sizes are shares of the widget so it looks the same at every size.
 */
body .wgt-card.widget:has(.w-clock) {
  --dc-muted: rgba(60, 60, 67, 0.6);
  background: #fff; color: #000; -webkit-backdrop-filter: none; backdrop-filter: none;
}
body .wgt-card.widget:has(.w-clock.dc-night) { --dc-muted: rgba(235, 235, 245, 0.6); background: #000; color: #fff; }
.w-clock { justify-content: space-between; }
.dc-city { font-size: 10.5cqmin; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-time {
  display: flex; align-items: baseline; white-space: nowrap; margin-top: auto;
  font: 500 23cqw/1 var(--font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.w-clock:has(.dc-ampm:empty) .dc-time { font-size: 28cqw; }
.dc-ampm { margin-left: 0.1em; font-size: 0.34em; font-weight: 600; letter-spacing: 0; }
.dc-day { margin-top: 3cqmin; font-size: 9cqmin; font-weight: 600; line-height: 1.2; color: var(--dc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Clock: the iPadOS face on a glass tile tinted by the wallpaper. */
body .wgt-card.widget:has(.w-analog) {
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(26px) saturate(170%) brightness(0.82); backdrop-filter: blur(26px) saturate(170%) brightness(0.82);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 6px 20px rgba(0, 0, 0, 0.1);
}
.w-analog { padding: 6% !important; align-items: center; justify-content: center; }
.ck-face { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
/* The dial and each hand are <svg>s of the same box, stacked (a saved copy may still hold one <svg>). */
.ck-face > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.ck-dial { fill: #fff; }
.ck-min { stroke: #b8b8bd; stroke-width: 0.7; stroke-linecap: round; }
.ck-hr { stroke: #1c1c1e; stroke-width: 1.4; stroke-linecap: round; }
.ck-num { font: 600 11.5px var(--font); fill: #1c1c1e; letter-spacing: -0.02em; }
.ck-stem { stroke: #1c1c1e; stroke-width: 1.7; stroke-linecap: round; }
.ck-bar { stroke: #1c1c1e; stroke-width: 4.2; stroke-linecap: round; }
.ck-sh line { stroke: #ff9500; stroke-width: 1; stroke-linecap: round; }
.ck-hub { fill: #ff9500; }
.ck-pin { fill: #fff; }
/* The hands turn smoothly (period and starting point are set per face in widgets.js). */
.ck-hand { transform-box: view-box; transform-origin: 50px 50px; animation: ck-turn 60s linear infinite; }
/* A hand is a <span> the size of the face, holding its <svg>, and turns about its middle on the
   compositor (a saved copy may still hold hands that are <svg>s themselves, covered by the rule above). */
.ck-face > .ck-hand { transform-box: border-box; transform-origin: 50% 50%; }
.ck-face > span.ck-hand { position: absolute; inset: 0; display: block; }
.ck-face > span.ck-hand > svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* Faces off screen hold still (widgets.js puts them right when they come back). */
.ck-off .ck-hand { animation-play-state: paused; }
@keyframes ck-turn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* The city's short code on the City face, in grey under the 12. */
.ck-code { font: 600 7.6px var(--font); fill: #8e8e93; letter-spacing: 0.06em; }
/* Where it is night in that city (and with the Dark widget style): a black face with white marks. */
.ck-night .ck-dial, body.icons-dark .ck-dial { fill: #000; }
.ck-night .ck-num, body.icons-dark .ck-num { fill: #fff; }
.ck-night .ck-hr, .ck-night .ck-stem, .ck-night .ck-bar,
body.icons-dark .ck-hr, body.icons-dark .ck-stem, body.icons-dark .ck-bar { stroke: #fff; }
.ck-night .ck-min, body.icons-dark .ck-min { stroke: #636366; }
.ck-night .ck-pin, body.icons-dark .ck-pin { fill: #000; }
.ck-night .ck-code, body.icons-dark .ck-code { fill: #8e8e93; }
body.icons-dark .wgt-card.widget:has(.w-clock) { --dc-muted: rgba(235, 235, 245, 0.6); background: #000; color: #fff; }

/*
 * Clear and Tinted widget styles (Customize), as iPadOS draws widgets in them: the card turns to
 * glass and everything on it to one colour, white for Clear and the chosen tint for Tinted; the
 * faces become glass discs with the marks and hands in that colour.
 */
body.icons-clear .wgt-card.widget:is(:has(.w-analog), :has(.w-clock), :has(.w-world)),
body.icons-tinted .wgt-card.widget:is(:has(.w-analog), :has(.w-clock), :has(.w-world)) {
  --ck-ink: rgba(255, 255, 255, 0.96); --dc-muted: rgba(255, 255, 255, 0.6); --w-muted: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, calc(0.12 + var(--g) * 0.14)); color: var(--ck-ink);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), inset 0 -1px 1px rgba(255, 255, 255, 0.15), 0 6px 20px rgba(0, 0, 0, 0.08);
}
body.icons-tinted .wgt-card.widget:is(:has(.w-analog), :has(.w-clock), :has(.w-world)) {
  --ck-ink: hsl(var(--hue), 95%, 72%); --dc-muted: hsla(var(--hue), 95%, 72%, 0.62); --w-muted: hsla(var(--hue), 95%, 72%, 0.62);
  background: hsla(var(--hue), 45%, 14%, 0.62);
}
body.icons-clear .ck-face .ck-dial, body.icons-tinted .ck-face .ck-dial { fill: rgba(255, 255, 255, 0.1); stroke: rgba(255, 255, 255, 0.22); stroke-width: 0.6; }
body.icons-clear .ck-face .ck-num, body.icons-tinted .ck-face .ck-num,
body.icons-clear .ck-face .ck-hub, body.icons-tinted .ck-face .ck-hub { fill: var(--ck-ink); }
body.icons-clear .ck-face :is(.ck-hr, .ck-stem, .ck-bar), body.icons-tinted .ck-face :is(.ck-hr, .ck-stem, .ck-bar),
body.icons-clear .ck-face .ck-sh line, body.icons-tinted .ck-face .ck-sh line { stroke: var(--ck-ink); }
body.icons-clear .ck-face .ck-min, body.icons-tinted .ck-face .ck-min { stroke: var(--ck-ink); opacity: 0.45; }
body.icons-clear .ck-face .ck-code, body.icons-tinted .ck-face .ck-code { fill: var(--ck-ink); opacity: 0.65; }
body.icons-clear .ck-face .ck-pin, body.icons-tinted .ck-face .ck-pin { fill: rgba(0, 0, 0, 0.35); }
/* City II: twelve grey bars and no numerals. */
.ck-bar-mark { stroke: #6c6c70; stroke-width: 2.6; stroke-linecap: round; }
.ck-night .ck-bar-mark, body.icons-dark .ck-bar-mark { stroke: #8e8e93; }
/* City III: the whole card is the face, white by day and black at night. */
body .wgt-card.widget:has(.w-city-iii) { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
body .wgt-card.widget:has(.w-city-iii.w-night), body.icons-dark .wgt-card.widget:has(.w-city-iii) { background: #000; }
.w-city-iii { padding: 0 !important; }
.ck-ray { stroke: #1c1c1e; stroke-width: 0.8; stroke-linecap: round; }
.ck-iii .ck-min { stroke-width: 0.5; }
.ck-big { font: 700 15px var(--font); fill: #1c1c1e; letter-spacing: -0.03em; }
.ck-iii .ck-code { font-size: 6.6px; }
.ck-night .ck-ray, body.icons-dark .ck-ray { stroke: #fff; }
.ck-night .ck-big, body.icons-dark .ck-big { fill: #fff; }
body.icons-clear .wgt-card.widget:has(.w-city-iii), body.icons-tinted .wgt-card.widget:has(.w-city-iii) { -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
body.icons-clear .ck-face :is(.ck-ray, .ck-bar-mark), body.icons-tinted .ck-face :is(.ck-ray, .ck-bar-mark) { stroke: var(--ck-ink); }
body.icons-clear .ck-face .ck-big, body.icons-tinted .ck-face .ck-big { fill: var(--ck-ink); }
.ck-mini .ck-num { font-size: 13px; font-weight: 700; }
.ck-mini .ck-hr { stroke-width: 2; }
.ck-mini .ck-bar { stroke-width: 5; }
.ck-mini .ck-dial { stroke: rgba(0, 0, 0, 0.06); stroke-width: 1; }

/* World Clock, small: four faces two by two. */
.wc-quad { display: grid; grid-template: repeat(2, minmax(0, 1fr)) / repeat(2, minmax(0, 1fr)); gap: 7%; padding: 9% !important; place-items: center; }
.wc-q { width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; }
.wc-q .ck-face { width: auto; height: 100%; max-width: 100%; aspect-ratio: 1; }
.wc-q .ck-code { font-size: 9.5px; font-weight: 700; }
/* World Clock, medium: four faces with the city and its offset under each. */
.wc-faces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 4.5%; align-content: center; }
.wc-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.wc-cell .ck-face { width: 100%; height: auto; aspect-ratio: 1; }
.wc-cell .wc-city { max-width: 100%; margin-top: 6px; font-size: clamp(9px, 5.6cqmin, calc(13px * var(--k))); font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* In a narrow window the offsets of four cities ran into each other; each stays under its own clock. */
.wc-cell .wc-diff { max-width: 100%; font-size: clamp(8px, 5cqmin, calc(12px * var(--k))); font-weight: 600; color: var(--w-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* World Clock, large: one row per city. */
.wc-list { justify-content: space-around; }
.wc-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.wc-row + .wc-row { border-top: 0.5px solid var(--w-sep); }
.wc-row .ck-face { flex: none; width: 17%; height: auto; aspect-ratio: 1; }
.wc-meta { flex: 1; min-width: 0; }
.wc-row .wc-city { font-size: clamp(12px, 5cqmin, calc(16px * var(--k))); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-row .wc-diff { font-size: clamp(10px, 4cqmin, calc(13px * var(--k))); color: var(--w-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-time { font: 300 clamp(20px, 9cqmin, calc(32px * var(--k)))/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.wc-ampm { margin-left: 2px; font-size: 0.48em; font-weight: 500; letter-spacing: 0; }
/* City I–III, Medium: the face, and beside it the city, its time and the difference from here. */
.wc-one { display: flex; align-items: center; min-width: 0; min-height: 0; height: 100%; }
.wc-one .wc-meta { flex: 1; min-width: 0; }
.wc-wide .wc-one { gap: 7%; }
.wc-wide .wc-one .ck-face { flex: none; width: auto; height: 100%; aspect-ratio: 1; }
.wc-wide .wc-city { font-size: clamp(13px, 10cqh, calc(17px * var(--k))); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-wide .wc-time { margin: 2px 0 3px; font: 300 clamp(26px, 30cqh, calc(46px * var(--k)))/1 var(--font); }
.wc-wide .wc-diff { font-size: clamp(11px, 8.5cqh, calc(14px * var(--k))); font-weight: 600; color: var(--w-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* City I–III, Large: one large face, the city and difference under it and the time beside them. */
.wc-big .wc-one { flex-direction: column; justify-content: center; gap: 5%; }
.wc-big .wc-one .ck-face { flex: none; width: auto; height: 72%; aspect-ratio: 1; }
.wc-big .wc-meta { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "city time" "diff time"; align-items: center; column-gap: 8px; }
.wc-big .wc-city { grid-area: city; font-size: clamp(13px, 7cqmin, calc(17px * var(--k))); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-big .wc-diff { grid-area: diff; font-size: clamp(11px, 5.5cqmin, calc(14px * var(--k))); font-weight: 600; color: var(--w-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-big .wc-time { grid-area: time; font: 300 clamp(22px, 13cqmin, calc(38px * var(--k)))/1 var(--font); }
/* Digital Clock, Medium and Large: the same clock, its digits as large as fit. */
.wgt.size-m .w-clock .dc-time { font-size: min(23cqw, 50cqh); }
.wgt.size-m .w-clock:has(.dc-ampm:empty) .dc-time { font-size: min(28cqw, 58cqh); }
.wgt.size-l .w-clock .dc-time { margin: auto 0; font-size: 30cqw; }
.wgt.size-l .w-clock:has(.dc-ampm:empty) .dc-time { font-size: 37cqw; }

/* A city clock's sheet: the Style row, each style drawn as it looks. */
.group .field.ckw-col { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 16px 12px; }
.ckw-faces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ckw-face { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px 6px; border: 0; border-radius: 12px; background: transparent; color: var(--label); font-size: 13px; cursor: pointer; }
.ckw-face .ck-face, .ckw-digits { flex: none; width: 52px; height: 52px; }
.ckw-digits { display: grid; place-items: center; border-radius: 12px; background: #000; color: #fff; font: 600 17px var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ckw-face.on { background: color-mix(in srgb, var(--tint) 18%, transparent); color: var(--tint); font-weight: 600; }
.ckw-face:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; }


.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: min(calc(2px * var(--k)), 0.6cqh); margin-top: min(calc(8px * var(--k)), 2cqh); text-align: center; }
.cal-dow { font-size: min(calc(10.5px * var(--k)), 6.5cqh); font-weight: 700; color: var(--w-muted); padding-bottom: min(calc(4px * var(--k)), 1cqh); }
.cal-day { font-size: min(calc(13px * var(--k)), 7cqh); font-weight: 600; height: min(calc(25px * var(--k)), 10.4cqh); line-height: min(calc(25px * var(--k)), 10.4cqh); border-radius: 50%; width: min(calc(25px * var(--k)), 10.4cqh); margin: 0 auto; font-variant-numeric: tabular-nums; }
.cal-day.today { background: #ff453a; color: #fff; font-weight: 700; }

/*
 * Batteries, as in iPadOS. Sizes are shares of the widget (cq units), so it looks the same in Today
 * View, on the Home Screen and at every screen size.
 */
.w-battery { --bt-green: #30d158; --bt-red: #ff453a; --bt-track: color-mix(in srgb, var(--w-text) 18%, transparent); --bt-glyph: var(--w-text); }
body.mode-light .w-battery { --bt-green: #34c759; --bt-red: #ff3b30; }
.bt-ring-box { aspect-ratio: 1; }
.bt-ring { display: block; width: 100%; height: 100%; overflow: visible; }
.bt-track { fill: none; stroke: var(--bt-track); stroke-width: 9; }
.bt-arc { fill: none; stroke: var(--bt-green); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.w-battery.low .bt-arc { stroke: var(--bt-red); }
.bt-glyph { fill: var(--bt-glyph); }
.bt-bolt { fill: var(--bt-green); display: none; }
.w-battery.charging .bt-bolt { display: inline; }
.w-battery:not(.charging) .bt-gap { r: 0; }
.bt-pct { font: 600 1em/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-battery.bt-none .bt-pct { color: var(--w-muted); }

/* Small: the ring at the top left, the percentage large at the bottom left. */
.bt-s .bt-dev { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.bt-s .bt-ring-box { width: 46cqmin; }
.bt-s .bt-pct { font-size: 25cqmin; }

/* Medium: four places in a row, each a ring with the percentage under it. */

/* Clear, Tinted and Dark widget styles, as the Clock widgets have them. */
body.icons-clear .wgt-card.widget:has(.w-battery), body.icons-tinted .wgt-card.widget:has(.w-battery) {
  background: rgba(255, 255, 255, calc(0.12 + var(--g) * 0.14)); color: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), inset 0 -1px 1px rgba(255, 255, 255, 0.15), 0 6px 20px rgba(0, 0, 0, 0.08);
}
body.icons-tinted .wgt-card.widget:has(.w-battery) { background: hsla(var(--hue), 45%, 14%, 0.62); color: hsl(var(--hue), 95%, 72%); }
body.icons-clear .w-battery, body.icons-tinted .w-battery { --bt-green: currentColor; --bt-red: currentColor; --bt-glyph: currentColor; --bt-track: color-mix(in srgb, currentColor 25%, transparent); }

.w-countdown { justify-content: space-between; }
.cd-title { font-size: calc(13px * var(--k)); font-weight: 700; color: #ff9f0a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-num { font: 300 min(calc(48px * var(--k)), 30cqh, 34cqw)/1 var(--round); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cd-unit { font-size: calc(13px * var(--k)); font-weight: 600; }



.w-notes .w-title { color: #ffd60a; }
.notes-area {
  margin-top: 8px; width: 100%; min-height: 110px; resize: vertical; border: 0; outline: 0; background: transparent; color: inherit;
  font-size: calc(14px * var(--k)); line-height: 1.45; user-select: text; padding: 0; scrollbar-width: thin;
}
.notes-area::placeholder { color: var(--w-muted); }


/*
 * No blur behind the − (it showed through only a seventh of it): every icon jiggles with its −, and
 * blurring what was behind 30-odd moving badges again in every frame dropped most frames of jiggle
 * mode, even with nothing being dragged (61 of 78; none without it).
 */
.app-remove {
  width: 24px; height: 24px; padding: 0; place-items: center; border-radius: 50%; border: 0;
  background: rgba(242, 242, 247, 0.92); color: #1c1c1e; font: 700 17px/1 var(--font);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.app-remove:hover { background: #fff; }

.add-widget {
  flex: none; display: block; align-self: center; height: 40px; padding: 0 22px; border-radius: 22px; border: 0; color: #fff; font-weight: 600;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge);
}

.widgets-empty { padding: 28px 18px; text-align: center; border-radius: 24px; background: var(--w-bg); color: var(--w-text); backdrop-filter: blur(24px); }
.empty-title { font-size: 16px; font-weight: 700; }
.empty-text { font-size: 13px; color: var(--w-muted); margin: 4px 0 14px; }

/* ---------- pages ---------- */

.book-wrap { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-top: 10px; }
/*
 * Pages are a full screen width apart and are not clipped to the page area, so while you swipe the
 * icons travel all the way to the edge of the screen (and under the Dock), as on iPad. Neighbouring
 * pages start past the screen edge, so they are never seen at rest.
 */
.book { position: relative; flex: 1; min-height: 0; width: 100%; max-width: 1820px; margin: 0 auto; overflow: visible; perspective: 2200px; }
/* On a very big screen (4K and up) the page stops growing at 1820 × 1300, the 7 × 5 grid's shape, and sits in the middle. */
.book { max-height: 1300px; margin: auto; }
.track {
  display: flex; height: 100%;
  transform: translateX(calc(var(--spread, 0) * -100vw + var(--drag-x, 0px)));
  transition: transform 0.5s var(--page);
  will-change: transform;
}
.track.live { transition: none; }
.spread { flex: 0 0 100vw; min-width: 0; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); padding-right: calc(100vw - 100%); }
/*
 * Screens further away than the next one either side (other pages, the App Library) are not laid
 * out or painted until needed, so a new tab draws only what can be seen. The neighbours stay ready,
 * so a swipe never reveals a page still being drawn; a turn past several screens marks the ones it
 * passes (placeTrack). `hidden`, not `auto`: Chrome watches an `auto` element's place on screen at
 * every frame while anything animates (the clock hands always do), which kept an idle Home Screen
 * working on every frame (about 35 ms a second); `hidden` is left alone.
 */
.spread { content-visibility: hidden; }
/*
 * The screen on show and its neighbours are marked by placeTrack (`.near`), not found with `.spread:has(+ .spread.current)`:
 * Chrome rechecked that :has() for the whole strip on any change inside a screen, so every icon moved
 * while dragging cost a full style recalculation (35–65 ms; 0.1 ms without it). Nor is the next one
 * drawn because it follows the current one: a page turn would then draw the screen after it (the App
 * Library, 30 ms) in its first frame; placeTrack marks the new neighbours once the turn has settled.
 */
.spread.current, .spread.near { content-visibility: visible; }
/* Nothing beyond the screen edges ever shows or scrolls. */
html, body { overflow: clip; }
.page-shell { min-width: 0; min-height: 0; padding: 4px 18px 0; }

.page { position: relative; width: 100%; height: 100%; container-type: size; contain: layout style; border-radius: 30px; transition: background 0.15s, box-shadow 0.15s; }
.page.drop-target { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
/*
 * The Home Screen grid, as on a big iPad: 6 columns × 5 rows of square cells, whatever the window's
 * shape and the icon size, centred on the page. An icon or small widget takes a cell; medium widgets
 * take two side by side, large ones 2 × 2. Icons flow around widgets, filling gaps. Icons fill a
 * little more of their cell than with fewer rows, as iPad's denser grid does.
 */
.page { display: grid; place-items: center; }
.grid {
  --cols: 7; --rows: 5;
  --pitch: min(100cqw / var(--cols), 100cqh / var(--rows));
  width: calc(var(--pitch) * var(--cols)); height: calc(var(--pitch) * var(--rows));
  display: grid; place-items: center; grid-auto-flow: row dense;
  grid-template-columns: repeat(var(--cols), var(--pitch)); grid-template-rows: repeat(var(--rows), var(--pitch)); grid-auto-rows: var(--pitch);
  --icon: calc(var(--pitch) * 0.47 * var(--scale));
}
.app.wgt.size-s { --ww: calc(var(--pitch) * 0.83); --wh: calc(var(--pitch) * 0.83); }
.app.wgt.size-m { --ww: calc(var(--pitch) * 1.83); --wh: calc(var(--pitch) * 0.83); }
.app.wgt.size-l { --ww: calc(var(--pitch) * 1.83); --wh: calc(var(--pitch) * 1.83); }
.app.wgt.size-xl { --ww: calc(var(--pitch) * 3.83); --wh: calc(var(--pitch) * 1.83); grid-column: span 4; grid-row: span 2; }
.app.wgt { place-self: center; width: var(--ww); height: var(--wh); max-width: none; padding: 0; gap: 0; }
.wgt .wgt-card { flex: 1; border-radius: calc(var(--pitch) * 0.13); }
/* As on iPad, widgets have no name under them. */
.wgt .label { display: none; }
.wgt .app-remove { left: -8px; top: -8px; }
.app.wgt.size-m, .app.wgt.size-l { grid-column: span 2; }
.app.wgt.size-l { grid-row: span 2; }
body.editing .app.wgt { animation-name: jiggle-wide; }
@keyframes jiggle-wide { from { rotate: -0.6deg; } to { rotate: 0.6deg; } }
.wgt-ghost { border-radius: calc(var(--pitch) * 0.13); overflow: hidden; }
.drag-ghost.wgt-ghost.lifted { scale: 1.05; }
/* The stand-in around a lifted widget’s copy (liftCopy in js/newtab.js): its classes and --pitch, no box. */
.lift-host { display: contents; }

/* ---------- icons ---------- */

.app {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: max(6px, calc(var(--icon) * 0.075));
  width: max(calc(var(--icon) + 30px), calc(var(--icon) * 1.4)); max-width: 100%; text-decoration: none; color: #fff; border-radius: 16px;
  padding: 0; border: 0; background: none; font: inherit; cursor: pointer;
  touch-action: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent;
  transition: translate 0.3s var(--spring);
}
/*
 * A notification badge, as on iPadOS: a red pill with the count in white, on the icon's top-right
 * corner and standing a little out from it; round for one digit, longer for more.
 */
.app-badge {
  position: absolute; z-index: 2; top: calc(var(--icon) * -0.1); left: calc(50% + var(--icon) * 0.5 + var(--icon) * 0.1); translate: -100% 0;
  display: grid; place-items: center; min-width: calc(var(--icon) * 0.32); height: calc(var(--icon) * 0.32); padding: 0 calc(var(--icon) * 0.09);
  border-radius: 999px; background: #ff3b30; color: #fff; font: 400 calc(var(--icon) * 0.21) / 1 var(--font); font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em; pointer-events: none;
}
.app-badge.pop { animation: badge-in 0.4s var(--spring-pop) both; }
.app-badge:not(.wide) { padding: 0; width: calc(var(--icon) * 0.32); }
body.mode-dark .app-badge { background: #ff453a; }
@keyframes badge-in { from { scale: 0.4; opacity: 0; } }
/* Gone while the icon is carried (the copy being dragged has none). */
.app.drag-origin > .app-badge { display: none; }
.tile {
  position: relative; display: grid; place-items: center; overflow: hidden; flex: none; isolation: isolate;
  width: var(--icon); height: var(--icon); border-radius: 22.5%;
  background: linear-gradient(180deg, var(--c1, #5c9dff), var(--c2, #2254e0));
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.18);
  transition: transform 0.18s var(--spring-pop), filter 0.18s ease, scale 0.22s ease, box-shadow 0.2s ease;
}
/* iOS icons are a continuous-curvature squircle, not a rounded square. */
@supports (corner-shape: superellipse(2)) {
  .tile { border-radius: 30%; corner-shape: superellipse(1.6); }
}
.app:active > .tile, .app.launched > .tile { transform: scale(0.92); filter: brightness(0.75); }
/* The icon picked up is still pressed, but its place (where it lands, measured) is at full size. Keyed to it, not to body.is-dragging, which restyled every icon on picking one up. */
.app.drag-origin > .tile { transform: none; filter: none; }
.glyph {
  font: 600 calc(var(--icon) * 0.48)/1 var(--round); color: #fff; letter-spacing: -0.03em;
}
.glyph.two { font-size: calc(var(--icon) * 0.38); }
.glyph.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.tile.has-fav { background: linear-gradient(180deg, #fff, #ececf0); }
.tile.has-fav .glyph { display: none; }
.fav { width: 58%; height: 58%; object-fit: contain; pointer-events: none; }
/* A 16 or 32 px favicon is not stretched to the full size, where it would blur. */
.fav.small { width: 42%; height: 42%; }
.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
/* Behind the artwork, its own background colour (white until it is known). */
.tile.has-art { background: var(--art-bg, #fff); }
.tile.has-art .art { opacity: 1; }
/* Artwork with Apple's Liquid Glass rim drawn in: a little larger, so the rim falls outside the icon. */
.tile.art-rim .art { transform: scale(1.08); }
/*
 * The letter under an icon's artwork is left out of the page, not only hidden: laid out, letters
 * like 文 ✉︎ ♫ ☀ made Chrome load large system fonts (Chinese, symbols: tens of MB) for every new
 * tab, before its first frame, to draw something no one sees.
 */
.tile.has-art .glyph { display: none; }
/* Duo New Tab's own app icons (FT.builtinArt); the Dark, Clear and Tinted styles draw their own. */
.bi-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
body.icons-dark .bi-art, body.icons-clear .bi-art, body.icons-tinted .bi-art { display: none; }
/* They catch the light along their edge, as iPadOS 26 icons do. */
body.icons-default .tile[class*="builtin-"]::after {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; corner-shape: inherit; pointer-events: none;
  box-shadow: inset 0 calc(var(--icon) * 0.012) calc(var(--icon) * 0.008) rgba(255, 255, 255, 0.5), inset 0 calc(var(--icon) * -0.006) calc(var(--icon) * 0.01) rgba(0, 0, 0, 0.1);
}

/* Icon styles (Customize): Dark, Clear and Tinted are re-coloured from the normal artwork. */
body.icons-dark .tile:not(.folder-tile) { background: linear-gradient(180deg, #2c2c2e, #0c0c0e); }
body.icons-dark .tile:not(.folder-tile) .glyph { color: var(--c1); }
body.icons-dark .tile.has-art { background: #000; }
body.icons-dark .tile .art { filter: invert(1) hue-rotate(180deg) saturate(1.25); }
body.icons-dark .tile.has-fav { background: linear-gradient(180deg, #2c2c2e, #0c0c0e); }

body.icons-clear .tile:not(.folder-tile), body.icons-tinted .tile:not(.folder-tile) {
  background: rgba(255, 255, 255, calc(0.12 + var(--g) * 0.14));
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), inset 0 -1px 1px rgba(255, 255, 255, 0.15);
}
body.icons-clear .tile.has-art { background: rgba(255, 255, 255, calc(0.1 + var(--g) * 0.12)); }
body.icons-clear .tile .art, body.icons-tinted .tile .art, body.icons-clear .fav, body.icons-tinted .fav {
  filter: grayscale(1) invert(1) contrast(1.7) brightness(1.15); mix-blend-mode: screen;
}
/* Clear and Tinted draw the icon's symbol as a silhouette (made in newtab.js) over glass. */
.art-mono {
  display: none; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  -webkit-mask: var(--mono) center / cover no-repeat; mask: var(--mono) center / cover no-repeat;
}
body.icons-clear .tile.has-mono .art, body.icons-tinted .tile.has-mono .art { opacity: 0; }
body.icons-clear .tile.has-mono .art-mono { display: block; background: rgba(255, 255, 255, 0.96); }
body.icons-tinted .tile.has-mono .art-mono { display: block; background: hsl(var(--hue), 95%, 72%); }
body.icons-tinted .tile.has-mono::after { display: none; }

/* Icons that already have a dark background are kept, not inverted. */
body.icons-dark .tile.art-dark .art { filter: none; }
body.icons-clear .tile.art-dark .art, body.icons-tinted .tile.art-dark .art { filter: grayscale(1) contrast(1.5) brightness(1.2); }
body.icons-clear .tile .glyph { color: rgba(255, 255, 255, 0.95); }
body.icons-tinted .tile:not(.folder-tile) { background: hsla(var(--hue), 45%, 14%, 0.62); }
body.icons-tinted .tile .glyph { color: hsl(var(--hue), 95%, 72%); }
body.icons-tinted .tile.has-art::after, body.icons-tinted .tile.has-fav::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: hsl(var(--hue), 100%, 66%); mix-blend-mode: multiply;
}

/* Folder: a glass tile showing up to nine of the icons inside, with room around them as on iPadOS. */
.folder-tile {
  --mini: calc(var(--icon) * 0.19);
  grid-template-columns: repeat(3, var(--mini)); grid-auto-rows: var(--mini); gap: calc(var(--icon) * 0.07);
  place-content: center; place-items: stretch;
  background: rgba(255, 255, 255, calc(0.16 + var(--g) * 0.16));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), inset 0 -1px 1px rgba(255, 255, 255, 0.1);
}
body.mode-dark .folder-tile { background: rgba(60, 60, 68, calc(0.3 + var(--g) * 0.3)); }
.folder-tile .tile { width: var(--mini); height: var(--mini); border-radius: 24%; box-shadow: none; transition: none; }
.folder-tile .glyph { font-size: calc(var(--mini) * 0.56); }
.folder-tile .glyph.two { font-size: calc(var(--mini) * 0.42); }

/* Resting a dragged icon on another one: the target swells into a folder outline. */
.app.merge-target > .tile {
  scale: 1.18;
  box-shadow: 0 0 0 calc(var(--icon) * 0.1) rgba(255, 255, 255, 0.32), 0 10px 26px rgba(0, 0, 0, 0.3);
}

/* The lifted icon that follows the pointer. */
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; margin: 0; pointer-events: none; will-change: translate;
  transition: scale 0.2s var(--spring-pop), opacity 0.18s ease, box-shadow 0.18s ease;
}
.drag-ghost.lifted { scale: 1.16; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38); }
/*
 * The grabbing hand: the lifted icon is always under the pointer, so it alone shows it (and is looked
 * through when finding what is under the pointer, underDrag in js/newtab.js). Set on <body>, the
 * stage and every icon instead, picking an icon up and dropping it restyled the whole page (the
 * cursor is inherited by everything), 35–40 ms each time.
 */
.drag-ghost.lifted { pointer-events: auto; cursor: grabbing; }
.drag-ghost.lifted * { cursor: inherit; }
.drag-ghost.settling { transition: translate 0.26s var(--spring), scale 0.26s ease, opacity 0.22s ease, box-shadow 0.22s ease; }
.drag-ghost.absorbed { scale: 0.3; opacity: 0; }
.app.drag-origin { visibility: hidden; animation: none !important; }

.label {
  max-width: 100%; font: 500 clamp(11.5px, calc(var(--icon) * 0.15), 16px)/1.3 var(--font); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
body.no-labels .label { display: none; }
/*
 * Over a light wallpaper (body.wp-light, measured from the picture in newtab.js) icon and App Library
 * names turn dark, as on iOS, so they can be read. Inside an open folder they follow the folder's
 * glass instead: dark text on the light glass, white on the dark glass.
 */
body.wp-light .label, body.wp-light .lib-name { color: rgba(0, 0, 0, 0.86); text-shadow: 0 0 4px rgba(255, 255, 255, 0.35); }
body.mode-light .folder-panel .label { color: #000; text-shadow: none; }
body.mode-dark .folder-panel .label { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }

.app-remove { display: none; position: absolute; top: -7px; left: 6px; z-index: 3; cursor: pointer; }
body.editing .app-remove { display: grid; }
body.editing .app { animation: jiggle 0.26s ease-in-out infinite alternate; }
body.editing .app:nth-child(even) { animation-delay: -0.13s; animation-duration: 0.29s; }
body.editing .app:nth-child(3n) { animation-duration: 0.31s; }
@keyframes jiggle { from { rotate: -1.4deg; } to { rotate: 1.4deg; } }
/* In edit mode every app in the App Library jiggles: any can be dragged out as another copy. */
body.editing .library .app.lib, body.editing #folderView .app.lib { cursor: grab; }
/*
 * A Library icon has no room around it (a card's cell is the icon's size), so the − is placed from the
 * tile: centred on its left edge, as it sits on a Home Screen icon (whose tile is centred in a wider box).
 */
.app.lib > .app-remove { left: calc(50% - var(--icon) / 2 - 12px); top: -7px; }
/* A card's small group of four (the rest of the category) jiggles with the icons. */
body.editing .library .lib-quad { animation: jiggle 0.28s ease-in-out infinite alternate; animation-delay: -0.07s; }
/*
 * Only the page on screen jiggles (and the Dock, Today View and an open folder or category). The icons
 * on the other pages and in the App Library while it is not shown, hundreds of them, kept the browser
 * restyling them all over and over, out of sight, which held up every frame of a drag. They start
 * jiggling when their page comes on screen. Those pages are marked .still (placeTrack) only in jiggle
 * mode: keyed to .current, every page turn restyled all the icons of both pages, 30 ms, even outside it.
 */
body.editing .spread.still .app, body.editing .spread.still .lib-quad { animation: none; }
/* Their − buttons too appear only on the page on screen: laying out hundreds of them at once was most of the work of starting jiggle mode. */
body.editing .spread.still .app-remove { display: none; }
/* Show on Home Screen: the app's icon bounces where it is. */
.app.found > .tile { animation: found 0.7s var(--spring-pop) 2; }
@keyframes found { 40% { scale: 1.18; } }

.app.drop-before::before, .app.drop-after::after {
  content: ""; position: absolute; top: 2px; height: var(--icon); width: 4px; border-radius: 2px; background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}
.app.drop-before::before { left: -6px; }
.app.drop-after::after { right: -6px; }

/* ---------- App Library ---------- */

.spread.library { display: block; }
.lib-scroll { height: 100%; overflow-y: auto; scrollbar-width: none; padding: 6px 28px 30px; container-type: inline-size; }
.lib-scroll::-webkit-scrollbar { display: none; }
.lib-search {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: min(560px, 100%); height: 40px; margin: 4px auto 22px;
  border: 0; border-radius: 20px; color: rgba(255, 255, 255, 0.85); font-size: 16px; font-weight: 500;
}
.lib-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.lib-grid {
  --icon: calc(clamp(46px, var(--pitch) * 0.38, 96px) * var(--scale));
  --pad: calc(var(--icon) * 0.24);
  display: grid; grid-template-columns: repeat(auto-fill, calc(var(--icon) * 2 + var(--pad) * 3));
  justify-content: center; gap: max(22px, calc(var(--icon) * 0.34)) max(34px, calc(var(--icon) * 0.53));
}
.lib-cat { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.lib-card {
  display: grid; grid-template-columns: var(--icon) var(--icon); grid-template-rows: var(--icon) var(--icon);
  gap: var(--pad); padding: var(--pad); border-radius: calc(var(--icon) * 0.42);
}
.lib-card .app { width: var(--icon); gap: 0; }
.lib-card .label { display: none; }
.lib-quad {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: calc(var(--icon) * 0.1);
  width: var(--icon); height: var(--icon); padding: 0; border: 0; background: none; cursor: pointer;
}
.lib-quad .tile { width: 100%; height: 100%; border-radius: 26%; }
.lib-quad .glyph { font-size: calc(var(--icon) * 0.22); }
.lib-name { max-width: 100%; font-size: clamp(12.5px, calc(var(--icon) * 0.19), 17px); font-weight: 600; color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.book.slide .page-shell { transition: none; }

/*
 * Unlock: as on an iPad, the wallpaper settles back from a slight zoom while the icons and Dock
 * come in from larger (spread toward the edges) to their places, fading in on the way.
 */
/* While the unlock plays (js: unlockHome) the Home Screen is shown at once; each item animates itself. */
body.unlocking .stage { transition: none; }
@keyframes rise { from { opacity: 0; transform: scale(0.97); } }

/* ---------- edit mode top bar ---------- */

/* In the screen's top corners (where the status bar was), so the icons do not shift when editing starts. */
.edit-top {
  position: fixed; z-index: 41; top: 10px; left: 16px; right: 16px; height: 34px;
  display: flex; align-items: center; justify-content: space-between; animation: fadeIn 0.2s ease both;
}
.edit-left { display: flex; gap: 8px; }
.glass-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 18px; border: 0; border-radius: 17px; color: #fff; font-size: 15px; font-weight: 600;
}
.glass-pill.strong { background: rgba(255, 255, 255, 0.9); color: #000; }
.glass-pill:hover { filter: brightness(1.12); }
/* Light appearance: the glass buttons are light, so their text, symbols and page dots are dark. */
body.mode-light .page-pill, body.mode-light .glass-pill:not(.strong), body.mode-light .glass-circle, body.mode-light .add-widget { color: #000; }
body.mode-light .dot { background: rgba(0, 0, 0, 0.25); }
body.mode-light .dot.active { background: #000; }
body.mode-light .dot.lib { background: none; border-color: rgba(0, 0, 0, 0.3); }
body.mode-light .dot.lib.active { border-color: #000; }
.glass-circle { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: #fff; display: grid; place-items: center; }
.glass-circle svg, .page-pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.glass-circle:disabled { opacity: 0.4; cursor: default; }
.glass-pill svg { width: 16px; height: 16px; margin-left: -4px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- bottom pill: Search, or page dots while moving ---------- */

.bottombar { flex: none; height: 52px; display: flex; align-items: center; justify-content: center; }
.page-pill {
  display: grid; place-items: center; height: 32px; min-width: 104px; padding: 0 16px; border: 0; border-radius: 16px; color: #fff;
  transition: min-width 0.25s ease, opacity 0.2s;
}
/*
 * Both sides of the pill are always scaled (scale(1) at rest, never none): going between none and a
 * scale changed how they are laid out, and the Home Screen with them, 35–50 ms as every swipe began.
 */
.page-pill > * { grid-area: 1 / 1; transform: scale(1); transition: opacity 0.2s ease, transform 0.25s ease; }
.pill-search { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.page-pill svg { width: 15px; height: 15px; stroke-width: 2.6; }
.dots { display: flex; align-items: center; gap: 9px; opacity: 0; transform: scale(0.9); pointer-events: none; }
.page-pill.show-dots .dots, .page-pill.has-pages:hover .dots { opacity: 1; transform: scale(1); pointer-events: auto; }
.page-pill.show-dots .pill-search, .page-pill.has-pages:hover .pill-search { opacity: 0; transform: scale(0.9); }
.page-pill.no-search:not(.has-pages):not(.show-dots) { opacity: 0; pointer-events: none; }
.dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.38); transition: background 0.2s; }
.dot.active { background: #fff; }
.dot.lib { width: 9px; height: 9px; background: none; border: 1.6px solid rgba(255, 255, 255, 0.45); border-radius: 2.5px; }
.dot.lib.active { border-color: #fff; }

/* ---------- short windows ---------- */

/*
 * SHORT WINDOWS (1.35.0). A window not tall enough for the 7 × 5 grid (a bookmarks bar, a small
 * laptop) shrank the whole Home Screen with it. There icons now stay larger: at least 66px (or 0.53
 * of the cell, if that is less) instead of 0.47 of the cell, the Dock's with them. Below 760px the
 * margins above and below the pages also shrink, a little more with each pixel down to 700px, so
 * the grid and its widgets grow a little without a jump as the window is resized. Cells stay
 * square, so widgets stay lined up with the icons; a window tall enough for 66px icons does not
 * change at all. These rules override .stage, .book-wrap, .bottombar, .grid and the Dock's sizes above.
 * THE SWITCH: --short-windows: 0 lays everything out exactly as before (or delete this block).
 */
:root {
  --short-windows: 1;
  /* How far below 760px the window is, 0 to 60px (0 with the switch off). */
  --short-by: calc(clamp(0px, 760px - 100vh, 60px) * var(--short-windows));
}
.grid { --icon: calc(max(var(--pitch) * 0.47, min(var(--pitch) * 0.53, 66px * var(--short-windows))) * var(--scale)); }
/* Up to 32px more for the pages: 10px above, 6px below, 6px over the pages, 10px around the Search button. */
.stage { padding-top: calc(40px - var(--short-by) / 6); padding-bottom: calc(14px - var(--short-by) / 10); }
.book-wrap { padding-top: calc(10px - var(--short-by) / 10); }
.bottombar { height: calc(52px - var(--short-by) / 6); }
body {
  --dk-ph: min(100vh - 116px + var(--short-by) * 32 / 60, 1300px);
  --dock-icon: clamp(32px, min(calc(clamp(40px, max(var(--dk-cell) * 0.47, min(var(--dk-cell) * 0.53, 66px * var(--short-windows))), 120px) * var(--scale)), (100vh - 96px) / 9.72), 140px);
}

/* ---------- dock ---------- */

/*
 * The Dock is centred down the screen, but never comes closer than 16px under the time and status
 * circle (--sb-bottom; the column starts 46px down): its first row is at least that tall, and when it
 * has to be, the Dock sits lower, with the room under it shorter.
 */
.dock-col {
  display: grid; grid-template-rows: minmax(max(0px, var(--sb-bottom, 110px) - 30px), 1fr) auto minmax(0, 1fr); justify-items: center;
  min-height: 0; padding-top: 6px; translate: 0 0; transition: translate 0.5s var(--smooth);
}
.dock-col > .dock { grid-row: 2; }
/*
 * On the App Library the Dock slides off the edge, as on iPad, and comes back with the Home Screen.
 * It stays while editing, so an app can still be dragged from the Library to the Dock. (Moved, not
 * faded: a fading Dock loses the blur of its glass until it is fully shown again.)
 */
body.on-library:not(.editing):not(.is-dragging) .dock-col { translate: calc(100% + var(--stage-right, 14px) + 48px) 0; pointer-events: none; }
/* Meanwhile the App Library and the pill under it move over into the room the Dock leaves, so they sit in the middle of the screen. */
/* At rest these (and the Dock) are moved by nothing rather than not moved, as the stage is, so arriving at the Library does not lay the Home Screen out again (30–40 ms). */
.spread.library .lib-scroll, .bottombar { translate: 0 0; transition: translate 0.5s var(--smooth); }
body.on-library:not(.editing):not(.is-dragging) :is(.spread.library .lib-scroll, .bottombar) { translate: var(--lib-shift) 0; }
/* The Dock: icons the size of the page's (--dock-icon, worked out on <body>). */
.dock {
  display: flex; flex-direction: column; align-items: center;
  --icon: var(--dock-icon);
  gap: calc(var(--icon) * 0.23); padding: calc(var(--icon) * 0.25) calc(var(--icon) * 0.22);
  border-radius: calc(var(--icon) * 0.57);
  transition: background 0.15s;
}
.dock.drop-target { background: rgba(255, 255, 255, 0.34); }
/* The App Library's icon at the end of the Dock, after a hairline (js/newtab.js, dockLibraryEl). */
.dock-sep { flex: none; width: 62%; height: 1px; margin: calc(var(--icon) * -0.06) 0; border-radius: 1px; background: rgba(255, 255, 255, 0.3); }
/* The icons always at the end of the Dock, after the divider: Settings and the App Library. */
.dock-fixed { flex: none; display: block; padding: 0; border: 0; background: none; border-radius: 22.5%; }
.dock-settings:active > .tile { transform: scale(0.92); filter: brightness(0.75); }
/*
 * As on iPad: a frosted lavender card the size of an icon with four of the Library's apps on it,
 * and two more cards stacked behind it, showing at its left edge (drawn as shadows, which the card's
 * own clipping does not cut off). Every size comes from the icon's (--lib), not from percentages,
 * which a copy lifted out of the Dock for its menu would measure against the whole window.
 */
.dock-lib-tile {
  --lib: var(--icon);
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; place-items: center;
  gap: calc(var(--lib) * 0.073); padding: calc(var(--lib) * 0.124);
  background: linear-gradient(180deg, rgba(196, 196, 240, 0.42), rgba(160, 160, 214, 0.34));
  box-shadow:
    inset 0 calc(var(--lib) * 0.012) calc(var(--lib) * 0.01) rgba(255, 255, 255, 0.55),
    inset 0 calc(var(--lib) * -0.008) calc(var(--lib) * 0.012) rgba(255, 255, 255, 0.16),
    calc(var(--lib) * -0.115) 0 0 calc(var(--lib) * -0.065) rgba(160, 160, 215, 0.42),
    calc(var(--lib) * -0.215) 0 0 calc(var(--lib) * -0.13) rgba(140, 140, 200, 0.32);
  overflow: visible;
}
.dock-lib-tile > .tile {
  --icon: calc(var(--lib) * 0.34); width: var(--icon); height: var(--icon); border-radius: 24%;
  box-shadow: 0 calc(var(--lib) * 0.01) calc(var(--lib) * 0.02) rgba(0, 0, 0, 0.14);
}
@supports (corner-shape: superellipse(2)) { .dock-lib-tile > .tile { border-radius: 30%; corner-shape: superellipse(1.6); } }
.dock-lib:active .dock-lib-tile { transform: scale(0.92); filter: brightness(0.85); }
/* In edit mode they jiggle with the Dock's apps, but have no − and are not dragged. */
body.editing .dock-fixed { animation: jiggle 0.28s ease-in-out infinite alternate; animation-delay: -0.09s; }
body.editing .dock-settings { animation-delay: -0.17s; animation-duration: 0.3s; }
.dock .app { width: var(--icon); gap: 0; }
.dock .label { display: none; }
.dock .app-remove { left: -8px; }
.dock .app.drop-before::before, .dock .app.drop-after::after { left: 0; right: auto; top: auto; width: var(--icon); height: 4px; }
.dock .app.drop-before::before { top: -8px; }
.dock .app.drop-after::after { bottom: -8px; }
.dock-empty { width: 58px; padding: 26px 0; font-size: 11px; text-align: center; color: rgba(255, 255, 255, 0.7); }

/* ---------- open folder ---------- */

.folder-view {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 24px;
}
/*
 * The blurred Home Screen behind, a layer of its own that fades in and out (the panel and the name
 * zoom on their own). Not the whole view: fading it would cut the blur and the panel's glass off
 * from the Home Screen behind them; and not the blur itself, which can only be animated a frame at a time.
 */
.folder-view::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(0, 0, 0, 0.18); -webkit-backdrop-filter: blur(30px) saturate(140%); backdrop-filter: blur(30px) saturate(140%);
  animation: folderFade 0.25s ease both;
}
.folder-title {
  width: min(460px, 86vw); height: 50px; padding: 0 14px; border: 0; border-radius: 14px; outline: 0; background: transparent;
  font: 700 34px/1 var(--font); letter-spacing: -0.02em; text-align: center; text-overflow: ellipsis; user-select: text;
}
.folder-title:not([readonly]):hover { background: rgba(255, 255, 255, 0.08); }
.folder-title:focus { background: rgba(255, 255, 255, 0.14); }
.folder-panel {
  --icon: calc(clamp(52px, min(var(--pitch) * 0.47, 8.6vh), 120px) * var(--scale));
  position: relative; z-index: 0;
  width: min(max(520px, calc(var(--icon) * 6.6)), 92vw); padding: 32px 24px 26px; border-radius: 42px;
  /* A big folder (or an App Library category) stays on screen and its grid scrolls. */
  display: flex; flex-direction: column; max-height: calc(100dvh - 130px);
}
/*
 * The panel's glass is a layer of its own, so it alone grows out of the folder icon and shrinks back
 * into it (js/newtab.js, flyFolder) while the icons fly on their own.
 */
.folder-platter { position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; }
/*
 * While the folder opens or closes: copies of its icons fly between the folder icon and their places,
 * over the whole screen (the grid scrolls, so it would cut off icons flying in from outside it), and
 * the grid itself waits hidden. The folder's own icon on the page is hidden while it is open: its
 * glass is the panel.
 */
.folder-fly { position: fixed; inset: 0; pointer-events: none; }
.folder-fly > .app { position: absolute; margin: 0; transition: none; }
/* The folder icon's small icons, on the moving glass (which is the icon's own glass meanwhile). */
#folderPanel .folder-ghost {
  position: absolute; margin: 0; transition: none; transform-origin: center;
  background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
}
.folder-view.flying .folder-grid { visibility: hidden; }
.app.folder-away > .tile { visibility: hidden; }
.folder-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: max(22px, calc(var(--icon) * 0.3)) 6px; place-items: start center;
  min-height: min(calc((var(--icon) + 22px) * 3 + 44px), calc(100dvh - 230px)); align-content: start;
  /* Room inside the scrolling box for the − badges and the jiggle, which reach past an icon's edge. */
  overflow-y: auto; overscroll-behavior: contain; padding: 12px 8px; margin: -12px -8px; scrollbar-width: thin;
}
@keyframes folderFade { from { opacity: 0; } }

/* ---------- Spotlight ---------- */

.spotlight {
  position: fixed; inset: 0; z-index: 35; display: flex; justify-content: center; padding: 70px 20px 20px;
  background: rgba(0, 0, 0, 0.26); -webkit-backdrop-filter: blur(36px) saturate(150%); backdrop-filter: blur(36px) saturate(150%);
  transition: opacity 0.28s ease, display 0.3s allow-discrete;
}
.sp-panel {
  width: min(720px, 100%); display: flex; flex-direction: column; gap: 18px; min-height: 0;
  transition: opacity 0.25s ease, translate 0.5s var(--smooth);
}
.spotlight[hidden] { opacity: 0; transition-duration: 0.22s; }
.spotlight[hidden] .sp-panel { opacity: 0; translate: 0 -14px; transition-duration: 0.18s, 0.25s; }
@starting-style {
  .spotlight { opacity: 0; }
  .sp-panel { opacity: 0; translate: 0 -28px; }
}
.sp-bar { display: flex; align-items: center; gap: 12px; }
.sp-field { flex: 1; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border-radius: 24px; }
.sp-field svg { width: 20px; height: 20px; fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 2.4; stroke-linecap: round; flex: none; }
.sp-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 19px; user-select: text; color: #fff; }
.sp-field input::placeholder { color: rgba(255, 255, 255, 0.6); }
.sp-cancel { border: 0; background: none; color: #fff; font-size: 16px; font-weight: 500; padding: 8px 4px; }
.sp-results { overflow-y: auto; scrollbar-width: none; min-height: 0; display: flex; flex-direction: column; gap: 18px; padding-bottom: 20px; }
.sp-results::-webkit-scrollbar { display: none; }
.sp-h { margin: 0 6px 8px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.72); }
.sp-h-row { display: flex; align-items: baseline; justify-content: space-between; }
.sp-more { border: 0; padding: 0; background: none; color: #fff; font: inherit; cursor: pointer; }
.sp-more:hover { text-decoration: underline; }
.sp-icons {
  --icon: 60px; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 16px 4px; place-items: start center;
  padding: 16px 10px; border-radius: 26px; background: rgba(255, 255, 255, 0.1);
}
.sp-list { border-radius: 22px; overflow: hidden; background: rgba(255, 255, 255, 0.12); }
.sp-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; background: none; color: #fff;
  text-align: left; text-decoration: none; font-size: 15px; --icon: 38px;
}
.sp-row + .sp-row { box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.14); }
.sp-row:hover, .sp-row.sel { background: rgba(255, 255, 255, 0.14); }
.sp-row .tile { border-radius: 24%; }
.sp-row .ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); }
.sp-row .ico svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sp-row .txt { min-width: 0; display: flex; flex-direction: column; }
.sp-row .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row .t2 { font-size: 12.5px; color: rgba(255, 255, 255, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-letter { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.6); }

/* ---------- Control Center ---------- */

.cc {
  position: fixed; inset: 0; z-index: 36; display: flex; justify-content: flex-end; align-items: flex-start; padding: calc(var(--sb-bottom, 104px) + 12px) 26px 20px;
  background: rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(28px) saturate(140%); backdrop-filter: blur(28px) saturate(140%);
  overflow-y: auto; transition: opacity 0.28s ease, display 0.3s allow-discrete;
}
/* Control Center drops down from the top right corner, where it is pulled from. */
.cc-grid {
  --u: 74px; display: grid; grid-template-columns: repeat(4, var(--u)); grid-template-rows: auto; grid-auto-rows: var(--u); gap: 16px;
  transform-origin: top right; transition: opacity 0.22s ease, scale 0.5s var(--spring), translate 0.5s var(--spring);
}
.cc[hidden] { opacity: 0; transition-duration: 0.24s; }
.cc[hidden] .cc-grid { opacity: 0; scale: 0.9; translate: 0 -10px; transition: opacity 0.2s ease, scale 0.26s ease-in, translate 0.26s ease-in; }
@starting-style {
  .cc { opacity: 0; }
  .cc-grid { opacity: 0; scale: 0.86; translate: 0 -16px; }
}
.cc-mod { border-radius: 26px; color: #fff; border: 0; padding: 0; min-width: 0; overflow: hidden; background: rgba(var(--tone), calc(0.16 + var(--g) * 0.3)); }
/* Liquid Glass, lighter than the Dock's, with a bright edge, as iPadOS 26 draws Control Center. */
.cc .cc-mod {
  background: rgba(255, 255, 255, calc(0.1 + var(--g) * 0.1));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.cc .cc-slider { background: rgba(255, 255, 255, calc(0.14 + var(--g) * 0.1)); }
.cc-mod.w2 { grid-column: span 2; }
.cc-mod.h2 { grid-row: span 2; }
.cc-btn { display: grid; place-items: center; transition: background 0.2s, color 0.2s; }
/* One-cell buttons are round, as in iPadOS 26's Control Center. */
.cc-btn:not(.w2):not(.h2) { border-radius: 50%; }
.cc-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cc-btn:hover { filter: brightness(1.15); }
.cc-btn.on { background: #fff; color: #000; }
/* The date along the top (the connection and battery are in the status circle above). */
.cc-head { grid-column: span 4; display: flex; align-items: center; padding: 0 6px; margin-bottom: -4px; color: #fff; font: 600 14px/1 var(--font); }
/* The toggles block: three large round toggles and four small ones in the last corner, icons only. */
.cc-conn { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; padding: 12px; gap: 6px; place-items: center; }
.cc-circle { display: flex; flex-direction: column; align-items: center; border: 0; background: none; color: #fff; padding: 0; cursor: pointer; }
.cc-circle .c { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.18); transition: background 0.2s, scale 0.3s var(--spring-pop); }
.cc-circle:hover .c { background-color: rgba(255, 255, 255, 0.26); }
.cc-circle:active .c { scale: 0.9; }
.cc-circle:focus-visible { outline: 0; }
.cc-circle:focus-visible .c { box-shadow: 0 0 0 2px #fff; }
.cc-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cc-mini .cc-circle .c { width: 26px; height: 26px; }
.cc-mini .cc-circle .c svg { width: 15px; height: 15px; stroke-width: 2.3; }
.cc-circle .c svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cc-circle .c svg.solid { fill: currentColor; stroke: none; }
.cc-circle.on .c, .cc-circle.on:hover .c { background: #0091ff; }
.cc-circle.on.green .c { background: #30d158; }
.cc-circle.on.orange .c { background: #ff9230; }
.cc-circle.on.purple .c { background: #5e5ce6; }
.cc-slider { position: relative; display: block; cursor: ns-resize; touch-action: none; }
.cc-slider .fill { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--v, 0.5) * 100%); background: #fff; transition: height 0.08s linear; }
.cc-slider svg { position: absolute; left: 50%; bottom: 18px; width: 26px; height: 26px; transform: translateX(-50%); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke: #8e8e93; z-index: 1; }
.cc-slider.light-low svg { stroke: #fff; }
/* In colour on the white fill, as iPad's: a yellow sun, a blue grid. */
.cc-bright:not(.light-low) svg { stroke: #ffb800; }
.cc-size:not(.light-low) svg { stroke: #0a84ff; }
/* Style, a wide button as iPad's Focus: its icon, the current style, and up-down chevrons. */
.cc-pill { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 14px; text-align: left; cursor: pointer; transition: background 0.2s, scale 0.3s var(--spring-pop); }
.cc-pill:hover { filter: brightness(1.15); }
.cc-pill:active { scale: 0.96; }
.cc-pill-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.cc-pill-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cc-pill-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cc-pill-t b { font: 600 15px/1.1 var(--font); }
.cc-pill-t small { font-size: 12px; color: rgba(255, 255, 255, 0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-pill-chev { flex: none; width: 16px; height: 16px; fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Edit Pages ---------- */

.pages-view {
  position: fixed; inset: 0; z-index: 34; display: flex; flex-direction: column; padding: 50px 40px 30px;
  background: rgba(0, 0, 0, 0.22); -webkit-backdrop-filter: blur(34px) saturate(140%); backdrop-filter: blur(34px) saturate(140%);
  transition: opacity 0.28s ease, display 0.3s allow-discrete;
}
.pages-view[hidden] { opacity: 0; }
body.pages-open #editTop { opacity: 0; pointer-events: none; }
.pages-view[hidden] .pages-grid { scale: 1.06; opacity: 0; }
@starting-style {
  .pages-view { opacity: 0; }
  .pages-grid { scale: 1.12; opacity: 0; }
}
.pages-head { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.pages-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px; align-content: center; padding: 20px 0; transition: scale 0.5s var(--smooth), opacity 0.25s ease;
}
.pg-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pg-thumb {
  width: 100%; aspect-ratio: 16 / 10; display: grid; grid-template-columns: 1fr; padding: 10px; border: 0; border-radius: 22px;
  background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); cursor: pointer;
}
.pg-thumb:hover { background: rgba(255, 255, 255, 0.2); }
.pg-card.current .pg-thumb { box-shadow: inset 0 0 0 2px #fff; }
.pg-grid {
  --icon: 18px; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 30px; grid-auto-flow: row dense; gap: 4px;
  place-items: center; align-content: start; padding: 8px; border-radius: 14px; background: rgba(0, 0, 0, 0.1); height: 100%;
}
.pg-grid .tile { border-radius: 26%; }
.pg-grid .glyph { font-size: 8px; }
.pg-grid .wgt-mini { width: 100%; height: 100%; border-radius: 8px; background: rgba(255, 255, 255, 0.35); }
.pg-grid .wgt-mini.size-m { grid-column: span 2; }
.pg-grid .wgt-mini.size-l { grid-column: span 2; grid-row: span 2; }
.pg-grid .wgt-mini.size-xl { grid-column: span 4; grid-row: span 2; }
.pg-half {
  --icon: 15px; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 22px; gap: 3px; place-items: center; align-content: start;
  padding: 6px; border-radius: 12px; background: rgba(0, 0, 0, 0.1);
}
.pg-half .tile { border-radius: 26%; }
.pg-half .glyph { font-size: 8px; }
.pg-name { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
/* The tick under each page, as on iPad: white and ticked while the page is shown, an empty ring once hidden. */
.pg-check {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08); color: transparent; transition: background 0.2s, color 0.2s, scale 0.25s var(--spring-pop);
}
.pg-check svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pg-check.on { background: #fff; border-color: #fff; color: #000; }
.pg-check:active { scale: 0.88; }
/* A hidden page is shown faded until it is ticked again. */
.pg-card.off .pg-thumb { opacity: 0.45; cursor: default; }
.pg-card.off .pg-thumb:hover { background: rgba(255, 255, 255, 0.12); }
.pg-del { position: absolute; top: -9px; left: -9px; }
.pg-add { aspect-ratio: 16 / 10; width: 100%; border: 1.5px dashed rgba(255, 255, 255, 0.4); border-radius: 22px; background: rgba(255, 255, 255, 0.05); color: #fff; font-size: 34px; font-weight: 300; }
.pg-add:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Customize sheet ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 33; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 16px; transition: display 0.32s allow-discrete; }
.sheet-wrap[hidden] .sheet { translate: 0 calc(100% + 24px); transition: translate 0.3s cubic-bezier(0.4, 0, 0.9, 0.6); }
@starting-style { .sheet { translate: 0 calc(100% + 24px); } }
.sheet {
  width: min(520px, 100%); padding: 10px 20px 22px; border-radius: 34px; color: #fff;
  background: rgba(var(--tone), calc(0.22 + var(--g) * 0.4));
  transition: translate 0.5s var(--smooth);
}
.sheet-grabber { width: 38px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: rgba(255, 255, 255, 0.4); }
.sheet-row { display: flex; gap: 10px; justify-content: space-between; }
.seg { display: flex; padding: 3px; border-radius: 20px; background: rgba(255, 255, 255, 0.14); gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 17px; background: none; color: #fff; font-size: 13.5px; font-weight: 600; }
.seg.icons button { width: 40px; padding: 0; display: grid; place-items: center; }
.seg button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.seg button[aria-checked="true"] { background: rgba(255, 255, 255, 0.92); color: #000; }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 8px; }
.styles button { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 0; border: 0; border-radius: 18px; background: none; color: #fff; font-size: 12.5px; font-weight: 600; }
.styles button[aria-checked="true"] { background: rgba(255, 255, 255, 0.16); }
.sw { width: 46px; height: 46px; border-radius: 24%; }
@supports (corner-shape: superellipse(2)) { .sw { border-radius: 30%; corner-shape: superellipse(1.6); } }
.sw-default { background: linear-gradient(135deg, #ff9f0a, #ff375f 50%, #0a84ff); }
.sw-dark { background: linear-gradient(180deg, #2c2c2e, #0c0c0e); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.sw-clear { background: rgba(255, 255, 255, 0.24); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), inset 0 -1px 1px rgba(255, 255, 255, 0.2); }
.sw-tinted { background: hsla(var(--hue), 60%, 30%, 0.8); box-shadow: inset 0 0 0 1px hsla(var(--hue), 95%, 72%, 0.6); }
.slider-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-size: 13.5px; font-weight: 600; }
.slider-row > span:first-child { width: 92px; flex: none; }
.slider-ends { flex: 1; display: flex; align-items: center; gap: 10px; }
.slider-ends small { font-size: 11.5px; color: rgba(255, 255, 255, 0.65); }
/* Light appearance: the glass is light, so the text and controls on it are dark. */
body.mode-light .sheet, body.mode-light .seg button, body.mode-light .styles button { color: #000; }
body.mode-light .sheet-grabber { background: rgba(0, 0, 0, 0.2); }
body.mode-light .seg { background: rgba(118, 118, 128, 0.14); }
body.mode-light .seg button[aria-checked="true"] { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
body.mode-light .styles button[aria-checked="true"] { background: rgba(0, 0, 0, 0.07); }
body.mode-light .slider-ends small { color: rgba(60, 60, 67, 0.6); }
.sheet input[type="range"] { flex: 1; min-width: 0; height: 26px; margin: 0; background: transparent; appearance: none; }
.sheet input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.28); }
.sheet input[type="range"].hue::-webkit-slider-runnable-track { background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.sheet input[type="range"]::-webkit-slider-thumb { appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
body.icons-default #hueRow, body.icons-dark #hueRow, body.icons-clear #hueRow { display: none; }

/* ---------- dialogs: iOS sheets ---------- */

.dlg {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0;
  border-radius: 30px; background: var(--sheet); color: var(--label);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45); user-select: none; overflow-y: auto; scrollbar-width: thin;
}
.dlg {
  transition: translate 0.5s var(--smooth), opacity 0.2s ease, scale 0.4s var(--spring-pop), display 0.5s allow-discrete, overlay 0.5s allow-discrete;
}
.dlg:not([open]) {
  translate: 0 calc(50vh + 50%); transition: translate 0.32s cubic-bezier(0.4, 0, 0.9, 0.6), opacity 0.2s ease 0.12s, display 0.32s allow-discrete, overlay 0.32s allow-discrete;
}
@starting-style { .dlg[open] { translate: 0 calc(50vh + 50%); } }
.dlg.alert:not([open]) { translate: none; opacity: 0; scale: 0.96; transition: opacity 0.2s ease, scale 0.2s ease, display 0.2s allow-discrete, overlay 0.2s allow-discrete; }
@starting-style { .dlg.alert[open] { translate: none; opacity: 0; scale: 1.14; } }
.dlg::backdrop { transition: background 0.3s ease, display 0.5s allow-discrete, overlay 0.5s allow-discrete; }
.dlg:not([open])::backdrop { background: transparent; }
@starting-style { .dlg[open]::backdrop { background: transparent; } }
.dlg.wide { width: min(580px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.32); }
.dlg-inner { padding: 12px 18px 22px; }
/*
 * Every window's title bar stays at the top in Liquid Glass, as in iOS 26 and later: once content
 * scrolls beneath it, that content shows through frosted (blurred and washed with the window's
 * colour), and the glass fades out softly below the bar instead of ending in a line (the "scroll
 * edge effect"). At the top of the page there is nothing beneath, so the bar is clear.
 */
.dlg-nav {
  position: sticky; top: 0; z-index: 2; isolation: isolate; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 50px; margin: -12px -18px 8px; padding: 0 14px; background: transparent;
}
.dlg-nav::before {
  content: ""; position: absolute; inset: 0 0 -22px; z-index: -1; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--sheet) 62%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  transition: opacity 0.25s ease;
}
.dlg.nav-scrolled .dlg-nav::before { opacity: 1; }
/* A very light line at the foot of the glass, to set the bar apart from what scrolls beneath. */
.dlg-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0.5px; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--label) 12%, transparent); transition: opacity 0.25s ease;
}
.dlg.nav-scrolled .dlg-nav::after { opacity: 1; }
/* Its buttons are glass capsules; the one that confirms (Done, Add, Save) is tinted. */
.dlg-nav .nav-btn {
  height: 36px; padding: 0 15px; border-radius: 18px; font-size: 16px; color: var(--label);
  background: rgba(var(--tone), 0.14); -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: scale 0.3s var(--spring-pop), filter 0.15s;
}
body:not(.mode-dark) .dlg-nav .nav-btn {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.08);
}
.dlg-nav .nav-btn.strong, body:not(.mode-dark) .dlg-nav .nav-btn.strong {
  color: #fff; background: var(--tint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 3px 12px color-mix(in srgb, var(--tint) 40%, transparent);
}
.dlg-nav .nav-btn:hover { filter: brightness(1.08); }
.dlg-nav .nav-btn:active { scale: 0.94; }
.dlg-nav > :first-child { justify-self: start; }
.dlg-nav > :last-child { justify-self: end; }
.dlg h2 { margin: 0; font-size: 17px; font-weight: 600; }
.nav-btn { border: 0; background: none; color: var(--tint); font-size: 17px; padding: 6px 4px; }
.nav-btn.strong { font-weight: 600; }
.dlg h3 { margin: 22px 16px 7px; font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; color: var(--label2); }

.group { border-radius: 12px; background: var(--cell); overflow: hidden; margin-top: 16px; }
h3 + .group { margin-top: 0; }
.group:empty, #appDeleteGroup:has(#appDelete[hidden]) { display: none; }
.group.pad { padding: 14px; }
.cell, .group .field, .row {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; margin: 0; padding: 6px 16px;
}
.cell + .cell::before, .group .field + .field::before, .row + .row::before, .cell-btn + .cell-btn::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--cell-sep);
}
.cell > span, .group .field > span, .row > span { flex: none; font-size: 16px; color: var(--label); }
.row > span { flex: 1; min-width: 0; }
.row small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--label2); line-height: 1.35; }
.cell input, .cell select, .group .field input, .group .field select, .row select {
  flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; background: transparent; color: var(--label2); text-align: right; font-size: 16px; user-select: text;
}
.row select { flex: none; width: auto; max-width: 180px; color: var(--label2); cursor: pointer; }
.cell input:focus, .group .field input:focus { color: var(--label); }
.dlg select option { background: var(--cell); color: var(--label); }
/* Pop-up buttons (popupmenu.css) in a window’s rows. */
.cell .pm-btn, .group .field .pm-btn, .row .pm-btn { color: var(--label2); font-size: 16px; }
.row .pm-btn { max-width: 200px; }
.cell-btn { position: relative; display: block; width: 100%; height: 46px; padding: 0 16px; border: 0; background: none; color: var(--tint); text-align: left; font-size: 16px; }
.cell-btn:hover, .row:hover { background: var(--fill); }
.cell-btn.danger { color: var(--red); }

.app-preview { display: grid; place-items: center; margin: 4px 0 4px; --icon: 76px; }
.swatches { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 6px 0; }
.swatches button { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.swatches button[aria-checked="true"] { border-color: var(--label); box-shadow: 0 0 0 2px var(--cell) inset; }

.error { margin: 12px 4px 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 69, 58, 0.16); color: var(--red); font-size: 13.5px; }
.fine { margin: 10px 16px 0; font-size: 13px; color: var(--label2); line-height: 1.4; }
.fine.hint { margin-top: 8px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { height: 34px; padding: 0 16px; border-radius: 17px; border: 0; background: var(--fill); color: var(--tint); font-weight: 600; font-size: 14px; }
.btn:hover { filter: brightness(1.1); }

/*
 * Add Widget, after the iPadOS widget gallery (openGallery in js/newtab.js): a search field and the
 * apps on the left; Suggestions as live widgets on the right, or an app’s widgets one at a time with
 * page dots and Add Widget.
 */
.dlg.wg-dlg { width: min(960px, calc(100vw - 32px)); height: min(700px, calc(100vh - 40px)); overflow: hidden; }
.wg-dlg .dlg-inner.wg { display: flex; flex-direction: column; height: 100%; padding: 12px 0 0; }
.wg-dlg .dlg-nav { flex: none; margin: -12px 0 0; }
.wg-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
/* The sidebar: its own rounded panel, a shade apart from the window with a fine edge, as Settings’ is. */
.wg-side {
  min-height: 0; overflow-y: auto; margin: 2px 0 16px 14px; padding: 14px 10px 14px 12px; border-radius: 24px;
  background: color-mix(in srgb, var(--label) 6%, var(--sheet)); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--label) 14%, transparent);
}
.wg-main { margin-left: 4px; }
.wg-search { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--fill); color: var(--label2); cursor: text; }
.wg-search-ico { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wg-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--label); font-size: 16px; user-select: text; }
.wg-apps { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.wg-app { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 7px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--label); font-size: 16px; text-align: left; cursor: pointer; }
.wg-app:hover { background: var(--fill); }
.wg-app.on { background: var(--tint); color: #fff; }
.wg-sparkle { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #5e9cff, #a35bf5); color: #fff; }
.wg-sparkle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.wg-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; padding: 2px 24px 24px; }
.wg-dlg .wg-h { margin: 6px 0 16px; padding: 0; font: 700 22px/1.2 var(--font); color: var(--label); text-transform: none; letter-spacing: 0.01em; }
.wg-none { margin: 60px 0; text-align: center; color: var(--label2); }
/* Suggestions: small ones a cell, medium two across, large two by two; the app’s name under each. */
.wg-grid { display: grid; grid-template-columns: repeat(auto-fill, 128px); grid-auto-rows: 132px; grid-auto-flow: dense; gap: 22px 18px; justify-content: center; }
.wg-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.wg-tile.size-m { grid-column: span 2; }
.wg-tile.size-l { grid-column: span 2; grid-row: span 2; }
.wg-tile.size-xl { grid-column: span 4; grid-row: span 2; }
.wg-tile .wg-host { transition: scale 0.35s var(--spring-pop); }
.wg-tile:hover .wg-host { scale: 1.03; }
.wg-tile:active .wg-host { scale: 0.97; }
.wg-tile:focus-visible { outline: none; }
.wg-tile:focus-visible .wgt-card { outline: 3px solid var(--tint); outline-offset: 3px; }
.wg-cap { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--label2); }
.wg-cap .st-badge, .wg-cap .st-app-ico { --icon: 18px; width: 18px; height: 18px; border-radius: 5px; }
.wg-cap .st-badge .st-sym { width: 12px; height: 12px; }
/* A widget drawn for the gallery: the size it is on the Home Screen at that cell size; not clickable itself. */
.wg-host { flex: none; display: flex; pointer-events: none; text-align: left; }
/* An app’s page. */
.wg-back { display: none; align-self: flex-start; align-items: center; gap: 2px; padding: 4px 6px 4px 0; border: 0; background: transparent; color: var(--tint); font-size: 16px; cursor: pointer; }
.wg-back-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wg-apphead { display: flex; align-items: center; gap: 12px; margin: 6px 0 0; }
.wg-apphead .st-badge, .wg-apphead .st-app-ico { --icon: 40px; width: 40px; height: 40px; border-radius: 10px; }
.wg-apphead .st-badge .st-sym { width: 24px; height: 24px; }
.wg-dlg .wg-appname { margin: 0; padding: 0; font: 700 26px/1.2 var(--font); color: var(--label); text-transform: none; letter-spacing: 0.01em; }
.wg-text { margin: 18px 0 4px; text-align: center; }
.wg-name { font: 600 19px/1.25 var(--font); }
.wg-desc { margin-top: 3px; font-size: 14px; color: var(--label2); }
.wg-track { flex: 1; min-height: 170px; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; cursor: pointer; }
.wg-track::-webkit-scrollbar { display: none; }
.wg-slide { flex: 0 0 100%; display: grid; place-items: center; scroll-snap-align: center; }
.wg-dots { display: flex; justify-content: center; gap: 0; padding: 6px 0 2px; }
.wg-dots[hidden] { display: none; }
/* Each dot is 8 px, but takes a click anywhere in the 20 px around it (they sat 9 px apart and were easy to miss). */
.wg-dot { display: grid; place-items: center; width: 20px; height: 24px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.wg-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--label) 26%, transparent); transition: background 0.2s ease, scale 0.25s var(--spring-pop); }
.wg-dot:hover::before { background: color-mix(in srgb, var(--label) 55%, transparent); scale: 1.25; }
.wg-dot[aria-selected="true"]::before { background: var(--label); }
.wg-add {
  flex: none; align-self: center; display: inline-flex; align-items: center; gap: 8px; height: 50px; margin-top: 8px; padding: 0 30px; border: 0; border-radius: 25px;
  background: var(--tint); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; transition: scale 0.25s var(--spring-pop), filter 0.2s ease;
}
.wg-add:hover { filter: brightness(1.08); }
.wg-add:active { scale: 0.95; }
.wg-add-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
/* A narrow window: the search and apps across the top, the widgets under them; Widgets goes back. */
@media (max-width: 700px) {
  .wg-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .wg-side { overflow: visible; margin: 0; padding: 2px 16px 4px; border-radius: 0; background: none; box-shadow: none; }
  .wg-main { margin-left: 0; }
  .wg-apps { flex-direction: row; gap: 6px; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .wg-app { flex: none; width: auto; min-height: 40px; padding: 5px 12px 5px 6px; border-radius: 20px; background: var(--fill); }
  .wg-dlg.wg-in-app .wg-side { display: none; }
  .wg-dlg.wg-in-app .wg-back { display: inline-flex; }
  .wg-main { padding: 6px 16px 20px; }
  .wg-grid { grid-template-columns: repeat(auto-fill, 112px); grid-auto-rows: 116px; gap: 20px 12px; }
}

/* Choosing cities (City, Digital Clock and World Clock), as in the Clock app: search over every city. */
.cp { display: flex; flex-direction: column; }
.cp-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 12px 0; }
.cp-chips:empty { display: none; }
.cp-chip {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 40px; padding: 0 8px 0 10px; border: 0; border-radius: 10px;
  background: var(--fill); color: var(--label); font-size: 15px; text-align: left; cursor: pointer;
}
.cp-chip.on { box-shadow: inset 0 0 0 2px var(--tint); }
.cp-chip.empty .cp-name { color: var(--tint); }
.cp-n { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--label2); color: var(--cell); font-size: 12px; font-weight: 700; }
.cp-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-x { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--label2); font-size: 18px; line-height: 1; }
.cp-x:hover { background: var(--fill); color: var(--label); }
.cp-search { display: flex; align-items: center; gap: 6px; height: 36px; margin: 12px; padding: 0 10px; border-radius: 10px; background: var(--fill); color: var(--label2); cursor: text; }
.cp-search svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cp-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--label); font-size: 16px; user-select: text; }
.cp-input::-webkit-search-cancel-button { display: none; }
.cp-list { position: relative; max-height: min(340px, 46vh); overflow-y: auto; border-top: 0.5px solid var(--cell-sep); }
.cp-row {
  position: relative; display: flex; align-items: baseline; gap: 8px; width: 100%; min-height: 44px; padding: 11px 46px 11px 16px;
  border: 0; background: none; color: var(--label); font-size: 16px; text-align: left; cursor: pointer;
}
.cp-row + .cp-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--cell-sep); }
.cp-row:hover { background: var(--fill); }
.cp-city { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-region { flex: none; color: var(--label2); font-size: 14px; }
/* The chosen city is ticked, as in iOS lists. */
.cp-row.on::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 6px; height: 12px;
  border: solid var(--tint); border-width: 0 2.2px 2.2px 0; transform: translateY(-65%) rotate(45deg);
}
.cp-none { padding: 18px; color: var(--label2); text-align: center; }

.wallpapers { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.wp-swatch { position: relative; aspect-ratio: 9 / 13; border-radius: 14px; border: 0; padding: 0; overflow: hidden; box-shadow: 0 0 0 0.5px var(--cell-sep); }
.wp-swatch span { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.wp-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--tint); }

.switch {
  appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 16px;
  background: var(--fill); cursor: pointer; transition: background 0.25s;
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.25s var(--spring-pop), width 0.2s; }
.switch:active::after { width: 33px; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch:checked:active::after { transform: translateX(14px); }

/* alert */
.dlg.alert { width: 290px; border-radius: 30px; padding: 0; background: rgba(var(--tone), 0.78); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); color: #fff; }
body.mode-light .dlg.alert { background: rgba(250, 250, 252, 0.86); color: #000; }
.alert-inner { padding: 22px 20px 16px; text-align: center; }
.alert-inner h2 { font-size: 17px; font-weight: 600; }
.alert-inner p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.38; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.alert-actions button { height: 44px; border: 0; border-radius: 22px; background: var(--fill); color: inherit; font-size: 16px; font-weight: 600; }
.alert-actions button.danger { background: var(--red); color: #fff; }
/* Three or more choices (Delete App, Remove from Home Screen, Cancel): one under another, full width. */
.alert-actions.stacked { grid-template-columns: 1fr; gap: 8px; }
.alert-inner h2 { overflow-wrap: anywhere; }

/*
 * The review alert (js/review.js), after the App Store's rating prompt: the app icon, title and
 * message, the stars between two hairlines, then Not Now and a quieter Send Feedback.
 */
.rv-alert { --rv-line: color-mix(in srgb, currentColor 16%, transparent); }
.rv-alert:focus { outline: none; }
.rv-alert .alert-inner { padding: 22px 22px 14px; }
.rv-alert .alert-inner p { margin-top: 4px; text-wrap: balance; opacity: 0.85; }
.rv-icon { display: block; width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 22.5%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
@supports (corner-shape: superellipse(2)) { .rv-icon { border-radius: 30%; corner-shape: superellipse(1.6); } }
.rv-stars { display: flex; justify-content: center; gap: 6px; margin: 0 18px; padding: 6px 0; border-block: 0.5px solid var(--rv-line); }
.rv-star { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.rv-star svg { width: 27px; height: 27px; fill: transparent; stroke: var(--tint); stroke-width: 1.25; stroke-linejoin: round; transition: fill 0.12s ease, scale 0.2s var(--spring-pop, ease); }
.rv-star.on svg { fill: var(--tint); }
.rv-star:active svg { scale: 0.86; }
.rv-actions { display: flex; flex-direction: column; align-items: center; padding: 14px 16px 10px; }
.rv-later { width: 100%; height: 44px; border: 0; border-radius: 22px; background: var(--fill); color: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.rv-later:hover { filter: brightness(1.08); }
.rv-later:active { scale: 0.97; }
.rv-feedback { margin-top: 4px; padding: 8px 12px; border: 0; border-radius: 12px; background: none; color: var(--tint); font-size: 14px; cursor: pointer; }
.rv-feedback:hover { text-decoration: underline; }
/* Send Feedback and Don't Ask Again, side by side under Not Now; Don't Ask Again the quieter. */
.rv-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.rv-links .rv-feedback { margin-top: 0; }
.rv-feedback.rv-never { color: inherit; opacity: 0.6; }
.rv-alert button:focus { outline: none; }
.rv-alert button:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.rv-star:focus-visible { outline-offset: -2px; }
/* The share sheet (js/share.js): the rating alert with a row of apps, four across, for the stars. */
.sh-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 2px; margin: 0 18px; padding: 12px 0 10px; border-block: 0.5px solid var(--rv-line); }
.sh-app { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 0; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; cursor: pointer; }
.sh-tile { display: grid; place-items: center; width: 50px; height: 50px; overflow: hidden; border-radius: 22.5%; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16); transition: scale 0.2s var(--spring-pop, ease); }
@supports (corner-shape: superellipse(2)) { .sh-tile { border-radius: 30%; corner-shape: superellipse(1.6); } }
.sh-tile svg { width: 27px; height: 27px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* A brand's logo on its tile: filled, at the size js/share.js gives it. */
.sh-tile.sh-logo svg { stroke: none; }
.sh-label { max-width: 100%; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; opacity: 0.85; }
.sh-app:active .sh-tile { scale: 0.9; }

/*
 * Window controls on every window (js/windows.js), the same as Notes: red closes, yellow minimizes to
 * the shelf at the bottom left, green fills the screen. Their symbols show under the pointer.
 */
.nav-lead { display: flex; align-items: center; gap: 12px; min-width: 0; padding-left: 6px; }
.win-ctrl { display: flex; align-items: center; gap: 8px; flex: none; }
.win-light {
  position: relative; display: grid; place-items: center; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); transition: filter 0.15s, scale 0.3s var(--spring-pop);
}
.win-light::before { content: ""; position: absolute; inset: -5px -4px; border-radius: 50%; }
.win-light.l-close { background: #ff5f57; }
.win-light.l-min { background: #febc2e; }
.win-light.l-full { background: #28c840; }
.win-light:hover { scale: 1.12; }
.win-light:active { filter: brightness(0.82); scale: 0.92; }
.win-light:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.win-ico {
  width: 10px; height: 10px; fill: none; stroke: rgba(0, 0, 0, 0.62); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; scale: 0.6; transition: opacity 0.15s ease 0.06s, scale 0.3s var(--spring-pop) 0.06s;
}
.win-ctrl:hover .win-ico, .win-ctrl:has(:focus-visible) .win-ico { opacity: 1; scale: 1; }
/* The title bar is where a window is dragged from. */
.dlg-nav { cursor: default; touch-action: none; }
.dlg.dlg-moving { user-select: none; box-shadow: 0 40px 110px rgba(0, 0, 0, 0.5); }
/* Filling the screen, below the status bar. */
.dlg.dlg-full { inset: 0; width: auto; max-width: none; height: auto; max-height: none; margin: 36px 8px 8px; border-radius: 26px; }
.dlg.dlg-instant, .dlg.dlg-instant::backdrop { transition: none !important; }
/* The shelf of minimized windows; each button brings its window back as it was. */
.win-shelf { position: fixed; left: 16px; bottom: 16px; z-index: 45; display: flex; flex-wrap: wrap; gap: 8px; max-width: calc(100vw - 32px); pointer-events: none; }
.win-chip {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 20px; pointer-events: auto;
  background: rgba(var(--tone), calc(0.16 + var(--g) * 0.3)); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge); color: #fff; font: 600 14px/1 var(--font); white-space: nowrap;
  transition: opacity 0.2s ease, scale 0.3s var(--spring-pop);
}
body:not(.mode-dark) .win-chip { background: rgba(255, 255, 255, 0.72); color: #000; }
.win-chip:hover { scale: 1.04; }
.win-chip:active { scale: 0.95; }
.win-chip.arrived { animation: chipLand 0.45s var(--spring-pop); }
@keyframes chipLand { 0% { scale: 0.85; } 100% { scale: 1; } }
.win-chip-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* ---------- App Switcher (js/switcher.js) ---------- */

/*
 * A row of window cards over the blurred Home Screen, below the status bar (and below Notes, so its
 * window can shrink into its card on top). Each card: the app's icon and name, then a picture of the
 * window in its shape. Flick a card up to quit; the others close the gap.
 */
.switcher {
  position: fixed; inset: 0; z-index: 38; display: flex; align-items: center; overflow-x: auto; overflow-y: hidden;
  background: rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(30px) saturate(140%); backdrop-filter: blur(30px) saturate(140%);
  animation: folderFade 0.25s ease both;
}
.sw-row { display: flex; align-items: center; gap: 44px; margin: 0 auto; padding: 70px max(40px, 7vw) 60px; min-width: min-content; }
.sw-card {
  flex: none; display: flex; flex-direction: column; gap: 10px; outline: none; cursor: default; touch-action: none;
  transition: translate 0.45s var(--smooth), opacity 0.3s ease, width 0.34s var(--smooth), margin 0.34s var(--smooth);
}
.sw-card.gone { width: 0 !important; margin-right: -44px; opacity: 0; }
.sw-label { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 2px; color: #fff; font: 600 14px/1 var(--font); white-space: nowrap; }
.sw-name { overflow: hidden; text-overflow: ellipsis; }
.sw-icon { flex: none; width: 26px; height: 26px; border-radius: 7px; }
.sw-icon-win { display: grid; place-items: center; background: rgba(255, 255, 255, 0.22); }
.sw-icon-win svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.sw-window { position: relative; overflow: hidden; border-radius: 18px; background: #000; box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 22px 60px rgba(0, 0, 0, 0.45); transition: scale 0.3s var(--spring-pop); }
.sw-card:hover .sw-window { scale: 1.02; }
.sw-card:active .sw-window { scale: 0.97; }
.sw-card:focus-visible .sw-window { outline: 3px solid #0a84ff; outline-offset: 4px; }
/* The picture of the window: a copy, laid out at the window's size and scaled into the card. */
.sw-shot { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: hidden; }
.sw-shot.napp { position: absolute; inset: auto; z-index: auto; }
.sw-shot.dlg {
  display: block; position: absolute; inset: auto; margin: 0; max-width: none; max-height: none; translate: none !important; opacity: 1 !important;
  transition: none; box-shadow: none; overflow: hidden; border-radius: 0;
}
.sw-empty { color: rgba(255, 255, 255, 0.8); font: 600 17px var(--font); padding: 40px; }
body.mode-light .sw-empty { color: rgba(0, 0, 0, 0.6); }
/* Minimized-window buttons are in the switcher while it is up. */
body.switcher-open .win-shelf { opacity: 0; pointer-events: none; }
/* The bottom edge of the Home Screen, where a swipe up opens the App Switcher. */
.home-edge { position: fixed; left: 0; right: 0; bottom: 0; height: 12px; z-index: 20; touch-action: none; }
body.editing .home-edge, body.app-open:not(.app-windowed) .home-edge { display: none; }

/* ---------- context menu (Haptic Touch) ---------- */

/*
 * As on iPad, the Home Screen behind a menu is dimmed, not blurred (a blur of the whole screen was
 * also the slowest thing to draw), and the icon or widget it belongs to lifts a little above it.
 */
.menu-shade {
  position: fixed; inset: 0; z-index: 48; background: rgba(0, 0, 0, 0.42);
  transition: opacity 0.22s ease, display 0.24s allow-discrete;
}
body:not(.mode-dark) .menu-shade { background: rgba(0, 0, 0, 0.3); }
.menu-shade[hidden] { opacity: 0; }
@starting-style { .menu-shade { opacity: 0; } }
.menu-preview { position: fixed; margin: 0; pointer-events: none; transition: scale 0.32s var(--spring-pop); }
.menu-preview.up { scale: 1.05; }
.menu {
  position: fixed; z-index: 50; min-width: 240px; max-height: calc(100vh - 16px); overflow-y: auto; scrollbar-width: none;
  padding: 6px; border-radius: 26px; color: #fff;
  background: rgba(var(--tone), calc(0.5 + var(--g) * 0.3)); transform-origin: top left;
  transition: opacity 0.16s ease, scale 0.3s var(--spring-pop), display 0.3s allow-discrete;
}
.menu[hidden] { opacity: 0; scale: 0.6; transition: opacity 0.14s ease, scale 0.18s ease-in, display 0.18s allow-discrete; }
@starting-style { .menu { opacity: 0; scale: 0.4; } }
/* Back, at the top of a list opened in place ("Move to…"). */
.menu button.menu-back { justify-content: flex-start; gap: 6px; padding-left: 8px; color: var(--tint); }
/* An icon or widget pressed on the Home Screen sinks a little, as on iPad, before its menu opens. */
.wgt > .wgt-card { transition: scale 0.22s var(--spring-pop); }
.wgt:active > .wgt-card { scale: 0.97; }
.wgt.drag-origin > .wgt-card, body.editing .wgt:active > .wgt-card { scale: none; }
body:not(.mode-dark) .menu { background: rgba(246, 246, 250, 0.72); color: #000; }
/* Rows as on iPadOS 26: the label, its symbol on the right, a rounded highlight under the pointer. */
.menu button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 44px; padding: 10px 14px 10px 16px; text-align: left; border: 0; border-radius: 14px; background: transparent; font-size: 17px; letter-spacing: -0.01em; color: inherit; }
.menu button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu button:hover, .menu button:focus-visible { background: rgba(128, 128, 136, 0.22); outline: 0; }
.menu button.danger { color: #ff453a; }
body:not(.mode-dark) .menu button.danger { color: #ff3b30; }
/* Between groups a hairline with room either side (not the thick grey bar of older iOS). */
.menu-sep { height: 0.5px; margin: 6px 16px; background: rgba(255, 255, 255, 0.2); }
body:not(.mode-dark) .menu-sep { background: rgba(60, 60, 67, 0.22); }
/* A widget’s sizes along the top of its menu, as on iPad: Small, Medium, Large, Extra Large as shapes (one cell 12 px). */
.menu .menu-sizes { display: flex; justify-content: space-between; gap: 4px; padding: 2px 4px 0; }
.menu .menu-size { flex: 1; display: grid; place-items: center; width: auto; height: 46px; padding: 0; border-radius: 12px; justify-content: center; }
.menu .menu-size:hover:not(:disabled), .menu .menu-size:focus-visible { background: rgba(128, 128, 136, 0.24); }
.menu .menu-size.on { background: color-mix(in srgb, var(--tint) 22%, transparent); color: var(--tint); }
.menu .menu-size:disabled { opacity: 0.28; cursor: default; }
.menu-size-shape { display: block; border: 1.8px solid currentColor; border-radius: 4px; }
.menu-size.on .menu-size-shape { background: currentColor; }
.menu-size.size-s .menu-size-shape { width: 12px; height: 12px; border-radius: 3.5px; }
.menu-size.size-m .menu-size-shape { width: 26px; height: 12px; }
.menu-size.size-l .menu-size-shape { width: 26px; height: 26px; border-radius: 6px; }
.menu-size.size-xl .menu-size-shape { width: 44px; height: 22px; border-radius: 5px; }

/* ---------- Dynamic Island ---------- */

/*
 * At the top centre of the screen, as on iPhone; hidden until something happens. Its size, scale and
 * fades are animated from js/newtab.js (islandShow) on springs; here only where it is and how it looks.
 */
.island {
  position: fixed; inset: 7px auto auto 50%; translate: -50% 0; margin: 0; padding: 0; border: 0; overflow: hidden; z-index: 60;
  display: block; width: 126px; height: 37px; border-radius: 18.5px; background: #000; color: #fff;
  opacity: 0; pointer-events: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.island:not(:popover-open) { display: block; }
.island.shown { opacity: 1; }
.island.expanded { pointer-events: auto; }
/* The content, laid out at the open size and centred, so the island opens round it. */
.island-body {
  position: absolute; top: 0; left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 12px; padding: 0 14px 0 12px;
  opacity: 0; transition: opacity 0.12s ease;
}
.island.expanded .island-body { opacity: 1; }
.isl-lead { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #2c2c2e; }
.isl-lead svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.isl-lead.charge { background: rgba(52, 199, 89, 0.22); }
.isl-lead.charge svg { width: 12px; height: 20px; fill: #34c759; stroke: none; }
.isl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.isl-t1 { font-size: 14.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.isl-t2 { font-size: 12.5px; color: rgba(235, 235, 245, 0.6); }
.isl-big { font: 600 26px/1 var(--round); color: #34c759; padding-right: 8px; font-variant-numeric: tabular-nums; }
.isl-btn { flex: none; height: 34px; padding: 0 16px; border: 0; border-radius: 17px; background: #0a84ff; color: #fff; font-weight: 600; font-size: 14px; }
/* An app's own icon in place of the round symbol (the Duo Games offer). */
.isl-lead.isl-art { border-radius: 22.5%; background: none; overflow: hidden; }
.isl-lead.isl-art img { display: block; width: 100%; height: 100%; }
/* A × beside the button: closes the island and nothing else. */
.isl-x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-left: -4px; padding: 0; border: 0; border-radius: 50%; background: #2c2c2e; color: rgba(235, 235, 245, 0.75); cursor: pointer; }
.isl-x:hover { color: #fff; }
.isl-x svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* ---------- opening a shortcut ---------- */

.folder-view.closing { pointer-events: none; }
.folder-view.closing::before { animation: folderOut 0.3s ease both; }
/* A fade, as it opened: animating the blur itself away made the browser blur the screen again at every
   strength, a frame at a time, which dropped frames as a folder closed. */
@keyframes folderOut { to { opacity: 0; } }

/*
 * Scroll indicators, as on iPadOS (drawn by js/scroll.js): no scrollbar or track, only a thin rounded
 * bar inset from the edge that shows while a view scrolls and fades out after; dark over light content,
 * light over dark; thicker under the pointer, and draggable.
 */
html *, html { scrollbar-width: none !important; }
/* Where a view's bar starts and ends, past bars laid over its content (not inherited by views inside it). */
@property --scroll-inset-top { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --scroll-inset-bottom { syntax: "<length>"; inherits: false; initial-value: 0px; }
.dlg:has(.dlg-nav) { --scroll-inset-top: 50px; }
*::-webkit-scrollbar { display: none; }
.ft-scroll {
  position: fixed; z-index: 2147483000; margin: 0; border-radius: 99px; opacity: 0; pointer-events: none; cursor: default;
  transition: opacity 0.35s ease, background 0.15s ease;
}
.ft-scroll.on { opacity: 1; pointer-events: auto; transition: opacity 0.1s ease, background 0.15s ease; }
.ft-scroll[data-tone="dark"] { background: rgba(0, 0, 0, 0.36); box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.25); }
.ft-scroll[data-tone="light"] { background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.ft-scroll[data-tone="dark"].thick, .ft-scroll[data-tone="dark"].held { background: rgba(0, 0, 0, 0.5); }
.ft-scroll[data-tone="light"].thick, .ft-scroll[data-tone="light"].held { background: rgba(255, 255, 255, 0.75); }

/* ---------- small windows ---------- */

@media (max-width: 920px) {
  .stage { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 560px) {
  .page-shell { padding: 4px 6px 0; }
  body { --stage-right: 8px; --stage-left: 8px; --stage-gap: 8px; }
  .stage { padding-bottom: 10px; }
  .cc-grid { --u: 62px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- widget designs ---------- */

.widget-body { padding: calc(var(--pitch, 150px) * 0.09); }
.w-title { font-size: clamp(11px, 8cqmin, calc(14px * var(--k))); }

/*
 * Weather, as on iPad: white type on a sky that follows the conditions and time of day. Small: place,
 * temperature, then symbol, condition and high/low. Medium adds six hours; Large adds the coming days
 * with rain chances and temperature-range bars; Extra Large puts hours and days side by side.
 */
.wgt-card:has(.w-weather) { background: linear-gradient(180deg, #2f7fd8 0%, #5ea6ea 100%); color: #fff; }
.wgt-card:has([data-sky="clear-night"]), .wgt-card:has([data-sky="partly-night"]) { background: linear-gradient(180deg, #0b1633 0%, #26386a 100%); }
.wgt-card:has([data-sky="partly-day"]) { background: linear-gradient(180deg, #4a87c9 0%, #84add6 100%); }
.wgt-card:has([data-sky="cloudy-day"]), .wgt-card:has([data-sky="fog-day"]) { background: linear-gradient(180deg, #5f7790 0%, #92a5b8 100%); }
.wgt-card:has([data-sky="cloudy-night"]), .wgt-card:has([data-sky="fog-night"]) { background: linear-gradient(180deg, #1c2533 0%, #3a4659 100%); }
.wgt-card:has([data-sky="rain-day"]), .wgt-card:has([data-sky="storm-day"]) { background: linear-gradient(180deg, #3e4d60 0%, #687b90 100%); }
.wgt-card:has([data-sky="rain-night"]), .wgt-card:has([data-sky="storm-night"]) { background: linear-gradient(180deg, #151c26 0%, #2f3a48 100%); }
.wgt-card:has([data-sky="snow-day"]) { background: linear-gradient(180deg, #7f94ab 0%, #b4c3d3 100%); }
.wgt-card:has([data-sky="snow-night"]) { background: linear-gradient(180deg, #27324a 0%, #4b5a73 100%); }

.w-weather { color: #fff; text-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.12); font-variant-numeric: tabular-nums; }
.w-weather .wx-glyph { display: block; }
.wx-city { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: clamp(12px, 8.5cqmin, calc(16px * var(--k))); font-weight: 600; white-space: nowrap; }
.wx-city > span { overflow: hidden; text-overflow: ellipsis; }
.wx-arrow { flex: none; width: 0.72em; height: 0.72em; }
/* Regular weight, as in Apple's Weather widgets (not light). */
.wx-temp { font: 400 clamp(30px, 28cqmin, calc(60px * var(--k)))/1.05 var(--font); letter-spacing: -0.03em; }
.wx-cond, .wx-hl { font-size: clamp(11px, 7.5cqmin, calc(14px * var(--k))); font-weight: 600; line-height: 1.25; }
.wx-icon .wx-glyph { width: clamp(16px, 13cqmin, calc(28px * var(--k))); height: clamp(16px, 13cqmin, calc(28px * var(--k))); }

/*
 * Small, measured from the iPad widget: place at the top left (about a tenth of the card), a large
 * temperature under it (about a quarter), and at the bottom the symbol, the condition and H/L
 * (about a twelfth each). Sizes follow the card, so nothing is cut off at any icon size.
 */
.wx-small { height: 100%; display: flex; flex-direction: column; min-width: 0; }
.wgt.size-s .widget-body:has(.wx-small) { padding: 10.5cqmin 10.5cqmin 9.5cqmin; }
.wx-small .wx-city { font-size: max(9px, 10cqmin); line-height: 1.2; }
.wx-small .wx-temp { font-size: max(24px, 30cqmin); font-weight: 400; line-height: 1; margin-top: 0.5cqmin; letter-spacing: -0.035em; }
.wx-small .wx-bottom { margin-top: auto; display: flex; flex-direction: column; min-width: 0; }
.wx-small .wx-icon { display: block; margin-bottom: 1.5cqmin; }
.wx-small .wx-icon .wx-glyph { width: max(11px, 11.5cqmin); height: max(11px, 11.5cqmin); }
.wx-small .wx-cond, .wx-small .wx-hl { font-size: max(8.5px, 8.6cqmin); line-height: 1.22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Medium and larger: place and temperature left; symbol, condition, high/low right. */
.wx-top { display: flex; justify-content: space-between; gap: 8px; }
.wx-top > div:first-child { min-width: 0; }
.wx-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; padding-top: 2px; }
.wx-side .wx-icon { margin-bottom: 3px; }

.wx-hours { display: flex; justify-content: space-between; gap: 4px; margin-top: auto; padding-top: 6px; }
.wx-hour { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: clamp(10px, 6cqmin, calc(13px * var(--k))); font-weight: 600; }
.wx-h { opacity: 0.9; white-space: nowrap; }
.wx-h-long { font-size: 0.8em; letter-spacing: -0.03em; }
.wx-t { white-space: nowrap; }
.wx-hi { position: relative; display: grid; place-items: center; height: clamp(18px, 11cqmin, calc(26px * var(--k))); }
.wx-hour .wx-glyph { width: clamp(16px, 10cqmin, calc(24px * var(--k))); height: clamp(16px, 10cqmin, calc(24px * var(--k))); }
.wx-pop { font-size: 0.78em; font-weight: 700; color: #64d2ff; line-height: 1; }
.wx-hi .wx-pop { position: absolute; top: 100%; }

/* Large: hours, a hairline, then the days. */
.wgt.size-l .w-weather .wx-hours { margin-top: 10px; }
.wx-sep { height: 0.5px; background: rgba(255, 255, 255, 0.35); margin: 10px 0 4px; }
.wx-days { display: flex; flex-direction: column; flex: 1; justify-content: space-between; min-height: 0; }
.wx-day { display: grid; grid-template-columns: 3.3em 2.2em 2.3em minmax(0, 1fr) 2.3em; align-items: center; gap: 6px; font-size: clamp(11px, 5.4cqmin, calc(15px * var(--k))); font-weight: 600; }
.wx-dname { white-space: nowrap; }
.wx-dicon { display: flex; flex-direction: column; align-items: center; }
.wx-dicon .wx-glyph { width: 1.4em; height: 1.4em; }
/* The chance of rain sits tight under the symbol so the rows stay even. */
.wx-dicon .wx-pop { font-size: 0.66em; margin-top: -0.25em; }
.wx-day { min-height: 0; line-height: 1.15; }
.wx-lo { text-align: right; opacity: 0.6; }
.wx-hi2 { text-align: right; }
.wx-bar { position: relative; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.18); }
.wx-fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.wx-now { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35); }

/* Extra large: two halves. */
.wx-xl { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; height: 100%; }
.wx-xl-left { display: flex; flex-direction: column; min-width: 0; }
.wx-xl-right { display: flex; flex-direction: column; min-width: 0; border-left: 0.5px solid rgba(255, 255, 255, 0.3); padding-left: 18px; }
.wx-xl .wx-day { font-size: clamp(11px, 4.6cqh, calc(15px * var(--k))); }

.wx-loading, .wx-error { height: 100%; display: flex; flex-direction: column; gap: 4px; }
.wx-msg { margin-top: auto; font-size: clamp(11px, 7.5cqmin, calc(14px * var(--k))); font-weight: 600; }
.wx-hint { font-size: clamp(10px, 6.5cqmin, calc(13px * var(--k))); opacity: 0.85; }
/*
 * Medium and Large are sized from the card's height (cqh), in the iPad widget's proportions, so the
 * place, the temperature, the hours and the days always fit, whatever the icon size. (Fixed minimum
 * sizes used to add up to more than a smaller card holds: Medium cut off its hours and Large
 * squeezed its days into a few pixels, one over the other.)
 */
.wgt.size-m .wx-city { font-size: max(8px, 10cqh); line-height: 1.2; }
.wgt.size-m .wx-temp { font-size: max(20px, 27cqh); line-height: 1; }
.wgt.size-m .wx-side { padding-top: 0; }
.wgt.size-m .wx-side .wx-icon { margin-bottom: 1cqh; }
.wgt.size-m .wx-icon .wx-glyph { width: max(11px, 12cqh); height: max(11px, 12cqh); }
.wgt.size-m .wx-cond, .wgt.size-m .wx-hl { font-size: max(8px, 8.8cqh); line-height: 1.2; white-space: nowrap; }
.wgt.size-m .wx-hours { padding-top: 0; }
.wgt.size-m .wx-hour { gap: 2.5cqh; font-size: max(8px, 8.8cqh); line-height: 1.2; }
.wgt.size-m .wx-hi { height: max(11px, 12cqh); }
.wgt.size-m .wx-hour .wx-glyph { width: max(11px, 12cqh); height: max(11px, 12cqh); }

/*
 * Large, set like Apple's iPad widget (sizes as a share of the widget's height): the place 4.6 %, a
 * regular-weight temperature 12 %, the condition and H/L 3.8 %; the hours' times 3.6 % and their
 * temperatures 4.2 %; the days 4.3 %, all semibold. Lows are secondary (dimmer), as in Weather.
 */
.wgt.size-l .wx-city { font-size: max(9px, 4.6cqh); line-height: 1.25; font-weight: 600; }
.wgt.size-l .wx-temp { font-size: max(22px, 12cqh); font-weight: 400; line-height: 1.02; letter-spacing: -0.025em; margin-top: 0.3cqh; }
.wgt.size-l .wx-side { padding-top: 0.4cqh; gap: 0.2cqh; }
.wgt.size-l .wx-side .wx-icon { margin-bottom: 0.8cqh; }
.wgt.size-l .wx-icon .wx-glyph { width: max(12px, 5.8cqh); height: max(12px, 5.8cqh); }
.wgt.size-l .wx-cond, .wgt.size-l .wx-hl { font-size: max(8px, 3.8cqh); line-height: 1.25; font-weight: 600; white-space: nowrap; }
.wgt.size-l .w-weather .wx-hours { margin-top: auto; padding-top: 2cqh; }
.wgt.size-l .wx-hour { gap: 1.1cqh; font-size: max(8px, 4.2cqh); line-height: 1.15; font-weight: 600; }
.wgt.size-l .wx-h { font-size: max(7.5px, 3.6cqh); opacity: 0.92; }
.wgt.size-l .wx-h-long { font-size: max(7px, 3.1cqh); }
.wgt.size-l .wx-hi { height: max(12px, 6.4cqh); }
.wgt.size-l .wx-hour .wx-glyph { width: max(12px, 6.2cqh); height: max(12px, 6.2cqh); }
.wgt.size-l .wx-hi .wx-pop { font-size: max(6.5px, 2.8cqh); }
.wgt.size-l .wx-sep { margin: 2.6cqh 0 1.2cqh; background: rgba(255, 255, 255, 0.28); }
.wgt.size-l .wx-day { font-size: max(8px, 4.3cqh); gap: 1.8cqh; line-height: 1.2; font-weight: 600; grid-template-columns: 3.6em 1.9em 2.2em minmax(0, 1fr) 2.2em; }
.wgt.size-l .wx-dicon .wx-glyph { width: 1.35em; height: 1.35em; }
.wgt.size-l .wx-dicon .wx-pop { font-size: 0.62em; }
.wgt.size-l .wx-lo { opacity: 0.55; }
.wgt.size-l .wx-bar { height: max(3px, 1.2cqh); border-radius: 99px; }
/* The days share what height is left evenly, never less than a row's own height. */
.wgt.size-l .wx-days { justify-content: space-evenly; }
.wgt.size-l .wx-day { flex: none; }


/* Calendar small and medium: weekday in red, the date large. */
.cal-dayblock { display: flex; flex-direction: column; min-width: 0; }
.cal-wd { font-size: clamp(10px, 8cqmin, calc(13px * var(--k))); font-weight: 700; text-transform: uppercase; color: #ff3b30; letter-spacing: 0.02em; }
.cal-num { font: 400 clamp(30px, 34cqmin, calc(60px * var(--k)))/1.05 var(--font); letter-spacing: -0.03em; }
.cal-none { margin-top: auto; font-size: clamp(10px, 7.5cqmin, calc(13px * var(--k))); color: var(--w-muted); font-weight: 600; }
.cal-small .cal-dayblock { height: 100%; }
.cal-medium { flex-direction: row; gap: 14px; }
.cal-medium .cal-dayblock { flex: 0 0 34%; }
.cal-month { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-month .w-title { display: none; }
.cal-month .cal-grid { margin-top: 0; }

/*
 * Reminders (js/widgets.js, from js/reminders.js): the list’s symbol and count, its name in its colour,
 * and its reminders with round checkboxes that tick them off. Small: three; Medium: the count on the
 * left, the reminders on the right; Large: up to eight with their dates; Extra Large: two columns.
 */
.w-todo { gap: 0; }
.rw-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rw-badge { flex: none; display: grid; place-items: center; width: max(18px, 15cqmin); height: max(18px, 15cqmin); border-radius: 50%; background: var(--rw); color: #fff; }
.rw-badge svg { width: 58%; height: 58%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rw-count { font: 700 max(18px, 17cqmin)/1 var(--font); color: var(--rw); font-variant-numeric: tabular-nums; }
.rw-name { margin-top: 2.5cqmin; font: 700 max(10px, 8.6cqmin)/1.15 var(--font); color: var(--rw); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-list { list-style: none; margin: 4cqmin 0 0; padding: 0; display: flex; flex-direction: column; gap: 3.2cqmin; min-height: 0; overflow: hidden; }
.rw-item { display: flex; align-items: flex-start; gap: 4cqmin; min-width: 0; cursor: pointer; }
.rw-check {
  flex: none; display: grid; place-items: center; width: max(11px, 8.6cqmin); height: max(11px, 8.6cqmin); margin-top: 0.4cqmin; padding: 0;
  border: max(1.2px, 0.9cqmin) solid color-mix(in srgb, var(--w-text) 32%, transparent); border-radius: 50%; background: transparent; cursor: pointer;
  transition: border-color 0.2s ease, scale 0.2s ease;
}
.rw-check::after { content: ""; width: 62%; height: 62%; border-radius: 50%; background: var(--c, var(--rw)); scale: 0; transition: scale 0.32s var(--spring-pop); }
.rw-check:hover { border-color: var(--c, var(--rw)); }
.rw-check:active { scale: 0.88; }
.rw-item.ticked .rw-check { border-color: var(--c, var(--rw)); }
.rw-item.ticked .rw-check::after { scale: 1; }
.rw-item.ticked .rw-text { color: var(--w-muted); }
.rw-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rw-text { font: 500 max(9.5px, 7.8cqmin)/1.22 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-when { font-size: max(8px, 6cqmin); color: var(--w-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-when.late { color: #ff453a; }
.rw-flag { flex: none; width: max(9px, 6.6cqmin); height: max(9px, 6.6cqmin); margin-top: 0.6cqmin; color: #ff9f0a; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.rw-more { margin-top: auto; padding-top: 2cqmin; font-size: max(8px, 6.4cqmin); font-weight: 600; color: var(--w-muted); }
.rw-empty { margin: auto 0; font-size: max(9px, 7.4cqmin); font-weight: 600; color: var(--w-muted); text-align: center; }
/* Small: no dates. */
.wgt.size-s .rw-when, .wgt.size-s .rw-flag { display: none; }
/* Medium: the count and name on the left, the reminders on the right. */
.rw-medium { flex-direction: row; gap: 6cqh; }
.rw-medium .rw-left { flex: 0 0 31%; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.rw-medium .rw-badge { width: max(18px, 17cqh); height: max(18px, 17cqh); }
.rw-medium .rw-count { font-size: max(22px, 26cqh); }
.rw-medium .rw-name { margin-top: 2cqh; font-size: max(10px, 9.4cqh); }
.rw-medium .rw-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rw-medium .rw-list { margin: 0; gap: 4.4cqh; }
.rw-medium .rw-item { gap: 4cqh; }
.rw-medium .rw-check { width: max(11px, 10cqh); height: max(11px, 10cqh); border-width: max(1.2px, 1cqh); }
.rw-medium .rw-text { font-size: max(9.5px, 9cqh); }
.rw-medium .rw-when { font-size: max(8px, 7cqh); }
.rw-medium .rw-flag { width: max(9px, 7.4cqh); height: max(9px, 7.4cqh); }
.rw-medium .rw-more { font-size: max(8px, 7.4cqh); }
.rw-medium .rw-empty { font-size: max(9px, 8.6cqh); }
/* Large and Extra Large: a header row, then the reminders with dates and hairlines. */
.wgt.size-l .rw-badge, .wgt.size-xl .rw-badge { width: max(18px, 7.6cqh); height: max(18px, 7.6cqh); }
.wgt.size-l .rw-head, .wgt.size-xl .rw-head { justify-content: flex-start; gap: 3cqh; }
.wgt.size-l .rw-name, .wgt.size-xl .rw-name { flex: 1; margin: 0; font-size: max(11px, 5.4cqh); }
.wgt.size-l .rw-count, .wgt.size-xl .rw-count { font-size: max(16px, 8cqh); }
.wgt.size-l .rw-list, .wgt.size-xl .rw-list { margin-top: 3cqh; gap: 0; }
.wgt.size-l .rw-item, .wgt.size-xl .rw-item { gap: 3cqh; padding: 1.7cqh 0; border-bottom: 0.5px solid var(--w-sep); }
.wgt.size-l .rw-check, .wgt.size-xl .rw-check { width: max(11px, 5.2cqh); height: max(11px, 5.2cqh); border-width: max(1.2px, 0.5cqh); }
.wgt.size-l .rw-text, .wgt.size-xl .rw-text { font-size: max(9.5px, 4.5cqh); }
.wgt.size-l .rw-when, .wgt.size-xl .rw-when { font-size: max(8px, 3.6cqh); }
.wgt.size-l .rw-flag, .wgt.size-xl .rw-flag { width: max(9px, 3.8cqh); height: max(9px, 3.8cqh); }
.wgt.size-l .rw-more, .wgt.size-xl .rw-more, .wgt.size-l .rw-empty, .wgt.size-xl .rw-empty { font-size: max(8px, 3.8cqh); }
.wgt.size-xl .rw-list { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 6), auto); column-gap: 5cqh; align-content: start; }

/* Notes: yellow header with the note below. */
/* Notes: a yellow bar with the app name, then the note, as in Apple's Notes widget. */
.w-notes .w-title {
  margin: calc(var(--pitch) * -0.09) calc(var(--pitch) * -0.09) 8px; padding: calc(var(--pitch) * 0.05) calc(var(--pitch) * 0.09);
  background: #ffcc00; color: #fff; text-transform: none; letter-spacing: 0; font-size: clamp(11px, 8cqmin, calc(14px * var(--k))); font-weight: 600;
}
.notes-area { margin-top: 0; font-weight: 600; }
.notes-area::placeholder { font-weight: 500; }
.wgt.size-s .w-notes .notes-area { min-height: 0; flex: 1; resize: none; font-size: calc(13px * var(--k)); }

/* A very small widget (a narrow window's 7 × 5 grid): Calendar keeps the day and date, without the events line. */
@container (max-height: 90px) {
  .cal-none { display: none; }
}

/*
 * The welcome card (first open): an iPadOS sheet over the blurred Home Screen offering to add your
 * most visited sites, with a fan of app icons, a large title, a blue Add Sites capsule and Not Now.
 */
.welcome, .ci {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, 0.22); -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%);
  animation: wl-in 0.4s ease both;
}
.welcome.out, .ci.out { animation: wl-out 0.3s ease both; }
@keyframes wl-in { from { opacity: 0; } }
@keyframes wl-out { to { opacity: 0; } }
.wl-card {
  display: flex; flex-direction: column; align-items: center; width: min(440px, 100%); padding: 34px 32px 22px; border-radius: 38px;
  background: var(--cell, #fff); color: var(--label, #000); text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  animation: wl-pop 0.55s var(--spring-pop, ease) both;
}
.welcome.out .wl-card, .ci.out .wl-card { animation: wl-drop 0.3s ease both; }
@keyframes wl-pop { from { opacity: 0; transform: translateY(24px) scale(0.94); } }
@keyframes wl-drop { to { opacity: 0; transform: translateY(16px) scale(0.96); } }
.wl-icons { display: flex; justify-content: center; margin: 4px 0 22px; }
.wl-tile {
  --icon: 62px; position: relative; display: grid; place-items: center; width: 62px; height: 62px; margin: 0 -7px; border-radius: 22.5%; overflow: hidden;
  color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--cell, #fff);
}
.wl-tile:nth-child(odd) { transform: translateY(-6px) rotate(-6deg); }
.wl-tile:nth-child(even) { transform: translateY(4px) rotate(5deg); }
.wl-tile .glyph { font: 600 26px/1 var(--font); }
.wl-title { margin: 0 0 10px; font: 700 28px/1.15 var(--font); letter-spacing: 0.005em; }
.wl-text { margin: 0 0 24px; font: 17px/1.4 var(--font); color: var(--label2, rgba(60, 60, 67, 0.6)); }
.wl-add {
  width: 100%; height: 52px; border: 0; border-radius: 26px; background: var(--tint, #007aff); color: #fff;
  font: 600 17px var(--font); cursor: pointer; transition: filter 0.2s ease, scale 0.2s ease;
}
.wl-add:hover { filter: brightness(1.08); }
.wl-add:active { scale: 0.97; }
.wl-later { margin-top: 8px; padding: 12px 20px; border: 0; background: none; color: var(--tint, #007aff); font: 17px var(--font); cursor: pointer; }
.wl-fine { margin: 10px 0 0; font: 13px/1.35 var(--font); color: var(--label2, rgba(60, 60, 67, 0.6)); }

/*
 * "Meet Clock" (js/clockintro.js), the welcome card made wider: pictures of the Clock that cross-fade
 * (each easing out of a slight zoom), a title and a line under them, dots, Open Clock and Not Now.
 * The pictures are 16:10; in a short window the card narrows so it still fits whole (the rest of it
 * is about 350px tall: 389px leaves the margins), and below about 530px it scrolls. Its one column
 * is the window less the margins, so a narrow window narrows it too.
 */
.ci { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.ci-card {
  width: min(clamp(300px, calc((100dvh - 389px) * 1.6 + 64px), 620px), 100%); max-height: calc(100dvh - 32px);
  overflow-y: auto; scrollbar-width: none; padding: 26px 32px 18px;
}
.ci-card:focus { outline: none; }
.ci-kicker { margin: 0 0 4px; font: 600 13px/1.2 var(--font); letter-spacing: 0.02em; text-transform: uppercase; color: var(--tint, #007aff); }
.ci-card .wl-title { margin-bottom: 16px; }
.ci-stage {
  position: relative; flex: none; width: 100%; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.12); touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.ci-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 0.6s ease; }
.ci-slide.on { opacity: 1; }
.ci-slide img { display: block; width: 100%; height: 100%; object-fit: cover; scale: 1.05; transition: scale 4.8s cubic-bezier(0.2, 0.6, 0.3, 1); pointer-events: none; }
.ci-slide.on img { scale: 1; }
.ci-nav {
  position: absolute; top: 50%; display: grid; place-items: center; width: 34px; height: 34px; margin-top: -17px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(30, 30, 32, 0.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity 0.2s ease, background 0.2s ease;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.ci-nav.prev { left: 10px; }
.ci-nav.next { right: 10px; }
.ci-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ci-stage:hover .ci-nav, .ci-nav:focus-visible { opacity: 1; }
.ci-nav:hover { background: rgba(30, 30, 32, 0.75); }
@media (hover: none) { .ci-nav { display: none; } }
.ci-cap { min-height: 74px; margin: 16px 0 6px; }
.ci-t { margin: 0 0 4px; font: 600 19px/1.25 var(--font); }
.ci-d { margin: 0; font: 15px/1.4 var(--font); color: var(--label2, rgba(60, 60, 67, 0.6)); text-wrap: balance; }
.ci-dots { display: flex; justify-content: center; gap: 2px; margin: 0 0 16px; }
.ci-dot { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.ci-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.25; transition: opacity 0.2s ease, width 0.25s ease; }
.ci-dot.on::before { width: 18px; border-radius: 4px; opacity: 0.85; }
@media (prefers-reduced-motion: reduce) {
  .ci-slide, .ci-slide img { transition: none; }
  .ci-slide img { scale: 1; }
}

/*
 * Web Search (js/widgets.js), like the Google widget on iPad: the engine's badge and a round field
 * on top, four engines in pills under it. Large adds the recent searches, or eight engines with
 * their names while there are none. Sized from the card's width, so Medium and Large match.
 */
.wgt-card:has(.w-search) .widget-body { padding: 5.2cqw; }
.w-search { --se-fill: rgba(118, 118, 128, 0.24); --se-fill-hi: rgba(118, 118, 128, 0.34); gap: 4.2cqw; }
body.mode-light .w-search { --se-fill: rgba(118, 118, 128, 0.12); --se-fill-hi: rgba(118, 118, 128, 0.2); }
.se-top { display: flex; align-items: center; gap: 3.2cqw; flex: none; }
.se-logo { flex: none; width: 14.5cqw; height: 14.5cqw; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; transition: scale 0.3s var(--spring-pop); }
.se-logo:hover { scale: 1.06; }
.se-logo:active, .se-logo[aria-expanded="true"] { scale: 0.92; }
.se-badge { position: relative; display: block; flex: none; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.14); }
.se-art { display: block; width: 100%; height: 100%; border-radius: 50%; }
.se-badge.se-pop { animation: se-pop 0.55s var(--spring-pop); }
@keyframes se-pop { from { scale: 0.45; opacity: 0; } 25% { opacity: 1; } }
.se-field {
  flex: 1; min-width: 0; height: 14.5cqw; display: flex; align-items: center; gap: 2.2cqw; padding: 0 4.2cqw 0 3.8cqw;
  border-radius: 99px; background: var(--se-fill); cursor: text;
  transition: background 0.2s ease, box-shadow 0.2s ease, scale 0.35s var(--spring-pop);
}
.se-field:hover { background: var(--se-fill-hi); }
.se-field:focus-within { scale: 1.02; background: var(--se-fill-hi); box-shadow: 0 0 0 2px var(--tint); }
.se-glass { flex: none; width: 5.8cqw; height: 5.8cqw; fill: none; stroke: var(--w-muted); stroke-width: 2.6; stroke-linecap: round; }
.se-input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--w-text); font: 500 max(12px, 5.4cqw) / 1 var(--font); letter-spacing: -0.01em;
}
.se-input::placeholder { color: var(--w-muted); opacity: 1; }
.se-input { text-overflow: ellipsis; }
.se-head { flex: none; margin: 0 0 -2.6cqw; font-size: max(10px, 3.6cqw); font-weight: 600; color: var(--w-muted); }
.se-input::-webkit-search-cancel-button {
  -webkit-appearance: none; flex: none; width: max(14px, 5cqw); height: max(14px, 5cqw); margin: 0; cursor: pointer; background: var(--w-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 100 20 10 10 0 000-20zM6.4 5L10 8.6 13.6 5 15 6.4 11.4 10l3.6 3.6-1.4 1.4-3.6-3.6L6.4 15 5 13.6 8.6 10 5 6.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.se-eng { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.8cqw; min-width: 0; padding: 0; border: 0; background: none; color: var(--w-text); font: inherit; cursor: pointer; }
.se-eng .se-badge { transition: scale 0.3s var(--spring-pop); }
.se-row { display: flex; gap: 3.2cqw; flex: none; margin-top: auto; }
.wgt.size-l .se-row { margin-top: 0; }
.se-row .se-eng { flex: 1; height: 14.5cqw; border-radius: 99px; background: var(--se-fill); transition: background 0.2s ease, scale 0.3s var(--spring-pop); }
.se-row .se-eng:hover { background: var(--se-fill-hi); }
.se-row .se-eng:active { scale: 0.93; }
.se-row .se-badge { width: 8.8cqw; height: 8.8cqw; }
.se-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: center; row-gap: 6cqw; }
.se-grid .se-badge { width: 15.5cqw; height: 15.5cqw; }
.se-grid .se-eng:hover .se-badge { scale: 1.07; }
.se-grid .se-eng:active .se-badge { scale: 0.9; }
.se-name { max-width: 100%; font-size: max(10px, 3.7cqw); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-list { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: -1cqw -2.4cqw -2.4cqw; overflow: hidden; }
.se-recent {
  position: relative; display: flex; align-items: center; gap: 3cqw; flex: none; width: 100%; min-height: 11.4cqw; padding: 0 2.4cqw;
  border: 0; border-radius: 3.4cqw; background: none; color: var(--w-text); font: 500 max(11px, 4.5cqw) / 1.2 var(--font); text-align: left; cursor: pointer;
}
.se-recent + .se-recent::before { content: ""; position: absolute; left: 10.4cqw; right: 2.4cqw; top: 0; height: 0.5px; background: var(--w-sep); }
.se-recent:hover { background: var(--se-fill); }
.se-recent:hover::before, .se-recent:hover + .se-recent::before { opacity: 0; }
.se-hist { flex: none; width: 5cqw; height: 5cqw; fill: none; stroke: var(--w-muted); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.se-q { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-del {
  flex: none; display: grid; place-items: center; width: 6.4cqw; height: 6.4cqw; border-radius: 50%;
  color: var(--w-muted); font-size: max(13px, 5.4cqw); line-height: 1; opacity: 0; transition: opacity 0.15s ease, background 0.15s ease;
}
.se-recent:hover .se-del, .se-recent:focus-visible .se-del { opacity: 1; }
.se-del:hover { background: var(--se-fill-hi); color: var(--w-text); }
/* The engine menus: the Haptic Touch menu's Search Engine list, and the one from the widget's badge. */
.menu button.menu-choice { justify-content: flex-start; gap: 10px; padding-left: 10px; }
.menu button.menu-choice > span { flex: 1; min-width: 0; }
.menu button .menu-check { width: 17px; height: 17px; flex: none; stroke-width: 2.4; }
.menu button img.menu-art { width: 24px; height: 24px; flex: none; border-radius: 50%; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.pm-item .se-badge.se-mini { width: 24px; height: 24px; }

/* Clear and Tinted: glass, with each engine's mark in white or the tint on a glass disc. */
body.icons-clear .wgt-card.widget:has(.w-search), body.icons-tinted .wgt-card.widget:has(.w-search) {
  background: rgba(255, 255, 255, calc(0.12 + var(--g) * 0.14)); color: #fff;
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), inset 0 -1px 1px rgba(255, 255, 255, 0.15), 0 6px 20px rgba(0, 0, 0, 0.08);
}
body.icons-tinted .wgt-card.widget:has(.w-search) { background: hsla(var(--hue), 45%, 14%, 0.62); }
body.icons-clear .w-search, body.icons-tinted .w-search {
  --se-ink: rgba(255, 255, 255, 0.96); --w-text: var(--se-ink); --w-muted: rgba(255, 255, 255, 0.6); --w-sep: rgba(255, 255, 255, 0.16);
  --se-fill: rgba(255, 255, 255, 0.14); --se-fill-hi: rgba(255, 255, 255, 0.22);
}
body.icons-tinted .w-search { --se-ink: hsl(var(--hue), 95%, 72%); --w-muted: hsla(var(--hue), 95%, 72%, 0.62); --se-fill: hsla(var(--hue), 80%, 70%, 0.14); --se-fill-hi: hsla(var(--hue), 80%, 70%, 0.22); }
body.icons-clear .w-search .se-badge, body.icons-tinted .w-search .se-badge { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), inset 0 -1px 1px rgba(255, 255, 255, 0.1); }
body.icons-clear .w-search .se-art, body.icons-tinted .w-search .se-art { opacity: 0; }
body.icons-clear .w-search .se-badge::after, body.icons-tinted .w-search .se-badge::after {
  content: ""; position: absolute; inset: 0; background: var(--se-ink);
  -webkit-mask: var(--mono) center / cover no-repeat; mask: var(--mono) center / cover no-repeat;
}
