:root {
  --accent: #007aff;
  --accent-2: #409cff;
  --accent-soft: rgba(0, 122, 255, 0.16);
  --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a; --green: #32d74b;
  --tl-close: #ff5f57; --tl-min: #febc2e; --tl-zoom: #28c840;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --mb-h: 26px;
  --radius-win: 10px;
  --blur: blur(28px) saturate(1.8);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-appearance="light"] {
  --text: #1d1d1f; --text-2: #515154; --text-3: #86868b;
  --menu-bg: rgba(251, 251, 253, 0.6);
  --panel: rgba(246, 246, 249, 0.82);
  --panel-solid: #f2f2f4;
  --chrome: rgba(246, 246, 248, 0.94);
  --content-bg: #ffffff;
  --sidebar-bg: rgba(238, 238, 242, 0.78);
  --field-bg: rgba(0, 0, 0, 0.05);
  --field-bg-focus: #ffffff;
  --sep: rgba(0, 0, 0, 0.09);
  --sep-strong: rgba(0, 0, 0, 0.16);
  --hover: rgba(0, 0, 0, 0.055);
  --shadow-win: 0 0 0 0.5px rgba(0,0,0,0.12), 0 10px 24px rgba(0,0,0,0.18), 0 32px 72px rgba(0,0,0,0.28);
  --shadow-pop: 0 0 0 0.5px rgba(0,0,0,0.1), 0 12px 34px rgba(0,0,0,0.24);
  --dock-bg: rgba(252, 252, 255, 0.42);
  --cc-bg: rgba(244, 244, 248, 0.62);
  --cc-cell: rgba(255, 255, 255, 0.72);
  --overlay: rgba(240, 240, 245, 0.3);
  color-scheme: light;
}
html[data-appearance="dark"] {
  --text: #f5f5f7; --text-2: #a9a9ae; --text-3: #7c7c80;
  --menu-bg: rgba(24, 24, 27, 0.52);
  --panel: rgba(36, 36, 40, 0.78);
  --panel-solid: #2a2a2e;
  --chrome: rgba(44, 44, 48, 0.92);
  --content-bg: #1e1e21;
  --sidebar-bg: rgba(32, 32, 36, 0.72);
  --field-bg: rgba(255, 255, 255, 0.08);
  --field-bg-focus: rgba(255, 255, 255, 0.14);
  --sep: rgba(255, 255, 255, 0.1);
  --sep-strong: rgba(255, 255, 255, 0.18);
  --hover: rgba(255, 255, 255, 0.08);
  --shadow-win: 0 0 0 0.5px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.42), 0 36px 90px rgba(0,0,0,0.5);
  --shadow-pop: 0 0 0 0.5px rgba(0,0,0,0.35), 0 14px 40px rgba(0,0,0,0.5);
  --dock-bg: rgba(30, 30, 34, 0.42);
  --cc-bg: rgba(32, 32, 37, 0.6);
  --cc-cell: rgba(66, 66, 72, 0.6);
  --overlay: rgba(10, 10, 14, 0.42);
  color-scheme: dark;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: #000;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  cursor: default;
}
input, textarea, [contenteditable="true"] { user-select: text; font-family: inherit; }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: default; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(127,127,127,0.42); border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(127,127,127,0.65); border: 2px solid transparent; background-clip: content-box; }

#screen { position: fixed; inset: 0; overflow: hidden; }
#wallpaper { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
#wallpaper svg { position: absolute; inset: -2.5%; width: 105%; height: 105%; transition: opacity 0.8s ease; }
#wallpaper .wp-layer { transition: transform 1.2s var(--ease-out); will-change: transform; }
#desktop { position: absolute; inset: var(--mb-h) 0 0 0; z-index: 1; }
#widget-layer { position: absolute; inset: var(--mb-h) 0 0 0; z-index: 1; pointer-events: none; }
#window-layer { position: absolute; inset: 0; z-index: 30; }
#menubar { position: absolute; top: 0; left: 0; right: 0; height: var(--mb-h); z-index: 400; }
#dock-wrap { position: absolute; bottom: 0; left: 0; right: 0; z-index: 380; display: flex; justify-content: center; pointer-events: none; }
#overlay-layer { position: absolute; inset: 0; z-index: 500; pointer-events: none; }
#overlay-layer > * { pointer-events: auto; }
#notification-layer { position: absolute; top: calc(var(--mb-h) + 8px); right: 10px; z-index: 600; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#dim-layer { position: absolute; inset: 0; z-index: 700; background: #000; pointer-events: none; }
#screensaver { position: absolute; inset: 0; z-index: 800; }
#lockscreen { position: absolute; inset: 0; z-index: 900; }
#bootscreen { position: absolute; inset: 0; z-index: 1000; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 74px; }
#poweroff { position: absolute; inset: 0; z-index: 1100; background: #000; color: rgba(255,255,255,0.4); display: flex; align-items: center; justify-content: center; font-size: 14px; letter-spacing: 0.02em; }

