/* ===== IROS — classic 90s desktop with a Linux heart ===== */

:root, [data-theme="classic"] {
  --face: #c0c0c0; --light: #dfdfdf; --hi: #ffffff; --shadow: #808080; --dark: #0a0a0a;
  --title-a: #000080; --title-b: #1084d0; --title-text: #fff;
  --title-in-a: #808080; --title-in-b: #b5b5b5; --title-in-text: #d8d8d8;
  --select: #000080; --select-text: #fff;
  --text: #000; --field: #fff; --muted: #555;
  --accent: #000080;
  --font: Tahoma, "Segoe UI", Verdana, Geneva, "DejaVu Sans", sans-serif;
  --mono: "Ubuntu Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
[data-theme="ubuntu"] {
  --face: #d9d4cf; --light: #ece8e4; --hi: #ffffff; --shadow: #8a827c; --dark: #2a1a22;
  --title-a: #e95420; --title-b: #77216f; --title-text: #fff;
  --title-in-a: #8a827c; --title-in-b: #b8b0aa; --title-in-text: #eee;
  --select: #e95420; --select-text: #fff;
  --text: #1d1d1d; --field: #fff; --muted: #6b625c;
  --accent: #e95420;
}
[data-theme="midnight"] {
  --face: #3a3a46; --light: #4c4c5a; --hi: #6a6a7c; --shadow: #23232b; --dark: #0b0b10;
  --title-a: #3b2a7a; --title-b: #7a4fd0; --title-text: #fff;
  --title-in-a: #2c2c36; --title-in-b: #45455a; --title-in-text: #9a9aaa;
  --select: #7a4fd0; --select-text: #fff;
  --text: #e8e8f0; --field: #1e1e26; --muted: #a0a0b4;
  --accent: #a58bff;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 12px var(--font); color: var(--text); background: #000; user-select: none; -webkit-user-select: none; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
code, kbd { font-family: var(--mono); }
kbd { background: var(--face); padding: 0 4px; box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hi); }
.muted { color: var(--muted); }

/* ---------- bevels ---------- */
.raised {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px var(--hi);
}
.sunken {
  background: var(--field);
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
}
.btn {
  background: var(--face); border: none; padding: 4px 12px; min-width: 75px; min-height: 23px; cursor: default;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
}
.btn:active, .btn.pressed {
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  padding: 5px 11px 3px 13px;
}
.btn:focus-visible { outline: 1px dotted var(--text); outline-offset: -4px; }
.btn.primary { font-weight: bold; }
.field {
  background: var(--field); border: none; padding: 3px 5px; outline: none; min-height: 21px; user-select: text;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
}
select.field { padding: 2px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); margin: 0 6px 0 0; }
.radio { display: flex; align-items: center; padding: 3px 0; }
.row { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.row.end { justify-content: flex-end; margin-bottom: 0; }
fieldset.group { border: none; margin: 8px 0; padding: 10px 10px 8px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--shadow), inset 2px 2px var(--hi); }
fieldset.group legend { padding: 0 4px; }

