/* ==========================================================================
   macOS Sequoia Desktop Clone — Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;

  /* Menu Bar */
  --menubar-height: 28px;
  --menubar-bg: rgba(38, 38, 40, 0.45);
  --menubar-font-size: 13.5px;

  /* Dock */
  --dock-bg: rgba(255, 255, 255, 0.25);
  --dock-border: rgba(255, 255, 255, 0.3);
  --dock-blur: blur(30px) saturate(180%);
  --dock-radius: 18px;
  --dock-icon-size: 48px;
  --dock-icon-radius: 12px;

  /* Windows */
  --window-bg: rgba(246, 246, 246, 0.95);
  --window-blur: blur(20px) saturate(150%);
  --window-radius: 10px;
  --window-border: 0.5px solid rgba(0, 0, 0, 0.15);
  --window-shadow: 0 22px 70px 4px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.1);
  --titlebar-height: 38px;
  --titlebar-bg: rgba(246, 246, 246, 0.9);

  /* Traffic Lights */
  --btn-close: #ff5f57;
  --btn-minimize: #ffbd2e;
  --btn-maximize: #28c940;
  --btn-inactive: #ddd;

  /* Colors */
  --accent-blue: #0066ff;
  --text-primary: rgba(0, 0, 0, 0.85);
  --text-secondary: rgba(0, 0, 0, 0.55);
  --separator: rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;

  /* Wallpaper — macOS Sequoia */
  --wallpaper: url('../assets/wallpaper.jpg') center/cover no-repeat;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-system);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Hide all scrollbars globally */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* --------------------------------------------------------------------------
   Animations / Keyframes
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes windowClose {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes dockSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(80px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes lockScreenFadeOut {
  from {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 0;
    filter: blur(10px);
  }
}

@keyframes subtlePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes dockBounce {
  0%   { transform: translateY(0); }
  15%  { transform: translateY(-20px); }
  30%  { transform: translateY(0); }
  45%  { transform: translateY(-12px); }
  60%  { transform: translateY(0); }
  75%  { transform: translateY(-5px); }
  90%  { transform: translateY(0); }
  100% { transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Desktop / Wallpaper
   -------------------------------------------------------------------------- */
#desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--wallpaper);
  background-size: cover;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Lock Screen
   -------------------------------------------------------------------------- */
#lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  background: var(--wallpaper);
  overflow: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#lock-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(40px) brightness(0.85) saturate(120%);
  -webkit-backdrop-filter: blur(40px) brightness(0.85) saturate(120%);
  z-index: 0;
}

/* Clock pinned to top center */
.lock-clock {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 1;
}

.lock-time {
  font-size: 82px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  line-height: 1;
}

.lock-date {
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
  margin-top: 6px;
}

/* User block centered on screen */
.lock-user {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.lock-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(180, 180, 180, 0.45);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-username {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

.lock-password-form {
  margin: 0;
}

.lock-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.lock-password-input {
  width: 200px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-size: 13px;
  font-family: var(--font-system);
  padding: 0 36px 0 14px;
  outline: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lock-password-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.lock-password-input:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.lock-submit-btn {
  position: absolute;
  right: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lock-submit-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lock-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Menu Bar
   -------------------------------------------------------------------------- */
#menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: rgba(38, 38, 40, 0.45);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 9000;
  font-family: var(--font-system);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
  user-select: none;
  -webkit-user-select: none;
}

.menu-bar-left,
.menu-bar-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.menu-bar-left {
  gap: 6px;
}

.menu-bar-right {
  gap: 6px;
}

.menu-bar-username {
  font-size: 13px;
  font-weight: 500;
}

.menu-bar-battery {
  display: flex;
  align-items: center;
  gap: 5px;
}

.menu-bar-battery-pct {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.menu-bar-item {
  all: unset;
  padding: 1px 10px;
  border-radius: 4px;
  cursor: default;
  white-space: nowrap;
  line-height: 26px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-system);
  color: rgba(255, 255, 255, 0.95);
  transition: background 0.1s ease;
}

.menu-bar-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.menu-bar-item:active,
.menu-bar-item.active {
  background: rgba(255, 255, 255, 0.18);
}

.menu-bar-app-name {
  font-weight: 700;
}

.apple-logo {
  all: unset;
  padding: 1px 8px;
  border-radius: 4px;
  cursor: default;
  line-height: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
  transition: background 0.1s ease;
}

.apple-logo svg {
  display: block;
}

.apple-logo:hover {
  background: rgba(255, 255, 255, 0.12);
}

.menu-bar-icon {
  all: unset;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.1s ease;
}

.menu-bar-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.menu-bar-datetime {
  display: flex;
  gap: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Menu Dropdown
   -------------------------------------------------------------------------- */
.menu-dropdown {
  position: fixed;
  background: rgba(40, 40, 42, 0.85);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-radius: 0 0 8px 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  padding: 4px;
  min-width: 220px;
  z-index: 9100;
  color: rgba(255, 255, 255, 0.9);
}

.menu-dropdown.active {
  display: block;
}

.menu-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  font-size: 13px;
  font-family: var(--font-system);
  border-radius: 4px;
  cursor: default;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.1s ease;
}

.menu-dropdown-item:hover {
  background: #2563eb;
  color: #fff;
}

.menu-dropdown-item.disabled {
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.menu-dropdown-item .shortcut {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 24px;
}

.menu-dropdown-item:hover .shortcut {
  color: rgba(255, 255, 255, 0.8);
}

.menu-dropdown-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 8px;
}

/* --------------------------------------------------------------------------
   Dock
   -------------------------------------------------------------------------- */
#dock {
  position: fixed;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8000;
  animation: dockSlideUp 0.5s ease 0.3s both;
}

.dock-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: rgba(200, 200, 200, 0.22);
  backdrop-filter: blur(40px) saturate(170%);
  -webkit-backdrop-filter: blur(40px) saturate(170%);
  border: 0.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  padding: 4px 8px 6px;
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.06),
    0 10px 50px rgba(0, 0, 0, 0.22),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.35);
}

/* Dock Item (button wrapper) */
.dock-item {
  all: unset;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Dock Icon */
.dock-icon {
  width: 50px;
  height: 50px;
  border-radius: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  position: relative;
}

.dock-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}

.dock-icon img {
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Dock Magnification — handled entirely by JS mousemove for smooth effect */

/* Dock Tooltip */
.dock-item::before {
  content: attr(aria-label);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-system);
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dock-item:hover::before {
  opacity: 1;
}

/* Dock Divider */
.dock-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 4px;
  align-self: center;
  flex-shrink: 0;
}

/* Dock Active Indicator (running app dot) */
.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}

/* Calendar dock icon */
.dock-icon-calendar {
  position: relative;
}

.dock-calendar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dock-calendar-day-name {
  font-size: 8px;
  font-weight: 800;
  color: white;
  font-family: var(--font-system);
  letter-spacing: 0.8px;
  margin-top: -4px;
  text-transform: uppercase;
}

.dock-calendar-date {
  font-size: 24px;
  font-weight: 300;
  color: #1a1a1a;
  font-family: var(--font-system);
  line-height: 1;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Windows — General
   -------------------------------------------------------------------------- */
.window {
  position: absolute;
  background: var(--window-bg);
  backdrop-filter: var(--window-blur);
  -webkit-backdrop-filter: var(--window-blur);
  border-radius: var(--window-radius);
  border: var(--window-border);
  box-shadow: var(--window-shadow);
  min-width: 400px;
  min-height: 300px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.window.active {
  display: flex;
  animation: windowOpen 0.25s ease both;
}

.window.closing {
  animation: windowClose 0.2s ease forwards;
}

.window.focused {
  box-shadow: var(--window-shadow);
}

.window:not(.focused) {
  box-shadow: 0 10px 40px 2px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

/* Window Title Bar */
.window-titlebar {
  height: var(--titlebar-height);
  min-height: var(--titlebar-height);
  background: var(--titlebar-bg);
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.window-titlebar:active {
  cursor: grabbing;
}

/* Traffic Lights */
.traffic-lights {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  line-height: 1;
  color: transparent;
  transition: color var(--transition-fast);
  padding: 0;
  outline: none;
}

.btn-close,
.traffic-close {
  background: var(--btn-close);
}

.btn-minimize,
.traffic-minimize {
  background: var(--btn-minimize);
}

.btn-maximize,
.traffic-maximize {
  background: var(--btn-maximize);
}

/* Show symbols on hover of the traffic-lights group */
.traffic-lights:hover .btn-close::after,
.traffic-lights:hover .traffic-close::after {
  content: '\00D7';
  font-size: 11px;
  font-weight: 700;
  color: rgba(80, 0, 0, 0.85);
  line-height: 1;
}

.traffic-lights:hover .btn-minimize::after,
.traffic-lights:hover .traffic-minimize::after {
  content: '\2013';
  font-size: 11px;
  font-weight: 700;
  color: rgba(80, 50, 0, 0.85);
  line-height: 1;
}

.traffic-lights:hover .btn-maximize::after,
.traffic-lights:hover .traffic-maximize::after {
  content: '+';
  font-size: 13px;
  font-weight: 400;
  color: rgba(0, 60, 0, 0.85);
  line-height: 1;
  transform: rotate(45deg);
  display: inline-block;
}

/* Window Title */
.window-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  min-width: 0;
}

/* Window Content / Body */
.window-content,
.window-body {
  flex: 1;
  overflow: auto;
  background: #fff;
  position: relative;
}

/* Thin custom scrollbar for window content */
.window-content::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.window-content::-webkit-scrollbar-track {
  background: transparent;
}

.window-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.window-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   Window — Resize Handle
   -------------------------------------------------------------------------- */
.window-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 10;
}

/* --------------------------------------------------------------------------
   Finder
   -------------------------------------------------------------------------- */
.finder-container {
  display: flex;
  flex: 1;
  height: 100%;
}

.finder-sidebar {
  width: 180px;
  min-width: 180px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.finder-sidebar::-webkit-scrollbar {
  width: 0;
}

.finder-sidebar-section {
  margin-bottom: 8px;
}

.finder-sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 16px;
}

.finder-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  margin: 1px 8px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: 6px;
  cursor: default;
  transition: background var(--transition-fast);
}

.finder-sidebar-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.finder-sidebar-item.active {
  background: rgba(0, 0, 0, 0.08);
}

.finder-sidebar-item .sidebar-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.finder-main {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fff;
}

.finder-main::-webkit-scrollbar {
  width: 6px;
}

.finder-main::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.finder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
}

.finder-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  cursor: default;
  transition: background var(--transition-fast);
}

