/* Tahoe fidelity pass — optical glass, native typography, complete settings,
   full-width App Store details and a restored Books reading environment. */

@font-face {
  font-family: "SF Pro Display Tahoe";
  src: local("SF Pro Display Ultralight"), local(".SF Pro Display Ultralight");
  font-style: normal;
  font-weight: 100 299;
}
@font-face {
  font-family: "SF Pro Display Tahoe";
  src: local("SF Pro Display"), local(".SF Pro Display");
  font-style: normal;
  font-weight: 300 899;
}
@font-face {
  font-family: "SF Pro Text Tahoe";
  src: local("SF Pro Text"), local(".SF Pro Text");
  font-style: normal;
  font-weight: 100 899;
}
@font-face {
  font-family: "SF Compact Tahoe";
  src: local("SF Compact Text"), local(".SF Compact Text"), local("SF Compact");
  font-style: normal;
  font-weight: 100 899;
}
@font-face {
  font-family: "SF Mono Tahoe";
  src: local("SF Mono"), local("SFMono-Regular"), local(".SF NS Mono");
  font-style: normal;
  font-weight: 100 899;
}
@font-face {
  font-family: "New York Tahoe";
  src: local("New York"), local("New York Small"), local(".New York");
  font-style: normal;
  font-weight: 100 899;
}

:root {
  --font: "SF Pro Text Tahoe", "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", "Segoe UI Variable Text", system-ui, sans-serif;
  --font-heading: "SF Pro Display Tahoe", "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", "Segoe UI Variable Display", system-ui, sans-serif;
  --font-compact: "SF Compact Tahoe", "SF Compact Text", "SF Pro Text Tahoe", "PingFang SC", "Segoe UI", sans-serif;
  --mono: "SF Mono Tahoe", "SF Mono", "Cascadia Mono", "Cascadia Code", Consolas, monospace;
  --serif: "New York Tahoe", "New York", "Songti SC", "STSong", Georgia, serif;
  --tahoe-spring: cubic-bezier(.25, 1.1, .35, 1);
  --tahoe-snap: cubic-bezier(.22, .94, .3, 1.08);
  --glass-blur-boost: 0px;
  --glass-saturation: 185%;
  --glass-brightness: .96;
  --glass-noise-opacity: .16;
  --glass-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.48'/%3E%3C/svg%3E");
  --glass-specular:
    radial-gradient(140% 70% at var(--glass-x, 22%) -12%, rgba(255,255,255,.34), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.025) 42%, rgba(0,0,0,.12));
}

/* Windows gets a deliberate type system instead of an invisible SF-local fallback. */
html.tahoe-windows {
  --font: "Segoe UI Variable Text", "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --font-heading: "Segoe UI Variable Display", "Segoe UI Variable Text", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --font-compact: "Segoe UI Variable Text", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
}

html.tahoe-windows h1,
html.tahoe-windows h2,
html.tahoe-windows h3,
html.tahoe-windows .window-title,
html.tahoe-windows .lock-time {
  font-family: var(--font-heading);
  font-variation-settings: "wght" var(--tahoe-heading-weight, 620), "opsz" 32;
}

html,
body,
button,
input,
textarea,
select {
  font-family: var(--font);
  font-optical-sizing: auto;
}