/* ---------- desktop ---------- */
#desktop { position: fixed; inset: 0 0 30px 0; background: #008080; transition: background .3s; }
#icons { position: absolute; inset: 0; padding: 8px 4px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
.dicon { width: 78px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px; color: #fff; text-align: center; cursor: default; }
.dicon .ic { font-size: 32px; line-height: 38px; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .45)); }
.dicon .lb { font-size: 11px; padding: 1px 3px; text-shadow: 1px 1px 1px #000; word-break: break-word; max-height: 30px; overflow: hidden; }
.dicon.sel .ic { opacity: .75; }
.dicon.sel .lb { background: var(--select); color: var(--select-text); text-shadow: none; outline: 1px dotted #ff0; max-height: none; }

/* ---------- windows ---------- */
#windows { position: fixed; inset: 0 0 30px 0; pointer-events: none; overflow: hidden; }
.window { position: absolute; pointer-events: auto; display: flex; flex-direction: column; padding: 3px; outline: none; }
.window.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
.titlebar {
  height: 20px; flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: 0 2px 0 3px; font-weight: bold;
  background: linear-gradient(90deg, var(--title-in-a), var(--title-in-b)); color: var(--title-in-text);
}
.window.active .titlebar { background: linear-gradient(90deg, var(--title-a), var(--title-b)); color: var(--title-text); }
.ticon { font-size: 13px; line-height: 1; font-weight: normal; }
.ttext { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtns { display: flex; }
.tbtn {
  width: 16px; height: 14px; padding: 0; border: none; font: bold 9px/1 var(--font); color: #000; background: var(--face);
  display: grid; place-items: center;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
}
[data-theme="midnight"] .tbtn { color: var(--text); }
.tbtn:active { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow); }
.tbtn.close { margin-left: 2px; }
.g-min { display: block; width: 6px; height: 2px; background: currentColor; margin-top: 5px; }
.g-max { display: block; width: 8px; height: 7px; border: 1px solid currentColor; border-top-width: 2px; }
.wbody { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-top: 2px; position: relative; }
.resize { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 45%, var(--shadow) 45% 52%, transparent 52% 62%, var(--shadow) 62% 69%, transparent 69% 79%, var(--shadow) 79% 86%, transparent 86%); }
.window.max .resize { display: none; }

/* ---------- menus ---------- */
.menubar { display: flex; flex-shrink: 0; padding: 1px 0 2px; }
.menubar > span { padding: 2px 7px; }
.menubar > span:hover, .menubar > span.open { box-shadow: inset 1px 1px var(--hi), inset -1px -1px var(--shadow); }
.menubar > span.open { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hi); }
.ctx-menu { position: fixed; z-index: 100000; min-width: 170px; padding: 3px; }
.mi { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 2px; white-space: nowrap; }
.mi:hover { background: var(--select); color: var(--select-text); }
.mi.disabled, .mi.disabled:hover { color: var(--shadow); background: none; text-shadow: 1px 1px var(--hi); }
.mi-icon { width: 20px; text-align: center; font-size: 13px; }
.mi-label { flex: 1; }
.mi-arrow { font-size: 8px; margin-left: 12px; }
.mi-hint { margin-left: 18px; opacity: .8; }
.sep { height: 2px; margin: 3px 2px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hi); }
.start-menu { display: flex; padding: 3px; }
.sm-banner { width: 26px; display: flex; align-items: flex-end; background: linear-gradient(0deg, var(--title-a), var(--title-b)); color: #fff; }
.sm-banner span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 18px; padding: 8px 3px; letter-spacing: 1px; white-space: nowrap; }
.sm-banner b { font-weight: 900; }
.sm-items { flex: 1; min-width: 190px; }
.start-menu .mi { padding: 6px 10px 6px 4px; }
.start-menu .mi-icon { font-size: 20px; width: 32px; }

/* ---------- taskbar ---------- */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 50000; display: flex; align-items: center; gap: 3px; padding: 3px 2px 2px;
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--hi); }
#start-btn { display: flex; align-items: center; gap: 5px; font-weight: bold; min-width: 0; height: 24px; padding: 2px 8px 2px 4px; }
#start-btn.pressed { padding: 3px 7px 1px 5px; }
.logo-mark {
  display: inline-grid; place-items: center; width: 18px; height: 16px; border-radius: 3px; font: 900 9px/1 var(--font); color: #fff;
  background: linear-gradient(135deg, #e95420 0 50%, #77216f 50%); box-shadow: 1px 1px 0 rgba(0, 0, 0, .4); letter-spacing: -.5px;
}
.logo-mark.big { width: 64px; height: 56px; font-size: 30px; border-radius: 10px; margin-right: 16px; box-shadow: 3px 3px 0 #000; }
.quick { display: flex; gap: 1px; padding: 0 4px; margin: 0 2px; border-left: 1px solid var(--shadow); border-right: 1px solid var(--shadow); box-shadow: inset 1px 0 var(--hi), 1px 0 var(--hi); height: 24px; align-items: center; }
.qbtn { width: 24px; height: 22px; border: none; background: none; padding: 0; font-size: 14px; line-height: 1; letter-spacing: -2px; }
.grid-ico { display: inline-block; width: 13px; height: 13px; vertical-align: middle;
  background: radial-gradient(circle, var(--text) 1.3px, transparent 1.6px) 0 0 / 4.5px 4.5px; }
.qbtn:hover { box-shadow: inset 1px 1px var(--hi), inset -1px -1px var(--shadow); }
.qbtn:active { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow); }
#task-buttons { flex: 1; display: flex; gap: 3px; min-width: 0; overflow: hidden; }
.task-btn { flex: 0 1 160px; min-width: 36px; height: 24px; display: flex; align-items: center; gap: 4px; text-align: left; white-space: nowrap; overflow: hidden; padding: 2px 6px; }
.task-btn .t { overflow: hidden; text-overflow: ellipsis; }
.task-btn.active { font-weight: bold; padding: 3px 5px 1px 7px;
  background: repeating-conic-gradient(var(--hi) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow); }
[data-theme="midnight"] .task-btn.active { background: var(--light); }
#tray { display: flex; align-items: center; gap: 8px; height: 24px; padding: 0 8px 0 5px; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hi); }
#tray > span { cursor: default; }
#clock { min-width: 58px; text-align: center; }
.ws-switch { display: flex; gap: 2px; }
.ws-switch button { width: 17px; height: 17px; padding: 0; border: none; font-size: 9px; background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow); }
.ws-switch button.busy { text-decoration: underline; font-weight: bold; }
.ws-switch button.on { background: var(--select); color: var(--select-text); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hi); }

