/* JOV Office website — the desktop, its apps and the phone layout.
   Colours are tokens below (light first, then dark for "Auto" and for the Dark choice).
   Brand colours (--brand-*, --accent-*, --fam-*) are set from assets/brand.js.
   Logical properties throughout. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --accent: var(--accent-light);
  --accent-text: var(--accent-text-light);
  --accent-2: var(--accent2-light);
  --fam-docs: var(--fam-docs-light);
  --fam-sheets: var(--fam-sheets-light);
  --fam-slides: var(--fam-slides-light);
  --fam-pdf: var(--fam-pdf-light);
  --on-accent: #ffffff;
  --focus: var(--accent-text);

  --text: #1c1b26;
  --text-2: #4f4d60;
  --text-3: #66647a;
  --bg-boot: #f3f1fb;
  --boot-track: rgb(28 27 38 / 12%);
  --boot-fill: #1c1b26;

  --win-bg: #fbfbfd;
  --win-bg-2: #f3f2f8;
  --titlebar: rgb(244 243 249 / 92%);
  --surface: #ffffff;
  --surface-2: #f6f5fa;
  --line: rgb(20 18 40 / 10%);
  --line-strong: rgb(20 18 40 / 18%);
  --hover: rgb(30 25 70 / 6%);
  --pressed: rgb(30 25 70 / 11%);
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --win-shadow: 0 28px 70px -18px rgb(26 20 70 / 38%), 0 10px 24px -10px rgb(26 20 70 / 22%), 0 0 0 1px rgb(20 18 40 / 9%);
  --win-shadow-back: 0 16px 40px -18px rgb(26 20 70 / 28%), 0 0 0 1px rgb(20 18 40 / 8%);

  --menubar-bg: rgb(250 249 255 / 58%);
  --menubar-line: rgb(255 255 255 / 45%);
  --menubar-text: #15141c;
  --mb-hover: rgb(20 18 40 / 9%);
  --menu-bg: rgb(252 252 255 / 90%);
  --menu-line: rgb(20 18 40 / 12%);
  --dock-bg: rgb(255 255 255 / 40%);
  --dock-line: rgb(255 255 255 / 60%);
  --dock-sep: rgb(20 18 40 / 16%);
  --dock-dot: #2a2838;
  --tooltip-bg: rgb(250 250 253 / 94%);
  --tooltip-text: #1c1b26;
  --toast-bg: rgb(250 250 254 / 88%);
  --desk-label: #1b1a24;
  --desk-label-shadow: rgb(255 255 255 / 70%);
  --desk-select: rgb(20 18 40 / 13%);

  --tile-neutral-a: #ffffff;
  --tile-neutral-b: #e7e5ef;
  --tile-neutral-glyph: #3b3952;
  --wc-close: #f07d8c;
  --wc-min: #f2c66d;
  --wc-zoom: #66cdbd;
  --wc-idle: #d6d4e0;
  --wc-glyph: rgb(40 20 40 / 62%);

  --paper: #ffffff;
  --paper-text: #1c1b26;
  --paper-text-2: #4f4d60;
  --canvas: #e8e7ef;
  --danger: #b4233a;
  --danger-soft: #fdeef0;
  --success: #0b6e4a;
  --success-soft: #e7f6ef;
  --warning: #7c4a00;
  --warning-soft: #fff3df;
  --scroll: rgb(20 18 40 / 22%);

  --art-bg: #efeef6;
  --art-win: #ffffff;
  --art-line: rgb(20 18 40 / 18%);
  --art-muted: #d9d7e4;
  --art-text: #4f4d60;

  /* Wallpaper */
  --wp-base: linear-gradient(160deg, #ebe8ff 0%, #e4f4f6 52%, #fbf0e6 100%);
  --wp-glow1: #b7adff; --wp-glow2: #a3ece4; --wp-glow3: #ffd6a6;
  --wp-rib1: #7d70f7; --wp-rib2: #36c3c6; --wp-rib3: #f0a35a;
  --wp-line: rgb(255 255 255 / 70%);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-ar: system-ui, -apple-system, "Geeza Pro", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --menubar-h: 30px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: var(--accent-dark);
    --accent-text: var(--accent-text-dark);
    --accent-2: var(--accent2-dark);
    --fam-docs: var(--fam-docs-dark);
    --fam-sheets: var(--fam-sheets-dark);
    --fam-slides: var(--fam-slides-dark);
    --fam-pdf: var(--fam-pdf-dark);
    --text: #ecebf3;
    --text-2: #b9b7c9;
    --text-3: #a09eb3;
    --bg-boot: #0f0e1c;
    --boot-track: rgb(255 255 255 / 14%);
    --boot-fill: #ecebf3;
    --win-bg: #1e1d29;
    --win-bg-2: #252431;
    --titlebar: rgb(38 37 51 / 94%);
    --surface: #262534;
    --surface-2: #2b2a3a;
    --line: rgb(255 255 255 / 9%);
    --line-strong: rgb(255 255 255 / 17%);
    --hover: rgb(255 255 255 / 6%);
    --pressed: rgb(255 255 255 / 11%);
    --accent-soft: color-mix(in srgb, var(--accent-text) 18%, transparent);
    --accent-line: color-mix(in srgb, var(--accent-text) 50%, transparent);
    --win-shadow: 0 28px 70px -14px rgb(0 0 0 / 65%), 0 10px 24px -10px rgb(0 0 0 / 45%), 0 0 0 1px rgb(255 255 255 / 10%);
    --win-shadow-back: 0 16px 40px -16px rgb(0 0 0 / 55%), 0 0 0 1px rgb(255 255 255 / 8%);
    --menubar-bg: rgb(18 17 30 / 50%);
    --menubar-line: rgb(255 255 255 / 8%);
    --menubar-text: #f2f1f8;
    --mb-hover: rgb(255 255 255 / 14%);
    --menu-bg: rgb(40 39 54 / 92%);
    --menu-line: rgb(255 255 255 / 12%);
    --dock-bg: rgb(36 34 54 / 45%);
    --dock-line: rgb(255 255 255 / 13%);
    --dock-sep: rgb(255 255 255 / 18%);
    --dock-dot: #ecebf3;
    --tooltip-bg: rgb(44 43 58 / 96%);
    --tooltip-text: #f2f1f8;
    --toast-bg: rgb(40 39 54 / 88%);
    --desk-label: #ffffff;
    --desk-label-shadow: rgb(0 0 0 / 75%);
    --desk-select: rgb(255 255 255 / 16%);
    --tile-neutral-a: #4a4862;
    --tile-neutral-b: #34334a;
    --tile-neutral-glyph: #f2f1f8;
    --wc-idle: #4a4960;
    --canvas: #15141e;
    --danger: #ff8c9b;
    --danger-soft: #3a1d25;
    --success: #6fdcae;
    --success-soft: #16322a;
    --warning: #ffc978;
    --warning-soft: #3a2c14;
    --scroll: rgb(255 255 255 / 22%);
    --art-bg: #2a2938;
    --art-win: #363548;
    --art-line: rgb(255 255 255 / 18%);
    --art-muted: #4a4960;
    --art-text: #c9c7d8;
    --wp-base: linear-gradient(160deg, #110f29 0%, #0b1b27 55%, #1a1026 100%);
    --wp-glow1: #4334b8; --wp-glow2: #0f6a72; --wp-glow3: #6a2f6e;
    --wp-rib1: #6c5ef5; --wp-rib2: #1fb2bd; --wp-rib3: #c0607a;
    --wp-line: rgb(255 255 255 / 22%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: var(--accent-dark);
  --accent-text: var(--accent-text-dark);
  --accent-2: var(--accent2-dark);
  --fam-docs: var(--fam-docs-dark);
  --fam-sheets: var(--fam-sheets-dark);
  --fam-slides: var(--fam-slides-dark);
  --fam-pdf: var(--fam-pdf-dark);
  --text: #ecebf3;
  --text-2: #b9b7c9;
  --text-3: #a09eb3;
  --bg-boot: #0f0e1c;
  --boot-track: rgb(255 255 255 / 14%);
  --boot-fill: #ecebf3;
  --win-bg: #1e1d29;
  --win-bg-2: #252431;
  --titlebar: rgb(38 37 51 / 94%);
  --surface: #262534;
  --surface-2: #2b2a3a;
  --line: rgb(255 255 255 / 9%);
  --line-strong: rgb(255 255 255 / 17%);
  --hover: rgb(255 255 255 / 6%);
  --pressed: rgb(255 255 255 / 11%);
  --accent-soft: color-mix(in srgb, var(--accent-text) 18%, transparent);
  --accent-line: color-mix(in srgb, var(--accent-text) 50%, transparent);
  --win-shadow: 0 28px 70px -14px rgb(0 0 0 / 65%), 0 10px 24px -10px rgb(0 0 0 / 45%), 0 0 0 1px rgb(255 255 255 / 10%);
  --win-shadow-back: 0 16px 40px -16px rgb(0 0 0 / 55%), 0 0 0 1px rgb(255 255 255 / 8%);
  --menubar-bg: rgb(18 17 30 / 50%);
  --menubar-line: rgb(255 255 255 / 8%);
  --menubar-text: #f2f1f8;
  --mb-hover: rgb(255 255 255 / 14%);
  --menu-bg: rgb(40 39 54 / 92%);
  --menu-line: rgb(255 255 255 / 12%);
  --dock-bg: rgb(36 34 54 / 45%);
  --dock-line: rgb(255 255 255 / 13%);
  --dock-sep: rgb(255 255 255 / 18%);
  --dock-dot: #ecebf3;
  --tooltip-bg: rgb(44 43 58 / 96%);
  --tooltip-text: #f2f1f8;
  --toast-bg: rgb(40 39 54 / 88%);
  --desk-label: #ffffff;
  --desk-label-shadow: rgb(0 0 0 / 75%);
  --desk-select: rgb(255 255 255 / 16%);
  --tile-neutral-a: #4a4862;
  --tile-neutral-b: #34334a;
  --tile-neutral-glyph: #f2f1f8;
  --wc-idle: #4a4960;
  --canvas: #15141e;
  --danger: #ff8c9b;
  --danger-soft: #3a1d25;
  --success: #6fdcae;
  --success-soft: #16322a;
  --warning: #ffc978;
  --warning-soft: #3a2c14;
  --scroll: rgb(255 255 255 / 22%);
  --art-bg: #2a2938;
  --art-win: #363548;
  --art-line: rgb(255 255 255 / 18%);
  --art-muted: #4a4960;
  --art-text: #c9c7d8;
  --wp-base: linear-gradient(160deg, #110f29 0%, #0b1b27 55%, #1a1026 100%);
  --wp-glow1: #4334b8; --wp-glow2: #0f6a72; --wp-glow3: #6a2f6e;
  --wp-rib1: #6c5ef5; --wp-rib2: #1fb2bd; --wp-rib3: #c0607a;
  --wp-line: rgb(255 255 255 / 22%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg-boot);
  -webkit-font-smoothing: antialiased;
}
:lang(ar) { font-family: var(--font-ar); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: default; }
a { color: var(--accent-text); }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
html.is-desktop, html.is-desktop body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.is-dragging, body.is-dragging * { user-select: none !important; cursor: default; }
body.is-resizing, body.is-resizing * { user-select: none !important; cursor: nwse-resize !important; }
[dir="rtl"] body.is-resizing, [dir="rtl"] body.is-resizing * { cursor: nesw-resize !important; }

/* ---------- Boot screen and no-JavaScript fallback ---------- */
.boot { display: none; }
.js .boot {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 44px;
  background: var(--bg-boot);
  transition: opacity .45s ease;
}
.js.is-phone .boot, .is-broken .boot { display: none; }
.boot.is-done { opacity: 0; pointer-events: none; }
.boot-mark { width: 76px; height: 76px; animation: boot-in .5s ease both; }
.boot-mark svg { display: block; filter: drop-shadow(0 10px 22px rgb(150 16 70 / 30%)); }
.boot-bar { width: 188px; height: 5px; border-radius: 3px; background: var(--boot-track); overflow: hidden; }
.boot-fill {
  height: 100%; width: 100%; border-radius: inherit; background: var(--boot-fill);
  transform: scaleX(.06); transform-origin: left center; transition: transform .7s cubic-bezier(.3, .7, .2, 1);
}
[dir="rtl"] .boot-fill { transform-origin: right center; }
@keyframes boot-in { from { opacity: 0; transform: scale(.92); } }

.fallback { display: block; max-width: 720px; margin: 0 auto; padding: 32px 20px 48px; font-size: 16px; line-height: 1.6; }
.js .fallback { display: none; }
.is-broken .fallback { display: block; }
.fb-brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); }
.fallback h1 { font-size: 32px; margin: 24px 0 8px; }
.fallback h2 { font-size: 20px; margin: 24px 0 8px; }
.fb-download { font-weight: 700; font-size: 18px; }
.fb-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 24px; }

