/*
 * hyd-classic-desktop.css
 *
 * Classic Mac desktop skin for the Hyderabad site: Lucida Grande window chrome, Geneva icon
 * labels and Panther-era grey metal, painted over the structural sheets that load before it
 * (hyd-desktop.css, hyd-personal-web.css, hyd-aqua.css, hyd-theme.css and others). It is
 * presentation only; the markup comes from hyd-world.html and the page scripts.
 *
 * How to read it
 * - Most selectors start with `html[data-theme] #world`. hyd-theme.js sets data-theme on
 *   <html>, and the ids (#home, #places, #roll, #area, #cinema) lift these rules above the
 *   earlier sheets without needing !important.
 * - Order matters. Several selectors appear twice: first with the plum palette, then again in
 *   the Panther overrides section (9) with grey metal. The later declaration wins, so rules
 *   must not be merged, sorted or moved.
 * - Each !important group has a comment saying why it is there, usually which earlier sheet
 *   it has to out-rank.
 * - Palette variables (--paper-*, --wallpaper-title-*, --desktop-caption-*) come from
 *   hyd-theme.css and hyd-photo-wallpaper.css; --finder-* come from hyd-mac-windows.css.
 * - hyd-object-controls.css loads after this file on purpose (see its own header).
 *
 * Sections
 *   1  Tokens and base type
 *   2  Shell bar
 *   3  Home title block
 *   4  Home desktop windows
 *   5  Places and photo roll
 *   6  Dialogs
 *   7  Dock and desktop icons
 *   8  Home layout by screen width
 *   9  Panther overrides
 *  10  Memory tools, cards and grids
 *  11  Area page
 *  12  Riyal cat shortcut
 *  13  Player
 *  14  Photo slideshow mode
 *  15  Player on narrow screens
 *  16  Reduced motion and the small shell bar
 *  17  Photos / recordings mode switch
 *  18  Minimum hit areas
 */

/* Lucida Grande window chrome and Geneva icon labels from the early Mac desktop.
   Aqua is reserved for functional controls; content stays on the plum desktop. */

/* ==========================================================================
   1. Tokens and base type
   Font stacks, edge colours and the base font for the four desktop pages.
   ========================================================================== */

/* Type stacks and edge colours used across this sheet. hyd-platform.css loads later and
   re-declares the three font variables with the self-hosted Hyd Ubuntu stack, so on the
   shipped page the Lucida and Geneva stacks here are the fallback. --desktop-rim is also
   read by hyd-lakes.css. --desktop-highlight and --desktop-shadow are declared but nothing
   in the shipped site reads them. */
:root {
  --desktop-font: "Lucida Grande","Lucida Sans Unicode",Tahoma,Arial,sans-serif;
  --desktop-label-font: Geneva,Tahoma,Verdana,sans-serif;
  --desktop-lettering: "Lucida Grande",Geneva,Tahoma,sans-serif;
  --desktop-rim: color-mix(in srgb,var(--paper-edge) 60%,var(--paper-panel));
  --desktop-highlight: color-mix(in srgb,var(--paper-edge) 72%,var(--paper-text));
  --desktop-shadow: #100d16;
}

/* hyd-theme.css animates the fixed wallpaper layer (scene-drift) and promotes it with
   will-change; the classic desktop keeps it still. */
body::before {
  animation: none;
  will-change: auto;
}

/* Base font for the four desktop pages: Home, Places, Photo roll and Area. */
html[data-theme] #world :is(#home, #places, #roll, #area) {
  font-family: var(--desktop-font);
}

/* !important: every control, the roll footer captions and the recordings captions keep the
   desktop family whatever font shorthand a component sheet gives them. Size, weight and
   line-height still come from each component. */
html[data-theme]
  #world
  :is(#home, #places, #roll, #area)
  :is(button, input, select, .frame-footer strong, .desk-video-label) {
  font-family: var(--desktop-font) !important;
}

/* ==========================================================================
   2. Shell bar
   Top navigation strip: page buttons, deck launcher and motion toggle. It is hidden on the home
   desktop, which has its own dock.
   ========================================================================== */

/* The bar itself: one flat 35 px row with a hairline rim underneath. */
html[data-theme] #world .shell {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-height: 35px;
  padding: 3px 12px;
  gap: 12px;
  background: var(--paper-surface);
  color: var(--paper-text);
  border-top: 0;
  border-bottom: 1px solid var(--desktop-rim);
  box-shadow: none;
  font-family: var(--desktop-font);
  isolation: isolate;
}

html[data-theme] #world .shell .brand {
  display: flex;
  align-items: center;
  flex: none;
  gap: 7px;
  padding: 2px 0;
  font: 700 12px/1.15 var(--desktop-font);
  letter-spacing: 0;
  color: #242424;
  text-shadow: 0 1px #fff9;
}

/* The home desktop hides the whole bar; its dock is the navigation there. */
html[data-theme] #world[data-page='home'] > .shell {
  display: none;
}

/* Brand block hidden outright: this later display: none overrides the display: flex above,
   so the bar shows navigation only. */
html[data-theme] #world .shell .brand {
  display: none;
}

/* Brand text and icon sizes. Not visible while the brand block above is hidden. */
#world .brand-name {
  white-space: nowrap;
}

#world .shell .brand-app-icon {
  width: 18px;
  height: 18px;
  flex: none;
  filter: drop-shadow(0 1px #fff);
}

/* Page navigation and the deck launcher share one flat, 26 px-high button style. */
html[data-theme] #world .shell nav {
  display: flex;
  align-items: center;
  flex: none;
  order: 0;
  width: auto;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

html[data-theme] #world .shell :is(nav button, .deck-launch) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  white-space: nowrap;
  font: 12px/1.3 var(--desktop-font);
  padding: 3px 7px;
  border: 1px solid transparent;
  color: var(--paper-text);
  min-height: 26px;
  border-radius: 3px;
  box-shadow: none;
  text-shadow: none;
  background: none;
}

/* Active page, plus the hover states of both kinds of button. */
html[data-theme] #world .shell nav button.active {
  background: var(--paper-inset);
  color: var(--paper-text);
  border-color: var(--desktop-rim);
  box-shadow: inset 0 1px 2px #0006;
  text-shadow: none;
}

html[data-theme] #world .shell :is(nav button, .deck-launch):hover {
  background: var(--paper-panel);
  color: var(--paper-text);
  border-color: var(--desktop-rim);
}

html[data-theme] #world .shell nav button.active:hover {
  background: var(--paper-inset);
  border-color: var(--paper-accent);
}

/* The deck launcher sits at the right-hand end of the bar. */
html[data-theme] #world .shell .deck-launch {
  margin-left: auto;
}

/* Motion toggle: an icon-only button. font-size: 0 hides its motion on/off text and leaves
   the sparkle glyph; aria-pressed false (motion off) dims the glyph. */
html[data-theme] #world .shell .motion {
  width: 23px;
  min-width: 23px;
  height: 24px;
  padding: 0;
  margin: 0;
  font-size: 0;
  display: grid;
  place-items: center;
  color: #333;
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: none;
  background: none;
}

html[data-theme] #world .shell .motion span {
  font: 16px/1 var(--desktop-font);
  color: var(--paper-muted);
}

html[data-theme] #world .shell .motion:hover {
  border-color: var(--desktop-rim);
  background: var(--paper-panel);
}

html[data-theme] #world .shell .motion[aria-pressed='false'] span {
  opacity: 0.45;
}

/* Keyboard focus ring for the bar's buttons, and the size of their icons. */
html[data-theme] #world .shell button:focus-visible {
  outline: 2px solid #426d9d;
  outline-offset: 1px;
}

html[data-theme] #world .shell :is(nav svg, .deck-launch svg) {
  width: 17px;
  height: 17px;
  flex: none;
  filter: none;
}

/* ==========================================================================
   3. Home title block
   The big wallpaper title on the home desktop: the Telugu line, the English title and the Manad
   byline.
   ========================================================================== */

/* The title uses the same period system family as the rest of the desktop. */
html[data-theme] #world .portal-brand h1,
html[data-theme] #world .portal-brand h1 em {
  background: none;
  -webkit-text-fill-color: currentColor;
  background-clip: initial;
  color: var(--wallpaper-title-ink);
  filter: none;
  text-shadow: var(--wallpaper-title-shadow);
}

html[data-theme] #world .portal-brand h1 em {
  color: inherit;
}

html[data-theme] #world .portal-brand h1 {
  font: 500 clamp(32px,3.8vw,52px)/1.15 var(--desktop-lettering);
  letter-spacing: -1.5px;
  white-space: normal;
  margin: 0;
}

html[data-theme] #world .portal-brand h1 em {
  font: inherit;
  white-space: nowrap;
}

/* The Telugu title line above the English title. */
#world .portal-brand > span:first-child {
  color: var(--wallpaper-title-muted);
  text-shadow: var(--wallpaper-title-shadow);
}

/* The byline button under the title (it opens the About me window). !important on the font
   shorthand: the reason is not recorded, and no other rule competes for the byline's size or
   line height today (removing it changed nothing in Chrome at 1440, 800 and 390 px with the
   default theme, 6 Oct 2026); the phone size further down has to be !important because this
   one is. The family that renders comes from hyd-platform.css, whose !important font-family
   rule is more specific (1,2,2 against 1,2,0). */