.calendar { position: fixed; right: 4px; bottom: 33px; z-index: 100000; padding: 10px; width: 230px; }
.cal-title { font-weight: bold; }
.cal-time { font: 22px var(--mono); margin: 4px 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; padding: 6px; gap: 2px; }
.cal-grid span { padding: 3px 0; }
.cal-grid .today { background: var(--select); color: var(--select-text); font-weight: bold; }

/* ---------- notifications (Ubuntu-style) ---------- */
#notifications { position: fixed; top: 12px; right: 12px; z-index: 200000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; min-width: 300px; max-width: 420px; padding: 10px 16px;
  background: rgba(36, 31, 34, .96); color: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); animation: toastIn .25s ease-out; transition: opacity .4s; cursor: pointer; }
.toast b { display: block; margin-bottom: 2px; }
.toast-icon { font-size: 24px; }
.toast.out { opacity: 0; }
@keyframes toastIn { from { transform: translateX(24px); opacity: 0; } }

/* ---------- Activities overview ---------- */
#dash { position: fixed; inset: 0 0 30px 0; z-index: 60000; background: rgba(24, 10, 22, .84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; padding: 36px 16px 16px; color: #fff; overflow: auto; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
#dash-search { width: min(520px, 100%); padding: 10px 18px; border-radius: 22px; border: 2px solid transparent; font-size: 15px; background: #fff; color: #222; outline: none; }
#dash-search:focus { border-color: #e95420; }
#dash-ws { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 22px 0; }
.wsbox { width: 150px; height: 92px; border: 2px solid rgba(255, 255, 255, .25); border-radius: 8px; background: rgba(255, 255, 255, .07);
  display: flex; flex-direction: column; justify-content: space-between; padding: 8px; cursor: pointer; }
