/* /css/os.css */
/* Questline Life OS — design system */
:root {
  --bg: #070818;
  --bg-2: #0d0f26;
  --card: rgba(20, 22, 50, 0.62);
  --card-solid: #14163a;
  --card-hi: rgba(36, 40, 86, 0.6);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eef0ff;
  --text-2: #a6abd6;
  --text-3: #6b70a0;
  --blue: #4fa8ff;
  --cyan: #45e6ff;
  --violet: #8b5cff;
  --pink: #ff5ea8;
  --gold: #ffc23d;
  --green: #35e09a;
  --red: #ff5d73;
  --orange: #ff9a3d;
  --grad: linear-gradient(135deg, #4fa8ff, #8b5cff 55%, #ff5ea8);
  --grad-soft: linear-gradient(135deg, rgba(79, 168, 255, 0.22), rgba(139, 92, 255, 0.2) 55%, rgba(255, 94, 168, 0.2));
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --r: 24px;
  --r-s: 16px;
  --font: 'Outfit', system-ui, -apple-system, sans-serif;
  --hand: 'Caveat', 'Segoe Print', cursive;
  --side: 248px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
:root[data-theme='lavender'] {
  --bg: #f3f1fa;
  --bg-2: #faf9fe;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --card-hi: rgba(255, 255, 255, 0.95);
  --line: rgba(90, 70, 170, 0.1);
  --line-2: rgba(90, 70, 170, 0.18);
  --text: #2a2350;
  --text-2: #6a6292;
  --text-3: #9d96c2;
  --shadow: 0 14px 40px rgba(110, 80, 200, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; }
body { overflow-x: hidden; }
/* Phones: no double-tap zoom, and inputs at 16px+ so iOS never zooms in when one is focused */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (pointer: coarse) { input, textarea, select { font-size: max(16px, 1em) !important; } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.2px; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(120, 140, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 140, 255, 0.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%); }
.ambient .blob { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: 0.35; animation: drift 26s ease-in-out infinite alternate; }
.ambient .b1 { background: #4b3bff; top: -25vmax; left: -15vmax; }
.ambient .b2 { background: #ff3d9a; top: 10vmax; right: -25vmax; animation-delay: -8s; opacity: 0.22; }
.ambient .b3 { background: #00c2ff; bottom: -30vmax; left: 20vmax; animation-delay: -16s; opacity: 0.2; }
:root[data-theme='lavender'] .ambient::before { display: none; }
:root[data-theme='lavender'] .ambient .blob { opacity: 0.35; filter: blur(110px); }
:root[data-theme='lavender'] .ambient .b1 { background: #b9a6ff; }
:root[data-theme='lavender'] .ambient .b2 { background: #ffc2e3; }
:root[data-theme='lavender'] .ambient .b3 { background: #b8e4ff; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(14, 16, 40, 0.75), rgba(10, 12, 30, 0.55)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
:root[data-theme='lavender'] .side { background: linear-gradient(180deg, #8f7cf7, #7b67ee); border: 0; color: #fff; margin: 14px 0 14px 14px; height: calc(100vh - 28px); border-radius: 28px; box-shadow: var(--shadow); }
.side .me { display: grid; justify-items: center; gap: 6px; padding: 10px 0 18px; }
.side .me .hello { font-weight: 700; font-size: 17px; }
.side .me .sub { font-size: 12px; color: var(--text-2); font-weight: 600; }
:root[data-theme='lavender'] .side .me .sub { color: rgba(255, 255, 255, 0.8); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; font-weight: 600; color: var(--text-2); transition: 0.15s; }
.nav-item .ni { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: rgba(255, 255, 255, 0.05); }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.on { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-item.on .ni { background: var(--grad); box-shadow: 0 6px 18px rgba(139, 92, 255, 0.4); }
:root[data-theme='lavender'] .nav-item { color: rgba(255, 255, 255, 0.85); }
:root[data-theme='lavender'] .nav-item.on { background: #fff; color: #5b47d6; box-shadow: 0 8px 20px rgba(60, 30, 160, 0.25); }
:root[data-theme='lavender'] .nav-item .ni { background: rgba(255, 255, 255, 0.18); }
.nav-item .badge { margin-left: auto; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--pink); color: #fff; }
.side .spacer { flex: 1; }
.side-card { border-radius: 20px; padding: 16px; background: linear-gradient(160deg, rgba(255, 154, 61, 0.22), rgba(255, 94, 168, 0.18)); border: 1px solid rgba(255, 154, 61, 0.3); text-align: center; }
:root[data-theme='lavender'] .side-card { background: #ffd9e8; color: #6a2a4a; border: 0; }
.side-card .big { font-size: 30px; }
.side-card b { display: block; font-size: 15px; margin: 4px 0 2px; }
.side-card span { font-size: 12px; opacity: 0.8; }

.main { min-width: 0; padding: 22px 28px 60px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.topbar h1 { font-size: 28px; font-weight: 800; }
.topbar .sub { color: var(--text-2); font-weight: 500; font-size: 14px; margin-top: 2px; }
.chips { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); font-size: 17px; flex: none; }

.mobile-top, .tabbar { display: none; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: calc(64px + var(--safe-t)) 14px calc(96px + var(--safe-b)); }
  .topbar { margin-bottom: 14px; }
  .topbar h1 { font-size: 24px; }
  .topbar .chips { display: none; }
  .mobile-top { display: flex; position: fixed; z-index: 20; top: 0; left: 0; right: 0; padding: calc(10px + var(--safe-t)) 14px 10px; align-items: center; gap: 8px; background: linear-gradient(180deg, var(--bg) 40%, transparent); }
  .mobile-top .chip { height: 34px; padding: 0 10px; font-size: 13px; }
  .tabbar { display: grid; position: fixed; z-index: 20; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); height: 66px; grid-template-columns: repeat(5, 1fr); align-items: center; border-radius: 24px; background: rgba(16, 18, 44, 0.92); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45); }
  :root[data-theme='lavender'] .tabbar { background: rgba(255, 255, 255, 0.95); }
  .tab { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--text-3); }
  .tab .ti { font-size: 21px; filter: grayscale(0.5); opacity: 0.85; }
  .tab.on { color: var(--text); }
  .tab.on .ti { filter: none; opacity: 1; transform: scale(1.1); }
  .tab.fab .ti { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--grad); filter: none; opacity: 1; margin-top: -26px; box-shadow: 0 10px 28px rgba(139, 92, 255, 0.55); font-size: 24px; }
}

/* ---------- grid + cards ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(12, 1fr); align-items: start; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: 1 / -1; }
@media (max-width: 1280px) { .s3 { grid-column: span 6; } .s4 { grid-column: span 6; } .s5, .s7 { grid-column: span 6; } .s8 { grid-column: span 12; } }
@media (max-width: 900px) { .grid { gap: 12px; } .s3, .s4, .s5, .s6, .s7, .s8 { grid-column: 1 / -1; } .s3.half, .s4.half { grid-column: span 6; } }

.card { --a: var(--violet); position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); min-width: 0; }
.card.neon { border-color: color-mix(in srgb, var(--a) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--a) 18%, transparent), 0 0 28px color-mix(in srgb, var(--a) 16%, transparent), var(--shadow); }
:root[data-theme='lavender'] .card.neon { border-color: var(--line); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 15px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-2); }
.card-h .link { font-size: 13px; font-weight: 700; color: var(--text-2); padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.card.tilt { transition: transform 0.25s ease; transform-style: preserve-3d; }

.tile { border-radius: 22px; padding: 16px; border: 1px solid var(--line); background: var(--card); position: relative; overflow: hidden; }
.tile .ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--a, var(--violet)) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a, var(--violet)) 30%, transparent); }
.tile .lbl { font-size: 13px; color: var(--text-2); font-weight: 600; margin-top: 12px; }
.tile .val { font-size: 28px; font-weight: 800; margin-top: 2px; letter-spacing: -0.5px; }
.tile .delta { font-size: 12px; font-weight: 700; color: var(--green); margin-top: 2px; }
:root[data-theme='lavender'] .tile { background: color-mix(in srgb, var(--a) 12%, white); border: 0; box-shadow: var(--shadow); }

/* ---------- hero banner ---------- */
.banner { align-self: stretch; position: relative; overflow: hidden; border-radius: 28px; padding: 26px 28px; min-height: 180px; display: flex; align-items: center; gap: 24px; background: radial-gradient(120% 140% at 0% 0%, rgba(79, 168, 255, 0.35), transparent 50%), radial-gradient(100% 120% at 100% 100%, rgba(255, 94, 168, 0.3), transparent 55%), linear-gradient(135deg, #1a1748, #241a5c); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
:root[data-theme='lavender'] .banner { background: linear-gradient(135deg, #cdbfff, #e7dcff); color: #2a2350; border: 0; }
.banner h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.banner p { margin: 8px 0 16px; color: var(--text-2); font-size: 15px; max-width: 520px; line-height: 1.45; }
.banner .art { margin-left: auto; font-size: 92px; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.35)); animation: bob 5s ease-in-out infinite; flex: none; }
.banner .stars { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff8, transparent), radial-gradient(1px 1px at 70% 20%, #fff9, transparent), radial-gradient(1.5px 1.5px at 85% 65%, #fff7, transparent), radial-gradient(1px 1px at 40% 80%, #fff8, transparent), radial-gradient(1px 1px at 55% 45%, #fff6, transparent); pointer-events: none; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
@media (max-width: 900px) { .banner { padding: 20px; min-height: 0; } .banner h2 { font-size: 23px; } .banner .art { font-size: 60px; position: absolute; right: 14px; top: 10px; opacity: 0.9; } .banner p { padding-right: 40px; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 14px; font-weight: 700; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-2); transition: transform 0.12s, filter 0.2s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.1); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px rgba(139, 92, 255, 0.4); }
.btn.gold { background: linear-gradient(180deg, #ffd062, #ffab1f); color: #3a2400; border-color: transparent; box-shadow: 0 8px 22px rgba(255, 170, 30, 0.3); }
.btn.danger { background: rgba(255, 93, 115, 0.14); border-color: rgba(255, 93, 115, 0.4); color: #ff9aaa; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 34px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.btn.block { width: 100%; }
:root[data-theme='lavender'] .btn { background: #fff; }
:root[data-theme='lavender'] .btn.primary { background: linear-gradient(135deg, #8f7cf7, #b07cf7); }

/* ---------- bars / rings ---------- */
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; position: relative; }
:root[data-theme='lavender'] .bar { background: rgba(90, 70, 170, 0.1); }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--a, var(--blue)) 70%, #000), var(--a, var(--blue))); box-shadow: 0 0 12px color-mix(in srgb, var(--a, var(--blue)) 60%, transparent); transition: width 0.7s cubic-bezier(.2,.8,.2,1); }
.bar.thick { height: 12px; }
.bar.thin { height: 5px; }
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); position: absolute; inset: 0; }
.ring .rv { text-align: center; line-height: 1.05; }
.ring .rv b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.ring .rv span { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- list rows ---------- */
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); margin-bottom: 8px; transition: 0.2s; }
:root[data-theme='lavender'] .item { background: #fff; }
.item:last-child { margin-bottom: 0; }
.item.done { opacity: 0.55; }
.item.done .it { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 40%, transparent); }
.item .it { font-weight: 700; font-size: 15px; }
.item .im { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.check { width: 28px; height: 28px; flex: none; border-radius: 9px; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 14px; color: #fff; transition: 0.15s; }
.check:hover { border-color: var(--cyan); }
.done .check, .check.on { background: linear-gradient(160deg, #35e09a, #2fb8ff); border-color: transparent; }
.xp { font-size: 13px; font-weight: 800; color: var(--cyan); white-space: nowrap; }
:root[data-theme='lavender'] .xp { color: #7b5cf0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--a, var(--violet)) 18%, transparent); color: color-mix(in srgb, var(--a, var(--violet)) 55%, var(--text)); border: 1px solid color-mix(in srgb, var(--a, var(--violet)) 30%, transparent); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a, var(--violet)); box-shadow: 0 0 8px var(--a, var(--violet)); flex: none; }
.icon-sq { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; flex: none; background: color-mix(in srgb, var(--a, var(--violet)) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a, var(--violet)) 30%, transparent); }

/* ---------- avatar ---------- */
.avatar { --a: var(--violet); position: relative; width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 24px; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--a) 55%, white), var(--a) 55%, color-mix(in srgb, var(--a) 45%, black)); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 8px 24px color-mix(in srgb, var(--a) 45%, transparent); }
.avatar.xl { width: 92px; height: 92px; font-size: 52px; }
.avatar.lg { width: 64px; height: 64px; font-size: 36px; }
.avatar.sm { width: 32px; height: 32px; font-size: 17px; }
.avatar .lv { position: absolute; bottom: -3px; right: -5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: #3a2400; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.avatar.sm .lv { min-width: 16px; height: 16px; font-size: 9px; }

/* ---------- tabs (segmented) ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button, .seg label span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button.on, .seg input:checked + span { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(139, 92, 255, 0.35); }
.seg input { display: none; }

/* ---------- forms / modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(4, 4, 18, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; animation: fade 0.2s; }
.modal { width: min(580px, 100%); max-height: 90vh; overflow-y: auto; background: var(--card-solid); border: 1px solid var(--line-2); border-radius: 28px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); animation: pop 0.25s cubic-bezier(.2,.8,.2,1); }
@media (max-width: 700px) { .modal-bg { place-items: end center; padding: 0; } .modal { border-radius: 28px 28px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); max-height: 92vh; } }
.modal h2 { font-size: 24px; font-weight: 800; }
.modal .sub { color: var(--text-2); margin: 6px 0 18px; line-height: 1.45; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 14px; } /* minmax: a time/date input's native min width spilled into the next field on phones */
.field > span { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 1px; }
.input { width: 100%; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); padding: 0 14px; outline: none; font-weight: 500; }
:root[data-theme='lavender'] .input { background: #f6f3ff; }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input[type='time'], .input[type='date'] { padding: 0 10px; } /* narrow 3-up rows on a phone: room for "10:30 PM" */
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 255, 0.2); }
select.input option { background: var(--card-solid); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches input { display: none; }
.swatches span { width: 32px; height: 32px; border-radius: 50%; display: block; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1); }
.swatches input:checked + span { box-shadow: 0 0 0 3px var(--text), 0 0 18px var(--c); }
.emoji-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.emoji-pick input { display: none; }
.emoji-pick span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); cursor: pointer; }
.emoji-pick input:checked + span { background: var(--grad-soft); border-color: var(--violet); transform: scale(1.06); }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 60; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; max-width: 100%; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; line-height: 1.35; color: #fff; background: rgba(22, 20, 48, 0.88); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 10px 30px -8px rgba(10, 8, 40, 0.5); animation: toastIn 0.32s cubic-bezier(.2,.9,.3,1.2); display: flex; gap: 8px; align-items: center; transition: opacity 0.25s, transform 0.25s; }
.toast.out { opacity: 0; transform: translateY(-8px) scale(0.97); }
.toast.xp { background: linear-gradient(135deg, rgba(53, 140, 255, 0.92), rgba(124, 92, 255, 0.92)); }
.toast.gold { background: linear-gradient(135deg, rgba(255, 170, 40, 0.94), rgba(255, 110, 60, 0.94)); }
.toast.err { background: rgba(200, 40, 70, 0.92); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: none; } }
.wa-tile.drawing .wa-pic { background: linear-gradient(110deg, var(--hm-soft) 30%, color-mix(in srgb, var(--violet) 25%, transparent) 50%, var(--hm-soft) 70%); background-size: 200% 100%; animation: waShimmer 1.2s linear infinite; }
@keyframes waShimmer { to { background-position: -200% 0; } }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
@keyframes pop { from { transform: translateY(20px) scale(0.98); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.page > * { animation: rise 0.45s cubic-bezier(.2,.8,.2,1) both; }
.page > *:nth-child(2) { animation-delay: 0.04s; } .page > *:nth-child(3) { animation-delay: 0.08s; } .page > *:nth-child(4) { animation-delay: 0.12s; }

.empty { text-align: center; padding: 26px 14px; color: var(--text-2); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 8px; padding: 3px 7px; word-break: break-all; }
.section { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 12px; gap: 12px; }
.section h2 { font-size: 20px; font-weight: 800; }
.hand { font-family: var(--hand); font-size: 22px; line-height: 1.25; }
.confetti { position: fixed; z-index: 70; pointer-events: none; inset: 0; }
.side { overflow-y: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.nav-item { padding: 7px 12px; }
.nav-item .ni { width: 30px; height: 30px; font-size: 16px; }
.side .me { padding: 4px 0 12px; }
@media (max-height: 900px) { .side .avatar.xl { width: 64px; height: 64px; font-size: 36px; } .side-card { display: none; } }
:root[data-theme='lavender'] .btn.gold { background: linear-gradient(180deg, #ffd062, #ffab1f); color: #3a2400; }
:root[data-theme='lavender'] .btn.danger { background: rgba(255, 93, 115, 0.1); color: #d6334f; }
:root[data-theme='lavender'] .btn.ghost { background: transparent; }
#demoBar { position: sticky; top: 0; z-index: 100; padding: 9px 16px; text-align: center; font-weight: 600; font-size: 14px; background: #ffb02e; color: #2a1a00; }
#demoBar a { color: #2a1a00; font-weight: 800; }

/* #/page?show=<id>: what the partner points at glows for a moment */
@keyframes ql-show { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 25%, 70% { box-shadow: 0 0 0 3px var(--violet), 0 0 28px color-mix(in srgb, var(--violet) 55%, transparent); } }
.ql-show { animation: ql-show 2.4s ease both; border-radius: inherit; position: relative; z-index: 1; }
/* phone on its side: the tab bar and top bar get out of the way; a small ☰ brings the tab bar back */
#navPeek { display: none; }
@media (orientation: landscape) and (max-height: 520px) {
  body:not(.nav-show) .tabbar, body:not(.nav-show) .mobile-top { display: none !important; }
  #navPeek { display: grid; place-items: center; position: fixed; z-index: 21; left: calc(10px + var(--safe-l, 0px)); bottom: calc(10px + var(--safe-b)); width: 40px; height: 40px; border-radius: 14px; background: rgba(16, 18, 44, 0.75); color: #fff; font-size: 18px; border: 1px solid var(--line-2); backdrop-filter: blur(10px); }
  body.nav-show #navPeek { bottom: calc(84px + var(--safe-b)); }
}
/* tablets held upright (700–900 px): two columns of cards instead of one stretched column */
@media (min-width: 700px) and (max-width: 900px) {
  .grid > .s3, .grid > .s4, .grid > .s5, .grid > .s6 { grid-column: span 6; }
  .page { max-width: none; }
}
/* phone top bar: solid (with a soft blur) so scrolled content never shows through it */
@media (max-width: 900px) {
  .mobile-top { background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
}
/* a page redrawn because data changed (not because you navigated): no entrance animations, no flash */
.page.quiet, .page.quiet *, .page.quiet *::before, .page.quiet *::after { animation: none !important; }
/* wallpaper picture picker (Settings → Phone / Mac wallpaper) */
.wa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; width: 100%; }
.wa-tile { display: grid; gap: 6px; padding: 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-2); background: none; border: 0; cursor: pointer; }
.wa-pic { position: relative; aspect-ratio: 9 / 15; border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, 0.06); border: 2px solid transparent; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.wa-pic svg, .wa-pic .wa-sky, .wa-pic .wa-sky svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wa-tile:hover .wa-pic { transform: translateY(-2px); }
.wa-tile.on .wa-pic { border-color: #8b5cff; box-shadow: 0 0 0 3px rgba(139, 92, 255, 0.35), 0 10px 24px rgba(0, 0, 0, 0.3); }
.wa-tile.on .wa-pic::after { content: '✓'; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; background: #8b5cff; }
.wa-tile.on span { color: var(--text); }
@media (max-width: 760px) { .wa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
.wa-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; width: 100%; }
.wa-ask .input { height: 40px; }
.wa-tile[hidden] { display: none; }
.at-notme { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* /css/auth.css */
/* Questline — sign in / sign up / account / admin (built on os.css tokens) */
body.auth { min-height: 100vh; min-height: 100dvh; }
.au-app { min-height: 100vh; min-height: 100dvh; padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b)); display: grid; }
.au-loading { display: grid; place-items: center; }
.au-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--violet); animation: au-rot 0.9s linear infinite; }
@keyframes au-rot { to { transform: rotate(360deg); } }

/* ---------- split screen: story on the left, form on the right ---------- */
.au-split { width: min(1040px, 100%); margin: auto; display: grid; grid-template-columns: 1.05fr 1fr; gap: 0; border-radius: 32px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.au-story { position: relative; padding: 40px 38px; color: #fff; background: radial-gradient(120% 80% at 10% 0%, #6d5cff 0%, transparent 60%), radial-gradient(90% 70% at 100% 100%, #ff5ea8 0%, transparent 55%), linear-gradient(160deg, #2b1f7a, #171044 70%); display: flex; flex-direction: column; gap: 18px; min-height: 560px; overflow: hidden; }
:root[data-theme='lavender'] .au-story { background: radial-gradient(120% 80% at 10% 0%, #a48cff 0%, transparent 60%), radial-gradient(90% 70% at 100% 100%, #ff9fcf 0%, transparent 55%), linear-gradient(160deg, #8f7cf7, #6b57e6 75%); }
.au-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -0.2px; }
.au-logo { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.au-story h1 { font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -1px; margin-top: auto; }
.au-story h1 em { font-style: normal; font-family: var(--hand); font-size: 1.15em; color: #ffd36b; letter-spacing: 0; }
.au-story p { margin: 0; font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, 0.82); max-width: 380px; }
.au-feats { display: grid; gap: 10px; margin-top: 6px; }
.au-feat { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.au-feat i { font-style: normal; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); flex: none; }
/* the little floating island with the hero walking on it */
.au-island { position: absolute; right: -28px; top: 64px; width: 230px; height: 190px; pointer-events: none; animation: au-float 6s ease-in-out infinite; opacity: 0.95; }
.au-island .top { position: absolute; left: 20px; right: 20px; top: 70px; height: 44px; border-radius: 50%; background: linear-gradient(180deg, #8ef0b0, #3fbf7f); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12); }
.au-island .rock { position: absolute; left: 44px; right: 44px; top: 92px; height: 86px; clip-path: polygon(0 0, 100% 0, 70% 70%, 50% 100%, 32% 72%); background: linear-gradient(180deg, #8a6bd6, #4b3592); }
.au-island .hero { position: absolute; left: 92px; top: 30px; font-size: 44px; animation: au-bob 1.6s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3)); }
.au-island .flag { position: absolute; left: 150px; top: 22px; font-size: 30px; }
.au-island .tree { position: absolute; left: 38px; top: 40px; font-size: 32px; }
@keyframes au-float { 50% { transform: translateY(-12px); } }
@keyframes au-bob { 50% { transform: translateY(-5px) rotate(-3deg); } }

.au-form { padding: 40px 38px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.au-form h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.4px; }
.au-form .au-sub { color: var(--text-2); margin: 6px 0 22px; font-weight: 500; line-height: 1.45; }
.au-form .field { margin-bottom: 12px; }
body.auth .field > span { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; }
body.auth .field > span small { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-3); }
.au-pw { position: relative; }
.au-pw .input { padding-right: 56px; }
.au-eye { position: absolute; right: 6px; top: 6px; height: 34px; padding: 0 10px; border-radius: 10px; font-size: 12px; font-weight: 800; color: var(--text-2); }
.au-eye:hover { background: rgba(128, 128, 200, 0.12); }
.au-meter { height: 5px; border-radius: 9px; background: var(--line-2); overflow: hidden; margin-top: 2px; }
.au-meter i { display: block; height: 100%; width: 0; border-radius: 9px; transition: width 0.25s, background 0.25s; }
.au-check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-2); margin: 4px 0 18px; cursor: pointer; user-select: none; }
.au-check input { width: 20px; height: 20px; accent-color: var(--violet); }
.au-err { display: none; margin: -4px 0 14px; padding: 10px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; background: rgba(255, 93, 115, 0.12); border: 1px solid rgba(255, 93, 115, 0.4); color: #ff8b9c; }
:root[data-theme='lavender'] .au-err { color: #c4304a; }
.au-err.on { display: block; }
.au-note { padding: 12px 14px; border-radius: 16px; background: var(--grad-soft); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; line-height: 1.45; margin-bottom: 16px; }
.au-alt { margin-top: 18px; text-align: center; color: var(--text-2); font-weight: 600; }
.au-alt a, .au-link { color: var(--violet); font-weight: 700; }
:root:not([data-theme='lavender']) .au-alt a, :root:not([data-theme='lavender']) .au-link { color: #a98bff; }
.au-hero-chip { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: rgba(128, 128, 200, 0.08); border: 1px solid var(--line-2); margin-bottom: 16px; }
.au-av { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; background: color-mix(in srgb, var(--a, var(--violet)) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a, var(--violet)) 45%, transparent); flex: none; }
.au-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }

/* ---------- centered single card (pending / blocked / demo) ---------- */
.au-solo { width: min(520px, 100%); margin: auto; text-align: center; padding: 38px 30px; border-radius: 32px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.au-solo h2 { font-size: 26px; font-weight: 800; margin-top: 18px; }
.au-solo p { color: var(--text-2); line-height: 1.5; font-weight: 500; }
.au-wait { position: relative; width: 132px; height: 132px; margin: 0 auto; display: grid; place-items: center; font-size: 56px; }
.au-wait::before, .au-wait::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--cyan); border-right-color: var(--violet); animation: au-rot 2.4s linear infinite; }
.au-wait::after { inset: 14px; border-top-color: var(--pink); border-right-color: transparent; animation-duration: 3.6s; animation-direction: reverse; }
.au-wait span { animation: au-bob 1.8s ease-in-out infinite; }
.au-steps { display: grid; gap: 8px; text-align: left; margin: 22px 0 6px; }
.au-step { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(128, 128, 200, 0.07); font-weight: 600; font-size: 14px; }
.au-step b { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 13px; flex: none; }
.au-step.done b { background: var(--green); }
.au-step.now { box-shadow: inset 0 0 0 1px var(--violet); }

/* ---------- account + admin ---------- */
.au-page { width: min(920px, 100%); margin: 0 auto; display: grid; gap: 16px; align-content: start; }
.au-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.au-top h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.4px; }
.au-top .grow { min-width: 160px; }
.au-top .sub { color: var(--text-2); font-weight: 500; margin-top: 2px; }
.au-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.au-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); min-width: 0; }
.au-card.wide { grid-column: 1 / -1; }
.au-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.au-card .hint { color: var(--text-2); font-size: 14px; font-weight: 500; margin: 0 0 14px; line-height: 1.45; }
.au-dev { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(128, 128, 200, 0.06); border: 1px solid var(--line); margin-bottom: 8px; }
.au-dev .ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; background: rgba(128, 128, 200, 0.12); flex: none; }
.au-dev .t { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.au-dev .m { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 3px; }
.au-dev.me { border-color: color-mix(in srgb, var(--green) 50%, transparent); }
.au-token { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px dashed var(--line-2); margin: 8px 0; user-select: all; }
:root[data-theme='lavender'] .au-token { background: rgba(90, 70, 170, 0.06); }
.au-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.au-tabs button { height: 38px; padding: 0 16px; border-radius: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.au-tabs button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(139, 92, 255, 0.35); }
.au-tabs .n { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); }
.au-tabs button:not(.on) .n { background: var(--pink); color: #fff; }
.au-user { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.au-user .who b { font-size: 16px; }
.au-user .meta { font-size: 13px; color: var(--text-2); font-weight: 600; margin-top: 3px; display: flex; gap: 6px 10px; flex-wrap: wrap; }
.au-user .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.au-user select.input { height: 38px; width: auto; min-width: 190px; border-radius: 11px; font-size: 14px; }
.au-empty { text-align: center; padding: 40px 16px; color: var(--text-2); font-weight: 600; border-radius: var(--r); border: 1px dashed var(--line-2); }
.au-empty .big { font-size: 40px; margin-bottom: 8px; }
.au-list { display: grid; gap: 10px; }

@media (max-width: 860px) {
  .au-split { grid-template-columns: 1fr; border-radius: 28px; }
  .au-story { min-height: 0; padding: 22px 22px 20px; gap: 10px; }
  .au-story h1 { font-size: 26px; margin-top: 6px; letter-spacing: -0.5px; }
  .au-story p, .au-feats, .au-island { display: none; }
  .au-form { padding: 24px 22px 26px; }
  .au-form h2 { font-size: 24px; }
  .au-form .au-sub { margin-bottom: 16px; }
  .au-cards { grid-template-columns: 1fr; }
  .au-user { grid-template-columns: auto 1fr; }
  .au-user .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .au-user select.input { flex: 1 1 100%; min-width: 0; width: 100%; }
}
@media (max-width: 420px) {
  .au-app { padding-left: 12px; padding-right: 12px; }
  .au-form { padding: 22px 18px 24px; }
  .au-solo { padding: 30px 20px; }
}
