/* =====================================================================
   Azelela styles. Colours come from CSS variables set in js/themes.js
   ===================================================================== */
:root {
  --bg: #0b1020; --bg2: #10172b; --panel: #151d36; --panel2: #1c2645;
  --text: #e7ecff; --muted: #8d98bf; --border: #26315a;
  --accent: #7c8cff; --accent-rgb: 124,140,255; --accent-text: #fff;
  --panel-rgb: 21,29,54; --bg-rgb: 11,16,32;
  --font: 'Inter', system-ui, sans-serif; --font-scale: 1;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.28);
  --bg-image: none; --bg-dim: .45;
  --sidebar: 236px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: calc(15px * var(--font-scale)); line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
body.has-bg::before {
  content: ''; position: fixed; inset: 0; z-index: -2;
  background: var(--bg-image) center / cover no-repeat;
}
body.has-bg::after {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: rgba(var(--bg-rgb), var(--bg-dim));
}
body.has-bg { background: transparent; }
#app { height: 100%; }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
p { margin: 0 0 .75em; }
.ic { flex-shrink: 0; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .86em; }
.tiny { font-size: .75em; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.pad { padding: 6px 10px; }
.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.error-text { color: #f87171; }
::selection { background: rgba(var(--accent-rgb), .35); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--panel2); font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .05s, filter .15s;
}
.btn:hover { border-color: rgba(var(--accent-rgb), .6); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: #dc2626; color: #fff; border-color: transparent; }
.btn.sm { padding: 6px 11px; font-size: .88em; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text); transition: background .15s, color .15s; position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: rgba(var(--accent-rgb), .14); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.accent { background: var(--accent); color: var(--accent-text); }
.icon-btn:disabled { opacity: .4; }
.rep1 { position: absolute; font-size: 9px; font-weight: 800; right: 6px; bottom: 5px; }
.link-btn { background: none; border: 0; color: var(--accent); padding: 8px 0 0; font-size: .9em; }
.input {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.input.sm { padding: 6px 10px; width: auto; font-size: .9em; }
select.input { cursor: pointer; }
textarea.input { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .85em; font-weight: 600; color: var(--muted); }
.hint { font-size: .8em; color: var(--muted); }
.hint.good { color: #4ade80; }
.hint.bad { color: #f87171; }
.form-error { color: #f87171; font-size: .9em; min-height: 1.2em; margin-bottom: 10px; }
.range { width: 100%; accent-color: var(--accent); cursor: pointer; }
.color-input { width: 38px; height: 38px; border: 2px solid var(--border); border-radius: 50%; padding: 0; background: none; cursor: pointer; overflow: hidden; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.seg.sm button { padding: 5px 11px; font-size: .88em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-btn { border: 1px solid var(--border); background: var(--panel); padding: 6px 13px; border-radius: 999px; font-size: .88em; font-weight: 600; color: var(--muted); transition: all .15s; }
.chip-btn:hover { color: var(--text); }
.chip-btn.on { background: rgba(var(--accent-rgb), .18); border-color: var(--accent); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: rgba(var(--accent-rgb), .16); color: var(--text); font-size: .78em; font-weight: 600; border: 0; white-space: nowrap; }
.chip.sm { font-size: .72em; padding: 2px 8px; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9em; margin-bottom: 16px; border: 1px solid var(--border); background: var(--bg2); }
.notice.warn { border-color: rgba(250, 204, 21, .45); background: rgba(250, 204, 21, .08); }
.panel { background: rgba(var(--panel-rgb), .92); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { font-size: 1.05em; }
.panel h4 { font-size: .9em; color: var(--muted); margin-top: 16px; }

.avatar { border-radius: 50%; background: rgba(var(--accent-rgb), .25); color: var(--text); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.empty-title { font-weight: 700; color: var(--text); margin-bottom: 4px; font-size: 1.05em; }
.spinner-wrap { display: grid; place-items: center; padding: 40px; grid-column: 1 / -1; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#boot { height: 100%; display: grid; place-items: center; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--border); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; opacity: 0; transform: translateY(10px); transition: all .25s; max-width: 90vw; }
.toast.show { opacity: 1; transform: none; }
.toast.success { border-color: #22c55e; }
.toast.error { border-color: #ef4444; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9000; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; width: min(440px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s; }
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 0 20px; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 14px 20px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 18px; }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 14px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.toolbar .input { flex: 1; min-width: 160px; }
.toolbar select.input { flex: 0 0 auto; width: auto; }
.section-title { margin: 22px 0 12px; font-size: 1.05em; }
.list-label { padding: 10px 4px 6px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.card { background: rgba(var(--panel-rgb), .92); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; transition: transform .15s, border-color .15s, box-shadow .15s; outline: none; }
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), .7); box-shadow: var(--shadow); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

/* =====================================================================
   Onboarding
   ===================================================================== */
.onboard { height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 40px 16px; background: radial-gradient(1200px 600px at 50% -10%, rgba(var(--accent-rgb), .22), transparent 60%); }
.ob-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3em; margin-bottom: 24px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .55)); color: var(--accent-text); font-weight: 800; flex-shrink: 0; }
.brand-icon { width: 40px; height: 40px; image-rendering: pixelated; }
.start-icon { width: 32px; height: 32px; image-rendering: pixelated; filter: drop-shadow(0 0 1px rgba(255,255,255,.35)); }
.logo-mark.sm { width: 28px; height: 28px; border-radius: 8px; font-size: .9em; }
.ob-card { width: min(420px, 100%); background: rgba(var(--panel-rgb), .95); border: 1px solid var(--border); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.ob-card.wide { width: min(640px, 100%); }
.ob-card h1 { font-size: 1.55em; margin-bottom: 18px; }
.ob-sub { font-size: .95em; margin: 20px 0 10px; color: var(--muted); }
.ob-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.ob-dots span { height: 6px; width: 22px; border-radius: 6px; background: var(--border); }
.ob-dots span.on { background: var(--accent); width: 38px; }
.ob-dots span.done { background: rgba(var(--accent-rgb), .5); }
.ob-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.theme-swatch { border: 2px solid var(--border); border-radius: 12px; padding: 6px; background: var(--bg2); display: flex; flex-direction: column; gap: 6px; font-size: .85em; font-weight: 600; transition: border-color .15s; }
.theme-swatch.on { border-color: var(--accent); }
.theme-swatch .sw { height: 52px; border-radius: 8px; position: relative; overflow: hidden; }
.theme-swatch .sw i:first-child { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 18px; border-radius: 5px; }
.theme-swatch .sw i:last-child { position: absolute; left: 8px; top: 8px; width: 22px; height: 10px; border-radius: 5px; }
.accent-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.accent-dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; outline: 2px solid transparent; transition: transform .1s; }
.accent-dot:hover { transform: scale(1.08); }
.accent-dot.on { outline-color: var(--text); border-color: var(--panel); }
.accent-dot.def { background: var(--panel2); font-weight: 800; font-size: .8em; border-color: var(--border); }
.layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.layout-card { border: 2px solid var(--border); background: var(--bg2); border-radius: 14px; padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s; }
.layout-card.on { border-color: var(--accent); }
.mock { height: 120px; border-radius: 9px; background: var(--bg); margin-bottom: 8px; position: relative; overflow: hidden; border: 1px solid var(--border); }
.mb-side { position: absolute; left: 0; top: 0; bottom: 0; width: 26%; background: var(--panel); }
.mb-main { position: absolute; left: 30%; right: 6%; top: 14%; bottom: 10%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mb-main i { background: var(--panel2); border-radius: 5px; }
.md-icons { position: absolute; left: 6%; top: 10%; display: flex; flex-direction: column; gap: 6px; }
.md-icons i { width: 16px; height: 16px; border-radius: 4px; background: rgba(var(--accent-rgb), .6); }
.md-win { position: absolute; left: 26%; top: 12%; width: 60%; height: 58%; border-radius: 6px; background: var(--panel2); border-top: 8px solid var(--panel); }
.md-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--panel); }

/* =====================================================================
   Browser layout (tabs + address bar + icon rail)
   ===================================================================== */
.shell.browser { display: flex; height: 100%; background: color-mix(in srgb, var(--bg) 70%, #000); }
[data-light="1"] .shell.browser { background: var(--bg2); }
body.has-bg .shell.browser { background: transparent; }
.rail { width: 52px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-right: 1px solid var(--border); }
.rail-apps { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.rail-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; transition: background .15s, color .15s; }
.rail-btn:hover { color: var(--text); background: rgba(var(--accent-rgb), .1); }
.rail-btn.active { color: var(--accent); background: rgba(var(--accent-rgb), .16); }
.chrome { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tabstrip { display: flex; align-items: center; gap: 4px; padding: 6px 8px 0; min-height: 40px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px 0 10px; border-radius: 8px; color: var(--muted); font-size: .86em; font-weight: 600; cursor: pointer; flex-shrink: 0; max-width: 200px; user-select: none; transition: background .15s, color .15s; }
.tab:hover { background: rgba(var(--accent-rgb), .08); color: var(--text); }
.tab.active { background: var(--accent); color: var(--accent-text); }
.tab-icon { display: grid; }
.tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-close { width: 20px; height: 20px; border: 0; background: transparent; border-radius: 5px; display: grid; place-items: center; color: inherit; opacity: .55; }
.tab-close:hover { opacity: 1; background: rgba(0,0,0,.18); }
.tab:not(.active):not(:hover) .tab-close { opacity: 0; }
.tab-new { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.tab-new:hover { color: var(--text); background: rgba(var(--accent-rgb), .1); }
.toolbar-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; }
.tb-btn { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 9px; display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.tb-btn:hover:not(:disabled) { color: var(--text); background: rgba(var(--accent-rgb), .1); }
.tb-btn:disabled { opacity: .35; cursor: default; }
.tb-btn.flip .ic { transform: scaleX(-1); }
.address { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(var(--panel-rgb), .9); border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s; cursor: text; }
.address:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.addr-lock { color: #4ade80; display: grid; }
.address-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: .92em; font-weight: 500; }
.music-pill { display: flex; align-items: center; gap: 2px; height: 36px; padding: 0 6px 0 10px; border-radius: 10px; background: rgba(var(--panel-rgb), .9); border: 1px solid var(--border); max-width: 300px; flex-shrink: 0; }
.pill-info { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); font-size: .84em; min-width: 0; padding: 0 8px 0 0; }
.pill-info:hover { color: var(--text); }
.pill-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.pill-btn { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 7px; display: grid; place-items: center; color: var(--text); }
.pill-btn:hover { background: rgba(var(--accent-rgb), .15); }
.browser-content { flex: 1; min-height: 0; margin: 0 8px 8px 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; position: relative;
  background-color: rgba(var(--bg-rgb), .92);
  background-image: radial-gradient(rgba(255,255,255,.075) 1px, transparent 1.2px); background-size: 22px 22px; }
[data-light="1"] .browser-content { background-image: radial-gradient(rgba(0,0,0,.09) 1px, transparent 1.2px); }
.tab-pane { position: absolute; inset: 0; }
.tab-pane[hidden] { display: none; }
.tab-pane > .app-view { position: absolute; inset: 0; overflow: auto; padding: 22px 24px 40px; }

/* mini player (desktop dock) */
.bar-mini { display: flex; align-items: center; gap: 4px; position: relative; background: rgba(var(--panel-rgb), .7); border: 1px solid var(--border); border-radius: 12px; padding: 3px 5px 5px; max-width: 250px; overflow: hidden; }
.mini-info { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0 6px 0 0; min-width: 0; text-align: left; flex: 1; }
.mini-info img, .mini-art { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; background: rgba(var(--accent-rgb), .2); }
.mini-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.mini-text b, .mini-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82em; }
.mini-text span { color: var(--muted); font-size: .74em; }
.mini-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--border); }
.mini-progress i { display: block; height: 100%; background: var(--accent); }

/* =====================================================================
   Desktop layout
   ===================================================================== */
.app-tile { display: grid; place-items: center; color: #fff; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 12px rgba(0,0,0,.3); }
.shell.desktop { position: relative; height: 100%; overflow: hidden; background: color-mix(in srgb, var(--bg) 25%, #000); }
[data-light="1"] .shell.desktop { background: var(--bg2); }
body.has-bg .shell.desktop { background: none; }
.desk-logo { position: absolute; left: 50%; top: 46%; width: min(560px, 46vw); transform: translate(-50%, -50%); pointer-events: none; opacity: .95; filter: drop-shadow(0 10px 40px rgba(255,255,255,.08)); }
[data-light="1"] .desk-logo { filter: drop-shadow(0 6px 20px rgba(0,0,0,.25)) invert(.85); }
body.has-bg .desk-logo { display: none; }
.desk-icons { position: absolute; top: 18px; left: 18px; bottom: 96px; display: grid; grid-template-columns: repeat(2, 94px); grid-auto-rows: 98px; gap: 0; align-content: start; z-index: 1; }
.desk-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; background: none; border-radius: 14px; color: #fff; padding: 4px; }
[data-light="1"] .desk-icon { color: var(--text); }
.desk-icon:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.08); }
.di-label { font-size: .8em; font-weight: 500; text-shadow: 0 1px 3px rgba(0,0,0,.6); white-space: nowrap; }
[data-light="1"] .di-label { text-shadow: none; }
.desk-widgets { position: absolute; top: 34px; right: 52px; width: 250px; z-index: 1; color: #fff; }
[data-light="1"] .desk-widgets { color: var(--text); }
.w-time { font-size: 70px; font-weight: 200; line-height: 1; letter-spacing: -.02em; }
.w-date { margin-top: 14px; font-size: .78em; letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.w-head { margin: 56px 0 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.18); font-size: .68em; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; }
[data-light="1"] .w-head { border-color: var(--border); }
.wx-main { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.wx-icon { font-size: 38px; line-height: 1; }
.wx-temp { font-size: 42px; font-weight: 300; }
.wx-sub { font-size: .8em; opacity: .85; margin-top: 6px; }
.wx-btn { margin-top: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: inherit; padding: 5px 12px; border-radius: 8px; font-size: .8em; font-weight: 600; }
.wx-btn:hover { background: rgba(255,255,255,.12); }
.sys-row { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; font-size: .7em; letter-spacing: .14em; text-transform: uppercase; padding: 4px 0; }
.sys-bar { height: 2px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
[data-light="1"] .sys-bar { background: var(--border); }
.sys-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s; }
.sys-val { letter-spacing: .02em; text-transform: none; font-size: 1.12em; text-align: right; white-space: nowrap; }
.win-layer { position: absolute; inset: 0 0 86px 0; z-index: 2; pointer-events: none; }
.win { position: absolute; display: flex; flex-direction: column; background: rgba(var(--panel-rgb), .97); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.5); overflow: hidden; resize: both; min-width: 320px; min-height: 220px; pointer-events: auto; animation: winIn .16s ease-out; }
@keyframes winIn { from { transform: scale(.97); opacity: 0; } }
.win.focused { border-color: rgba(var(--accent-rgb), .55); }
.win.minimised { display: none; }
.win.maxed { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
.win-head { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; background: var(--panel2); border-bottom: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none; flex-shrink: 0; }
.win-head:active { cursor: grabbing; }
.win-icon { color: var(--accent); display: grid; }
.win-title { flex: 1; font-weight: 600; font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-btns { display: flex; gap: 2px; }
.win-btns button { width: 30px; height: 28px; border: 0; background: transparent; border-radius: 7px; display: grid; place-items: center; }
.win-btns button:hover { background: rgba(var(--accent-rgb), .18); }
.win-btns button.close:hover { background: #e11d48; color: #fff; }
.win-body { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.win-body > .app-view { position: absolute; inset: 0; overflow: auto; padding: 18px; }
.frame-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
body.dragging iframe { pointer-events: none; }
body.dragging { user-select: none; }

/* dock */
.dock { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: calc(100% - 24px); height: 58px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: rgba(18, 18, 22, .82); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; backdrop-filter: blur(18px); box-shadow: 0 12px 40px rgba(0,0,0,.45); z-index: 1000; color: #fff; }
[data-light="1"] .dock { background: rgba(255,255,255,.85); border-color: var(--border); color: var(--text); }
.start-btn { width: 42px; height: 42px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.start-btn:hover { background: rgba(255,255,255,.08); }
.start-mark { font-size: 24px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dock-search { position: relative; display: flex; align-items: center; gap: 8px; width: 230px; height: 36px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.65); flex-shrink: 1; min-width: 120px; }
[data-light="1"] .dock-search { background: var(--bg2); border-color: var(--border); color: var(--muted); }
.dock-search:focus-within { border-color: var(--accent); }
.dock-search-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: inherit; font-size: .86em; }
.dock-results { position: absolute; left: 0; bottom: calc(100% + 14px); width: 320px; background: rgba(var(--panel-rgb), .98); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); color: var(--text); }
.res-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: 9px; text-align: left; font-weight: 600; font-size: .9em; }
.res-item:hover, .res-item:first-child { background: rgba(var(--accent-rgb), .14); }
.res-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-sub { font-size: .75em; color: var(--muted); }
.res-web { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--panel2); }
.dock-pinned, .dock-tasks { display: flex; align-items: center; gap: 4px; }
.dock-tasks:not(:empty) { padding-left: 8px; border-left: 1px solid rgba(255,255,255,.12); }
.dock-app { position: relative; width: 44px; height: 46px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; transition: transform .15s; }
.dock-app:hover { transform: translateY(-3px); }
.dock-app.running::after { content: ''; position: absolute; bottom: 1px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .6; }
.dock-app.active::after { width: 14px; margin-left: -7px; border-radius: 3px; opacity: 1; background: var(--accent); }
.dock-clock { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); text-align: right; line-height: 1.2; flex-shrink: 0; }
[data-light="1"] .dock-clock, [data-light="1"] .dock-tasks:not(:empty) { border-color: var(--border); }
.dock-time { font-size: .86em; font-weight: 700; white-space: nowrap; }
.dock-date { font-size: .72em; opacity: .7; }
.start-menu { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); width: 360px; max-height: calc(100% - 110px); overflow: auto; background: rgba(var(--panel-rgb), .97); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; z-index: 1001; display: none; backdrop-filter: blur(14px); }
.start-menu.open { display: block; animation: fade .15s; }
.sm-user { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sm-apps { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sm-app, .sm-logout { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; text-align: left; font-size: .9em; }
.sm-app:hover, .sm-logout:hover { background: rgba(var(--accent-rgb), .14); }
.sm-logout { width: 100%; margin-top: 8px; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; padding-top: 12px; color: var(--muted); }

/* YouTube dock (official player stays visible) */
#yt-dock { position: fixed; right: 16px; bottom: 16px; width: 320px; z-index: 1500; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
body.layout-desktop #yt-dock { bottom: 84px; }
body:not(.layout-desktop) #yt-dock { bottom: 20px; right: 20px; }
.yt-dock-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; background: var(--panel2); }
.yt-dock-title { flex: 1; font-size: .8em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-dock-body { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yt-dock-body iframe, #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* =====================================================================
   Apps
   ===================================================================== */
/* home */
.home2 { max-width: 760px; margin: 0 auto; padding: 6vh 0 30px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.glow-logo { font-size: clamp(56px, 9vw, 104px); font-weight: 800; letter-spacing: -.045em; line-height: 1; margin: 0 0 34px; padding: 0 .1em .08em;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, #fff), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 28px rgba(var(--accent-rgb), .55)) drop-shadow(0 0 70px rgba(var(--accent-rgb), .3)); }
.home-search { position: relative; width: min(670px, 100%); display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 18px; border-radius: 14px; background: rgba(var(--panel-rgb), .95); border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s; }
.home-search:focus-within { border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.hs-ic { color: var(--muted); display: grid; }
.home-search-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 1.02em; }
.hs-go { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.hs-go .ic { transform: scaleX(-1); }
.home-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: rgba(var(--panel-rgb), .98); border: 1px solid var(--border); border-radius: 14px; padding: 6px; z-index: 20; box-shadow: var(--shadow); text-align: left; }
.sugg-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 9px; font-weight: 600; }
.sugg-item:hover, .sugg-item:first-child { background: rgba(var(--accent-rgb), .12); }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 38px; }
.quick-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; font-size: .9em; font-weight: 500; }
.quick-ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: rgba(var(--panel-rgb), .95); border: 1px solid var(--border); transition: border-color .15s, transform .15s, color .15s; }
.quick-btn:hover .quick-ic { border-color: rgba(var(--accent-rgb), .7); color: var(--accent); transform: translateY(-2px); }
.online-pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 30px; padding: 8px 14px; border-radius: 10px; background: rgba(var(--panel-rgb), .95); border: 1px solid var(--border); font-size: .86em; font-weight: 500; }
.online-pill b { font-weight: 700; }
.clock-card { margin-top: 26px; width: 220px; padding: 50px 16px; border-radius: 16px; background: rgba(var(--panel-rgb), .95); border: 1px solid var(--border); }
.clock-time { font-size: 2.6em; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.clock-date { font-size: .82em; color: var(--muted); margin-top: 8px; }
.home-recent { margin-top: 26px; width: 100%; }
.recent-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.recent-game { width: 110px; border: 1px solid var(--border); background: rgba(var(--panel-rgb), .95); border-radius: 12px; overflow: hidden; padding: 0 0 6px; font-size: .8em; font-weight: 600; transition: border-color .15s, transform .15s; }
.recent-game:hover { border-color: rgba(var(--accent-rgb), .7); transform: translateY(-2px); }
.recent-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 5px; font-size: 1.1em !important; }
.recent-game span { padding: 0 6px; }
.all-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.all-app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border: 0; background: transparent; border-radius: 12px; font-weight: 600; font-size: .86em; }
.all-app:hover { background: rgba(var(--accent-rgb), .1); }

/* games */
.games-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.game-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg2); }
.game-cover.gen, .gs-cover.gen, .pick-cover.gen { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.6em; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.fav { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 16px; opacity: 0; transition: opacity .15s; }
.game-card:hover .fav, .fav.on { opacity: 1; }
.fav.on { color: #facc15; }
.game-player { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.tab-pane > .app-view:has(.game-player), .tab-pane > .app-view:has(.viewer), .tab-pane > .app-music, .tab-pane > .app-chat, .tab-pane > .app-ai { display: flex; flex-direction: column; }
.gp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gp-title { font-size: 1.05em; }
.game-frame { flex: 1; width: 100%; min-height: 360px; border: 0; border-radius: var(--radius); background: #000; }

/* viewers (pdf / books / tv) */
.viewer { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; flex: 1; }
.viewer-frame { flex: 1; width: 100%; min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.tv-frame-wrap { flex: 1; display: grid; place-items: center; min-height: 0; }
.tv-frame { width: 100%; max-height: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: #000; }

/* videos */
.video-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.vid-thumb-wrap { position: relative; }
.vid-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg2); }
.vid-thumb.ph { display: grid; place-items: center; color: var(--muted); }
.vid-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.4); }
.vid-prog i { display: block; height: 100%; background: var(--accent); }
.video-page { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
.video-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.video-box { background: #000; border-radius: var(--radius); overflow: hidden; }
.video-el { width: 100%; max-height: 72vh; display: block; background: #000; }
.video-side { display: flex; flex-direction: column; gap: 8px; max-height: 80vh; overflow: auto; }
.side-vid { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; cursor: pointer; padding: 6px; border-radius: 10px; font-size: .88em; font-weight: 600; }
.side-vid:hover { background: rgba(var(--accent-rgb), .1); }
.side-vid .vid-thumb { border-radius: 8px; }

/* pdfs & books */
.pdf-grid, .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pdf-cover, .book-cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--bg2); }
.pdf-cover.ph { display: grid; place-items: center; color: var(--accent); }
.book-cover.ph { display: grid; place-items: center; padding: 14px; text-align: center; font-weight: 700; background: linear-gradient(160deg, rgba(var(--accent-rgb), .35), var(--panel2)); font-size: .9em; }
.card-del { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; }

/* tv */
.tv-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 6px; }
.tv-logo { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), .25), var(--panel2)); font-size: 1.05em; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.7); animation: pulse 1.6s infinite; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }

/* music */
.music-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; flex: 1; min-height: 0; height: 100%; }
.music-left { display: flex; flex-direction: column; min-height: 0; }
.music-list { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
.music-list > .row .input { flex: 1; }
.tracks { overflow: auto; flex: 1; min-height: 200px; display: flex; flex-direction: column; gap: 2px; }
.track { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.track:hover { background: rgba(var(--accent-rgb), .1); }
.track.active { background: rgba(var(--accent-rgb), .18); }
.track.active b { color: var(--accent); }
.track-art { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg2); }
.track-art.ph { display: grid; place-items: center; color: var(--muted); }
.track-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.track-text b, .track-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-text span { color: var(--muted); font-size: .85em; }
.track-num { color: var(--muted); font-size: .85em; width: 24px; text-align: right; }
.music-now { background: rgba(var(--panel-rgb), .92); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.now-art { width: 150px; height: 150px; border-radius: 14px; overflow: hidden; align-self: center; display: grid; place-items: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), .35), var(--panel2)); color: var(--text); flex-shrink: 0; }
.now-art img { width: 100%; height: 100%; object-fit: cover; }
.now-meta { text-align: center; display: flex; flex-direction: column; min-width: 0; }
.now-meta b, .now-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seek-row, .vol-row { display: flex; align-items: center; gap: 8px; }
.now-ctrls { display: flex; align-items: center; justify-content: center; gap: 6px; }
.play-big { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; transition: transform .1s; }
.play-big:hover { transform: scale(1.05); }
.music-now .seg { margin: 4px 0 0; align-self: center; }
.lyrics { flex: 1; overflow: auto; min-height: 120px; padding: 6px 4px; scroll-behavior: smooth; mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); }
.lyrics.queue { mask-image: none; }
.lline { margin: 0; padding: 5px 6px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .2s, transform .2s; font-size: 1.02em; }
.lline:hover { background: rgba(var(--accent-rgb), .08); }
.lline.on { color: var(--text); transform: scale(1.03); transform-origin: left; }
.lline.plain { cursor: default; font-weight: 500; }

/* ai */
.ai-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; max-width: 860px; width: 100%; margin: 0 auto; gap: 10px; flex: 1; }
.ai-top { padding-bottom: 6px; }
.ai-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 4px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble { max-width: 82%; padding: 11px 15px; border-radius: 16px; background: rgba(var(--panel-rgb), .95); border: 1px solid var(--border); overflow-wrap: anywhere; }
.ai-msg.user .ai-bubble { background: var(--accent); color: var(--accent-text); border-color: transparent; border-bottom-right-radius: 5px; }
.ai-msg.assistant .ai-bubble { border-bottom-left-radius: 5px; }
.ai-bubble pre { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow: auto; margin: 8px 0; }
.ai-bubble code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .88em; }
.ai-bubble :not(pre) > code { background: rgba(var(--accent-rgb), .15); padding: 1px 5px; border-radius: 5px; }
.ai-bubble h4 { margin: 8px 0 4px; }
.ai-compose { display: flex; gap: 10px; align-items: flex-end; }
.ai-input { resize: none; max-height: 160px; }
.ai-empty { margin: auto; text-align: center; padding: 30px 10px; }
.ai-orb { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), .9), rgba(var(--accent-rgb), .3)); color: var(--accent-text); box-shadow: 0 0 40px rgba(var(--accent-rgb), .45); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

