/* Nimbus OS — shell + apps */
:root {
  --accent: #0067c0; --accent-text: #fff;
  --win: #f3f3f3; --content: #ffffff; --card: #fbfbfb; --text: #1b1b1b; --text2: #5f5f5f;
  --border: rgba(0,0,0,.1); --hover: rgba(0,0,0,.055); --press: rgba(0,0,0,.09);
  --bar: rgba(243,243,243,.82); --flyout: rgba(243,243,243,.9); --input: #fff;
  --shadow: 0 16px 48px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.12);
  --danger: #c42b1c; --radius: 8px; --taskbar-h: 48px;
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}
:root[data-theme="dark"] {
  --win: #202020; --content: #272727; --card: #2d2d2d; --text: #ffffff; --text2: #c0c0c0;
  --border: rgba(255,255,255,.1); --hover: rgba(255,255,255,.07); --press: rgba(255,255,255,.11);
  --bar: rgba(32,32,32,.82); --flyout: rgba(40,40,40,.92); --input: #1e1e1e;
  --shadow: 0 16px 48px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.12);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font: 14px/1.4 var(--font); color: var(--text); background: #0a2a6a; user-select: none; -webkit-user-select: none; }
#root { position: fixed; inset: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
input, textarea { user-select: text; -webkit-user-select: text; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,.45); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(128,128,128,.7); }

