/* ==========================================================================
   macOS Web - system chrome styles
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;

  --accent: #0a82ff;
  --accent-deep: #0064e1;

  /* Light theme */
  --text: rgba(0, 0, 0, 0.88);
  --text-secondary: rgba(0, 0, 0, 0.5);
  --text-tertiary: rgba(0, 0, 0, 0.28);
  --menubar-bg: rgba(255, 255, 255, 0.32);
  --menubar-text: rgba(0, 0, 0, 0.85);
  --menu-bg: rgba(242, 242, 242, 0.72);
  --menu-border: rgba(255, 255, 255, 0.45);
  --menu-shadow: 0 10px 34px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.14);
  --dock-bg: rgba(246, 246, 246, 0.36);
  --dock-border: rgba(255, 255, 255, 0.42);
  --win-bg: #ffffff;
  --win-bg-translucent: rgba(246, 246, 246, 0.82);
  --titlebar-bg: #f2f1f1;
  --titlebar-bg-inactive: #f6f6f6;
  --titlebar-text: rgba(0, 0, 0, 0.85);
  --titlebar-text-inactive: rgba(0, 0, 0, 0.35);
  --sidebar-bg: rgba(234, 232, 231, 0.72);
  --hairline: rgba(0, 0, 0, 0.1);
  --hairline-strong: rgba(0, 0, 0, 0.16);
  --win-shadow: 0 24px 68px rgba(0, 0, 0, 0.38), 0 0 0 0.5px rgba(0, 0, 0, 0.22);
  --win-shadow-inactive: 0 10px 30px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.18);
  --win-inner-edge: inset 0 0.5px 0 rgba(255, 255, 255, 0.6);
  --control-bg: rgba(0, 0, 0, 0.05);
  --control-bg-hover: rgba(0, 0, 0, 0.09);
  --control-active: rgba(0, 0, 0, 0.14);
  --input-bg: #ffffff;
  --popover-bg: rgba(240, 240, 240, 0.76);
  --selected-row: rgba(0, 0, 0, 0.07);
  --scrollbar-thumb: rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] {
  --text: rgba(255, 255, 255, 0.88);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.28);
  --menubar-bg: rgba(24, 24, 26, 0.4);
  --menubar-text: rgba(255, 255, 255, 0.88);
  --menu-bg: rgba(44, 44, 46, 0.68);
  --menu-border: rgba(255, 255, 255, 0.16);
  --menu-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(0, 0, 0, 0.6), inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  --dock-bg: rgba(38, 38, 40, 0.38);
  --dock-border: rgba(255, 255, 255, 0.14);
  --win-bg: #1f2023;
  --win-bg-translucent: rgba(38, 38, 40, 0.78);
  --titlebar-bg: #323234;
  --titlebar-bg-inactive: #2a2a2c;
  --titlebar-text: rgba(255, 255, 255, 0.85);
  --titlebar-text-inactive: rgba(255, 255, 255, 0.32);
  --sidebar-bg: rgba(30, 30, 32, 0.62);
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --win-shadow: 0 24px 68px rgba(0, 0, 0, 0.62), 0 0 0 0.5px rgba(0, 0, 0, 0.7), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
  --win-shadow-inactive: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(0, 0, 0, 0.6), inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  --win-inner-edge: none;
  --control-bg: rgba(255, 255, 255, 0.08);
  --control-bg-hover: rgba(255, 255, 255, 0.13);
  --control-active: rgba(255, 255, 255, 0.2);
  --input-bg: rgba(255, 255, 255, 0.06);
  --popover-bg: rgba(40, 40, 42, 0.72);
  --selected-row: rgba(255, 255, 255, 0.1);
  --scrollbar-thumb: rgba(255, 255, 255, 0.3);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  cursor: default;
}

input, textarea, [contenteditable] { user-select: text; cursor: text; font-family: inherit; }
button { font-family: inherit; border: none; background: none; cursor: default; color: inherit; }