#world .portal-brand .manad-byline {
  display: block;
  margin: 8px auto 0;
  padding: 2px 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--wallpaper-title-muted);
  text-shadow: var(--wallpaper-title-shadow);
  font: calc(12 * var(--px))/1.5 var(--desktop-label-font) !important;
  letter-spacing: 0;
  text-align: center;
  pointer-events: auto;
}

#world .portal-brand .manad-byline:hover {
  color: var(--wallpaper-title-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Decorative marks are toned down: the orbit is hidden, and the wallpaper sparks are dimmed
   and stilled here (the Panther section hides the sparks outright). */
#world .portal-brand .tiny-orbit {
  display: none;
}

#world .desktop-wallpaper .pixel-spark {
  opacity: 0.4;
  animation: none;
}

/* ==========================================================================
   4. Home desktop windows
   Window frames, titlebars with their round buttons, toolbar buttons, and the contents of the
   recordings (#desk-photos), photo viewer (#desk-view), About me (#desk-notes), Start here
   (#desk-entry) and Stickers (#desk-stickers) windows.
   ========================================================================== */

/* Small, round Aqua controls sit on a shared baseline, with a centred drag area. */
/* Window frame: light bevel on the top and left, dark on the bottom and right, and a hard
   offset shadow. The front window gets a deeper shadow and a rim. */
html[data-theme] #world #home .desktop-window {
  border: 1px solid #ddd;
  border-right-color: #707070;
  border-bottom-color: #555;
  border-radius: 8px 8px 4px 4px;
  padding: 2px;
  background: var(--paper-panel);
  box-shadow:
    1px 1px 0 #000,
    3px 4px 0 #0005;
  rotate: 0deg;
}

html[data-theme] #world #home .desktop-window.is-front {
  box-shadow:
    1px 1px 0 #000,
    5px 6px 0 #0005;
  outline: 1px solid var(--desktop-rim);
}

/* Titlebar: 31 px of pinstriped grey metal; the front window's bar is lighter. !important on
   the background: earlier sheets (hyd-personal-web.css, hyd-theme.css, hyd-mac-windows.css
   and others) set titlebar backgrounds with !important, so this has to as well; it wins on
   specificity or on load order. */
html[data-theme] #world #home .desktop-titlebar,
html[data-theme] #world #home #desk-entry .desktop-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  height: 31px;
  min-height: 31px;
  padding: 0 4px;
  border-radius: 5px 5px 0 0;
  background:
    repeating-linear-gradient(0deg, #ffffff09 0 1px, #00000004 1px 2px),
    linear-gradient(#d9d9d9, #b6b6b6) !important;
  border-top: 1px solid #f4f4f4;
  border-bottom: 1px solid #888;
  box-shadow: inset 0 1px #fff6;
  color: #222;
  filter: none;
}

html[data-theme] #world #home .desktop-window.is-front .desktop-titlebar {
  background:
    repeating-linear-gradient(0deg, #ffffff0a 0 1px, #00000004 1px 2px),
    linear-gradient(#e5e5e5, #bcbcbc) !important;
}

/* The title is a button (.window-grab) that also moves the window with the arrow keys; the
   wide side padding keeps a long title clear of the round buttons. */
html[data-theme] #world #home .window-grab {
  display: block;
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  font: 13px/1.3 var(--desktop-font);
  text-shadow: 0 1px #fff8;
  color: #222;
  padding: 2px 58px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Button cluster pinned to the left edge. row-reverse flips the markup order (minimise,
   close) so close comes first, as on a Mac. */
html[data-theme] #world #home .desktop-titlebar > div {
  position: absolute;
  left: 8px;
  top: 50%;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 7px;
  height: 18px;
  margin: 0;
  z-index: 1;
}

/* Round gold buttons, 24 x 24 px; close turns red. !important on font: hyd-platform.css
   forces the desktop family on every button, and this more specific rule keeps the glyphs in
   Arial. */
html[data-theme] #world #home .desktop-titlebar > div > button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 1px solid #947844;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 15%, #fff9d9, #e9c774 55%, #bc994d);
  box-shadow:
    inset 0 1px #fff8,
    0 1px #fff7;
  color: #624722;
  font: 700 13px/1 Arial !important;
  transform: none;
  text-shadow: 0 1px #fff5;
}

html[data-theme] #world #home .desktop-titlebar > div > [data-close-window] {
  border-color: #98635f;
  background: radial-gradient(ellipse at 40% 15%, #fff0e9, #de9a91 55%, #be706e);
  color: #5b3031;
}

/* Hover, keyboard focus and pressed states of the round buttons. */
html[data-theme] #world #home .desktop-titlebar > div > button:hover {
  filter: brightness(1.12);
}

html[data-theme] #world #home .desktop-titlebar > div > button:focus-visible {
  outline: 2px solid #4d386b;
  outline-offset: 3px;
}

html[data-theme] #world #home .desktop-titlebar > div > button:active {
  box-shadow: inset 0 1px 3px #0007;
}

/* Menu, status, photo-tool and finder bars inside the windows, in plum panel colours. The
   Panther section below repaints the same selectors in grey metal. */
html[data-theme]
  #world
  #home
  :is(
    .desktop-menu,
    .desktop-status,
    .desktop-photo-tools,
    .places-finder-toolbar,
    .places-finder-tabs,
    .places-finder-footer
  ) {
  background: var(--paper-panel);
  color: var(--paper-muted);
  border-color: var(--desktop-rim);
  text-shadow: none;
  box-shadow: none;
  font-family: var(--desktop-font);
}

/* Bevelled 27 px toolbar buttons on the home windows and on Places, Photo roll and Area. */
html[data-theme]
  #world
  #home
  :is(
    .desktop-menu button,
    .desktop-photo-tools button,
    .places-finder-tabs button,
    .places-finder-footer button,
    .about-actions button,
    .entry-play,
    .terminal-input > button
  ),
html[data-theme]
  #world
  :is(#places, #roll, #area)
  :is(
    .map-tools > button,
    .atlas-window-bar button,
    .collection-tools button,
    .photo-shuffle,
    .area-actions button,
    .frame-watch
  ) {
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--desktop-rim);
  border-radius: 2px;
  background: var(--paper-panel);
  color: var(--paper-text);
  box-shadow:
    inset 1px 1px #ffffff1c,
    inset -1px -1px #0004;
  font: calc(12 * var(--px))/1.3 var(--desktop-font);
  text-shadow: none;
  transform: none;
}

/* Hover state. */
html[data-theme]
  #world
  #home
  :is(.desktop-menu button, .desktop-photo-tools button, .about-actions button, .entry-play):hover,
html[data-theme]
  #world
  :is(#places, #roll, #area)
  :is(.map-tools > button, .collection-tools button, .photo-shuffle, .frame-watch):hover {
  background: var(--paper-high);
  border-color: var(--paper-edge);
}

/* Selected (aria-pressed) tabs look pressed in. */
html[data-theme]
  #world
  #home
  :is(
    .places-finder-tabs button[aria-pressed='true'],
    .desktop-contact-strip button[aria-pressed='true']
  ),
html[data-theme] #world #roll .collection-tools button[aria-pressed='true'] {
  background: var(--paper-inset);
  color: var(--paper-text);
  box-shadow: inset 1px 1px #0008;
}

/* Inset text fields: the area search terminal, its suggestion list and the places finder
   search. */
html[data-theme]
  #world
  #home
  :is(.terminal-input, .area-suggestions, .places-finder-toolbar input) {
  border-radius: 1px;
  border: 1px solid var(--desktop-rim);
  background: var(--paper-inset);
  color: var(--paper-text);
  box-shadow: inset 1px 1px #0005;
}

/* Recordings window (#desk-photos): thumbnail grid and captions. */
html[data-theme] #world #home .desk-recordings > button {
  background: var(--paper-surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 4px;
}

html[data-theme] #world #home .desk-recordings {
  background: var(--paper-surface);
  padding: 7px;
  gap: 7px;
}

html[data-theme] #world #home .desk-video-label {
  font: calc(12 * var(--px))/1.35 var(--desktop-font);
  letter-spacing: 0;
}

/* Status bar (.desktop-status), the photo viewer's caption (.desktop-sky) and the About
   panel (.about-manad). */
html[data-theme] #world #home .desktop-status {
  font-size: calc(10 * var(--px));
  padding: 4px 7px;
}

html[data-theme] #world #home .desktop-sky > span {
  font: calc(12 * var(--px))/1.4 var(--desktop-font);
}

html[data-theme] #world #home .about-manad {
  background: var(--paper-surface);
  padding: 15px;
}

html[data-theme] #world #home .about-manad h2 {
  font: 700 calc(17 * var(--px))/1.3 var(--desktop-font);
}

html[data-theme] #world #home .about-manad p {
  font: calc(12 * var(--px))/1.7 var(--desktop-font);
}

/* Start here window (#desk-entry): a shuffle object on the left and the area search terminal
   on the right. */
html[data-theme] #world #home .visual-entry {
  background: var(--paper-surface);
  min-height: 273px;
}

html[data-theme] #world #home .visual-entry :is(.shuffle-object b, .area-terminal > label > b) {
  font: 700 calc(13 * var(--px))/1.3 var(--desktop-font);
}