::selection {
  color: inherit;
  background: color-mix(in srgb, var(--accent, #0a84ff), transparent 66%);
  text-shadow: 0 1px rgba(255,255,255,.24);
}

input,
textarea,
[contenteditable="true"] {
  caret-color: color-mix(in srgb, var(--accent, #0a84ff), white 10%);
}

/* Multi-layer Liquid Glass. Noise is static; light follows the pointer. */
.liquid {
  isolation: isolate;
  background:
    radial-gradient(120% 130% at var(--glass-x, 20%) var(--glass-y, 0%), rgba(255,255,255,.14), transparent 45%),
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.035) 42%, rgba(4,8,18,.12));
  border: 0 !important;
  box-shadow:
    var(--glass-shadow, 0 18px 48px rgba(0,0,0,.32)),
    inset 0 1px 0 rgba(255,255,255,.38),
    inset 0 -1px 0 rgba(0,0,0,.23);
  backdrop-filter:
    blur(calc(var(--glass-blur, 34px) + var(--glass-blur-boost)))
    saturate(var(--glass-saturation))
    brightness(var(--glass-brightness));
  -webkit-backdrop-filter:
    blur(calc(var(--glass-blur, 34px) + var(--glass-blur-boost)))
    saturate(var(--glass-saturation))
    brightness(var(--glass-brightness));
  transition:
    background .24s ease,
    box-shadow .24s ease,
    backdrop-filter .24s ease,
    -webkit-backdrop-filter .24s ease,
    filter .18s ease !important;
}

.liquid::before {
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background-image: var(--glass-noise), var(--glass-specular) !important;
  background-size: 128px 128px, 100% 100%;
  background-blend-mode: soft-light, normal;
  opacity: var(--glass-noise-opacity);
  mix-blend-mode: soft-light;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 2px, #000 calc(100% - 2px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 2px, #000 calc(100% - 2px), transparent 100%);
  animation: none !important;
}

.liquid::after {
  z-index: 2;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: inherit;
  padding: 1px;
  background:
    linear-gradient(155deg, rgba(255,255,255,.75), rgba(255,255,255,.16) 30%, rgba(255,255,255,.055) 56%, rgba(0,0,0,.34)) border-box;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: .78;
  transform: none;
  animation: none !important;
  pointer-events: none;
}

.liquid:hover {
  filter: brightness(1.055);
}

.menubar.liquid {
  --glass-blur: 18px;
  --glass-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.dock.liquid {
  --glass-blur: 54px;
  --glass-shadow: 0 18px 46px rgba(0,0,0,.3);
}
.control-center.liquid,
.notification-center.liquid {
  --glass-blur: 38px;
  --glass-shadow: 0 18px 48px rgba(0,0,0,.34);
}
.menu-pop.liquid,
.context-menu.liquid {
  --glass-blur: 38px;
  --glass-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.spotlight-panel.liquid {
  --glass-blur: 52px;
  --glass-shadow: 0 38px 96px rgba(0,0,0,.48);
}

.window,
.cp-native-window.window {
  background:
    linear-gradient(155deg, rgba(255,255,255,.055), transparent 35%),
    color-mix(in srgb, var(--cp-bg, #1c1c1e), transparent 4%);
  border: 0 !important;
  box-shadow:
    0 34px 86px rgba(0,0,0,.46),
    0 8px 24px rgba(0,0,0,.28),
    inset 0 1px rgba(255,255,255,.2),
    inset 0 0 0 1px rgba(255,255,255,.095);
  backdrop-filter: blur(42px) saturate(175%);
  -webkit-backdrop-filter: blur(42px) saturate(175%);
}

.window.active {
  box-shadow:
    0 38px 94px rgba(0,0,0,.48),
    0 10px 28px rgba(0,0,0,.25),
    inset 0 1px rgba(255,255,255,.24),
    inset 0 0 0 1px rgba(255,255,255,.12);
}

.window.fullscreen {
  z-index: 980 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.app-fullscreen-active .windows {
  inset: 0 !important;
}
.window.fullscreen .resize-handle {
  display: none !important;
}
body.app-fullscreen-active .menubar,
body.app-fullscreen-active .dock {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.window .titlebar {
  height: 38px;
  min-height: 38px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.115), rgba(255,255,255,.025)),
    color-mix(in srgb, var(--cp-bg, #1c1c1e), transparent 18%);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  box-shadow: inset 0 1px rgba(255,255,255,.14);
}

.window.opening { animation-timing-function: var(--tahoe-spring) !important; }
.window.dragging {
  transform: scale(1.012) !important;
  opacity: .85;
  filter: brightness(1.04);
  box-shadow: 0 40px 96px rgba(0,0,0,.48) !important;
}

.dock-icon img,
.dock-icon .real-app-icon-img {
  filter: drop-shadow(0 7px 8px rgba(0,0,0,.2));
  -webkit-box-reflect: below -8px linear-gradient(transparent 30%, rgba(0,0,0,.1));
  transition: filter .18s ease, transform .2s var(--tahoe-snap);
}
.dock-item:hover .dock-icon img,
.dock-item:hover .dock-icon .real-app-icon-img {
  filter:
    brightness(1.075)
    saturate(1.04)
    drop-shadow(0 12px 12px rgba(0,0,0,.28));
}
.dock-item[data-app="automator"] .dock-icon::after {
  display: none;
}
.dock-item[data-app="automator"] .dock-icon img,
.dock-icon.app-icon.app-automator img.real-app-icon-img {
  transform: translateY(4px) scale(.78) !important;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.24)) !important;
  -webkit-box-reflect: none !important;
}

/* Native three-state controls. */
.cp-native-window button:not(.close):not(.minimize):not(.maximize),
.mac-confirm-button,
.tool-button {
  transition:
    background .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    filter .16s ease,
    transform .13s var(--tahoe-snap) !important;
}
.cp-native-window button:not(.close):not(.minimize):not(.maximize):hover,
.tool-button:hover {
  filter: brightness(1.075);
}
.cp-native-window button:not(.close):not(.minimize):not(.maximize):active,
.tool-button:active {
  filter: brightness(.88);
  transform: scale(.965) !important;
}

input[type="range"] {
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent), white 8%), color-mix(in srgb, var(--accent), #7048e8 28%)) 0/var(--range-progress, 64%) 100% no-repeat,
    rgba(128,128,128,.24);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.2), 0 1px rgba(255,255,255,.12);
}
input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  appearance: none;
  -webkit-appearance: none;
  border: .5px solid rgba(0,0,0,.14);
  border-radius: 50%;
  background: linear-gradient(#fff,#efeff2);
  box-shadow: 0 2px 6px rgba(0,0,0,.34), inset 0 1px white;
}

.cp-switch {
  width: 36px;
  height: 22px;
  background: rgba(120,120,128,.34);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), inset 0 2px 4px rgba(0,0,0,.13);
}
.cp-switch i,
.cp-switch em {
  width: 18px;
  height: 18px;
  box-shadow: 0 2px 5px rgba(0,0,0,.38), inset 0 1px white;
  transition: transform .24s cubic-bezier(.22, .94, .3, 1);
}
.cp-switch.on {
  background: var(--accent);
}
.cp-switch.on i,
.cp-switch.on em {
  transform: translateX(14px);
}

.menu-pop .menu-item:hover,
.context-menu .context-item:hover,
.context-menu [class*="item"]:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent), white 8%), color-mix(in srgb, var(--accent), black 7%)) !important;
  color: white !important;
}