::-webkit-scrollbar { width: 14px; height: 14px; background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
  border: 4px solid transparent;
  background-clip: padding-box;
  opacity: 0;
}
::-webkit-scrollbar-corner { background: transparent; }

/* real macOS icon PNGs - containers size them, shadows are baked in */
img.app-png {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  -webkit-user-drag: none; user-select: none;
}
.finder-item img.app-png { width: 52px; height: 52px; }
.fl-name img.app-png { width: 17px; height: 17px; }

/* desktop drag-select rectangle */
.select-rect {
  position: fixed; z-index: 4000;
  background: rgba(10, 130, 255, 0.13);
  border: 1px solid rgba(10, 130, 255, 0.5);
  pointer-events: none;
}

/* ============ BOOT ============ */
#boot-screen {
  position: fixed; inset: 0; z-index: 10000;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.7s ease;
}
#boot-screen.fading { opacity: 0; pointer-events: none; }
#boot-logo { opacity: 0; transition: opacity 1s ease; }
#boot-logo.show { opacity: 1; }
#boot-progress {
  width: 220px; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  margin-top: 84px; overflow: hidden;
  opacity: 0; transition: opacity 0.5s ease;
}
#boot-progress.show { opacity: 1; }
#boot-progress-fill {
  width: 0%; height: 100%; border-radius: 3px;
  background: #fff;
  transition: width 0.25s ease-out;
}

/* ============ LOGIN / LOCK SCREEN ============ */
#login-screen {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease;
  overflow: hidden;
}
#login-screen.fading { opacity: 0; pointer-events: none; }
.login-wall {
  position: absolute; inset: -60px;
  background-size: cover; background-position: center;
  filter: blur(42px) brightness(0.62) saturate(1.35);
  transform: scale(1.08);
}
.login-wall::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 110%, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0) 55%);
}
.login-clock {
  position: absolute; top: 7.5%; left: 0; right: 0;
  text-align: center; color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.28);
  user-select: none;
}
.login-date {
  font-size: clamp(17px, 1.9vw, 24px); font-weight: 600; letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.9);
}
.login-time {
  font-family: var(--font);
  font-size: clamp(96px, 15.5vw, 190px);
  font-weight: 200;
  letter-spacing: -0.5px;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
  margin-top: -6px;
}
.login-center {
  position: absolute; left: 0; right: 0; top: 56%;
  display: flex; flex-direction: column; align-items: center;
  animation: loginIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(14px); } }
.login-avatar {
  width: 66px; height: 66px; border-radius: 50%;
  background: linear-gradient(140deg, #6ab5f8, #2f6ef2);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 29px; font-weight: 500;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}
.login-name {
  color: rgba(255, 255, 255, 0.96); font-size: 15px; font-weight: 600;
  margin-top: 12px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
.login-pw-wrap { position: relative; margin-top: 14px; }
.login-pw {
  width: 178px; height: 30px; border-radius: 15px;
  border: none; outline: none;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.25);
  color: #fff; text-align: center; font-size: 12.5px;
  padding: 0 28px;
  caret-color: #fff;
  transition: background 0.2s ease, width 0.28s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.login-pw::placeholder { color: rgba(255, 255, 255, 0.72); font-weight: 400; }
.login-pw:focus { background: rgba(255, 255, 255, 0.3); width: 196px; }
.login-go {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.32); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease, background 0.15s ease;
}
.login-go:hover { background: rgba(255, 255, 255, 0.45); }
.login-pw-wrap:focus-within .login-go, .login-pw:not(:placeholder-shown) + .login-go { opacity: 1; }
.login-hint {
  color: rgba(255, 255, 255, 0.62); font-size: 12px; margin-top: 16px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.login-shake { animation: loginShake 0.4s ease; }
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); } 40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}

