/* StelarOS: a desktop under a night sky. Ice blue means earning, solar gold means credits. */
:root {
  --sky-top: #121a42;
  --sky-low: #24306e;
  --ink: #eef1ff;
  --muted: #a7b0dc;
  --faint: #7480b8;
  --line: rgba(166, 180, 255, 0.18);
  --line-strong: rgba(166, 180, 255, 0.32);
  --panel: rgba(21, 28, 70, 0.92);
  --panel-raised: #1f2a62;
  --panel-solid: #18214f;
  --field: rgba(10, 15, 44, 0.55);
  --hover: rgba(166, 180, 255, 0.1);
  --ice: #8ed8ff;
  --sun: #ffc56b;
  --good: #8ef0b5;
  --bad: #ff9a9a;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --taskbar-h: 52px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-low) 100%) fixed;
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
body.wall-deep { background: radial-gradient(120% 90% at 50% 110%, #2c3a86 0%, #172056 45%, #0f1538 100%) fixed; }
body.wall-dawn { background: linear-gradient(180deg, #141c48 0%, #2b3678 55%, #5a4a7a 85%, #a77a5c 100%) fixed; }
[hidden] { display: none !important; }
b { font-weight: 700; }
a { color: var(--ice); }
button, input, textarea, select, output { font: inherit; color: inherit; }
input, textarea, .doc, .msg p, .note { user-select: text; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.mark { display: inline-block; width: 14px; height: 14px; background: var(--sun); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); flex: 0 0 auto; }
.coin { width: 10px; height: 10px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 8px rgba(255, 197, 107, 0.8); flex: 0 0 auto; }

button { cursor: pointer; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-raised); padding: 7px 14px; }
button:hover { border-color: var(--line-strong); background: #26326f; }
button:disabled { opacity: 0.55; cursor: default; }
.btn-sun { background: var(--sun); color: #2a1a00; border-color: var(--sun); font-weight: 700; }
.btn-sun:hover { background: #ffd48e; border-color: #ffd48e; }
.btn-ice { background: var(--ice); color: #06263a; border-color: var(--ice); font-weight: 700; }
.btn-ice:hover { background: #b5e6ff; border-color: #b5e6ff; }
.btn-ice.running { background: transparent; color: var(--ice); }
.link { background: none; border: 0; padding: 4px 0; color: var(--ice); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { background: none; color: #b5e6ff; }

input[type="email"], input[type="number"], input[type="search"], textarea, select {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
}
input[type="range"] { width: 100%; accent-color: var(--ice); }
.note { color: var(--muted); font-size: 0.86rem; margin: 0 0 10px; }
.empty { color: var(--faint); }
.check-row { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; }

/* ---------- startup ---------- */
.boot {
  position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center;
  background: #0d1333; transition: opacity 0.3s ease;
}
.boot.done { opacity: 0; }
.boot-brand { display: flex; flex-direction: column; align-items: center; }
.boot-mark { width: 60px; height: 60px; background: var(--sun); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 18px rgba(255, 197, 107, 0.7)); }
.boot-word { font: 800 2.2rem/1 var(--font-display); letter-spacing: -0.03em; margin: 20px 0 26px; }
.boot-bar { width: 200px; height: 4px; border-radius: 2px; background: rgba(166, 180, 255, 0.15); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--ice); transition: width 0.05s linear; }
.boot-status { color: var(--muted); margin: 14px 0 0; font-size: 0.9rem; }
.boot-skip { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: var(--faint); font-size: 0.8rem; margin: 0; }

/* ---------- lock screen ---------- */
.lock {
  position: fixed; inset: 0; z-index: 8000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 40px; padding: 24px; overflow: auto; background: rgba(9, 13, 38, 0.45); backdrop-filter: blur(18px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.lock.leaving { opacity: 0; transform: translateY(-24px); }
.lock-clock { text-align: center; }
.lock-time { display: block; font: 800 clamp(4rem, 12vw, 6.5rem)/1 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.lock-date { display: block; margin-top: 8px; font-size: 1.15rem; color: var(--muted); }
.lock-card {
  width: min(380px, 100%); text-align: center; padding: 28px 26px 20px;
  background: rgba(21, 28, 70, 0.72); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(3, 6, 25, 0.5);
}
.avatar { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; background: var(--panel-raised); border: 1px solid var(--line-strong); }
.avatar .mark { width: 30px; height: 30px; }
.avatar.small { width: 30px; height: 30px; margin: 0; }
.avatar.small .mark { width: 13px; height: 13px; }
.lock-card h1 { font: 700 1.5rem/1.2 var(--font-display); margin: 0 0 6px; overflow-wrap: anywhere; }
.lock-sub { color: var(--muted); margin: 0 0 18px; }
.lock-reason { margin: 0 0 12px; padding: 7px 10px; border-radius: 8px; background: rgba(142, 216, 255, 0.12); color: var(--ice); }
.lock-form { display: flex; gap: 8px; }
.lock-form input { flex: 1; min-width: 0; padding: 10px 12px; font-size: 1rem; }
.lock-form button { padding: 0 18px; }
.lock-note { font-size: 0.85rem; color: var(--faint); margin: 10px 0 0; user-select: text; }
.lock-note.ok { color: var(--ink); }
.lock-note.err { color: var(--bad); }
.lock-alt { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.lock-alt #walletPanel { width: 100%; text-align: left; }
.lock-unlock { width: 100%; padding: 11px; font-size: 1rem; }
.wallets { display: grid; gap: 8px; margin-top: 8px; }
.wallets button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; text-align: left; }
.wallets img, .wallet-glyph { width: 26px; height: 26px; border-radius: 6px; flex: 0 0 auto; }
.wallet-glyph { display: grid; place-items: center; background: var(--field); color: var(--muted); }
.wallet-name { font-weight: 700; }
.wallet-status { min-height: 1.3em; margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.wallet-status.err { color: var(--bad); }

/* ---------- desktop ---------- */
.desktop { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }
.workarea { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.sky-caption { position: absolute; right: 16px; bottom: 10px; margin: 0; color: var(--faint); font-size: 0.78rem; pointer-events: none; }

.icons { position: absolute; inset: 0; z-index: 1; }
.icon {
  position: absolute; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 7px 4px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  font-size: 0.8rem; line-height: 1.25; text-align: center; transition: left 0.15s ease, top 0.15s ease;
}
.icon:hover { background: rgba(166, 180, 255, 0.08); border-color: transparent; }
.icon.selected { background: rgba(142, 216, 255, 0.18); border-color: rgba(142, 216, 255, 0.45); }
.icon.dragging { transition: none; opacity: 0.85; z-index: 2; }
.icon:focus-visible { outline-offset: -2px; }
.icon-tile {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(160deg, #2c3a86, #1b245a); border: 1px solid var(--line-strong);
  box-shadow: 0 4px 12px rgba(3, 6, 25, 0.4);
}
.icon-tile svg { width: 24px; height: 24px; }
.icon-label { text-shadow: 0 1px 3px rgba(3, 6, 25, 0.95); overflow-wrap: anywhere; }
.icon.locked .icon-tile svg, .start-app.locked .start-tile svg { opacity: 0.45; }
.icon.locked .icon-tile::after, .start-app.locked .start-tile::after, .task.locked::after {
  content: ""; position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--panel-raised) center / 9px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23a7b0dc'%3E%3Cpath d='M3.5 5V3.6a2.5 2.5 0 0 1 5 0V5h.6c.5 0 .9.4.9.9v4.2c0 .5-.4.9-.9.9H2.9a.9.9 0 0 1-.9-.9V5.9c0-.5.4-.9.9-.9zm1.2 0h2.6V3.6a1.3 1.3 0 0 0-2.6 0z'/%3E%3C/svg%3E");
  border: 1px solid var(--line);
}

.snap-preview {
  position: absolute; z-index: 9; border-radius: 10px; pointer-events: none;
  background: rgba(142, 216, 255, 0.12); border: 2px solid rgba(142, 216, 255, 0.55);
}

/* ---------- windows ---------- */
.win {
  position: absolute; z-index: 2; display: flex; flex-direction: column;
  background: var(--panel); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 48px rgba(3, 6, 25, 0.55); overflow: hidden;
}
.win.focused { border-color: var(--line-strong); box-shadow: 0 22px 60px rgba(3, 6, 25, 0.7); }
.win:not(.focused) .win-bar h2 { color: var(--muted); }
.win.maximized, .win.snapped { border-radius: 0; }
.win.opening { animation: win-open 0.16s ease-out; }
@keyframes win-open { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
.win-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 38px; padding-left: 12px;
  background: rgba(12, 17, 46, 0.4); border-bottom: 1px solid var(--line); cursor: default; touch-action: none;
}
.win-icon { display: grid; place-items: center; }
.win-icon svg { width: 16px; height: 16px; color: var(--muted); }
.win-bar h2 { margin: 0; flex: 1; min-width: 0; font: 400 0.86rem/1 var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-ctl { display: flex; align-self: stretch; }
.win-ctl button { width: 46px; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.win-ctl button svg { width: 15px; height: 15px; }
.win-ctl button:hover { background: var(--hover); color: var(--ink); }
.win-ctl button[data-act="close"]:hover { background: #c4344a; color: #fff; }
.win-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 18px; }
.win-flush .win-body { padding: 0; overflow: hidden; display: flex; }
.win-resize { position: absolute; z-index: 3; touch-action: none; }
.win-resize-e { top: 10px; right: 0; bottom: 10px; width: 6px; cursor: ew-resize; }
.win-resize-w { top: 10px; left: 0; bottom: 10px; width: 6px; cursor: ew-resize; }
.win-resize-s { left: 10px; right: 10px; bottom: 0; height: 6px; cursor: ns-resize; }
.win-resize-se { right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.win-resize-sw { left: 0; bottom: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.win.maximized .win-resize { display: none; }
.win h3 { font: 700 0.95rem/1.2 var(--font-display); margin: 18px 0 8px; }
.win h3.first { margin-top: 0; }

/* ---------- taskbar ---------- */
.taskbar {
  flex: 0 0 auto; position: relative; z-index: 5000; display: flex; align-items: center; gap: 6px;
  height: var(--taskbar-h); padding: 0 8px; background: rgba(12, 17, 46, 0.86); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.taskbar button { border-color: transparent; background: transparent; }
.taskbar button:hover { background: var(--hover); border-color: transparent; }
.start { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 12px; font: 700 0.95rem/1 var(--font-display); }
.start[aria-expanded="true"] { background: var(--hover); }
.task-apps { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.task { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 40px; padding: 0; }
.task svg { width: 22px; height: 22px; }
.task::before { content: ""; position: absolute; left: 50%; bottom: 3px; width: 0; height: 3px; border-radius: 2px; background: var(--faint); transform: translateX(-50%); transition: width 0.15s ease; }
.task.open::before { width: 6px; }
.task.active { background: var(--hover); }
.task.active::before { width: 16px; background: var(--ice); }
.task.running svg { color: var(--ice); }
.task.locked::after { right: 6px; bottom: 6px; width: 12px; height: 12px; }

.tray { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.tray-item { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tray-credits b { color: var(--sun); }
.tray-earning { color: var(--ice); }
.tray-earning::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 8px var(--ice); }
.tray-icon { display: grid; place-items: center; width: 34px; height: 36px; color: var(--ink); }
.tray-icon svg { width: 18px; height: 18px; }
.tray-icon.offline { color: var(--bad); }
.tray-clock { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; height: 40px; padding: 0 10px; font-size: 0.8rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tray-clock[aria-expanded="true"] { background: var(--hover); }

/* ---------- start menu ---------- */
.start-menu {
  position: absolute; left: 8px; bottom: calc(var(--taskbar-h) + 8px); z-index: 6000;
  width: min(460px, calc(100% - 16px)); max-height: calc(100% - var(--taskbar-h) - 24px); overflow: auto;
  padding: 18px 18px 0; background: rgba(24, 33, 79, 0.97); backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 24px 60px rgba(3, 6, 25, 0.7);
  animation: pop-up 0.14s ease-out;
}
@keyframes pop-up { from { opacity: 0; transform: translateY(10px); } }
#startSearch { border-radius: 999px; padding: 9px 16px; }
.start-heading { font-weight: 700; margin: 16px 2px 8px; }
.start-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 16px; }
.start-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 1px solid transparent; background: transparent; font-size: 0.8rem; text-align: center; }
.start-app:hover, .start-app:focus-visible { background: var(--hover); border-color: transparent; outline: none; }
.start-tile { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(160deg, #2c3a86, #1b245a); border: 1px solid var(--line-strong); }
.start-tile svg { width: 22px; height: 22px; }
.start-empty { grid-column: 1 / -1; color: var(--faint); margin: 8px 2px; }
.start-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -18px; padding: 10px 18px;
  border-top: 1px solid var(--line); background: rgba(12, 17, 46, 0.4); border-radius: 0 0 12px 12px;
}
.start-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.start-user #startUser { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-power { display: flex; gap: 4px; }
.start-power button { background: transparent; border-color: transparent; }
.start-power button:hover { background: var(--hover); }

/* ---------- right-click menu ---------- */
.context-menu {
  position: fixed; z-index: 7000; min-width: 200px; padding: 5px;
  background: rgba(24, 33, 79, 0.98); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 16px 40px rgba(3, 6, 25, 0.6);
}
.context-menu button { display: block; width: 100%; text-align: left; padding: 7px 12px; border: 0; background: transparent; border-radius: 4px; }
.context-menu button:hover, .context-menu button:focus-visible { background: var(--hover); outline: none; }
.context-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* ---------- notifications ---------- */
.notif-center {
  position: absolute; right: 8px; bottom: calc(var(--taskbar-h) + 8px); z-index: 6000; width: min(360px, calc(100% - 16px));
  max-height: calc(100% - var(--taskbar-h) - 24px); overflow: auto; padding: 14px;
  background: rgba(24, 33, 79, 0.97); backdrop-filter: blur(20px); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(3, 6, 25, 0.7); animation: pop-up 0.14s ease-out;
}
.notif-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.notif-head h2 { font: 700 1rem/1 var(--font-display); margin: 0; }
.notif-head button { background: transparent; border-color: transparent; padding: 4px 8px; font-size: 0.85rem; color: var(--muted); }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notif-list li:not(.empty) { padding: 10px 12px; border-radius: 8px; background: var(--field); border-left: 3px solid var(--ice); }
.notif-list li.error { border-left-color: var(--bad); }
.notif-list p { margin: 0 0 4px; }
.notif-list time { color: var(--faint); font-size: 0.78rem; }
.notif-date { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }

.toasts { position: absolute; right: 12px; bottom: calc(var(--taskbar-h) + 12px); z-index: 7500; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100% - 24px)); pointer-events: none; }
.toast {
  padding: 11px 14px; border-radius: 10px; background: var(--panel-raised); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--ice); box-shadow: 0 10px 30px rgba(3, 6, 25, 0.5); pointer-events: auto; animation: slide-in 0.2s ease-out;
}
.toast.error { border-left-color: var(--bad); }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }

.confirm {
  max-width: 400px; padding: 20px 22px; color: var(--ink); background: var(--panel-solid);
  border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 24px 60px rgba(3, 6, 25, 0.7);
}
.confirm::backdrop { background: rgba(6, 9, 30, 0.55); }
.confirm h2 { font: 700 1.15rem/1.2 var(--font-display); margin: 0 0 8px; }
.confirm p { color: var(--muted); margin: 0 0 18px; }
.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Getting started (document) ---------- */
.doc { max-width: 62ch; line-height: 1.65; }
.doc h1 { font: 700 1.45rem/1.2 var(--font-display); margin: 0 0 12px; }
.doc h2 { font: 700 1.05rem/1.2 var(--font-display); margin: 22px 0 6px; }
.doc p, .doc ul { margin: 0 0 10px; color: #d4d9f5; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 4px; }
.doc b { color: var(--ink); }

/* ---------- AI Chat ---------- */
.chat { flex: 1; display: flex; min-width: 0; }
.chat-side { flex: 0 0 200px; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-right: 1px solid var(--line); background: rgba(12, 17, 46, 0.3); }
.chat-new { width: 100%; }
.chat-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.chat-list button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: transparent; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.chat-list button:hover { background: var(--hover); color: var(--ink); }
.chat-list button.current { background: rgba(142, 216, 255, 0.14); color: var(--ink); }
.chat-list .empty { font-size: 0.85rem; padding: 4px 6px; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.chat-top label { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--muted); }
.chat-top select { width: auto; padding: 4px 8px; }
.chat-top-note { font-size: 0.8rem; color: var(--faint); }
.chat-log { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.chat-empty b { font: 700 1.3rem/1.2 var(--font-display); color: var(--ink); }
.msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.msg p { margin: 0; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.user p { background: #2f3d8f; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; }
.msg.ai p { background: var(--field); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.pending p { color: var(--muted); font-style: italic; }
.msg.error p { border-color: var(--bad); color: var(--bad); }
.msg-cost { font-size: 0.75rem; color: var(--faint); padding: 0 4px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 16px 4px; }
.chat-compose textarea { resize: none; min-height: 40px; max-height: 160px; border-radius: 10px; padding: 9px 12px; }
.chat-compose button { height: 40px; padding: 0 18px; border-radius: 10px; }
.chat-foot { margin: 0; padding: 2px 16px 10px; font-size: 0.78rem; color: var(--faint); }

/* ---------- Earn ---------- */
.earn-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.earn-state { font: 700 1.5rem/1.1 var(--font-display); margin: 0 0 4px; }
.earn-head .note { margin: 0; max-width: 34ch; }
.btn-big { padding: 11px 22px; font-size: 1rem; border-radius: 999px; flex: 0 0 auto; }
.graph { margin: 0 0 14px; padding: 10px 12px 8px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; }
.graph canvas { display: block; width: 100%; height: 120px; }
.graph figcaption { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 18px; margin: 0 0 14px; }
.readout dt { font-size: 0.78rem; color: var(--muted); }
.readout dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.power { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.power legend { grid-column: 1 / -1; font-weight: 700; margin-bottom: 8px; padding: 0; }
.power label { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--field); }
.power label:has(input:checked) { border-color: var(--ice); background: rgba(142, 216, 255, 0.1); }
.power input { accent-color: var(--ice); margin-top: 3px; }
.power span { display: flex; flex-direction: column; }
.power small { color: var(--muted); font-size: 0.78rem; }
.advanced { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; padding: 4px 0; }
.advanced[open] summary { margin-bottom: 10px; }
.controls { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; }
.controls output { color: var(--muted); }
.log, .activity { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.log li, .activity li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.log .ok b { color: var(--ice); }
.log .bad { color: var(--bad); }
.activity .plus { color: var(--good); }
.activity time { color: var(--faint); }

/* ---------- Credits ---------- */
.balance { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; }
.balance b { font: 800 2.5rem/1 var(--font-display); color: var(--sun); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.balance span { color: var(--muted); }
.bucket { margin: 14px 0; }
.bucket-head { display: flex; justify-content: space-between; gap: 12px; }
.bucket-head b { font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 3px; background: var(--field); margin: 6px 0; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--sun); border-radius: 3px; transition: width 0.4s ease; }
.fine-print { margin-top: 14px; font-size: 0.78rem; color: var(--faint); }

/* ---------- Settings ---------- */
.settings { flex: 1; display: flex; min-width: 0; }
.settings-nav { flex: 0 0 190px; display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; border-right: 1px solid var(--line); background: rgba(12, 17, 46, 0.3); }
.settings-nav button { text-align: left; padding: 8px 12px; border: 0; background: transparent; border-radius: 6px; color: var(--muted); position: relative; }
.settings-nav button:hover { background: var(--hover); color: var(--ink); }
.settings-nav button[aria-current="page"] { background: var(--hover); color: var(--ink); font-weight: 700; }
.settings-nav button[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--ice); }
.settings-body { flex: 1; overflow: auto; padding: 18px 22px; }
.settings-body h2 { font: 700 1.25rem/1.2 var(--font-display); margin: 0 0 14px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wallpapers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.wallpaper { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; font-size: 0.86rem; }
.wallpaper input { position: absolute; opacity: 0; pointer-events: none; }
.wp { display: block; height: 72px; border-radius: 8px; border: 2px solid var(--line); }
.wallpaper input:checked + .wp { border-color: var(--ice); }
.wallpaper input:focus-visible + .wp { outline: 2px solid var(--ice); outline-offset: 2px; }
.wp-night { background: linear-gradient(180deg, var(--sky-top), var(--sky-low)); }
.wp-deep { background: radial-gradient(120% 90% at 50% 110%, #2c3a86 0%, #172056 45%, #0f1538 100%); }
.wp-dawn { background: linear-gradient(180deg, #141c48 0%, #2b3678 55%, #5a4a7a 85%, #a77a5c 100%); }
.about-rows { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 16px; }
.about-rows dt { color: var(--muted); }
.about-rows dd { margin: 0; }

/* ---------- Earnings calculator / My devices ---------- */
.eco-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.eco-actions .note { margin: 0; }
.eco-inputs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 14px; }
.eco-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.verdict { margin: 4px 0 0; font-weight: 700; }
.verdict.good { color: var(--good); }
.verdict.warn { color: var(--sun); }
.verdict.bad { color: var(--bad); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 400; }

/* ---------- phones: apps open full screen above the taskbar ---------- */
@media (max-width: 760px) {
  .icons { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; padding: 14px 12px; }
  .icon { position: static !important; width: auto; }
  .workarea { overflow: auto; }
  .win { position: fixed; inset: 0 0 var(--taskbar-h) 0; width: auto !important; height: auto !important; border-radius: 0; z-index: 4000; }
  .win-ctl [data-act="max"], .win-resize { display: none; }
  .sky-caption { display: none; }
  .chat-side { display: none; }
  .settings-nav { flex-basis: 120px; }
  .tray-clock #clockDate, .start-label { display: none; }
  .power { grid-template-columns: 1fr; }
  .earn-head { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .win.opening, .start-menu, .notif-center, .toast { animation: none; }
  .icon, .meter span, .lock { transition: none; }
}

/* ---------- sign-in link page ---------- */
.verify { position: relative; z-index: 1; max-width: 440px; margin: 18vh auto 0; padding: 0 16px; }
.verify h1 { font: 800 2.4rem/1 var(--font-display); letter-spacing: -0.03em; margin: 36px 0 12px; }
.verify p { color: var(--muted); margin: 0 0 20px; }
.verify .btn-sun { padding: 11px 22px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 1.15rem/1 var(--font-display); color: var(--ink); text-decoration: none; }