.menu-pop .shortcut,
.menu-shortcut,
.context-shortcut,
.menu-item kbd,
.context-item kbd {
  margin-left: 34px;
  color: rgba(255,255,255,.5);
  font: 500 11px/1 var(--font);
  font-variant-numeric: tabular-nums;
}
.menu-pop .menu-item:hover .shortcut,
.context-item:hover .context-shortcut {
  color: rgba(255,255,255,.72);
}

/* Traffic lights reveal their glyphs as a single, crisp hover state. */
.traffic button,
.window-controls button {
  box-shadow: inset 0 1px rgba(255,255,255,.32);
}
.window-controls button::before {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .12s ease;
}
.window-controls:hover button::before { opacity: 1; }
.window-controls:hover .close::before { content: "\00d7"; }
.window-controls:hover .minimize::before { content: "\2212"; }
.window-controls:hover .maximize::before { content: "+"; }

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: transparent;
  background-clip: padding-box;
}
*:hover::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, currentColor, transparent 78%);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, currentColor, transparent 62%);
  background-clip: padding-box;
}

/* Menu bar spacing and state indicators. */
.menubar {
  height: 26px;
  padding-inline: 10px 7px;
  border-radius: 0 !important;
}
.menubar-item,
.status-button,
.clock-button {
  font-size: 13px;
}
.menu-right {
  min-width: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 3px !important;
  white-space: nowrap;
}
.status-button {
  margin: 0 !important;
  width: 26px;
  min-width: 26px !important;
  flex: 0 0 26px;
  padding: 0 !important;
  display: grid;
  place-items: center;
}
.status-button .status-icon {
  width: 15px;
  height: 15px;
  flex: none;
}
.status-button.cw-space-indicator {
  width: auto !important;
  min-width: 70px !important;
  max-width: 112px;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px !important;
}
.cw-space-indicator .cw-symbol {
  width: 15px;
  height: 15px;
}
.cw-space-indicator b {
  display: block;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1;
}
.clock-button {
  min-width: 0;
  flex: 0 0 auto;
  padding-inline: 6px;
  font-family: var(--mono);
  font-size: 12px !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}
.tahoe-focus-indicator {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: rgba(255,255,255,.92);
  font-size: 13px;
}
.tahoe-focus-indicator[hidden] { display: none; }
#battery-button.charging { position: relative; }
#battery-button.charging::after {
  content: "⚡";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffe347;
  font-size: 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* Lock screen: correct type scale, widgets, notification and quick actions. */