/* ============ DESKTOP ============ */
#desktop-root { position: fixed; inset: 0; overflow: hidden; }
#desktop-root.entering { animation: desktopIn 0.7s cubic-bezier(0.25, 0.8, 0.3, 1); }
@keyframes desktopIn { from { opacity: 0; transform: scale(1.03); } }

#wallpaper {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: background-image 0.4s ease;
}
#brightness-veil {
  position: absolute; inset: 0; z-index: 8000;
  background: #000; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ============ DESKTOP ICONS ============ */
#desktop-icons {
  position: absolute; top: 34px; right: 6px; bottom: 90px;
  display: flex; flex-direction: column; flex-wrap: wrap-reverse;
  align-content: flex-start; gap: 4px;
  z-index: 1;
}
.desk-icon {
  width: 94px; padding: 5px 2px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  border-radius: 6px;
}
.desk-icon .di-img { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 4px; padding: 2px; }
.desk-icon .di-img svg { width: 54px; height: 54px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25)); }
.desk-icon .di-label {
  font-size: 12.5px; font-weight: 500; color: #fff; text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  padding: 1px 6px; border-radius: 4px;
  max-width: 92px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.25;
}
.desk-icon.selected .di-img { background: rgba(120, 120, 120, 0.35); }
.desk-icon.selected .di-label { background: var(--accent); text-shadow: none; }

/* ============ MENU BAR ============ */
#menubar {
  position: absolute; top: 0; left: 0; right: 0; height: 25px;
  z-index: 5000;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--menubar-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  color: var(--menubar-text);
  font-size: 13px;
  padding: 0 8px;
}
#menubar-left, #menubar-right { display: flex; align-items: center; height: 100%; }
.mb-item {
  height: 100%; display: flex; align-items: center;
  padding: 0 10px; border-radius: 4px;
  font-weight: 400; white-space: nowrap;
}
.mb-item.mb-appname { font-weight: 700; }
.mb-item.mb-apple { padding: 0 12px; }
.mb-item.mb-apple svg { width: 13px; height: 16px; display: block; }
.mb-item.open, .mb-item:active { background: rgba(128, 128, 128, 0.28); }
.mb-status {
  height: 100%; display: flex; align-items: center;
  padding: 0 8px; border-radius: 4px;
}
.mb-status.open { background: rgba(128, 128, 128, 0.28); }
.mb-status svg { display: block; }
#mb-clock { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 10px; }
.mb-status.mb-battery { display: flex; align-items: center; }
.mb-battery-pct {
  display: inline-block;
  font-size: 13px; line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-right: 5px;
}

