/* ==========================================================================
   Web OS - core styles (Windows 11-like)
   ========================================================================== */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Fira Code", Menlo, monospace;
  --accent: #0067c0;
  --accent-2: #4cc2ff;
  --accent-soft: rgba(0, 103, 192, .12);
  --bg: #f3f3f3;
  --surface: #ffffff;
  --surface-2: #f9f9f9;
  --surface-3: #eeeeee;
  --border: #e0e0e0;
  --border-strong: #c8c8c8;
  --text: #1b1b1b;
  --text-2: #5c5c5c;
  --danger: #c42b1c;
  --success: #0f7b0f;
  --radius: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .08);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06);
  --taskbar-h: 48px;
  --acrylic: rgba(243, 243, 243, .82);
  --acrylic-dark: rgba(32, 32, 32, .78);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: #0b1437;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, [contenteditable] { user-select: text; }
[hidden] { display: none !important; }
.ico { flex: none; display: block; }
.gl { flex: none; display: block; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: #0b1437; z-index: 9999; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fatal { position: fixed; inset: 0; margin: 0; padding: 40px; color: #fff; background: #0b1437; white-space: pre-wrap; font: 14px var(--mono); }

/* ---------------------------------------------------------------- buttons, inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 14px; border-radius: 4px;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  transition: background .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #1975c5; }
.btn.danger.primary, .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 26px; padding: 0 10px; font-size: 12px; }

.input {
  width: 100%; height: 32px; padding: 0 10px; border-radius: 4px;
  border: 1px solid var(--border-strong); border-bottom-color: #8a8a8a; background: var(--surface); outline: none;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
select.input { padding: 0 6px; }
.input:focus { border-bottom: 2px solid var(--accent); }

.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; min-width: 30px; padding: 0 7px; border: 0; border-radius: 4px;
  background: transparent; cursor: pointer; color: var(--text); white-space: nowrap;
}
.tbtn:hover { background: rgba(0,0,0,.06); }
.tbtn:active { background: rgba(0,0,0,.1); }
.tbtn:disabled { opacity: .4; cursor: default; background: transparent; }
.tbtn.on { background: var(--accent-soft); color: var(--accent); }
.tsep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex: none; }

/* ---------------------------------------------------------------- desktop */
#os { position: fixed; inset: 0; }
#desktop { position: absolute; inset: 0 0 var(--taskbar-h) 0; outline: none; overflow: hidden; }
.desktop-bg { position: fixed; inset: 0; z-index: 0; transition: background .4s; }
.desktop-icons { position: absolute; inset: 0; z-index: 1; }
.dicon {
  position: absolute; width: 84px; padding: 6px 4px 4px; border-radius: 4px;
  transition: background .1s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff; text-align: center; border: 1px solid transparent; cursor: default;
}
.dicon span {
  font-size: 12px; line-height: 1.25; text-shadow: 0 1px 3px rgba(0,0,0,.8), 0 0 2px rgba(0,0,0,.6);
  word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dicon.sel span { -webkit-line-clamp: 6; }
.dicon:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); }
.dicon.sel { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.35); }
.dicon.drop-target { background: rgba(76,194,255,.35); border-color: var(--accent-2); }
.dicon .ico { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.is-cut { opacity: .5; }

.band { position: absolute; display: none; border: 1px solid var(--accent); background: rgba(0,103,192,.15); pointer-events: none; z-index: 5; }
.band.fixed { position: fixed; z-index: 2; border-color: rgba(255,255,255,.8); background: rgba(76,194,255,.2); }

#window-layer { position: absolute; inset: 0 0 var(--taskbar-h) 0; pointer-events: none; z-index: 2; }
#snap-preview { display: none; position: absolute; z-index: 99999; border-radius: 8px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.5); backdrop-filter: blur(6px); pointer-events: none; transition: all .12s; }

/* ---------------------------------------------------------------- windows */
.window {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  min-width: 240px; min-height: 120px;
  transition: opacity .15s, transform .15s;
}
.window.opening { opacity: 0; transform: scale(.96); }
.window.closing { opacity: 0; transform: scale(.96); }
.window.minimized { opacity: 0; transform: translateY(60px) scale(.8); pointer-events: none; visibility: hidden; transition: opacity .15s, transform .15s, visibility 0s .15s; }
.window.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.window:not(.active) { box-shadow: 0 4px 18px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.1); }
.titlebar {
  flex: none; height: 34px; display: flex; align-items: center; gap: 8px; padding-left: 10px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); touch-action: none;
}
.window:not(.active) .titlebar { color: #8a8a8a; }
.wtitle { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.wbtns { display: flex; height: 100%; }
.wbtn { width: 46px; height: 100%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: inherit; }
.wbtn:hover { background: rgba(0,0,0,.07); }
.wbtn:disabled { opacity: .3; cursor: default; background: transparent; }
.wclose:hover { background: #c42b1c; color: #fff; }
.wbody { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
body.wm-dragging .wbody, body.wm-dragging iframe { pointer-events: none; }
body.wm-dragging { cursor: default; }
.window.dirty .wtitle::before { content: "● "; color: var(--accent); }

.rz { position: absolute; z-index: 10; }
.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: 12px; height: 12px; }
.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; }
.window.maximized .rz { display: none; }

/* shared app chrome */
.toolbar { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.menubar { flex: none; display: flex; gap: 2px; padding: 2px 4px; background: var(--surface); border-bottom: 1px solid var(--border); }
.menubar .mb { padding: 4px 10px; border-radius: 4px; cursor: pointer; border: 0; background: none; }
.menubar .mb:hover, .menubar .mb.open { background: rgba(0,0,0,.06); }
.statusbar { flex: none; display: flex; gap: 16px; align-items: center; height: 26px; padding: 0 10px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; overflow: hidden; }
.statusbar .spacer { flex: 1; }
.empty-state { flex: 1; display: grid; place-items: center; color: var(--text-2); text-align: center; padding: 20px; }

/* ---------------------------------------------------------------- taskbar */
#taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--taskbar-h); z-index: 50000;
  display: flex; align-items: center; gap: 2px; padding: 0 6px;
  background: var(--acrylic); backdrop-filter: blur(30px) saturate(1.6); border-top: 1px solid rgba(0,0,0,.1);
}
#taskbar button { border: 0; background: transparent; cursor: pointer; border-radius: 5px; color: var(--text); }
#taskbar button:hover { background: rgba(255,255,255,.65); }
.tb-start, .tb-app { width: 40px; height: 40px; display: grid; place-items: center; }
.tb-start:hover .ico { transform: scale(1.06); }
.tb-pinned { display: flex; gap: 2px; }
.tb-sep { width: 1px; height: 26px; background: rgba(0,0,0,.15); margin: 0 6px; }
.tb-tasks { flex: 1; display: flex; gap: 3px; min-width: 0; overflow: hidden; }
.tb-task {
  position: relative; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px;
  max-width: 190px; min-width: 44px; flex: 0 1 190px;
}
.tb-task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.tb-task::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px; background: #8a8a8a; transition: width .15s, margin .15s; }
.tb-task.active { background: rgba(255,255,255,.7) !important; }
.tb-task.active::after { width: 18px; margin-left: -9px; background: var(--accent); }
.tb-tray { display: flex; align-items: center; height: 100%; }
.tb-clock { display: flex !important; flex-direction: column; align-items: flex-end; justify-content: center; height: 40px; padding: 0 10px; font-size: 12px; line-height: 1.35; }

/* ---------------------------------------------------------------- start menu */
.start-menu {
  position: fixed; left: 8px; bottom: calc(var(--taskbar-h) + 8px); width: 560px; max-width: calc(100vw - 16px);
  height: 600px; max-height: calc(100vh - var(--taskbar-h) - 20px); z-index: 60000;
  display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
  background: rgba(243,243,243,.9); backdrop-filter: blur(40px) saturate(1.8); box-shadow: var(--shadow);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s;
}
.start-menu.open { transform: none; opacity: 1; pointer-events: auto; }
.sm-search { margin: 22px 26px 10px; height: 36px; border-radius: 18px; border: 1px solid var(--border); border-bottom: 2px solid var(--accent); padding: 0 16px; outline: none; background: #fff; }
.sm-section { padding: 8px 32px; font-weight: 600; }
.sm-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); align-content: start; gap: 4px; padding: 6px 24px; overflow: auto; }
.sm-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; }
.sm-app:hover { background: rgba(255,255,255,.75); }
.sm-app span { font-size: 12px; text-align: center; line-height: 1.2; }
.sm-results { flex: 1; overflow: auto; padding: 4px 20px; }
.sm-result { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.sm-result .ico { grid-row: span 2; }
.sm-result small { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-result:hover { background: rgba(255,255,255,.75); }
.sm-noresult { padding: 20px; text-align: center; color: var(--text-2); }
.sm-footer { flex: none; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 30px; background: rgba(0,0,0,.035); border-top: 1px solid rgba(0,0,0,.06); }
.sm-user { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.sm-user:hover, .sm-power:hover { background: rgba(255,255,255,.75); }
.sm-power { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text); }

.calendar-pop {
  position: fixed; right: 8px; bottom: calc(var(--taskbar-h) + 8px); width: 320px; z-index: 60000; padding: 16px;
  border-radius: 10px; background: rgba(243,243,243,.92); backdrop-filter: blur(40px); box-shadow: var(--shadow);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s;
}
.calendar-pop.open { transform: none; opacity: 1; pointer-events: auto; }
.cal-time { font-size: 32px; font-weight: 300; }
.cal-date { color: var(--accent); margin-bottom: 12px; text-transform: capitalize; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow { font-size: 11px; color: var(--text-2); padding: 4px 0; }
.cal-day { padding: 7px 0; border-radius: 50%; }
.cal-day.today { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- context menu */
.ctx-menu {
  position: fixed; z-index: 70000; min-width: 220px; padding: 4px; border-radius: 8px;
  background: rgba(249,249,249,.97); backdrop-filter: blur(30px); box-shadow: var(--shadow-sm);
}
.ctx-menu.sub { position: absolute; display: none; }
.ctx-item { position: relative; display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; border-radius: 4px; cursor: default; white-space: nowrap; }
.ctx-item:hover { background: rgba(0,0,0,.06); }
.ctx-item.disabled { opacity: .4; pointer-events: none; }
.ctx-item.danger { color: var(--danger); }
.ctx-icon { width: 16px; display: grid; place-items: center; color: var(--text-2); }
.ctx-label { flex: 1; }
.ctx-short { color: var(--text-2); font-size: 11px; margin-left: 20px; }
.ctx-arrow { color: var(--text-2); }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.ctx-sep:first-child, .ctx-sep + .ctx-sep, .ctx-sep:last-child { display: none; }

/* ---------------------------------------------------------------- dialogs */
#modal-layer { position: fixed; z-index: 80000; }
.dlg-backdrop { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.28); animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.dlg { max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); display: flex; flex-direction: column; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; animation: pop .14s; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.dlg-title { padding: 18px 22px 6px; font-size: 18px; font-weight: 600; }
.dlg-body { padding: 8px 22px 18px; overflow: auto; }
.dlg-msg { line-height: 1.5; white-space: pre-wrap; user-select: text; }
.dlg-hint { margin: 0 0 12px; color: var(--text-2); line-height: 1.45; }
.dlg-error { color: var(--danger); min-height: 18px; margin-top: 6px; }
.dlg-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; background: var(--surface-2); border-top: 1px solid var(--border); }
.dlg-footer .btn { min-width: 100px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { color: var(--text-2); font-size: 12px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check > span { color: var(--text); font-size: 13px; }
.field.inline { flex-direction: row; align-items: center; margin: 10px 0 0; }
.field.inline > span { flex: none; }

.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-bar { display: flex; gap: 4px; align-items: center; }
.picker-main { display: flex; height: 320px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.picker-side { width: 160px; flex: none; padding: 6px; background: var(--surface-2); border-right: 1px solid var(--border); overflow: auto; }
.picker-place { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.picker-place:hover { background: rgba(0,0,0,.05); }
.picker-list { flex: 1; overflow: auto; outline: none; }
.picker-item { display: grid; grid-template-columns: 22px 1fr 80px 130px; align-items: center; gap: 6px; padding: 4px 10px; cursor: default; }
.picker-item:hover { background: rgba(0,0,0,.04); }
.picker-item.sel { background: var(--accent-soft); }
.picker-item .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item .s, .picker-item .d { color: var(--text-2); font-size: 12px; text-align: right; }
.picker-empty { padding: 30px; text-align: center; color: var(--text-2); }

.props-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.props-head b { word-break: break-all; }
.props-table { width: 100%; border-collapse: collapse; }
.props-table th { text-align: left; color: var(--text-2); font-weight: normal; padding: 5px 12px 5px 0; vertical-align: top; white-space: nowrap; }
.props-table td { padding: 5px 0; word-break: break-all; user-select: text; }

/* ---------------------------------------------------------------- toasts */
#toast-area { position: fixed; right: 14px; bottom: calc(var(--taskbar-h) + 14px); z-index: 90000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 8px; background: rgba(249,249,249,.97);
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--accent); transform: translateX(30px); opacity: 0; transition: all .25s;
  pointer-events: auto; line-height: 1.4; word-break: break-word;
}
.toast.show { transform: none; opacity: 1; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.ptext { margin-bottom: 8px; }
.pbar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.pbar-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.pbar-fill.indet { width: 40%; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { from { margin-left: -40%; } to { margin-left: 100%; } }

/* ---------------------------------------------------------------- file view */
.fileview { position: relative; flex: 1; overflow: auto; outline: none; background: var(--surface); }
.fileview.drop-hover { box-shadow: inset 0 0 0 2px var(--accent); }
.fv-inner { min-height: 100%; }
.fv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); align-content: start; gap: 2px; padding: 8px; }
.fv-grid .fv-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border: 1px solid transparent; border-radius: 4px; text-align: center; }
.fv-name { font-size: 12px; line-height: 1.25; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fv-item:hover { background: rgba(0,103,192,.06); }
.fv-item.sel { background: rgba(0,103,192,.14); border-color: rgba(0,103,192,.25); }
.fv-item.drop-target { background: rgba(0,103,192,.22); border-color: var(--accent); }
.fv-list .fv-head, .fv-list .fv-item { display: grid; grid-template-columns: minmax(180px, 1fr) 140px 120px 90px; align-items: center; }
.fv-list .fv-head { position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--border); height: 30px; color: var(--text-2); font-size: 12px; }
.fv-list .fv-head .fv-col { padding: 0 10px; cursor: pointer; border-right: 1px solid var(--border); }
.fv-list .fv-head .fv-col:hover { background: var(--surface-2); }
.fv-list .fv-item { height: 28px; border: 1px solid transparent; }
.fv-list .fv-col { padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-list .c-name { display: flex; align-items: center; gap: 8px; }
.fv-list .c-name span { overflow: hidden; text-overflow: ellipsis; }
.fv-list .c-mtime, .fv-list .c-type, .fv-list .c-size { color: var(--text-2); font-size: 12px; }
.fv-list .c-size { text-align: right; }
.fv-empty { padding: 40px; text-align: center; color: var(--text-2); grid-column: 1 / -1; }

/* ---------------------------------------------------------------- login / lock screen */
#login { position: fixed; inset: 0; z-index: 95000; color: #fff; overflow: hidden; }
.login-bg { position: absolute; inset: -20px; transition: filter .35s, transform .35s; }
#login.revealed .login-bg { filter: blur(18px) brightness(.8); transform: scale(1.05); }
.ls-clock { position: absolute; left: 0; right: 0; top: 14vh; text-align: center; transition: transform .35s, opacity .35s; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.ls-time { font-size: clamp(64px, 11vw, 120px); font-weight: 600; letter-spacing: -2px; }
.ls-date { font-size: 24px; text-transform: capitalize; }
.ls-hint { margin-top: 40vh; opacity: .8; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
#login.revealed .ls-clock { transform: translateY(-60px); opacity: 0; pointer-events: none; }
.ls-panel { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .35s; overflow: auto; padding: 20px; }
#login.revealed .ls-panel { opacity: 1; pointer-events: auto; }
#login.leaving { opacity: 0; transition: opacity .35s; }
.ls-form { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 320px; }
.ls-form.wide { width: 440px; max-width: 100%; text-align: center; }
.ls-form h2 { margin: 0; font-weight: 600; }
.ls-form p { margin: 0; opacity: .9; line-height: 1.5; }
.ls-avatar .ico { border-radius: 50%; box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.ls-name { font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.ls-row { display: flex; width: 100%; gap: 0; }
.ls-input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid rgba(255,255,255,.35); border-bottom: 2px solid rgba(255,255,255,.7);
  border-radius: 4px; background: rgba(255,255,255,.18); color: #fff; outline: none; backdrop-filter: blur(10px);
}
.ls-input::placeholder { color: rgba(255,255,255,.7); }
.ls-input:focus { background: rgba(255,255,255,.28); border-bottom-color: #fff; }
.ls-row .ls-input { border-radius: 4px 0 0 4px; }
.ls-code { font-size: 22px; letter-spacing: 10px; text-align: center; font-family: var(--mono); }
.ls-go { width: 42px; flex: none; border: 1px solid rgba(255,255,255,.35); border-left: 0; border-radius: 0 4px 4px 0; background: rgba(255,255,255,.25); color: #fff; font-size: 20px; cursor: pointer; }
.ls-go:hover { background: rgba(255,255,255,.4); }
.ls-go:disabled { opacity: .5; }
.ls-error { min-height: 20px; color: #ffd1d1; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.ls-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.ls-link { color: #fff; opacity: .85; }
.ls-intro { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ls-setup { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ls-qr { width: 200px; height: 200px; padding: 8px; border-radius: 8px; background: #fff; color: #333; display: grid; place-items: center; }
.ls-qr svg { width: 100%; height: 100%; }
.ls-secret { display: flex; flex-direction: column; gap: 4px; }
.ls-secret code { font-family: var(--mono); font-size: 15px; letter-spacing: 1px; user-select: all; background: rgba(0,0,0,.3); padding: 6px 10px; border-radius: 4px; }
.ls-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin: 8px 0; }
.ls-codes code { font: 16px var(--mono); padding: 8px; background: rgba(0,0,0,.35); border-radius: 4px; user-select: all; }
.ls-shield .ico { filter: invert(1) drop-shadow(0 2px 6px rgba(0,0,0,.3)); }

/* scrollbars */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.25); border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(0,0,0,.4); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 700px) {
  .tb-task span { display: none; }
  .tb-task { flex: 0 0 44px; justify-content: center; }
  .tb-pinned { display: none; }
}
:root[data-icons="small"] .dicon { width: 70px; }
:root[data-icons="small"] .dicon span { font-size: 11px; }
:root[data-icons="large"] .dicon { width: 104px; }
.btn.primary:hover { background: var(--accent-hover, #1975c5); }
:root[data-taskbar="center"] #taskbar { justify-content: center; }
:root[data-taskbar="center"] .tb-tasks { flex: 0 1 auto; }
:root[data-taskbar="center"] .tb-tray { position: absolute; right: 6px; }
:root[data-taskbar="center"] .start-menu { left: 50%; margin-left: -280px; }
@media (max-width: 600px) { :root[data-taskbar="center"] .start-menu { left: 8px; margin-left: 0; } }
:root[data-transparency="off"] { --acrylic: var(--bg); --acrylic-dark: #202020; }
:root[data-transparency="off"] #taskbar, :root[data-transparency="off"] .start-menu, :root[data-transparency="off"] .calendar-pop, :root[data-transparency="off"] .ctx-menu { backdrop-filter: none; }
:root[data-transparency="off"] .start-menu, :root[data-transparency="off"] .calendar-pop { background: var(--surface-2); }

/* ==========================================================================
   Dark theme
   ========================================================================== */
:root[data-theme="dark"] {
  --bg: #202020;
  --surface: #2b2b2b;
  --surface-2: #272727;
  --surface-3: #383838;
  --border: #3d3d3d;
  --border-strong: #4a4a4a;
  --text: #f3f3f3;
  --text-2: #a8a8a8;
  --danger: #ff6b5b;
  --success: #6ccb5f;
  --acrylic: rgba(32, 32, 32, .8);
  --shadow: 0 8px 32px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .07);
  color-scheme: dark;
}
:root[data-theme="dark"] .input { background: #1f1f1f; border-bottom-color: #7a7a7a; }
:root[data-theme="dark"] .tbtn:hover, :root[data-theme="dark"] .menubar .mb:hover, :root[data-theme="dark"] .menubar .mb.open, :root[data-theme="dark"] .wbtn:hover { background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .wclose:hover { background: #c42b1c; }
:root[data-theme="dark"] #taskbar { border-top-color: rgba(255,255,255,.08); }
:root[data-theme="dark"] #taskbar button:hover { background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .tb-task.active { background: rgba(255,255,255,.1) !important; }
:root[data-theme="dark"] .tb-sep { background: rgba(255,255,255,.15); }
:root[data-theme="dark"] .start-menu, :root[data-theme="dark"] .calendar-pop { background: rgba(36,36,36,.92); }
:root[data-theme="dark"] .sm-search { background: #1f1f1f; border-color: #3d3d3d; }
:root[data-theme="dark"] .sm-app:hover, :root[data-theme="dark"] .sm-result:hover, :root[data-theme="dark"] .sm-user:hover, :root[data-theme="dark"] .sm-power:hover { background: rgba(255,255,255,.07); }
:root[data-theme="dark"] .sm-footer { background: rgba(0,0,0,.2); border-top-color: rgba(255,255,255,.06); }
:root[data-theme="dark"] .ctx-menu { background: rgba(44,44,44,.97); }
:root[data-theme="dark"] .ctx-item:hover { background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .toast { background: rgba(44,44,44,.97); }
:root[data-theme="dark"] .fv-item:hover { background: rgba(255,255,255,.05); }
:root[data-theme="dark"] .picker-place:hover, :root[data-theme="dark"] .picker-item:hover { background: rgba(255,255,255,.05); }
:root[data-theme="dark"] .dlg-backdrop { background: rgba(0,0,0,.45); }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.22); }

/* windows that are always dark (photos, media, terminal, photo editor) */
.dark-window { --surface: #202020; --surface-2: #2b2b2b; --surface-3: #383838; --border: #3a3a3a; --border-strong: #4a4a4a; --text: #eee; --text-2: #aaa; color: var(--text); }
.dark-window .titlebar { background: #2b2b2b; color: #eee; }
.dark-window:not(.active) .titlebar { color: #999; }
.dark-window .tbtn, .dark-window .wbtn { color: #eee; }
.dark-window .tbtn:hover, .dark-window .wbtn:hover, .dark-window .menubar .mb:hover { background: rgba(255,255,255,.08); }
.dark-window .wclose:hover { background: #c42b1c; }
.dark-window .input { background: #1a1a1a; color: #eee; border-color: #444; }
.dark-window .btn { background: #333; border-color: #4a4a4a; color: #eee; }

/* ==========================================================================
   Apps
   ========================================================================== */

/* ---- explorer */
.ex-nav { gap: 4px; flex-wrap: nowrap; }
.ex-address-wrap { flex: 1; min-width: 0; position: relative; }
.ex-address { display: flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; cursor: text; background: var(--surface); }
.ex-address-input { width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 4px; outline: none; background: var(--surface); }
.ex-crumb { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
.ex-crumb:hover { background: rgba(127,127,127,.15); }
.ex-chev { color: var(--text-2); display: inline-flex; }
.ex-search { width: 200px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; outline: none; background: var(--surface); }
.ex-search:focus { border-color: var(--accent); }
.ex-actions { gap: 2px; }
.ex-actions .tbtn span { font-size: 12px; }
.ex-main { flex: 1; min-height: 0; display: flex; }
.ex-side { width: 190px; flex: none; padding: 8px 6px; border-right: 1px solid var(--border); overflow: auto; background: var(--surface); }
.ex-place { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.ex-place:hover { background: rgba(127,127,127,.1); }
.ex-place.active { background: var(--accent-soft); }
.ex-place.drop-target { background: var(--accent-soft); outline: 1px solid var(--accent); }
@media (max-width: 760px) { .ex-side { display: none; } .ex-actions .tbtn span { display: none; } .ex-search { width: 120px; } }

/* ---- notepad */
.np-text { flex: 1; width: 100%; border: 0; outline: none; resize: none; padding: 8px 10px; font: 14px/1.5 var(--mono); background: var(--surface); color: var(--text); tab-size: 4; }

/* ---- code editor */
.ce-body { background: #1e1e1e; }
.ce-menubar { background: #2d2d2d; border-color: #252526; }
.ce-menubar .mb { color: #ccc; }
.ce-menubar .mb:hover { background: rgba(255,255,255,.1); }
.ce-wrap { flex: 1; min-height: 0; display: flex; }
.ce-side { width: 240px; flex: none; display: flex; flex-direction: column; background: #252526; color: #ccc; border-right: 1px solid #1e1e1e; }
.ce-side.hidden { display: none; }
.ce-tree-head { display: flex; align-items: center; gap: 2px; padding: 6px 4px 6px 12px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.ce-tree-head .tbtn { color: #ccc; height: 24px; min-width: 24px; padding: 0 4px; }
.ce-tree-head .tbtn:hover { background: rgba(255,255,255,.1); }
.ce-root { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-tree { flex: 1; overflow: auto; padding-bottom: 20px; }
.ce-node { display: flex; align-items: center; gap: 5px; height: 22px; padding-right: 8px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.ce-node span:last-child { overflow: hidden; text-overflow: ellipsis; }
.ce-node:hover { background: #2a2d2e; }
.ce-node.active { background: #37373d; }
.ce-caret { width: 10px; flex: none; font-size: 10px; color: #aaa; }
.ce-err { padding: 8px 14px; color: #888; font-size: 12px; }
.ce-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.ce-tabs { flex: none; display: flex; overflow-x: auto; background: #252526; min-height: 35px; }
.ce-tabs::-webkit-scrollbar { height: 3px; }
.ce-tab { display: flex; align-items: center; gap: 6px; height: 35px; padding: 0 8px 0 12px; background: #2d2d2d; color: #969696; border-right: 1px solid #252526; cursor: pointer; white-space: nowrap; font-size: 13px; }
.ce-tab.active { background: #1e1e1e; color: #fff; box-shadow: inset 0 1px 0 var(--accent); }
.ce-tab-close { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; }
.ce-tab-close:hover { background: rgba(255,255,255,.12); }
.ce-editor { flex: 1; min-height: 0; }
.ce-welcome { position: absolute; inset: 35px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #aaa; text-align: center; padding: 20px; background: #1e1e1e; }
.ce-welcome h2 { color: #ddd; font-weight: 400; margin: 14px 0 4px; }
.ce-welcome .hint { color: #777; font-size: 12px; }
.ce-status { background: var(--accent); color: #fff; border: 0; }

/* ---- photos */
.iv-toolbar { background: #2b2b2b; border-color: #333; flex-wrap: nowrap; overflow: hidden; }
.iv-zoom, .iv-info { font-size: 12px; color: #bbb; white-space: nowrap; }
.iv-zoom { min-width: 44px; text-align: center; }
.iv-wrap { flex: 1; min-height: 0; position: relative; background: #1a1a1a; }
.iv-stage { position: absolute; inset: 0; overflow: hidden; }
.iv-stage.pannable { cursor: grab; }
.iv-stage.pannable:active { cursor: grabbing; }
.iv-img { position: absolute; left: 50%; top: 50%; transform-origin: center; max-width: none; background: repeating-conic-gradient(#3a3a3a 0% 25%, #2a2a2a 0% 50%) 0 0 / 20px 20px; image-rendering: auto; }
.iv-nav { position: absolute; top: 50%; margin-top: -32px; width: 44px; height: 64px; border: 0; border-radius: 6px; background: rgba(0,0,0,.4); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.iv-wrap:hover .iv-nav { opacity: 1; }
.iv-nav.prev { left: 10px; } .iv-nav.next { right: 10px; }
.iv-nav:hover { background: rgba(0,0,0,.65); }
.dark-window .empty-state { color: #999; }

/* ---- media */
.mp-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: #000; }
.mp-video { width: 100%; height: 100%; background: #000; }
.mp-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.mp-audio { display: flex; flex-direction: column; align-items: center; gap: 18px; color: #eee; }
.mp-audio audio { width: min(480px, 80vw); }
.mp-name { font-size: 16px; }

/* ---- calculator */
.calc { background: var(--surface-2); padding: 6px; gap: 4px; display: grid !important; grid-template-rows: auto auto auto 1fr; grid-template-columns: 1fr; outline: none; }
.calc.show-history { grid-template-columns: 1fr 180px; }
.calc-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; grid-column: 1; }
.calc-top b { font-size: 18px; font-weight: 600; }
.calc-screen { padding: 4px 10px; text-align: right; grid-column: 1; min-width: 0; }
.calc-expr { min-height: 18px; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-display { font-size: 44px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: text; line-height: 1.2; }
.calc-mem { min-height: 14px; font-size: 11px; color: var(--text-2); }
.calc-memrow { display: flex; gap: 2px; grid-column: 1; }
.calc-mbtn { flex: 1; height: 28px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; font-size: 12px; }
.calc-mbtn:hover { background: rgba(127,127,127,.15); }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 3px; grid-column: 1; min-height: 0; }
.calc-btn { border: 1px solid var(--border); border-radius: 5px; font-size: 16px; cursor: pointer; background: var(--surface); transition: background .08s; }
.calc-btn.num { font-weight: 600; background: var(--surface); }
.calc-btn.fn { background: var(--surface-2); }
.calc-btn.eq { background: var(--accent); color: #fff; border-color: var(--accent); font-size: 20px; }
.calc-btn:hover { filter: brightness(.95); }
:root[data-theme="dark"] .calc-btn:hover { filter: brightness(1.2); }
.calc-btn:active, .calc-btn.pressed { filter: brightness(.85); }
.calc-history { display: none; grid-column: 2; grid-row: 1 / -1; overflow: auto; border-left: 1px solid var(--border); padding: 6px; }
.calc.show-history .calc-history { display: block; }
.calc-hrow { padding: 6px; text-align: right; border-radius: 4px; cursor: pointer; }
.calc-hrow:hover { background: rgba(127,127,127,.12); }
.calc-hrow small { display: block; color: var(--text-2); }
.calc-hrow b { font-size: 18px; }

/* ---- terminal */
.term-window .wbody { background: #0c0c0c; }
.term-toolbar { background: #1f1f1f; border-color: #2a2a2a; }
.term-toolbar .tbtn span { font-size: 12px; }
.term-host { flex: 1; min-height: 0; padding: 4px 0 0 6px; background: #0c0c0c; }
.term-host .xterm { height: 100%; }
.input.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* ---- ftp */
.ftp-connect { flex: none; display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }
.ftp-connect .input { width: auto; flex: 1 1 110px; min-width: 80px; }
.ftp-connect select.input { flex: 0 0 82px; }
.ftp-connect .ftp-port { flex: 0 0 72px; }
.ftp-key { display: flex; flex: 1 1 180px; gap: 2px; }
.ftp-panes { flex: 1; min-height: 0; display: flex; }
.ftp-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ftp-pane-head { padding: 6px 10px 2px; }
.ftp-pathbar { padding: 4px 8px; }
.ftp-list { flex: 1; overflow: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); outline: none; }
.ftp-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 80px 128px; gap: 6px; align-items: center; height: 26px; padding: 0 8px; cursor: default; }
.ftp-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftp-row .s, .ftp-row .d { font-size: 12px; color: var(--text-2); text-align: right; white-space: nowrap; }
.ftp-row:hover { background: rgba(127,127,127,.08); }
.ftp-row.sel { background: var(--accent-soft); }
.ftp-empty { padding: 30px; text-align: center; color: var(--text-2); }
.ftp-pane-info { padding: 4px 10px; font-size: 12px; color: var(--text-2); }
.ftp-mid { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 6px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.ftp-xfer { flex-direction: column; height: auto; padding: 8px 6px; font-size: 11px; }
.ftp-log { flex: none; height: 96px; overflow: auto; padding: 4px 10px; font: 12px var(--mono); background: var(--surface-2); border-top: 1px solid var(--border); user-select: text; }
.ftp-log-row.ok { color: var(--success); }
.ftp-log-row.err { color: var(--danger); }
@media (max-width: 760px) { .ftp-row { grid-template-columns: 20px minmax(0, 1fr) 70px; } .ftp-row .d { display: none; } }

/* ---- archiver */
.ar-crumbs { flex: none; display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.ar-list { flex: 1; overflow: auto; }
.ar-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 100px 140px; gap: 8px; align-items: center; height: 28px; padding: 0 12px; }
.ar-row .n { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-row span:not(.n) { font-size: 12px; color: var(--text-2); text-align: right; white-space: nowrap; }
.ar-row:not(.ar-head):hover { background: rgba(127,127,127,.08); }
.ar-head { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.ar-head span { text-align: left !important; }

/* ---- photo editor */
.pe-options { background: #2b2b2b; border-color: #383838; gap: 6px; flex-wrap: wrap; }
.pe-opt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #ccc; white-space: nowrap; }
.pe-opt input[type=range] { width: 90px; }
.pe-opt.opt-fill, .pe-opt.opt-text, .pe-opt.opt-tol { display: none; }
.pe-options.show-fill .opt-fill, .pe-options.show-text .opt-text, .pe-options.show-tol .opt-tol { display: flex; }
.pe-opt select.input { width: 110px; height: 26px; }
.pe-num { width: 64px !important; height: 26px !important; }
.pe-val { min-width: 38px; font-size: 12px; color: #bbb; text-align: center; }
.pe-colors { display: flex; align-items: center; gap: 4px; }
.pe-colors input[type=color], .st-accents input[type=color] { width: 30px; height: 30px; padding: 0; border: 1px solid #555; border-radius: 4px; background: none; cursor: pointer; }
.pe-main { flex: 1; min-height: 0; display: flex; background: #1e1e1e; }
.pe-tools { flex: none; width: 44px; display: flex; flex-direction: column; gap: 2px; padding: 4px; background: #2b2b2b; border-right: 1px solid #383838; overflow: auto; }
.pe-tool { width: 36px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #ddd; cursor: pointer; }
.pe-tool:hover { background: rgba(255,255,255,.08); }
.pe-tool.on { background: var(--accent); color: #fff; }
.pe-viewport { flex: 1; min-width: 0; overflow: auto; position: relative; outline: none; display: grid; place-items: center; padding: 20px; }
.pe-viewport[data-tool="brush"], .pe-viewport[data-tool="eraser"], .pe-viewport[data-tool="line"], .pe-viewport[data-tool="rect"], .pe-viewport[data-tool="ellipse"], .pe-viewport[data-tool="select"], .pe-viewport[data-tool="gradient"], .pe-viewport[data-tool="picker"], .pe-viewport[data-tool="fill"] { cursor: crosshair; }
.pe-viewport[data-tool="text"] { cursor: text; }
.pe-viewport[data-tool="hand"] { cursor: grab; }
.pe-viewport[data-tool="move"] { cursor: move; }
.pe-stage { position: relative; flex: none; box-shadow: 0 0 0 1px #000, 0 4px 20px rgba(0,0,0,.5); background: repeating-conic-gradient(#cfcfcf 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; }
.pe-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pe-stage.pixelated canvas { image-rendering: pixelated; }
.pe-overlay { pointer-events: none; }
.pe-panel { flex: none; width: 230px; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #2b2b2b; border-left: 1px solid #383838; color: #ddd; }
.pe-panel-title { font-weight: 600; }
.pe-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pe-row select, .pe-row input { flex: 1; min-width: 0; }
.pe-row select.input { height: 26px; }
.pe-layers { flex: 1; overflow: auto; border: 1px solid #3a3a3a; border-radius: 4px; background: #232323; }
.pe-layer { display: flex; align-items: center; gap: 6px; padding: 4px; border-bottom: 1px solid #333; cursor: pointer; }
.pe-layer.active { background: rgba(0,103,192,.35); }
.pe-layer canvas { flex: none; border: 1px solid #555; background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 0 / 8px 8px; }
.pe-lname { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-eye { height: 24px; min-width: 24px; padding: 0; }
.pe-layer-btns { display: flex; justify-content: space-between; }
.pe-slider { display: flex; align-items: center; gap: 8px; }
.pe-slider input { flex: 1; }
@media (max-width: 800px) { .pe-panel { width: 160px; } }

/* ---- settings */
.st-wrap { flex: 1; min-height: 0; display: flex; background: var(--surface-2); }
.st-nav { width: 250px; flex: none; padding: 12px 8px; overflow: auto; }
.st-user { display: flex; align-items: center; gap: 12px; padding: 8px 10px 18px; }
.st-user b { display: block; font-size: 15px; }
.st-user small { color: var(--text-2); }
.st-nav-item { width: 100%; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; cursor: pointer; text-align: left; position: relative; }
.st-nav-item:hover { background: rgba(127,127,127,.1); }
.st-nav-item.active { background: rgba(127,127,127,.15); }
.st-nav-item.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent); }
.st-content { flex: 1; min-width: 0; overflow: auto; padding: 8px 28px 30px; }
.st-content h2 { font-size: 26px; font-weight: 600; margin: 10px 0 16px; }
.st-section { margin-bottom: 22px; }
.st-section h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.st-hint { color: var(--text-2); margin: 0 0 10px; line-height: 1.5; user-select: text; }
.st-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 16px; margin-bottom: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.st-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-card-text small { color: var(--text-2); line-height: 1.4; }
.st-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.st-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 5px; overflow: hidden; flex: none; }
.st-seg button { border: 0; padding: 6px 14px; background: var(--surface); cursor: pointer; border-right: 1px solid var(--border); }
.st-seg button:last-child { border-right: 0; }
.st-seg button.on { background: var(--accent); color: #fff; }
.st-toggle { position: relative; width: 42px; height: 22px; flex: none; }
.st-toggle input { opacity: 0; width: 0; height: 0; }
.st-toggle span { position: absolute; inset: 0; border-radius: 11px; border: 1px solid var(--text-2); cursor: pointer; transition: background .15s; }
.st-toggle span::after { content: ""; position: absolute; left: 4px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-2); transition: transform .15s; }
.st-toggle input:checked + span { background: var(--accent); border-color: var(--accent); }
.st-toggle input:checked + span::after { transform: translateX(20px); background: #fff; }
.st-preview { position: relative; width: 300px; height: 180px; border-radius: 8px; margin-bottom: 20px; box-shadow: var(--shadow-sm); overflow: hidden; }
.st-preview-taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--acrylic); }
.st-preview-win { position: absolute; left: 70px; top: 40px; width: 140px; height: 90px; border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.st-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 10px; }
.st-preset { position: relative; height: 70px; border: 2px solid transparent; border-radius: 6px; cursor: pointer; overflow: hidden; }
.st-preset span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 11px; color: #fff; background: rgba(0,0,0,.35); text-align: left; }
.st-preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.st-accents { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 360px; }
.st-accent { width: 30px; height: 30px; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
.st-accent.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }
.st-badge { padding: 3px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.st-badge.ok { background: rgba(15,123,15,.15); color: var(--success); }
.st-badge.warn { background: rgba(196,43,28,.12); color: var(--danger); }
.st-sessions { margin-top: 12px; }
.st-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-codes code { padding: 6px 8px; font: 14px var(--mono); background: var(--surface-2); border-radius: 4px; user-select: all; }
.st-usage { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.st-usage-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.st-usage-bar div { height: 100%; background: var(--accent); }
.st-about { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.st-about h3 { margin: 0; font-size: 20px; }
.st-about p { margin: 4px 0 0; color: var(--text-2); }
.st-keys td { padding: 4px 16px 4px 0; }
kbd { padding: 2px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; font: 12px var(--mono); background: var(--surface); white-space: nowrap; }
@media (max-width: 700px) { .st-nav { width: 64px; } .st-nav-item span, .st-user div { display: none; } .st-card { flex-wrap: wrap; } }