.finder-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.finder-item.selected {
  background: rgba(0, 102, 255, 0.12);
}

.finder-item-icon {
  font-size: 48px;
  line-height: 1;
}

.finder-item-name {
  font-size: 11px;
  text-align: center;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.3;
  max-width: 80px;
}

/* Finder Toolbar */
.finder-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 38px;
  background: rgba(246, 246, 246, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.finder-toolbar-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.finder-toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.finder-toolbar-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Calculator
   -------------------------------------------------------------------------- */
.window-titlebar-calc {
  background: #2a2a2a !important;
  border-bottom: none !important;
}

.calculator-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #2a2a2a;
}

.calculator-display,
.calc-display {
  padding: 8px 20px 4px;
  text-align: right;
  font-size: 52px;
  font-weight: 200;
  color: #fff;
  background: #2a2a2a;
  min-height: 70px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
  word-break: break-all;
  line-height: 1;
  font-family: var(--font-system);
}

.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 1px;
  flex: 1;
}

.calc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 400;
  font-family: var(--font-system);
  border: none;
  cursor: pointer;
  transition: background 0.1s ease;
  border-radius: 0;
  color: #fff;
  padding: 0;
  min-height: 48px;
}

.calc-btn.number {
  background: #505050;
}

.calc-btn.number:hover {
  background: #606060;
}

