/* ==========================================================================
   App specific styles
   ========================================================================== */

/* ---------- calls ---------- */
.call-panel { position: fixed; bottom: calc(var(--taskbar-h) + 16px); inset-inline-end: 16px; width: 320px; height: 220px; z-index: 25000; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #334155, #0f172a); color: #fff; box-shadow: var(--shadow); animation: pop .2s; cursor: grab; }
.call-panel.video, .call-panel.has-remote-video { width: 560px; height: 380px; }
.call-panel:fullscreen { width: 100%; height: 100%; border-radius: 0; }
.call-panel video.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.call-panel.has-remote-video video.remote { display: block; }
.call-panel video.local { position: absolute; width: 28%; aspect-ratio: 4/3; top: 10px; inset-inline-end: 10px; border-radius: 10px; object-fit: cover; background: #111; display: none; border: 2px solid rgba(255,255,255,.4); }
.call-panel.video video.local { display: block; }
.call-info { position: absolute; inset: 0 0 60px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.call-panel.has-remote-video .call-info { justify-content: flex-start; align-items: flex-start; padding: 12px; inset: 0 auto auto 0; }
.call-panel.has-remote-video .call-info .avatar { display: none; }
.call-info .avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.call-status { opacity: .75; font-size: .9em; }
.call-ctl { position: absolute; bottom: 12px; inset-inline: 0; display: flex; justify-content: center; gap: 10px; }
.cbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(10px); transition: .15s; }
.cbtn:hover { background: rgba(255,255,255,.3); }
.cbtn.off { background: #fff; color: #111; }
.cbtn.on { background: var(--accent); }
.cbtn.end { background: #dc2626; } .cbtn.end:hover { background: #b91c1c; }
.cbtn.ok { background: #16a34a; } .cbtn.ok:hover { background: #15803d; }
.call-incoming { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 26000; background: #0f172a; color: #fff; border-radius: 18px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); animation: slideup .3s; min-width: 360px; }
.call-incoming .avatar.lg { width: 56px; height: 56px; font-size: 22px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(59,130,246,.25); } }

/* ---------- File Station ---------- */
.fs { display: flex; flex-direction: column; height: 100%; }
.fs-top { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--bg); }
.fs-crumbs { flex: 1; display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); overflow: hidden; min-width: 0; }
.fs-crumbs button { border: 0; background: none; padding: 4px 6px; border-radius: 5px; cursor: pointer; white-space: nowrap; color: var(--fg); }
.fs-crumbs button:hover { background: var(--hover); }
.fs-crumbs .ic { width: 12px; height: 12px; color: var(--fg2); }
[dir=rtl] .fs-crumbs .chev { transform: scaleX(-1); }
.fs-crumbs input { border: 0; outline: none; background: none; flex: 1; height: 100%; }
.fs-ribbon { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--bg); flex-wrap: wrap; }
.fs-ribbon .btn { height: 30px; padding: 0 9px; }
.fs-ribbon .vsep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.fs-main { flex: 1; display: flex; min-height: 0; }
.fs-side { width: 210px; flex: none; overflow-y: auto; background: var(--bg2); border-inline-end: 1px solid var(--border); padding: 8px 6px; }
.fs-side .grp { font-size: .75em; color: var(--fg2); text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px 4px; font-weight: 600; }
.fs-side button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; text-align: start; color: var(--fg); }
.fs-side button:hover { background: var(--hover); }
.fs-side button.active { background: var(--sel); }
.fs-side button .ic { color: #d97706; } .fs-side button .ic.blue { color: var(--accent); }
.fs-content { flex: 1; min-width: 0; overflow: auto; position: relative; outline: none; }
.fs-status { display: flex; gap: 14px; padding: 5px 12px; font-size: .82em; color: var(--fg2); border-top: 1px solid var(--border); background: var(--bg); }
.fs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 110px), 1fr)); gap: 4px; padding: 10px; }
.fs-item { border-radius: 8px; border: 1px solid transparent; cursor: default; user-select: none; }
.fs-grid .fs-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; text-align: center; }
.fs-grid .fs-item .nm { font-size: 12.5px; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.fs-item:hover { background: var(--hover); }
.fs-item.sel { background: var(--sel); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.fs-item.cut { opacity: .5; }
.fs-thumb { width: calc(var(--tile, 110px) * .6); height: calc(var(--tile, 110px) * .6); display: grid; place-items: center; position: relative; }
.fs-thumb img { max-width: 100%; max-height: 100%; border-radius: 4px; object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.fs-thumb .ic { width: 70%; height: 70%; }
.fs-list { width: 100%; border-collapse: collapse; }
.fs-list th { text-align: start; font-weight: 500; font-size: .85em; color: var(--fg2); padding: 6px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); cursor: pointer; white-space: nowrap; }
.fs-list td { padding: 5px 10px; white-space: nowrap; }
.fs-list tr.fs-item td:first-child { border-radius: 6px 0 0 6px; } .fs-list tr.fs-item td:last-child { border-radius: 0 6px 6px 0; }
.fs-list .nmcell { display: flex; align-items: center; gap: 9px; max-width: 520px; }
.fs-list .nmcell span { overflow: hidden; text-overflow: ellipsis; }
.fs-preview { width: 280px; flex: none; border-inline-start: 1px solid var(--border); background: var(--bg2); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fs-preview .pv { display: grid; place-items: center; min-height: 160px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.fs-preview .pv img, .fs-preview .pv video { max-width: 100%; max-height: 240px; }
.ftype { --fc: #64748b; color: var(--fc); }
.ftype.dir { --fc: #f59e0b; } .ftype.image { --fc: #22c55e; } .ftype.video { --fc: #ef4444; } .ftype.audio { --fc: #ec4899; } .ftype.pdf { --fc: #dc2626; }
.ftype.doc { --fc: #2563eb; } .ftype.sheet { --fc: #16a34a; } .ftype.slide { --fc: #ea580c; } .ftype.archive { --fc: #a16207; } .ftype.code { --fc: #7c3aed; } .ftype.text { --fc: #475569; }
.upload-panel { position: absolute; bottom: 36px; inset-inline-end: 12px; width: 320px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; z-index: 20; }

/* ---------- media players ---------- */
.player { position: relative; background: #000; flex: 1; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-ctl { position: absolute; inset-inline: 0; bottom: 0; padding: 30px 16px 12px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; display: flex; flex-direction: column; gap: 8px; transition: opacity .3s; }
.player.idle .player-ctl { opacity: 0; } .player.idle { cursor: none; }
.player-ctl .row .btn { color: #fff; }
.player-ctl .btn.ghost:hover { background: rgba(255,255,255,.15); }
.seek { width: 100%; }
.player .center-msg { position: absolute; color: #fff; text-align: center; }
.vlib { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 16px; }
.vcard { cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--bg2); transition: transform .15s; }
.vcard:hover { transform: scale(1.03); }
.vcard .poster { aspect-ratio: 16/9; background: #111 center/cover; display: grid; place-items: center; color: #fff; }
.vcard .meta { padding: 8px 10px; } .vcard .meta b { display: block; font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Audio Station */
.au { display: flex; flex-direction: column; height: 100%; }
.au-main { flex: 1; display: flex; min-height: 0; }
.au-bar { height: 84px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-top: 1px solid var(--border); background: var(--bg2); }
.au-bar .cover { width: 56px; height: 56px; border-radius: 8px; background: var(--bg3) center/cover; flex: none; display: grid; place-items: center; }
.au-bar .now { width: 220px; min-width: 0; }
.au-bar .now b, .au-bar .now span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-bar .mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 640px; margin: 0 auto; }
.au-bar .mid .row { gap: 6px; }
.au-bar .playbtn { width: 42px; height: 42px; border-radius: 50%; background: var(--fg); color: var(--bg); border: 0; display: grid; place-items: center; cursor: pointer; }
.au-bar .btn.on { color: var(--accent); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; padding: 18px; }
.album { cursor: pointer; }
.album .art { aspect-ratio: 1; border-radius: 10px; background: linear-gradient(135deg, var(--bg3), var(--bg2)) center/cover; display: grid; place-items: center; box-shadow: var(--shadow-sm); transition: transform .15s; position: relative; overflow: hidden; }
.album:hover .art { transform: translateY(-3px); }
.album b { display: block; margin-top: 8px; font-size: .93em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album small { color: var(--fg2); }
.track-table td { padding: 6px 10px; }
.track-table tr.playing td { color: var(--accent); font-weight: 600; }
.eq { display: flex; gap: 12px; justify-content: center; align-items: flex-end; height: 180px; }
.eq label { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78em; color: var(--fg2); }
.eq input[type=range] { writing-mode: vertical-lr; direction: rtl; width: 24px; height: 140px; }
.lyrics { white-space: pre-wrap; line-height: 2; font-size: 1.1em; text-align: center; padding: 20px; }
.lyrics .cur { color: var(--accent); font-weight: 700; font-size: 1.15em; }
.visualizer { width: 100%; height: 120px; display: block; }

/* Photos */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ph, 160px), 1fr)); gap: 4px; padding: 4px 16px 16px; }
.ph-grid .ph { aspect-ratio: 1; background: var(--bg3) center/cover; cursor: pointer; border-radius: 4px; position: relative; overflow: hidden; }
.ph-grid .ph:hover { filter: brightness(1.1); }
.ph-grid .ph .vbadge { position: absolute; bottom: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 11px; display: flex; gap: 3px; align-items: center; }
.ph-grid .ph.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph-day { padding: 18px 16px 6px; font-weight: 600; }
.lightbox { position: absolute; inset: 0; background: #000; z-index: 30; display: flex; flex-direction: column; color: #fff; }
.lightbox .stage { flex: 1; display: grid; place-items: center; overflow: hidden; position: relative; min-height: 0; }
.lightbox .stage img, .lightbox .stage video { max-width: 100%; max-height: 100%; transition: transform .2s; user-select: none; }
.lightbox .lb-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: rgba(0,0,0,.6); }
.lightbox .lb-bar .btn { color: #fff; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.15); border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; }
.lightbox .nav.prev { inset-inline-start: 16px; } .lightbox .nav.next { inset-inline-end: 16px; }
[dir=rtl] .lightbox .nav .ic { transform: scaleX(-1); }
.edit-panel { width: 280px; background: #111; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.edit-panel label { display: flex; flex-direction: column; gap: 4px; font-size: .9em; }

/* ---------- terminal ---------- */
.term-wrap { flex: 1; background: #0d1117; padding: 6px; min-height: 0; }
.term-wrap .xterm { height: 100%; }

/* ---------- notes / editors ---------- */
.notes { display: flex; height: 100%; }
.notes-side { width: 260px; flex: none; border-inline-end: 1px solid var(--border); background: var(--bg2); display: flex; flex-direction: column; }
.notes-tree { flex: 1; overflow: auto; padding: 6px; }
.tree-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.tree-item:hover { background: var(--hover); }
.tree-item.active { background: var(--sel); color: var(--accent); }
.tree-item .tw { width: 14px; display: inline-grid; place-items: center; flex: none; }
.notes-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rt-toolbar { display: flex; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; background: var(--bg); }
.rt-toolbar .btn { height: 30px; min-width: 30px; padding: 0 7px; }
.rt-toolbar select { height: 30px; }
.rt-editor { flex: 1; overflow: auto; padding: 28px max(28px, calc((100% - 860px) / 2)); outline: none; line-height: 1.65; font-size: 1.05em; }
.rt-editor h1 { font-size: 2em; margin: .4em 0; } .rt-editor h2 { font-size: 1.5em; } .rt-editor blockquote { border-inline-start: 4px solid var(--accent); margin: 0; padding: 4px 16px; color: var(--fg2); background: var(--bg2); }
.rt-editor pre, .md-preview pre { background: var(--bg2); padding: 12px; border-radius: 8px; overflow: auto; font-family: var(--mono); }
.rt-editor code, .md-preview code { font-family: var(--mono); background: var(--bg3); padding: 1px 5px; border-radius: 4px; }
.rt-editor table, .md-preview table { border-collapse: collapse; } .rt-editor td, .rt-editor th, .md-preview td, .md-preview th { border: 1px solid var(--border); padding: 6px 10px; }
.rt-editor img { max-width: 100%; }
.md-split { flex: 1; display: flex; min-height: 0; }
.md-split textarea { flex: 1; border: 0; outline: none; resize: none; padding: 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; background: var(--bg); color: var(--fg); }
.md-preview { flex: 1; overflow: auto; padding: 20px 28px; border-inline-start: 1px solid var(--border); line-height: 1.65; }
.code-ed { flex: 1; display: flex; min-height: 0; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; background: var(--bg); }
.code-ed .gutter { padding: 10px 8px; text-align: end; color: var(--fg2); background: var(--bg2); user-select: none; overflow: hidden; min-width: 48px; white-space: pre; border-inline-end: 1px solid var(--border); direction: ltr; }
.code-ed textarea { flex: 1; border: 0; outline: none; resize: none; padding: 10px 12px; font: inherit; line-height: inherit; background: transparent; color: var(--fg); white-space: pre; overflow: auto; tab-size: 4; direction: ltr; }
.code-ed textarea.wrap { white-space: pre-wrap; }
.ed-tabs { display: flex; background: var(--bg2); border-bottom: 1px solid var(--border); overflow-x: auto; flex: none; }
.ed-tabs .tab { display: flex; align-items: center; gap: 6px; padding: 7px 10px 7px 14px; border-inline-end: 1px solid var(--border); cursor: pointer; white-space: nowrap; font-size: .9em; color: var(--fg2); }
.ed-tabs .tab.active { background: var(--bg); color: var(--fg); box-shadow: inset 0 2px 0 var(--accent); }
.ed-tabs .tab .x { opacity: .5; border-radius: 4px; display: grid; place-items: center; width: 18px; height: 18px; }
.ed-tabs .tab .x:hover { opacity: 1; background: var(--hover); }
.ed-tabs .tab.dirty .nm::after { content: " ●"; color: var(--accent); }
.findbar { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--bg2); align-items: center; flex-wrap: wrap; }

/* ---------- chat ---------- */
.chat { display: flex; height: 100%; }
.chat-side { width: 290px; flex: none; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg2); }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 6px; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--sel); }
.chat-item .avatar { width: 40px; height: 40px; position: relative; overflow: visible; }
.chat-item .avatar .on { position: absolute; bottom: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--bg2); }
.chat-item .unread { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px;
  background-image: radial-gradient(color-mix(in srgb, var(--fg2) 12%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.msg { max-width: 70%; padding: 7px 11px; border-radius: 12px; background: var(--bg2); align-self: flex-start; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.08); word-wrap: break-word; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
.msg .who { font-size: .78em; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.msg .tm { font-size: .7em; color: var(--fg2); float: inline-end; margin-inline-start: 10px; margin-top: 6px; }
.msg .reacts { display: flex; gap: 3px; margin-top: 4px; }
.msg .reacts span { background: var(--bg); border-radius: 10px; padding: 0 6px; font-size: .85em; border: 1px solid var(--border); cursor: pointer; }
.msg img.att { max-width: 280px; max-height: 260px; border-radius: 8px; display: block; margin: 4px 0; cursor: pointer; }
.msg .file-att { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--bg); border-radius: 8px; margin: 4px 0; text-decoration: none; color: var(--fg); }
.msg .reply-q { border-inline-start: 3px solid var(--accent); padding: 2px 8px; font-size: .85em; color: var(--fg2); margin-bottom: 4px; background: var(--hover); border-radius: 4px; }
.msg:hover .msg-act { opacity: 1; }
.msg-act { position: absolute; top: -12px; inset-inline-end: 6px; opacity: 0; display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px; box-shadow: var(--shadow-sm); }
.msg-act button { border: 0; background: none; cursor: pointer; padding: 2px 5px; border-radius: 5px; }
.msg-act button:hover { background: var(--hover); }
.day-sep { align-self: center; background: var(--bg2); padding: 3px 12px; border-radius: 10px; font-size: .78em; color: var(--fg2); margin: 10px 0; }
.chat-input { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; max-height: 140px; min-height: 40px; border-radius: 20px; padding: 10px 16px; border: 1px solid var(--border); background: var(--input); outline: none; }
.emoji-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; font-size: 22px; }
.emoji-pick button { border: 0; background: none; cursor: pointer; border-radius: 6px; padding: 4px; }
.emoji-pick button:hover { background: var(--hover); }

/* ---------- browser ---------- */
.br-tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: var(--bg2); overflow-x: auto; flex: none; }
.br-tab { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px 8px 0 0; max-width: 220px; min-width: 120px; cursor: pointer; font-size: .88em; color: var(--fg2); }
.br-tab.active { background: var(--bg); color: var(--fg); }
.br-tab .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-bar { display: flex; gap: 4px; padding: 6px 8px; align-items: center; border-bottom: 1px solid var(--border); }
.br-bar .url { flex: 1; height: 34px; border-radius: 17px; padding: 0 14px; }
.br-body { flex: 1; position: relative; min-height: 0; display: flex; }
.br-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.br-home { position: absolute; inset: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 60px 20px; gap: 24px; background: var(--wallpaper); background-size: cover; }
.br-home .search { width: min(600px, 100%); height: 48px; border-radius: 24px; padding: 0 22px; font-size: 1.1em; box-shadow: var(--shadow); border: 0; }
.br-speed { display: grid; grid-template-columns: repeat(auto-fill, 100px); gap: 14px; justify-content: center; width: min(760px, 100%); }
.br-speed a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(20px); text-decoration: none; color: var(--fg); font-size: .85em; cursor: pointer; }
.br-speed a:hover { transform: translateY(-2px); }
.br-speed img { width: 32px; height: 32px; }

/* ---------- calculator ---------- */
.calc { display: flex; flex-direction: column; height: 100%; padding: 10px; gap: 8px; background: var(--bg2); direction: ltr; }
.calc .disp { text-align: right; padding: 10px; } .calc .disp .expr { color: var(--fg2); min-height: 20px; font-size: .95em; } .calc .disp .val { font-size: 40px; font-weight: 300; overflow: hidden; text-overflow: ellipsis; }
.calc .keys { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.calc .keys button { border: 0; border-radius: 8px; background: var(--bg); font-size: 18px; cursor: pointer; }
.calc .keys button:hover { background: var(--bg3); }
.calc .keys button.op { background: var(--bg3); } .calc .keys button.eq { background: var(--accent); color: #fff; }

/* ---------- calendar ---------- */
.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-grid .dh { padding: 8px; font-size: .85em; color: var(--fg2); border-bottom: 1px solid var(--border); text-align: center; }
.cal-cell { border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 6px; overflow: hidden; cursor: pointer; min-height: 80px; }
.cal-cell:hover { background: var(--hover); }
.cal-cell .n { font-size: .85em; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .n { background: var(--accent); color: #fff; font-weight: 700; }
.cal-cell.other { opacity: .45; }
.cal-ev { font-size: .78em; padding: 2px 6px; border-radius: 4px; color: #fff; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- monitor ---------- */
.mon-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mon-chart { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.mon-chart canvas { width: 100%; height: 140px; }
.gauge { width: 120px; height: 120px; position: relative; display: grid; place-items: center; }
.gauge svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.gauge b { font-size: 1.4em; }

/* ---------- storage ---------- */
.disk-bay { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.disk { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; position: relative; cursor: pointer; }
.disk.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.disk .led { position: absolute; top: 12px; inset-inline-end: 12px; }
.disk .slot { font-size: .75em; color: var(--fg2); text-transform: uppercase; letter-spacing: .05em; }
.raid-opt { border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.raid-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.raid-opt.disabled { opacity: .4; pointer-events: none; }

/* ---------- games ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 16px; }
.game { border-radius: 12px; overflow: hidden; background: var(--bg2); cursor: pointer; transition: transform .15s; border: 1px solid var(--border); }
.game:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.game .cv { aspect-ratio: 3/4; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.3em; text-align: center; padding: 10px; }
.game .gm { padding: 8px 10px; } .game .gm b { display: block; font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- screen recorder ---------- */
.rec-preview { flex: 1; background: #000; border-radius: 12px; display: grid; place-items: center; overflow: hidden; min-height: 200px; position: relative; }
.rec-preview video { max-width: 100%; max-height: 100%; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* file type icon wrapper must fill the thumbnail box */
.fs-thumb .ftype { display: grid; place-items: center; width: 100%; height: 100%; }
.fs-preview .pv .ftype { display: grid; place-items: center; }
.fs-grid .fs-item.sel .nm { color: var(--fg); }