.lock-screen {
  overflow: hidden;
  border-radius: 0;
  background: none !important;
}
.lock-screen::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -12px;
  background: var(--lock-wallpaper, url("../assets/wallpapers/Tahoe Day.jpg") center/cover no-repeat);
  filter: blur(1.5px) brightness(.96);
  transform: scale(1.008);
  pointer-events: none;
}
.lock-screen::after {
  z-index: 1;
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.14), transparent 32%, rgba(0,0,0,.13));
}
.lock-top {
  z-index: 2;
  top: 104px;
}
.lock-time {
  font-family: "SF Pro Display Tahoe", "SF Pro Display", "Segoe UI Variable Display", sans-serif;
  font-size: clamp(72px, 7vw, 92px);
  font-weight: 200;
  letter-spacing: -.055em;
  text-shadow: 0 2px 22px rgba(0,0,0,.2);
}
.lock-date {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 400;
}
.lock-user { z-index: 3; }
.tahoe-lock-widgets {
  position: absolute;
  z-index: 2;
  top: 272px;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, 185px);
  gap: 10px;
  transform: translateX(-50%);
}
.tahoe-lock-widget {
  min-height: 74px;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  color: white;
  background: rgba(22,26,34,.24);
  box-shadow: inset 0 1px rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.1);
  backdrop-filter: blur(24px) saturate(155%);
}
.tahoe-lock-widget > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  font-size: 21px;
}
.tahoe-lock-widget > div { display: grid; gap: 2px; }
.tahoe-lock-widget b { font-size: 14px; }
.tahoe-lock-widget small { color: rgba(255,255,255,.66); font-size: 10px; }
.tahoe-lock-notification {
  position: absolute;
  z-index: 4;
  top: 28px;
  left: 50%;
  width: min(390px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 17px;
  color: white;
  background: rgba(27,30,38,.42);
  box-shadow: inset 0 1px rgba(255,255,255,.25), 0 12px 34px rgba(0,0,0,.15);
  backdrop-filter: blur(30px) saturate(170%);
  transform: translate(-50%, -140%);
  animation: tahoe-notification-drop .58s .8s var(--tahoe-spring) forwards;
}
.tahoe-lock-notification > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg,#ff6b61,#ff2d55);
  font-size: 18px;
}
.tahoe-lock-notification div { display: grid; }
.tahoe-lock-notification b { font-size: 11px; }
.tahoe-lock-notification small { color: rgba(255,255,255,.68); font-size: 10px; }
.tahoe-lock-notification time { align-self: start; color: rgba(255,255,255,.56); font-size: 9px; }
@keyframes tahoe-notification-drop {
  to { transform: translate(-50%, 0); }
}
.tahoe-lock-actions {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 25px;
  left: 24px;
  display: flex;
  justify-content: space-between;
}
.tahoe-lock-actions button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: white;
  background: rgba(20,24,30,.42);
  box-shadow:
    inset 0 1px rgba(255,255,255,.26),
    inset 0 0 0 1px rgba(255,255,255,.14),
    0 7px 18px rgba(0,0,0,.14);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  transition:
    transform .18s var(--tahoe-spring),
    color .16s ease,
    background .16s ease;
}
.tahoe-lock-actions button svg {
  width: 23px;
  height: 23px;
  display: block;
  fill: currentColor;
}
.tahoe-lock-actions button:hover {
  transform: scale(1.055);
  background: rgba(34,38,45,.58);
}
.tahoe-lock-actions button:active {
  transform: scale(.94);
}
.tahoe-lock-actions button.active {
  color: #111318;
  background: rgba(255,255,255,.92);
}