/* chat */
.share-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: rgba(var(--accent-rgb), .15); border: 1px solid rgba(var(--accent-rgb), .5); flex-wrap: wrap; }
.chat-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; flex: 1; min-height: 0; height: 100%; }
.chat-rooms { display: flex; flex-direction: column; gap: 8px; min-height: 0; background: rgba(var(--panel-rgb), .92); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.room-list { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.room { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; border: 0; background: transparent; text-align: left; font-weight: 600; color: var(--muted); min-width: 0; }
.room:hover { background: rgba(var(--accent-rgb), .1); color: var(--text); }
.room.on { background: rgba(var(--accent-rgb), .2); color: var(--text); }
.chat-pane { display: flex; flex-direction: column; min-height: 0; background: rgba(var(--panel-rgb), .92); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); min-height: 54px; }
.back-rooms { display: none; }
.code-chip { cursor: pointer; font-family: ui-monospace, monospace; letter-spacing: .08em; }
.msg-list { flex: 1; overflow: auto; padding: 12px 6px; min-height: 0; }
.msg { display: flex; gap: 10px; padding: 6px 10px; border-radius: 10px; position: relative; }
.msg:hover { background: rgba(var(--accent-rgb), .06); }
.msg.grouped { padding-top: 1px; }
.msg-gutter { width: 36px; flex-shrink: 0; }
.msg-av { border: 0; background: none; padding: 0; height: fit-content; }
.msg-main { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-name { border: 0; background: none; padding: 0; font-weight: 700; }
.msg-name:hover { text-decoration: underline; }
.msg.mine .msg-name { color: var(--accent); }
.msg-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-del { position: absolute; right: 6px; top: 4px; opacity: 0; }
.msg:hover .msg-del { opacity: 1; }
.game-share { display: flex; align-items: center; gap: 12px; padding: 8px; margin-top: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg2); max-width: 380px; }
.gs-cover { width: 84px; height: 54px; border-radius: 8px; object-fit: cover; flex-shrink: 0; font-size: 1em !important; }
.gs-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; margin-top: 10px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; background: transparent; border-radius: 9px; text-align: left; font-weight: 600; min-width: 0; }
.pick-item:hover { background: rgba(var(--accent-rgb), .12); }
.pick-cover { width: 56px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; font-size: .8em !important; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-family: ui-monospace, monospace; font-size: 1.3em; text-align: center; }

