/* KSM Central — (c) 2026 KSM · VinzzApp by VinzzDev */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --menubar-h: 30px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ok: #30a14e; --warn: #f5a524; --bad: #ff453a; --idle: #a1a1a6;
  --accent: #0a84ff;
  color-scheme: light;
  --text: #1d1d1f; --text-2: #5f5f66; --text-3: #8c8c93;
  --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .14);
  --glass: rgba(255, 250, 247, .74); --glass-border: rgba(255, 255, 255, .55);
  --menubar-bg: rgba(48, 18, 40, .2); --menubar-text: #fff; --menubar-bolt: rgba(0, 0, 0, .55);
  --menu-bg: rgba(242, 242, 245, .84); --menu-text: #1d1d1f; --menu-hl: #0a6cdc;
  --win-bg: #ffffff; --win-title: rgba(246, 246, 248, .94); --win-shadow: 0 24px 70px rgba(10, 10, 30, .32), 0 0 0 .5px rgba(0, 0, 0, .18);
  --field: rgba(0, 0, 0, .045); --field-focus: rgba(10, 132, 255, .22);
  --panel: #f5f5f7; --panel-2: #ffffff; --sidebar: rgba(236, 236, 240, .9);
  --btn: rgba(0, 0, 0, .06); --btn-hover: rgba(0, 0, 0, .1); --primary: #1d1d1f; --primary-text: #fff;
  --welcome: #1c1a35; --welcome-shadow: 0 1px 24px rgba(255, 255, 255, .25);
  --overlay: rgba(20, 20, 28, .28);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #f5f5f7; --text-2: #b0b0b8; --text-3: #85858d;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --glass: rgba(22, 22, 24, .7); --glass-border: rgba(255, 255, 255, .09);
  --menubar-bg: rgba(10, 10, 12, .38); --menubar-text: #f5f5f7; --menubar-bolt: rgba(0, 0, 0, .8);
  --menu-bg: rgba(36, 36, 40, .86); --menu-text: #f2f2f5; --menu-hl: #0a6cdc;
  --win-bg: #1a1a1a; --win-title: rgba(34, 34, 36, .96); --win-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 0 .5px rgba(255, 255, 255, .12);
  --field: rgba(255, 255, 255, .06); --field-focus: rgba(10, 132, 255, .35);
  --panel: #111111; --panel-2: #1a1a1a; --sidebar: rgba(26, 26, 28, .94);
  --btn: rgba(255, 255, 255, .08); --btn-hover: rgba(255, 255, 255, .13); --primary: #f5f5f7; --primary-text: #111;
  --welcome: #ffffff; --welcome-shadow: 0 2px 30px rgba(0, 0, 0, .35);
  --overlay: rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); font-size: 13px; line-height: 1.45; color: var(--text);
  background: #0b0b10; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