.calc-btn.number:active {
  background: #707070;
}

.calc-btn.operator {
  background: #ff9f0a;
  color: #fff;
  font-size: 26px;
}

.calc-btn.operator:hover {
  background: #ffb340;
}

.calc-btn.operator:active {
  background: #ffc766;
}

.calc-btn.operator.active-op {
  background: #fff;
  color: #ff9f0a;
}

.calc-btn.function {
  background: #a5a5a5;
  color: #333;
  font-size: 18px;
}

.calc-btn.function:hover {
  background: #b5b5b5;
}

.calc-btn.function:active {
  background: #c5c5c5;
}

.calc-btn.zero {
  grid-column: span 2;
  text-align: left;
  padding-left: 24px;
  justify-content: flex-start;
}

/* --------------------------------------------------------------------------
   Terminal
   -------------------------------------------------------------------------- */
.window-titlebar-terminal {
  background: rgba(56, 56, 56, 0.97) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3) !important;
}

.window-title-light {
  color: rgba(255, 255, 255, 0.7) !important;
}

.terminal-content {
  flex: 1;
  padding: 4px 8px !important;
  margin: 0 !important;
  color: #f0f0f0;
  font-size: 13px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  line-height: 1.35;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: #1e1e1e !important;
}

#window-terminal {
  background: #1e1e1e;
}

.terminal-content::-webkit-scrollbar {
  width: 6px;
}

.terminal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.terminal-line {
  margin-bottom: 1px;
}

.terminal-prompt-line {
  display: flex;
  align-items: center;
}

.terminal-prompt {
  color: #f0f0f0;
  font-weight: bold;
  margin-right: 0;
  white-space: nowrap;
}

.terminal-input {
  background: none;
  border: none;
  color: #f0f0f0;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  outline: none;
  flex: 1;
  caret-color: #f0f0f0;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Safari
   -------------------------------------------------------------------------- */
.safari-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}

.safari-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(to bottom, #f6f6f6, #e8e8e8);
  border-bottom: 1px solid #c8c8c8;
  flex-shrink: 0;
}

.safari-nav-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.safari-nav-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.safari-nav-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Safari URL bar is styled in the safari page section below */

.safari-share-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

.safari-share-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.safari-content {
  flex: 1;
  overflow: auto;
  background: #fff;
}

.safari-content::-webkit-scrollbar {
  width: 6px;
}

.safari-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* Safari tab bar */
.safari-tabs {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0 8px;
  background: rgba(230, 230, 230, 0.8);
  height: 30px;
  flex-shrink: 0;
}

.safari-tab {
  flex: 1;
  max-width: 200px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 11px;
  border-radius: 6px;
  cursor: default;
  color: var(--text-secondary);
  background: transparent;
  transition: background var(--transition-fast);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.safari-tab.active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.safari-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
}

/* Safari page content */
.safari-page {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
}

/* GitHub Light Mode */
.gh-header {
  background: #f6f8fa;
  border-bottom: 1px solid #d1d9e0;
  padding: 0 24px;
  height: 48px;
  display: flex;
  align-items: center;
}

.gh-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.gh-header-search {
  background: #f6f8fa;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 14px;
  color: #656d76;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 240px;
}

.gh-header-nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #24292f;
  margin-left: auto;
}

.gh-header-nav span { cursor: pointer; }
.gh-header-nav span:hover { color: #656d76; }

.gh-profile {
  max-width: 1012px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  gap: 24px;
}

.gh-profile-left { width: 260px; flex-shrink: 0; }

.gh-avatar {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid #d1d9e0;
  object-fit: cover;
  background: #f6f8fa;
}

.gh-name {
  font-size: 24px;
  font-weight: 600;
  color: #24292f;
  margin: 12px 0 0;
  line-height: 1.25;
}

.gh-username {
  font-size: 20px;
  font-weight: 300;
  color: #656d76;
  margin: 0;
  line-height: 1.5;
}

.gh-bio {
  font-size: 14px;
  color: #24292f;
  margin: 12px 0;
  line-height: 1.5;
}

.gh-follow-btn {
  width: 100%;
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  background: #f6f8fa;
  color: #24292f;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.15s;
}

.gh-follow-btn:hover { background: #eaeef2; }

.gh-stats-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #656d76;
  margin-bottom: 4px;
}

.gh-stats-row strong { color: #24292f; font-weight: 600; }
.gh-dot { margin: 0 4px; }

.gh-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #656d76;
  margin-top: 4px;
}

.gh-profile-right { flex: 1; min-width: 0; }

.gh-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #d1d9e0;
  margin-bottom: 16px;
}

.gh-tab {
  padding: 8px 16px;
  font-size: 14px;
  color: #656d76;
  cursor: pointer;
}

.gh-tab.active {
  font-weight: 600;
  color: #24292f;
  border-bottom: 2px solid #fd8c73;
}

.gh-tab-count {
  background: #e8e8e8;
  border-radius: 12px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 4px;
}

.gh-repo-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.gh-repo-search {
  flex: 1;
  padding: 5px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  background: #f6f8fa;
  color: #24292f;
  outline: none;
}

.gh-repo-filter-btns { display: flex; gap: 4px; }

.gh-filter-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  background: #f6f8fa;
  color: #24292f;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  cursor: pointer;
}