/* ---------- Desktop shell ---------- */
.os { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
.wallpaper { position: absolute; inset: 0; background: var(--wp-base); }
.wallpaper-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.wp-glow1-a { stop-color: var(--wp-glow1); stop-opacity: .75; } .wp-glow1-b { stop-color: var(--wp-glow1); stop-opacity: 0; }
.wp-glow2-a { stop-color: var(--wp-glow2); stop-opacity: .7; } .wp-glow2-b { stop-color: var(--wp-glow2); stop-opacity: 0; }
.wp-glow3-a { stop-color: var(--wp-glow3); stop-opacity: .7; } .wp-glow3-b { stop-color: var(--wp-glow3); stop-opacity: 0; }
.wp-rib1-a { stop-color: var(--wp-rib1); stop-opacity: 0; } .wp-rib1-b { stop-color: var(--wp-rib1); stop-opacity: .42; } .wp-rib1-c { stop-color: var(--wp-rib2); stop-opacity: .12; }
.wp-rib2-a { stop-color: var(--wp-rib2); stop-opacity: .08; } .wp-rib2-b { stop-color: var(--wp-rib2); stop-opacity: .34; } .wp-rib2-c { stop-color: var(--wp-rib1); stop-opacity: 0; }
.wp-rib3-a { stop-color: var(--wp-rib3); stop-opacity: 0; } .wp-rib3-b { stop-color: var(--wp-rib3); stop-opacity: .26; } .wp-rib3-c { stop-color: var(--wp-rib3); stop-opacity: .05; }
.wp-line { fill: none; stroke: var(--wp-line); stroke-width: 1.6; }
.wp-line-2 { stroke-width: 1.1; opacity: .7; }

/* Menu bar */
.menubar {
  position: absolute; inset: 0 0 auto 0; height: var(--menubar-h); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-inline: 8px;
  color: var(--menubar-text);
  background: var(--menubar-bg);
  border-block-end: 1px solid var(--menubar-line);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
}
.menubar-menus, .menubar-end { display: flex; align-items: center; gap: 1px; min-width: 0; }
.menubar-menus { overflow: hidden; }
.mb-item, .mb-control {
  height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: none;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px;
}
.mb-item:hover, .mb-item[aria-expanded="true"], .mb-control:hover, .mb-control[aria-expanded="true"] { background: var(--mb-hover); }
.mb-item:focus-visible, .mb-control:focus-visible { outline-offset: -2px; }
.mb-jov { padding: 0 8px; }
.mb-jov svg { display: block; }
.mb-app { font-weight: 700; }
.mb-clock { padding-inline: 8px 4px; font-variant-numeric: tabular-nums; white-space: pre; font-size: 13px; }

/* Desktop and icons */
.desktop { position: absolute; inset: var(--menubar-h) 0 0 0; z-index: 1; }
.desk-icons {
  position: absolute; inset: 12px 10px 104px 10px;
  display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 2px 4px;
  pointer-events: none;
}
.desk-icon {
  pointer-events: auto; width: 108px; padding: 6px 4px 5px; border-radius: 9px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: default;
}
.desk-icon:focus { outline: none; }
.desk-icon:focus-visible .desk-icon-art { outline: 2px solid var(--focus); outline-offset: 1px; }
.desk-icon-art { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 10px; }
.desk-icon[aria-selected="true"] .desk-icon-art { background: var(--desk-select); }
.desk-icon-label {
  max-width: 104px; padding: 1px 5px; border-radius: 5px; text-align: center;
  font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--desk-label);
  text-shadow: 0 1px 3px var(--desk-label-shadow); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.desk-icon[aria-selected="true"] .desk-icon-label { background: var(--accent); color: var(--on-accent); text-shadow: none; }
.file-art { display: block; filter: drop-shadow(0 3px 5px rgb(20 16 60 / 22%)); }
.fa-page { fill: #ffffff; stroke: rgb(20 18 40 / 14%); stroke-width: 1; }
.fa-fold { fill: #ecebf3; stroke: rgb(20 18 40 / 14%); stroke-width: 1; stroke-linejoin: round; }
.fa-line { stroke: #cfcdd9; stroke-width: 2; stroke-linecap: round; fill: none; }
.fa-band { fill: var(--text-2); }
.file-docs .fa-band { fill: var(--fam-docs); }
.file-sheets .fa-band { fill: var(--fam-sheets); }
.file-slides .fa-band { fill: var(--fam-slides); }
.file-pdf .fa-band { fill: var(--fam-pdf); }
.fa-ext { fill: #ffffff; font: 700 9.5px/1 var(--font); letter-spacing: .5px; }
.installer-art { position: relative; width: 60px; height: 60px; display: block; filter: drop-shadow(0 4px 6px rgb(20 16 60 / 25%)); }
.installer-disk { display: block; }
.ia-body { fill: #f4f3f9; stroke: rgb(20 18 40 / 15%); }
.ia-slot { fill: rgb(20 18 40 / 18%); }
.installer-mark { position: absolute; top: 17px; left: 17px; }
.installer-arrow {
  position: absolute; bottom: 4px; inset-inline-end: 2px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--surface);
}

/* Windows */
.win-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.menu-layer { position: absolute; inset: 0; z-index: 3000; pointer-events: none; }
.win {
  position: absolute; pointer-events: auto;
  display: flex; flex-direction: column;
  min-width: 320px; min-height: 220px;
  background: var(--win-bg); color: var(--text);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--win-shadow-back);
  transition: opacity .18s ease, transform .18s ease, box-shadow .2s ease;
  user-select: text; -webkit-user-select: text;
}
.win:focus { outline: none; }
.win.is-front { box-shadow: var(--win-shadow); }
.win.is-opening { opacity: 0; transform: translateY(8px) scale(.965); }
.win.is-closing { opacity: 0; transform: scale(.965); pointer-events: none; }
.win.is-minimising {
  transform: translate(var(--min-x), var(--min-y)) scale(.06); opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.55, 0, .75, .1), opacity .3s ease-in;
}
.win.is-animating { transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease, box-shadow .2s ease; }
.win-titlebar {
  flex: none; height: 40px; display: flex; align-items: center; gap: 10px; padding-inline: 13px;
  background: var(--titlebar); border-block-end: 1px solid var(--line);
  user-select: none; -webkit-user-select: none; touch-action: none; cursor: default;
}
.win-controls, .win-titlebar-end { flex: none; width: 62px; display: flex; align-items: center; gap: 8px; }
.win-title {
  flex: 1; min-width: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win.is-front .win-title { color: var(--text); }
.os.is-desktop-active .win .win-title { color: var(--text-2); }
.wc {
  width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--wc-idle); color: transparent;
  transition: background-color .12s ease, transform .12s ease;
}
.wc svg { display: block; }
.win.is-front .wc-close { background: var(--wc-close); }
.win.is-front .wc-min { background: var(--wc-min); }
.win.is-front .wc-zoom { background: var(--wc-zoom); }
.os.is-desktop-active .wc { background: var(--wc-idle); }
.win-controls:hover .wc, .wc:focus-visible { color: var(--wc-glyph); }
.win-controls:hover .wc-close { background: var(--wc-close); }
.win-controls:hover .wc-min { background: var(--wc-min); }
.win-controls:hover .wc-zoom { background: var(--wc-zoom); }
.wc:active { transform: scale(.9); }
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.win-resize {
  position: absolute; bottom: 0; inset-inline-end: 0; width: 18px; height: 18px; z-index: 20;
  cursor: nwse-resize; touch-action: none;
  background:
    linear-gradient(135deg, transparent 0 55%, var(--line-strong) 55% 61%, transparent 61% 72%, var(--line-strong) 72% 78%, transparent 78%);
}
[dir="rtl"] .win-resize { cursor: nesw-resize; transform: scaleX(-1); }
.win-loading, .win-error {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--text-2); padding: 24px; text-align: center;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line-strong); border-top-color: var(--accent-text);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Dock */
.dock { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 1500; }
.dock-list {
  list-style: none; margin: 0; padding: 6px 8px; display: flex; align-items: flex-end; gap: 7px;
  border-radius: 22px; background: var(--dock-bg); border: 1px solid var(--dock-line);
  -webkit-backdrop-filter: blur(22px) saturate(1.7); backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: 0 10px 30px -10px rgb(20 16 60 / 35%);
}
.dock-cell { position: relative; --tile: 50px; width: var(--tile); height: var(--tile); transition: width .1s ease-out, height .1s ease-out; }
.dock-item {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; border-radius: 12px;
  transform-origin: 50% 100%;
}
.dock-item:focus-visible { outline-offset: 3px; border-radius: 14px; }
.dock-cell.is-bouncing .dock-item { animation: dock-bounce .8s ease; }
@keyframes dock-bounce { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-16px); } 50% { transform: translateY(0); } 70% { transform: translateY(-6px); } }
.dock-label {
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 7px; background: var(--tooltip-bg); color: var(--tooltip-text);
  font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0;
  box-shadow: 0 4px 14px rgb(0 0 0 / 18%), 0 0 0 1px var(--menu-line);
  transition: opacity .12s ease;
}
.dock-item:hover .dock-label, .dock-item:focus-visible .dock-label { opacity: 1; }
.dock-dot {
  position: absolute; bottom: -5px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--dock-dot); opacity: 0; transition: opacity .2s ease;
}
.dock-cell.is-running .dock-dot { opacity: .85; }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 3px; background: var(--dock-sep); }