/* ---- wallpapers ---- */
.wp-bloom { background: radial-gradient(60% 80% at 62% 68%, #9fdcff 0%, rgba(120,190,255,0) 60%), radial-gradient(70% 90% at 38% 78%, #2f7df0 0%, rgba(47,125,240,0) 65%), radial-gradient(90% 70% at 50% 100%, #0b3fb3 0%, #062a7a 55%, #031743 100%); }
.wp-dusk { background: radial-gradient(80% 70% at 70% 90%, #ffb26b 0%, rgba(255,140,90,0) 60%), radial-gradient(90% 90% at 25% 85%, #d1487a 0%, rgba(209,72,122,0) 62%), linear-gradient(180deg, #1b1445 0%, #44216e 55%, #8a2f6c 100%); }
.wp-aurora { background: radial-gradient(70% 60% at 30% 70%, #37e0a6 0%, rgba(55,224,166,0) 60%), radial-gradient(70% 70% at 78% 60%, #2a8cff 0%, rgba(42,140,255,0) 60%), linear-gradient(180deg, #03131f 0%, #06293a 60%, #0a3d44 100%); }
.wp-sand { background: radial-gradient(80% 70% at 65% 85%, #ffe2b8 0%, rgba(255,226,184,0) 60%), radial-gradient(80% 80% at 20% 90%, #e9a47a 0%, rgba(233,164,122,0) 60%), linear-gradient(180deg, #f4efe6 0%, #ecd9c2 60%, #d9b596 100%); }
.wp-slate { background: radial-gradient(80% 70% at 60% 90%, #4a5568 0%, rgba(74,85,104,0) 60%), linear-gradient(180deg, #101317 0%, #1b2027 60%, #2a313b 100%); }
.wp-meadow { background: radial-gradient(70% 60% at 70% 80%, #d6f29a 0%, rgba(214,242,154,0) 60%), radial-gradient(80% 80% at 25% 90%, #3fae6a 0%, rgba(63,174,106,0) 62%), linear-gradient(180deg, #8fd3f4 0%, #a8e0c8 55%, #2f8f5b 100%); }
.wallpaper { position: absolute; inset: 0; background-size: cover; background-position: center; }

/* ---- generic controls ---- */
.btn { border: 1px solid var(--border); background: var(--card); border-radius: 5px; padding: 5px 14px; cursor: pointer; min-height: 32px; border-bottom-color: rgba(0,0,0,.18); }
.btn:hover { background: var(--hover); }
.btn:active { background: var(--press); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.ibtn { border: 0; background: transparent; border-radius: 5px; width: 32px; height: 32px; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.ibtn:hover { background: var(--hover); }
.ibtn:disabled { opacity: .35; pointer-events: none; }
.ibtn svg { width: 16px; height: 16px; }
.tbtn { border: 0; background: transparent; border-radius: 5px; height: 32px; padding: 0 10px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }
.tbtn:hover { background: var(--hover); }
.tbtn:disabled { opacity: .4; pointer-events: none; }
.tbtn svg { width: 16px; height: 16px; }
.input, select.input { border: 1px solid var(--border); border-bottom: 1px solid rgba(128,128,128,.7); background: var(--input); border-radius: 5px; padding: 5px 10px; min-height: 32px; outline: none; width: 100%; }
.input:focus { border-bottom: 2px solid var(--accent); padding-bottom: 4px; }
textarea.input { resize: vertical; }
.muted { color: var(--text2); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.sep-v { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex: none; }
.empty { display: grid; place-items: center; height: 100%; color: var(--text2); text-align: center; padding: 24px; }
.avatar { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 600; flex: none; }
.switch { appearance: none; width: 40px; height: 20px; border-radius: 10px; border: 1px solid var(--text2); position: relative; cursor: pointer; background: transparent; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--text2); transition: left .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { left: 23px; background: #fff; }

/* ---- login / lock ---- */
.login { position: absolute; inset: 0; z-index: 100000; display: grid; place-items: center; color: #fff; }
.login .wallpaper { filter: blur(24px) brightness(.75); transform: scale(1.1); }
.login-clock { position: absolute; top: 9%; left: 0; right: 0; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.login-clock .t { font-size: 84px; font-weight: 600; line-height: 1; letter-spacing: -1px; }
.login-clock .d { font-size: 20px; margin-top: 8px; }
.login-card { position: relative; width: 340px; text-align: center; margin-top: 8vh; }
.login-card .avatar { width: 128px; height: 128px; font-size: 52px; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.login-card h1 { font-weight: 400; font-size: 28px; margin: 16px 0 20px; }
.login-card .input { background: rgba(20,20,20,.55); color: #fff; border-color: rgba(255,255,255,.25); border-bottom-color: #fff; margin-bottom: 10px; height: 36px; backdrop-filter: blur(20px); }
.login-card .input::placeholder { color: rgba(255,255,255,.7); }
.login-card .btn { width: 100%; height: 36px; }
.login-card .err { min-height: 20px; margin-top: 10px; font-size: 13px; }
.login-card p { font-size: 13px; opacity: .9; margin: 0 0 16px; }
.login-users { position: absolute; left: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 2px; }
.login-users button { background: transparent; border: 0; color: #fff; display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 6px; cursor: pointer; text-align: left; min-width: 200px; }
.login-users button:hover, .login-users button.sel { background: rgba(255,255,255,.16); }
.login-users .avatar { width: 40px; height: 40px; font-size: 16px; }
.login-brand { position: absolute; right: 28px; bottom: 24px; opacity: .85; font-size: 13px; }

/* ---- desktop ---- */
.desktop { position: absolute; inset: 0; overflow: hidden; }
.desk-icons { position: absolute; inset: 0 0 var(--taskbar-h) 0; padding: 8px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 4px; }
.desk-icon { width: 84px; height: 88px; padding: 6px 4px; border-radius: 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; font-size: 12px; text-align: center; border: 1px solid transparent; cursor: default; }
.desk-icon:hover { background: rgba(255,255,255,.12); }
.desk-icon.sel { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.35); }
.desk-icon .ic { width: 44px; height: 44px; flex: none; }
.desk-icon .ic svg, .desk-icon .ic img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.desk-icon span { text-shadow: 0 1px 3px rgba(0,0,0,.9); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; line-height: 1.25; }
.windows { position: absolute; inset: 0 0 var(--taskbar-h) 0; pointer-events: none; }

/* ---- windows ---- */
.window { position: absolute; display: flex; flex-direction: column; background: var(--win); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; pointer-events: auto; animation: win-in .16s cubic-bezier(.2,.9,.3,1); }
@keyframes win-in { from { opacity: 0; transform: scale(.94); } }
.window.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.window.min { display: none; }
.window:not(.active) .titlebar .title { opacity: .55; }
.titlebar { height: 34px; display: flex; align-items: center; flex: none; padding-left: 10px; gap: 8px; touch-action: none; }
.titlebar .ticon { width: 16px; height: 16px; flex: none; }
.titlebar .ticon svg { width: 16px; height: 16px; display: block; }
.titlebar .title { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar .wc { width: 46px; height: 34px; border: 0; background: transparent; display: grid; place-items: center; cursor: default; }
.titlebar .wc svg { width: 10px; height: 10px; }
.titlebar .wc:hover { background: var(--hover); }
.titlebar .wc.close:hover { background: var(--danger); color: #fff; }
.win-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.win-shield { position: absolute; inset: 34px 0 0 0; z-index: 5; }
.window.active .win-shield { display: none; }
.rz { position: absolute; z-index: 6; }
.rz.n { top: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; } .rz.s { bottom: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.rz.w { left: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; } .rz.e { right: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.rz.nw { left: -3px; top: -3px; width: 12px; height: 12px; cursor: nwse-resize; } .rz.se { right: -3px; bottom: -3px; width: 12px; height: 12px; cursor: nwse-resize; }
.rz.ne { right: -3px; top: -3px; width: 12px; height: 12px; cursor: nesw-resize; } .rz.sw { left: -3px; bottom: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.window.max .rz { display: none; }
body.wm-drag iframe, body.wm-drag .win-body { pointer-events: none; }
.snap-preview { position: absolute; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.5); border-radius: 8px; backdrop-filter: blur(12px); transition: all .12s; pointer-events: none; z-index: 50; }

/* ---- taskbar ---- */
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--taskbar-h); background: var(--bar); backdrop-filter: blur(30px) saturate(1.6); border-top: 1px solid var(--border); display: flex; align-items: center; z-index: 90000; padding: 0 4px 0 8px; }
.tb-apps { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.taskbar.left .tb-apps { justify-content: flex-start; }
.tb-btn { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 5px; display: grid; place-items: center; position: relative; cursor: default; transition: background .1s; }
.tb-btn:hover { background: var(--hover); }
.tb-btn:active svg { transform: scale(.85); }
.tb-btn svg { width: 24px; height: 24px; transition: transform .1s; }
.tb-btn.running::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 6px; height: 3px; border-radius: 2px; background: var(--text2); transform: translateX(-50%); transition: all .15s; }
.tb-btn.active { background: var(--hover); }
.tb-btn.active::after { width: 16px; background: var(--accent); }
.tray { display: flex; align-items: center; height: 100%; }
.tray-clock { border: 0; background: transparent; text-align: right; font-size: 12px; line-height: 1.3; padding: 4px 10px; border-radius: 5px; cursor: default; height: 40px; }
.tray-clock:hover { background: var(--hover); }
.show-desktop { width: 6px; height: 100%; border: 0; background: transparent; border-left: 1px solid transparent; margin-left: 4px; }
.show-desktop:hover { border-left-color: var(--text2); }

/* ---- start menu / flyouts ---- */
.start { position: absolute; bottom: calc(var(--taskbar-h) + 12px); left: 50%; transform: translateX(-50%); width: 600px; max-width: calc(100vw - 24px); height: 620px; max-height: calc(100vh - 80px); background: var(--flyout); backdrop-filter: blur(40px) saturate(1.8); border-radius: 10px; box-shadow: var(--shadow); z-index: 95000; display: flex; flex-direction: column; animation: start-in .18s cubic-bezier(.2,.9,.3,1); overflow: hidden; }
.start.left { left: 12px; transform: none; }
@keyframes start-in { from { opacity: 0; margin-bottom: -24px; } }
.start-search { padding: 28px 32px 8px; }
.start-search .input { border-radius: 18px; padding-left: 16px; height: 36px; }
.start h3 { font-size: 14px; font-weight: 600; margin: 16px 0 12px; padding: 0 40px; }
.start-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 0 28px; overflow-y: auto; flex: 1; align-content: start; }
.start-app { height: 84px; border: 0; background: transparent; border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; cursor: default; padding: 0 2px; }
.start-app:hover { background: var(--hover); }
.start-app svg { width: 32px; height: 32px; }
.start-foot { height: 64px; flex: none; border-top: 1px solid var(--border); background: rgba(0,0,0,.04); display: flex; align-items: center; padding: 0 44px; justify-content: space-between; }
.start-user { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 6px 12px; border-radius: 5px; cursor: default; }
.start-user:hover { background: var(--hover); }
.start-user .avatar { width: 32px; height: 32px; font-size: 13px; }

.menu { position: fixed; z-index: 99000; min-width: 190px; background: var(--flyout); backdrop-filter: blur(30px) saturate(1.6); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; animation: menu-in .1s; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 6px 12px; border-radius: 4px; text-align: left; cursor: default; min-height: 30px; }
.menu button:hover { background: var(--hover); }
.menu button:disabled { opacity: .4; pointer-events: none; }
.menu button .k { margin-left: auto; padding-left: 20px; color: var(--text2); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu svg { width: 16px; height: 16px; flex: none; }

.toasts { position: absolute; right: 12px; bottom: calc(var(--taskbar-h) + 12px); z-index: 99500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { width: 340px; background: var(--flyout); backdrop-filter: blur(30px); border-radius: 8px; box-shadow: var(--shadow); padding: 12px 16px; animation: toast-in .25s cubic-bezier(.2,.9,.3,1); pointer-events: auto; }
.toast b { display: block; margin-bottom: 2px; }
.toast.err { border-left: 3px solid var(--danger); }
@keyframes toast-in { from { transform: translateX(110%); } }

.modal-back { position: absolute; inset: 0; background: rgba(0,0,0,.35); z-index: 98000; display: grid; place-items: center; animation: menu-in .12s; }
.modal { width: 420px; max-width: calc(100vw - 32px); background: var(--content); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.modal .mb { padding: 24px 24px 20px; max-height: 70vh; overflow: auto; }
.modal h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
.modal label { display: block; font-size: 13px; margin: 12px 0 4px; }
.modal .mf { background: var(--win); border-top: 1px solid var(--border); padding: 16px 24px; display: flex; gap: 8px; }
.modal .mf .btn { flex: 1; }

/* ---- shared app chrome ---- */
.toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; flex: none; min-height: 44px; }
.pane { background: var(--content); flex: 1; min-height: 0; overflow: auto; }
.statusbar { flex: none; height: 26px; display: flex; align-items: center; gap: 16px; padding: 0 12px; font-size: 12px; color: var(--text2); border-top: 1px solid var(--border); }
.menubar { display: flex; padding: 0 4px; flex: none; }
.menubar button { border: 0; background: transparent; padding: 4px 10px; border-radius: 4px; font-size: 13px; cursor: default; }
.menubar button:hover { background: var(--hover); }

/* explorer */
.ex { display: flex; flex: 1; min-height: 0; }
.ex-side { width: 196px; flex: none; padding: 6px; overflow: auto; border-right: 1px solid var(--border); }
.ex-side button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 6px 10px; border-radius: 4px; text-align: left; cursor: default; }
.ex-side button:hover { background: var(--hover); }
.ex-side button.sel { background: var(--press); }
.ex-side svg { width: 18px; height: 18px; flex: none; }
.crumbs { flex: 1; display: flex; align-items: center; background: var(--input); border: 1px solid var(--border); border-radius: 5px; height: 32px; padding: 0 6px; overflow: hidden; margin: 0 6px; min-width: 80px; }
.crumbs button { border: 0; background: transparent; padding: 3px 6px; border-radius: 4px; cursor: default; white-space: nowrap; }
.crumbs button:hover { background: var(--hover); }
.crumbs i { color: var(--text2); font-style: normal; font-size: 10px; }
.ftable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ftable th { text-align: left; font-weight: 400; color: var(--text2); padding: 6px 10px; border-right: 1px solid var(--border); position: sticky; top: 0; background: var(--content); font-size: 12px; z-index: 1; }
.ftable td { padding: 5px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.ftable td.n { display: flex; align-items: center; gap: 8px; }
.ftable td.n svg, .ftable td.n img { width: 20px; height: 20px; flex: none; object-fit: cover; border-radius: 2px; }
.ftable tbody tr:hover { background: var(--hover); }
.ftable tbody tr.sel { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.ftable td.d { color: var(--text2); }
.pane.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.usage { width: 120px; height: 4px; background: var(--press); border-radius: 2px; overflow: hidden; }
.usage i { display: block; height: 100%; background: var(--accent); }

/* notepad */
.np-text { flex: 1; border: 0; outline: 0; resize: none; padding: 10px 14px; background: var(--content); font: 14px/1.5 var(--mono); tab-size: 4; min-height: 0; }
.np-text.wrap { white-space: pre-wrap; } .np-text.nowrap { white-space: pre; overflow-x: auto; }

/* browser */
.br-tabs { display: flex; align-items: flex-end; padding: 0 8px; gap: 2px; flex: none; height: 36px; overflow: hidden; }
.br-tab { flex: 0 1 220px; min-width: 60px; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; border-radius: 8px 8px 0 0; font-size: 12px; cursor: default; }
.br-tab:hover { background: var(--hover); }
.br-tab.sel { background: var(--content); }
.br-tab span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.br-tab .ibtn { width: 20px; height: 20px; } .br-tab .ibtn svg { width: 9px; height: 9px; }
.br-bar { background: var(--content); display: flex; align-items: center; gap: 2px; padding: 5px 8px; flex: none; border-bottom: 1px solid var(--border); }
.br-url { flex: 1; height: 30px; border-radius: 15px; border: 1px solid transparent; background: var(--win); padding: 0 14px; outline: 0; margin: 0 6px; min-width: 0; }
.br-url:focus { border-color: var(--accent); background: var(--input); }
.br-marks { background: var(--content); display: flex; gap: 2px; padding: 2px 8px 4px; flex: none; border-bottom: 1px solid var(--border); overflow: hidden; }
.br-marks button { border: 0; background: transparent; border-radius: 4px; padding: 3px 8px; font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; flex: none; }
.br-marks button:hover { background: var(--hover); }
.br-view { flex: 1; position: relative; background: #fff; min-height: 0; }
.br-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.br-load { position: absolute; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 3; animation: br-load 1.6s ease-out infinite; }
@keyframes br-load { from { width: 0; } to { width: 90%; } }
.br-newtab { position: absolute; inset: 0; background: var(--content); color: var(--text); display: flex; flex-direction: column; align-items: center; padding-top: 12vh; overflow: auto; }
.br-newtab h1 { font-weight: 600; font-size: 34px; margin: 0 0 24px; }
.br-newtab .input { width: min(560px, 80%); height: 46px; border-radius: 23px; padding: 0 22px; font-size: 15px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.br-tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 640px; margin-top: 32px; padding: 0 16px; }
.br-tile { width: 104px; height: 92px; border: 0; background: var(--win); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12px; cursor: default; padding: 4px; }
.br-tile:hover { background: var(--press); }
.br-tile b { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 17px; }
.br-tile span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* mail */
.ml { display: flex; flex: 1; min-height: 0; }
.ml-side { width: 200px; flex: none; overflow: auto; padding: 6px; border-right: 1px solid var(--border); }
.ml-acct { font-size: 12px; font-weight: 600; padding: 10px 10px 4px; display: flex; align-items: center; gap: 6px; }
.ml-acct span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-side button.f { display: flex; width: 100%; border: 0; background: transparent; padding: 6px 10px 6px 18px; border-radius: 4px; text-align: left; cursor: default; }
.ml-side button.f:hover { background: var(--hover); }
.ml-side button.f.sel { background: var(--press); font-weight: 600; }
.ml-side button.f em { margin-left: auto; font-style: normal; color: var(--accent); font-weight: 600; font-size: 12px; }
.ml-list { width: 320px; flex: none; overflow: auto; background: var(--content); border-right: 1px solid var(--border); }
.ml-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: default; border-left: 3px solid transparent; }
.ml-item:hover { background: var(--hover); }
.ml-item.sel { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ml-item.unread { border-left-color: var(--accent); }
.ml-item.unread .s { font-weight: 600; color: var(--accent); }
.ml-item .f { display: flex; gap: 8px; } .ml-item .f b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.ml-item.unread .f b { font-weight: 600; }
.ml-item .f time { font-size: 11px; color: var(--text2); flex: none; }
.ml-item .s { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-read { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--content); }
.ml-head { padding: 16px 20px; border-bottom: 1px solid var(--border); flex: none; user-select: text; -webkit-user-select: text; }
.ml-head h2 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.ml-head .meta { font-size: 12px; color: var(--text2); line-height: 1.6; word-break: break-word; }
.ml-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ml-body { flex: 1; min-height: 0; overflow: auto; }
.ml-body pre { margin: 0; padding: 18px 20px; white-space: pre-wrap; word-break: break-word; font: 14px/1.55 var(--font); user-select: text; -webkit-user-select: text; }
.ml-body iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.compose { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--content); }
.compose .line { display: flex; align-items: center; border-bottom: 1px solid var(--border); padding: 0 14px; flex: none; }
.compose .line label { width: 64px; color: var(--text2); font-size: 13px; }
.compose .line input, .compose .line select { flex: 1; border: 0; outline: 0; background: transparent; height: 36px; min-width: 0; }
.compose textarea { flex: 1; border: 0; outline: 0; resize: none; padding: 14px; background: transparent; font: 14px/1.55 var(--font); min-height: 0; }

/* settings */
.st { display: flex; flex: 1; min-height: 0; }
.st-nav { width: 240px; flex: none; padding: 8px; overflow: auto; }
.st-me { display: flex; align-items: center; gap: 12px; padding: 10px 10px 18px; }
.st-me .avatar { width: 52px; height: 52px; font-size: 20px; }
.st-nav button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 8px 12px; border-radius: 5px; text-align: left; cursor: default; position: relative; }
.st-nav button:hover { background: var(--hover); }
.st-nav button.sel { background: var(--press); }
.st-nav button.sel::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--accent); }
.st-nav svg { width: 18px; height: 18px; }
.st-main { flex: 1; overflow: auto; padding: 8px 28px 28px; min-width: 0; }
.st-main h1 { font-size: 26px; font-weight: 600; margin: 8px 0 20px; }
.st-main h4 { font-size: 14px; font-weight: 600; margin: 22px 0 8px; }
.st-card { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; display: flex; align-items: center; gap: 16px; margin-bottom: 4px; min-height: 64px; }
.st-card .lbl { flex: 1; min-width: 0; } .st-card .lbl small { display: block; color: var(--text2); font-size: 12px; }
.st-card .input { width: 220px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 5px; border: 2px solid transparent; cursor: pointer; }
.swatches button.sel { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--content); }
.wps { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.wps button { height: 76px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; background-size: cover; background-position: center; }
.wps button.sel { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--content); }
.utable { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 6px; }
.utable td, .utable th { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 400; }
.utable th { color: var(--text2); font-size: 12px; }
.utable .avatar { width: 28px; height: 28px; font-size: 12px; margin-right: 10px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--press); }
.badge.a { background: var(--accent); color: var(--accent-text); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; font-size: 13px; user-select: text; -webkit-user-select: text; }
.kv span:nth-child(odd) { color: var(--text2); }

/* calculator */
.calc { display: flex; flex-direction: column; flex: 1; padding: 4px; gap: 2px; min-height: 0; }
.calc-exp { text-align: right; padding: 8px 14px 0; color: var(--text2); min-height: 26px; font-size: 13px; }
.calc-out { text-align: right; padding: 0 14px 10px; font-size: 44px; font-weight: 600; overflow: hidden; white-space: nowrap; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; flex: 1; }
.calc-keys button { border: 1px solid var(--border); border-radius: 4px; background: var(--content); font-size: 17px; cursor: default; }
.calc-keys button.op { background: var(--card); opacity: .92; }
.calc-keys button:hover { filter: brightness(.95); }
.calc-keys button.eq { background: var(--accent); color: var(--accent-text); }

/* calendar */
.cal { display: flex; flex: 1; min-height: 0; background: var(--content); }
.cal-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; border-top: 1px solid var(--border); min-height: 0; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; color: var(--text2); padding: 4px 0; }
.cal-dow span { padding-left: 8px; }
.cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 6px; overflow: hidden; font-size: 12px; cursor: default; }
.cal-cell:hover { background: var(--hover); }
.cal-cell.out { color: var(--text2); opacity: .55; }
.cal-cell .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.cal-cell.today .num { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.cal-ev { background: color-mix(in srgb, var(--accent) 22%, transparent); border-left: 3px solid var(--accent); border-radius: 3px; padding: 1px 5px; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* photos / media / paint */
.viewer { flex: 1; background: #111; display: grid; place-items: center; min-height: 0; overflow: hidden; position: relative; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer .empty { color: #bbb; }
.paint-wrap { flex: 1; overflow: auto; background: var(--press); padding: 16px; min-height: 0; }
.paint-wrap canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: crosshair; display: block; touch-action: none; }
.tool.sel { background: var(--press); outline: 1px solid var(--accent); }

/* terminal */
.term { flex: 1; background: #0c0c0c; color: #cccccc; font: 14px/1.4 var(--mono); padding: 8px 10px; overflow: auto; min-height: 0; user-select: text; -webkit-user-select: text; cursor: text; }
.term pre { margin: 0; white-space: pre-wrap; word-break: break-all; font: inherit; }
.term .line { display: flex; }
.term input { flex: 1; background: transparent; border: 0; outline: 0; color: inherit; font: inherit; padding: 0; margin-left: 6px; }
.term .p { color: #16c60c; white-space: nowrap; }

@media (max-width: 720px) {
  .login-clock .t { font-size: 56px; }
  .ex-side, .st-nav { width: 56px; } .ex-side button span, .st-nav button span, .st-me div { display: none; }
  .ml-side { width: 130px; } .ml-list { width: 200px; }
}