#world #home .visual-entry .shuffle-art {
  width: 105px;
  height: 105px;
  flex-basis: 105px;
  filter: none;
}

#world #home .shuffle-object {
  gap: 12px;
}

#world #home .shuffle-object:focus-visible {
  border-radius: 0;
  outline: 2px solid var(--paper-accent);
  outline-offset: -5px;
  box-shadow: none;
}

#world #home .entry-play {
  width: 52px;
  min-height: 24px;
}

#world #home .area-terminal {
  padding: 12px;
}

#world #home .area-terminal > label {
  padding-bottom: 9px;
}

#world #home .terminal-input input {
  font: calc(12 * var(--px)) var(--desktop-font);
  min-width: 0;
}

#world #home .area-suggestions .finder-area {
  padding: 7px 9px;
}

/* The sticker sheet is a toolbox; placed objects have no permanent slots. */
html[data-theme] #world #home #desk-stickers :is(.sticker-play, .sticker-board) {
  background: var(--paper-surface);
  box-shadow: none;
  border-color: var(--desktop-rim);
}

html[data-theme] #world #home #desk-stickers .sticker-tray > button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: 1px;
  color: var(--paper-text);
}

html[data-theme] #world #home #desk-stickers .sticker-tray > button:is(:hover, .is-selected) {
  background: var(--paper-panel);
  border-color: var(--desktop-rim);
}

html[data-theme]
  #world
  #home
  #desk-stickers
  :is(.sticker-preview-copy b, .sticker-preview-copy small, #sticker-status) {
  color: var(--paper-text);
}

/* Illustrated stickers whose artwork is a hyd-* image get a fixed 135 px hit box (98 px on
   phones). */
#world #home .desktop-sticker.illustrated-sticker:has(img[src*='hyd-']) {
  width: 135px;
  height: 135px;
}

/* ==========================================================================
   5. Places and photo roll
   Finder-style windows for the map (#places) and the photo roll (#roll).
   ========================================================================== */

/* Finder surfaces carry the same restrained chrome into the map and photos. */
/* Re-points the --finder-* variables (defined in hyd-mac-windows.css) at this theme's
   palette. */
html[data-theme] #world :is(#places, #roll) {
  --finder-ink: var(--paper-text);
  --finder-border: var(--desktop-rim);
  --finder-chrome: var(--paper-panel);
  --finder-toolbar: var(--paper-panel);
  --finder-button: var(--paper-panel);
}

/* Places window frame and the heading bars of Places and the photo roll. */
html[data-theme] #world #places .places-browser {
  border-radius: 3px;
  border-color: var(--desktop-rim);
  box-shadow: 2px 3px #0007;
}

html[data-theme] #world :is(#places .places-heading, #roll .roll-heading) {
  border-radius: 1px;
  background:
    repeating-linear-gradient(0deg,transparent 0 2px,#ffffff0a 2px 3px),var(--paper-panel);
  box-shadow: none;
  min-height: 35px;
}

html[data-theme] #world :is(#places .places-heading h1, #roll .roll-heading h1) {
  font: 700 13px var(--desktop-font);
  text-shadow: none;
  color: var(--paper-text);
}

/* Round red close button, 19 px. !important on font: same reason as the titlebar buttons
   (hyd-platform.css forces the desktop family on every button). */
html[data-theme] #world .finder-close {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  min-height: 0;
  padding: 0;
  background: radial-gradient(ellipse at 40% 15%, #fff0e9, #de9a91 55%, #be706e);
  border: 1px solid #98635f;
  border-radius: 50%;
  box-shadow:
    inset 0 1px #fff8,
    0 1px #fff7;
  color: #5b3031;
  font: 700 14px/1 Arial !important;
}

/* Map tools, atlas bar and status line. */
html[data-theme] #world #places .map-tools {
  background: var(--paper-surface);
  box-shadow: none;
  padding: 10px 12px;
}

html[data-theme] #world #places .map-tools label {
  border-radius: 2px;
  box-shadow: inset 1px 1px #0006;
  min-height: 30px;
}

html[data-theme] #world #places .atlas-window-bar {
  background: var(--paper-panel);
  border-color: var(--desktop-rim);
}

html[data-theme] #world #places .map-status {
  font-size: 11px;
}

/* Area directory cards. !important on the background: hyd-actions.css, hyd-personal-web.css,
   hyd-retro.css and hyd-theme.css all set .directory-card's background with !important; this
   more specific rule has to as well. */
html[data-theme] #world #places .directory-card {
  background: var(--paper-surface) !important;
  border: 1px solid var(--desktop-rim);
  border-radius: 2px;
  box-shadow: 2px 2px #0005;
}

html[data-theme] #world #places .directory-card strong {
  font: 700 13px var(--desktop-font);
}

/* Selection bar and the Leaflet zoom buttons. */
html[data-theme] #world #places :is(.map-selection-bar, .leaflet-control-zoom a) {
  background: var(--paper-panel);
  color: var(--paper-text);
  box-shadow: none;
}

/* Photo roll: tool bars, frames and subject buttons. */
html[data-theme]
  #world
  #roll
  :is(.collection-tools, .photo-browse, .frame-shelf-bar, .frame-titlebar) {
  background: var(--paper-panel);
  border-color: var(--desktop-rim);
  box-shadow: none;
  color: var(--paper-text);
  font-family: var(--desktop-font);
}

/* Frame windows. !important on the background and shadow: hyd-theme.css and hyd-retro.css
   set the frame background with !important, so this more specific rule has to as well; the
   shadow is held at the same priority so the pair stays together. */
html[data-theme] #world #roll .keepsake-wall .frame-window {
  background: var(--paper-panel) !important;
  border: 1px solid var(--desktop-rim);
  box-shadow: 3px 4px #0005 !important;
}

html[data-theme] #world #roll :is(.frame-footer, .frame-titlebar .keep-frame) {
  background: var(--paper-surface);
  color: var(--paper-text);
  text-shadow: none;
  box-shadow: none;
}

html[data-theme] #world #roll #photo-subjects button {
  background: var(--paper-panel);
  color: var(--paper-text);
  border: 1px solid var(--desktop-rim);
  border-radius: 2px;
  font: 12px var(--desktop-font);
}

html[data-theme] #world #roll .photo-browse {
  border-radius: 2px;
}

html[data-theme] #world #roll #shuffle-scraps {
  background: var(--paper-panel);
  border: 1px solid var(--desktop-rim);
  border-radius: 2px;
  box-shadow: inset 1px 1px #ffffff1c;
  transform: none;
}

/* ==========================================================================
   6. Dialogs
   Personalise, postcard, email, photo, story and credits dialogs, and the cat window.
   ========================================================================== */

/* Dialogs use the same labels and edges. Media players retain their own dark metal. */
html[data-theme]
  :is(
    #desktop-personalise,
    #hyd-postcard,
    #email-manad,
    #photo-dialog,
    #story-dialog,
    #credits-dialog
  ) {
  border: 1px solid var(--desktop-rim);
  border-radius: 3px;
  box-shadow: 3px 5px #0008;
  font-family: var(--desktop-font);
}

/* Dialog titlebars (personalise, personal pages, postcard and cat) and their titles and
   buttons. */
html[data-theme]
  :is(.desktop-personalise-bar, .personal-titlebar, .postcard-titlebar, .hyd-cat-titlebar) {
  background: var(--paper-panel);
  color: var(--paper-text);
  box-shadow: none;
  border-color: var(--desktop-rim);
  font-family: var(--desktop-font);
}

html[data-theme]
  :is(.desktop-personalise-bar, .personal-titlebar, .postcard-titlebar, .hyd-cat-titlebar)
  :is(h2, button) {
  font-family: var(--desktop-font);
  color: var(--paper-text);
  text-shadow: none;
}

/* ==========================================================================
   7. Dock and desktop icons
   The taskbar, drawn as a dock, at the bottom of the home desktop, and the icon captions on the
   wallpaper.
   ========================================================================== */

/* A shallow application shelf, without the foggy glass or magnification. */
html[data-theme] #world #home .desktop-taskbar {
  background: var(--paper-panel);
  border: 1px solid var(--desktop-rim);
  border-radius: 3px;
  box-shadow:
    inset 1px 1px #ffffff18,
    2px 3px #0007;
  backdrop-filter: none;
  padding: 4px 7px;
  min-height: 56px;
  bottom: max(6px,env(safe-area-inset-bottom));
}

html[data-theme] #world #home .desktop-taskbar::before {
  display: none;
}

html[data-theme] #world #home .desktop-taskbar button {
  background: none;
  box-shadow: none;
  border: 1px solid transparent;
  border-radius: 2px;
  transform: none;
  translate: 0;
  scale: 1;
  transition: background 0.12s;
}

html[data-theme] #world #home .desktop-taskbar button:is(:hover, [aria-pressed='true']) {
  background: var(--paper-inset);
  border-color: var(--desktop-rim);
  transform: none;
  translate: 0;
  scale: 1;
}

/* !important: icons inside the dock never move or scale, whatever an earlier hover rule asks
   for. The dock buttons are reset the same way above without !important; hyd-aqua.css
   magnifies the button on hover. */
#world #home .desktop-taskbar button svg {
  transform: none !important;
  scale: 1 !important;
}