.wsbox:hover { background: rgba(255, 255, 255, .14); }
.wsbox.on { border-color: #e95420; }
.ws-icons { font-size: 20px; display: flex; flex-wrap: wrap; gap: 4px; }
.ws-empty { font-size: 11px; opacity: .5; }
.ws-name { font-size: 11px; opacity: .85; }
#dash-grid { display: grid; grid-template-columns: repeat(auto-fill, 112px); gap: 10px; width: min(820px, 100%); justify-content: center; }
.dash-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; cursor: pointer; text-align: center; font-size: 12px; }
.dash-app:hover, .dash-app.hl { background: rgba(255, 255, 255, .16); }
.dash-app .ic { font-size: 42px; line-height: 1; }
.dash-app .sub, .dash-file .sub { font-size: 10px; opacity: .65; }
#dash-files { width: min(520px, 100%); margin-top: 14px; }
.dash-h { font-weight: bold; opacity: .7; margin: 4px 0 6px; }
.dash-file { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.dash-file:hover { background: rgba(255, 255, 255, .14); }

/* ---------- boot / splash / login / power ---------- */
#boot { position: fixed; inset: 0; z-index: 300000; background: #000; color: #b8b8b8; font: 15px/1.35 "Courier New", var(--mono); padding: 22px; white-space: pre-wrap; overflow: hidden; cursor: default; }
#boot b { color: #fff; }
.bios-logo { float: right; font: 900 42px/1 var(--font); color: #e95420; border: 3px solid #e95420; padding: 4px 10px; border-radius: 6px; }
#boot .dim { color: #666; }
#boot .ok { color: #4ce64c; }
#splash, .power-wait { position: fixed; inset: 0; z-index: 300001; display: grid; place-items: center; color: #fff;
  background: radial-gradient(ellipse at 50% 120%, #e95420 0%, #77216f 40%, #1b0a2e 75%, #000 100%); }
.splash-inner { display: flex; flex-direction: column; align-items: center; }
.splash-logo { display: flex; align-items: center; font: 900 72px/1 var(--font); letter-spacing: 6px; text-shadow: 4px 4px 0 #000; }
.splash-sub { font-size: 18px; margin-top: 14px; letter-spacing: 2px; }
.splash-tag { font-size: 13px; opacity: .75; margin-top: 6px; font-style: italic; }
.splash-bar { width: 260px; height: 16px; margin-top: 44px; position: relative; overflow: hidden; background: #000; }
.splash-bar i { position: absolute; top: 3px; bottom: 3px; width: 64px; background: repeating-linear-gradient(90deg, #e95420 0 10px, transparent 10px 14px); animation: slide 1.3s linear infinite; }
@keyframes slide { from { left: -64px; } to { left: 100%; } }
#login { position: fixed; inset: 0; z-index: 300002; display: grid; place-items: center; background: #008080; }
.login-win { position: relative; width: 400px; max-width: calc(100% - 32px); }
.login-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: linear-gradient(90deg, #2c001e, #77216f 60%, #e95420); }
.login-banner .logo-mark { width: 36px; height: 32px; font-size: 16px; }
.login-banner b { font-size: 22px; letter-spacing: 2px; }
.form-row { display: flex; align-items: center; gap: 8px; }
.form-row span { width: 72px; }
.form-row .field { flex: 1; }
#power { position: fixed; inset: 0; z-index: 400000; }
.power-off { background: #000; color: #f0a030; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; font: bold 26px var(--font); text-align: center; padding: 16px; cursor: pointer; }
.power-off small { font-size: 12px; color: #555; font-weight: normal; }

/* ---------- dialogs ---------- */
.dlg { padding: 12px 12px 10px; }
.dlg-row { display: flex; gap: 14px; align-items: flex-start; }
.dlg-icon { font-size: 30px; line-height: 1; }
.dlg-msg { flex: 1; white-space: pre-wrap; padding-top: 4px; display: flex; flex-direction: column; gap: 10px; user-select: text; -webkit-user-select: text; min-width: 0; word-break: break-word; }
.dlg-btns { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }

/* ---------- common app parts ---------- */
.toolbar { display: flex; gap: 2px; align-items: center; padding: 2px; flex-shrink: 0; }
.toolbar .field { flex: 1; }
.tb { border: none; background: none; padding: 3px 6px; white-space: nowrap; }
.tb:hover { box-shadow: inset 1px 1px var(--hi), inset -1px -1px var(--shadow); }
.tb:active { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow); }
.tb-sep { width: 2px; height: 20px; margin: 0 3px; border-left: 1px solid var(--shadow); border-right: 1px solid var(--hi); }
.addr-label { padding: 0 6px 0 4px; }
.statusbar { display: flex; gap: 2px; flex-shrink: 0; margin-top: 2px; }
.statusbar > div { flex: 1; padding: 2px 5px; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hi); }
.statusbar > div:last-child { flex: 0 0 34%; }
.tabs { display: flex; padding: 4px 4px 0; flex-shrink: 0; }
.tab { padding: 3px 12px 4px; margin-right: -1px; position: relative; top: 2px; box-shadow: inset 1px 1px var(--hi), inset -1px 0 var(--dark), inset -2px 0 var(--shadow); cursor: default; }
.tab.on { top: 0; padding-bottom: 6px; z-index: 1; }
.tabpanel { flex: 1; padding: 10px; overflow: auto; min-height: 0; display: flex; flex-direction: column; }

/* file manager */
.fm { flex: 1; display: flex; gap: 2px; min-height: 0; }
.fm-side { width: 135px; overflow: auto; padding: 4px; }
.fm-side div { padding: 4px; display: flex; gap: 6px; white-space: nowrap; }
.fm-side div:hover { background: var(--select); color: var(--select-text); }
.fm-side div.on { font-weight: bold; }
.fm-main { flex: 1; overflow: auto; padding: 6px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; outline: none; }
.fitem { width: 82px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; text-align: center; }
.fitem .ic { font-size: 30px; line-height: 36px; }
.fitem .lb { font-size: 11px; padding: 0 2px; word-break: break-word; max-height: 42px; overflow: hidden; }
.fitem.sel .lb { background: var(--select); color: var(--select-text); max-height: none; }
.fm-empty { color: var(--muted); padding: 16px; font-style: italic; }

/* editor */
textarea.editor { flex: 1; resize: none; border: none; outline: none; padding: 6px; font: 13px/1.4 "Courier New", var(--mono); user-select: text; -webkit-user-select: text; tab-size: 4; }

/* terminal */
.term { flex: 1; overflow: auto; padding: 6px 8px; background: #300a24; color: #eeeeec; font: 13px/1.38 var(--mono); user-select: text; -webkit-user-select: text; cursor: text;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark); }
.term-out { white-space: pre-wrap; word-break: break-all; }
.term-line { display: flex; white-space: pre; }
.term-in { flex: 1; min-width: 20px; background: transparent; border: none; outline: none; padding: 0; color: inherit; font: inherit; caret-color: #fff; }
.t-user { color: #8ae234; font-weight: bold; }
.t-path { color: #729fcf; font-weight: bold; }
.t-err { color: #ef2929; }
.t-dir { color: #729fcf; font-weight: bold; }
.t-exe { color: #8ae234; font-weight: bold; }
.t-img { color: #ad7fa8; font-weight: bold; }
.t-mag { color: #ad7fa8; }
.t-dim { color: #b0a8ac; }
.t-or { color: #ff8c4a; }
.t-inv { background: #eeeeec; color: #300a24; }

/* calculator */
.calc { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.calc-top { display: flex; gap: 6px; }
.calc-mem { width: 30px; display: grid; place-items: center; font-weight: bold; }
.calc-display { flex: 1; text-align: right; font: 20px var(--mono); padding: 4px 8px; overflow: hidden; white-space: nowrap; }
.calc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.calc-grid .btn { min-width: 0; padding: 5px 0; }
.calc-grid .btn:active { padding: 6px 0 4px 1px; }
.calc-grid .op { color: #b00; }
.calc-grid .mem { color: #a0f; }
.calc-grid .eq { grid-column: 1 / -1; font-weight: bold; }
[data-theme="midnight"] .calc-grid .op { color: #ff8080; }
[data-theme="midnight"] .calc-grid .mem { color: #d0a0ff; }

/* paint */
.paint { flex: 1; display: flex; gap: 3px; min-height: 0; }
.paint-side { width: 58px; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.paint-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.paint-tools .btn { min-width: 0; height: 25px; padding: 0; font-size: 13px; }
.paint-side select { width: 100%; }
.paint-canvas-wrap { flex: 1; overflow: auto; padding: 4px; background: var(--shadow); }
.paint-canvas-wrap canvas { display: block; background: #fff; cursor: crosshair; box-shadow: 1px 1px 0 #000; touch-action: none; }
.paint-palette { display: flex; gap: 6px; align-items: center; padding: 4px 2px 0; flex-shrink: 0; }
.pal-cur { width: 34px; height: 34px; position: relative; flex-shrink: 0; }
.pal-fg, .pal-bg { position: absolute; width: 15px; height: 15px; box-shadow: 0 0 0 1px var(--shadow), 0 0 0 2px var(--hi); }
.pal-fg { left: 5px; top: 5px; z-index: 1; }
.pal-bg { right: 5px; bottom: 5px; }
.pal-grid { display: grid; grid-template-columns: repeat(14, 15px); gap: 1px; }
.pal-grid div { width: 15px; height: 15px; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hi); }
.paint-palette input[type="color"] { width: 30px; height: 30px; padding: 0; border: none; background: none; }
.viewer { flex: 1; overflow: auto; display: grid; place-items: center; background: #6a6a6a; }
.viewer img { max-width: 100%; max-height: 100%; }

/* mines */
.mines { padding: 6px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; background: var(--face); }
.mines-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; background: var(--face); }
.led { background: #000; color: #f00; font: bold 22px/1 "Courier New", monospace; padding: 2px 3px; letter-spacing: 1px; text-shadow: 0 0 4px #f00; min-width: 48px; text-align: center; }
.face { width: 30px; height: 30px; min-width: 0; padding: 0; font-size: 17px; line-height: 1; }
.face:active { padding: 1px 0 0 1px; }
.mgrid { display: grid; padding: 3px; background: var(--face); justify-content: center; }
.cell { width: 18px; height: 18px; font: bold 12px/18px Tahoma, sans-serif; display: grid; place-items: center; overflow: hidden; }
.cell.raised { font-size: 10px; }
.cell.open { background: #bdbdbd; box-shadow: inset 1px 1px #7b7b7b; font-size: 12px; }
.cell.boom { background: #f00; }
.n1 { color: #0000ff; } .n2 { color: #008000; } .n3 { color: #ff0000; } .n4 { color: #000080; }
.n5 { color: #800000; } .n6 { color: #008080; } .n7 { color: #000; } .n8 { color: #808080; }

/* clock */
.clock { padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.clock-face { padding: 6px; border-radius: 4px; background: #e8e4d8; }
.clock-dig { text-align: center; }
.clock .group { width: 100%; text-align: center; }
.clock-sw { display: inline-block; font-size: 24px; padding: 4px 10px; }
.clock .row { justify-content: center; }

/* system monitor */
.list-wrap { flex: 1; overflow: auto; min-height: 0; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { position: sticky; top: 0; text-align: left; font-weight: normal; padding: 2px 6px; background: var(--face); box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hi); }
table.list td { padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
table.list tr.sel td { background: var(--select); color: var(--select-text); }
.label { font-weight: bold; margin: 2px 0 4px; }
.graph { width: 100%; height: 130px; display: block; margin-bottom: 10px; }
.progress { height: 18px; padding: 3px; }
.progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--select) 0 8px, transparent 8px 10px); transition: width .2s; }
.stats { margin-top: 10px; color: var(--muted); }

/* settings */
.settings { flex: 1; display: flex; gap: 4px; min-height: 0; padding: 4px; }
.set-side { width: 150px; padding: 4px; overflow: auto; }
.set-side div { display: flex; align-items: center; gap: 8px; padding: 5px 6px; }
.set-side div:hover { background: var(--select); color: var(--select-text); }
.set-side div.on { font-weight: bold; box-shadow: inset 0 0 0 1px var(--select); }
.set-side .ic { font-size: 16px; }
.set-pane { flex: 1; padding: 8px 12px; overflow: auto; }
.theme-preview { display: flex; gap: 10px; flex-wrap: wrap; }
.tp { width: 140px; cursor: pointer; padding: 3px; background: var(--face); box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow); }
.tp-bar { background: linear-gradient(90deg, var(--title-a), var(--title-b)); color: #fff; font-weight: bold; padding: 2px 4px; font-size: 11px; }
.tp-body { height: 48px; display: grid; place-items: center; color: var(--text); }
.tp-btn { padding: 2px 14px; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow); }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 8px; }
.wp { text-align: center; padding: 4px; cursor: pointer; }
.wp.on { background: var(--select); color: var(--select-text); }
.wp-thumb { height: 66px; margin-bottom: 4px; background-size: cover !important; }
.user-card { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar { width: 56px; height: 56px; display: grid; place-items: center; font-size: 34px; background: linear-gradient(135deg, #e95420, #77216f); border-radius: 50%; }
.about { display: flex; gap: 18px; align-items: flex-start; }
.about-logo { width: 96px; height: 96px; flex-shrink: 0; display: grid; place-items: center; font: 900 26px var(--font); color: #fff; border-radius: 14px;
  background: linear-gradient(135deg, #e95420 0 50%, #77216f 50%); box-shadow: 3px 3px 0 var(--dark); }
table.kv td { padding: 2px 12px 2px 0; vertical-align: top; }
table.kv td:first-child { font-weight: bold; white-space: nowrap; }

/* software center */
.sc-head { display: flex; align-items: center; gap: 12px; padding: 8px 6px; color: #fff; background: linear-gradient(90deg, #2c001e, #77216f 55%, #e95420); flex-shrink: 0; }
.sc-title { font-size: 15px; font-weight: bold; white-space: nowrap; }
.sc-head .field { flex: 1; color: #000; background: #fff; }
.pkg-list { flex: 1; overflow: auto; min-height: 0; }
.pkg { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--light); }
.pkg.hl { background: color-mix(in srgb, var(--select) 15%, transparent); }
.pkg .ic { font-size: 32px; width: 40px; text-align: center; }
.pkg .info { flex: 1; min-width: 0; }
.pkg .desc { margin-top: 2px; }
.pkg-actions { display: flex; gap: 6px; align-items: center; }
.pkg-actions .progress { width: 120px; }

/* help */
.help { flex: 1; overflow: auto; padding: 12px 16px; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.help h3 { margin: 14px 0 4px; font-size: 13px; }
.help code { background: color-mix(in srgb, var(--text) 8%, transparent); padding: 0 3px; }

@media (max-width: 640px) {
  .quick .qbtn:not([data-act="dash"]) { display: none; }
  .ws-switch { display: none; }
  .task-btn .t { display: none; }
}
@media (max-width: 640px) {
  #notifications { left: 12px; }
  .toast { min-width: 0; }
}