/* System Settings: complete user/account workflow. */
.cp-settings-app,
.cp-settings-sidebar {
  font-family: var(--font-compact);
}
.cp-settings-detail {
  padding-top: 30px;
}
.cp-settings-group {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), transparent 52%),
    color-mix(in srgb, var(--cp-surface), transparent 2%);
  box-shadow:
    inset 0 1px rgba(255,255,255,.075),
    inset 0 0 0 1px rgba(255,255,255,.035),
    0 7px 22px rgba(0,0,0,.05);
}
.cp-user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  color: white;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.38), 0 5px 13px rgba(0,0,0,.2);
  font-weight: 650;
}
.cp-user-avatar.hero { width: 78px; height: 78px; font-size: 31px; }
.cp-user-avatar.account { width: 72px; height: 72px; font-size: 28px; }
.cp-user-avatar.store { width: 28px; height: 28px; font-size: 12px; }
.cp-user-avatar.store-account { width: 78px; height: 78px; font-size: 29px; }
.cp-user-profile-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 17px;
  margin-bottom: 18px;
  padding: 17px;
  border: 1px solid var(--cp-border);
  border-radius: 15px;
  background:
    radial-gradient(circle at 95% 0, color-mix(in srgb, var(--accent), transparent 78%), transparent 42%),
    var(--cp-surface);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.08);
}
.cp-user-profile-card h2 { margin: 0; font: 700 21px/1.15 var(--font-heading); letter-spacing: -.03em; }
.cp-user-profile-card p { margin: 4px 0 7px; color: var(--cp-secondary); font-size: 11px; }
.cp-user-profile-card div > span { display: block; max-width: 390px; color: var(--cp-tertiary); font-size: 9.5px; line-height: 1.45; }
.cp-user-editor { overflow: visible; }
.cp-profile-field {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--cp-separator);
}
.cp-profile-field > span { display: grid; gap: 2px; }
.cp-profile-field b { font-size: 12px; font-weight: 530; }
.cp-profile-field small { color: var(--cp-secondary); font-size: 9.5px; }
.cp-profile-field input {
  width: min(270px, 48%);
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--cp-border);
  border-radius: 7px;
  outline: 0;
  color: var(--cp-text);
  background: var(--cp-surface-strong);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.12);
}
.cp-profile-field input:focus {
  border-color: var(--cp-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp-blue), transparent 70%);
}
.cp-avatar-picker { display: flex; gap: 8px; }
.cp-avatar-picker button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  color: white;
  background: var(--avatar-bg);
  box-shadow: inset 0 1px rgba(255,255,255,.36), 0 3px 8px rgba(0,0,0,.2);
  font-size: 14px;
  font-weight: 700;
}
.cp-avatar-picker button.active {
  border-color: white;
  outline: 2px solid var(--cp-blue);
  outline-offset: 2px;
}
.cp-avatar-picker button.import {
  border: 1px dashed var(--cp-secondary);
  color: var(--cp-secondary);
  background: var(--cp-surface);
  font-size: 21px;
  font-weight: 300;
}
.cp-profile-actions {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 13px;
}
.cp-profile-actions > span { margin-right: auto; color: var(--cp-red); font-size: 10px; }
.cp-primary-button {
  height: 27px;
  padding: 0 13px;
  border-radius: 7px;
  color: white;
  background: var(--cp-blue);
  box-shadow: inset 0 1px rgba(255,255,255,.22), 0 4px 10px color-mix(in srgb, var(--cp-blue), transparent 70%);
  font-size: 11px;
  font-weight: 620;
}
.cp-sheet-backdrop {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: start center;
  padding-top: 0;
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(3px);
}
.cp-password-sheet {
  width: min(430px, calc(100% - 42px));
  display: grid;
  gap: 11px;
  padding: 20px;
  border: 1px solid var(--cp-border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  color: var(--cp-text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 35%),
    color-mix(in srgb, var(--cp-bg), transparent 2%);
  box-shadow: 0 22px 58px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.12);
  animation: cp-sheet-in .32s var(--tahoe-spring);
}
@keyframes cp-sheet-in {
  from { opacity: 0; transform: translateY(-42px) scale(.98); }
}
.cp-password-sheet header {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
}
.cp-password-lock {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: linear-gradient(145deg,#999,#555);
  box-shadow: inset 0 1px rgba(255,255,255,.3);
}
.cp-password-sheet h2 { margin: 0; font: 700 16px/1.2 var(--font-heading); }
.cp-password-sheet header p { margin: 3px 0 0; color: var(--cp-secondary); font-size: 10px; }
.cp-password-sheet > label {
  display: grid;
  grid-template-columns: 94px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.cp-password-sheet input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--cp-border);
  border-radius: 7px;
  outline: 0;
  color: var(--cp-text);
  background: var(--cp-surface-strong);
}
.cp-password-sheet input:focus { border-color: var(--cp-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp-blue), transparent 70%); }
.cp-password-error { min-height: 13px; margin: 0 0 -2px 104px; color: var(--cp-red); font-size: 9.5px; }
.cp-password-sheet footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.cp-password-sheet footer button {
  min-width: 76px;
  height: 28px;
  border-radius: 7px;
  background: var(--cp-surface-strong);
  font-size: 11px;
}
.cp-password-sheet footer button.primary { color: white; background: var(--cp-blue); }