/* Finder captions sit directly on the wallpaper; blue belongs to selection. */
html[data-theme] #world #home .desktop-icons > button > b {
  font: 700 calc(12 * var(--px))/calc(14 * var(--px)) var(--desktop-font);
  letter-spacing: 0;
  text-align: center;
  color: var(--desktop-caption-ink);
  text-shadow: var(--desktop-caption-shadow);
  background: transparent;
  border: 0;
  border-radius: 3px;
  outline: none;
  box-shadow: none;
  white-space: normal;
}

#world #home .desktop-icons > button {
  border-radius: 0;
}

html[data-theme] #world #home .desktop-icons > button:focus-visible {
  outline: none;
}

html[data-theme] #world #home .desktop-icons > button:is(:focus-visible, :active) > b {
  background: #3875d7;
  color: #fff;
  text-shadow: 0 1px 1px #163861;
  box-shadow: 0 0 0 1px #ffffff70;
}

/* ==========================================================================
   8. Home layout by screen width
   Where each home window sits at each breakpoint: 901 px and up (desktop), 621-900 px (tablet),
   620 px and under (phone). Positions are left or right, top and width per #desk-* id; a window
   the visitor has dragged keeps its offset (--wx, --wy), which hyd-desktop.js stores and
   hyd-desktop.css applies as a translate on top of these values.
   ========================================================================== */

@media (min-width: 901px) {
  /* Canvas: at least 780 px tall, filling the viewport. */
  .portal-collage .web-desktop {
    height: max(780px, 100dvh);
  }

  .portal-collage .portal-brand {
    left: 0;
    right: 0;
    top: 30px;
    width: auto;
    padding-inline: 180px;
  }

  /* Icon column: two columns at the top left. */
  .portal-collage .desktop-icons {
    left: 17px;
    top: 71px;
    width: 148px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
    align-items: start;
  }

  /* Each icon is a 50 px picture over a 28 px caption; the caption’s share grows with bigger text. */
  #world #home .desktop-icons > button {
    display: grid;
    grid-template-rows: 50px calc(28 * var(--px));
    justify-items: center;
    align-items: end;
    min-height: calc(54px + 28 * var(--px));
    gap: 4px;
    translate: none;
  }

  #world #home .desktop-icons > button > b {
    align-self: start;
    margin: 0;
    min-height: calc(28 * var(--px));
    max-width: 100%;
    padding: 2px 3px;
  }

  #world #home .desktop-icons > button > :is(svg, img) {
    max-height: 50px;
    max-width: 53px;
    object-fit: contain;
  }

  /* Default window positions. */
  #world #home #desk-photos {
    left: 17%;
    top: 180px;
    width: 310px;
  }

  #world #home #desk-view {
    left: auto;
    right: 4%;
    top: 211px;
    width: 246px;
  }

  #world #home #desk-entry {
    left: 29%;
    top: 326px;
    width: 450px;
  }

  #world #home #desk-notes {
    left: 19%;
    top: 150px;
    width: 280px;
  }

  #world #home #desk-places {
    left: auto;
    right: 17%;
    top: 192px;
    width: 360px;
  }

  #world #home #desk-stickers {
    left: auto;
    right: 11%;
    top: 133px;
    width: 320px;
  }

  /* Riyal's perch on the home desktop. */
  #web-desktop > .hyd-cat-slot-home {
    left: auto;
    right: 10%;
    bottom: 115px;
  }
}

/* Tablet: a fixed 1180 px canvas. */
@media (min-width: 621px) and (max-width: 900px) {
  .portal-collage .web-desktop {
    height: 1180px;
  }

  .portal-collage .portal-brand {
    top: 26px;
    left: 0;
    right: 0;
    width: auto;
    padding-inline: 112px;
  }

  .portal-collage .desktop-icons {
    top: 54px;
  }

  #world #home #desk-photos {
    left: 18%;
    top: 165px;
    width: 270px;
  }

  #world #home #desk-entry {
    left: 24%;
    top: 338px;
    width: 390px;
  }

  #world #home #desk-view {
    right: 7%;
    top: 730px;
    width: 235px;
  }

  #world #home #desk-notes {
    left: 20%;
    top: 170px;
    width: 260px;
  }

  #world #home #desk-stickers {
    left: auto;
    right: 4%;
    top: 200px;
  }

  #web-desktop > .hyd-cat-slot-home {
    left: 20%;
    right: auto;
    bottom: 96px;
    width: 92px;
    height: 84px;
  }
}

/* Tablet: slightly tighter shell bar. */
@media (min-width: 621px) and (max-width: 900px) {
  html[data-theme] #world .shell {
    gap: 8px;
    padding: 3px 9px;
  }

  html[data-theme] #world .shell nav {
    padding-left: 6px;
    gap: 0;
  }

  html[data-theme] #world .shell nav button {
    padding-inline: 5px;
  }
}

/* Phone: compact shell bar, a flowing canvas and full-width windows. hyd-personal-web.css
   and hyd-desktop.css put the windows into normal flow at this width; the padding-top below
   reserves room for the title and icon block. */
@media (max-width: 620px) {
  html[data-theme] #world .shell {
    flex-wrap: nowrap;
    padding: 3px 6px;
    gap: 3px;
  }

  html[data-theme] #world .shell .brand {
    font-size: 12px;
  }

  html[data-theme] #world .shell nav {
    order: 0;
    width: auto;
    flex: 1;
    justify-content: flex-start;
    gap: 1px;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  html[data-theme] #world .shell nav button {
    flex: none;
  }

  html[data-theme] #world .shell :is(nav button, .deck-launch) {
    font-size: 10px;
    padding: 3px 4px;
    min-height: 27px;
  }

  html[data-theme] #world .portal-brand h1 {
    font-size: clamp(25px, 6.8vw, 37px);
    letter-spacing: -0.8px;
  }

  .portal-collage .portal-brand {
    left: 0;
    right: 0;
    width: auto;
    padding-inline: 16px;
  }

  /* !important is needed here because the base byline font shorthand is !important. */
  #world .portal-brand .manad-byline {
    margin-top: 5px;
    font-size: calc(10 * var(--px)) !important;
  }

  /* Canvas and icons: the canvas height follows its content, and the icon grid moves down to
     sit under the title. */
  #home .portal-collage .web-desktop {
    padding-top: 388px;
    padding-bottom: 140px;
    height: auto;
  }

  .portal-collage .desktop-icons {
    top: 143px;
    gap: 14px 5px;
  }

  #world #home .desktop-render-icon {
    width: 43px;
    height: 43px;
  }

  /* Windows and stickers: untilted and sized for a single column. */
  html[data-theme] #world #home .desktop-window {
    rotate: 0deg;
  }

  #world #home .visual-entry {
    min-height: 252px;
    padding: 6px 2px;
  }

  #world #home .visual-entry .shuffle-art {
    width: 84px;
    height: 84px;
    flex-basis: 84px;
  }

  #world #home .area-terminal {
    padding: 8px;
  }

  #world #home .visual-entry :is(.shuffle-object b, .area-terminal > label > b) {
    font-size: calc(12 * var(--px));
  }

  #world #home #desk-notes {
    width: 100%;
    margin: 0;
  }

  #world #home #desk-view {
    width: 86%;
    margin-left: 8%;
  }

  #world #home .desktop-sticker.illustrated-sticker:has(img[src*='hyd-']) {
    width: 98px;
    height: 98px;
  }

  #world #home #desk-stickers {
    width: 100%;
  }
}

/* ==========================================================================
   9. Panther overrides
   Grey metal values for selectors the earlier sections already styled with the plum palette.
   Same selectors, later in the file, so these win: keep them below the rules they replace.
   ========================================================================== */

/* Panther-style utility bars: fine metal, compact labels, no lavender frosting. */
html[data-theme]
  #world
  #home
  :is(
    .desktop-menu,
    .desktop-status,
    .desktop-photo-tools,
    .places-finder-toolbar,
    .places-finder-tabs,
    .places-finder-footer
  ) {
  background: #c7c7c7;
  color: #282828;
  border-color: #8e8e8e;
}

/* Metal buttons in the same bars. */
html[data-theme]
  #world
  #home
  :is(
    .desktop-menu button,
    .desktop-photo-tools button,
    .places-finder-tabs button,
    .places-finder-footer button
  ) {
  background: linear-gradient(#f7f7f7, #d0d0d0);
  color: #222;
  border-color: #929292;
  box-shadow: inset 0 1px #fff;
  border-radius: 4px;
}

html[data-theme] #world #home :is(.desktop-menu button, .desktop-photo-tools button):hover {
  background: #ebebeb;
  border-color: #656565;
}

html[data-theme] #world #home :is(.places-finder-toolbar input, .terminal-input) {
  border-radius: 6px;
}

/* Heading bars of Places and the photo roll, and the dialog titlebars. */
html[data-theme] #world :is(#places .places-heading, #roll .roll-heading) {
  background:
    repeating-linear-gradient(0deg, #ffffff0a 0 1px, #00000004 1px 2px),
    linear-gradient(#dedede, #bdbdbd);
  border-bottom: 1px solid #888;
  color: #222;
}

html[data-theme] #world :is(#places .places-heading h1, #roll .roll-heading h1) {
  color: #222;
}

