/* ==========================================================================
   NOVA OS — desktop shell styles (index.html)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;500;700&display=swap');

:root {
  --glass: rgba(16, 16, 20, 0.58);
  --glass-strong: rgba(20, 20, 26, 0.86);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --txt: #f3f4f8;
  --dim: rgba(243, 244, 248, 0.64);
  --faint: rgba(243, 244, 248, 0.4);
  --dock-h: 76px;
  --font-os: 'Outfit', 'Chakra Petch', system-ui, sans-serif;
}

body.os { height: 100vh; height: 100dvh; overflow: hidden; background: #050507; color: var(--txt); font-family: var(--font-ui); }
body.os .bg-vignette { background: radial-gradient(ellipse at 50% 30%, transparent 30%, rgba(0,0,0,.55) 100%); }

/* ---------- Shared glass ---------- */
.os-glass {
  background: linear-gradient(160deg, rgba(40,40,48,.55), rgba(14,14,18,.62));
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05);
}
.os-label { font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--faint); }

/* ---------- Home ---------- */
.os-home {
  position: absolute; inset: 0 0 var(--dock-h) 0; overflow-y: auto; overflow-x: hidden;
  padding: clamp(16px, 4vh, 48px) 16px 32px; scrollbar-width: thin;
}
.os-home-inner { width: min(1180px, 100%); margin: 0 auto; }
.os-day {
  font-family: var(--font-os); font-weight: 200; line-height: .9; letter-spacing: .14em;
  font-size: clamp(64px, 13vw, 190px); color: rgba(255,255,255,.86); user-select: none;
  text-shadow: -3px 0 rgba(255,60,90,.35), 3px 0 rgba(60,200,255,.35), 0 0 60px rgba(255,255,255,.08);
  margin: 0 0 4px -0.06em; white-space: nowrap; overflow: hidden; text-overflow: clip;
  animation: day-in 1s var(--ease-out);
}
@keyframes day-in { from { opacity: 0; letter-spacing: .4em; filter: blur(8px); } }
.os-date { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: clamp(18px, 4vh, 36px); color: var(--dim); font-family: var(--font-os); font-weight: 300; font-size: clamp(18px, 2.2vw, 24px); }
.os-date b { font-weight: 500; color: var(--txt); }
.os-greet { color: var(--faint); font-size: 16px; }