/* profile */
.pf-page { max-width: 760px; }
.pf-card { background: rgba(var(--panel-rgb), .95); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; padding-bottom: 16px; }
.modal .pf-card { margin: -4px -6px 0; border: 0; background: transparent; }
.pf-banner { height: 150px; background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .25)) center / cover; position: relative; }
.pf-card.big .pf-banner { height: 190px; }
.pf-banner-btn { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff; border-color: transparent; }
.pf-head { display: flex; align-items: flex-end; gap: 16px; padding: 0 20px; margin-top: -42px; position: relative; }
.pf-head .avatar { border: 4px solid var(--panel); }
.pf-names { padding-bottom: 6px; min-width: 0; }
.pf-names h2 { margin: 0; overflow-wrap: anywhere; }
.pf-bio { padding: 12px 20px 0; margin: 0; white-space: pre-wrap; }
.pf-joined { padding: 8px 20px 0; }
.pf-avatar-btn { border: 0; background: none; padding: 0; position: relative; border-radius: 50%; }
.pf-avatar-edit { position: absolute; inset: 4px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.pf-avatar-btn:hover .pf-avatar-edit { opacity: 1; }

/* settings */
.settings-page { max-width: 820px; }
.font-preview { margin-top: 12px; font-size: 1.1em; }
.bg-preview { height: 140px; border-radius: 12px; background: center / cover; margin-bottom: 12px; border: 1px solid var(--border); }
.settings-page .row .input { flex: 1; min-width: 200px; }
.settings-page .row { margin-bottom: 10px; }
.layout-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 26px; border: 2px solid var(--border); border-radius: 14px; background: var(--bg2); font-weight: 600; }
.layout-pick.on { border-color: var(--accent); color: var(--accent); }