/* ============ DROPDOWN MENUS / CONTEXT MENUS ============ */
.menu-panel {
  position: fixed; z-index: 6000;
  min-width: 200px;
  background: var(--menu-bg);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-radius: 8px;
  box-shadow: var(--menu-shadow);
  padding: 5px;
  font-size: 13px;
  color: var(--text);
  animation: menuIn 0.12s ease-out;
  transform-origin: top left;
}
@keyframes menuIn { from { opacity: 0; transform: scale(0.97); } }
.menu-panel.closing { opacity: 0; transition: opacity 0.15s ease; pointer-events: none; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 10px; border-radius: 5px;
  white-space: nowrap; gap: 26px;
  line-height: 1.45;
}
.menu-item .mi-shortcut { color: var(--text-secondary); font-size: 12.5px; letter-spacing: 1px; }
.menu-item:hover:not(.disabled) { background: var(--accent); color: #fff; }
.menu-item:hover:not(.disabled) .mi-shortcut { color: rgba(255, 255, 255, 0.75); }
.menu-item.blink { animation: menuBlink 0.14s steps(1) 1; }
@keyframes menuBlink {
  0% { background: transparent; color: var(--text); }
  50% { background: var(--accent); color: #fff; }
}
.menu-item.disabled { color: var(--text-tertiary); }
.menu-item .mi-check { width: 14px; margin-left: -6px; display: inline-block; }
.menu-sep { height: 1px; background: var(--hairline); margin: 5px 10px; }

/* ============ DOCK ============ */
#dock-container {
  position: absolute; left: 0; right: 0; bottom: 6px;
  display: flex; justify-content: center;
  z-index: 5500;
  pointer-events: none;
}
#dock {
  pointer-events: auto;
  display: flex; align-items: flex-end;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 20px;
  background: var(--dock-bg);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  box-shadow: 0 0 0 0.5px var(--dock-border) inset, 0 12px 34px rgba(0, 0, 0, 0.28);
}
.dock-item {
  position: relative;
  transition: width 0.09s ease-out;
  will-change: width;
}
.dock-icon {
  position: absolute; bottom: 0; left: 0;
  width: 100%; aspect-ratio: 1;
}
.dock-icon svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.22)); }
.dock-item .dock-dot {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0; transition: opacity 0.2s ease;
}
:root[data-theme="dark"] .dock-item .dock-dot { background: rgba(255, 255, 255, 0.55); }
.dock-item.running .dock-dot { opacity: 1; }
.dock-item.bouncing .dock-icon { animation: dockBounce 0.65s cubic-bezier(0.28, 0.6, 0.36, 1) 2; }
@keyframes dockBounce {
  0%, 100% { transform: translateY(0); }
  38% { transform: translateY(-26px); }
  76% { transform: translateY(0); }
}
.dock-sep { width: 1px; align-self: stretch; margin: 6px 5px; background: var(--hairline-strong); }
.dock-tip {
  position: fixed; z-index: 6500;
  background: var(--menu-bg);
  backdrop-filter: blur(30px);
  color: var(--text);
  font-size: 13px; padding: 3px 11px; border-radius: 7px;
  box-shadow: var(--menu-shadow);
  pointer-events: none; white-space: nowrap;
  transform: translateX(-50%);
}
.dock-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--menu-bg); border-bottom: none;
}