input, textarea, select, [contenteditable], .selectable { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sym { flex: none; display: block; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============ Wallpaper ============ */
.wallpaper { position: fixed; inset: 0; background: #ff9d6c url("../img/wallpaper.svg") center / cover no-repeat; transform: translateZ(0); }
:root.wp-custom .wallpaper { background-image: var(--wp); }
.wallpaper::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 10, 0); transition: background .5s var(--ease); }
:root[data-theme="dark"] .wallpaper::after { background: rgba(4, 4, 16, .48); }

/* ============ Boot / auth screens ============ */
.boot { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; }
.boot-spin { width: 26px; height: 26px; border-radius: 50%; border: 2.4px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; color: #fff; overflow: auto; }
.auth-bg { position: fixed; inset: -60px; z-index: -1; background: #6b4a8f url("../img/wallpaper.svg") center / cover no-repeat; filter: blur(28px) saturate(135%); transform: translateZ(0); }
:root.wp-custom .auth-bg { background-image: var(--wp); }
.auth-bg::after { content: ""; position: absolute; inset: 0; background: rgba(10, 6, 24, .22); }
:root[data-theme="dark"] .auth-bg::after { background: rgba(0, 0, 8, .5); }
.auth-clock { margin-top: clamp(40px, 11vh, 110px); text-align: center; text-shadow: 0 2px 30px rgba(0, 0, 0, .25); }
.auth-date { font-size: 19px; font-weight: 600; opacity: .9; }
.auth-time { font-size: clamp(72px, 12vw, 112px); font-weight: 650; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.auth-card { margin: auto 0 clamp(36px, 10vh, 96px); width: min(340px, calc(100vw - 40px)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar { --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  font-weight: 600; font-size: calc(var(--size) * .38); color: #fff; letter-spacing: .01em;
  background: linear-gradient(145deg, #6b7cff, #8c55e8 55%, #d9508f); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 4px 14px rgba(0, 0, 0, .16); }
.avatar.lg { --size: 84px; }
.avatar .presence { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--glass-solid, #fff); }
.auth-name { font-size: 17px; font-weight: 600; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.auth-sub { font-size: 12.5px; opacity: .8; margin-top: -6px; text-align: center; }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.auth-field { position: relative; }
.auth-field input { width: 100%; height: 36px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .16);
  color: #fff; font: inherit; font-size: 13.5px; padding: 0 44px 0 16px; outline: none; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: border-color .2s, background .2s; }
.auth-field input::placeholder { color: rgba(255, 255, 255, .7); }
.auth-field input:focus { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .22); }
.auth-go { position: absolute; right: 5px; top: 5px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .25); color: #fff; transition: background .2s, opacity .2s; }
.auth-go:hover { background: rgba(255, 255, 255, .4); }
.auth-go[disabled] { opacity: .4; cursor: default; }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; padding: 2px 6px; opacity: .92; }
.auth-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.auth-check input { accent-color: #fff; width: 14px; height: 14px; margin: 0; }
.auth-err { min-height: 18px; font-size: 12.5px; text-align: center; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.auth-err.show { color: #ffd6d3; }
.auth-foot { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 11px; opacity: .65; pointer-events: none; }
.auth-card.shake, .sheet.shake { animation: shake .42s var(--ease); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.auth-title { font-size: 20px; font-weight: 650; letter-spacing: -.01em; text-align: center; }
.auth.out { animation: authOut .38s var(--ease) forwards; pointer-events: none; }
@keyframes authOut { to { opacity: 0; transform: scale(1.04); } }

/* ============ Menu bar ============ */
.menubar { position: fixed; top: 0; left: 0; right: 0; height: var(--menubar-h); z-index: 8000; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 10px; color: var(--menubar-text); background: var(--menubar-bg); backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
  font-size: 13px; font-weight: 500; text-shadow: 0 1px 2px rgba(0, 0, 0, .22), 0 0 12px rgba(0, 0, 0, .12); }
.mb-left, .mb-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.mb-right { justify-content: flex-end; }
.mb-item { height: 24px; padding: 0 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s; }
.mb-item.open { background: rgba(255, 255, 255, .22); }
@media (hover: hover) { .mb-item:hover { background: rgba(255, 255, 255, .22); } :root[data-theme="dark"] .mb-item:hover { background: rgba(255, 255, 255, .14); } }
:root[data-theme="dark"] .mb-item.open { background: rgba(255, 255, 255, .14); }
.mb-brand { font-weight: 750; letter-spacing: .02em; }
.mb-user { font-weight: 650; }
.mb-nav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mb-nav::-webkit-scrollbar { display: none; }
.mb-app { position: relative; opacity: .88; }
.mb-app.running::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 3.5px; height: 3.5px; margin-left: -1.75px; border-radius: 50%; background: currentColor; opacity: .85; }
.mb-app.active { opacity: 1; font-weight: 700; }
.mb-batt { font-variant-numeric: tabular-nums; }
.mb-batt .batt { color: var(--menubar-text); }
.mb-batt.low .mb-batt-pct { color: #fff; }
.mb-clock { font-variant-numeric: tabular-nums; }

/* ============ Desktop ============ */
.desk { position: fixed; inset: var(--menubar-h) 0 0 0; z-index: 1; }
.desk-scroll { position: absolute; inset: 0; }
.desk-icons { position: absolute; top: 18px; left: 18px; display: flex; flex-direction: column; gap: 14px; z-index: 2; }
.d-icon { width: 92px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 5px 2px 4px; border-radius: 10px; text-align: center; color: #fff; }
.d-icon .app-icon { width: 58px; height: 58px; filter: drop-shadow(0 6px 12px rgba(30, 10, 40, .28)); transition: transform .25s var(--ease), filter .25s; }
.d-icon:hover .app-icon { transform: translateY(-2px) scale(1.04); filter: drop-shadow(0 10px 16px rgba(30, 10, 40, .32)); }
.d-icon:active .app-icon { transform: scale(.96); }
.d-icon-label { font-size: 12px; font-weight: 600; line-height: 1.25; padding: 1px 6px; border-radius: 5px; text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 0 12px rgba(0, 0, 0, .25); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-icon.selected .d-icon-label, .d-icon:focus-visible .d-icon-label { background: rgba(10, 100, 220, .85); text-shadow: none; }
.d-icon:focus-visible { outline: none; }
.d-icon-run { width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .4); opacity: 0; margin-top: -1px; }
.d-icon.running .d-icon-run { opacity: .95; }
.d-icon .warn-dot { position: absolute; }

.desk-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; padding: 0 360px 40px; }
.welcome { margin: 0; font-size: clamp(30px, 3.4vw, 46px); font-weight: 650; letter-spacing: -.025em; color: var(--welcome); text-shadow: var(--welcome-shadow); line-height: 1.1; }
.desk-clock { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--welcome); }
.desk-time { font-size: clamp(40px, 4.6vw, 62px); font-weight: 300; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: var(--welcome-shadow); }
.desk-date { font-size: 15px; font-weight: 550; opacity: .8; letter-spacing: .01em; text-shadow: var(--welcome-shadow); }
.desk-divider { width: 34px; height: 2px; border-radius: 2px; background: currentColor; opacity: .18; margin: 2px 0 0; }

.desk-widgets { position: absolute; top: 18px; right: 18px; width: 316px; display: flex; flex-direction: column; gap: 14px; z-index: 2; }
.widget { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-xl); backdrop-filter: blur(36px) saturate(180%); -webkit-backdrop-filter: blur(36px) saturate(180%);
  box-shadow: 0 10px 40px rgba(40, 10, 30, .14), inset 0 1px 0 rgba(255, 255, 255, .25); color: var(--text); padding: 16px 16px 14px; }
.w-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.w-kicker { font-size: 10.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); }
.status-line { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--idle); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.st-headline { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 14px; }
.st-headline .dot { width: 9px; height: 9px; }
.st-metrics { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.st-metric + .st-metric { border-left: 1px solid var(--line-2); padding-left: 16px; }
.st-label { font-size: 11.5px; color: var(--text-2); }
.st-value { font-size: 27px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.st-unit { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.st-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2.5px; height: 22px; }
.st-bar { border-radius: 2.5px; background: var(--line-2); transition: transform .15s; }
.st-bar.ok { background: var(--ok); }
.st-bar.warn { background: var(--warn); }
.st-bar.bad { background: var(--bad); }
.st-bar:hover { transform: scaleY(1.12); }
.st-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); margin-top: 5px; }
.st-list { border-top: 1px solid var(--line-2); margin-top: 11px; padding-top: 7px; display: flex; flex-direction: column; }
.st-row { display: flex; align-items: center; justify-content: space-between; height: 24px; font-size: 12.5px; }
.st-row .status-line { font-weight: 500; font-size: 11.5px; }
.st-row .ms { color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 8px; font-size: 11px; }
.st-foot { border-top: 1px solid var(--line-2); margin-top: 8px; padding-top: 8px; font-size: 10.5px; color: var(--text-3); display: flex; justify-content: space-between; }
.st-tip { position: fixed; z-index: 9500; pointer-events: none; background: var(--menu-bg); color: var(--menu-text); padding: 5px 8px; border-radius: 7px; font-size: 11px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); white-space: nowrap; }

.pwa-widget { position: relative; display: flex; gap: 12px; padding: 14px 14px 13px; animation: popIn .45s var(--ease); }
.pwa-widget .app-icon { width: 42px; height: 42px; flex: none; }
.pwa-title { font-size: 13.5px; font-weight: 650; margin-top: 1px; }
.pwa-text { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.pwa-text .inline-sym { display: inline-block; vertical-align: -3px; }
.pwa-actions { display: flex; gap: 7px; margin-top: 10px; }
.pwa-x { position: absolute; top: 9px; right: 9px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--btn); transition: background .15s; }
.pwa-x:hover { background: var(--btn-hover); }
.pwa-widget.out { animation: popOut .28s var(--ease) forwards; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes popOut { to { opacity: 0; transform: scale(.96); } }

.user-card { position: absolute; right: 18px; bottom: 18px; width: 316px; display: flex; align-items: center; gap: 13px; padding: 13px 15px; z-index: 2; text-align: left; }
.user-card .avatar { --size: 46px; --glass-solid: rgba(255, 245, 240, .9); }
:root[data-theme="dark"] .user-card .avatar { --glass-solid: #222; }
.uc-name { font-size: 14px; font-weight: 650; }
.uc-role { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.uc-batt { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.uc-batt .batt { color: var(--text); width: 22px; height: 11px; }
.uc-batt.low { color: var(--bad); font-weight: 600; }
.uc-main { min-width: 0; flex: 1; }

/* ============ Buttons / fields ============ */
.btn { height: 28px; padding: 0 14px; border-radius: 999px; background: var(--btn); color: var(--text); font-weight: 550; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background .15s, transform .1s, opacity .15s; }
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary); opacity: .88; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad); opacity: .88; }
.btn-ghost { background: transparent; }
.btn-sm { height: 24px; padding: 0 11px; font-size: 12px; }
.btn-icon { width: 28px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 550; color: var(--text-2); }
.field small { font-size: 11px; color: var(--text-3); }
.input, .select, .textarea { width: 100%; min-height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; font-size: 13px; padding: 6px 11px; outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { resize: vertical; min-height: 64px; font-family: var(--mono); font-size: 12px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--field-focus); }
.select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 20 20' fill='none' stroke='%238c8c93' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch i::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, .3); transition: transform .2s var(--ease); }
.switch input:checked + i { background: #34c759; }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ Notifications ============ */
.notif-stack { position: fixed; top: calc(var(--menubar-h) + 10px); right: 12px; z-index: 9800; display: flex; flex-direction: column; gap: 8px; width: min(352px, calc(100vw - 24px)); pointer-events: none; }
.notif { pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; border-radius: 18px; background: var(--menu-bg); color: var(--menu-text); position: relative;
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); box-shadow: 0 12px 40px rgba(0, 0, 0, .2), 0 0 0 .5px var(--line-2);
  opacity: 0; transform: translateX(24px); transition: opacity .3s var(--ease), transform .3s var(--ease); touch-action: pan-y; }
.notif.in { opacity: 1; transform: none; }
.notif.out { opacity: 0; transform: translateX(40px); }
.notif-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.notif-ico .app-icon { width: 34px; height: 34px; }
.notif-sym { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--btn); color: var(--text-2); }
.notif-success .notif-sym { color: #fff; background: linear-gradient(#5fdc84, #22a94c); }
.notif-warning .notif-sym, .notif-battery .notif-sym { color: #fff; background: linear-gradient(#ffc04d, #ff8f1f); }
.notif-danger .notif-sym, .notif-error .notif-sym { color: #fff; background: linear-gradient(#ff7a7a, #e8323f); }
.notif-main { flex: 1; min-width: 0; padding-right: 10px; }
.notif-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.notif-head strong { font-size: 13px; font-weight: 650; }
.notif-time { font-size: 11px; color: var(--text-3); flex: none; }
.notif-body { font-size: 12.5px; color: var(--text-2); margin-top: 1px; word-wrap: break-word; }
.notif-actions { display: flex; gap: 6px; margin-top: 8px; }
.notif-btn { height: 24px; padding: 0 11px; border-radius: 999px; background: var(--btn); font-size: 12px; font-weight: 550; }
.notif-btn.primary { background: var(--primary); color: var(--primary-text); }
.notif-x { position: absolute; left: -6px; top: -6px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--menu-bg); box-shadow: 0 1px 4px rgba(0, 0, 0, .2), 0 0 0 .5px var(--line-2); opacity: 0; transition: opacity .15s; color: var(--text-2); }
.notif:hover .notif-x, .notif:focus-within .notif-x { opacity: 1; }
@media (pointer: coarse) { .notif-x { opacity: 1; } }

/* ============ Context menu ============ */
.cm { position: fixed; z-index: 9900; min-width: 216px; max-width: 300px; padding: 5px; border-radius: 10px; background: var(--menu-bg); color: var(--menu-text);
  backdrop-filter: blur(40px) saturate(190%); -webkit-backdrop-filter: blur(40px) saturate(190%); box-shadow: 0 10px 38px rgba(0, 0, 0, .24), 0 0 0 .5px rgba(0, 0, 0, .22), inset 0 0 0 .5px rgba(255, 255, 255, .25);
  font-size: 13px; outline: none; opacity: 0; transform: scale(.98); transform-origin: top left; transition: opacity .12s, transform .12s var(--ease); }
:root[data-theme="dark"] .cm { box-shadow: 0 10px 38px rgba(0, 0, 0, .5), 0 0 0 .5px rgba(255, 255, 255, .14); }
.cm.show { opacity: 1; transform: none; }
.cm-item:focus-visible { outline: none; }
.cm-item { height: 24px; display: flex; align-items: center; gap: 7px; padding: 0 9px 0 4px; border-radius: 5px; cursor: default; outline: none; white-space: nowrap; }
.cm-item:hover, .cm-item:focus, .cm-item.active { background: var(--menu-hl); color: #fff; }
.cm-item.disabled { opacity: .38; }
.cm-item.disabled:hover, .cm-item.disabled:focus { background: transparent; color: inherit; }
.cm-item.danger { color: var(--bad); }
.cm-item.danger:hover, .cm-item.danger:focus { color: #fff; background: var(--bad); }
.cm-check { width: 14px; display: grid; place-items: center; flex: none; }
.cm-ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; opacity: .85; }
.cm-ico .app-icon { width: 16px; height: 16px; }
.cm-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cm-key { opacity: .55; font-size: 12px; margin-left: 18px; letter-spacing: .06em; }
.cm-arrow { opacity: .6; }
.cm-sep { height: 1px; margin: 5px 9px; background: var(--line-2); }
.cm-header { font-size: 11px; font-weight: 650; color: var(--text-3); padding: 4px 9px 2px 25px; }

/* ============ Sheets ============ */
.sheet-overlay { position: fixed; inset: 0; z-index: 9700; display: grid; place-items: center; background: var(--overlay); opacity: 0; transition: opacity .18s; padding: 16px; }
.sheet-overlay.in { opacity: 1; }
.sheet-overlay.out { opacity: 0; }
.sheet { background: var(--menu-bg); color: var(--menu-text); border-radius: 16px; padding: 22px 20px 16px; text-align: center; backdrop-filter: blur(40px) saturate(190%); -webkit-backdrop-filter: blur(40px) saturate(190%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 .5px var(--line-2); transform: scale(.96); transition: transform .22s var(--ease); max-height: calc(100vh - 32px); overflow: auto; }
.sheet-overlay.in .sheet { transform: none; }
.sheet-ico { display: flex; justify-content: center; margin-bottom: 10px; }
.sheet-ico .app-icon { width: 52px; height: 52px; }
.sheet-title { margin: 0; font-size: 14.5px; font-weight: 700; }
.sheet-msg { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); }
.sheet-actions { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.sheet-actions .btn { flex: 1; max-width: 160px; }
.sheet .field { text-align: left; margin-top: 12px; }
.pin-sheet { width: min(320px, calc(100vw - 32px)); }
.pin-field { position: relative; display: block; margin: 18px auto 0; width: 220px; height: 44px; cursor: text; }
.pin-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; caret-color: transparent; }
.pin-dots { display: flex; justify-content: center; align-items: center; gap: 14px; height: 100%; pointer-events: none; }
.pin-dots span { width: 13px; height: 13px; border-radius: 50%; border: 1.6px solid var(--text-3); transition: background .12s, border-color .12s, transform .12s; }
.pin-dots span.on { background: var(--text); border-color: var(--text); transform: scale(1.05); }
.pin-field:focus-within .pin-dots span:not(.on):first-of-type { border-color: var(--accent); }
.pin-err { min-height: 18px; margin-top: 8px; font-size: 12px; color: var(--bad); font-weight: 550; }
.pin-sheet.busy .pin-dots { opacity: .5; }
.pin-sheet.ok .pin-dots span { background: var(--ok); border-color: var(--ok); }

/* ============ Windows ============ */
.win-layer { position: fixed; inset: var(--menubar-h) 0 0 0; z-index: 100; pointer-events: none; }
.win { position: absolute; display: flex; flex-direction: column; background: var(--win-bg); border-radius: 12px; overflow: hidden; box-shadow: var(--win-shadow); pointer-events: auto; min-width: 360px; min-height: 260px;
  transition: opacity .2s var(--ease), transform .2s var(--ease); }
.win.zoomed { left: 8px !important; top: 8px !important; width: calc(100% - 16px) !important; height: calc(100% - 16px) !important; }
.win.inactive .win-title { color: var(--text-3); }
.win.inactive .tl { background: var(--line-2) !important; }
.win.entering { opacity: 0; transform: scale(.965) translateY(8px); }
.win.leaving { opacity: 0; transform: scale(.97); pointer-events: none; }
.win-title { height: 38px; flex: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 0 10px 0 13px; background: var(--win-title); border-bottom: 1px solid var(--line); color: var(--text); cursor: default; touch-action: none; }
.win-traffic { display: flex; gap: 8px; }
.tl { width: 12px; height: 12px; border-radius: 50%; display: grid; place-items: center; color: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18); position: relative; }
.tl::before { content: ""; position: absolute; inset: -5px; }
.tl svg { opacity: 0; width: 8px; height: 8px; transition: opacity .1s; }
.win-traffic:hover .tl svg, .win-traffic:focus-within .tl svg { opacity: 1; }
.tl-close { background: #ff5f57; } .tl-min { background: #febc2e; } .tl-zoom { background: #28c840; }
.win-name { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; font-weight: 650; font-size: 13px; }
.win-name .app-icon { width: 17px; height: 17px; flex: none; }
.win-sub { font-weight: 450; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.win-sub::before { content: "—"; margin-right: 7px; opacity: .6; }
.win-actions { display: flex; gap: 2px; }
.win-act { width: 26px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--text-2); transition: background .15s; }
.win-act:hover { background: var(--btn); }
.win-body { position: relative; flex: 1; min-height: 0; background: var(--win-bg); }
.win-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
:root[data-theme="dark"] .win-body iframe { background: #fff; }
.win-loader { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--win-bg); transition: opacity .3s; z-index: 2; }
.win-loader .app-icon { width: 64px; height: 64px; animation: breathe 1.6s ease-in-out infinite; }
.win-loader.hide { opacity: 0; pointer-events: none; }
.win-loader-text { font-size: 12.5px; color: var(--text-2); }
.win-loader-hint { font-size: 11.5px; color: var(--text-3); opacity: 0; transition: opacity .4s; max-width: 300px; text-align: center; }
.win-loader-hint.show { opacity: 1; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }
.win-shield { position: absolute; inset: 0; z-index: 5; display: none; }
.win.dragging .win-shield, .win.resizing .win-shield, body.wm-busy .win-shield { display: block; }
.win.dragging, .win.resizing { transition: none; }
.rz { position: absolute; z-index: 6; }
.rz-e { right: -3px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.rz-w { left: -3px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.rz-s { bottom: -3px; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.rz-se { right: -3px; bottom: -3px; width: 16px; height: 16px; cursor: nwse-resize; }
.rz-sw { left: -3px; bottom: -3px; width: 16px; height: 16px; cursor: nesw-resize; }
.win.zoomed .rz { display: none; }

/* ============ Editor (Edit CentralApp) ============ */
.ed { position: absolute; inset: 0; display: grid; grid-template-columns: 216px 1fr; background: var(--panel); color: var(--text); user-select: none; }
.ed-side { background: var(--sidebar); border-right: 1px solid var(--line); padding: 12px 10px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.ed-side-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.ed-side-head .avatar { --size: 34px; }
.ed-side-head b { display: block; font-size: 13px; }
.ed-side-head small { display: block; font-size: 11.5px; color: var(--text-2); }
.ed-nav { height: 30px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border-radius: 7px; font-weight: 550; color: var(--text); text-align: left; }
.ed-nav:hover { background: var(--btn); }
.ed-nav.on { background: var(--menu-hl); color: #fff; }
.ed-nav .sym { opacity: .8; }
.ed-side-foot { margin-top: auto; padding: 12px 8px 2px; font-size: 11px; color: var(--text-3); line-height: 1.5; }
.ed-main { overflow: auto; padding: 26px 30px 40px; }
.ed-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ed-h h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.ed-h p { margin: 3px 0 0; color: var(--text-2); font-size: 12.5px; max-width: 560px; }
.card { background: var(--panel-2); border-radius: 12px; border: 1px solid var(--line); }
.card + .card { margin-top: 14px; }
.card-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-h b { font-size: 13px; }
.card-b { padding: 16px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 56px; }
.list-row:last-child { border-bottom: 0; }
.list-row .app-icon { width: 34px; height: 34px; flex: none; }
.lr-main { flex: 1; min-width: 0; }
.lr-title { font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.lr-sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-meta { font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.lr-actions { display: flex; gap: 4px; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row b { font-size: 13px; font-weight: 550; display: block; }
.toggle-row small { color: var(--text-3); font-size: 11.5px; }
.glyph-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.glyph-pick button { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; border: 2px solid transparent; }
.glyph-pick button .app-icon { width: 32px; height: 32px; }
.glyph-pick button.on { border-color: var(--accent); }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick button { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); position: relative; }
.color-pick button.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); }
.note { font-size: 12px; color: var(--text-2); background: var(--field); border-radius: 10px; padding: 10px 12px; line-height: 1.55; }
.note b { color: var(--text); }
.note code, .mono { font-family: var(--mono); font-size: 11.5px; }
.note code { background: var(--btn); padding: 1px 5px; border-radius: 4px; }
.detect-box { margin-top: 10px; font-size: 12px; }
.detect-box .ok { color: var(--ok); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.vault-row { display: grid; grid-template-columns: 34px 150px 1fr 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.vault-row:last-child { border-bottom: 0; }
.vault-row .app-icon { width: 30px; height: 30px; }
.vault-row .lr-title { font-size: 12.5px; }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; width: 90px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.meter.low i { background: var(--bad); }
.meter.mid i { background: var(--warn); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; }
.log-row { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; }
.log-row:last-child { border-bottom: 0; }
.log-row .mono { color: var(--text-2); }
.log-ref { font-family: var(--mono); font-weight: 700; font-size: 12px; }
.log-msg { margin-top: 3px; }
details.log-trace summary { cursor: pointer; color: var(--text-3); font-size: 11.5px; margin-top: 4px; }
details.log-trace pre { white-space: pre-wrap; font-family: var(--mono); font-size: 11px; background: var(--field); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; color: var(--text-2); user-select: text; }
.empty { padding: 30px 16px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.ed-toolbar { display: flex; gap: 8px; align-items: center; }
.ed-search { width: 220px; }
.pill-text { font-size: 11.5px; color: var(--text-3); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.ed-back { display: none; }

/* ============ Responsive ============ */
@media (max-width: 1180px) {
  .desk-center { padding: 0 340px 40px 130px; }
}
@media (max-width: 980px) {
  .desk { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .desk-scroll { position: relative; min-height: 100%; display: flex; flex-direction: column; padding: 18px 16px 24px; gap: 18px; }
  .desk-icons { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .desk-center { position: static; padding: 26px 0 10px; flex: none; }
  .desk-widgets { position: static; width: 100%; max-width: 520px; margin: 0 auto; }
  .user-card { position: static; width: 100%; max-width: 520px; margin: 0 auto; }
}
@media (max-width: 760px) {
  :root { --menubar-h: 34px; }
  .menubar { grid-template-columns: auto 1fr auto; gap: 4px; padding: 0 6px; }
  .mb-user, .mb-clock-date { display: none; }
  .mb-right { gap: 0; }
  .mb-nav { justify-content: flex-start; mask-image: linear-gradient(90deg, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .mb-item { padding: 0 8px; }
  .d-icon { width: 80px; }
  .d-icon .app-icon { width: 54px; height: 54px; }
  .welcome { font-size: 30px; }
  .desk-time { font-size: 46px; }
  .win, .win.zoomed { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; min-width: 0; }
  .win-title { height: 44px; }
  .tl { width: 14px; height: 14px; }
  .win-sub { display: none; }
  .rz { display: none; }
  .ed { grid-template-columns: 1fr; }
  .ed-side { position: absolute; inset: 0; z-index: 2; border: 0; }
  .ed.detail .ed-side { display: none; }
  .ed-main { padding: 16px 16px 40px; }
  .ed-back { display: inline-flex; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .vault-row { grid-template-columns: 30px 1fr; }
  .vault-row > :nth-child(n+3) { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; }
  .ed-search { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (display-mode: standalone) {
  :root { --menubar-h: calc(30px + env(safe-area-inset-top, 0px)); }
  .menubar { padding-top: env(safe-area-inset-top, 0px); }
}
@media (display-mode: standalone) and (max-width: 760px) {
  :root { --menubar-h: calc(34px + env(safe-area-inset-top, 0px)); }
}