/* App tiles (Dock, Home, phone) */
.tile {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 23%;
  color: #ffffff; background: linear-gradient(165deg, color-mix(in srgb, var(--fam, #666) 72%, #ffffff), var(--fam, #666) 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 28%), 0 2px 6px rgb(20 16 60 / 22%);
}
.tile-glyph { width: 56%; height: 56%; }
.tile-docs { --fam: var(--fam-docs); }
.tile-sheets { --fam: var(--fam-sheets); }
.tile-slides { --fam: var(--fam-slides); }
.tile-pdf { --fam: var(--fam-pdf); }
.tile-download, .tile-pricing, .tile-account, .tile-help, .tile-readme {
  background: linear-gradient(170deg, var(--tile-neutral-a), var(--tile-neutral-b));
  color: var(--tile-neutral-glyph);
}
.tile-download { color: var(--accent-text); }
.tile-mark { background: none; box-shadow: none; }
.tile-mark-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 4px rgb(20 16 60 / 25%)); }

/* Menus */
.menu {
  position: fixed; pointer-events: auto; min-width: 230px; max-width: 340px; padding: 5px;
  border-radius: 10px; background: var(--menu-bg); color: var(--text);
  box-shadow: 0 14px 40px -6px rgb(0 0 0 / 28%), 0 0 0 1px var(--menu-line);
  -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
  font-size: 13px; user-select: none; -webkit-user-select: none;
  animation: menu-in .1s ease-out;
}
.menu:focus { outline: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-3px); } }
.menu-item {
  display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 4px;
  width: 100%; min-height: 25px; padding: 3px 10px 3px 4px; padding-inline: 4px 10px;
  border: 0; border-radius: 6px; background: none; text-align: start; white-space: nowrap;
}
.menu-item:focus { outline: none; background: var(--accent); color: var(--on-accent); }
.menu-item[aria-disabled="true"] { opacity: .45; }
.menu-item[aria-disabled="true"]:focus { background: none; color: inherit; }
.menu-check { display: grid; place-items: center; width: 18px; }
.menu-label { overflow: hidden; text-overflow: ellipsis; }
.menu-shortcut { margin-inline-start: 22px; color: var(--text-3); font-size: 12.5px; }
.menu-item:focus .menu-shortcut { color: inherit; opacity: .85; }
.menu-sub-arrow { display: grid; place-items: center; margin-inline-start: 14px; opacity: .7; }
.menu-sep { height: 1px; margin: 5px 9px; background: var(--line-strong); }
.menu-heading { padding: 4px 10px 2px 26px; padding-inline: 26px 10px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }

/* Notifications: top corner, just inside the column of desktop icons (so they don't hide the first ones) */
.toasts {
  position: absolute; top: calc(var(--menubar-h) + 10px); inset-inline-end: 128px; z-index: 2000;
  width: min(360px, calc(100vw - 140px)); display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  position: relative; pointer-events: auto;
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 14px 13px;
  border-radius: 18px; background: var(--toast-bg); color: var(--text);
  box-shadow: 0 14px 40px -10px rgb(0 0 0 / 30%), 0 0 0 1px var(--menu-line);
  -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.1);
  user-select: none; -webkit-user-select: none;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }
[dir="rtl"] .toast { animation-name: toast-in-rtl; }
@keyframes toast-in-rtl { from { opacity: 0; transform: translateX(-30px); } }
.toast.is-leaving { opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .2s ease; }
.toast-icon svg { display: block; }
.toast-main { min-width: 0; }
.toast-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-3); margin-bottom: 1px; }
.toast-title { font-weight: 700; font-size: 13px; }
.toast-body { color: var(--text-2); font-size: 13px; margin-top: 1px; }
.toast-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.toast-close {
  position: absolute; top: -7px; inset-inline-start: -7px; width: 22px; height: 22px; padding: 0; border: 0;
  border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text-2);
  box-shadow: 0 1px 4px rgb(0 0 0 / 20%), 0 0 0 1px var(--menu-line); opacity: 0; transition: opacity .12s ease;
}
.toast:hover .toast-close, .toast:focus-within .toast-close { opacity: 1; }

