/* Desktop styles (moved out of index.html so browsers can cache them and the CSP needs no inline hashes). */
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
/* Stand-in for Lucida Grande where it isn't installed (Windows, Linux, Android). Macs use the
   real "Lucida Grande", which comes first in every stack. Otherwise prefer a real Lucida
   already on the machine (Lucida Sans Unicode ships with Windows; Lucida Sans Demibold with
   Office), then Lunasima, an OFL font made as a metric-compatible Lucida Grande fallback
   (subset to Latin + UI symbols; licence: ../assets/fonts/lunasima-OFL.txt). This replaces
   the browser's smeared fake bold in menu titles, window titles and labels. */
@font-face {
  font-family: "Lucida Grande Web";
  src: local("Lucida Sans Unicode"), local("LucidaSansUnicode"), local("Lucida Sans Regular"), local("LucidaSans"),
       url("../assets/fonts/lunasima-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Lucida Grande Web";
  src: local("Lucida Sans Demibold Roman"), local("LucidaSans-Demi"),
       url("../assets/fonts/lunasima-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --aqua-blue: #1f73df;
  --aqua-sel: #3875d7;
  --aqua-stripe: #edf3fe;
  --ink: #1a1a1a;
  --muted: #52565e;
  --aqua-sel-list: #3a81e0;
  /* Panther pinstripe: 4px period, nearly invisible (sampled 10.3 TextEdit toolbar) */
  --pinstripe-bg: repeating-linear-gradient(180deg, #ececec 0 2px, #f0f0f0 2px 4px);
  /* Panther titlebars have no pinstripes: a smooth #f9f9f9 -> #cacaca gradient */
  --titlebar-active: linear-gradient(180deg, #f9f9f9 0%, #e6e6e6 20%, #d9d9d9 60%, #cacaca 100%);
  --titlebar-idle: linear-gradient(180deg, #f6f6f6 0%, #eeeeee 50%, #e4e4e4 100%);
  /* Neutral grey brushed metal with fine horizontal grain (no blue tint) */
  --metal:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0.13'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0 1px, rgba(0, 0, 0, 0.035) 1px 2px, rgba(255, 255, 255, 0) 2px 3px),
    linear-gradient(180deg, #d2d2d2 0%, #c1c1c1 8%, #bdbdbd 60%, #b4b4b4 100%);
  --ui-font: "Lucida Grande", "Lucida Grande Web", Geneva, Verdana, sans-serif;
  --mono: Monaco, "Lucida Console", monospace;
  --menubar-h: 22px;
}

* { box-sizing: border-box; }

html {
  background: #2462ae;
}
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 12px;
  line-height: 1.45;
  overflow-x: hidden;
}
body {
  background: transparent;
  position: relative;
  z-index: 0;
  padding-bottom: 92px;
}

/* Panther (10.3) default desktop: Aqua Blue */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #2462ae;
  /* Original vector approximation of the 10.3 "Aqua Blue" ribbons: pale leaf from the upper left with a rounded tip, diagonal streaks from the upper right, a broad lobe at the lower right (not Apple's bitmap) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='1' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%236aa9dc'/%3E%3Cstop offset='.3' stop-color='%234f8fcc'/%3E%3Cstop offset='.62' stop-color='%233272b8'/%3E%3Cstop offset='1' stop-color='%23163f82'/%3E%3C/linearGradient%3E%3CradialGradient id='n' cx='0' cy='1' r='.8'%3E%3Cstop offset='0' stop-color='%230b2a5e' stop-opacity='.85'/%3E%3Cstop offset='.6' stop-color='%230b2a5e' stop-opacity='.25'/%3E%3Cstop offset='1' stop-color='%230b2a5e' stop-opacity='0'/%3E%3C/radialGradient%3E%3ClinearGradient id='leaf' x1='0' y1='0' x2='1' y2='.35'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.34'/%3E%3Cstop offset='.45' stop-color='%23d8f0ff' stop-opacity='.2'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3ClinearGradient id='lobe' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.12'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.02'/%3E%3C/linearGradient%3E%3Cfilter id='s1' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeGaussianBlur stdDeviation='5'/%3E%3C/filter%3E%3Cfilter id='s2' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeGaussianBlur stdDeviation='1.6'/%3E%3C/filter%3E%3Cfilter id='s3' x='-50%25' y='-50%25' width='200%25' height='200%25'%3E%3CfeGaussianBlur stdDeviation='40'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='1600' height='1000' fill='url(%23b)'/%3E%3Cpath d='M0 330C160 420 300 540 430 660L380 1000H0Z' fill='%230b2a5e' opacity='.35' filter='url(%23s3)'/%3E%3Crect width='1600' height='1000' fill='url(%23n)'/%3E%3Cpath d='M510 170C700 200 900 120 1040 0H1600V140C1300 260 1000 420 760 560C620 640 480 690 430 625C385 560 420 330 510 170Z' fill='url(%23leaf)' filter='url(%23s1)'/%3E%3Cpath d='M940 1000C900 820 985 645 1150 592C1300 546 1480 540 1600 560V1000Z' fill='url(%23lobe)' filter='url(%23s1)'/%3E%3Cg fill='none' stroke='%23fff' filter='url(%23s2)'%3E%3Cpath d='M548 0C532 62 518 120 510 170C448 292 402 500 430 625' stroke-opacity='.42' stroke-width='2.4'/%3E%3Cpath d='M510 170C700 200 900 120 1040 0' stroke-opacity='.22' stroke-width='1.6'/%3E%3Cpath d='M1500 0C1220 230 920 430 700 645' stroke-opacity='.4' stroke-width='1.6'/%3E%3Cpath d='M1420 0C1150 215 880 405 680 600' stroke-opacity='.26' stroke-width='1.1'/%3E%3Cpath d='M1570 25C1310 255 1010 470 760 665' stroke-opacity='.3' stroke-width='1.3'/%3E%3Cpath d='M1600 90C1360 290 1080 500 840 690' stroke-opacity='.18' stroke-width='1'/%3E%3Cpath d='M940 1000C900 820 985 645 1150 592C1300 546 1480 540 1600 560' stroke-opacity='.3' stroke-width='3'/%3E%3Cpath d='M150 0C200 140 260 300 330 450' stroke-opacity='.05' stroke-width='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}
body.wp-shinjuku::before {
  background:
    linear-gradient(180deg, rgba(16, 20, 28, 0.35), rgba(10, 14, 20, 0.52)),
    url("../assets/ig/post-07-tokyo-vip-sedan.jpg") center / cover no-repeat;
  filter: grayscale(100%) contrast(1.08);
}
body.wp-graphite::before {
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(160deg, #5d6673 0%, #3a414b 60%, #2d323a 100%);
}

/* Panther menu bar: 22px (21 rows + 1px #ababab line), faint pinstripe, rounded top corners */
.osx-menubar {
  position: sticky;
  top: 0;
  z-index: 950;
  height: var(--menubar-h);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0 2px, rgba(255, 255, 255, 0) 2px 4px),
    linear-gradient(180deg, #fafafa 0%, #e5e5e5 100%);
  border-bottom: 1px solid #ababab;
  border-radius: 5px 5px 0 0;
  padding: 0 6px 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}
.menu-left, .menu-right {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  height: 100%;
}
.apple-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 21px;
  border: 0;
  background: transparent;
  cursor: default;
}
.menu-item, .menu-app-name {
  background: transparent;
  border: 0;
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 21px;
  color: #000;
  padding: 0 10px;
  height: 21px;
  cursor: default;
  white-space: nowrap;
}
.menu-app-name { font-weight: 700; }
/* Mac menus highlight only while open, never on plain hover */
.menu-drop-wrap.open > .menu-item,
.menu-drop-wrap.open > .apple-mark {
  background: linear-gradient(180deg, #6aa7f0 0%, #3f82e2 50%, #2e72d6 51%, #3b84e6 100%);
  color: #fff;
}
.menu-drop-wrap.open > .apple-mark svg { filter: brightness(0) invert(1); }
.menu-extra {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #000;
  padding: 0 8px;
  height: 21px;
  white-space: nowrap;
}

/* Full-screen Desktop Workspace (1440p+ edge-to-edge) */
.osx-desktop {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 118px);
}
/* Desktop widths: the screen never scrolls. The menu bar is pinned, the desktop is
   exactly the screen below it, and windows are kept inside it by the window manager. */
@media (min-width: 961px) {
  html, body { height: 100%; overflow: hidden; }
  body { padding: var(--menubar-h) 0 0; }
  .osx-menubar { position: fixed; top: 0; left: 0; right: 0; }
  .osx-desktop { height: calc(100vh - var(--menubar-h)); min-height: 0; overflow: clip; }
}

/* Until the script's first tiling pass the windows sit untiled at the top-left: keep them,
   the desktop icons, stickies and the placeholder clock hidden for that moment. The delayed
   animation reveals everything anyway if the script never gets there. */
html:not(.booted) .osx-win, html:not(.booted) .desktop-icons, html:not(.booted) .stk-layer, html:not(.booted) #osx-clock {
  visibility: hidden;
  animation: boot-reveal 0s linear 2.5s forwards;
}
@keyframes boot-reveal { to { visibility: visible; } }

/* Right-Edge Mac OS X Desktop Icons */
.desktop-icons {
  position: absolute;
  top: 14px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
  width: 114px;
}
.desk-icon {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-family: var(--ui-font);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 2px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.desk-icon svg {
  width: 48px;
  height: 48px;
  padding: 2px;
  box-sizing: content-box;
  border-radius: 4px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}
.desk-icon span {
  font-weight: 700; /* Panther desktop labels are bold white (GUIdebook desktop/empty) */
  padding: 0 6px;
  border-radius: 8px;
  max-width: 100%;
  overflow-wrap: break-word;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  line-height: 1.3;
}
.desk-icon:focus { outline: none; }
/* Panther selection: a dark rounded box behind the icon plus a blue pill behind the name (no hover highlight) */
/* (Ars Technica 10.3 review, "Selected in Panther": darker box, pale 1px rim, ~4px inset).
   The rim is an inset shadow and the padding grows by margin trade, so nothing shifts. */
.desk-icon.selected svg {
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  padding: 4px;
  margin: -2px;
  border-radius: 5px;
}
.desk-icon.selected span { background: #3875d7; text-shadow: none; }
.desk-icon:focus-visible span { outline: 1px dotted #fff; }

/* Early-2000s Mac OS X Window Chrome */
.osx-win {
  position: absolute;
  /* Aqua windows: rounded top, square bottom; a light edge, the soft shadow defines the window */
  border-radius: 5px 5px 0 0;
  border: 1px solid rgba(0, 0, 0, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  background: var(--pinstripe-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.osx-win.metal {
  background: var(--metal);
  border-color: rgba(0, 0, 0, 0.42);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 #f3f3f3;
}
.osx-win.focused {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.osx-win.metal.focused {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 #f3f3f3;
}
.osx-win.anim-snap {
  transition: left 0.24s cubic-bezier(0.22, 1, 0.36, 1), top 0.24s cubic-bezier(0.22, 1, 0.36, 1), width 0.24s ease;
}
.osx-win.closed { display: none; }
/* Minimized into the Dock (genie): the window keeps its geometry but is not drawn */
.osx-win.minimized { visibility: hidden; pointer-events: none; }
.osx-win.genie-anim { visibility: visible; z-index: 945 !important; will-change: transform, clip-path; pointer-events: none; }

/* Resize handles: right / left / bottom edges + bottom corners (grow box lives in .win-rz-se) */
.win-rz {
  position: absolute;
  z-index: 6;
  touch-action: none;
}
.win-rz-e { top: 22px; right: 0; bottom: 14px; width: 6px; cursor: ew-resize; }
.win-rz-w { top: 22px; left: 0; bottom: 14px; width: 6px; cursor: ew-resize; }
.win-rz-s { left: 14px; right: 14px; bottom: 0; height: 6px; cursor: ns-resize; }
.win-rz-sw { left: 0; bottom: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.win-rz-se { right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.win-rz-se::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' aria-hidden='true' shape-rendering='crispEdges'%3E%3Cpath d='M2 10h1v1h-1zM3 9h1v1h-1zM4 8h1v1h-1zM5 7h1v1h-1zM6 6h1v1h-1zM7 5h1v1h-1zM8 4h1v1h-1zM9 3h1v1h-1zM10 2h1v1h-1zM11 1h1v1h-1zM6 10h1v1h-1zM7 9h1v1h-1zM8 8h1v1h-1zM9 7h1v1h-1zM10 6h1v1h-1zM11 5h1v1h-1zM10 10h1v1h-1zM11 9h1v1h-1z' fill='%23fff' fill-opacity='.85'/%3E%3Cpath d='M1 10h1v1h-1zM2 9h1v1h-1zM3 8h1v1h-1zM4 7h1v1h-1zM5 6h1v1h-1zM6 5h1v1h-1zM7 4h1v1h-1zM8 3h1v1h-1zM9 2h1v1h-1zM10 1h1v1h-1zM5 10h1v1h-1zM6 9h1v1h-1zM7 8h1v1h-1zM8 7h1v1h-1zM9 6h1v1h-1zM10 5h1v1h-1zM9 10h1v1h-1zM10 9h1v1h-1z' fill='%23878787'/%3E%3C/svg%3E") no-repeat;
  pointer-events: none;
}
body.is-resizing, body.is-resizing * { user-select: none !important; }

/* Panther titlebar: 22px smooth gradient (no pinstripes) with a 1px #8c8c8c base line */
.osx-titlebar {
  height: 22px;
  flex: 0 0 22px;   /* never squeezed by a tall window body (iPhoto/Safari shrank to 16-19px) */
  min-height: 22px;
  padding: 0 7px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--titlebar-idle);
  border-bottom: 1px solid #a5a5a5;
  cursor: default;
  user-select: none;
  touch-action: none;
}
.osx-win.focused .osx-titlebar {
  background: var(--titlebar-active);
  border-bottom-color: #8c8c8c;
}
/* Metal: titlebar, toolbar and bottom bar are one seamless surface */
.osx-win.metal .osx-titlebar {
  background: transparent;
  border-bottom: 0;
}

/* Authentic 3D Glossy Aqua Gel Traffic Lights */
.aqua-lights {
  display: flex;
  align-items: center;
  gap: 7px;
}
/* ===== Panther (10.3) Aqua titlebar buttons: 14px gel lozenges =====
   Checked against pixel crops of 10.3 TextEdit + System Preferences windows
   (guidebookgallery.org): dark rim on top and sides that fades out at the
   bottom, a small white specular cap in the top 2-3 rows, a deep core and a
   bright glow pooling at the bottom. Real pitch is 21px, so pair this with
   `.aqua-lights { gap: 7px; }`. */
.aq-dot {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #3a0a0c;
  border-top-color: #141010;
  padding: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  font: 900 10px/1 "Lucida Grande", "Helvetica Neue", Arial, sans-serif;
  color: transparent;
  text-shadow: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 0.5px rgba(0, 0, 0, 0.1);
}
/* specular cap: narrow, top 2-3 rows only */
.aq-dot::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 0.5px;
  height: 4px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.6) 60%, rgba(255, 255, 255, 0.1) 100%);
  pointer-events: none;
}
/* bottom glow */
.aq-dot::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 0;
  height: 6px;
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  background: radial-gradient(ellipse 70% 80% at 50% 100%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 75%);
  pointer-events: none;
}
.aq-close {
  border-color: #4f1013;
  border-top-color: #160c0c;
  border-bottom-color: #8e4c48;
  background: linear-gradient(180deg, #a6302b 0%, #8b170e 30%, #8f1c11 45%, #c4392f 62%, #ef7a70 78%, #f9aca2 92%, #e7a39a 100%);
}
.aq-min {
  border-color: #6b2414;
  border-top-color: #241011;
  border-bottom-color: #a08a3a;
  background: linear-gradient(180deg, #b8663a 0%, #d88517 28%, #eb9918 42%, #fbb93f 58%, #fdd96a 72%, #fff583 88%, #f0e27a 100%);
}
.aq-zoom {
  border-color: #1d3a15;
  border-top-color: #121512;
  border-bottom-color: #6a8a3e;
  background: linear-gradient(180deg, #4d8a3a 0%, #559b19 28%, #6aab1c 42%, #8fcd47 58%, #b2eb6d 72%, #cdff88 88%, #b7e07c 100%);
}
/* hover glyphs (the × – + text is already in the markup) */
.osx-titlebar:hover .aq-close { color: rgba(75, 4, 2, 0.85); }
.osx-titlebar:hover .aq-min { color: rgba(110, 50, 0, 0.85); }
.osx-titlebar:hover .aq-zoom { color: rgba(18, 60, 6, 0.85); }
/* pressed: the gel darkens */
.aq-dot:active { filter: brightness(0.78) saturate(1.1); }

/* inactive window: clear grey gel (lighter than graphite; matches 10.3 disabled/inactive crops) */
.osx-win:not(.focused) .aq-dot {
  border-color: #8a8a8a;
  border-top-color: #6e6e6e;
  border-bottom-color: #a8a8a8;
  background: linear-gradient(180deg, #cfcfcf 0%, #c6c6c6 30%, #cdcdcd 45%, #dcdcdc 62%, #ebebeb 80%, #f6f6f6 92%, #e6e6e6 100%);
}
.osx-win:not(.focused) .aq-dot::before { opacity: 0.7; }
/* A disabled title-bar button (zoom on small screens) is the clear grey gel and does nothing */
.osx-win .aq-dot:disabled {
  border-color: #8a8a8a;
  border-top-color: #6e6e6e;
  border-bottom-color: #a8a8a8;
  background: linear-gradient(180deg, #cfcfcf 0%, #c6c6c6 30%, #cdcdcd 45%, #dcdcdc 62%, #ebebeb 80%, #f6f6f6 92%, #e6e6e6 100%);
  color: transparent !important;
  cursor: default;
}
.osx-win:not(.focused) .osx-titlebar:hover .aq-dot { color: rgba(40, 40, 40, 0.7); }

/* Panther centres the title across the whole title bar (not in the space left over after
   the traffic lights), so it sits on the window's centre line; it is laid over the bar and
   lets clicks through to it, and long titles still stop short of the buttons. */
.osx-titlebar { position: relative; }
.osx-title {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 76px;
  right: 76px;
  pointer-events: none;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  color: #000;
  /* block (not centred flex) so a title wider than the bar ends in an ellipsis instead of
     spilling off both sides */
  display: block;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.osx-title > .proxy-ico { vertical-align: -3px; margin-right: 5px; }
.osx-win:not(.focused) .osx-title {
  color: #7a7a7a;
}

/* ===== Panther toolbar-toggle pill (.aqua-lozenge): 20x10 clear gel =====
   From a 10.3 System Preferences crop: mid-grey top rim, dark sides,
   near-black bottom rim; light top row, mid-grey band, near-white low down. */
.aqua-lozenge {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 20px;
  height: 10px;
  padding: 0;
  border-radius: 99px;
  border: 1px solid #3a3a3a;
  border-top-color: #858585;
  border-bottom-color: #1b1b1b;
  background: linear-gradient(180deg, #e6e6e6 0%, #d2d2d2 22%, #c8c8c8 40%, #e8e8e8 55%, #fbfbfb 72%, #f4f4f4 88%, #d8d8d8 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
/* at the far right of the title bar (10.3 Finder Search Results shot, GUIdebook) */
.osx-titlebar > .aqua-lozenge { grid-column: 3; justify-self: end; }
.aqua-lozenge:active {
  background: linear-gradient(180deg, #b4b4b4 0%, #a2a2a2 22%, #9a9a9a 40%, #bcbcbc 55%, #d2d2d2 72%, #cacaca 88%, #b0b0b0 100%);
}

.osx-body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
/* Fixed chrome rows never shrink; the one content region per window flexes + scrolls */
.osx-body > * { flex-shrink: 0; }
.osx-body > .win-fill {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Aqua push button: clear (white) gel capsule; only a window's default button is blue */
.aqua-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 21px;
  padding: 1px 14px 2px;
  border-radius: 99px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: default;
  color: #000;
  border: 1px solid #6f6f6f;
  border-top-color: #8a8a8a;
  border-bottom-color: #4f4f4f;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 45%, #e1e1e1 50%, #ededed 75%, #ffffff 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}
.aqua-btn:active {
  background: linear-gradient(180deg, #d6d6d6 0%, #c8c8c8 45%, #b7b7b7 50%, #c6c6c6 75%, #dedede 100%);
}
.aqua-btn.silver { color: #000; }
.aqua-btn.default {
  color: #000;
  border-color: #1f4e9a;
  border-top-color: #3a6bb5;
  border-bottom-color: #173e7c;
  background: linear-gradient(180deg, #d4e8fd 0%, #93c3f4 30%, #5ea2ec 50%, #3d8ae5 51%, #6cb2f5 80%, #b5ddff 100%);
}
.aqua-btn.small { font-size: 11px; min-height: 17px; padding: 0 10px 1px; }

/* Sunken White Content Well */
.aqua-well {
  background: #ffffff;
  border: 1px solid #9b9ea5;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* Resize Grip (bottom right) */
.osx-statusbar {
  height: 20px;
  padding: 0 22px 0 10px;
  font-size: 10.5px;
  color: #44474c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #b5b5b5;
  background: linear-gradient(180deg, #f1f1f1 0%, #dedede 100%);
  position: relative;
}
.osx-win.metal .osx-statusbar {
  background: transparent;
  border-top: 0;
  justify-content: center;
  font-size: 11px;
  color: #000;
}

/* 1. TextEdit: About_Erik.rtf
   10.3 ruler (guidebookgallery texteditor/macosx103.png): Styles popup, alignment
   segment, Spacing popup, a right-aligned tab well; under it a ruler numbered in
   inches with a tab stop every half inch. The text area is white to the window
   edges with a permanent scroller; no status bar. */
.textedit-ruler {
  font-size: 11px;
  color: #000;
  background: var(--pinstripe-bg);
  border-bottom: 1px solid #8c8c8c;
  overflow: hidden;
}
.te-row { display: flex; align-items: center; gap: 6px; padding: 3px 6px 2px; height: 24px; }
.te-pop {
  position: relative; display: inline-flex; align-items: center; flex-shrink: 0;
  height: 18px; padding: 0 24px 0 9px; border-radius: 5px;
  border: 1px solid #7b7b7b; border-bottom-color: #555;
  background: linear-gradient(180deg, #fff 0%, #f1f1f1 45%, #e2e2e2 50%, #f0f0f0 80%, #fff 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  font-size: 11px; line-height: 16px; overflow: hidden;
}
.te-pop i {
  position: absolute; right: 0; top: 0; bottom: 0; width: 17px; border-left: 1px solid #2d5fa6;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 6'%3E%3Cpath d='M0 0h8L4 5z' fill='%23000'/%3E%3C/svg%3E") 50% 55% / 7px 5px no-repeat,
    linear-gradient(180deg, #cfe5fc 0%, #8dbff3 45%, #5a9cea 50%, #79b5f2 80%, #b9dcfd 100%);
}
.te-tabwell {
  margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center;
  height: 15px; padding: 0 8px; border-radius: 99px;
  border: 1px solid #8a8a8a; background: linear-gradient(180deg, #fafafa, #e4e4e4);
}
.te-tabwell svg { display: block; width: 58px; height: 10px; }
.te-ruler {
  position: relative; height: 20px; margin: 0 0 0 6px; overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 7'%3E%3Cpath d='M1 0l5 3.5L1 7z' fill='%23000'/%3E%3C/svg%3E") 33px 1px / 36px 7px repeat-x,
    linear-gradient(90deg, #000 0 1px, transparent 1px) 0 100% / 72px 9px repeat-x,
    linear-gradient(90deg, #000 0 1px, transparent 1px) 36px 100% / 72px 6px repeat-x,
    linear-gradient(90deg, #555 0 1px, transparent 1px) 0 100% / 9px 3px repeat-x;
  border-bottom: 1px solid #8c8c8c;
}
.te-ruler span { position: absolute; bottom: 1px; margin-left: 3px; font-size: 9px; line-height: 9px; }
.te-ruler-ctrls { display: inline-flex; border: 1px solid #5e7fb2; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.te-al {
  width: 18px; height: 14px; display: block;
  background: linear-gradient(180deg, #fdfdfd, #dfe1e5);
  border-left: 1px solid #b4b7bd;
  background-repeat: no-repeat;
}
.te-al:first-child { border-left: 0; }
.te-al.on { background-color: #8dbff3; background-image: linear-gradient(180deg, #cfe5fc 0%, #8dbff3 45%, #5a9cea 50%, #79b5f2 80%, #b9dcfd 100%); }
.te-al::before {
  content: ""; display: block; margin: 3px auto 0; width: 10px; height: 8px;
  background: repeating-linear-gradient(180deg, #333 0 1px, transparent 1px 2.33px);
}
.te-al-l::before { -webkit-mask: linear-gradient(90deg, #000 70%, transparent 70%); mask: linear-gradient(90deg, #000 70%, transparent 70%); }
.te-al-c::before { width: 8px; }
.te-al-r::before { -webkit-mask: linear-gradient(270deg, #000 70%, transparent 70%); mask: linear-gradient(270deg, #000 70%, transparent 70%); }
.osx-body > .textedit-doc {
  background: #fff;
  padding: 6px 10px 12px 8px;
  overflow-y: scroll;
}
.proxy-ico { width: 16px; height: 16px; flex: 0 0 auto; }
/* Portrait spans half the About_Erik.rtf window's width; name, status and bio sit beside it */
#win-textedit { container-type: inline-size; container-name: textedit; }
.te-header {
  display: grid;
  grid-template-columns: 50cqw minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 11px;
}
.te-intro { min-width: 0; align-self: end; } /* bio ends level with the bottom of the portrait */
/* Ruler hidden by default (TextEdit: Format > Text > Hide Ruler) to give the portrait room */
#win-textedit.te-noruler .textedit-ruler { display: none; }
.te-intro .te-online { display: flex; width: max-content; margin: 4px 0 10px; }
.te-intro .te-prose { margin: 0; }
.te-photo {
  border: 1px solid #888;
  padding: 3px;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}
.te-photo img {
  display: block;
  width: 100%;
  height: auto; /* the width/height attributes only reserve the space */
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.te-name {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 27px;
  line-height: 1;
  white-space: nowrap;
  margin: 0 0 4px;
  color: #111;
}
.te-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e9f5e6;
  border: 1px solid #75b868;
  color: #1e6113;
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 99px;
}
button.te-online { font: inherit; font-size: 10.5px; cursor: pointer; }
button.te-online:hover { background: #dcefd7; }
button.te-online:active { background: #cbe6c4; }
button.te-online:focus { outline: none; }
button.te-online:focus-visible { box-shadow: 0 0 0 2px #7fb2ff; }
button.te-online:disabled { cursor: default; color: #1e6113; background: #e9f5e6; }
#te-email { color: #0b4fd0; text-decoration: none; }
#te-email:hover { text-decoration: underline; }
.te-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ab620;
  display: block;
}
.te-prose {
  margin: 0 0 10px;
  color: #242629;
  font-size: 12px;
}
.te-headline {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: #111;
}
.aqua-kv-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #b8bdc6;
  font-size: 11.5px;
}
.aqua-kv-table tr:nth-child(odd) { background: #ffffff; }
.aqua-kv-table tr:nth-child(even) { background: var(--aqua-stripe); }
.aqua-kv-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #dce1ea;
}
.aqua-kv-table td.k {
  width: 82px;
  font-weight: 700;
  color: #36393f;
  border-right: 1px solid #dce1ea;
}

/* 2. iTunes 4 */
/* ---------- iTunes 4 window shell (sits inside .osx-body) ---------- */
.pst-win {
  --pst-font: "Lucida Grande", "Lucida Grande Web", "Inter", system-ui, -apple-system, sans-serif;
  --pst-sel: #3875d7;
  --pst-stripe: #edf3fe;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  font-family: var(--pst-font);
  color: #1a1a1a;
}

/* top metal bar: transport | LCD | search */
.pst-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 7px;
}
.pst-transport { display: flex; align-items: center; gap: 4px; }
.pst-vol {
  width: 62px;
  height: 4px;
  margin-left: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7d828a, #b9bdc4);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.35);
  position: relative;
}
.pst-vol::after {
  content: "";
  position: absolute;
  left: 40px;
  top: -4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid #6d7178;
  background: radial-gradient(circle at 50% 30%, #fff, #c9ccd2);
}


.pst-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: #2b2b2b;
}
.pst-search input {
  width: 150px;
  height: 19px;
  padding: 0 8px 0 20px;
  border-radius: 10px;
  border: 1px solid #7b7f86;
  font: 11px var(--pst-font);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='5' cy='5' r='3.4' fill='none' stroke='%23555' stroke-width='1.4'/%3E%3Cpath d='M7.5 7.5l3 3' stroke='%23555' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 6px 50% / 11px 11px no-repeat,
    #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  outline: none;
}
.pst-search input:focus { box-shadow: 0 0 0 2px #7aa7e8, inset 0 1px 2px rgba(0, 0, 0, 0.25); }

/* middle: source list + song list / visualizer */
.pst-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 8px;
  padding: 0 10px;
}
.pst-source {
  background: #fff;
  border: 1px solid #8e9198;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  overflow: auto;
  font-size: 11px;
}
.pst-source-hd {
  height: 17px;
  padding: 0 7px;
  font-size: 11px;
  line-height: 16px;
  background: linear-gradient(180deg, #fbfbfb 0%, #e9e9e9 50%, #dcdcdc 51%, #ebebeb 100%);
  border-bottom: 1px solid #a2a5ab;
}
.pst-source ul { list-style: none; margin: 0; padding: 2px 0; }
.pst-source li {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 6px;
  white-space: nowrap;
  cursor: default;
}
.pst-source li svg { flex: 0 0 auto; width: 15px; height: 15px; display: block; }
.pst-source li.sel { background: var(--pst-sel); color: #fff; }

/* bottom bar */
.pst-bottom {
  height: 34px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: #33363b;
}
.pst-bottom .pst-sq-row { display: flex; gap: 5px; }
.pst-sq {
  width: 25px;
  height: 21px;
  padding: 0;
  border: 1px solid #72767d;
  border-radius: 4px;
  background: linear-gradient(180deg, #fdfdfd 0%, #dfe1e5 55%, #c9ccd1 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.pst-sq svg { display: block; width: 13px; height: 11px; }
.pst-status { text-align: center; }
/* These rules adapt the iTunes 4 shell to the playable Library and the desktop window manager. */
#win-itunes .osx-body { container: itunes / inline-size; }
#win-itunes .osx-body > .pst-win { flex: 1 1 auto; min-height: 0; height: auto; overflow: hidden; }
#win-itunes:not(.sized) .pst-main { height: 300px; }
#win-itunes .pst-main { grid-template-columns: clamp(108px, 27%, 148px) minmax(0, 1fr); }
/* the Source list widens to give the Visualizer the video's shape only while it shows (fitItunesVisualizer) */
#win-itunes .pst-win[data-vis="on"] .pst-main { grid-template-columns: var(--it-src-w, clamp(108px, 27%, 148px)) minmax(0, 1fr); }
#win-itunes .pst-top { grid-template-columns: auto minmax(0, 1fr) auto; }
#win-itunes .itunes-lcd { justify-self: center; width: min(100%, 380px); }
#win-itunes .pst-win { --pst-font: var(--ui-font); --pst-sel: var(--aqua-sel-list); }
/* Compact iTunes (next to the Buddy List): narrower Source list, no Browse button, short search field */
@container itunes (max-width: 600px) {
  #win-itunes .pst-top { gap: 8px; padding: 6px 8px 7px; }
  #win-itunes .it-browse { display: none; }
  #win-itunes .pst-search input { width: 96px; }
  #win-itunes .pst-main { gap: 6px; padding: 0 8px; }
  #win-itunes .it-art { height: 84px; }
  #win-itunes .pst-bottom { padding: 0 8px; gap: 6px; }
  #win-itunes .pst-bottom .pst-sq-row { gap: 3px; }
}
/* iTunes 4 Visualizer: replaces the song list (the Source list stays). Black pane; the
   w1red music video plays in it, songs get a canvas visual. Toggled by the bottom-right button. */
.it-vis { display: none; position: relative; min-width: 0; min-height: 0; background: #000; border: 1px solid #5d6066; overflow: hidden; }
.pst-win[data-vis="on"] .it-vis { display: block; }
.pst-win[data-vis="on"] .it-lib { display: none; }
.it-vis video, .it-vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.it-vis video { object-fit: contain; }
.it-vis canvas { image-rendering: auto; }
.it-vis[data-mode="audio"] video, .it-vis[data-mode="video"] canvas { display: none; }
.it-vis-info {
  position: absolute; left: 10px; top: 8px; right: 10px; color: #fff; font: 11px/1.35 var(--ui-font);
  text-shadow: 0 1px 2px #000; opacity: 0; transition: opacity 0.8s; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.it-vis-info.show { opacity: 1; }
.it-vis-info b { display: block; font-size: 12px; font-weight: 700; }
button.pst-sq { cursor: pointer; font: inherit; color: inherit; }
.pst-sq.on, button.pst-sq:active { background: linear-gradient(180deg, #b9bcc2 0%, #c9ccd1 55%, #d9dbdf 100%); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35); }
button.pst-sq:focus-visible { outline: 2px solid #7aa7e8; outline-offset: 1px; }
/* iTunes 4 (guidebookgallery cdplayer/macosx103-1-1.png): back / play / forward side by side,
   the volume slider directly beneath with speaker-low / speaker-high glyphs */
#win-itunes .itunes-transport { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.it-tbtns { display: flex; align-items: center; gap: 4px; }
.it-vol { display: flex; align-items: center; gap: 3px; }
.it-vol svg { display: block; height: 9px; width: auto; }
.it-vol svg:first-child { width: 9px; }
.it-vol svg:last-child { width: 13px; }
#win-itunes .it-vol .it-vol-range { width: 74px; height: 11px; }
#win-itunes .it-vol .it-vol-range::-webkit-slider-runnable-track { height: 3px; }
#win-itunes .it-vol .it-vol-range::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -5px; }
#win-itunes .it-vol .it-vol-range::-moz-range-thumb { width: 10px; height: 10px; }
.it-vol-btn { border: 0; padding: 1px; margin: 0; background: none; cursor: pointer; line-height: 0; }
.it-vol-btn:active svg { opacity: 0.6; }
.itunes-lcd { position: relative; }
.lcd-rb {
  position: absolute; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%;
  border: 1px solid #6c6f61; background: radial-gradient(circle at 50% 30%, #f4f4f0, #b9bcae 70%, #a5a99a);
}
.lcd-rb.l { left: 5px; }
.lcd-rb.r { right: 5px; }
.it-topright { display: flex; align-items: flex-start; gap: 10px; }
.it-browse { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: #2b2b2b; }
.it-browse i {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid #5d6066;
  background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, #f7f7f8 0%, #d9dbdf 48%, #c3c6cc 52%, #e6e8eb 100%);
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.25);
}
.it-browse svg { width: 16px; height: 16px; display: block; }
#win-itunes .pst-search input {
  padding-left: 24px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Ccircle cx='5' cy='5' r='3.4' fill='none' stroke='%23444' stroke-width='1.4'/%3E%3Cpath d='M7.5 7.5l3 3' stroke='%23444' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M12.5 5h4.5l-2.25 2.6z' fill='%23444'/%3E%3C/svg%3E") 5px 50% / 17px 11px no-repeat,
    #fff;
}
.itunes-table .c-n { width: 34px; text-align: right; padding-right: 8px; }
.itunes-table th.c-n { text-align: center; font-size: 8px; padding: 0 4px; }
.itunes-table .c-t { width: 44px; text-align: right; }
.itunes-table th.c-t { text-align: left; }
.itunes-table td, .itunes-table th { border-left: 1px solid #d9d9d9; }
.itunes-table th { border-left-color: #c3c3c3; }
.itunes-table td:first-child { border-left: 0; }
.it-cb {
  display: inline-block; vertical-align: -2px; width: 11px; height: 11px; margin-right: 5px; border-radius: 2px;
  border: 1px solid #4b6fa8;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2.2 2.3L8.4 1.8' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / 9px 9px no-repeat, linear-gradient(180deg, #d6e8fc, #7fb1ec 55%, #a9cdf6);
}
/* iTunes 4 mini player: the green zoom button shrinks the window to the transport + LCD row */
#win-itunes.it-mini .pst-main, #win-itunes.it-mini .pst-bottom, #win-itunes.it-mini .it-topright, #win-itunes.it-mini .win-rz { display: none; }
#win-itunes.it-mini { height: auto !important; }
#win-itunes.it-mini .pst-top { grid-template-columns: auto minmax(0, 1fr); }
.it-srccol { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
/* iTunes 4: the Source list is the flexible pane (at least ~4 rows); the artwork square gives way first */
.it-srccol .pst-source { flex: 1 1 0; min-height: 96px; }
#win-itunes.it-noart .it-art { display: none; }
#win-itunes .pst-source li { cursor: pointer; }
#win-itunes .pst-source li span { overflow: hidden; text-overflow: ellipsis; }
#win-itunes .pst-source li:focus-visible { outline: 2px solid #7aa7e8; outline-offset: -2px; }
.it-art {
  flex: 0 1 auto;
  min-height: 0;
  position: relative;
  height: 118px;
  border: 1px solid #72757b;
  overflow: hidden;
  background: #111;
}
.it-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.it-art-links {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: linear-gradient(0deg, rgba(15, 18, 22, 0.78), rgba(15, 18, 22, 0));
}
.it-art-links .aqua-btn { font-size: 10.5px; padding: 2px 9px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-lib { min-width: 0; min-height: 0; overflow: auto; }
/* iTunes 4 transport: round brushed-metal buttons, vector glyphs centred in the face */
.it-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #5d6066;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #f7f7f8 0%, #d9dbdf 48%, #c3c6cc 52%, #e6e8eb 100%);
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 0;
}
.it-btn svg { width: 14px; height: 14px; display: block; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.75)); }
.it-btn.main { width: 36px; height: 36px; }
.it-btn.main svg { width: 16px; height: 16px; }
.it-btn:active { background: linear-gradient(180deg, #c9ccd1 0%, #b4b7bd 50%, #cfd2d6 100%); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35); }
.it-btn .g-pause, .it-btn.is-playing .g-play { display: none; }
.it-btn.is-playing .g-pause { display: block; }
/* iTunes 4 LCD: pale olive, heavily rounded ends, centred Lucida Grande text,
   thin outlined progress bar with a diamond position marker (no EQ bars) */
.itunes-lcd {
  background: linear-gradient(180deg, #c9cdb2 0%, #d7dcc0 30%, #dde2c7 100%);
  border: 1px solid #6f7262;
  border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.6);
  padding: 4px 22px 6px;
  color: #000;
  display: block;
  text-align: center;
}
.lcd-title {
  font-weight: 400;
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lcd-sub {
  font-family: var(--ui-font);
  font-size: 11px;
  line-height: 14px;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lcd-prog {
  position: relative;
  height: 7px;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 0;
  margin: 3px auto 0;
  cursor: pointer;
  overflow: visible;
  touch-action: none;
}
.lcd-prog span {
  position: relative;
  display: block;
  height: 100%;
  width: 0%;
  background: transparent;
}
.lcd-prog span::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  background: #1a1a1a;
  transform: translate(50%, -50%) rotate(45deg);
}
.lcd-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}
.lcd-eq span {
  width: 3px;
  height: 6px;
  background: #2f3d1f;
}
.itunes-lcd.playing .lcd-eq span:nth-child(1) { animation: eq 0.5s ease-in-out infinite alternate; }
.itunes-lcd.playing .lcd-eq span:nth-child(2) { animation: eq 0.38s 0.1s ease-in-out infinite alternate; }
.itunes-lcd.playing .lcd-eq span:nth-child(3) { animation: eq 0.65s 0.2s ease-in-out infinite alternate; }
.itunes-lcd.playing .lcd-eq span:nth-child(4) { animation: eq 0.44s 0.05s ease-in-out infinite alternate; }
.itunes-lcd.playing .lcd-eq span:nth-child(5) { animation: eq 0.58s 0.15s ease-in-out infinite alternate; }
.itunes-lcd.playing .lcd-eq span:nth-child(6) { animation: eq 0.48s 0.22s ease-in-out infinite alternate; }
@keyframes eq { 0% { height: 4px; } 100% { height: 19px; } }

.itunes-table th { position: sticky; top: 0; }
.itunes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
/* Panther list header: near-white, dipping to #e9e9e9 mid-height; the sorted column is blue gel */
.itunes-table th, .finder-table th, .source-head, #win-itunes .pst-source-hd {
  text-align: left;
  background: linear-gradient(180deg, #fff 0%, #f2f2f2 45%, #e9e9e9 50%, #f2f2f2 60%, #fff 100%);
  border-bottom: 1px solid #666;
  border-left: 1px solid #c3c3c3;
  padding: 0 6px;
  height: 16px;
  line-height: 15px;
  font-size: 11px;
  font-weight: 400;
  color: #000;
  text-transform: none;
  white-space: nowrap;
}
.itunes-table th:first-child, .finder-table th:first-child { border-left: 0; }
.itunes-table th:first-child, .finder-table th:first-child {
  background: linear-gradient(180deg, #c7e1fb 0%, #9cc8f4 45%, #79b0ee 50%, #92c3f5 60%, #c9e2fb 100%);
}
.itunes-table tr { cursor: default; -webkit-user-select: none; user-select: none; }
/* the song now playing (or paused mid-song) gets the iTunes speaker glyph in the number column */
.itunes-table tr.now .c-n::before {
  content: ""; display: inline-block; width: 11px; height: 9px; margin-right: 3px; vertical-align: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M1 3.5h2L6 1v8L3 6.5H1z' fill='%23222'/%3E%3Cpath d='M8 3a3 3 0 0 1 0 4M10 1.5a5.2 5.2 0 0 1 0 7' fill='none' stroke='%23222' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.itunes-table tr.now.active .c-n::before { filter: invert(1); }
.itunes-table tbody tr:nth-child(odd) { background: #ffffff; }
.itunes-table tbody tr:nth-child(even) { background: var(--aqua-stripe); }
.itunes-table tbody tr.active {
  background: var(--aqua-sel-list);
  color: #ffffff;
}
.itunes-table td { padding: 1px 6px; height: 17px; line-height: 15px; white-space: nowrap; }
.itunes-table:focus { outline: none; }
.itunes-table:focus-visible { outline: 2px solid #7fb2ff; outline-offset: -2px; }


/* 3. iPhoto '04: Vegas & Tokyo '26 */
.iphoto-split {
  display: grid;
  grid-template-columns: 162px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.osx-body > .iphoto-split { overflow: hidden; }
.iphoto-source {
  background: #dce3ec;
  border-right: 1px solid #8c939e;
  padding: 0 0 8px;
  overflow-y: auto;
}
.source-head { text-align: center; border-left: 0; margin: 0 0 2px; }
.source-head ~ .source-head { margin-top: 6px; }
.album-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 5px 12px;
  font-family: var(--ui-font);
  font-size: 11.5px;
  color: #1c1f24;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.album-btn.active {
  background: var(--aqua-sel-list);
  color: #ffffff;
}
.iphoto-stage {
  background: #d0d2d6;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 11px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
}
.slide-card {
  background: #ffffff;
  border: 1px solid #8b8e94;
  padding: 5px 5px 7px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  transition: transform 0.12s ease;
}
.slide-card:hover {
  transform: translateY(-2px);
  border-color: var(--aqua-blue);
}
.slide-card.hidden { display: none; }
.slide-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid #d5d5d5;
}
.slide-loc {
  display: block;
  font-family: var(--ui-font);
  font-weight: 600;
  font-size: 10.5px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slide-cap {
  display: block;
  font-family: var(--ui-font);
  font-size: 10px;
  color: #555960;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Aqua slider: thin grey groove (no blue fill), clear gel knob */
.aqua-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 15px;
  margin: 0;
  background: transparent;
}
.aqua-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #8e8e8e, #d8d8d8 60%, #ececec);
  border: 1px solid #6e6e6e;
}
.aqua-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -6px;
  border-radius: 50%;
  border: 1px solid #5a5a5a;
  background: radial-gradient(circle at 50% 28%, #fff 0, #f2f2f2 30%, #c9c9c9 70%, #e9e9e9 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
.aqua-slider::-moz-range-track { height: 4px; border-radius: 3px; background: linear-gradient(180deg, #8e8e8e, #ececec); border: 1px solid #6e6e6e; }
.aqua-slider::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; border: 1px solid #5a5a5a; background: radial-gradient(circle at 50% 28%, #fff 0, #c9c9c9 70%, #e9e9e9 100%); }
.ip-size { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ip-size i { display: block; border: 1px solid #555; background: linear-gradient(180deg, #fff, #cfcfcf); }
.ip-size i.sm { width: 7px; height: 6px; }
.ip-size i.lg { width: 12px; height: 10px; }
.iphoto-foot {
  padding: 6px 24px 6px 12px;
  border-top: 1px solid #8a8d94;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #24262a;
}

#iphoto-count { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphoto-foot .ip-size { flex: 0 0 auto; white-space: nowrap; }
/* 4. Finder (guidebookgallery filemanager/macosx103-1-1.png): metal toolbar with
   back/forward, icon/list/column view switcher, Action (gear) popup and a search
   field; white sidebar; list view; "N items, X GB available" status line. */
.osx-win.metal .finder-toolbar { background: transparent; border-bottom: 0; }
#win-finder .osx-statusbar span + span { display: none; }
.finder-toolbar {
  padding: 4px 10px 7px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.fd-seg {
  display: inline-flex; flex-shrink: 0; padding: 0; border-radius: 4px; overflow: hidden;
  border: 1px solid #5f6267; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.fd-seg i {
  display: grid; place-items: center; width: 25px; height: 20px;
  background: linear-gradient(180deg, #fdfdfd 0%, #eceef0 45%, #d9dbde 50%, #e7e8ea 85%, #f3f4f5 100%);
}
.fd-seg i + i { border-left: 1px solid #77797e; }
.fd-seg i.on { background: linear-gradient(180deg, #cfe5fc 0%, #8dbff3 45%, #5a9cea 50%, #79b5f2 80%, #b9dcfd 100%); }
.fd-seg svg { display: block; width: 12px; height: 10px; }
.fd-seg i.fd-off svg { opacity: 0.55; }
button.fd-seg { font: inherit; cursor: default; }
.fd-action i { width: 36px; }
.fd-action svg { width: 22px; height: 12px; }
.fd-action:active i, .fd-action[aria-expanded="true"] i { background: linear-gradient(180deg, #c9ccd1 0%, #b4b7bd 50%, #cfd2d6 100%); }
.fd-action-wrap { position: relative; display: inline-flex; }
.fd-action-menu { top: 23px; left: 0; border-radius: 5px; }
.fd-action-wrap.open > .fd-action-menu { display: block; }
.fd-search { margin-left: auto; min-width: 0; flex: 0 1 150px; }
.fd-search input {
  width: 100%; height: 19px; padding: 0 8px 0 24px; border-radius: 10px;
  border: 1px solid #7b7f86; font: 11px var(--ui-font); outline: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Ccircle cx='5' cy='5' r='3.4' fill='none' stroke='%23444' stroke-width='1.4'/%3E%3Cpath d='M7.5 7.5l3 3' stroke='%23444' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M12.5 5h4.5l-2.25 2.6z' fill='%23444'/%3E%3C/svg%3E") 5px 50% / 17px 11px no-repeat,
    #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}
.fd-search input:focus { box-shadow: 0 0 0 2px #7aa7e8, inset 0 1px 2px rgba(0, 0, 0, 0.25); }
.finder-main {
  /* Panther Finder: sidebar and file list are two separate white panes with a strip of
     metal between them (GUIdebook filemanager_macosx103-1-1.png) */
  display: grid; grid-template-columns: 124px minmax(0, 1fr); column-gap: 7px;
  margin: 0 10px; background: transparent;
}
.finder-main > .finder-sidebar, .finder-main > .finder-content { border: 1px solid #6f7277; background: #fff; min-height: 0; }
.osx-body > .finder-main { overflow: hidden; }
.finder-sidebar { border-right: 1px solid #9a9da3; padding: 4px 0; overflow-y: auto; font-size: 12px; }
.finder-sidebar span { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 4px 0 2px; white-space: nowrap; overflow: hidden; }
.finder-sidebar span[role="link"] { cursor: default; }
.finder-sidebar span[role="link"]:focus-visible { outline: 2px solid #7fb2ff; outline-offset: -2px; }
.finder-sidebar span.sel { background: linear-gradient(180deg, #3d96e2 0%, #127cd8 50%, #0060cd 100%); color: #fff; }
.finder-sidebar svg { width: 32px; height: 32px; flex: 0 0 auto; }
.finder-sidebar hr { border: 0; border-top: 1px solid #b3b3b3; margin: 3px 4px; }
.finder-content { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.fd-ico { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; margin-right: 4px; }
.finder-table td:first-child { white-space: nowrap; }
#win-finder.no-toolbar .finder-toolbar, #win-finder.no-toolbar .finder-sidebar { display: none; }
#win-finder.no-toolbar .finder-main { grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
/* Panther segmented control: small-radius rounded rect, thin dividers, blue gel selected segment */
.seg-group {
  display: inline-flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #6e6e6e;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.seg-btn {
  border: 0;
  padding: 2px 10px;
  font-family: var(--ui-font);
  font-size: 11px;
  cursor: default;
  background: linear-gradient(180deg, #ffffff 0%, #f1f1f1 45%, #dedede 50%, #ececec 80%, #f8f8f8 100%);
  color: #000;
}
.seg-btn + .seg-btn { border-left: 1px solid #8a8a8a; }
.seg-btn.active {
  background: linear-gradient(180deg, #a7d0fb 0%, #5fa3ee 50%, #3d8ae5 51%, #86c0f7 100%);
  color: #000;
  font-weight: 400;
}
.finder-list-wrap {
  flex: 1 1 auto;
  min-height: 60px;
  overflow: auto;
}
.finder-table td { white-space: nowrap; }
.finder-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.finder-table th {
  position: sticky;
  top: 0;
}
.finder-table tbody tr { cursor: pointer; }
.finder-table tbody tr:nth-child(odd) { background: #ffffff; }
.finder-table tbody tr:nth-child(even) { background: var(--aqua-stripe); }
.finder-table tbody tr.selected {
  background: var(--aqua-sel-list);
  color: #ffffff;
}
.finder-table td { padding: 1px 6px; height: 17px; line-height: 15px; }

.finder-preview {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 6px 8px 8px;
  border-top: 1px solid #c9ccd1;
  font-size: 11px;
}
.finder-preview h4 {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 700;
}

/* 5. iChat AV Buddy List (512pixels 10-3-Panther-iChat-AV.png, vowe.net ichatav.png):
   status dot + name + "Available" popup on the left, AV capability icon and the
   user's picture on the right; metal bottom bar with "+" and the A / phone /
   camera segmented control. */
.ichat-me {
  padding: 2px 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ichat-id { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.ichat-id strong { font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ichat-status { font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.ichat-status svg { width: 7px; height: 5px; }
.ichat-av svg { display: block; width: 22px; height: 16px; }
.ichat-me img {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid #666;
  object-fit: cover;
}
.ichat-bottom {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px 2px;
}
.ichat-sq {
  position: absolute; left: 10px; top: 4px;
  width: 22px; height: 20px; display: grid; place-items: center; border-radius: 4px;
  border: 1px solid #5f6267; background: linear-gradient(180deg, #fdfdfd 0%, #eceef0 45%, #d9dbde 50%, #e7e8ea 85%, #f3f4f5 100%);
}
.ichat-sq svg { width: 10px; height: 10px; display: block; }
.ichat-seg { display: inline-flex; border-radius: 99px; overflow: hidden; border: 1px solid #5f6267; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55); }
.ichat-seg > * {
  display: grid; place-items: center; width: 30px; height: 20px; padding: 0; border: 0; cursor: default;
  background: linear-gradient(180deg, #fdfdfd 0%, #eceef0 45%, #d9dbde 50%, #e7e8ea 85%, #f3f4f5 100%);
}
.ichat-seg > * + * { border-left: 1px solid #77797e; }
.ichat-seg button:active { background: linear-gradient(180deg, #c9ccd1 0%, #b4b7bd 50%, #cfd2d6 100%); }
.ichat-seg button:focus-visible { outline: 2px solid #7aa7e8; outline-offset: -2px; }
.ichat-seg svg { display: block; width: 13px; height: 12px; }
/* chat window: white transcript with iChat balloons, text field at the bottom */
.ichat-transcript { background: #fff; margin: 0 10px; border: 1px solid #6f7277; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.ichat-line { display: flex; align-items: flex-end; gap: 6px; max-width: 88%; }
.ichat-line img, .ichat-line .buddy-pic { width: 28px; height: 28px; flex: 0 0 auto; border: 1px solid #888; object-fit: cover; }
.ichat-line.me { align-self: flex-end; flex-direction: row-reverse; }
.ichat-line p {
  margin: 0; padding: 5px 11px; border-radius: 13px; font-size: 12px; overflow-wrap: anywhere;
  background: linear-gradient(180deg, #e9f2fd, #c4dcf7); border: 1px solid #8fb2de;
}
.ichat-line.me p { background: linear-gradient(180deg, #f4f4f4, #dcdcdc); border-color: #a9a9a9; }
/* iChat status notice (centered grey text between bubbles) and inline action links */
.ichat-notice { align-self: center; text-align: center; font-size: 11px; color: #6b6f76; max-width: 92%; }
.ichat-notice button, .ichat-act {
  margin-left: 6px; padding: 0 9px; height: 18px; border: 1px solid #8a8d92; border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #dcdcdc); font: 11px/16px var(--ui-font); color: #000; cursor: default;
}
.ichat-notice button:active, .ichat-act:active { background: linear-gradient(180deg, #a9c9f3, #5f98e3); color: #fff; }
.ichat-acts { align-self: flex-start; margin-left: 34px; }
.ichat-acts .ichat-act { margin-left: 0; }
/* The well shows four buddies and scrolls the rest, so the Buddy List keeps its size. */
.ichat-buddies {
  margin: 8px 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(4 * 41.5px + 2px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ichat-buddies > .buddy-row { flex: 0 0 41.5px; height: 41.5px; }
.buddy-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  min-height: 36px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid #e3e7ee;
}
.buddy-row:nth-child(even) { background: var(--aqua-stripe); }
.buddy-row:hover, .buddy-row:focus-visible { background: var(--aqua-sel); color: #fff; outline: none; }
.buddy-row:hover .buddy-text span, .buddy-row:focus-visible .buddy-text span { color: #e4ecfa; }
.buddy-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #c8ffb4, #3cc02a 55%, #1d7a12);
  border: 1px solid rgba(0, 0, 0, 0.35);
}
.buddy-dot.away { background: radial-gradient(circle at 50% 30%, #ffd2cc, #e0392c 55%, #8d150c); }
.buddy-text { min-width: 0; display: flex; flex-direction: column; }
.buddy-text strong { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buddy-text span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buddy-pic {
  width: 32px; height: 32px; border: 1px solid #8f939a; border-radius: 2px;
  background:
    radial-gradient(circle at 50% 38%, #f4f6fa 0 6px, transparent 6.5px),
    radial-gradient(ellipse 11px 9px at 50% 100%, #f4f6fa 0 99%, transparent 100%),
    linear-gradient(180deg, #a9c3e6, #6f92c7);
}
img.buddy-pic { display: block; object-fit: cover; background: #6f92c7; }
.ichat-msg-form {
  margin: 8px 10px 10px;
  display: flex;
  gap: 6px;
}
.ichat-msg-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #8c9096;
  border-radius: 99px;
  padding: 5px 11px;
  font-family: var(--ui-font);
  font-size: 11.5px;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.14);
}

/* Classic Translucent Mac OS X Bottom Dock */
.osx-dock-wrap {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 940;
  max-width: calc(100vw - 20px);
}
.osx-dock {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 3px 8px 0;
  /* Panther: see-through white over the wallpaper (reads blue-grey), square corners, thin
     light outline. Checked against GUIdebook desktop/empty/macosx103.png; alpha estimated. */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.28) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}
.dock-item {
  position: relative;
  background: transparent;
  border: 0;
  padding: 0 1px 1px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}
.dock-item:hover { transform: none; }
.dock-item:focus { outline: none; }
.dock-item:focus-visible svg { filter: drop-shadow(0 0 3px #7fb2ff) drop-shadow(0 0 1px #fff); }
.dock-item svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
.dock-tip {
  position: absolute;
  top: -22px;
  background: none;
  color: #fff;
  border: 0;
  padding: 0;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.dock-item:hover .dock-tip, .dock-item:focus-visible .dock-tip { opacity: 1; }
.dock-tri {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid #000;
  margin-top: 1px;
}
.dock-item.is-closed .dock-tri { opacity: 0; }
.dock-sep {
  width: 1px;
  height: 50px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.5);
  margin: 0 5px 4px;
}

/* Preview / QuickTime Modal */
.osx-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 34, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}
.osx-modal.open { display: flex; }
.osx-modal-win {
  max-width: 560px;
  width: 100%;
  border-radius: 7px;
  border: 1px solid #3c3e42;
  background: var(--pinstripe-bg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}
.osx-modal-win img {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background: #141619;
}
/* Caption and the Instagram button share one white footer row; the button stays
   vertically centred on the caption and wraps under it only when there's no room. */
.m-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #aaa;
  font-size: 12px;
}
#m-cap { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
#m-permalink { flex: 0 0 auto; margin: 0 0 0 auto; }
#m-permalink[hidden] { display: none; }
/* Previous / next: shown while the pointer is over the photo (or a key is used); on
   touch screens they stay hidden and a sideways swipe on the photo does the same. */
.m-stage { position: relative; touch-action: pan-y; }
.m-nav {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 46px;
  margin-top: -23px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.m-nav svg { display: block; width: 12px; height: 20px; margin: 0 auto; }
.m-prev { left: 10px; }
.m-next { right: 10px; }
.m-stage:hover .m-nav, .m-nav:focus-visible { opacity: 1; }
.m-nav:hover { background: rgba(0, 0, 0, 0.7); }
.m-nav[hidden] { display: none; }
@media (hover: none) { .m-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .m-nav { transition: none; } }

body.is-dragging, body.is-dragging * { user-select: none !important; }


/* Mobile fallback */
/* 6. Terminal easter egg window (white Terminal.app body inside a pinstripe window) */
.terminal-body { background: #ffffff; padding: 0; position: relative; }
/* keep the Zork status line out of the scroller column under the split widget */
#win-terminal .pt-status { margin-right: 15px; }
#panther-terminal { height: 100%; min-height: 160px; --pt-font-size: 12px; }
/* 10.3 Terminal (guidebookgallery commandprompt/macosx103.png): a permanent scroller
   with the split-pane widget above it */
#win-terminal .pt-screen { overflow-y: scroll; }
#win-terminal .pt-screen::-webkit-scrollbar-track:vertical { margin-top: 11px; }
.term-split {
  position: absolute; top: 0; right: 0; width: 15px; height: 11px; pointer-events: none;
  border-left: 1px solid #a5a5a5; border-bottom: 1px solid #a5a5a5;
  background:
    linear-gradient(#555, #555) 3px 3px / 9px 1px no-repeat,
    linear-gradient(#555, #555) 3px 6px / 9px 1px no-repeat,
    linear-gradient(90deg, #c8c8c8 0, #f4f4f4 3px, #fff 8px, #e6e6e6 13px, #bcbcbc 15px);
}
.menu-drop-wrap[hidden] { display: none; }
.dock-item.dock-transient.is-closed { display: none; }
/* Safari 1.x window: the page area inside PantherSafari scrolls, never the window body */
#win-safari .win-fill { overflow: hidden; }
/* Finder detail strip: open the selected project's store page in Safari */
.finder-preview .fd-visit { color: #0000ee; text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.finder-preview .fd-visit:focus-visible { outline: 1px dotted #0000ee; }

/* Panther pull-down menus: translucent white, square top, rounded bottom corners, blue highlight */
.menu-drop-wrap { position: relative; display: inline-flex; height: 21px; }
.menu-drop {
  display: none;
  position: absolute;
  top: 21px;
  left: 0;
  min-width: 190px;
  padding: 4px 0 5px;
  background: rgba(255, 255, 255, 0.95);
  border: 0;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16), 0 6px 16px rgba(0, 0, 0, 0.38);
  z-index: 960;
}
.menu-drop-wrap.open > .menu-drop { display: block; }
.menu-drop-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 19px;
  padding: 0 14px 0 20px;
  border: 0;
  background: transparent;
  font: 14px/19px var(--ui-font);
  color: #000;
  text-align: left;
  white-space: nowrap;
  cursor: default;
}
.menu-drop-item:not(:disabled):hover, .menu-drop-item:not(:disabled):focus-visible, .menu-drop-item.has-sub.open {
  background: linear-gradient(180deg, #6aa7f0 0%, #3f82e2 50%, #2e72d6 51%, #3b84e6 100%);
  color: #fff;
  outline: none;
}
.menu-drop-item:disabled, .menu-drop-item[aria-disabled="true"] { color: #a3a3a3; }
.menu-drop-item.checked::before { content: "\2713"; position: absolute; left: 6px; font-size: 12px; }
.menu-key { margin-left: 28px; font-size: 14px; letter-spacing: 1px; }
.menu-sep { height: 1px; margin: 5px 0 6px; background: #d9d9d9; }
.menu-sub-arrow { font-size: 10px; margin-left: 28px; }
.menu-sub { top: -4px; left: 100%; border-radius: 5px; }
.menu-drop-item.has-sub:hover > .menu-sub, .menu-drop-item.has-sub.open > .menu-sub { display: block; }

/* Aqua scrollers: 15px white grooved track, blue gel capsule thumb, both arrows together at the end */
.osx-win ::-webkit-scrollbar, .osx-modal ::-webkit-scrollbar { width: 15px; height: 15px; }
.osx-win ::-webkit-scrollbar-track:vertical { background: linear-gradient(90deg, #c8c8c8 0, #e9e9e9 2px, #fdfdfd 5px, #fff 10px, #eeeeee 13px, #d0d0d0 15px); }
.osx-win ::-webkit-scrollbar-track:horizontal { background: linear-gradient(180deg, #c8c8c8 0, #e9e9e9 2px, #fdfdfd 5px, #fff 10px, #eeeeee 13px, #d0d0d0 15px); }
.osx-win ::-webkit-scrollbar-thumb {
  border-radius: 8px;
  border: 1px solid #1d4f97;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.osx-win ::-webkit-scrollbar-thumb:vertical {
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0 1px, rgba(255, 255, 255, 0) 1px 3px),
    linear-gradient(90deg, #3a76c8 0%, #7fb6f2 25%, #4c93e4 50%, #2f78d8 75%, #5aa0ea 100%);
}
.osx-win ::-webkit-scrollbar-thumb:horizontal {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 1px, rgba(255, 255, 255, 0) 1px 3px),
    linear-gradient(180deg, #3a76c8 0%, #7fb6f2 25%, #4c93e4 50%, #2f78d8 75%, #5aa0ea 100%);
}
.osx-win ::-webkit-scrollbar-button { display: none; }
.osx-win ::-webkit-scrollbar-button:end:decrement,
.osx-win ::-webkit-scrollbar-button:end:increment { display: block; width: 15px; height: 15px; background-repeat: no-repeat; background-position: center; }
.osx-win ::-webkit-scrollbar-button:vertical:end:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Cpath d='M7.5 5L11 10H4z' fill='%23222'/%3E%3C/svg%3E"), linear-gradient(90deg, #c8c8c8 0, #f4f4f4 3px, #fff 8px, #e6e6e6 13px, #bcbcbc 15px);
  border-top: 1px solid #a5a5a5;
}
.osx-win ::-webkit-scrollbar-button:vertical:end:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Cpath d='M7.5 10L11 5H4z' fill='%23222'/%3E%3C/svg%3E"), linear-gradient(90deg, #c8c8c8 0, #f4f4f4 3px, #fff 8px, #e6e6e6 13px, #bcbcbc 15px);
  border-top: 1px solid #a5a5a5;
}
.osx-win ::-webkit-scrollbar-button:horizontal:end:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Cpath d='M5 7.5L10 4v7z' fill='%23222'/%3E%3C/svg%3E"), linear-gradient(180deg, #c8c8c8 0, #f4f4f4 3px, #fff 8px, #e6e6e6 13px, #bcbcbc 15px);
  border-left: 1px solid #a5a5a5;
}
.osx-win ::-webkit-scrollbar-button:horizontal:end:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Cpath d='M10 7.5L5 4v7z' fill='%23222'/%3E%3C/svg%3E"), linear-gradient(180deg, #c8c8c8 0, #f4f4f4 3px, #fff 8px, #e6e6e6 13px, #bcbcbc 15px);
  border-left: 1px solid #a5a5a5;
}
.osx-win ::-webkit-scrollbar-corner { background: #eeeeee; }

@media (max-width: 960px) {
  .desktop-icons, .desk-only, .ip-size { display: none; }
  /* Compact Dock: the way back to any window that was closed */
  body { padding-bottom: 64px; }
  .osx-dock { gap: 2px; padding: 2px 6px 0; }
  .dock-item svg { width: 38px; height: 38px; }
  .dock-sep { height: 40px; margin: 0 3px 4px; }
  .dock-tip { display: none; }
  .osx-body > .textedit-doc { overflow-y: visible; }
  #win-itunes .it-vol, #win-itunes .it-topright { display: none; }
  #win-itunes .itunes-table th:nth-child(5), #win-itunes .itunes-table td:nth-child(5) { display: none; }
  /* phone: the Finder list keeps all four columns inside the window (no sideways scroll) */
  #win-finder .finder-table { font-size: 10.5px; }
  #win-finder .finder-table th, #win-finder .finder-table td { padding-left: 3px; padding-right: 3px; }
  .osx-desktop {
    min-height: auto !important;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .osx-win {
    position: static !important;
    width: 100% !important;
    height: auto !important;
  }
  .win-rz { display: none; }
  .osx-titlebar { cursor: default; }
  .iphoto-split { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .iphoto-source { border-right: 0; border-bottom: 1px solid #8c939e; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
  .source-head { display: none; }
  .album-btn { width: auto; border-radius: 99px; padding: 3px 10px; }
  .iphoto-source .source-head { display: none; }
  .iphoto-stage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #win-itunes .pst-main { grid-template-columns: minmax(0, 1fr); height: auto !important; padding: 0 8px; }
  #win-itunes .pst-top { grid-template-columns: auto minmax(0, 1fr); padding: 6px 8px; }
  #win-itunes .pst-vol, #win-itunes .pst-search { display: none; }
  #win-itunes .pst-source-hd { display: none; }
  #win-itunes .pst-source ul { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px; }
  #win-itunes .pst-source li { border-radius: 99px; padding: 0 8px; border: 1px solid #c6cad1; }
  #win-itunes .it-art { height: 96px; }
  #win-itunes .it-srccol .pst-source { flex: 0 0 auto; }
  #win-itunes .it-vis { height: 220px; }
  #win-itunes .it-lib { max-height: 260px; }
  #win-terminal #panther-terminal { height: 340px; }
  #win-search #panther-search { height: 420px; }
  #win-chess #panther-chess { height: 620px; }
  #win-safari #panther-safari { height: 560px; overflow: hidden; }
  .menu-sub { left: 0; top: 100%; }
}
/* Tablets and landscape phones: the menu titles need the room, so the status extras and the
   user menu (both in the desktop view) step aside rather than overlap Help/Window. */
@media (max-width: 880px) {
  .menu-right .menu-extra[title], .menu-right .egg-user { display: none; }
}
@media (max-width: 660px) {
  .menu-right { display: none; }
}
@media (max-width: 560px) {
  .iphoto-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-header { grid-template-columns: 1fr; }
  .te-photo { max-width: 216px; }
  .menu-right { display: none; }
  .menu-item, .menu-app-name { font-size: 13px; padding: 0 6px; }
  .apple-mark { padding: 0 8px; }
  .menu-drop { min-width: 0; }
  .menu-drop-item { font-size: 13px; }
  .menu-key { display: none; }
  .menu-drop-wrap[data-extra] { display: none; }
  .finder-main { grid-template-columns: minmax(0, 1fr); }
  .finder-sidebar { display: none; }
  .fd-search { flex-basis: 110px; }
}
@media (max-width: 330px) {
  [data-menu="help"] { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .itunes-lcd.playing .lcd-eq span { animation: none !important; }
  .osx-win.anim-snap, .dock-item { transition: none !important; }
}

/* ---- Dock: minimized-window thumbnails (right of the separator, before the Trash) ---- */
/* ===== iPod phone view (ipod/): active only when body.ipod-on (JS adds it at <=600px) ===== */
#ipod-host { display: none; }
body.ipod-on { padding: 0 !important; }
/* While the iPod itself is on screen the page cannot scroll: the host fills the visible
   viewport exactly (dvh follows the phone's collapsing toolbars), takes every touch, and
   keeps the device clear of notches and the home indicator. */
html:has(body.ipod-on:not(.ipod-fs)), body.ipod-on:not(.ipod-fs) { overflow: hidden; height: 100%; overscroll-behavior: none; }
body.ipod-on #ipod-host {
  display: block; position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100dvh; z-index: 2000;
  overflow: hidden; overscroll-behavior: none; touch-action: none; box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
body.ipod-on .osx-menubar, body.ipod-on .osx-desktop, body.ipod-on .osx-dock-wrap { display: none !important; }
/* A full-screen launcher (Photos / a post / the store) opened from the iPod: reveal the desktop
   with only the target window, the iPod hidden, a back bar on top. */
body.ipod-fs #ipod-host { display: none !important; }
body.ipod-fs .osx-desktop { display: flex !important; padding-top: 50px !important; }
body.ipod-fs .osx-win:not(.ipod-fs-win) { display: none !important; }
body.ipod-fs .stk-layer, body.ipod-fs .desktop-icons { display: none !important; }
/* the launched window fills the whole display below the back bar (dvh tracks the phone's
   browser chrome showing/hiding) */
body.ipod-fs { overflow: hidden; }
body.ipod-fs .osx-win.ipod-fs-win { position: fixed !important; top: 44px !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: auto !important; height: auto !important; max-width: none !important; max-height: none !important; min-height: 0 !important; margin: 0 !important; transform: none !important; border-radius: 0 !important; display: flex !important; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px); }
body.ipod-fs .osx-win.ipod-fs-win > .osx-body { flex: 1 1 auto; min-height: 0; height: auto !important; max-height: none !important; overflow: auto; }
#ipod-fs-bar { display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; height: 44px; z-index: 2600; padding: 0 12px; background: linear-gradient(#f7f7f7, #d9d9d9); border-bottom: 1px solid #9a9a9a; font: 13px var(--ui-font); }
#ipod-fs-bar[hidden] { display: none; }
#ipod-fs-back { border: 1px solid #8a8d92; border-radius: 13px; background: linear-gradient(#fff, #dcdcdc); padding: 3px 14px; font: 12px var(--ui-font); color: #000; cursor: pointer; }
#ipod-fs-back:active { background: linear-gradient(#a9c9f3, #5f98e3); color: #fff; }
#ipod-fs-title { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ipod-fs .ipod-fs-win .aqua-lights { visibility: hidden; }
/* 44px touch targets without changing the look */
#ipod-fs-back, #ipod-chip { position: relative; }
#ipod-fs-back::before { content: ""; position: absolute; inset: -9px -10px; }
#ipod-chip::before { content: ""; position: absolute; inset: -5px; }
#ipod-chip { position: fixed; right: 12px; bottom: calc(48px + 10px + env(safe-area-inset-bottom, 0px)); z-index: 2600; border: 1px solid #555; border-radius: 16px; padding: 7px 16px; background: linear-gradient(#fff, #cfcfcf); font: 13px var(--ui-font); color: #000; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); cursor: pointer; }
#ipod-chip[hidden] { display: none; }

.osx-dock-wrap { transform-origin: 50% 100%; }
.dock-mini { width: 50px; }
.dock-mini .dock-mini-face { display: block; width: 48px; height: 48px; position: relative; }
.dock-mini .dock-tri { opacity: 0; }
/* Trash turns into the Eject symbol while a mounted disk is dragged */
#dock-trash .dock-eject { display: none; }
#dock-trash.as-eject > svg:not(.dock-eject) { display: none; }
#dock-trash.as-eject .dock-eject { display: block; }
#dock-trash.drop-hot svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) brightness(0.6); }

/* ---- Exposé (10.3): windows tile at reduced scale, the desktop dims ---- */
.expose-dim {
  position: absolute; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.42);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
body.expose-on .expose-dim { opacity: 1; pointer-events: auto; }
body.expose-desk .expose-dim { display: none; }
.osx-win.expose-anim { transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.3s ease; transform-origin: 0 0; }
body.expose-on .osx-win, body.expose-desk .osx-win { cursor: default; }
body.expose-on .osx-win *, body.expose-desk .osx-win * { pointer-events: none !important; }
body.expose-on .osx-win.expose-out { opacity: 0; pointer-events: none; }
.osx-win.expose-hover::after {
  content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none;
  background: rgba(150, 190, 255, 0.22); box-shadow: inset 0 0 0 3px rgba(120, 170, 255, 0.75);
}
.expose-label {
  position: fixed; z-index: 948; pointer-events: none; transform: translate(-50%, -50%);
  padding: 4px 14px 5px; border-radius: 12px; background: rgba(0, 0, 0, 0.62);
  color: #fff; font: 700 15px/1.25 var(--ui-font); white-space: nowrap; max-width: 70vw;
  overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 0.12s ease;
}
.expose-label.show { opacity: 1; }
.expose-corner { position: fixed; left: 0; bottom: 0; width: 6px; height: 6px; z-index: 990; }
.expose-corner.br { left: auto; right: 0; }
.osx-dock-wrap { max-width: none; }
.menu-drop-item.minimized-item::before { content: "\25C6"; position: absolute; left: 6px; font-size: 10px; }

/* ---- Finder desktop icons: free placement on a grid, selection, rubber band ---- */
.desktop-icons.free { inset: 0; width: auto; display: block; pointer-events: none; }
.desktop-icons.free .desk-icon { position: absolute; width: 114px; pointer-events: auto; box-sizing: border-box; }
.desktop-icons.dragging { z-index: 945; }
.desk-icon.drag-src { opacity: 0.6; }
.desk-icon { -webkit-user-drag: none; user-select: none; touch-action: none; }
.desk-icon.selected.dim span { background: #a8a8a8; }
.desk-band {
  position: absolute; z-index: 6; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}
@media (prefers-reduced-motion: reduce) {
  .osx-win.expose-anim, .expose-dim { transition-duration: 0.01s !important; }
}
@media (max-width: 960px) {
  .osx-win.minimized { display: none; }
  .dock-mini { width: 40px; }
  .dock-mini .dock-mini-face { width: 38px; height: 38px; }
  .expose-corner { display: none; }
}

/* ---- formerly the second inline block (after the module stylesheets); its selectors carry IDs, so it still wins ---- */
/* Address Book / iCal / Mail windows (closed until opened from the Dock or a menu). */
#win-addressbook > .osx-body > .win-fill,
#win-ical > .osx-body > .win-fill,
#win-mail > .osx-body > .win-fill { overflow: hidden; }
/* iCal's Info drawer sits beside the window: it goes away with the window into the Dock and during Exposé. */
.pical-drawer.is-outside:has(+ #win-ical.minimized),
.pical-drawer.is-outside:has(+ #win-ical.genie-anim),
body.expose-on .pical-drawer.is-outside,
body.expose-desk .pical-drawer.is-outside { visibility: hidden; }
@media (max-width: 960px) {
  #win-addressbook #panther-addressbook { height: 520px; }
  #win-ical #panther-ical { height: 560px; }
  #win-mail #panther-mail { height: 460px; }
}
/* Applications folder: Finder icon view */
#win-apps .apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); align-content: start; gap: 6px 4px; padding: 14px 10px; background: #fff; overflow-y: auto; outline: none; }
.apps-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px; border: 0; background: transparent; font: 11px/1.2 var(--ui-font); color: #000; cursor: default; }
.apps-item svg { width: 48px; height: 48px; padding: 2px; border-radius: 4px; }
.apps-item span { padding: 1px 5px; border-radius: 8px; text-align: center; }
.apps-item.sel svg { background: rgba(0, 0, 0, 0.16); }
.apps-item.sel span { background: var(--aqua-sel); color: #fff; }
.apps-grid:focus-visible .apps-item.sel span { box-shadow: 0 0 0 2px #7ba7e1; }
/* the folder window's working Back / Forward segment */
.fd-nav-b { display: block; border: 0; padding: 0; margin: 0; background: none; font: inherit; cursor: default; }
.fd-nav-b + .fd-nav-b i { border-left: 1px solid #77797e; }
.fd-nav-b:disabled svg { opacity: 0.55; }
.fd-nav-b:not(:disabled):active i { background: linear-gradient(180deg, #c9ccd1 0%, #b4b7bd 50%, #cfd2d6 100%); }
.fd-nav-b:focus { outline: none; }
.fd-nav-b:focus-visible i { box-shadow: inset 0 0 0 2px #7fb2ff; }
#win-apps.no-toolbar .finder-toolbar, #win-apps.no-toolbar .finder-sidebar { display: none; }
#win-apps.no-toolbar .finder-main { grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
.lazy-host { position: relative; display: flex; flex-direction: column; min-height: 0; }
.lazy-msg { margin: auto; font: 12px var(--ui-font); color: #555; }
/* Blog folder (Finder list view) + post window (TextEdit); module styles are in blog/blog.css */
#win-blog.no-toolbar .finder-toolbar, #win-blog.no-toolbar .finder-sidebar { display: none; }
#win-blog.no-toolbar .finder-main { grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
#win-mail.no-toolbar .pml-toolbar { display: none; }
@media (max-width: 960px) {
  #win-blog #blog-list { height: 220px; }
}

/* Address Book title-bar card icon: sized here too, since addressbook.css only loads when Address Book opens */
.pab-proxy { display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }

/* Chess (10.3): a standard Aqua window with a flat grey content area (sampled #b3b3b3 from a Panther Chess screenshot) */
#win-chess > .osx-body { background: #b3b3b3; }