.boot-logo svg { width: 84px; height: 100px; filter: drop-shadow(0 0 24px rgba(255,255,255,0.08)); }
.boot-progress { width: 220px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.22); overflow: hidden; }
.boot-progress i { display: block; height: 100%; width: 0%; border-radius: 4px; background: #fff; transition: width 0.25s linear; }

#lockscreen {
  display: flex; flex-direction: column; align-items: center;
  background: transparent; transition: opacity 0.5s ease;
}
#lockscreen .lock-bg { position: absolute; inset: -40px; filter: blur(32px) saturate(1.4) brightness(0.86); transform: scale(1.06); overflow: hidden; }
#lockscreen .lock-bg svg { width: 100%; height: 100%; }
.lock-clock { position: relative; margin-top: 7vh; text-align: center; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.3); transition: all 0.45s var(--spring); }
.lock-clock .lc-date { font-size: 22px; font-weight: 600; letter-spacing: 0.01em; }
.lock-clock .lc-time { font-size: 88px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.02; margin-top: -4px; }
.lock-user { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: auto; margin-bottom: 16vh; transition: all 0.45s var(--spring); animation: fade-up 0.6s ease 0.1s backwards; }
#lockscreen.unlocking .lock-clock { transform: translateY(-46px) scale(0.92); opacity: 0.7; }
#lockscreen.unlocking .lock-user { transform: translateY(14px); opacity: 0; }
.avatar { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; font-weight: 600; box-shadow: 0 6px 22px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.25); background: linear-gradient(145deg, #7ab3ef, #3f6fdd 55%, #6a4fd0); }
.lock-user .lu-name { color: #fff; font-size: 16px; font-weight: 600; text-shadow: 0 1px 10px rgba(0,0,0,0.4); }
.lock-field { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 15px; background: rgba(255,255,255,0.24); backdrop-filter: blur(20px); box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.3); }
.lock-field input { background: none; border: none; outline: none; color: #fff; font-size: 13px; width: 150px; }
.lock-field input::placeholder { color: rgba(255,255,255,0.75); }
.lock-field button { width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,0.85); color: #333; display: flex; align-items: center; justify-content: center; font-size: 11px; transition: transform 0.15s; }
.lock-field button:active { transform: scale(0.88); }
.lock-field .spin { animation: spin 0.7s linear infinite; }
.lock-hint { color: rgba(255,255,255,0.8); font-size: 12px; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.lock-bottom { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 26px; }
.lock-bottom .lb-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.22); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.dialog-backdrop { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; background: transparent; animation: fadein 0.18s ease; }
@keyframes fadein { from { opacity: 0; } }
.dialog {
  min-width: 260px; max-width: 400px; border-radius: 12px; padding: 18px 18px 14px;
  background: var(--panel); backdrop-filter: var(--blur); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  animation: dialog-in 0.22s var(--spring);
}
@keyframes dialog-in { from { transform: scale(1.06); opacity: 0; } }
.dialog .d-icon { width: 56px; height: 56px; margin-bottom: 2px; }
.dialog .d-title { font-size: 13px; font-weight: 700; }
.dialog .d-msg { font-size: 11.5px; color: var(--text-2); line-height: 1.45; max-width: 320px; }
.dialog .d-btns { display: flex; gap: 8px; margin-top: 10px; width: 100%; justify-content: center; }
.btn {
  height: 22px; min-width: 70px; padding: 0 12px; border-radius: 6px; font-size: 12.5px;
  background: var(--field-bg); box-shadow: inset 0 0 0 0.5px var(--sep-strong), 0 0.5px 1px rgba(0,0,0,0.08);
  display: inline-flex; align-items: center; justify-content: center; transition: filter 0.12s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(0.94); }
.btn.default { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 0 0 0.5px rgba(0,0,0,0.08); font-weight: 600; }
.btn.destructive { background: linear-gradient(180deg, #ff6259, var(--red)); color: #fff; font-weight: 600; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.big { height: 26px; font-size: 13px; border-radius: 7px; }

.sheet { position: absolute; left: 50%; transform: translateX(-50%); top: 0; z-index: 60; min-width: 280px; border-radius: 0 0 12px 12px; background: var(--panel); backdrop-filter: var(--blur); box-shadow: var(--shadow-pop); padding: 16px; animation: sheet-in 0.28s var(--spring); }
@keyframes sheet-in { from { transform: translateX(-50%) translateY(-40%); opacity: 0; } }

.text-input {
  height: 24px; padding: 0 8px; border-radius: 6px; border: none; outline: none; font-size: 12.5px; color: var(--text);
  background: var(--field-bg); box-shadow: inset 0 0 0 0.5px var(--sep);
}
.text-input:focus { background: var(--field-bg-focus); box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 0.5px var(--accent); }
select.text-input { appearance: none; padding-right: 20px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 11px) 55%, calc(100% - 7px) 55%; background-size: 4px 4px; background-repeat: no-repeat; }

.toggle { position: relative; width: 38px; height: 23px; border-radius: 12px; background: rgba(120,120,128,0.32); transition: background 0.2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.25); transition: transform 0.2s var(--spring); }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(15px); }

.slider { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; width: 100%; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--fill, 50%), rgba(120,120,128,0.3) var(--fill, 50%)); }
.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.3), inset 0 0 0 0.5px rgba(0,0,0,0.06); margin-top: -6px; }

.seg { display: inline-flex; background: var(--field-bg); border-radius: 7px; padding: 2px; gap: 1px; box-shadow: inset 0 0 0 0.5px var(--sep); }
.seg button { padding: 3px 12px; border-radius: 5px; font-size: 12px; color: var(--text-2); transition: all 0.15s; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.14), inset 0 0 0 0.5px rgba(0,0,0,0.04); font-weight: 500; }
html[data-appearance="dark"] .seg button.on { background: #636366; color: #fff; }

@keyframes bounce-dock {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-26px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-12px); }
  85% { transform: translateY(0); }
}
@keyframes wiggle { 0%,100% { transform: rotate(-1.6deg);} 50% { transform: rotate(1.6deg);} }
@keyframes notif-in { from { transform: translateX(110%); opacity: 0.4; } }
@keyframes fade-up { from { transform: translateY(14px); opacity: 0; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.beachball { display: inline-block; animation: spin 0.9s linear infinite; }
