/* UltraOS: dark navy desktop. Colors are CSS variables so themes/accents swap instantly. */
:root {
  --accent: #38bdf8;
  --bg: #0a1020; --panel: rgba(13, 20, 38, .9); --panel-solid: #0f1729; --panel-2: #141e35; --panel-3: #1b2742;
  --border: rgba(148, 163, 184, .16); --border-strong: rgba(148, 163, 184, .28);
  --text: #e2e8f0; --muted: #8fa1bb; --faint: #5b6b84;
  --ok: #22c55e; --bad: #f43f5e; --warn: #f59e0b;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --radius: 12px; --bar: 52px;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --hover: rgba(148, 163, 184, .1); --sel: color-mix(in srgb, var(--accent) 22%, transparent);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e8eef7; --panel: rgba(255, 255, 255, .92); --panel-solid: #ffffff; --panel-2: #f3f6fb; --panel-3: #e7edf6;
  --border: rgba(15, 23, 42, .1); --border-strong: rgba(15, 23, 42, .2);
  --text: #0f172a; --muted: #55657d; --faint: #94a3b8;
  --shadow: 0 24px 60px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
  --hover: rgba(15, 23, 42, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; -webkit-font-smoothing: antialiased; }
#app { height: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .28); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
[hidden] { display: none !important; }

/* ---------- basics ---------- */
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .pad { padding: 10px 14px; }
.mono { font-family: var(--mono); font-size: 13px; } .mono-soft { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(0,0,0,.25); }
.tile-sm { width: 20px; height: 20px; border-radius: 6px; } .tile-md { width: 32px; height: 32px; border-radius: 9px; }
.tile-lg { width: 46px; height: 46px; border-radius: 13px; } .tile.emoji { font-size: 24px; box-shadow: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; background: var(--panel-3); border: 1px solid var(--border); font-weight: 550; transition: background .12s, border-color .12s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--panel-3) 70%, var(--text) 10%); }
.btn.primary { background: var(--accent); border-color: transparent; color: #04121f; }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger.ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; padding: 11px; }
.linkbtn { color: var(--accent); font-size: 13px; } .linkbtn:hover { text-decoration: underline; }
.icon-btn { display: inline-flex; padding: 6px; border-radius: 7px; color: var(--muted); } .icon-btn:hover { background: var(--hover); color: var(--text); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.input { width: 100%; padding: 9px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border-strong); outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.auto { width: auto; min-width: 90px; }
.input.code { font-family: var(--mono); letter-spacing: .15em; text-align: center; font-size: 17px; }
textarea.input { resize: vertical; }
.field-label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; font-weight: 550; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--hover); margin-left: 6px; vertical-align: 1px; }
.pill-ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill-bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.pill-off { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot-ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); } .dot-bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.tag { font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--hover); color: var(--muted); }
.notice { display: flex; gap: 10px; align-items: center; padding: 9px 14px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: color-mix(in srgb, var(--warn) 80%, var(--text)); font-size: 13px; border-bottom: 1px solid var(--border); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 40px 20px; text-align: center; height: 100%; min-height: 160px; }
.empty .ic { opacity: .6; } .empty.small { padding: 30px 10px; min-height: 0; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 13px; height: 13px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #6366f1); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.avatar.big { width: 72px; height: 72px; font-size: 30px; margin: 0 auto 6px; }
.bar { height: 8px; border-radius: 99px; background: var(--hover); overflow: hidden; margin: 6px 0 3px; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.bar-fill.warnc { background: var(--warn); } .bar-fill.bad { background: var(--bad); }

/* ---------- lock / login ---------- */
.lockscreen { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 20px;
  background: radial-gradient(1000px 700px at 15% 10%, rgba(37,99,235,.35), transparent 60%), radial-gradient(900px 700px at 85% 90%, rgba(14,165,233,.28), transparent 60%), linear-gradient(160deg, #0a1020, #0b1730); color: #e2e8f0; }
.lockscreen.overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(6, 10, 22, .55); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); }
.lock-clock { text-align: center; text-shadow: 0 2px 20px rgba(0,0,0,.4); }
.lock-time { font-size: clamp(54px, 11vw, 96px); font-weight: 250; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.lock-date { font-size: 18px; opacity: .8; margin-top: 8px; }
.login-card { width: min(360px, 100%); background: rgba(13, 20, 38, .78); border: 1px solid rgba(148,163,184,.2); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); text-align: center; }
.login-card h1 { font-size: 19px; margin: 0 0 6px; font-weight: 650; }
.login-card .input { background: rgba(10, 16, 32, .8); color: #e2e8f0; }
.login-logo { width: 58px; height: 58px; margin: 0 auto 4px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #38bdf8, #2563eb); box-shadow: 0 8px 24px rgba(37,99,235,.45); }
.login-err { min-height: 18px; color: #fb7185; font-size: 13px; } .login-err.hint { color: #93c5fd; }
.lock-foot { font-size: 12.5px; color: #fbbf24; text-align: center; max-width: 520px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- desktop ---------- */
#desktop { position: fixed; inset: 0; overflow: hidden; background-color: #0a1020; }
#icons { position: absolute; inset: 0 0 var(--bar) 0; user-select: none; touch-action: none; }
.dicon { position: absolute; width: 86px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 10px; border: 1px solid transparent; color: #fff; transition: left .12s, top .12s; }
.dicon.moving { transition: none; opacity: .8; z-index: 2; }
.marquee { position: fixed; z-index: 9400; pointer-events: none; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 2px; }
.dicon:hover { background: rgba(255,255,255,.08); }
.dicon.sel { background: color-mix(in srgb, var(--accent) 25%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dicon-label { font-size: 12.5px; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.8); line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#windows { position: absolute; inset: 0 0 var(--bar) 0; pointer-events: none; }
#windows > * { pointer-events: auto; }
#snap-preview { position: absolute; pointer-events: none; border-radius: 12px; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); opacity: 0; transition: all .15s; inset: 50%; }
#snap-preview.snap-left { inset: 6px 50% 6px 6px; opacity: 1; } #snap-preview.snap-right { inset: 6px 6px 6px 50%; opacity: 1; } #snap-preview.snap-max { inset: 6px; opacity: 1; }

#taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar); display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--panel); border-top: 1px solid var(--border); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); z-index: 5000; }
.start-btn { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--accent); flex: none; }
.start-btn:hover, .start-btn.on { background: var(--hover); }
#tasks { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
#tasks::-webkit-scrollbar { display: none; }
.task { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 9px; border-radius: 10px; max-width: 210px; flex: none; position: relative; }
.task:hover { background: var(--hover); }
.task.on { background: var(--hover); }
.task::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 6px; height: 3px; border-radius: 3px; background: var(--muted); transform: translateX(-50%); }
.task.on::after { width: 18px; background: var(--accent); }
.task.min { opacity: .7; }
.task-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray { display: flex; align-items: center; gap: 2px; flex: none; }
.tray-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.tray-btn:hover { background: var(--hover); color: var(--text); }
.tray-btn.warn { color: var(--warn); }
.tray-chip { display: flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tray-chip:hover { background: var(--hover); color: var(--text); }
.badge { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.tray-clock { text-align: right; padding: 0 8px; cursor: pointer; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tray-time { font-size: 13px; font-weight: 600; } .tray-date { font-size: 11px; color: var(--muted); }

.start { position: absolute; left: 8px; bottom: calc(var(--bar) + 8px); width: min(520px, calc(100vw - 16px)); max-height: calc(100% - var(--bar) - 16px); display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); z-index: 6000; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.start-head { display: flex; gap: 12px; align-items: center; }
.start-user { font-weight: 650; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 4px; overflow-y: auto; min-height: 120px; }
.start-app { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px; border-radius: 12px; font-size: 12.5px; }
.start-app:hover, .start-app:focus-visible { background: var(--hover); }
.start-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border); padding-top: 10px; }
.start-foot > span { flex: 1; }

.notes { position: absolute; right: 8px; bottom: calc(var(--bar) + 8px); width: min(380px, calc(100vw - 16px)); max-height: min(560px, calc(100% - var(--bar) - 16px)); display: flex; flex-direction: column; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); z-index: 6000; animation: pop .16s ease-out; overflow: hidden; }
.notes-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notes-list { overflow-y: auto; padding: 6px; }
.note { display: flex; gap: 10px; padding: 10px; border-radius: 10px; }
.note:hover { background: var(--hover); }
.note > .ic { margin-top: 2px; color: var(--accent); }
.note-warn > .ic { color: var(--warn); } .note-error > .ic { color: var(--bad); } .note-ok > .ic { color: var(--ok); }
.note-title { font-weight: 600; font-size: 13.5px; } .note-body { font-size: 13px; color: var(--muted); word-break: break-word; } .note-time { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* ---------- windows ---------- */
.win { position: absolute; display: flex; flex-direction: column; min-width: 320px; min-height: 200px; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; animation: winin .14s ease-out; }
@keyframes winin { from { opacity: 0; transform: scale(.97); } }
.win:not(.active) { box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.win:not(.active) .win-bar { opacity: .75; }
.win.minimized { display: none; }
.win.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border: 0; }
.win.closing { opacity: 0; transform: scale(.97); transition: opacity .14s, transform .14s; }
.win.dragging { user-select: none; } .win.dragging iframe { pointer-events: none; }
.win.blur-hidden { visibility: hidden; }
.win-bar { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 6px 0 11px; background: var(--panel-2); border-bottom: 1px solid var(--border); flex: none; cursor: default; user-select: none; touch-action: none; }
.win-title { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-btns { display: flex; gap: 2px; }
.win-btn { width: 34px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.win-btn:hover { background: var(--hover); color: var(--text); }
.win-btn.close:hover { background: var(--bad); color: #fff; }
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.win-body > * { flex: 1; min-height: 0; }
.rz { position: absolute; z-index: 2; touch-action: none; }
.rz-n, .rz-s { left: 8px; right: 8px; height: 6px; cursor: ns-resize; } .rz-n { top: -3px; } .rz-s { bottom: -3px; }
.rz-e, .rz-w { top: 8px; bottom: 8px; width: 6px; cursor: ew-resize; } .rz-e { right: -3px; } .rz-w { left: -3px; }
.rz-ne, .rz-nw, .rz-se, .rz-sw { width: 14px; height: 14px; } .rz-ne { top: -3px; right: -3px; cursor: nesw-resize; } .rz-sw { bottom: -3px; left: -3px; cursor: nesw-resize; }
.rz-nw { top: -3px; left: -3px; cursor: nwse-resize; } .rz-se { bottom: -3px; right: -3px; cursor: nwse-resize; }
.win.maximized .rz { display: none; }

/* ---------- menus, toasts, dialogs ---------- */
.menu { position: fixed; z-index: 9500; min-width: 210px; padding: 5px; border-radius: 11px; background: var(--panel); border: 1px solid var(--border-strong); box-shadow: var(--shadow); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: pop .1s ease-out; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 7px; font-size: 13.5px; text-align: left; }
.menu-item .ic { width: 15px; color: var(--muted); }
.menu-item:hover:not(:disabled) { background: var(--accent); color: #04121f; } .menu-item:hover:not(:disabled) .ic { color: inherit; }
.menu-item.danger { color: var(--bad); } .menu-item.danger .ic { color: var(--bad); }
.menu-item.danger:hover:not(:disabled) { background: var(--bad); color: #fff; } .menu-item.danger:hover .ic { color: #fff; }
.menu-item span:nth-child(2) { flex: 1; }
.menu-hint { font-size: 11.5px; opacity: .55; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 6px; }
#toasts { position: fixed; right: 14px; bottom: calc(var(--bar) + 14px); z-index: 9800; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; gap: 9px; align-items: flex-start; max-width: min(420px, calc(100vw - 28px)); padding: 10px 14px; border-radius: 11px; background: var(--panel); border: 1px solid var(--border-strong); box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 13.5px; animation: pop .16s ease-out; transition: opacity .3s, transform .3s; pointer-events: auto; word-break: break-word; }
.toast .ic { margin-top: 1px; color: var(--accent); } .toast-ok .ic { color: var(--ok); } .toast-warn .ic { color: var(--warn); } .toast-error .ic { color: var(--bad); }
.toast.out { opacity: 0; transform: translateX(20px); }
.modal-layer { position: fixed; inset: 0; z-index: 9200; background: rgba(2, 6, 16, .45); display: grid; place-items: center; padding: 12px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal-title { font-size: 16.5px; font-weight: 650; margin-bottom: 4px; word-break: break-word; }
.modal-body { overflow-y: auto; margin: 0 -4px; padding: 0 4px; } .modal-body p { margin: 8px 0; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- toolbars ---------- */
.toolbar { display: flex; align-items: center; gap: 4px; padding: 7px 8px; border-bottom: 1px solid var(--border); background: var(--panel-solid); flex: none; flex-wrap: wrap; }
.toolbar.slim { padding: 4px 8px; }
.toolbar .input.search { width: 210px; padding: 6px 10px; }
.tbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 8px; border-radius: 8px; color: var(--muted); justify-content: center; font-size: 13px; }
.tbtn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.tbtn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.statusbar { display: flex; gap: 10px; align-items: center; padding: 5px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); background: var(--panel-2); flex: none; min-height: 28px; }

/* ---------- files ---------- */
.files { display: flex; flex-direction: column; }
.files-main { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 190px; flex: none; padding: 8px; border-right: 1px solid var(--border); background: var(--panel-2); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.side-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; text-align: left; color: var(--text); }
.side-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .ic { color: var(--muted); } .side-item:hover { background: var(--hover); }
.side-item.on { background: var(--sel); } .side-item.on .ic { color: var(--accent); }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 12px 10px 4px; font-weight: 650; }
.files-pane { flex: 1; min-width: 0; position: relative; display: flex; }
.files-content { flex: 1; overflow: auto; outline: none; }
.pathbar { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 2px; padding: 0 6px; height: 34px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); overflow-x: auto; white-space: nowrap; scrollbar-width: none; cursor: text; }
.pathbar::-webkit-scrollbar { display: none; }
.crumb { padding: 3px 7px; border-radius: 6px; font-size: 13px; display: inline-flex; align-items: center; } .crumb:hover { background: var(--hover); }
.crumb-sep { color: var(--faint); }
.path-input { width: 100%; background: transparent; border: 0; outline: none; font-family: var(--mono); font-size: 13px; }
.flist { min-width: 520px; }
.fhead { display: flex; position: sticky; top: 0; background: var(--panel-solid); border-bottom: 1px solid var(--border); z-index: 1; }
.fh { padding: 7px 10px; font-size: 12px; color: var(--muted); text-align: left; font-weight: 600; }
.fh:hover { color: var(--text); }
.frow { display: flex; align-items: center; height: 36px; padding: 0 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); cursor: default; user-select: none; }
.frow:hover { background: var(--hover); }
.frow.sel { background: var(--sel); }
.frow.droptarget, .ftile.droptarget { outline: 2px dashed var(--accent); outline-offset: -2px; }
.frow.faded { opacity: .5; }
.c-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-size { width: 100px; padding: 0 10px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; flex: none; }
.c-date { width: 170px; padding: 0 10px; font-size: 13px; flex: none; }
.c-path { width: 34%; padding: 0 10px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.c-act { width: 170px; display: flex; justify-content: flex-end; gap: 4px; padding: 0 8px; flex: none; }
.fi { color: var(--muted); } .fi-dir { color: #fbbf24; } .fi-image { color: #f472b6; } .fi-video { color: #a78bfa; } .fi-audio { color: #34d399; }
.fi-archive { color: #fb923c; } .fi-text { color: #60a5fa; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; padding: 10px; }
.ftile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 8px; border-radius: 10px; user-select: none; border: 1px solid transparent; }
.ftile:hover { background: var(--hover); } .ftile.sel { background: var(--sel); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.ftile .fi svg { width: 44px; height: 44px; stroke-width: 1.4; }
.ftile-name { font-size: 12.5px; text-align: center; word-break: break-word; line-height: 1.25; max-height: 2.5em; overflow: hidden; }
.thumb { width: 64px; height: 50px; object-fit: cover; border-radius: 6px; background: var(--hover); }
.drop-hint { position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--panel-solid)); display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: var(--accent); font-weight: 600; pointer-events: none; z-index: 3; }
.upload-bar { position: relative; height: 28px; background: var(--panel-2); border-top: 1px solid var(--border); font-size: 12px; display: flex; align-items: center; padding: 0 12px; overflow: hidden; flex: none; }
.upload-bar span { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 25%, transparent); transition: width .2s; }
.view-actions { display: flex; justify-content: flex-end; padding: 8px 10px; }
.prop { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.prop > :last-child { text-align: right; }
.prop-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; font-size: 15px; word-break: break-all; }

/* ---------- editor / terminal ---------- */
.editor, .terminal, .viewer, .services, .processes, .links, .backups { display: flex; flex-direction: column; }
.editor-area { flex: 1; min-height: 0; position: relative; }
.ace-host { position: absolute; inset: 0; }
.plain-editor { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; outline: none; resize: none; padding: 12px 14px; background: var(--panel-solid); font-family: var(--mono); tab-size: 2; }
.terminal { background: #0b1220; }
:root[data-theme="light"] .terminal { background: #f8fafc; }
.term-host { flex: 1; min-height: 0; padding: 6px 4px 4px 10px; }
.term-host .xterm { height: 100%; }

/* ---------- monitor ---------- */
.monitor { overflow-y: auto; padding: 12px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.mcard { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-width: 0; }
.mcard.wide { grid-column: 1 / -1; }
.mcard-title { display: flex; align-items: center; gap: 7px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
.big { font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.big.net { font-size: 19px; display: flex; flex-direction: column; line-height: 1.35; }
.chart { width: 100%; height: 64px; display: block; margin-top: 10px; }
.disks { display: grid; gap: 12px; }
.disk-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.info-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13.5px; }
.info-grid > :nth-child(even) { word-break: break-word; }

/* ---------- services / processes ---------- */
.split { flex: 1; display: flex; min-height: 0; }
.svc-list { width: 44%; min-width: 250px; overflow-y: auto; border-right: 1px solid var(--border); padding: 4px; }
.svc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; text-align: left; }
.svc:hover { background: var(--hover); } .svc.on { background: var(--sel); }
.svc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.svc-name b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-detail { flex: 1; min-width: 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.svc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.svc-head h3 { margin: 0; font-size: 16px; word-break: break-all; }
.logs { flex: 1; min-height: 120px; margin: 0; overflow: auto; background: #070c18; color: #cbd5e1; border-radius: 10px; padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border); }
.ptable { flex: 1; overflow: auto; }
.prow { display: flex; align-items: center; min-height: 38px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); font-size: 13px; }
.prow:not(.phead):hover { background: var(--hover); }
.prow.phead { position: sticky; top: 0; background: var(--panel-solid); z-index: 1; min-height: 32px; }
.p-pid { width: 76px; padding: 0 10px; font-variant-numeric: tabular-nums; flex: none; }
.p-name { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 3px 10px; }
.p-user { width: 110px; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; flex: none; }
.p-num { width: 90px; padding: 0 12px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.p-num.hot { color: var(--warn); font-weight: 650; }
.prow .fh { padding: 7px 10px; }

/* ---------- viewer ---------- */
.viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: repeating-conic-gradient(#0d1424 0 25%, #111a2d 0 50%) 0 0 / 22px 22px; overflow: hidden; }
.viewer-stage.scroll { overflow: auto; place-items: start; }
.view-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.view-img.full { max-width: none; max-height: none; cursor: zoom-out; }
.view-media { max-width: 100%; max-height: 100%; background: #000; }
.view-audio { display: flex; flex-direction: column; align-items: center; gap: 14px; color: #e2e8f0; }
.big-ic { font-size: 64px; opacity: .7; }
.view-pdf { width: 100%; height: 100%; border: 0; background: #fff; align-self: stretch; justify-self: stretch; }

/* ---------- links / backups ---------- */
.links-grid { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-content: start; }
.link-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s; }
.link-card:hover { border-color: var(--border-strong); }
.link-main { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.link-text { display: flex; flex-direction: column; min-width: 0; }
.link-foot { display: flex; justify-content: space-between; align-items: center; }
.link-foot .pill { margin: 0; }
.backups-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.bjob { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.bjob-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px; flex-wrap: wrap; }
.bjob-head h3 { margin: 0 0 3px; font-size: 15px; }
.archives { border-top: 1px solid var(--border); }
.archive { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.archive .ellipsis { flex: 1; font-size: 13px; }
.archive:last-child { border-bottom: 0; }

/* ---------- settings ---------- */
.settings { display: flex; }
.settings .sidebar { width: 210px; }
.settings-page { flex: 1; overflow-y: auto; padding: 20px 24px 30px; }
.settings-page h2 { margin: 0 0 14px; font-size: 20px; }
.card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.card > .input, .card > textarea { width: 100%; }
.card p { margin: 0; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); width: 100%; }
.set-label { font-weight: 600; margin: 18px 0 8px; }
.seg { display: inline-flex; background: var(--panel-3); border-radius: 9px; padding: 3px; }
.seg button { padding: 5px 14px; border-radius: 7px; font-size: 13px; } .seg button.on { background: var(--accent); color: #04121f; font-weight: 600; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
.swatch.on { border-color: var(--text); }
.walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.wall { height: 76px; border-radius: 10px; border: 2px solid var(--border); display: flex; align-items: flex-end; padding: 6px 8px; font-size: 11.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); background-size: cover !important; }
.wall.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.wall.upload { flex-direction: column; justify-content: center; align-items: center; gap: 4px; color: var(--muted); text-shadow: none; background: var(--panel-3); border-style: dashed; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.toggle { width: 42px; height: 24px; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--border-strong); position: relative; flex: none; transition: background .15s; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle.on { background: var(--accent); border-color: transparent; } .toggle.on span { transform: translateX(18px); }
.session { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 8px 0; border-bottom: 1px solid var(--border); }
.utable { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.urow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.qr { width: 190px; margin: 6px auto; background: #fff; border-radius: 10px; padding: 6px; } .qr svg { width: 100%; height: auto; display: block; }
.secret { text-align: center; padding: 8px; border-radius: 8px; background: var(--panel-2); cursor: copy; word-break: break-all; margin: 6px 0; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; background: var(--panel-2); border-radius: 10px; text-align: center; }
.about { text-align: center; padding: 30px 10px; } .about h3 { margin: 12px 0 4px; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --bar: 58px; }
  #icons { display: grid; padding: 14px; gap: 6px; align-content: start; grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-rows: 96px; touch-action: auto; }
  .dicon { position: static; width: auto; }
  .win, .win.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border: 0; animation: none; }
  .win-btn[title="Maximize"], .rz { display: none; }
  .win-bar { height: 46px; }
  .task-title { display: none; }
  .task { padding: 0 10px; }
  .tray-chip, .tray-date { display: none; }
  .sidebar { display: none; }
  .settings .sidebar { display: flex; width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .settings { flex-direction: column; }
  .settings-page { padding: 16px; }
  .toolbar .input.search { width: 100%; order: 10; }
  .c-date, .c-path { display: none; }
  .flist { min-width: 0; }
  .split { flex-direction: column; } .svc-list { width: 100%; max-height: 45%; border-right: 0; border-bottom: 1px solid var(--border); }
  .p-user { display: none; }
  .start { left: 6px; right: 6px; width: auto; }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
:root[data-theme="light"] .dicon { color: #0f172a; }
:root[data-theme="light"] .dicon-label { text-shadow: 0 0 6px rgba(255,255,255,.9), 0 0 2px rgba(255,255,255,.9); }
.update-out { width: 100%; display: flex; flex-direction: column; gap: 8px; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card pre.logs { max-height: 260px; width: 100%; }
.storage-box { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.storage-box .bar { margin: 2px 0; }
