:root {
  --brand: #16a34a; --brand-2: #22c55e; --brand-soft: #dcfce7; --brand-ink: #14532d;
  --bg: #f4f7f5; --surface: #ffffff; --surface-2: #f0f4f1; --border: #e1e8e3; --border-strong: #c9d5cd;
  --text: #101a14; --text-2: #4b5d52; --text-3: #81938a;
  --danger: #dc2626; --danger-soft: #fee2e2; --warn: #d97706; --warn-soft: #fef3c7; --info: #2563eb; --info-soft: #dbeafe;
  --hm0: #e6ebe8; --hm1: #fde68a; --hm2: #bbf7d0; --hm3: #4ade80; --hm4: #15803d; --hmrest: #e2e8f0;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(16,26,20,.05), 0 4px 16px rgba(16,26,20,.05);
  --nav-h: 66px; --side-w: 236px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --brand: #22c55e; --brand-2: #4ade80; --brand-soft: #0f2e1c; --brand-ink: #bbf7d0;
  --bg: #0b100d; --surface: #131a16; --surface-2: #19221d; --border: #223029; --border-strong: #2f4237;
  --text: #e8f0ea; --text-2: #a3b5aa; --text-3: #6e8277;
  --danger: #f87171; --danger-soft: #3a1414; --warn: #fbbf24; --warn-soft: #3a2a0a; --info: #60a5fa; --info-soft: #10223f;
  --hm0: #1c2620; --hm1: #a16207; --hm2: #166534; --hm3: #22c55e; --hm4: #86efac; --hmrest: #1e293b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 26px; height: 26px; } .ic.xl { width: 40px; height: 40px; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; } .center { text-align: center; } .hide { display: none !important; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Layout ---------- */
#app { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 750; font-size: 20px; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 520; position: relative; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-ink); }
html[data-theme="dark"] .nav-link.active { color: var(--brand-2); }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.sidebar .spacer { flex: 1; }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 28px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { flex: 1; min-width: 180px; }
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--border);
  }
  .topbar .brand { padding: 0; font-size: 18px; flex: 1; }
  .topbar .brand img { width: 28px; height: 28px; }
  .page { padding: 18px 14px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 11px; font-weight: 560; border-radius: 12px; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav .fab { background: var(--brand); color: #fff; width: 52px; height: 52px; border-radius: 16px; margin: -18px auto 0; box-shadow: 0 6px 18px rgba(22,163,74,.4); }
  .bottom-nav .fab .ic { width: 26px; height: 26px; }
  h1 { font-size: 21px; }
  .hide-m { display: none !important; }
  .stat-card { gap: 10px; padding: 14px; }
  .stat-ico { width: 38px; height: 38px; }
  .stat .v { font-size: 22px; }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 16px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--brand); color: #fff;
  transition: transform .08s ease, filter .15s ease, background .15s ease; white-space: nowrap; min-height: 42px;
}
.btn:hover { filter: brightness(1.05); } .btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; min-height: 38px; min-width: 38px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.hint { font-size: 12px; color: var(--text-3); }
.err-text { font-size: 13px; color: var(--danger); min-height: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 560; cursor: pointer; }
.chip.on { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand); }
html[data-theme="dark"] .chip.on { color: var(--brand-2); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.green { background: var(--brand-soft); color: var(--brand-ink); } html[data-theme="dark"] .badge.green { color: var(--brand-2); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.progress.thin { height: 6px; }
.progress.time > span { background: var(--border-strong); }
.progress.xp > span { background: linear-gradient(90deg, #8b5cf6, #22c55e); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--text-2); font-weight: 560; }
.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.stat-ico.violet { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #8b5cf6; }
.stat-ico.orange { background: color-mix(in srgb, #f97316 16%, transparent); color: #f97316; }
.stat-ico.blue { background: color-mix(in srgb, #3b82f6 16%, transparent); color: #3b82f6; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.list-item.click:hover { background: var(--surface-2); }
.empty { text-align: center; padding: 34px 16px; color: var(--text-2); }
.empty .ic { width: 44px; height: 44px; color: var(--text-3); margin-bottom: 8px; }

/* ---------- Goal cards ---------- */
.goal-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .15s ease, border-color .15s; position: relative; overflow: hidden; }
.goal-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.goal-card .cover { height: 92px; margin: -18px -18px 0; background-size: cover; background-position: center; }
.goal-card .title { font-weight: 650; font-size: 16px; }
.goal-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.goal-meta span { display: inline-flex; align-items: center; gap: 5px; }
.prog-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 560; }

/* ---------- Countdown ---------- */
.countdown { border-radius: var(--radius); padding: 18px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); background: var(--surface); }
.countdown .num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.countdown .unit { font-size: 13px; font-weight: 600; color: var(--text-2); }
.countdown.reminder { border-color: color-mix(in srgb, var(--info) 45%, var(--border)); }
.countdown.highlight { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 50%, transparent); }
.countdown.highlight .num { color: var(--info); }
.countdown.strong { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.countdown.strong .num { color: var(--warn); }
.countdown.final, .countdown.last_day { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.countdown.final .num, .countdown.last_day .num { color: var(--danger); }
.countdown.last_day .num, .countdown.final .num { animation: pulse 1.6s ease-in-out infinite; }
.countdown.review { background: var(--surface-2); border-style: dashed; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.mini-count { font-weight: 700; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; }
.mini-count.highlight { background: var(--info-soft); color: var(--info); }
.mini-count.strong { background: var(--warn-soft); color: var(--warn); }
.mini-count.final, .mini-count.last_day { background: var(--danger-soft); color: var(--danger); }
.mini-count.review { background: var(--danger-soft); color: var(--danger); }

/* ---------- Heatmap ---------- */
.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: inline-grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; }
.heatmap .c { width: 13px; height: 13px; border-radius: 3px; background: var(--hm0); cursor: pointer; border: 0; padding: 0; }
.heatmap .c:hover { outline: 2px solid var(--text-2); outline-offset: 1px; }
.heatmap .c.pad { visibility: hidden; cursor: default; }
.heatmap .c.future { opacity: .35; cursor: default; }
.heatmap .c.today { outline: 2px solid var(--brand); outline-offset: 1px; }
.l1 { background: var(--hm1) !important; } .l2 { background: var(--hm2) !important; } .l3 { background: var(--hm3) !important; } .l4 { background: var(--hm4) !important; }
.rest { background: repeating-linear-gradient(45deg, var(--hmrest), var(--hmrest) 2px, var(--hm0) 2px, var(--hm0) 4px) !important; }
.hm-months { display: grid; grid-auto-flow: column; gap: 3px; font-size: 11px; color: var(--text-3); margin-bottom: 4px; height: 15px; }
.hm-months span { width: 13px; white-space: nowrap; overflow: visible; }
.hm-body { display: flex; gap: 6px; }
.hm-days { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; font-size: 10px; color: var(--text-3); padding-top: 19px; }
.legend { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--hm0); }
.hm-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.hm-stats b { color: var(--text); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .wd { font-size: 12px; font-weight: 650; color: var(--text-3); text-align: center; padding: 4px 0; }
.cal .day { min-height: 74px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 7px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); }
.cal .day:hover { border-color: var(--border-strong); }
.cal .day.pad { visibility: hidden; }
.cal .day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.cal .day.sel { background: var(--brand-soft); }
.cal .day.future { opacity: .5; }
.cal .day .n { font-weight: 650; font-size: 13px; }
.cal .day .h { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.cal .day .bar { height: 5px; border-radius: 3px; background: var(--hm0); margin-top: auto; }
@media (max-width: 560px) { .cal { gap: 3px; } .cal .day { min-height: 52px; padding: 5px; border-radius: 9px; } .cal .day .h { font-size: 10px; } }

/* ---------- Level ---------- */
.level-card { background: linear-gradient(135deg, #14532d, #166534 55%, #15803d); color: #f0fdf4; border: 0; }
html[data-theme="dark"] .level-card { background: linear-gradient(135deg, #0f2e1c, #14532d 60%, #166534); }
.level-card, .level-card h2 { color: #f0fdf4; }
.level-card .muted { color: #bbf7d0; }
.level-card .progress { background: rgba(255,255,255,.18); }
.level-card .progress > span { background: linear-gradient(90deg, #fde047, #86efac); }
.level-num { width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 26px; font-weight: 800; flex: none; }

.badge-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.badge-tile .medal { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.badge-tile .medal .ic { width: 28px; height: 28px; }
.badge-tile.locked { opacity: .55; }
.badge-tile.locked .medal { background: var(--surface-2); color: var(--text-3); box-shadow: none; }
.badge-tile .nm { font-weight: 650; font-size: 13.5px; }

/* ---------- Modal / sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5,10,7,.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .18s ease; }
.sheet { background: var(--surface); border-radius: 20px; width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-head h2 { flex: 1; }
@media (max-width: 640px) {
  .overlay { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 22px 22px 0 0; max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* ---------- Toasts & celebrations ---------- */
#toasts { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 8px; align-items: center; animation: toastIn .3s cubic-bezier(.2,.8,.2,1); }
.toast.xp { background: linear-gradient(90deg, #7c3aed, #16a34a); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { transform: translateY(-14px) scale(.96); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-14px); opacity: 0; } }
.celebrate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(5,10,7,.7); animation: fade .25s ease; padding: 20px; }
.celebrate .box { background: var(--surface); border-radius: 24px; padding: 34px 28px; text-align: center; max-width: 360px; width: 100%; animation: pop .5s cubic-bezier(.2,1.4,.3,1); position: relative; overflow: hidden; }
.celebrate .big { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 28px; display: grid; place-items: center; font-size: 44px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #7c3aed, #16a34a); box-shadow: 0 12px 30px rgba(22,163,74,.35); }
.celebrate .big.medal { border-radius: 50%; background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.celebrate .big .ic { width: 46px; height: 46px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.confetti { position: absolute; width: 8px; height: 14px; top: -20px; border-radius: 2px; animation: fall 2.2s linear forwards; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: linear-gradient(150deg, #052e16, #14532d 45%, #16a34a); color: #f0fdf4; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h1 { font-size: 40px; letter-spacing: -.03em; margin: 20px 0 12px; line-height: 1.08; }
.auth-side p { color: #bbf7d0; font-size: 16px; max-width: 420px; }
.auth-side .feat { display: flex; gap: 10px; align-items: center; margin-top: 12px; color: #dcfce7; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 24px; margin-bottom: 6px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: calc(28px + env(safe-area-inset-top)) 22px 28px; }
  .auth-side h1 { font-size: 28px; margin: 14px 0 6px; }
  .auth-side .feats { display: none; }
}

/* ---------- Misc ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.hello { font-size: 13px; color: var(--text-2); font-weight: 560; }
.motivation { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 16px; color: var(--text-2); }
.ms-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ms-item:last-child { border-bottom: 0; }
.ms-check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; flex: none; background: transparent; color: #fff; padding: 0; }
.ms-check.on { background: var(--brand); border-color: var(--brand); }
.ms-item.done .t { text-decoration: line-through; color: var(--text-3); }
.act-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.act-item:last-child { border-bottom: 0; }
.act-dur { font-weight: 700; font-size: 14px; white-space: nowrap; }
.act-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); color: var(--info); font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.green { background: var(--brand-soft); color: var(--brand-ink); }
html[data-theme="dark"] .notice.green { color: var(--brand-2); }
.ai-text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; }
.ai-text ul { margin: 6px 0; padding-left: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-2); padding: 10px 14px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 13px; background: var(--surface-2); flex: none; }
.rank.r1 { background: #fde68a; color: #78350f; } .rank.r2 { background: #e2e8f0; color: #334155; } .rank.r3 { background: #fed7aa; color: #7c2d12; }
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.more-grid a { display: flex; flex-direction: column; gap: 10px; padding: 18px; color: var(--text); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.install-banner { display: flex; align-items: center; gap: 12px; }
.compare { display: flex; align-items: baseline; gap: 6px; font-weight: 700; }
.up { color: var(--brand); } .down { color: var(--danger); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl td, table.tbl th { padding: 9px 6px; border-bottom: 1px solid var(--border); text-align: left; }
table.tbl th { font-size: 12px; color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
table.tbl td.r, table.tbl th.r { text-align: right; }