.gh-filter-btn:hover { background: #eaeef2; }

.gh-repo-list { display: flex; flex-direction: column; }

.gh-repo-item {
  padding: 16px 0;
  border-bottom: 1px solid #d1d9e0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.gh-repo-info { flex: 1; min-width: 0; }

.gh-repo-name {
  font-size: 16px;
  font-weight: 600;
  color: #0969da;
  margin-bottom: 4px;
}

.gh-repo-desc {
  font-size: 13px;
  color: #656d76;
  margin-bottom: 8px;
  line-height: 1.5;
}

.gh-repo-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: #656d76;
}

.gh-repo-lang {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gh-repo-lang-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.gh-repo-star-btn {
  padding: 3px 12px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  background: #f6f8fa;
  color: #24292f;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.gh-repo-star-btn:hover { background: #eaeef2; }

.gh-repo-visibility {
  font-size: 12px;
  color: #656d76;
  border: 1px solid #d1d9e0;
  border-radius: 12px;
  padding: 0 7px;
  font-weight: 500;
  margin-left: 4px;
}

.safari-github-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 20px;
}

.safari-github-avatar { flex-shrink: 0; }

.safari-github-info h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.safari-github-bio {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.safari-github-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.safari-github-repos h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.safari-repo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.safari-repo-card {
  border: 1px solid var(--separator);
  border-radius: 8px;
  padding: 16px;
  cursor: default;
  transition: background var(--transition-fast);
}

.safari-repo-card:hover {
  background: rgba(0, 0, 0, 0.02);
}

.safari-repo-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: #0969da;
  margin-bottom: 4px;
}

.safari-repo-card p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.safari-repo-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.safari-repo-lang::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lang-color, #ccc);
  margin-right: 4px;
  vertical-align: middle;
}

/* Safari URL bar inner */
.safari-url-bar {
  flex: 1;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: default;
}

.safari-url-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}

.safari-url-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Notes
   -------------------------------------------------------------------------- */
.notes-container {
  display: flex;
  height: 100%;
}

.notes-sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(250, 245, 230, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  flex-shrink: 0;
}

.notes-sidebar::-webkit-scrollbar {
  width: 0;
}

.notes-sidebar-header {
  padding: 12px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.notes-list-item {
  padding: 8px 16px;
  cursor: default;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background var(--transition-fast);
}

.notes-list-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.notes-list-item.active {
  background: rgba(255, 204, 0, 0.15);
}

.notes-list-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-list-item-preview {
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-list-item-date {
  font-size: 10px;
  color: var(--text-secondary);
}

.notes-content {
  flex: 1;
  padding: 16px 20px;
  background: #fff;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.notes-content::-webkit-scrollbar {
  width: 6px;
}

.notes-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

/* Optional lined paper effect */
.notes-content.lined {
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    rgba(0, 0, 0, 0.05) 27px,
    rgba(0, 0, 0, 0.05) 28px
  );
  background-position: 0 16px;
}

.notes-editor {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-system);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: transparent;
}

/* --------------------------------------------------------------------------
   Generic App Styles (Mail, Maps, Photos, FaceTime, Calendar, etc.)
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  height: 100%;
}

.app-sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.app-sidebar::-webkit-scrollbar { width: 0; }

.app-sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 16px;
  margin-top: 8px;
}

.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  margin: 1px 8px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: 6px;
  cursor: default;
  transition: background var(--transition-fast);
}

.app-sidebar-item:hover { background: rgba(0, 0, 0, 0.05); }
.app-sidebar-item.active { background: rgba(0, 102, 255, 0.12); color: #0066ff; }
.app-sidebar-item .sidebar-icon { font-size: 15px; width: 20px; text-align: center; }
.app-sidebar-item .badge {
  margin-left: auto;
  background: #007AFF;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.app-main {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #fff;
}

.app-main::-webkit-scrollbar { width: 6px; }
.app-main::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.app-main h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Mail (styles in the mail-body section below) */