/* App Store: details use the entire content column, never a half-window overlay. */
.cp-store-app {
  grid-template-columns: 204px minmax(0, 1fr);
}
.cp-store-sidebar {
  background:
    linear-gradient(155deg, rgba(255,255,255,.045), transparent 52%),
    color-mix(in srgb, var(--cp-sidebar), transparent 4%);
  backdrop-filter: blur(24px) saturate(150%);
}
.cp-store-main {
  grid-column: 2;
  grid-row: 1;
  padding: 27px clamp(26px, 4vw, 48px) 58px;
}
.cp-store-detail {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-width: 0;
  padding: 22px clamp(28px, 5vw, 64px) 64px;
  border: 0;
  background:
    radial-gradient(circle at 95% 0, color-mix(in srgb, var(--accent), transparent 90%), transparent 36%),
    var(--cp-bg);
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(28px);
  transition: opacity .2s ease, transform .32s var(--tahoe-spring), visibility 0s .32s;
}
.cp-store-app.detail-open .cp-store-main {
  display: none;
}
.cp-store-app.detail-open .cp-store-detail.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: opacity .2s ease, transform .32s var(--tahoe-spring);
}
.cp-store-detail-close {
  position: sticky;
  z-index: 4;
  top: -8px;
  float: none;
  width: auto;
  height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 8px -8px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--cp-blue);
  background: color-mix(in srgb, var(--cp-bg), transparent 8%);
  backdrop-filter: blur(24px);
  font-size: 11px;
  font-weight: 600;
}
.cp-store-detail-close span { font-size: 20px; font-weight: 400; line-height: 0; }
.cp-store-detail > header {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  margin: 12px 0 22px;
}
.cp-store-detail > header > img {
  width: 112px;
  height: 112px;
  border-radius: 25px;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.2));
}
.cp-store-detail > header h2 {
  margin-top: 9px;
  font: 750 28px/1.05 var(--font-heading);
}
.cp-store-detail > header p { max-width: 540px; font-size: 12px; }
.cp-store-stats { margin-top: 5px; padding: 14px 0; }
.cp-store-stats b { font: 700 17px/1 var(--font-heading); }
.cp-store-screenshots {
  grid-auto-columns: minmax(330px, 52%);
  gap: 13px;
  margin: 24px 0 26px;
  padding-bottom: 5px;
}
.cp-store-screenshots > .cp-store-shot {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border-radius: 16px;
  color: white;
  background:
    radial-gradient(circle at calc(18% + var(--shot) * 30%) 8%, rgba(255,255,255,.34), transparent 34%),
    linear-gradient(calc(132deg + var(--shot) * 17deg), #087dd0, #5948d5 55%, #c347b8);
  box-shadow: inset 0 1px rgba(255,255,255,.3), 0 14px 34px rgba(0,0,0,.18);
}
.cp-store-shot-1 {
  background:
    radial-gradient(circle at 88% 4%, rgba(103,232,255,.34), transparent 34%),
    linear-gradient(145deg, #1746a5, #5635ad 58%, #9f3ec4) !important;
}
.cp-store-shot-2 {
  background:
    radial-gradient(circle at 18% 2%, rgba(255,226,151,.3), transparent 35%),
    linear-gradient(145deg, #006a7c, #3c4bb1 56%, #8b3f9e) !important;
}
.cp-shot-window {
  position: absolute;
  inset: 19px 18px 65px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 11px;
  color: #f6f6f8;
  background: rgba(19,20,28,.9);
  box-shadow: 0 20px 34px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.09);
}
.cp-shot-window span {
  position: static;
  z-index: auto;
  inset: auto;
  display: initial;
  color: inherit;
}
.cp-shot-window b {
  font-size: inherit;
}
.cp-shot-window > header {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  height: 27px;
  padding: 0 8px;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 -1px rgba(255,255,255,.05);
  font-size: 8px;
}
.cp-shot-window > header > span {
  display: flex;
  gap: 4px;
}
.cp-shot-window > header > span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5f57;
}
.cp-shot-window > header > span i:nth-child(2) { background: #ffbd2e; }
.cp-shot-window > header > span i:nth-child(3) { background: #28c840; }
.cp-shot-window > header > b {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-shot-window > header > em {
  justify-self: end;
  color: rgba(255,255,255,.55);
  font-style: normal;
  letter-spacing: 1px;
}
.cp-shot-layout {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr);
  height: calc(100% - 27px);
}
.cp-shot-layout > nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 7px;
  border-right: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.045);
}
.cp-shot-layout > nav b {
  margin: 0 4px 6px;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-shot-layout > nav i {
  padding: 4px 5px;
  border-radius: 4px;
  color: rgba(255,255,255,.57);
  font-size: 6.5px;
  font-style: normal;
}
.cp-shot-layout > nav i.active {
  color: white;
  background: color-mix(in srgb, var(--accent), transparent 16%);
}
.cp-shot-layout > main {
  min-width: 0;
  padding: 9px;
}
.cp-shot-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 21px;
  margin-bottom: 8px;
}
.cp-shot-toolbar strong {
  flex: 1;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-shot-toolbar i {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: rgba(255,255,255,.1);
}
.cp-shot-overview main > section {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
  height: calc(100% - 29px);
}
.cp-shot-overview article {
  min-width: 0;
  padding: 9px;
  border-radius: 7px;
  background: rgba(255,255,255,.065);
}
.cp-shot-overview article:first-child {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto 1fr;
  gap: 3px 7px;
  align-content: start;
}
.cp-shot-app-icon {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border-radius: 7px;
}
.cp-shot-overview article b { font-size: 8px; }
.cp-shot-overview article small {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255,255,255,.52);
  font-size: 6px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.cp-shot-overview article:last-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.cp-shot-overview article:last-child em {
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(60,174,255,.72), rgba(134,72,219,.72));
}
.cp-shot-workspace main > section {
  display: grid;
  grid-template-columns: minmax(0,1fr) 72px;
  gap: 8px;
  height: calc(100% - 29px);
}
.cp-shot-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  border-radius: 7px;
  background: #11141b;
}
.cp-shot-lines i {
  width: calc(42% + var(--line) * 5%);
  max-width: 92%;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #72d1ff 0 22%, #bd7dff 22% 48%, rgba(255,255,255,.18) 48%);
}
.cp-shot-workspace aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
}
.cp-shot-workspace aside b { font-size: 7px; }
.cp-shot-workspace aside span {
  height: 13px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
}
.cp-shot-workspace aside button {
  margin-top: auto;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  color: white;
  background: var(--accent);
  font-size: 6px;
}
.cp-shot-local main > section {
  display: grid;
  grid-template-columns: .8fr 1.3fr;
  gap: 8px;
  height: calc(100% - 29px);
}
.cp-shot-local article {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(52,199,89,.22), rgba(10,132,255,.13));
}
.cp-shot-local article b { color: rgba(255,255,255,.6); font-size: 6px; }
.cp-shot-local article strong { margin: 8px 0 3px; font-size: 20px; }
.cp-shot-local article small { color: rgba(255,255,255,.55); font-size: 6px; }
.cp-shot-table {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255,255,255,.055);
}
.cp-shot-table span {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 5px;
  min-height: 25%;
  padding: 0 7px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  font-size: 6px;
}
.cp-shot-table span i {
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  color: white;
  background: var(--accent);
  font-style: normal;
}
.cp-shot-table span em { color: rgba(255,255,255,.45); font-style: normal; }
.cp-store-shot > footer {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  display: flex;
  flex-direction: column;
}
.cp-store-shot > footer b { font-size: 14px; }
.cp-store-shot > footer small {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255,255,255,.72);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-store-description { max-width: 760px; font-size: 11.5px; line-height: 1.62; }
.cp-store-whats-new,
.cp-store-privacy { max-width: 760px; }
.cp-store-account {
  grid-template-columns: 30px 1fr;
}
.cp-store-account > .cp-user-avatar:first-child {
  width: 28px;
  height: 28px;
}
.cp-store-account-page > .cp-user-avatar { width: 78px; height: 78px; }
.cp-store-detail > header button {
  min-width: 64px !important;
  height: 28px !important;
  padding: 0 15px !important;
  color: white !important;
  background: var(--accent) !important;
  font-size: 11px !important;
  line-height: 1 !important;
}