html[data-theme]
  :is(.desktop-personalise-bar, .personal-titlebar, .postcard-titlebar, .hyd-cat-titlebar) {
  background: linear-gradient(#dedede, #bdbdbd);
  color: #222;
}

html[data-theme]
  :is(.desktop-personalise-bar, .personal-titlebar, .postcard-titlebar, .hyd-cat-titlebar)
  :is(h2, button) {
  color: #222;
}

/* The dock: translucent grey, with a blue wash on the active button. */
html[data-theme] #world #home .desktop-taskbar {
  background: #c3c3c3da;
  border-color: #e3e3e3 #777 #666 #ddd;
  border-radius: 7px;
  box-shadow: 0 3px 8px #0006;
}

html[data-theme] #world #home .desktop-taskbar button:is(:hover, [aria-pressed='true']) {
  background: #5b76955c;
  border-color: #8997a9;
}

/* Browse, personal corners, then utilities; keyboard order follows this grouping. */
@media (min-width: 621px) {
  html[data-theme] #world #home .desktop-taskbar {
    gap: 5px;
    padding: 4px 8px;
  }

  html[data-theme] #world #home .desktop-tasks {
    gap: 5px;
  }

  html[data-theme] #world #home .desktop-taskbar button {
    flex: none;
    width: 44px;
    height: 46px;
    padding: 2px;
  }

  /* An etched divider is drawn before the first button of each dock group (hyd-desktop.js
     adds .dock-group-start). */
  html[data-theme] #world #home .desktop-taskbar .dock-group-start {
    margin-left: 12px;
  }

  html[data-theme] #world #home .desktop-taskbar .dock-group-start:before {
    content: '';
    position: absolute;
    left: -9px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: #737982;
    box-shadow: 1px 0 #eef0f480;
  }

  html[data-theme] #world #home .desktop-taskbar .desk-reset {
    margin-left: 0;
    padding: 2px;
    border-left: 1px solid transparent;
    width: 36px;
  }
}

/* Pixel sparks are hidden entirely in this theme; an earlier rule only dimmed them. */
html[data-theme] #world #home .desktop-wallpaper .pixel-spark {
  display: none;
}

/* ==========================================================================
   10. Memory tools, cards and grids
   A memory is one dated photo or recording. The tool bar, filmstrip shelf, cards and month
   grids are shared by the map, the area pages and the photo dialog.
   ========================================================================== */

/* One dated collection: photographs and recordings sit beside each other. */
/* Tool bar (filter selects and buttons) above a memory list. */
html[data-theme] #world .memory-tools {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--paper-panel);
  border-block: 1px solid var(--desktop-rim);
  color: var(--paper-text);
  font: 11px/1.35 var(--desktop-font);
}

html[data-theme] #world .memory-tools label {
  display: grid;
  gap: 4px;
  font: 11px var(--desktop-font);
  color: var(--paper-muted);
}

html[data-theme] #world .memory-tools :is(select, button),
html[data-theme] #photo-dialog .memory-next {
  min-height: 30px;
  border: 1px solid var(--desktop-rim);
  border-radius: 3px;
  padding: 5px 8px;
  background: var(--paper-surface);
  color: var(--paper-text);
  box-shadow: inset 0 1px #fff2;
  font: 12px/1.25 var(--desktop-font);
  text-shadow: none;
}

html[data-theme] #world .memory-tools select {
  max-width: 260px;
}

html[data-theme] #world .memory-tools button:hover {
  background: var(--paper-high);
}

html[data-theme] #world .memory-tools > span {
  align-self: center;
  margin-left: auto;
  font-size: 11px;
}

/* The map's clear button sits at the right end of its tool bar. */
#world .map-memory-tools #map-memory-clear {
  margin-left: auto;
}

/* Map shelf: a horizontal filmstrip of cards under the map that snaps to card edges. */
#world .map-memory-shelf {
  padding: 12px 14px 15px;
  border-block: 1px solid var(--desktop-rim);
  background: var(--paper-surface);
}

#world .memory-shelf-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font: 12px/1.4 var(--desktop-font);
  color: var(--paper-text);
}

#world .memory-shelf-title > span {
  font-size: 11px;
  color: var(--paper-muted);
}

#world .memory-filmstrip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--paper-edge) var(--paper-inset);
  overscroll-behavior-x: contain;
}

/* Memory card: picture, title and a small caption. */
html[data-theme] #world .memory-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--desktop-rim);
  border-radius: 2px;
  background: var(--paper-inset);
  color: var(--paper-text);
  text-align: left;
  box-shadow: 1px 2px #0004;
  text-shadow: none;
  transform: none;
  transition: border-color 0.15s;
}

html[data-theme] #world .memory-card:hover {
  border-color: var(--paper-accent);
  background: var(--paper-panel);
  transform: none;
}

html[data-theme] #world .memory-card:focus-visible {
  outline: 2px solid var(--paper-accent);
  outline-offset: 2px;
}

#world .memory-filmstrip .memory-card {
  flex: 0 0 170px;
  scroll-snap-align: start;
}

/* Card picture: a 4:3 crop with a small badge in the lower-right corner. */
#world .memory-picture {
  display: block;
  position: relative;
  aspect-ratio: 4/3;
  width: 100%;
  overflow: hidden;
  background: #101014;
}

#world .memory-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#world .memory-picture i {
  position: absolute;
  bottom: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 22px;
  border: 1px solid #c8c4cd99;
  border-radius: 3px;
  background: #222c;
  color: #fff;
  font: 14px/1 var(--desktop-font);
}

#world .memory-card strong {
  font: 12px/1.35 var(--desktop-font);
  color: var(--paper-text);
}

#world .memory-card small {
  font: 10px/1.4 var(--desktop-font);
  color: var(--paper-muted);
}

/* ==========================================================================
   11. Area page
   One area is a small Finder window: title bar, top row, search with its suggestion dropdown,
   filter tools and the memory grid.
   ========================================================================== */

/* An area is one small Finder window, including its search and filter controls. */
html[data-theme] #world #area {
  display: flex;
  flex-direction: column;
  width: calc(100% - 32px);
  max-width: 1060px;
  min-height: 0;
  height: auto;
  margin: 18px auto 28px;
  padding: 0;
  border: 1px solid #707078;
  border-radius: 5px;
  background: var(--paper-surface);
  box-shadow: 0 5px 16px #0005;
  overflow: hidden;
}

/* The title bar (order -2) and the top row (order -1) are lifted above the content with flex
   order, because the markup order differs. */
html[data-theme] #world #area .area-heading {
  order: -2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #8c8c92;
  border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(0deg, #d5d5d8 0 1px, #dedee0 1px 3px);
  color: #26262d;
  box-shadow: inset 0 1px #fff8;
}

html[data-theme] #world #area .area-heading h1 {
  margin: 0;
  padding: 0;
  font: 700 13px/1.4 var(--desktop-font);
  color: #26262d;
  text-shadow: 0 1px #fff6;
  letter-spacing: 0;
}

html[data-theme] #world #area .area-top {
  order: -1;
  min-height: 30px;
  padding: 5px 12px;
  gap: 10px;
  background: #d6d6d9;
  color: #47474f;
  border-bottom: 1px solid #b5b5bd;
  font: 10px/1.4 var(--desktop-font);
}

html[data-theme] #world #area .area-top .text-button {
  padding: 2px 0;
  color: #32333c;
  font: 11px/1.3 var(--desktop-font);
  text-decoration: none;
}

html[data-theme] #world #area .area-top .text-button:hover {
  text-decoration: underline;
}

html[data-theme] #world #area .area-location {
  text-align: right;
  font-size: 10px;
  color: #5c5c65;
}

/* Search row; the suggestion list drops down over the content. */
html[data-theme] #world #area .area-finder {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 6px 12px;
  background: #d6d6d9;
  color: #2c2c34;
}

html[data-theme] #world #area .area-finder input {
  flex: 1;
  min-width: 0;
  width: auto;
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid #9999a3;
  border-radius: 4px;
  background: #fbfbfc;
  color: #25252b;
  box-shadow: inset 0 1px 2px #0002;
  font: 12px/1.4 var(--desktop-font);
}

html[data-theme] #world #area .area-finder input::placeholder {
  color: #696972;
}

html[data-theme] #world #area .area-finder .discovery-results {
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  z-index: 30;
  max-height: 260px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--desktop-rim);
  background: var(--paper-panel);
  box-shadow: 0 5px 12px #0005;
}

/* Filter tools for the area, in grey metal. */
html[data-theme] #world #area > .memory-tools {
  align-items: center;
  gap: 8px;
  padding: 7px 12px 10px;
  background: #d6d6d9;
  color: #3a3a43;
  border-top: 0;
  border-bottom: 1px solid #96969f;
}

html[data-theme] #world #area > .memory-tools label {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 11px var(--desktop-font);
  color: #3a3a43;
}

html[data-theme] #world #area > .memory-tools :is(select, button) {
  min-height: 28px;
  padding: 4px 8px;
  border-color: #94949d;
  background: linear-gradient(#fafafa, #d2d2d8);
  color: #303039;
  box-shadow: inset 0 1px #fff;
  font: 11px/1.4 var(--desktop-font);
}

html[data-theme] #world #area > .memory-tools select {
  background: #f5f5f8;
}

html[data-theme] #world #area > .memory-tools > span {
  margin-left: auto;
  font: 10px/1.4 var(--desktop-font);
  color: #5b5b65;
}