/* Maps */
.maps-container { display: flex; flex-direction: column; height: 100%; }
.maps-search {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(246, 246, 246, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.maps-search input {
  flex: 1;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font-system);
  outline: none;
}

.maps-view {
  flex: 1;
  background: linear-gradient(135deg, #c8e6c9 0%, #e8f5e9 30%, #fff9c4 60%, #c8e6c9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(0,0,0,0.2);
  position: relative;
}

.maps-bottom {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(246, 246, 246, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
  color: var(--text-secondary);
}

.maps-bottom span { cursor: default; padding: 4px 8px; border-radius: 4px; }
.maps-bottom span:hover { background: rgba(0, 0, 0, 0.05); }
.maps-bottom span.active { color: #007AFF; font-weight: 600; }

/* Photos */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 4px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: 4px;
  cursor: default;
  transition: opacity var(--transition-fast);
}

.photo-thumb:hover { opacity: 0.85; }

/* FaceTime */
.facetime-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #1c1c1e;
  color: white;
  padding: 20px;
}

.facetime-new-btn {
  background: #30d158;
  color: white;
  border: none;
  border-radius: 14px;
  padding: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-system);
  cursor: pointer;
  margin-bottom: 20px;
  transition: background var(--transition-fast);
}

.facetime-new-btn:hover { background: #28b94d; }

.facetime-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

.facetime-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.facetime-name { font-size: 15px; font-weight: 500; }
.facetime-time { font-size: 12px; color: rgba(255, 255, 255, 0.4); margin-left: auto; }

/* Calendar */
.calendar-container { display: flex; flex-direction: column; height: 100%; }
.calendar-toolbar {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  background: rgba(246, 246, 246, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.calendar-toolbar-btn {
  background: none;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-system);
  padding: 3px 10px;
  cursor: pointer;
  color: var(--text-primary);
}

.calendar-toolbar-btn:hover { background: rgba(0,0,0,0.04); }
.calendar-toolbar-month { font-size: 15px; font-weight: 600; margin-left: 8px; }

.calendar-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.calendar-grid-header {
  padding: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(246, 246, 246, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.calendar-grid-cell {
  padding: 4px 6px;
  font-size: 12px;
  border-right: 0.5px solid rgba(0, 0, 0, 0.04);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
  min-height: 60px;
  color: var(--text-primary);
}

.calendar-grid-cell.today .calendar-day-num {
  background: #FF3B30;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-grid-cell.other-month { color: var(--text-secondary); opacity: 0.4; }

/* Reminders */
.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--separator);
}

.reminder-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #007AFF;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.reminder-check:hover { background: rgba(0, 122, 255, 0.1); }
.reminder-check.done { background: #007AFF; }

.reminder-text { font-size: 14px; color: var(--text-primary); }
.reminder-detail { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Music */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.album-card { cursor: default; }

.album-art {
  aspect-ratio: 1;
  border-radius: 8px;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.album-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.album-artist { font-size: 12px; color: var(--text-secondary); }

/* News */
.news-card {
  padding: 14px 0;
  border-bottom: 0.5px solid var(--separator);
  cursor: default;
}

.news-card:hover { background: rgba(0, 0, 0, 0.01); }
.news-card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.news-card-source { font-size: 12px; color: #FF3B30; font-weight: 600; }
.news-card-time { font-size: 12px; color: var(--text-secondary); }
.news-card-preview { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }

/* App Store */
.appstore-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.appstore-card {
  border-radius: 12px;
  padding: 20px;
  cursor: default;
  transition: transform var(--transition-fast);
}

.appstore-card:hover { transform: scale(1.01); }
.appstore-card-category { font-size: 11px; font-weight: 600; text-transform: uppercase; opacity: 0.7; }
.appstore-card-title { font-size: 20px; font-weight: 700; margin: 4px 0; }
.appstore-card-desc { font-size: 13px; opacity: 0.8; }

.appstore-get-btn {
  display: inline-block;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: 14px;
  padding: 5px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-system);
  cursor: pointer;
  color: inherit;
}

.appstore-get-btn:hover { background: rgba(255, 255, 255, 0.35); }

/* --------------------------------------------------------------------------
   System Settings (Preferences)
   -------------------------------------------------------------------------- */
/* settings-body = the flex container (used as window-body class) */
.settings-body {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.settings-sidebar {
  width: 220px;
  min-width: 220px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.settings-sidebar::-webkit-scrollbar { width: 0; }

.settings-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 14px;
}

.settings-avatar { flex-shrink: 0; }

.settings-profile-info { min-width: 0; }

.settings-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-profile-detail {
  font-size: 11px;
  color: var(--text-secondary);
}

.settings-sidebar-list {
  padding: 0 4px;
}

.settings-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  margin: 1px 4px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  transition: background var(--transition-fast);
}

.settings-sidebar-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.settings-sidebar-item.active {
  background: rgba(0, 102, 255, 0.12);
  color: var(--text-primary);
}

.settings-content {
  flex: 1;
  padding: 20px 28px;
  overflow-y: auto;
  background: #fff;
}

.settings-content::-webkit-scrollbar { width: 6px; }
.settings-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

.settings-content-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.settings-section {
  margin-bottom: 16px;
  background: rgba(246, 246, 246, 0.8);
  border-radius: 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  min-height: 44px;
}

.settings-row + .settings-row {
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.settings-label {
  font-size: 13px;
  color: var(--text-primary);
}

.settings-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 0, 0, 0.05);
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 4px 24px 4px 10px;
  font-size: 13px;
  font-family: var(--font-system);
  color: var(--text-primary);
  cursor: default;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  outline: none;
}

/* Appearance previews */
.settings-appearance-options {
  display: flex;
  gap: 16px;
}

.settings-appearance-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
  font-size: 12px;
  color: var(--text-secondary);
}

.settings-appearance-option.active { color: var(--accent-blue); font-weight: 600; }

.settings-appearance-preview {
  width: 72px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.settings-appearance-option.active .settings-appearance-preview {
  border-color: var(--accent-blue);
}

.settings-appearance-light { background: linear-gradient(135deg, #f5f5f7, #e8e8ed); }
.settings-appearance-dark { background: linear-gradient(135deg, #2d2d2d, #1a1a1a); }
.settings-appearance-auto {
  background: linear-gradient(135deg, #f5f5f7 50%, #1a1a1a 50%);
}

/* Accent color dots */
.settings-accent-colors {
  display: flex;
  gap: 8px;
}

.settings-accent-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}

.settings-accent-dot:hover { transform: scale(1.15); }

/* Toggle Switch */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.settings-toggle input { opacity: 0; width: 0; height: 0; }

.settings-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: #ccc;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.settings-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast);
}

.settings-toggle input:checked + .settings-toggle-slider {
  background: #34c759;
}

.settings-toggle input:checked + .settings-toggle-slider::after {
  transform: translateX(16px);
}

.settings-toggle-row {
  min-height: 44px;
}

/* Legacy toggle-switch class */
.toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #ccc;
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.toggle-switch.active { background: #34c759; }

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast);
}

.toggle-switch.active::after { transform: translateX(16px); }

/* --------------------------------------------------------------------------
   Finder — Body & Layout
   -------------------------------------------------------------------------- */
.finder-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #fff;
}

.finder-toolbar-left,
.finder-toolbar-center,
.finder-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.finder-toolbar-left { flex-shrink: 0; }
.finder-toolbar-center { flex-shrink: 0; margin: 0 8px; }
.finder-toolbar-right { margin-left: auto; }

.finder-search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  min-width: 140px;
}

.finder-search-input {
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: var(--font-system);
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.finder-main-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.finder-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fff;
}

.finder-content::-webkit-scrollbar { width: 6px; }
.finder-content::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; }

.finder-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 12px;
  background: rgba(246, 246, 246, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.finder-folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  cursor: default;
  transition: background var(--transition-fast);
}

.finder-folder:hover { background: rgba(0, 0, 0, 0.05); }

.finder-folder-icon {
  font-size: 48px;
  line-height: 1;
}

.finder-folder-name {
  font-size: 11px;
  text-align: center;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.3;
  max-width: 80px;
}

/* --------------------------------------------------------------------------
   Safari — Body & Layout
   -------------------------------------------------------------------------- */
.safari-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #fff;
}

.safari-iframe {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Messages — Body & Layout
   -------------------------------------------------------------------------- */
.messages-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.messages-sidebar {
  width: 220px;
  min-width: 220px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  flex-shrink: 0;
}

.messages-sidebar::-webkit-scrollbar { width: 0; }

.messages-conversation {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: default;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  transition: background var(--transition-fast);
}

.messages-conversation:hover { background: rgba(0, 0, 0, 0.04); }
.messages-conversation.active { background: rgba(0, 102, 255, 0.12); }

.messages-conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.messages-conv-info { min-width: 0; flex: 1; }

.messages-conv-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.messages-conv-preview {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.messages-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.messages-chat::-webkit-scrollbar { width: 6px; }
.messages-chat::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.message-bubble {
  max-width: 65%;
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.message-bubble.message-sent {
  align-self: flex-end;
  background: #007AFF;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.message-bubble.message-received {
  align-self: flex-start;
  background: #e9e9eb;
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
}

.messages-input-bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(246, 246, 246, 0.6);
  flex-shrink: 0;
}

.messages-input {
  flex: 1;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 0 14px;
  font-size: 13px;
  font-family: var(--font-system);
  background: #fff;
  outline: none;
  color: var(--text-primary);
}

.messages-input:focus { border-color: #007AFF; }

/* --------------------------------------------------------------------------
   Mail — Body & Layout
   -------------------------------------------------------------------------- */
.mail-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.mail-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.mail-list {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  background: #fff;
}

.mail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: default;
  transition: background var(--transition-fast);
}

.mail-item:hover { background: rgba(0, 0, 0, 0.03); }
.mail-item.active { background: rgba(0, 102, 255, 0.08); }

.mail-item-content {
  flex: 1;
  min-width: 0;
}

.mail-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.mail-sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.mail-sidebar::-webkit-scrollbar { width: 0; }

.mail-sidebar-section { padding: 0; }

.mail-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mail-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  border-radius: 0;
  margin: 0 8px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.mail-sidebar-item:hover { background: rgba(0, 0, 0, 0.05); }
.mail-sidebar-item.active { background: rgba(0, 102, 255, 0.12); color: #0066ff; }

.mail-badge {
  background: #007AFF;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.mail-content {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Maps — Body & Layout
   -------------------------------------------------------------------------- */
.maps-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.maps-search-bar {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  background: rgba(246, 246, 246, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.maps-search-input {
  flex: 1;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font-system);
  outline: none;
  color: var(--text-primary);
}

.maps-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.maps-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 36px;
  background: rgba(246, 246, 246, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.maps-mode-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-family: var(--font-system);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.maps-mode-btn:hover { background: rgba(0, 0, 0, 0.05); }
.maps-mode-btn.active { color: #007AFF; font-weight: 600; }

/* --------------------------------------------------------------------------
   Photos — Body & Layout
   -------------------------------------------------------------------------- */
.photos-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.photos-sidebar {
  width: 180px;
  min-width: 180px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.photos-sidebar::-webkit-scrollbar { width: 0; }

.photos-sidebar-section { padding: 0; }

.photos-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.photos-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  margin: 1px 8px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.photos-sidebar-item:hover { background: rgba(0, 0, 0, 0.05); }
.photos-sidebar-item.active { background: rgba(0, 102, 255, 0.12); color: #0066ff; }

.photos-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fff;
}

.photos-content::-webkit-scrollbar { width: 6px; }
.photos-content::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.photos-thumbnail {
  aspect-ratio: 1;
  border-radius: 4px;
  cursor: default;
  transition: opacity var(--transition-fast);
  background: #e0e0e0;
}

.photos-thumbnail:hover { opacity: 0.85; }

.photos-thumb {
  aspect-ratio: 1;
  border-radius: 4px;
  cursor: default;
  transition: opacity var(--transition-fast);
}

.photos-thumb:hover { opacity: 0.85; }

/* --------------------------------------------------------------------------
   FaceTime — Body & Layout
   -------------------------------------------------------------------------- */
.facetime-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: #1c1c1e;
  color: #fff;
  padding: 20px;
  overflow-y: auto;
}

.facetime-new {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.facetime-recents {
  flex: 1;
  overflow-y: auto;
}

.facetime-contacts {
  flex: 1;
  overflow-y: auto;
}

.facetime-contact-name {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
}

.facetime-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Calendar — Body & Layout
   -------------------------------------------------------------------------- */
.calendar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.calendar-btn {
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-system);
  padding: 3px 10px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.calendar-btn:hover { background: rgba(0, 0, 0, 0.04); }

.calendar-nav-btn {
  padding: 3px 8px;
  font-size: 14px;
}

.calendar-month-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 8px;
}

.calendar-day-header {
  padding: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(246, 246, 246, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.calendar-day {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-primary);
  border-right: 0.5px solid rgba(0, 0, 0, 0.04);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
  min-height: 50px;
  cursor: default;
  transition: background var(--transition-fast);
}

.calendar-day:hover { background: rgba(0, 0, 0, 0.03); }

.calendar-day.today {
  font-weight: 700;
  color: #FF3B30;
  background: rgba(255, 59, 48, 0.06);
}

.calendar-today {
  font-weight: 700;
  color: #FF3B30;
}

/* --------------------------------------------------------------------------
   Reminders — Body & Layout
   -------------------------------------------------------------------------- */
.reminders-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.reminders-sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.reminders-sidebar::-webkit-scrollbar { width: 0; }

.reminders-sidebar-section { padding: 0; }

.reminders-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reminders-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  margin: 1px 8px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.reminders-sidebar-item:hover { background: rgba(0, 0, 0, 0.05); }
.reminders-sidebar-item.active { background: rgba(0, 102, 255, 0.12); color: #0066ff; }

.reminders-content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #fff;
}

.reminders-content::-webkit-scrollbar { width: 6px; }
.reminders-content::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.reminders-list { padding: 0; }

.reminders-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--separator);
  font-size: 14px;
  color: var(--text-primary);
  cursor: default;
}

.reminders-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #007AFF;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.reminders-checkbox:hover { background: rgba(0, 122, 255, 0.1); }
.reminders-checkbox.done { background: #007AFF; }

/* --------------------------------------------------------------------------
   Music — Body & Layout
   -------------------------------------------------------------------------- */
.music-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.music-sidebar {
  width: 220px;
  min-width: 220px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.music-sidebar::-webkit-scrollbar { width: 0; }

.music-sidebar-section { padding: 0; margin-bottom: 8px; }

.music-sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 16px 4px;
}

.music-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.music-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  margin: 1px 8px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.music-sidebar-item:hover { background: rgba(0, 0, 0, 0.05); }
.music-sidebar-item.active { background: rgba(0, 102, 255, 0.12); color: #0066ff; }

.music-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #fff;
}

.music-content::-webkit-scrollbar { width: 6px; }
.music-content::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.music-content-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.music-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.music-album-card {
  cursor: default;
}

.music-album-art {
  aspect-ratio: 1;
  border-radius: 8px;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #e0e0e0;
}

.music-album-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
}

.music-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(246, 246, 246, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   News — Body & Layout
   -------------------------------------------------------------------------- */
.news-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #fff;
}

.news-sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.news-sidebar::-webkit-scrollbar { width: 0; }

.news-sidebar-section { padding: 0; }

.news-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  margin: 1px 8px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.news-sidebar-item:hover { background: rgba(0, 0, 0, 0.05); }
.news-sidebar-item.active { background: rgba(0, 102, 255, 0.12); color: #0066ff; }

.news-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #fff;
}

.news-content::-webkit-scrollbar { width: 6px; }
.news-content::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.news-content-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.news-featured {
  margin-bottom: 20px;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.news-article-list { padding: 0; }

.news-article-card {
  padding: 14px 0;
  border-bottom: 0.5px solid var(--separator);
  cursor: default;
  transition: background var(--transition-fast);
}

.news-article-card:hover { background: rgba(0, 0, 0, 0.01); }

.news-article-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.news-article-source {
  font-size: 12px;
  color: #FF3B30;
  font-weight: 600;
}

.news-article-time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   App Store — Body & Layout
   -------------------------------------------------------------------------- */
.appstore-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.appstore-sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(246, 246, 246, 0.95);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.appstore-sidebar::-webkit-scrollbar { width: 0; }

.appstore-sidebar-section { padding: 0; }

.appstore-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.appstore-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  margin: 1px 8px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.appstore-sidebar-item:hover { background: rgba(0, 0, 0, 0.05); }
.appstore-sidebar-item.active { background: rgba(0, 102, 255, 0.12); color: #0066ff; }

.appstore-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #fff;
}

.appstore-content::-webkit-scrollbar { width: 6px; }
.appstore-content::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.appstore-content-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.appstore-featured-list { padding: 0; }

.appstore-featured-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--separator);
  cursor: default;
  transition: background var(--transition-fast);
}

.appstore-featured-card:hover { background: rgba(0, 0, 0, 0.02); }

.appstore-app-info { flex: 1; min-width: 0; }

.appstore-app-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.appstore-app-category {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Notes — Body & Layout
   -------------------------------------------------------------------------- */
.notes-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Context Menu
   -------------------------------------------------------------------------- */
#context-menu {
  position: fixed;
  background: rgba(246, 246, 246, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 8px;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 4px;
  min-width: 220px;
  z-index: 9500;
  display: none;
}

#context-menu.active {
  display: block;
  animation: fadeIn 0.1s ease;
}

.context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 4px;
  cursor: default;
  color: var(--text-primary);
  transition: background 0.1s ease, color 0.1s ease;
}

.context-menu-item:hover {
  background: var(--accent-blue);
  color: #fff;
}

.context-menu-item.disabled {
  color: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.context-menu-item .context-shortcut {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 24px;
}

.context-menu-item:hover .context-shortcut {
  color: rgba(255, 255, 255, 0.7);
}

.context-menu-separator {
  height: 1px;
  background: var(--separator);
  margin: 4px 8px;
}

/* Submenu arrow */
.context-menu-item .submenu-arrow {
  font-size: 10px;
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Notification Center
   -------------------------------------------------------------------------- */
#notification-center {
  position: fixed;
  top: var(--menubar-height);
  right: 0;
  width: 340px;
  height: calc(100vh - var(--menubar-height));
  background: rgba(246, 246, 246, 0.7);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  z-index: 8500;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  padding: 16px;
  overflow-y: auto;
  border-left: 0.5px solid rgba(0, 0, 0, 0.1);
}

#notification-center::-webkit-scrollbar {
  width: 0;
}

#notification-center.active {
  transform: translateX(0);
}

.notification-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.notification-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.notification-card-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-card-app {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.notification-card-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
}

.notification-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notification-card-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Widget cards */
.widget-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.widget-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Desktop Icons
   -------------------------------------------------------------------------- */
.desktop-icons {
  position: absolute;
  top: calc(var(--menubar-height) + 16px);
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.desktop-icon {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  cursor: default;
  transition: background var(--transition-fast);
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.desktop-icon.selected {
  background: rgba(0, 102, 255, 0.35);
}

.desktop-icon-img {
  width: 64px;
  height: 64px;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.desktop-icon-label {
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  word-break: break-word;
  line-height: 1.2;
  max-width: 76px;
}

/* --------------------------------------------------------------------------
   Spotlight / Search
   -------------------------------------------------------------------------- */
#spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9800;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 180px;
  background: rgba(0, 0, 0, 0.25);
}

#spotlight.active {
  display: flex;
  animation: fadeIn 0.15s ease;
}

.spotlight-box {
  width: 680px;
  max-width: 90vw;
  background: rgba(246, 246, 246, 0.9);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.spotlight-input-wrap {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
}

.spotlight-icon {
  font-size: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.spotlight-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 300;
  font-family: var(--font-system);
  color: var(--text-primary);
  outline: none;
}

.spotlight-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.spotlight-results {
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
}

.spotlight-results::-webkit-scrollbar {
  width: 0;
}

.spotlight-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: default;
  transition: background 0.1s ease;
}

.spotlight-result-item:hover,
.spotlight-result-item.selected {
  background: var(--accent-blue);
  color: #fff;
}

.spotlight-result-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.spotlight-result-name {
  font-size: 14px;
  font-weight: 500;
}

.spotlight-result-type {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
}

.spotlight-result-item:hover .spotlight-result-type,
.spotlight-result-item.selected .spotlight-result-type {
  color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Selection Marquee (desktop drag selection)
   -------------------------------------------------------------------------- */
.selection-marquee {
  position: fixed;
  border: 1.5px solid rgba(0, 102, 255, 0.6);
  background: rgba(0, 102, 255, 0.12);
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
  display: none;
  box-shadow: 0 0 0 0.5px rgba(0, 102, 255, 0.3);
}

/* --------------------------------------------------------------------------
   Window — Fullscreen
   -------------------------------------------------------------------------- */
.window.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
  z-index: 8900 !important;
  transition: all var(--transition-normal);
}

.window.fullscreen .window-titlebar {
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   Window — Minimized (hidden off-screen)
   -------------------------------------------------------------------------- */
.window.minimized {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Loading / Boot Screen (optional)
   -------------------------------------------------------------------------- */
#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  color: #fff;
}

#boot-screen.hidden {
  animation: fadeOut 0.6s ease forwards;
  pointer-events: none;
}

.boot-logo {
  font-size: 64px;
  margin-bottom: 32px;
}

.boot-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.no-select {
  user-select: none;
  -webkit-user-select: none;
}

.grab {
  cursor: grab;
}

.grabbing {
  cursor: grabbing;
}

/* --------------------------------------------------------------------------
   Widgets
   -------------------------------------------------------------------------- */
.desktop-widgets {
  position: absolute;
  top: calc(var(--menubar-height) + 16px);
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
  align-items: flex-end;
}

.widget {
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

.widget-weather {
  width: 280px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(90,170,255,0.85) 0%, rgba(60,130,230,0.85) 100%);
  color: white;
}

.widget-weather-location { font-size: 14px; font-weight: 600; }
.widget-weather-temp { font-size: 52px; font-weight: 200; line-height: 1; margin: 4px 0; }
.widget-weather-condition { font-size: 13px; opacity: 0.85; }
.widget-weather-forecast { display: flex; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.2); }
.widget-weather-hour { text-align: center; font-size: 11px; }
.widget-weather-hour-temp { font-size: 13px; font-weight: 500; margin-top: 2px; }

.widget-row {
  display: flex;
  gap: 12px;
}

.widget-clock {
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.clock-face {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  position: relative;
  background: white;
}

.clock-center { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; background: #333; border-radius: 50%; transform: translate(-50%, -50%); z-index: 5; }
.clock-hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom center; border-radius: 2px; }
.clock-hand-hour { width: 3px; height: 30px; background: #333; }
.clock-hand-minute { width: 2px; height: 42px; background: #333; }
.clock-hand-second { width: 1px; height: 48px; background: #ff3b30; }

.clock-number {
  position: absolute;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.widget-calendar {
  width: 160px;
  background: rgba(255,255,255,0.9);
  padding: 12px;
  color: #333;
}

.cal-month { font-size: 12px; font-weight: 700; color: #ff3b30; text-transform: uppercase; margin-bottom: 8px; }
.cal-header, .cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; text-align: center; }
.cal-header { font-size: 9px; color: #999; font-weight: 600; margin-bottom: 4px; }
.cal-day { font-size: 11px; padding: 2px 0; line-height: 20px; }
.cal-day.today { background: #ff3b30; color: white; border-radius: 50%; width: 20px; height: 20px; margin: 0 auto; }
.cal-day.empty { visibility: hidden; }

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .dock-item::before {
    display: none;
  }

  .dock-icon {
    width: 36px;
    height: 36px;
  }

  .dock-divider {
    height: 28px;
  }

  .dock-container {
    padding: 3px 5px 4px;
    border-radius: 12px;
  }

  .window {
    min-width: 320px;
    min-height: 240px;
  }

  .finder-sidebar {
    width: 140px;
    min-width: 140px;
  }

  .notes-sidebar {
    width: 160px;
    min-width: 160px;
  }

  .settings-sidebar {
    width: 180px;
    min-width: 180px;
  }

  #notification-center {
    width: 300px;
  }

  .spotlight-box {
    width: 90vw;
  }

  .lock-time {
    font-size: 60px;
  }

  .lock-date {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .dock-icon {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .dock-icon:hover {
    transform: scale(1.3) translateY(-6px);
  }

  .finder-sidebar,
  .notes-sidebar,
  .settings-sidebar {
    display: none;
  }

  #notification-center {
    width: 100vw;
  }
}