/* ---------- windows: let full-height apps fill ---------- */
.win-body > .app-music, .win-body > .app-chat, .win-body > .app-ai, .win-body > .app-view:has(.viewer), .win-body > .app-view:has(.game-player) { display: flex; flex-direction: column; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1000px) {
  .music-layout { grid-template-columns: 1fr; height: auto; }
  .tab-pane > .app-music { display: block; }
  .music-now { order: -1; max-height: none; }
  .lyrics { max-height: 320px; }
  .video-page { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .desk-widgets { display: none; }
}
@media (max-width: 760px) {
  .rail { width: 44px; }
  .rail-btn { width: 34px; height: 34px; }
  .toolbar-row { gap: 2px; padding: 4px 6px 6px; }
  .tb-btn.flip, .tb-btn[title="Reload"], .tb-btn[title="Fullscreen"] { display: none; }
  .music-pill .pill-text { display: none; }
  .browser-content { margin: 0 6px 6px 0; }
  .tab-pane > .app-view { padding: 16px 12px 40px; }
  .home2 { padding-top: 3vh; }
  .quick { gap: 14px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.in-room .chat-rooms { display: none; }
  .chat-layout:not(.in-room) .chat-pane { display: none; }
  .back-rooms { display: inline-grid; }
  .layout-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .desk-icons { grid-template-columns: repeat(2, 80px); grid-auto-rows: 86px; }
  .desk-logo { width: 80vw; }
  .dock { gap: 4px; padding: 0 6px; }
  .dock-search, .dock-clock, .bar-mini .mini-text { display: none; }
  .dock-app { width: 38px; }
  #yt-dock { width: 240px; right: 10px; bottom: 10px; }
  .ob-card { padding: 22px; }
}

/* web (proxy) */
.app-view.app-web-page { padding: 0 !important; display: flex; flex-direction: column; overflow: hidden; }
.web-page { flex: 1; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.web-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--panel2); }
.web-url { flex: 1; width: auto; min-width: 0; }
.icon-btn.flip .ic { transform: scaleX(-1); }
.web-frame-wrap { flex: 1; position: relative; min-height: 0; background: #fff; }
.web-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.web-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--bg); color: var(--text); }
.web-start h2 { margin: 6px 0 22px; font-size: 1.6em; }
.web-globe { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #818cf8, #3b48d6); box-shadow: 0 10px 40px rgba(59, 72, 214, .45); }
.web-status { margin-top: 16px; max-width: 460px; }