.widgets { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.wg { grid-column: span 4; border-radius: 24px; padding: 20px; min-width: 0; position: relative; overflow: hidden; animation: wg-in .6s var(--ease-out) backwards; }
.wg.span-6 { grid-column: span 6; } .wg.span-8 { grid-column: span 8; } .wg.span-12 { grid-column: span 12; }
.wg:nth-child(2) { animation-delay: .05s } .wg:nth-child(3) { animation-delay: .1s } .wg:nth-child(4) { animation-delay: .15s } .wg:nth-child(5) { animation-delay: .2s } .wg:nth-child(6) { animation-delay: .25s } .wg:nth-child(7) { animation-delay: .3s }
@keyframes wg-in { from { opacity: 0; transform: translateY(16px); } }
.wg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.wg-row {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 4px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 18px;
  transition: background .2s;
}
.wg-row:hover { background: rgba(255,255,255,.04); }
.wg-ico { width: 72px; height: 72px; border-radius: 18px; flex: none; overflow: hidden; background: #111; display: grid; place-items: center; box-shadow: 0 8px 24px -8px rgba(0,0,0,.8); }
.wg-ico img, .wg-ico canvas { width: 100%; height: 100%; object-fit: cover; }
.wg-ico svg { width: 34px; height: 34px; color: #fff; }
.wg-title { font-family: var(--font-os); font-weight: 500; font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-sub { color: var(--dim); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-meta { min-width: 0; flex: 1; }
.wg-chev { color: var(--faint); width: 22px; height: 22px; flex: none; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-2)); box-shadow: 0 0 16px var(--primary-glow); transition: width .8s var(--ease-out); }
.bar.gold > i { background: linear-gradient(90deg, #f59e0b, #fcd34d); box-shadow: 0 0 16px rgba(251,191,36,.5); }
.wg-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill.hot { color: #fdba74; border-color: rgba(251,146,60,.35); background: rgba(251,146,60,.1); }
.pill.ok { color: #6ee7b7; border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.mini {
  position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16/11; border: 1px solid var(--line); background: #0c0c12; cursor: pointer; padding: 0; color: #fff;
  transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s;
}
.mini:hover { transform: translateY(-3px) scale(1.02); border-color: var(--line-strong); box-shadow: 0 16px 30px -14px rgba(0,0,0,.9); }
.mini img, .mini canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 13px; font-weight: 700; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.85)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.viz { display: flex; align-items: flex-end; gap: 3px; height: 36px; }
.viz i { flex: 1; background: linear-gradient(to top, var(--primary), var(--primary-2)); border-radius: 3px 3px 0 0; min-height: 3px; transition: height .08s linear; opacity: .85; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 10px; z-index: 900;
  height: calc(var(--dock-h) - 18px); max-width: calc(100vw - 16px);
  display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 22px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock-sep { width: 1px; height: 30px; background: var(--line-strong); margin: 0 6px; flex: none; }
.dk {
  position: relative; width: 46px; height: 46px; flex: none; border: 0; border-radius: 13px; padding: 0; cursor: pointer; color: #fff;
  display: grid; place-items: center; background: transparent; transition: transform .25s var(--ease-spring);
}
.dk:hover { transform: translateY(-5px) scale(1.12); }
.dk:active { transform: scale(.92); }
.dk .app-ico { width: 42px; height: 42px; }
.dk::after { content: ''; position: absolute; bottom: -6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .2s; }
.dk.is-open::after { opacity: .85; }
.dk.is-active::after { background: var(--primary-2); opacity: 1; box-shadow: 0 0 8px var(--primary-2); }
.dk-tip {
  position: fixed; z-index: 1001; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; pointer-events: none;
  background: rgba(10,10,14,.92); border: 1px solid var(--line-strong); transform: translate(-50%, -100%); white-space: nowrap; opacity: 0; transition: opacity .15s;
}
.dk-tip.is-on { opacity: 1; }
.dk-start .app-ico { background: conic-gradient(from 210deg, #2563eb, #60a5fa, #1d4ed8, #3b82f6) !important; }
.fps { flex: none; height: 40px; padding: 0 14px; border-radius: 12px; display: flex; align-items: center; gap: 6px; font-family: var(--font-os); font-weight: 500; font-size: 18px; border: 1px solid var(--line-strong); background: rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
.fps small { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--dim); }
.dk-clock { flex: none; padding: 0 8px 0 4px; text-align: right; line-height: 1.1; font-family: var(--font-os); }
.dk-clock b { display: block; font-weight: 500; font-size: 16px; }
.dk-clock span { font-size: 12px; color: var(--dim); }
.dk-thumb { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; background: #111; border: 1px solid var(--line-strong); }
.dk-thumb img, .dk-thumb canvas { width: 100%; height: 100%; object-fit: cover; }

/* App icons */
.app-ico {
  width: 56px; height: 56px; border-radius: 26%; display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px -6px rgba(0,0,0,.8);
}
.app-ico svg { width: 52%; height: 52%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.app-ico.av { font-family: var(--font-os); font-weight: 700; font-size: 20px; }

/* ---------- Windows ---------- */
.win-layer { position: absolute; inset: 0 0 var(--dock-h) 0; pointer-events: none; z-index: 100; }
.win {
  position: absolute; display: flex; flex-direction: column; pointer-events: auto; min-width: 300px; min-height: 220px;
  border-radius: 18px; overflow: hidden; background: var(--glass-strong); border: 1px solid var(--line-strong);
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.4);
  animation: win-in .32s var(--ease-spring);
  transition: box-shadow .2s;
}
.win.is-focus { box-shadow: 0 40px 120px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(0,0,0,.4), 0 0 60px -20px var(--primary-glow); border-color: rgba(255,255,255,.22); }
.win.is-closing { animation: win-out .18s var(--ease-out) forwards; }
.win.is-min { display: none; }
.win.is-max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border-width: 0 0 1px; }
.win.anim { transition: left .28s var(--ease-out), top .28s var(--ease-out), width .28s var(--ease-out), height .28s var(--ease-out), border-radius .28s; }
@keyframes win-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes win-out { to { opacity: 0; transform: translateY(10px) scale(.95); } }
.win-bar {
  height: 44px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 12px; cursor: grab; user-select: none; touch-action: none;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border-bottom: 1px solid var(--line);
}
.win-bar:active { cursor: grabbing; }
.win-bar .app-ico { width: 24px; height: 24px; border-radius: 7px; }
.win-bar .app-ico svg { width: 62%; height: 62%; }
.win-bar .dk-thumb { width: 24px; height: 24px; border-radius: 7px; }
.win-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb { width: 34px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; flex: none; }
.wb svg { width: 16px; height: 16px; }
.wb:hover { background: rgba(255,255,255,.08); color: var(--txt); }
.wb.close:hover { background: #e11d48; color: #fff; }
.wb.on { color: #fb7185; }
.wb.on-like { color: #60a5fa; }
.wb.on-like svg { fill: currentColor; fill-opacity: .25; }
.win-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.win-body.is-frame { overflow: hidden; background: #000; }
.win-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.win-shield { position: absolute; inset: 44px 0 0; display: none; z-index: 5; }
body.os-dragging .win-shield { display: block; }
body.os-dragging { cursor: grabbing; user-select: none; }
.win-rz { position: absolute; z-index: 6; }
.win-rz.r { top: 10px; right: -4px; width: 10px; bottom: 10px; cursor: ew-resize; }
.win-rz.b { left: 10px; bottom: -4px; height: 10px; right: 10px; cursor: ns-resize; }
.win-rz.br { right: -4px; bottom: -4px; width: 18px; height: 18px; cursor: nwse-resize; }
.win-rz.l { top: 10px; left: -4px; width: 10px; bottom: 10px; cursor: ew-resize; }
.win.is-max .win-rz { display: none; }
.win-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #050507; z-index: 2; transition: opacity .35s; }
.win-loading.is-done { opacity: 0; pointer-events: none; }
.win-loading .spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--primary-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.snap-hint { position: absolute; inset: 6px; border-radius: 16px; border: 2px solid var(--primary-2); background: rgba(139,92,246,.08); pointer-events: none; z-index: 99; opacity: 0; transition: opacity .15s; }
.snap-hint.is-on { opacity: 1; }

/* ---------- App content ---------- */
.app { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
.app > * { min-width: 0; }
.app h2 { font-family: var(--font-os); font-weight: 500; font-size: 26px; letter-spacing: .01em; }
.app-sub { color: var(--dim); }
.app-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 3; margin: -20px -20px 0; padding: 14px 20px; background: rgba(18,18,24,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.search-box { position: relative; flex: 1 1 220px; min-width: 0; }
.app-toolbar > .select { flex: none; width: auto !important; }
.search-box svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search-box .input { padding-left: 42px; min-height: 42px; border-radius: 999px; background: rgba(0,0,0,.35); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { flex: none; min-height: 34px; padding: 0 14px; font-size: 13px; }
.chip svg { width: 14px; height: 14px; display: inline; vertical-align: -2px; margin-right: 4px; }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.gcard {
  position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.035); border: 1px solid var(--line);
  cursor: pointer; transition: transform .3s var(--ease-out), border-color .25s, box-shadow .3s; text-align: left; color: inherit; padding: 0;
}
.gcard:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 24px 40px -20px rgba(0,0,0,.9), 0 0 40px -20px hsl(var(--h) 90% 60% / .7); }
.gcard .cov { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #0a0a10; }
.gcard .cov img, .gcard .cov canvas { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.gcard:hover .cov img, .gcard:hover .cov canvas { transform: scale(1.07); }
.gcard .cov::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,.6)); pointer-events: none; }
.gcard .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.gcard h3 { font-family: var(--font-os); font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard p { font-size: 13px; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.gcard .gmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 4px; gap: 6px; }
.gcard .gmeta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .gmeta span:first-child { flex: 1; min-width: 0; }
.gcard .gmeta span:last-child { flex: none; }
.gcard .body { min-width: 0; }
.gbadges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; z-index: 2; pointer-events: none; }
.gbadge { padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }
.gbadge.new { background: var(--primary); }
.gbadge.hot { background: linear-gradient(135deg, #f97316, #f43f5e); }
.fav-btn {
  position: absolute; right: 8px; bottom: 8px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px); color: #fff; opacity: 0; transform: scale(.8); transition: all .2s var(--ease-spring);
}
.fav-btn svg { width: 18px; height: 18px; }
.gcard:hover .fav-btn, .fav-btn.on, .gcard:focus-visible .fav-btn { opacity: 1; transform: none; }
.fav-btn.on { color: #fb7185; }
.fav-btn.on svg { fill: currentColor; }
.fav-btn.pop { animation: pop .4s var(--ease-spring); }
@keyframes pop { 50% { transform: scale(1.4); } }
.lib-hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 200px; display: flex; align-items: flex-end; border: 1px solid var(--line); cursor: pointer; }
.lib-hero img, .lib-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1); }
.lib-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(0,0,0,.2) 70%), linear-gradient(transparent 40%, rgba(0,0,0,.6)); }
.lib-hero .in { position: relative; z-index: 1; padding: 24px; display: grid; gap: 8px; max-width: 520px; }
.lib-hero h3 { font-family: var(--font-os); font-weight: 500; font-size: clamp(26px, 4vw, 38px); }
.lib-hero p { color: var(--dim); }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-title h4 { font-family: var(--font-os); font-weight: 500; font-size: 19px; }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 210px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.empty { text-align: center; color: var(--dim); padding: 40px 10px; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ach { display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); align-items: flex-start; }
.ach .ai { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.06); color: var(--faint); }
.ach .ai svg { width: 22px; height: 22px; }
.ach.done { border-color: rgba(251,191,36,.35); background: linear-gradient(160deg, rgba(251,191,36,.1), rgba(255,255,255,.03)); }
.ach.done .ai { background: linear-gradient(135deg, #f59e0b, #fcd34d); color: #3b2000; box-shadow: 0 6px 18px -6px rgba(251,191,36,.6); }
.ach b { display: block; font-size: 15px; }
.ach small { color: var(--dim); font-size: 13px; display: block; margin-bottom: 8px; }
.ach .bar { height: 6px; }
.ach .xp { font-size: 12px; color: var(--faint); margin-top: 6px; display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.stat span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.stat b { font-family: var(--font-os); font-weight: 500; font-size: 26px; }

.lb-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lb-rows li { display: grid; grid-template-columns: 34px 38px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.lb-rows li.me { border-color: var(--primary-2); background: rgba(139,92,246,.12); }
.lb-rows .rk { font-family: var(--font-os); font-weight: 700; font-size: 18px; color: var(--faint); text-align: center; }
.lb-rows li:nth-child(1) .rk { color: #fcd34d; } .lb-rows li:nth-child(2) .rk { color: #e2e8f0; } .lb-rows li:nth-child(3) .rk { color: #f59e0b; }
.lb-rows .avatar { width: 38px; height: 38px; font-size: 15px; border-radius: 11px; }
.lb-rows .sc { font-family: var(--font-os); font-weight: 500; font-size: 20px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line); gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--dim); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; }
.seg button[aria-pressed='true'] { background: rgba(255,255,255,.1); color: var(--txt); }

.track { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.03); cursor: pointer; width: 100%; color: inherit; text-align: left; }
.track:hover { background: rgba(255,255,255,.06); }
.track[aria-pressed='true'] { border-color: var(--primary-2); background: rgba(139,92,246,.12); }
.track .app-ico { width: 48px; height: 48px; }
.big-play { width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: #fff; color: #000; transition: transform .2s var(--ease-spring); }
.big-play:hover { transform: scale(1.08); }
.big-play svg { width: 26px; height: 26px; }
.notes-area { width: 100%; min-height: 100%; height: 100%; resize: none; border: 0; padding: 20px; background: transparent; color: var(--txt); font: 16px/1.6 var(--font-ui); outline: none; }

/* ---------- Start menu / library overlay / palette ---------- */
.start {
  position: fixed; z-index: 950; left: 50%; bottom: calc(var(--dock-h) + 4px); width: min(560px, calc(100vw - 16px)); max-height: min(640px, calc(100dvh - var(--dock-h) - 20px));
  border-radius: 24px; padding: 18px; display: grid; gap: 16px; overflow: auto; transform: translate(-50%, 12px) scale(.98); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .28s var(--ease-out); background: rgba(14,14,20,.88);
}
.start.is-open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.start-user { display: flex; align-items: center; gap: 12px; }
.start-user .avatar { width: 46px; height: 46px; font-size: 18px; border-radius: 14px; }
.start-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.sa { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: 16px; border: 0; background: transparent; color: var(--txt); cursor: pointer; font-size: 12px; font-weight: 600; transition: background .15s; }
.sa:hover { background: rgba(255,255,255,.07); }
.sa .app-ico { width: 48px; height: 48px; }
.start-list { display: grid; gap: 4px; }
.sl { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 0; background: transparent; color: var(--txt); cursor: pointer; text-align: left; width: 100%; }
.sl:hover, .sl.is-sel { background: rgba(255,255,255,.08); }
.sl .dk-thumb, .sl .app-ico { width: 38px; height: 38px; border-radius: 10px; }
.sl b { font-size: 14px; display: block; }
.sl small { color: var(--faint); font-size: 12px; }

.palette-back { position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; opacity: 0; transition: opacity .15s; }
.palette-back.is-open { opacity: 1; }
.palette { width: min(620px, 100%); border-radius: 22px; overflow: hidden; background: rgba(16,16,22,.94); }
.palette .search-box .input { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); min-height: 60px; font-size: 18px; background: transparent; }
.palette .search-box .input:focus { box-shadow: none; }
.palette .start-list { max-height: 50vh; overflow: auto; padding: 8px; }
.palette kbd, .kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; font: 600 12px var(--font-ui); background: rgba(255,255,255,.08); border: 1px solid var(--line); border-bottom-width: 2px; }

.ctx { position: fixed; z-index: 1400; min-width: 200px; padding: 6px; border-radius: 14px; background: rgba(16,16,22,.95); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--txt); cursor: pointer; font-weight: 500; text-align: left; }
.ctx button:hover { background: rgba(255,255,255,.08); }
.ctx svg { width: 16px; height: 16px; color: var(--dim); }

/* Toasts restyled for the OS */
body.os .toast-wrap { bottom: calc(var(--dock-h) + 12px); left: auto; right: 16px; transform: none; width: min(380px, calc(100% - 32px)); }
body.os .toast { background: rgba(16,16,22,.94); border-color: var(--line-strong); backdrop-filter: blur(16px); }
.toast-big { padding: 16px 18px; font-size: 15px; border-color: rgba(167,139,250,.5) !important; box-shadow: 0 0 40px -10px var(--primary-glow), var(--shadow) !important; }
.toast-ach { border-color: rgba(251,191,36,.55) !important; box-shadow: 0 0 40px -10px rgba(251,191,36,.5), var(--shadow) !important; }
.toast-ach svg { color: #fcd34d !important; }

/* Boot splash */
.boot { position: fixed; inset: 0; z-index: 3000; background: #000; display: grid; place-items: center; transition: opacity .6s, visibility .6s; }
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-in { display: grid; justify-items: center; gap: 18px; }
.boot-logo { font-family: var(--font-os); font-weight: 200; font-size: 44px; letter-spacing: .5em; margin-right: -.5em; text-shadow: -2px 0 rgba(255,60,90,.5), 2px 0 rgba(60,200,255,.5); }
.boot-bar { width: 160px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: #fff; animation: boot 1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .wg, .wg.span-6, .wg.span-8 { grid-column: span 6; }
  .wg.span-12 { grid-column: span 12; }
}
@media (max-width: 760px) {
  :root { --dock-h: 74px; }
  .wg, .wg.span-6, .wg.span-8, .wg.span-12 { grid-column: span 12; }
  .os-home { padding-top: 20px; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border-width: 0; min-width: 0; }
  .win-bar { cursor: default; }
  .win-rz, .wb.max { display: none; }
  .dock { left: 8px; right: 8px; width: auto; justify-content: flex-start; max-width: none; }
  .dk-clock, .fps.hide-sm { display: none; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .app { padding: 16px; }
  .app-toolbar { margin: -16px -16px 0; padding: 12px 16px; }
  body.os .toast-wrap { right: 50%; transform: translateX(50%); }
}

/* ---------- Dock badge / notification center ---------- */
.dk-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #f43f5e; color: #fff; font: 700 11px/18px var(--font-ui); box-shadow: 0 0 0 2px rgba(10,10,14,.9); }
.dk-clock { cursor: pointer; border-radius: 10px; }
.dk-clock:hover { background: rgba(255,255,255,.06); }
.notifs { position: fixed; z-index: 950; right: 10px; bottom: calc(var(--dock-h) + 4px); width: min(380px, calc(100vw - 20px)); max-height: min(620px, calc(100dvh - var(--dock-h) - 20px));
  border-radius: 22px; padding: 18px; display: grid; gap: 14px; align-content: start; overflow: auto; background: rgba(14,14,20,.9);
  opacity: 0; transform: translateX(16px); transition: opacity .2s, transform .28s var(--ease-out); }
.notifs.is-open { opacity: 1; transform: none; }
.nf-list { display: grid; gap: 8px; }
.nf { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 14px; }
.nf svg { width: 18px; height: 18px; flex: none; color: var(--primary-2); margin-top: 2px; }
.nf small { color: var(--faint); font-size: 12px; }
.nf.ach-n { border-color: rgba(251,191,36,.35); }
.nf.ach-n svg { color: #fcd34d; }

/* ---------- Lock screen ---------- */
.lock { position: fixed; inset: 0; z-index: 2500; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 12vh 16px 10vh;
  background: radial-gradient(ellipse at 50% 30%, rgba(5,5,7,.35), rgba(5,5,7,.8)); backdrop-filter: blur(28px) saturate(120%); -webkit-backdrop-filter: blur(28px) saturate(120%); cursor: pointer; user-select: none;
  transition: transform .6s var(--ease-out), opacity .6s var(--ease-out); animation: lock-in .8s var(--ease-out); }
.lock.is-gone { transform: translateY(-100%); opacity: 0; pointer-events: none; }
@keyframes lock-in { from { opacity: 0; } }
.lock-top { text-align: center; }
.lock-time { font-family: var(--font-os); font-weight: 200; font-size: clamp(96px, 22vw, 260px); line-height: .9; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  text-shadow: -3px 0 rgba(255,60,90,.35), 3px 0 rgba(60,200,255,.35), 0 10px 60px rgba(0,0,0,.5); }
.lock-date { font-family: var(--font-os); font-weight: 300; font-size: clamp(18px, 2.4vw, 28px); color: var(--dim); margin-top: 10px; }
.lock-bottom { display: grid; justify-items: center; gap: 8px; text-align: center; }
.lock-hint { font-size: 13px; color: var(--faint); letter-spacing: .2em; text-transform: uppercase; animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { opacity: .35; } }

.confetti { position: fixed; inset: 0; z-index: 2600; pointer-events: none; }

/* ---------- Widget editing ---------- */
.wg-edit-btn { margin-left: auto; }
.wg-edit { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; padding: 14px; border-radius: inherit;
  background: rgba(10,10,14,.55); border: 2px dashed var(--line-strong); backdrop-filter: blur(2px); animation: wg-wiggle .35s ease-in-out infinite alternate; }
.wg-edit .icon-btn { width: 38px; height: 38px; background: rgba(20,20,26,.9); }
.wg.wg-off { opacity: .45; }
@keyframes wg-wiggle { from { transform: rotate(-.25deg); } to { transform: rotate(.25deg); } }

.upnext { position: fixed; left: 16px; bottom: calc(var(--dock-h) + 12px); z-index: 960; width: min(340px, calc(100vw - 32px)); padding: 16px; border-radius: 20px; background: rgba(14,14,20,.92); animation: up-in .45s var(--ease-spring); transition: opacity .3s, transform .3s; }
.upnext .wg-ico { width: 56px; height: 56px; border-radius: 14px; }
.upnext.is-gone { opacity: 0; transform: translateY(10px); }
@keyframes up-in { from { opacity: 0; transform: translateY(20px) scale(.96); } }

.ctl-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px;
  background: rgba(10,10,14,.82); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); font-size: 14px; font-weight: 600; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis;
  animation: up-in .5s var(--ease-spring); transition: opacity .6s, transform .6s; }
.ctl-hint svg { width: 16px; height: 16px; color: var(--primary-2); flex: none; }
.ctl-hint.is-gone { opacity: 0; transform: translate(-50%, -8px); }

/* ---- Music app: stations ---- */
.mu-app { gap: 16px; }
.mu-hero { display: flex; align-items: center; gap: 18px; text-align: left; min-width: 0; }
.mu-now { min-width: 0; }
.mu-now h2 { margin: 4px 0 2px; font-size: 24px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mu-now .app-sub { margin: 0; }
.mu-art { display: grid; place-items: center; overflow: hidden; box-shadow: 0 12px 36px -10px rgba(0,0,0,.6); }
.mu-art img { width: 100%; height: 100%; object-fit: cover; }
.mu-art svg { width: 42%; height: 42%; }
.mu-art.is-spin svg { animation: spin 12s linear infinite; }
.mu-prog { display: flex; align-items: center; gap: 10px; font: 600 12px var(--font-os, inherit); color: var(--dim); font-variant-numeric: tabular-nums; }
.mu-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); cursor: pointer; position: relative; }
.mu-bar::before { content: ''; position: absolute; inset: -8px 0; }
.mu-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .4s linear; }
.mu-bar:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 4px; }
.mu-ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mu-ctrl .icon-btn[disabled] { opacity: .3; pointer-events: none; }
.mu-ctrl .icon-btn.is-on { color: var(--primary-2); background: rgba(139,92,246,.16); }
.mu-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mu-tabs::-webkit-scrollbar { display: none; }
.mu-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: inherit; font: 600 13px inherit; cursor: pointer; }
.mu-tab i { width: 12px; height: 12px; border-radius: 50%; }
.mu-tab span { color: var(--faint); font-weight: 500; }
.mu-tab[aria-pressed='true'] { background: #fff; color: #000; border-color: #fff; }
.mu-tab[aria-pressed='true'] span { color: rgba(0,0,0,.5); }
.mu-list { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; text-align: left; margin: 0 -4px; padding: 0 4px; }
.mu-song { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.mu-song:hover { background: rgba(255,255,255,.06); }
.mu-song.is-on { background: rgba(139,92,246,.14); }
.mu-song.is-on b { color: var(--primary-2); }
.mu-num { width: 22px; flex: none; text-align: center; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.mu-st { min-width: 0; display: grid; }
.mu-st b, .mu-st small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-st small { color: var(--dim); font-size: 12.5px; }
.mu-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.mu-eq i { width: 3px; background: var(--primary-2); border-radius: 2px; animation: mu-eq .9s ease-in-out infinite; }
.mu-eq i:nth-child(2) { animation-delay: -.3s; } .mu-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes mu-eq { 0%,100% { height: 30%; } 50% { height: 100%; } }
.mu-hint { display: flex; gap: 12px; text-align: left; padding: 14px; border-radius: 14px; border: 1px dashed var(--line); font-size: 13.5px; color: var(--dim); }
.mu-hint svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.mu-hint code { font-size: 12px; background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; }
@media (prefers-reduced-motion: reduce) { .mu-eq i, .mu-art.is-spin svg { animation: none; } }
@media (max-width: 480px) { .mu-hero { flex-direction: column; text-align: center; } }

/* ---------------------------------------------- Admin commands (nova-live.js) */
html.adm-flip body { transform: rotate(180deg); transition: transform .8s cubic-bezier(.5,-.3,.4,1.3); }
html body { transition: transform .8s ease; }
html.adm-tiny body { transform: scale(.5); transform-origin: 50% 50%; }
html.adm-flip.adm-tiny body { transform: rotate(180deg) scale(.5); }
html.adm-shake body { animation: adm-shake .12s linear infinite; }
@keyframes adm-shake { 0%{translate:0 0} 20%{translate:-14px 6px} 40%{translate:12px -8px} 60%{translate:-8px -10px} 80%{translate:10px 8px} 100%{translate:0 0} }
html.adm-spin .win { animation: adm-spin 20s linear forwards; }
@keyframes adm-spin { from { rotate: 0deg } 85% { rotate: 360deg } to { rotate: 360deg } }
.adm-wall { position: fixed; inset: 0; z-index: -1; background: center / cover no-repeat; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.adm-wall.on { opacity: 1; }
.adm-msg { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: rgba(6,4,16,.55); backdrop-filter: blur(6px); animation: adm-in .3s ease; }
.adm-msg.is-leaving { opacity: 0; transition: opacity .25s; }
.adm-msg-card { max-width: min(560px, 90vw); padding: 26px 28px 22px; border-radius: 22px; display: grid; gap: 14px; justify-items: center; text-align: center;
  background: linear-gradient(160deg, rgba(60,30,120,.95), rgba(18,10,40,.96)); border: 1px solid rgba(196,167,255,.35); box-shadow: 0 30px 90px -20px rgba(0,0,0,.9), 0 0 60px -10px var(--primary-glow); }
.adm-msg-card p { margin: 0; font: 600 clamp(20px, 3.4vw, 30px)/1.25 var(--font-os); color: #fff; word-break: break-word; }
.adm-tag { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #e9d5ff; background: rgba(167,139,250,.18); border: 1px solid rgba(196,167,255,.35); }
.adm-tag svg { width: 14px; height: 14px; }
@keyframes adm-in { from { opacity: 0; transform: scale(.96); } }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.lv-grid .btn { justify-content: flex-start; }
.lv-who { cursor: pointer; border: 1px solid transparent; }
.lv-who.is-sel { border-color: rgba(196,167,255,.55); background: rgba(139,92,246,.16); }
@media (prefers-reduced-motion: reduce) { html.adm-shake body { animation-duration: .5s; } }