/* The area's memory grid: fixed-width cards, left aligned. */
html[data-theme] #world #area-memories {
  min-height: 0;
  padding: 4px 14px 16px;
  background: var(--paper-surface);
  border: 0;
}

#world #area .memory-grid {
  grid-template-columns: repeat(auto-fill, minmax(175px, 220px));
  gap: 12px;
  align-items: start;
  justify-content: start;
}

#world #area .memory-month {
  padding: 12px 0 5px;
}

#world #area .memory-card {
  max-width: 240px;
}

/* A lone card becomes one wide row: picture on the left, text on the right. */
@media (min-width: 621px) {
  #world #area .memory-grid:has(> .memory-card:only-child) {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme] #world #area .memory-grid > .memory-card:only-child {
    display: grid;
    grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
    column-gap: 15px;
    row-gap: 6px;
    max-width: none;
    padding: 8px;
    text-align: left;
  }

  #world #area .memory-grid > .memory-card:only-child .memory-picture {
    grid-column: 1;
    grid-row: 1/3;
    aspect-ratio: 16/9;
  }

  #world #area .memory-grid > .memory-card:only-child strong {
    align-self: end;
    font-size: 15px;
  }

  #world #area .memory-grid > .memory-card:only-child small {
    align-self: start;
    font-size: 11px;
  }
}

/* Shared month heading, grid and empty state. Inside #area the rules above win on
   specificity. */
#world .memory-month {
  padding: 18px 0 8px;
}

html[data-theme] #world .memory-month h2 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--desktop-rim);
  font: 700 13px/1.4 var(--desktop-font);
  color: var(--paper-text);
}

#world .memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

#world .memory-empty {
  padding: 16px;
  color: var(--paper-muted);
  font: 12px var(--desktop-font);
}

/* The photo dialog's next button, centred under the grid. The second rule restates the global
   [hidden] rule from hyd-world.css (display: none !important), which already beats the
   display: block above; belt and braces, not needed for correctness. */
html[data-theme] #photo-dialog .memory-next {
  display: block;
  margin: 12px auto 0;
}

html[data-theme] #photo-dialog .memory-next[hidden] {
  display: none;
}

/* Phone: tighter tools, two-column grids and a narrower area window. */
@media (max-width: 620px) {
  html[data-theme] #world .memory-tools {
    gap: 7px;
    padding: 9px;
  }

  html[data-theme] #world .memory-tools label:first-child {
    flex: 1 1 100%;
  }

  html[data-theme] #world .memory-tools label select {
    width: 100%;
    max-width: none;
  }

  html[data-theme] #world .memory-tools > span {
    width: 100%;
    margin: 2px 0 0;
  }

  #world .map-memory-tools #map-memory-clear {
    font-size: 11px;
  }

  #world .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  #world .memory-filmstrip .memory-card {
    flex-basis: 145px;
  }

  html[data-theme] #world #area {
    width: calc(100% - 16px);
    margin: 10px auto 18px;
  }

  html[data-theme] #world #area .area-location {
    display: none;
  }

  html[data-theme] #world #area > .memory-tools label:first-child {
    flex: 0 1 auto;
  }

  html[data-theme] #world #area > .memory-tools > span {
    width: auto;
    margin: 0 0 0 auto;
  }

  html[data-theme] #world #area-memories {
    padding: 3px 10px 14px;
  }

  #world #area .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
}

/* ==========================================================================
   12. Riyal cat shortcut
   Riyal is Manad's ginger cat (hyd-cat.js). Her button sits in the area search row and in the
   player's extras bar.
   ========================================================================== */

/* A visible, stationary shortcut for Riyal; never a titlebar illustration. */
#world :is(#area .area-finder, #cinema .player-extras) > .hyd-cat-slot {
  display: block;
  flex: 0 0 88px;
  width: 88px;
  height: 44px;
  margin: 0 0 0 auto;
}

#world #cinema .player-extras .hyd-cat {
  width: 100%;
  height: 100%;
}

/* Light button in the area page; the player gets a dark variant below. */
#world :is(#area, #cinema) .hyd-cat-pet {
  border: 1px solid #96969f;
  border-radius: 4px;
  background: #e4e4e8;
  box-shadow: inset 0 1px #fff9;
  color: #35353d;
}

#world :is(#area, #cinema) .hyd-cat-pet:is(:hover, :focus-visible) {
  background: #f1f1f4;
  border-color: #666673;
  transform: none;
}

#world :is(#area, #cinema) .hyd-cat-sprite {
  inset: 0 auto 0 0;
  width: 44px;
  height: 42px;
}

#world :is(#area, #cinema) .hyd-cat-name {
  position: absolute;
  inset: 0 3px 0 43px;
  display: grid;
  place-items: center;
  font: 11px/1.3 var(--desktop-font);
  color: inherit;
  text-shadow: none;
}

#world #cinema .hyd-cat-pet {
  background: #343940;
  border-color: #68717c;
  color: #f1f2f5;
  box-shadow: inset 0 1px #fff2;
}

#world #cinema .hyd-cat-pet:is(:hover, :focus-visible) {
  background: #484f59;
  border-color: #a3a9b4;
}

/* ==========================================================================
   13. Player
   The #cinema page: screen caption, extras bar, details panels, toolbar, chapters and the
   next-recording queue, in dark metal.
   ========================================================================== */

/* Playback details share the player's neutral metal, not a second purple page. */
/* The signal wave and the big on-screen title are hidden in this theme. */
html[data-theme] #world #cinema .signal-wave {
  display: none;
}

/* One-line kind label (#memory-kind), centred and truncated with an ellipsis. */
html[data-theme] #world #cinema #memory-kind {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #303840;
  border: 0;
  font: 11px/1.3 var(--desktop-font);
  text-shadow: 0 1px #ffffff70;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

html[data-theme] #world #cinema .screen-title {
  display: none;
}

/* Extras bar under the screen. */
html[data-theme] #world #cinema .player-extras {
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: #191e24;
  color: #e9edf2;
}

html[data-theme] #world #cinema .player-extras > button {
  min-height: 32px;
  padding: 6px 9px;
  font: calc(11 * var(--px))/1.3 var(--desktop-font);
  border-radius: 3px;
}

html[data-theme] #world #cinema .journey-volume {
  font: calc(10 * var(--px))/1.3 var(--desktop-font);
  color: #c2cad3;
}

/* Details panel under the screen. */
html[data-theme] #world #cinema .cinema-below {
  margin: 0 22px;
  padding: 17px 16px 12px;
  background: #20262d;
  color: #e7eaf0;
  border: 1px solid #4c5662;
  border-radius: 4px;
  box-shadow: inset 0 1px #fff1;
}

html[data-theme] #world #cinema .recording-heading {
  gap: 11px;
  align-items: flex-start;
}

html[data-theme] #world #cinema .clip-stamp {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 4px;
  border: 1px solid #68737f;
  border-radius: 3px;
  background: #303943;
  transform: none;
  rotate: none;
  box-shadow: inset 0 1px #fff2;
  color: #dae4ef;
}

html[data-theme] #world #cinema .clip-stamp svg {
  width: 25px;
  height: 25px;
}

html[data-theme] #world #cinema .cinema-below .sample-label {
  font: calc(10 * var(--px))/1.4 var(--desktop-font);
  color: #b4beca;
  letter-spacing: 0;
}

html[data-theme] #world #cinema .cinema-below h2 {
  margin: 3px 0 5px;
  font: 700 clamp(calc(17 * var(--px)),2vw,calc(23 * var(--px)))/1.3 var(--desktop-font);
  color: #f0f3f7;
  letter-spacing: -0.3px;
  text-shadow: none;
}

html[data-theme] #world #cinema .cinema-below p {
  max-width: 780px;
  font: calc(12 * var(--px))/1.55 var(--desktop-font);
  color: #bbc4d0;
}

/* Three-column action toolbar inside the details panel. */
html[data-theme] #world #cinema .pixel-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  margin: 13px 0 0;
  padding: 8px 0 0;
  gap: 4px;
  border: 0;
  border-top: 1px solid #424c58;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme] #world #cinema .pixel-toolbar > button {
  flex: 1 1 138px;
  min-width: 0;
  min-height: 46px;
  padding: 6px 8px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #edf0f5;
  box-shadow: none;
  font: calc(11 * var(--px))/1.3 var(--desktop-font);
}

html[data-theme] #world #cinema .pixel-toolbar > button:is(:hover, :focus-visible) {
  border-color: #6b7787;
  background: #303944;
}

html[data-theme] #world #cinema .pixel-toolbar small {
  font: calc(10 * var(--px))/1.25 var(--desktop-font);
  color: #aebbc9;
}

html[data-theme] #world #cinema .pixel-toolbar b {
  font: 700 calc(11 * var(--px))/1.35 var(--desktop-font);
  color: #eef1f6;
  overflow-wrap: anywhere;
}

html[data-theme] #world #cinema .pixel-toolbar :is(svg, .day-glyph) {
  width: 25px;
  height: 25px;
  flex: none;
  font-size: 25px;
  color: #c8d7e7;
}

html[data-theme] #world #cinema .pixel-toolbar .folder-art {
  width: 25px;
  min-width: 25px;
  height: 18px;
}