@media (max-width: 600px) {
  .status-button.cw-space-indicator {
    min-width: 26px !important;
    width: 26px !important;
    padding: 0 !important;
  }
}

/* Books: restore a light editorial environment with a real serif role. */
#win-books.window {
  min-width: min(780px, 100%);
  background: #f4f1ec !important;
}
#win-books .titlebar {
  background: rgba(241,238,233,.82) !important;
  backdrop-filter: blur(26px) saturate(140%);
}
.mi-books {
  grid-template-columns: 208px minmax(0,1fr);
  background: #f4f1ec;
}
.mi-books .mi-media-sidebar {
  background:
    linear-gradient(160deg, rgba(255,255,255,.48), transparent 58%),
    rgba(232,228,222,.86);
  backdrop-filter: blur(28px) saturate(145%);
}
.mi-books-main {
  padding: 31px clamp(28px, 4vw, 52px) 56px;
  background:
    radial-gradient(circle at 98% 0, rgba(233,139,55,.12), transparent 30%),
    linear-gradient(180deg,#faf8f4,#f5f2ed);
}
.mi-library-title h1,
.mi-shelf-head h2 {
  font-family: var(--font-heading);
}
.mi-book-feature h2,
.mi-book-cover b,
.mi-reader-page,
.mi-reader-page h1 {
  font-family: var(--serif);
}
.mi-book-feature {
  min-height: 232px;
  border-radius: 22px;
  box-shadow: 0 22px 45px rgba(153,82,30,.18), inset 0 1px rgba(255,255,255,.3);
}
.mi-book-grid {
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 26px 22px;
}
.mi-book-grid > button { max-width: 150px; }
.mi-book-cover {
  width: 124px;
  height: 169px;
  box-shadow: -8px 11px 22px rgba(34,34,38,.22), inset 2px 0 2px rgba(255,255,255,.18);
}
.mi-book-grid button > span { width: 124px; }
.mi-reader-page {
  max-width: 700px;
  margin-inline: auto;
  color: #2a2622;
  font-size: var(--reader-size);
  line-height: 1.82;
  text-rendering: optimizeLegibility;
}
.mi-reader-page h1 {
  font-weight: 600;
  letter-spacing: -.035em;
}

/* Launchpad uses a row-major 30ms stagger. */
.launch-app {
  animation-delay: calc(var(--launch-index, 0) * 30ms) !important;
}
.spotlight-panel {
  transform: translateY(-14px) scale(.9) !important;
  filter: blur(14px);
  transition: transform .3s var(--tahoe-spring), opacity .18s ease, filter .1s ease !important;
}
.spotlight {
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition:
    background .16s ease,
    backdrop-filter .16s ease,
    -webkit-backdrop-filter .16s ease;
}
.spotlight.spotlight-visible {
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.spotlight.spotlight-visible .spotlight-panel {
  transform: translateY(0) scale(1) !important;
  filter: blur(0);
}

.light-mode {
  --cp-bg: rgba(246,246,248,.94);
  --cp-sidebar: rgba(230,230,234,.82);
  --glass-blur-boost: 5px;
  --glass-saturation: 140%;
  --glass-brightness: 1.02;
  --glass-noise-opacity: .08;
}
.light-mode .window,
.light-mode .cp-native-window.window {
  box-shadow: 0 34px 84px rgba(0,0,0,.24), inset 0 1px white, inset 0 0 0 1px rgba(0,0,0,.08);
}

@media (prefers-color-scheme: light) {
  html:not(.tahoe-night):not(.light-mode) {
    --glass-blur-boost: 3px;
    --glass-saturation: 150%;
    --glass-brightness: 1;
    --glass-noise-opacity: .1;
  }
}

/* Accent is a real system token across controls, links, selections and tags. */
.cp-primary-button,
.cp-password-sheet footer button.primary,
.cp-settings-nav-item.active,
.cp-store-sidebar nav > button.active,
.cp-store-detail header button,
.cp-pill-button.primary,
.cp-segmented button.active {
  background-color: var(--accent) !important;
}
.cp-settings-detail a,
.cp-store-detail-close,
.cp-row a,
.cp-link,
.cp-tag,
.cp-settings-nav-item.active svg {
  color: var(--accent) !important;
}
.cp-profile-field input:focus,
.cp-password-sheet input:focus,
.cp-settings-detail select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 70%) !important;
}