/* ============ WINDOWS ============ */
.mac-window {
  position: absolute;
  border-radius: 10px;
  background: var(--win-bg);
  box-shadow: var(--win-shadow-inactive);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 200px; min-height: 120px;
  transition: box-shadow 0.2s ease;
}
.mac-window.active { box-shadow: var(--win-shadow); }
.mac-window.opening {
  transition: transform 0.34s cubic-bezier(0.28, 0.9, 0.32, 1.04), opacity 0.28s ease;
}
.mac-window.closing {
  transition: transform 0.16s ease-in, opacity 0.16s ease-in;
  transform: scale(0.92); opacity: 0;
  pointer-events: none;
}
.mac-window.minimizing, .mac-window.restoring {
  transition: transform 0.36s cubic-bezier(0.5, 0.06, 0.6, 1), opacity 0.32s ease-in;
}
.mac-window.zooming {
  transition: top 0.3s cubic-bezier(0.3, 0.8, 0.3, 1), left 0.3s cubic-bezier(0.3, 0.8, 0.3, 1),
              width 0.3s cubic-bezier(0.3, 0.8, 0.3, 1), height 0.3s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.mac-window.dragging, .mac-window.resizing { transition: none; }

.win-titlebar {
  height: 28px; flex: 0 0 28px;
  display: flex; align-items: center;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
.mac-window:not(.active) .win-titlebar { background: var(--titlebar-bg-inactive); }
.win-titlebar .win-title {
  position: absolute; left: 80px; right: 80px;
  text-align: center; font-size: 13px; font-weight: 600;
  color: var(--titlebar-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.mac-window:not(.active) .win-title { color: var(--titlebar-text-inactive); }

/* windows with unified/tall toolbars */
.mac-window.toolbar-window .win-titlebar { height: 52px; flex-basis: 52px; }
.mac-window.no-titlebar-bg .win-titlebar { background: transparent; border-bottom: none; }

/* Traffic lights */
.traffic-lights { display: flex; gap: 8px; padding-left: 9px; align-items: center; flex: 0 0 auto; z-index: 3; }
.tl-btn {
  width: 12px; height: 12px; border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.tl-close { background: #ff5f57; }
.tl-min { background: #febc2e; }
.tl-zoom { background: #28c840; }
.mac-window:not(.active) .tl-btn { background: rgba(140, 140, 140, 0.4); }
:root[data-theme="dark"] .mac-window:not(.active) .tl-btn { background: rgba(255, 255, 255, 0.22); }
.mac-window:not(.active) .traffic-lights:hover .tl-close { background: #ff5f57; }
.mac-window:not(.active) .traffic-lights:hover .tl-min { background: #febc2e; }
.mac-window:not(.active) .traffic-lights:hover .tl-zoom { background: #28c840; }
.tl-btn svg { position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; opacity: 0; }
.traffic-lights:hover .tl-btn svg { opacity: 1; }
.tl-btn:active { filter: brightness(0.72); }
.tl-btn.tl-disabled { background: rgba(140, 140, 140, 0.35) !important; }
.tl-btn.tl-disabled svg { display: none; }

.win-body {
  flex: 1; display: flex; overflow: hidden; position: relative;
  color: var(--text); font-size: 13px;
}

/* resize handles */
.rz { position: absolute; z-index: 40; }
.rz-n { top: -4px; left: 8px; right: 8px; height: 8px; cursor: ns-resize; }
.rz-s { bottom: -4px; left: 8px; right: 8px; height: 8px; cursor: ns-resize; }
.rz-e { right: -4px; top: 8px; bottom: 8px; width: 8px; cursor: ew-resize; }
.rz-w { left: -4px; top: 8px; bottom: 8px; width: 8px; cursor: ew-resize; }
.rz-ne { top: -5px; right: -5px; width: 12px; height: 12px; cursor: nesw-resize; }
.rz-nw { top: -5px; left: -5px; width: 12px; height: 12px; cursor: nwse-resize; }
.rz-se { bottom: -5px; right: -5px; width: 12px; height: 12px; cursor: nwse-resize; }
.rz-sw { bottom: -5px; left: -5px; width: 12px; height: 12px; cursor: nesw-resize; }

/* generic sidebar layout used by several apps */
.app-sidebar {
  width: 200px; flex: 0 0 auto;
  background: var(--sidebar-bg);
  backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
  border-right: 1px solid var(--hairline);
  overflow-y: auto;
  padding: 8px;
}
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--win-bg); }

.sidebar-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  padding: 8px 8px 3px;
}
.sidebar-row {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 8px; border-radius: 6px;
  font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden;
}
.sidebar-row svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--accent); }
.sidebar-row.selected { background: var(--control-active); }
.sidebar-row:hover:not(.selected) { background: var(--control-bg); }

/* ============ SPOTLIGHT ============ */
#spotlight {
  position: absolute; inset: 0; z-index: 7000;
  display: flex; justify-content: center;
}
.spotlight-panel {
  margin-top: 22vh;
  width: 660px; max-width: 90vw;
  height: fit-content;
  background: var(--popover-bg);
  backdrop-filter: blur(50px) saturate(190%);
  -webkit-backdrop-filter: blur(50px) saturate(190%);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(0, 0, 0, 0.2), inset 0 0.5px 0 rgba(255,255,255,0.4);
  overflow: hidden;
  animation: spotIn 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
:root[data-theme="dark"] .spotlight-panel { box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(0,0,0,0.7), inset 0 0 0 0.5px rgba(255,255,255,0.14); }
@keyframes spotIn { from { opacity: 0; transform: scale(0.96); } }
.spotlight-input-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px;
  color: var(--text-secondary);
}
.spotlight-glass { flex: 0 0 auto; }
#spotlight-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 24px; font-weight: 300; color: var(--text);
  font-family: var(--font); line-height: 1.2;
  min-width: 0;
}
#spotlight-input::placeholder { color: var(--text-tertiary); }
#spotlight-results { max-height: 46vh; overflow-y: auto; }
#spotlight-results:not(:empty) { border-top: 1px solid var(--hairline); padding: 7px; }
.spot-section {
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  padding: 10px 13px 4px;
  letter-spacing: 0.2px;
}
.spot-section:first-child { padding-top: 6px; }
.spot-row {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 13px; border-radius: 8px;
  min-height: 40px; box-sizing: border-box;
  color: var(--text);
}
.spot-row .spot-icon { width: 30px; height: 30px; flex: 0 0 auto; display: flex; }
.spot-row .spot-icon svg { width: 100%; height: 100%; }
.spot-row .spot-name {
  font-size: 14px; line-height: 1.3;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.spot-row .spot-kind { flex: 0 0 auto; margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--text-tertiary); }
.spot-row.selected { background: var(--accent); color: #fff; }
.spot-row.selected .spot-kind { color: rgba(255, 255, 255, 0.7); }
.spot-calc-row .spot-icon { border-radius: 7px; overflow: hidden; }
.spot-calc-text {
  font-size: 21px; font-weight: 400; color: var(--text);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.spot-row.selected .spot-calc-text { color: #fff; }

/* ============ LAUNCHPAD ============ */
#launchpad {
  position: absolute; inset: 0; z-index: 6800;
  display: flex; flex-direction: column; align-items: center;
  backdrop-filter: blur(40px) saturate(160%) brightness(0.82);
  -webkit-backdrop-filter: blur(40px) saturate(160%) brightness(0.82);
  background: rgba(60, 60, 70, 0.25);
  animation: lpIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
#launchpad.closing { animation: lpOut 0.18s ease forwards; }
@keyframes lpIn { from { opacity: 0; backdrop-filter: blur(0px); } }
@keyframes lpOut { to { opacity: 0; } }
#launchpad-search {
  margin-top: 42px;
  width: 220px; height: 30px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.16);
  color: #fff; text-align: center; font-size: 13px;
  outline: none;
}
#launchpad-search::placeholder { color: rgba(255, 255, 255, 0.7); }
#launchpad-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 118px);
  gap: 30px 26px;
  justify-content: center;
  width: min(940px, 94vw);
  align-content: start;
  overflow-y: auto;
  padding-bottom: 40px;
}
#launchpad-grid.lp-anim { animation: lpGridIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes lpGridIn { from { opacity: 0; transform: scale(1.1); } }
.lp-app { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lp-app .lp-icon { width: 74px; height: 74px; transition: transform 0.12s ease; }
.lp-app .lp-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3)); }
.lp-app:active .lp-icon { transform: scale(0.92); filter: brightness(0.8); }
.lp-app .lp-label { color: #fff; font-size: 13px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }

/* ============ POPOVERS (control center, clock) ============ */
.popover {
  position: fixed; z-index: 6200;
  background: var(--popover-bg);
  backdrop-filter: blur(50px) saturate(190%);
  -webkit-backdrop-filter: blur(50px) saturate(190%);
  border-radius: 14px;
  box-shadow: var(--menu-shadow);
  color: var(--text);
  animation: menuIn 0.14s ease-out;
  padding: 10px;
}
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 320px; }
.cc-tile {
  background: var(--control-bg);
  border-radius: 14px; padding: 12px;
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.cc-tile.wide { grid-column: 1 / -1; }
.cc-row { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 5px 1px; }
.cc-row + .cc-row { margin-top: 1px; }
.cc-toggle-circle {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(120, 120, 128, 0.3); color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}
.cc-toggle-circle.on { background: var(--accent); color: #fff; }
.cc-toggle-circle svg { width: 15px; height: 15px; }
.cc-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.cc-sub { font-size: 11px; color: var(--text-secondary); font-weight: 400; line-height: 1.25; }
.cc-slider-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; margin-bottom: 9px; color: var(--text);
}
.cc-slider-title svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--text-secondary); }
.cc-slider { -webkit-appearance: none; width: 100%; height: 20px; border-radius: 10px; background: rgba(120, 120, 128, 0.28); outline: none; display: block; }
.cc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); cursor: default;
}