/* Chapter buttons. */
html[data-theme] #world #cinema .chapters {
  margin: 8px 22px;
  padding: 10px 12px;
  border: 1px solid #4c5662;
  border-radius: 4px;
  background: #20262d;
  gap: 8px 12px;
  font: calc(11 * var(--px))/1.4 var(--desktop-font);
  color: #bdc7d3;
}

html[data-theme] #world #cinema .chapters > span:first-child {
  color: #bdc7d3;
}

html[data-theme] #world #cinema .chapters button {
  padding: 5px 8px;
  background: #282f38;
  border: 1px solid #526072;
  border-radius: 3px;
  font: calc(11 * var(--px))/1.3 var(--desktop-font);
  color: #e1e7f0;
}

html[data-theme] #world #cinema .chapters button[aria-pressed='true'] {
  background: #3c4c5c;
  border-color: #a1b6ce;
  color: #fff;
}

/* Next stop panel and the next-recording queue. */
html[data-theme] #world #cinema .next-stop {
  margin: 8px 22px 0;
  padding: 12px;
  border: 1px solid #4c5662;
  border-radius: 4px;
  background: #20262d;
  color: #d5dde8;
}

html[data-theme] #world #cinema .queue-heading {
  margin-bottom: 9px;
  gap: 8px;
}

html[data-theme] #world #cinema .queue-heading h2 {
  margin: 0;
  font: 700 calc(14 * var(--px))/1.4 var(--desktop-font);
  letter-spacing: 0;
  color: #e6ebf3;
}

html[data-theme] #world #cinema .queue-spark {
  display: none;
}

html[data-theme] #world #cinema .queue-heading :is(#queue-area, .auto-next) {
  font: calc(11 * var(--px))/1.4 var(--desktop-font);
  color: #b7c2d2;
}

html[data-theme] #world #cinema .queue-heading #queue-area {
  margin-left: 0;
}

html[data-theme] #world #cinema .next-recording {
  gap: 12px;
  padding: 6px;
  border: 1px solid #586577;
  border-radius: 3px;
  background: #232c36;
  box-shadow: inset 0 1px #fff1;
  translate: none;
}

html[data-theme] #world #cinema .next-recording:hover {
  border-color: #a6b8d0;
  background: #2b3643;
}

html[data-theme] #world #cinema .next-picture {
  width: 96px;
  flex-basis: 96px;
  border-color: #677689;
}

html[data-theme] #world #cinema .next-copy strong {
  font: 700 calc(14 * var(--px))/1.35 var(--desktop-font);
  letter-spacing: 0;
  color: #eef2f8;
}

html[data-theme] #world #cinema .next-copy :is(small, span) {
  font: calc(10 * var(--px))/1.45 var(--desktop-font);
  color: #b9c6d5;
}

html[data-theme] #world #cinema .next-arrow {
  padding: 5px;
  font-size: 21px;
  color: #c0d0e3;
}

html[data-theme] #world #cinema .queue-footer {
  padding-top: 7px;
}

html[data-theme] #world #cinema .queue-footer > .text-button {
  min-height: 28px;
  font: calc(11 * var(--px))/1.4 var(--desktop-font);
  color: #c9d5e5;
}

/* ==========================================================================
   14. Photo slideshow mode
   When a photo rather than a video is playing, the same screen shows #memory-photo.
   ========================================================================== */

/* The slideshow uses the same screen and route window. The clock supplies zoom. */
/* --photo-zoom is written by the photo clock in hyd-world.js: it climbs from 1 to 1.055 over
   each 5 s photo and stays 1 when motion is off. The short linear transition smooths the
   steps between clock ticks. */
html[data-theme] #world #cinema #memory-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  animation: none;
  transform: scale(var(--photo-zoom,1));
  transform-origin: center;
  transition: transform 0.12s linear;
}

/* Photo mode hides the video and the shade over the screen. */
html[data-theme] #world #cinema.photo-mode #journey-video {
  display: none;
}

html[data-theme] #world #cinema.photo-mode .screen-shade {
  background: none;
  pointer-events: none;
}

/* A paused photo has no transition, so the zoom stops where it is. */
html[data-theme] #world #cinema.photo-paused #memory-photo {
  transition: none;
}

/* Transport buttons are 44 px touch targets. */
html[data-theme] #world #cinema .transport :is(#previous-memory, #skip-memory) {
  flex: none;
  width: 44px;
  min-height: 44px;
  padding: 1px;
  font: 23px/1 var(--desktop-font);
}

html[data-theme] #world #cinema .transport #play-small {
  width: 44px;
  min-height: 44px;
  padding: 2px;
}

/* Expanded player: the details panels are hidden and the extras bar is tightened. */
body.cinema-expanded #world #cinema :is(.cinema-below, .chapters, .next-stop) {
  display: none;
}

body.cinema-expanded #world #cinema .player-extras {
  padding: 7px 12px;
}

/* ==========================================================================
   15. Player on narrow screens
   820 px and under: the extras bar becomes a six-column grid and the route window a compact
   strip. 620 px and under: smaller buttons. 420 px and under: stacked volume, wrapped
   transport. Dormant: the compact route strip rules target #mobile-route-slot, which is no
   longer in hyd-world.html or any script (6 Oct 2026); the phone location window is now
   #player-location-dock, laid out by hyd-player-layout.css.
   ========================================================================== */

@media (max-width: 820px) {
  /* Extras bar as a six-column grid: the action buttons span two columns each on the first
     row; volume (columns 1-3), deck launcher (4) and Riyal (5-6) share the second row. */
  html[data-theme] #world #cinema .player-extras {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
  }

  html[data-theme] #world #cinema .player-extras > :is([data-random], [data-player-return], .collection-link) {
    grid-column: span 2;
    min-width: 0;
    width: 100%;
    margin: 0;
    min-height: 36px;
    padding: 5px 6px;
    gap: 4px;
    font-size: calc(10 * var(--px));
  }

  html[data-theme] #world #cinema .journey-volume {
    grid-column: 1/4;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    min-width: 0;
    order: 0;
    font-size: calc(10 * var(--px));
  }

  html[data-theme] #world #cinema .journey-volume > span {
    flex: none;
  }

  html[data-theme] #world #cinema .journey-volume input {
    flex: 1;
    min-width: 40px;
    max-width: 105px;
    width: 100%;
  }

  html[data-theme] #world #cinema .player-extras > .deck-launch {
    grid-column: 4;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin: 0;
    order: 0;
    font-size: calc(10 * var(--px));
    padding: 5px 3px;
  }

  #world #cinema .player-extras > .hyd-cat-slot {
    grid-column: 5/7;
    grid-row: 2;
    justify-self: end;
    display: block;
    width: 88px;
    height: 44px;
    margin: 0;
    order: 0;
  }

  /* Dormant: #mobile-route-slot is no longer in the markup (6 Oct 2026); the phone location
     window is #player-location-dock (hyd-player-layout.css). Mobile route window
     (#mobile-route-slot): a 110 px strip with the map on the left (128 px) and the title and
     caption on the right. */
  html[data-theme] #world #cinema #mobile-route-slot .route-window {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    grid-template-rows: 35px 1fr;
    height: 110px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-top: 1px solid #65717f;
    border-radius: 0;
    background: #222b35;
    color: #dde5ef;
    box-shadow: none;
    overflow: hidden;
  }

  html[data-theme] #world #cinema #mobile-route-slot .route-title {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
    min-width: 0;
    padding: 5px 8px;
    border: 0;
    border-bottom: 1px solid #465362;
    border-radius: 0;
    background: #29333e;
    color: #d2dce8;
    font: calc(10 * var(--px))/1.3 var(--desktop-font);
    text-shadow: none;
  }

  html[data-theme] #world #cinema #mobile-route-slot .route-title > span {
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[data-theme] #world #cinema #mobile-route-slot .route-title button {
    min-height: 24px;
    min-width: 24px;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    font: calc(15 * var(--px))/1 var(--desktop-font);
  }

  html[data-theme] #world #cinema #mobile-route-slot #route-content {
    display: contents;
  }

  /* Dormant like the strip above (#mobile-route-slot is gone). !important on the map height:
     hyd-own-media.css and hyd-player.css fix #journey-map's height with !important, so a
     different height needs !important too. hyd-map-cleanup.css, loading later, has its own
     !important height for routes that show a caption. */
  html[data-theme] #world #cinema #mobile-route-slot #journey-map {
    grid-column: 1;
    grid-row: 1/3;
    width: 128px;
    height: 110px !important;
    min-height: 0;
    border: 0;
    border-right: 1px solid #637182;
    border-radius: 0;
  }

  html[data-theme] #world #cinema #mobile-route-slot .route-caption {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    margin: 0;
    padding: 8px 10px;
    background: transparent;
    color: #e1e7ee;
    font: calc(11 * var(--px))/1.4 var(--desktop-font);
  }

  html[data-theme] #world #cinema #mobile-route-slot .route-caption b {
    display: block;
    font: 700 calc(12 * var(--px))/1.4 var(--desktop-font);
    color: #e1e7ee;
  }

  html[data-theme] #world #cinema #mobile-route-slot #route-time {
    display: block;
    color: #9fadc0;
    font: calc(10 * var(--px))/1.3 var(--desktop-font);
  }

  html[data-theme] #world #cinema #mobile-route-slot #route-content > small {
    display: none;
  }

  html[data-theme] #world #cinema #mobile-route-slot .route-window:has(#route-content[hidden]) {
    display: block;
    height: auto;
  }
}