/* ---------- Controls ---------- */
.btn {
  height: 30px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: default;
  box-shadow: 0 1px 1px rgb(20 18 40 / 4%);
  transition: background-color .12s ease, filter .12s ease;
}
a.btn { cursor: pointer; }
.btn:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.btn:active { filter: brightness(.95); }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 90%, #000); }
.btn-large { height: 44px; padding: 0 24px; border-radius: 11px; font-size: 15px; }
.btn-small { height: 26px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-quiet { background: var(--hover); border-color: transparent; box-shadow: none; }
.btn-quiet:hover { background: var(--pressed); }
.btn-icon { width: 30px; padding: 0; }
.btn-small.btn-icon { width: 26px; }
.btn svg { flex: none; }
.link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.notice svg { flex: none; margin-top: 1px; }
.notice-warning { background: var(--warning-soft); color: var(--warning); }
.notice-success { background: var(--success-soft); color: var(--success); }
.chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px;
  background: var(--hover); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap;
}

/* ---------- Apps ---------- */
.app-scroll { flex: 1; min-height: 0; overflow: auto; }
.app-center { text-align: center; }

/* Home */
.home { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 18px 24px 16px; }
.wordmark { display: flex; align-items: center; gap: 10px; margin-inline-end: auto; }
.wordmark svg { display: block; }
.wordmark-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.trial-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600;
}
.search {
  display: flex; align-items: center; gap: 6px; height: 30px; width: 220px; padding-inline: 9px 4px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-3);
}
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 13px; }
.search-clear { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--text-2); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; padding: 0 24px 18px; }
.qa {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; min-height: 60px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: start;
  box-shadow: 0 1px 2px rgb(20 18 40 / 5%); transition: box-shadow .15s ease, transform .15s ease;
}
.qa:hover { box-shadow: 0 6px 16px -6px rgb(20 18 40 / 22%); }
.qa-prominent { border: 1.5px solid var(--accent-line); }
.qa-icon { flex: none; width: 34px; height: 34px; }
.qa-icon .tile { border-radius: 9px; }
.qa-icon .tile-glyph { width: 60%; height: 60%; }
.tile-open { --fam: var(--accent); }
.qa-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qa-title { font-weight: 600; font-size: 13px; color: var(--text); }
.qa-sub { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 24px 10px; }
.filter-chip {
  height: 26px; padding: 0 12px; border-radius: 13px; border: 1px solid transparent;
  background: var(--hover); color: var(--text); font-size: 12.5px;
}
.filter-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); font-weight: 600; }
.recent {
  flex: 1; min-height: 0; overflow: auto; margin: 0 18px 12px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface);
}
.recent:focus-visible { outline-offset: -2px; }
.rc-head, .rc-row { display: grid; grid-template-columns: minmax(170px, 2.3fr) minmax(110px, 1.5fr) minmax(56px, .6fr) minmax(90px, 1fr); gap: 12px; align-items: center; padding: 0 14px; }
.rc-head { position: sticky; top: 0; z-index: 1; height: 30px; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface); border-block-end: 1px solid var(--line); }
.rc-list { list-style: none; margin: 0; padding: 4px; }
.rc-row { height: 40px; border-radius: 7px; font-size: 13px; color: var(--text-2); cursor: default; }
.rc-row:hover { background: var(--hover); }
.rc-row[aria-selected="true"] { background: var(--accent); color: rgb(255 255 255 / 88%); }
.rc-row[aria-selected="true"] .rc-name { color: #fff; }
.rc-name { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; min-width: 0; }
.rc-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-icon { flex: none; width: 24px; height: 24px; }
.rc-icon .tile { border-radius: 6px; }
.rc-icon .tile-glyph { width: 64%; height: 64%; }
.rc-num { font-variant-numeric: tabular-nums; }
.rc-empty { padding: 30px 20px; text-align: center; color: var(--text-2); }
.rc-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.home-note { padding: 0 24px 14px; font-size: 11.5px; color: var(--text-3); }

/* Download */
.dl-hero { padding: 26px 28px 8px; text-align: center; }
.dl-icon { display: inline-block; filter: drop-shadow(0 14px 24px rgb(150 16 70 / 28%)); }
.dl-icon svg { display: block; }
.dl-name { font-size: 26px; font-weight: 750; letter-spacing: -.015em; margin-top: 12px; }
.dl-tagline { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }
.dl-hero .chip-row { margin-top: 14px; }
.dl-cta { margin-top: 20px; }
.dl-trial { margin-top: 10px; color: var(--text-2); font-size: 13px; }
.dl-sha {
  display: flex; align-items: center; gap: 8px; max-width: 480px; margin: 16px auto 0; padding: 5px 5px 5px 12px;
  padding-inline: 12px 5px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); text-align: start;
}
.dl-sha-label { flex: none; font-size: 11px; font-weight: 700; color: var(--text-2); }
.dl-sha code { flex: 1; min-width: 0; font: 10.5px/1.35 var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.dl-notmac { max-width: 480px; margin: 14px auto 0; text-align: start; }
.dl-guide { padding: 18px 28px 26px; }
.dl-guide-h { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700;
}
.step-title { font-size: 14px; font-weight: 650; }
.step-body { display: grid; grid-template-columns: 1fr minmax(150px, 210px); gap: 16px; align-items: center; margin-top: 8px; }
.step-body p, .step-body li { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.step-art { width: 100%; height: auto; display: block; }
.step-body-shot { grid-template-columns: minmax(0, 1fr); gap: 10px; }
/* The install pictures (core/shots.js): drawn illustrations, 880 × 560, never wider than their box. */
.shot { display: block; min-width: 0; max-width: 100%; }
.shot-img {
  display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 880 / 560; border-radius: 10px;
  border: 1px solid var(--line); background: #f3f4f8; object-fit: cover;
}
/* Help and the phone layouts: one picture per line, as wide as the text (up to 880 px), so it can be read;
   each one opens larger in the viewer (core/viewer.js, css/viewer.css). */
.shots { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.shots li { min-width: 0; max-width: 880px; display: grid; gap: 8px; align-content: start; }
.shot-cap { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.shot-cap .step-num { width: 20px; height: 20px; font-size: 11px; }
.mini-steps { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.step-note { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--hover); gap: 2px; margin-top: 10px; }
.seg button { height: 26px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font-size: 12.5px; color: var(--text-2); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgb(20 18 40 / 16%); }
.dl-done { margin-top: 12px; }
.dl-full { margin-top: 14px; text-align: center; font-size: 13px; }
.art-bg { fill: var(--art-bg); }
.art-win { fill: var(--art-win); stroke: var(--art-line); }
.art-line { stroke: var(--art-line); fill: none; }
.art-muted { fill: var(--art-muted); }
.art-accent { fill: var(--accent); }
.art-accent-stroke { stroke: var(--accent); fill: none; }
.art-text { fill: var(--art-text); font: 600 9px var(--font); }
.art-text-strong { fill: var(--text); font: 700 9px var(--font); }
.art-on-accent { fill: #fff; font: 700 9px var(--font); }
.art-folder { fill: #7fb6e8; }
.art-warn { fill: #f2b53d; }

/* Help */
.help { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px 1fr; }
.help-nav { border-inline-end: 1px solid var(--line); background: var(--win-bg-2); padding: 14px 10px; overflow: auto; }
.help-nav h2 { font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 0 8px 8px; }
.help-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.help-nav button { width: 100%; text-align: start; padding: 6px 8px; border: 0; border-radius: 7px; background: none; font-size: 13px; }
.help-nav button:hover { background: var(--hover); }
.help-nav button[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.help-content { overflow: auto; padding: 22px 28px 30px; scroll-behavior: smooth; }
/* The text can take focus (so the keyboard can scroll it): its ring is drawn inside the window. */
.help-content:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; border-radius: 4px; }
.help-section h2:focus { outline: none; }
.help-section h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.help-section { padding-block: 4px 18px; border-block-end: 1px solid var(--line); margin-block-end: 18px; }
.help-section:last-child { border: 0; }
.help-section h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.help-section h2 svg { color: var(--accent-text); }
.help-section p { font-size: 13.5px; line-height: 1.6; color: var(--text-2); margin-bottom: 8px; }
.help-section .btn { margin-top: 4px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.faq summary { padding: 10px 14px; font-weight: 600; font-size: 13.5px; cursor: default; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 16px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 14px 12px; margin: 0; }
.help-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }

/* Pricing, Account, About, Read Me */
.panel-pad { padding: 26px 28px 28px; }
.panel-h { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.panel-lead { color: var(--text-2); font-size: 14px; margin-top: 6px; line-height: 1.5; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.plan { position: relative; padding: 18px 16px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: start; }
.plan-best { border: 1.5px solid var(--accent-line); }
.plan-badge { position: absolute; top: -10px; inset-inline-end: 12px; padding: 2px 9px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.plan-name { font-size: 13px; font-weight: 650; color: var(--text-2); }
.plan-price { font-size: 22px; font-weight: 750; margin-top: 6px; letter-spacing: -.01em; }
.ticks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 7px; text-align: start; }
.ticks li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.ticks svg { flex: none; color: var(--success); margin-top: 1px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.app-center .panel-actions { justify-content: center; }
.panel-note { margin-top: 14px; font-size: 12px; color: var(--text-3); }
.avatar { width: 64px; height: 64px; margin: 0 auto 14px; }
.about { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 22px; text-align: center; }
.about-name { font-size: 20px; font-weight: 750; margin-top: 10px; }
.about-version { color: var(--text-2); font-size: 13px; }
.about-tag { margin-top: 8px; font-size: 13px; }
.about-web { font-size: 12px; color: var(--text-3); }
.about .panel-actions { margin-top: 14px; }
.about-links { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; }
.readme { flex: 1; overflow: auto; background: var(--paper); color: var(--paper-text); padding: 26px 30px 28px; }
.readme p { font-size: 14.5px; line-height: 1.65; margin-bottom: 12px; }
.readme h2 { font-size: 18px; margin-bottom: 12px; }

/* Demo banner (every demo window) */
.demo-banner {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; padding-inline: 12px 8px;
  background: var(--accent-soft); border-block-end: 1px solid var(--line); font-size: 12.5px; color: var(--text);
}
.demo-banner svg { flex: none; color: var(--accent-text); }
.demo-banner-text { flex: 1; min-width: 0; }

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

/* ---------- Phone layout ---------- */
html.is-phone body { font-size: 16px; line-height: 1.5; background: var(--win-bg); }
.ph { min-height: 100vh; color: var(--text); background: var(--win-bg); }
.ph-top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--win-bg) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border-block-end: 1px solid var(--line);
}
.ph-brand { display: flex; align-items: center; gap: 9px; min-height: 44px; min-width: 0; margin-inline-end: auto; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.ph-ctl { height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; }
.ph-hero { position: relative; overflow: hidden; padding: 40px 16px 34px; text-align: center; }
.ph-hero-bg { position: absolute; inset: 0; background: var(--wp-base); z-index: 0; }
.ph-hero-bg .wallpaper-art { opacity: .9; }
.ph-hero > *:not(.ph-hero-bg) { position: relative; z-index: 1; }
.ph-hero-mark { display: inline-block; filter: drop-shadow(0 12px 24px rgb(150 16 70 / 30%)); }
.ph-hero-mark svg { display: block; }
.ph-h1, .ph-h2 { text-wrap: balance; }
.ph-lead, .ph-card p, .ph-value p { text-wrap: pretty; }
.ph-h1 { font-size: clamp(27px, 8vw, 34px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 18px auto 0; max-width: 16em; }
.ph-lead { margin: 12px auto 0; max-width: 32em; color: var(--text-2); font-size: 16px; }
.ph-version { display: inline-block; margin-top: 16px; padding: 4px 12px; border-radius: 20px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text-2); font-size: 13px; font-weight: 600; }
.ph-section { padding: 28px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); border-block-start: 1px solid var(--line); scroll-margin-top: 64px; }
.ph-h2 { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.ph-sub { color: var(--text-2); margin-top: 4px; }
.ph-card { margin-top: 14px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.ph-card p { color: var(--text-2); }
.ph-card .ph-strong { color: var(--text); font-weight: 650; font-size: 17px; }
.ph-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ph-actions .btn { height: 48px; border-radius: 12px; font-size: 16px; width: 100%; }
.ph-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 8px; font-size: 15px; }
.ph-links a, .ph-footer nav a, .ph-footer nav button { display: inline-flex; align-items: center; min-height: 44px; }
.ph-sha { margin-top: 12px; font: 12px/1.45 var(--font-mono); color: var(--text-3); overflow-wrap: anywhere; }
.ph-status { margin-top: 10px; color: var(--success); font-size: 14px; }
.ph-status:empty { display: none; }
.ph-demos { display: grid; gap: 12px; margin-top: 16px; }
.ph-demo {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); text-align: start; cursor: pointer;
}
.ph-demo-icon { flex: none; width: 52px; height: 52px; }
.ph-demo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ph-demo-name { font-weight: 700; font-size: 17px; color: var(--text); }
.ph-demo-desc { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.ph-demo-go { flex: none; color: var(--accent-text); }
.ph-values { display: grid; gap: 12px; margin-top: 16px; }
.ph-value { display: flex; gap: 12px; align-items: flex-start; }
.ph-value svg { flex: none; color: var(--accent-text); margin-top: 3px; }
.ph-value h3 { font-size: 16px; font-weight: 700; }
.ph-value p { color: var(--text-2); font-size: 15px; }
.ph-footer { padding: 16px max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-block-start: 1px solid var(--line); background: var(--win-bg-2); }
.ph-footer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; font-size: 15px; }
.ph-footer p { margin-top: 14px; color: var(--text-3); font-size: 13px; }
.sheet {
  position: fixed; inset: 0; z-index: 4000; display: flex; flex-direction: column; background: var(--win-bg);
  animation: sheet-in .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.sheet-bar {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  border-block-end: 1px solid var(--line); background: var(--titlebar);
}
.sheet-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: env(safe-area-inset-bottom); }
html.has-sheet, html.has-sheet body { overflow: hidden; }
/* Help in a phone sheet: one column (its topics are the headings), with phone margins. */
.sheet .help { grid-template-columns: minmax(0, 1fr); }
.sheet .help-nav { display: none; }
.sheet .help-content { padding: 18px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); }
.sheet .readme { padding: 18px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); }
.ph .menu, .menu.is-touch { min-width: 200px; }
.is-phone .menu-item { min-height: 40px; font-size: 15px; }
.ph .toasts { position: fixed; top: calc(env(safe-area-inset-top) + 64px); inset-inline: 12px; width: auto; }
.ph-strong svg { vertical-align: -3px; }