.clock-popover { width: 300px; padding: 15px; }
.clock-popover .cp-date {
  font-size: 13.5px; font-weight: 700; margin: 0 0 12px 2px;
  color: var(--text);
}
.cp-mini-cal {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 26px;
  row-gap: 3px;
  text-align: center; font-size: 11.5px;
}
.cp-mini-cal .cp-dow {
  color: var(--text-tertiary); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cp-mini-cal .cp-day {
  width: 26px; height: 26px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text);
  box-sizing: border-box;
}
.cp-mini-cal .cp-day.other { color: var(--text-tertiary); }
.cp-mini-cal .cp-day.today { background: var(--accent); color: #fff; font-weight: 700; }
.cp-empty {
  margin: 14px 0 0; padding-top: 11px;
  border-top: 1px solid var(--hairline);
  font-size: 12px; color: var(--text-secondary); text-align: center;
}

/* ============ ABOUT PANEL ============ */
.about-body {
  flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 8px 30px 26px; text-align: center;
  background: var(--win-bg-translucent);
  backdrop-filter: blur(40px) saturate(180%);
}
.about-body .about-chip { width: 148px; height: 148px; margin-top: 4px; }
.about-title { font-size: 26px; font-weight: 700; margin-top: 10px; }
.about-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.about-specs { margin-top: 18px; font-size: 12.5px; line-height: 1.85; }
.about-specs b { display: inline-block; min-width: 90px; text-align: right; margin-right: 10px; font-weight: 600; }
.about-specs span { color: var(--text-secondary); }
.about-btn {
  margin-top: 20px; padding: 4px 14px; border-radius: 6px;
  background: var(--control-bg); box-shadow: inset 0 0 0 0.5px var(--hairline);
  font-size: 12.5px;
}
.about-btn:hover { background: var(--control-bg-hover); }

/* generic push button + form controls */
.mac-btn {
  padding: 3px 12px; border-radius: 6px; font-size: 13px;
  background: var(--control-bg);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
  color: var(--text);
}
.mac-btn:hover { background: var(--control-bg-hover); }
.mac-btn:active { background: var(--control-active); }
.mac-btn.primary { background: var(--accent); color: #fff; box-shadow: none; }
.mac-btn.primary:active { background: var(--accent-deep); }
.mac-input {
  border: none; outline: none; border-radius: 6px;
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--text); font-size: 13px; padding: 4px 8px;
}
.mac-input:focus { box-shadow: inset 0 0 0 1px var(--hairline), 0 0 0 3px rgba(10, 130, 255, 0.35); }
.mac-select {
  border: none; outline: none; border-radius: 5px;
  background: var(--control-bg); color: var(--text);
  font-size: 12px; padding: 2px 6px; font-family: var(--font);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.mac-switch {
  width: 38px; height: 22px; border-radius: 12px; position: relative;
  background: rgba(120, 120, 128, 0.32); transition: background 0.2s ease;
  flex: 0 0 auto;
}
.mac-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: left 0.18s cubic-bezier(0.3, 0.8, 0.4, 1);
}
.mac-switch.on { background: #34c759; }
.mac-switch.on::after { left: 18px; }

/* segmented control */
.seg-control {
  display: inline-flex; background: var(--control-bg);
  border-radius: 7px; padding: 1px; gap: 1px;
}
.seg-control .seg {
  padding: 2px 10px; border-radius: 6px; font-size: 12px; color: var(--text);
  display: flex; align-items: center; gap: 4px;
}
.seg-control .seg svg { width: 14px; height: 14px; }
.seg-control .seg.selected { background: var(--win-bg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
:root[data-theme="dark"] .seg-control .seg.selected { background: rgba(255, 255, 255, 0.18); }