/* 620 px and under: smaller buttons and cat. */
@media (max-width: 620px) {
  html[data-theme] #world #cinema .player-extras {
    padding: 8px 10px;
    gap: 6px;
  }

  html[data-theme] #world #cinema .player-extras > button {
    min-height: 32px;
    font-size: calc(10 * var(--px));
    padding: 5px 7px;
  }

  #world #cinema .player-extras > .hyd-cat-slot {
    display: block;
    flex-basis: 79px;
    width: 79px;
    height: 40px;
    order: 5;
  }

  #world #cinema .hyd-cat-sprite {
    width: 40px;
    height: 38px;
  }

  #world #cinema .hyd-cat-name {
    left: 39px;
    font-size: 10px;
  }

  html[data-theme] #world #cinema .cinema-below {
    margin: 0 10px;
    padding: 13px 10px 9px;
  }

  html[data-theme] #world #cinema .pixel-toolbar {
    gap: 3px;
  }

  html[data-theme] #world #cinema .pixel-toolbar > button {
    flex-basis: 125px;
    padding: 5px;
    min-height: 44px;
  }

  html[data-theme] #world #cinema .chapters {
    margin-inline: 10px;
  }

  html[data-theme] #world #cinema .next-stop {
    margin-inline: 10px;
  }

  html[data-theme] #world #cinema .next-picture {
    width: 78px;
    flex-basis: 78px;
  }

  html[data-theme] #world #cinema .next-copy strong {
    font-size: calc(12 * var(--px));
  }

  html[data-theme] #world #cinema .transport {
    gap: 6px;
  }
}

/* 420 px and under: stacked volume, a wrapping transport, and an icon-only note button. */
@media (max-width: 420px) {
  html[data-theme] #world #cinema .journey-volume {
    display: grid;
    gap: 2px;
  }

  html[data-theme] #world #cinema .journey-volume input {
    width: 100%;
    max-width: 125px;
  }

  html[data-theme] #world #cinema .transport {
    flex-wrap: wrap;
    gap: 5px;
    padding: 6px;
  }

  html[data-theme] #world #cinema .transport .scrub-label {
    min-width: 50px;
  }

  html[data-theme] #world #cinema .transport #note-toggle {
    width: 36px;
    min-height: 44px;
    padding: 0;
    font-size: 0;
  }

  html[data-theme] #world #cinema .transport #note-toggle:after {
    content: 'ⓘ';
    font: calc(16 * var(--px)) var(--desktop-font);
  }

  html[data-theme] #world #cinema .pixel-toolbar :is(svg, .day-glyph) {
    display: none;
  }
}

/* ==========================================================================
   16. Reduced motion and the small shell bar
   The slideshow zoom and card transitions stop for visitors who prefer reduced motion or who
   turned motion off with the shell bar switch (body.motion-off).
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html[data-theme] #world #cinema #memory-photo {
    transform: none;
    transition: none;
  }
}

html[data-theme] body.motion-off #world #cinema #memory-photo {
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  #world .memory-card {
    transition: none;
  }
}

/* 440 px and under: the deck launcher in the shell bar becomes icon-only. */
@media (max-width: 440px) {
  html[data-theme] #world .shell nav button {
    gap: 3px;
  }

  html[data-theme] #world .shell .deck-launch {
    font-size: 0;
    gap: 0;
    width: 27px;
    padding: 4px;
  }
}

/* ==========================================================================
   17. Photos / recordings mode switch
   A two-button segmented control; aria-pressed marks the active mode. It appears in the Start
   here window, the memory tool bars and the player.
   ========================================================================== */

/* Two media modes, presented as period toolbar segments rather than new cards. */
html[data-theme] #world .memory-mode-switch {
  display: inline-flex;
  align-items: stretch;
  flex: none;
  gap: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid #81848b;
  border-radius: 3px;
  background: #c7c9cd;
  box-shadow: 0 1px #ffffff65;
  overflow: hidden;
  vertical-align: middle;
}

/* Each segment rule is listed twice: generally, and again under #area / #places so it
   matches the specificity of the tool-bar button rules there (#area > .memory-tools
   :is(select, button)); being later, these win. */
html[data-theme] #world .memory-mode-switch > button,
html[data-theme] #world :is(#area, #places) .memory-mode-switch > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 77px;
  min-height: 30px;
  margin: 0;
  padding: 4px 10px;
  border: 0;
  border-right: 1px solid #979ba3;
  border-radius: 0;
  background: linear-gradient(#f5f5f6, #d2d4d8);
  color: #343941;
  box-shadow: inset 0 1px #fff8;
  font: calc(11 * var(--px))/1.3 var(--desktop-font);
  letter-spacing: 0;
  text-shadow: 0 1px #fff7;
  transform: none;
}

html[data-theme] #world .memory-mode-switch > button:last-child,
html[data-theme] #world :is(#area, #places) .memory-mode-switch > button:last-child {
  border-right: 0;
}

html[data-theme] #world .memory-mode-switch > button:hover,
html[data-theme] #world :is(#area, #places) .memory-mode-switch > button:hover {
  background: #e9edf2;
}

html[data-theme] #world .memory-mode-switch > button[aria-pressed='true'],
html[data-theme] #world :is(#area, #places) .memory-mode-switch > button[aria-pressed='true'] {
  background: linear-gradient(#66788d, #4d6076);
  color: #fff;
  border-color: #435368;
  box-shadow: inset 0 1px 3px #16243166;
  text-shadow: 0 1px #203044;
}

html[data-theme] #world .memory-mode-switch > button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #abcce9;
  outline-offset: -3px;
}

html[data-theme] #world .memory-mode-switch > button:disabled {
  opacity: 0.55;
  cursor: default;
}

html[data-theme] #world .memory-mode-switch svg {
  width: 18px;
  height: 18px;
  flex: none;
  filter: none;
}

/* Placement inside the Start here window. */
html[data-theme] #world #home .entry-choices {
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 10px;
}

html[data-theme] #world #home .entry-choices > .memory-mode-switch {
  grid-column: 1/-1;
  justify-self: center;
  align-self: start;
}

/* Player mode bar: a 32 px strip with the switch and a one-line note. */
html[data-theme] #world #cinema .player-modebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 12px;
  height: 32px;
  min-height: 32px;
  padding: 2px 7px;
  border-top: 1px solid #fff8;
  border-bottom: 1px solid #6c7682;
  background: linear-gradient(#cfd3d8, #b9c0c8);
  color: #35404c;
  font: calc(10 * var(--px))/1.3 var(--desktop-font);
}

html[data-theme] #world #cinema .player-modebar .memory-mode-switch > button {
  min-height: 25px;
  min-width: 73px;
  padding: 2px 8px;
  font-size: calc(10 * var(--px));
}

html[data-theme] #world #cinema .player-modebar .memory-mode-switch svg {
  width: 16px;
  height: 16px;
}

html[data-theme] #world #cinema #playback-mode-note {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #3e4956;
  font: calc(10 * var(--px))/1.3 var(--desktop-font);
}

/* Placement inside the memory tool bars. */
html[data-theme] #world .memory-tools > .memory-mode-switch {
  align-self: center;
}

/* Phone: tighter spacing and a smaller note. */
@media (max-width: 620px) {
  html[data-theme] #world #home .entry-choices {
    row-gap: 8px;
  }

  html[data-theme] #world #home .entry-choices > .memory-mode-switch {
    margin-top: 3px;
  }

  html[data-theme] #world #cinema .player-modebar {
    gap: 8px;
    padding-inline: 5px;
  }

  html[data-theme] #world #cinema #playback-mode-note {
    font-size: calc(9 * var(--px));
  }
}

/* ==========================================================================
   18. Minimum hit areas
   Small system controls keep their look but never fall below a 24 px press area.
   ========================================================================== */

/* Keep small system controls recognisable while giving them a usable hit area. */
/* !important keeps the close buttons (min size) and the checkboxes and radios (exact size)
   at 24 px even where a component sheet sets something smaller. */
html[data-theme]
  body
  :is(
    dialog button[aria-label^='close' i],
    dialog button[aria-label^='hide' i],
    .finder-close,
    .uturn-close,
    [data-pn-close]
  ) {
  min-width: 24px !important;
  min-height: 24px !important;
  box-sizing: border-box;
}

html[data-theme] body :is(input[type='checkbox'], input[type='radio']) {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px;
  min-height: 24px;
  flex: none;
  vertical-align: middle;
  box-sizing: border-box;
}

html[data-theme] body summary {
  min-height: 24px;
  box-sizing: border-box;
  align-content: center;
}

html[data-theme] body input[type='range'] {
  min-height: 24px;
  box-sizing: border-box;
}

/* At least 24px press areas for small text actions, invisible: "back to the map" and start-here "browse all places". */
html[data-theme] #world #area .area-top .text-button {
  position: relative;
}

html[data-theme] #world #area .area-top .text-button::after {
  content: '';
  position: absolute;
  inset: -3px 0;
}

#home .visual-entry .finder-all-areas {
  position: relative;
}

#home .visual-entry .finder-all-areas::after {
  content: '';
  position: absolute;
  inset: 0 0 -1px;
}