.snap-preview {
  border: 1px solid color-mix(in srgb, var(--accent), white 48%) !important;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.2), rgba(255,255,255,.04)),
    color-mix(in srgb, var(--accent), transparent 72%) !important;
  box-shadow:
    0 18px 48px rgba(0,0,0,.22),
    inset 0 1px rgba(255,255,255,.48) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
  transition: all .18s var(--tahoe-spring) !important;
}

.launchpad {
  background: rgba(3,7,14,0);
  backdrop-filter: blur(0) saturate(100%) brightness(1);
  -webkit-backdrop-filter: blur(0) saturate(100%) brightness(1);
  transition:
    opacity .22s ease,
    background .26s ease,
    backdrop-filter .3s var(--tahoe-spring),
    -webkit-backdrop-filter .3s var(--tahoe-spring) !important;
}
.launchpad.show {
  background: rgba(3,7,14,.44);
  backdrop-filter: blur(42px) saturate(135%) brightness(.72);
  -webkit-backdrop-filter: blur(42px) saturate(135%) brightness(.72);
}

.tahoe-screenshot-flash {
  position: fixed;
  z-index: 1000002;
  inset: 0;
  background: white;
  pointer-events: none;
  animation: tahoe-screenshot-flash .28s ease-out forwards;
}
@keyframes tahoe-screenshot-flash {
  0% { opacity: .95; }
  100% { opacity: 0; }
}

.cp-accent-row > div {
  flex-wrap: nowrap;
  justify-content: flex-end;
  max-width: 280px;
}
.cp-accent-row > span {
  display: grid;
  gap: 2px;
}
.cp-accent-row > span small {
  color: var(--cp-secondary);
  font-size: 9px;
  line-height: 1.25;
}
.cp-accent-row button {
  width: 20px;
  height: 20px;
}

html.reduce-transparency .liquid,
html.reduce-transparency .window,
html.reduce-transparency .cp-settings-sidebar,
html.reduce-transparency .cp-store-sidebar,
html.reduce-transparency .mi-media-sidebar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.reduce-transparency .liquid::before { display: none; }

@media (max-width: 840px) {
  .tahoe-lock-widgets { grid-template-columns: 170px 170px; }
  .cp-settings-app { grid-template-columns: 220px minmax(0,1fr); }
  .cp-store-app { grid-template-columns: 178px minmax(0,1fr); }
  .cp-store-detail { padding-inline: 24px; }
  .cp-avatar-picker { flex-wrap: wrap; justify-content: flex-end; }
  .mi-books { grid-template-columns: 180px minmax(0,1fr); }
}

@media (max-width: 640px) {
  .tahoe-lock-widgets { display: none; }
  .cp-profile-field { align-items: flex-start; flex-direction: column; }
  .cp-profile-field input { width: 100%; }
  .cp-avatar-picker { justify-content: flex-start; }
  .cp-store-detail > header { grid-template-columns: 82px 1fr; }
  .cp-store-detail > header > img { width: 82px; height: 82px; }
}

@media (prefers-reduced-motion: reduce) {
  .tahoe-lock-notification { animation: none; transform: translate(-50%,0); }
}
