@font-face { font-family: 'DM Sans'; src: url('fonts/dmsans.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }

:root, [data-theme="royal"] {
  --bg: #FBF7FC; --card: #FFFFFF; --ink: #24152B; --soft: #6E5F75; --line: #EEE3F1;
  --pri: #7A2E8E; --pri-ink: #FFFFFF; --pri-soft: #F3E6F7; --acc: #E5484D; --acc-soft: #FFE6E4;
  --sun: #F5B82E; --mint: #1F9E74; --mint-soft: #DDF3EA; --warn: #D33A3A; --shadow: 0 10px 30px rgba(36, 21, 43, .08);
  --lime: #9BD34A; --save: #1F9E74;
}
[data-theme="teal"] { --bg: #F3FAF9; --line: #D9ECEA; --pri: #0F766E; --pri-soft: #DDF1EE; }
[data-theme="slate"] { --bg: #F5F7FA; --line: #E1E6EE; --pri: #334155; --pri-soft: #E4E9F0; }
[data-theme="night"] {
  --bg: #16111C; --card: #211A29; --ink: #F5EFF8; --soft: #B7A9C0; --line: #392E44;
  --pri: #D59AF0; --pri-ink: #16111C; --pri-soft: #3A2A47; --acc: #FF8A8A; --acc-soft: #4A2228; --mint-soft: #173D31; --warn: #FF8C97;
  --shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
[data-size="l"] { font-size: 18px; }
[data-size="xl"] { font-size: 20px; }

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; min-height: 100vh; padding-bottom: 84px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--soft); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

.demo-bar { background: var(--ink); color: var(--bg); text-align: center; font-size: .85rem; padding: 7px 12px; }
.demo-bar a { color: var(--sun); font-weight: 700; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1040px; margin: 0 auto; padding: 16px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.logo { width: 34px; height: 34px; border-radius: 11px; background: var(--pri); position: relative; flex: none; }
.logo::before { content: ''; position: absolute; inset: 7px; background: var(--pri-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 7l5 4 5-7 5 7 5-4-2 12H4z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 7l5 4 5-7 5 7 5-4-2 12H4z'/%3E%3C/svg%3E") center/contain no-repeat; }
.logo::after { content: ''; position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--sun); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { text-decoration: none; padding: 8px 13px; border-radius: 999px; font-weight: 600; color: var(--soft); }
.nav a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nav a.kidlink { background: var(--acc-soft); color: var(--ink); }
.tabbar { display: none; }

main { max-width: 1040px; margin: 0 auto; padding: 8px 20px 40px; outline: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 6px 0 18px; }
.pagehead h1 { margin: 0; }

label.f { display: block; font-weight: 700; margin: 0 0 6px; }
.input { width: 100%; border: 2px solid var(--line); background: var(--bg); border-radius: 14px; padding: 12px 14px; font-size: 1rem; }
.input:focus { outline: none; border-color: var(--pri); background: var(--card); }
textarea.input { min-height: 90px; resize: vertical; }
.hint { font-size: .85rem; color: var(--soft); margin-top: 6px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fgrid .full { grid-column: 1 / -1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; }
.chip.on { border-color: var(--pri); background: var(--pri-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 11px 16px; font-weight: 700; cursor: pointer; background: var(--pri-soft); color: var(--ink); text-decoration: none; }
.btn.pri { background: var(--pri); color: var(--pri-ink); }
.btn.acc { background: var(--acc); color: #fff; }
.btn.line { background: transparent; border: 2px solid var(--line); }
.btn.sm { padding: 7px 12px; font-size: .9rem; border-radius: 11px; }
.btn.big { width: 100%; font-size: 1.25rem; padding: 18px; border-radius: 18px; }
.btn.danger { background: transparent; border: 2px solid var(--line); color: var(--warn); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .chip:focus-visible, .nav a:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }

/* Kid cards */
.kid { position: relative; overflow: hidden; }
.kid .band { position: absolute; left: 0; top: 0; right: 0; height: 6px; background: var(--kc, var(--pri)); }
.kid-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.av { width: 46px; height: 46px; border-radius: 50%; background: var(--kc, var(--pri)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.kid-head .nm { font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.left-box { display: flex; align-items: center; gap: 16px; margin: 6px 0 12px; }
.mini-ring { width: 104px; height: 104px; position: relative; flex: none; }
.mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring .bg { stroke: var(--line); }
.mini-ring .fg { stroke: var(--kc, var(--pri)); stroke-linecap: round; }
.mini-ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.mini-ring .n { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.mini-ring .u { font-size: .72rem; color: var(--soft); font-weight: 700; }
.math { font-size: .9rem; color: var(--soft); }
.math b { color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; background: var(--pri-soft); }
.pill.mode { background: #FFF1CC; color: #6B4E00; }
.pill.off { background: var(--acc-soft); color: var(--warn); }
.pill.ok { background: var(--mint-soft); color: #0E6B55; }
[data-theme="night"] .pill.mode { background: #4A3D14; color: #FFE7A3; }
[data-theme="night"] .pill.ok { color: #9BF0D8; }
.running { background: var(--pri-soft); border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.running .clock { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.running.warn { background: #FFF1CC; }
.running.over { background: var(--acc-soft); }
[data-theme="night"] .running.warn { background: #4A3D14; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 700; }
.tag { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--pri-soft); white-space: nowrap; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 7px 9px; border-radius: 10px; color: var(--soft); font-weight: 700; }
.icon-btn:hover { background: var(--pri-soft); color: var(--ink); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--sun); }

.alert { background: #FFF1CC; border-radius: 16px; padding: 14px 16px; }
[data-theme="night"] .alert { background: #4A3D14; }
.alert .list li { border-color: rgba(0,0,0,.08); flex-wrap: wrap; }
.alert .list li .grow { min-width: 55%; }

/* Week */
.wbars { display: flex; gap: 8px; align-items: flex-end; height: 130px; margin-top: 10px; }
.wbars .d { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: .72rem; color: var(--soft); font-weight: 700; }
.wbars .col { width: 100%; max-width: 34px; position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.wbars .lim { position: absolute; left: -3px; right: -3px; border-top: 2px dashed var(--soft); opacity: .55; }
.wbars .use { background: var(--kc, var(--pri)); border-radius: 7px 7px 3px 3px; min-height: 3px; }
.wbars .use.over { background: var(--acc); }
.stat-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.stat .n { font-size: 1.1rem; font-weight: 800; white-space: nowrap; }
.stat .l { font-size: .75rem; color: var(--soft); font-weight: 700; }

/* Welcome */
.hero h1 { font-size: 2.3rem; }
.hero .lead { font-size: 1.1rem; color: var(--soft); max-width: 36em; }
.kidrows .kr { display: grid; grid-template-columns: 1fr 120px 40px; gap: 8px; margin-bottom: 8px; }

/* Kid view */
body.kidmode .top, body.kidmode .tabbar, body.kidmode .demo-bar { display: none; }
body.kidmode { padding-bottom: 20px; }
.kv { max-width: 640px; margin: 0 auto; text-align: center; }
.kv-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0 6px; }
.kv-tab { border: 3px solid transparent; background: var(--card); border-radius: 999px; padding: 6px 16px 6px 6px; display: flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); }
.kv-tab .av { width: 34px; height: 34px; font-size: 1rem; }
.kv-tab.on { border-color: var(--kc); }
.kv .big-ring { width: min(72vw, 300px); aspect-ratio: 1; margin: 14px auto 6px; position: relative; }
.kv .big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.kv .big-ring .bg { stroke: var(--line); }
.kv .big-ring .fg { stroke: var(--kc); stroke-linecap: round; }
.kv .big-ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.kv .big-ring .n { font-size: 4rem; font-weight: 800; line-height: 1; }
.kv .big-ring .u { font-weight: 700; color: var(--soft); }
.earn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.earn { border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 14px; cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.earn span:first-child { text-align: left; }
.earn:hover { border-color: var(--kc, var(--pri)); }
.earn .plus { color: #0E6B55; background: var(--mint-soft); border-radius: 999px; padding: 2px 9px; font-size: .85rem; white-space: nowrap; }
[data-theme="night"] .earn .plus { color: #9BF0D8; }
.kv-top { display: flex; justify-content: flex-end; padding-top: 10px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; justify-content: center; margin-top: 12px; }
.pinpad button { height: 56px; border-radius: 14px; border: 0; background: var(--pri-soft); font-weight: 800; font-size: 1.3rem; cursor: pointer; }
.pindots { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--soft); }
.pindots i.on { background: var(--ink); border-color: var(--ink); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal .sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; }
.modal .sheet h2 { margin-bottom: 12px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* Agreement */
.agree { max-width: 820px; margin: 0 auto; }
.agree .doc { background: #fff; color: #1F2A44; border-radius: 18px; padding: 40px 44px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.agree .doc h1 { text-align: center; font-size: 2rem; margin-bottom: 4px; }
.agree .doc .sub { text-align: center; color: #5E6A85; margin-bottom: 22px; }
.agree .doc h2 { font-size: 1.1rem; color: #4C8DFF; border-bottom: 2px solid #E1ECFF; padding-bottom: 4px; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.agree .tbl { overflow-x: auto; }
.agree table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.agree th, .agree td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #E5EAF5; }
.agree th { background: #F3F7FF; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #5E6A85; }
.agree ul { margin: 0; padding-left: 1.2em; }
.agree li { margin: 4px 0; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 30px; margin-top: 14px; }
.sig { border-bottom: 1.5px solid #1F2A44; padding-top: 30px; font-size: .8rem; color: #5E6A85; position: relative; }
.sig span { position: absolute; bottom: -20px; left: 0; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 75; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .8; } }

.ic { width: 24px; height: 24px; display: inline-block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ic-sun { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Cpath d='M11 1h2v4h-2zM11 19h2v4h-2zM1 11h4v2H1zM19 11h4v2h-4zM4.2 5.6l1.4-1.4 2.8 2.8-1.4 1.4zM15.6 17l1.4-1.4 2.8 2.8-1.4 1.4zM4.2 18.4l2.8-2.8 1.4 1.4-2.8 2.8zM15.6 7l2.8-2.8 1.4 1.4L17 8.4z'/%3E%3C/svg%3E"); }
.ic-chart { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 20h18v2H3zM5 11h3v8H5zm5.5-6h3v14h-3zM16 8h3v11h-3z'/%3E%3C/svg%3E"); }
.ic-deal { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v15H6zm8 1.5V8h4.5zM8.5 11h9v2h-9zm0 4h9v2h-9z'/%3E%3C/svg%3E"); }
.ic-kid { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8.5 8.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm7 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM12 18a5.5 5.5 0 0 1-5-3.2h10A5.5 5.5 0 0 1 12 18z'/%3E%3C/svg%3E"); }
.ic-gear { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.4 13a7.5 7.5 0 0 0 0-2l2.1-1.6-2-3.5-2.5 1a7.6 7.6 0 0 0-1.7-1L15 3h-4l-.4 2.9a7.6 7.6 0 0 0-1.7 1l-2.5-1-2 3.5L6.6 11a7.5 7.5 0 0 0 0 2l-2.1 1.6 2 3.5 2.5-1a7.6 7.6 0 0 0 1.7 1L11 21h4l.4-2.9a7.6 7.6 0 0 0 1.7-1l2.5 1 2-3.5zM13 15.5A3.5 3.5 0 1 1 13 8.5a3.5 3.5 0 0 1 0 7z'/%3E%3C/svg%3E"); }

@media (max-width: 860px) {
  .nav { display: none; }
  .top { padding: 12px 16px; }
  main { padding: 4px 16px 30px; }
  .grid2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.85rem; }
  .card { padding: 18px; border-radius: 18px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: .7rem; font-weight: 700; color: var(--soft); padding: 4px 0; }
  .tabbar a.on { color: var(--pri); }
  .agree .doc { padding: 24px 16px; }
  .agree th, .agree td { padding: 7px 6px; font-size: .85rem; }
  .sigs { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .earn-grid { grid-template-columns: 1fr; }
}
@media print {
  body { background: #fff; padding: 0; }
  .top, .tabbar, .demo-bar, .noprint, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .agree .doc { box-shadow: none; border: 0; padding: 0; }
  .agree h2 { break-after: avoid; }
  .agree table, .agree ul { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Jars */
.jars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 12px; }
.jar { text-align: center; }
.jar svg { width: 100%; max-width: 92px; height: auto; display: block; margin: 0 auto 4px; }
.jar .jn { font-weight: 800; font-size: 1.15rem; line-height: 1.1; }
.jar .jl { font-size: .75rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }
.kv .jars { gap: 14px; }
.kv .jar svg { max-width: 150px; }
.kv .jar .jn { font-size: 1.6rem; }
.goalbar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.goalbar i { display: block; height: 100%; background: var(--save); border-radius: 999px; }
.goal { background: var(--pri-soft); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
[data-theme="night"] .goal { background: #1F3D30; }
.goal .row { justify-content: space-between; margin-bottom: 6px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { width: 44px; height: 44px; border-radius: 50%; background: var(--sun); color: #5A4300; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.mission { background: var(--acc-soft); border-radius: 18px; padding: 16px 18px; text-align: left; }
.mission .eyebrow { font-size: .75rem; font-weight: 800; letter-spacing: .08em; color: #9A6510; text-transform: uppercase; }
[data-theme="night"] .mission .eyebrow { color: var(--acc); }
.think { background: var(--bg); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.think label { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-weight: 600; }
.amt-in { font-size: 1.6rem; font-weight: 800; }
.tx-plus { color: #1D7A50; font-weight: 800; }
.tx-minus { color: var(--warn); font-weight: 800; }
[data-theme="night"] .tx-plus { color: #8BE3B8; }
.wait { background: var(--acc-soft); border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.ic-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3h10v2h-1v2.2c2.4 1 4 3.3 4 6V19a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-5.8c0-2.7 1.6-5 4-6V5H7z'/%3E%3C/svg%3E"); }
.ic-list { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h3v3H4zm5 0h11v3H9zM4 10.5h3v3H4zm5 0h11v3H9zM4 16h3v3H4zm5 0h11v3H9z'/%3E%3C/svg%3E"); }
.ic-book { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h6a3 3 0 0 1 2 1 3 3 0 0 1 2-1h6v15h-6a2 2 0 0 0-2 2 2 2 0 0 0-2-2H4zm2 2v11h4l1 .3V7a1 1 0 0 0-1-1zm12 0h-4a1 1 0 0 0-1 1v10.3l1-.3h4z'/%3E%3C/svg%3E"); }
a.chip { text-decoration: none; display: inline-block; }

/* Dorm Dollars */
.big-num { font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hero-week { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
.ring2 { width: 210px; height: 210px; position: relative; }
.ring2 svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring2 .bg { stroke: var(--line); } .ring2 .fg { stroke: var(--pri); stroke-linecap: round; }
.ring2.over .fg { stroke: var(--warn); }
.ring2 .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring2 .n { font-size: 2.3rem; font-weight: 800; line-height: 1; }
.ring2 .u { font-size: .8rem; font-weight: 700; color: var(--soft); }
.cat { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cat:first-child { border-top: 0; }
.cat .bar { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cat .bar i { display: block; height: 100%; border-radius: 999px; background: var(--cc, var(--pri)); }
.cat .bar i.over { background: var(--warn); }
/* This week: category rows that show what's left */
.catrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.catrow.first { border-top: 0; }
.cat-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; background: none; border: 0; padding: 6px 6px; margin: 0; text-align: left; cursor: pointer; border-radius: 12px; }
.cat-main:hover { background: var(--pri-soft); }
.cat-main:focus-visible, .cat-add:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.cat-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cat-left { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.catrow.over .cat-left { color: var(--warn); }
.cat-sub { grid-column: 1 / -1; }
.lbar { display: block; grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lbar i { display: block; height: 100%; border-radius: 999px; background: var(--mint); transition: width .3s; }
.lbar.low i { background: var(--sun); }
.lbar.over i { background: var(--warn); }
.tag-low { font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 1px 8px; background: var(--sun); color: #3D2C10; }
.cat-add { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--pri-soft); color: var(--ink); font-size: 1.4rem; font-weight: 700; line-height: 1; cursor: pointer; }
.cat-add:hover { background: var(--pri); color: var(--pri-ink); }
.cat-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 12px; }
.cat-sum > div { background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.cat-sum .n { font-weight: 800; font-size: 1.2rem; }
.cat-sum.over > div:first-child .n { color: var(--warn); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.ok-box { background: var(--mint-soft); border-radius: 16px; padding: 14px 16px; }
.bad-box { background: var(--acc-soft); border-radius: 16px; padding: 14px 16px; }
.meal { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--card); cursor: pointer; text-align: left; }
.meal:hover { border-color: var(--pri); }
.meal .t { font-weight: 700; }
.meal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.week-plan { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-plan .dcol { background: var(--bg); border-radius: 14px; padding: 8px; min-height: 120px; }
.week-plan .dname { font-size: .75rem; font-weight: 800; color: var(--soft); text-transform: uppercase; }
.slot { display: block; width: 100%; text-align: left; border: 1.5px dashed var(--line); background: var(--card); border-radius: 10px; padding: 6px 8px; margin-top: 6px; font-size: .82rem; font-weight: 600; cursor: pointer; min-height: 40px; }
.slot.filled { border-style: solid; border-color: var(--pri-soft); }
.check { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check.done .grow { text-decoration: line-through; color: var(--soft); }
.owe-pos { color: #178A60; font-weight: 800; } .owe-neg { color: var(--warn); font-weight: 800; }
[data-theme="night"] .owe-pos { color: #7FE3BC; }
@media (max-width: 860px) {
  .hero-week { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .week-plan { grid-template-columns: repeat(2, 1fr); }
}
.ic-wallet { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6a3 3 0 0 1 3-3h11v3h1a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm3-1a1 1 0 0 0 0 2h9V5zm11 7a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z'/%3E%3C/svg%3E"); }
.ic-cal { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h3v18H4V4h3zm-1 8v10h12V10z'/%3E%3C/svg%3E"); }
.ic-cart { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 3h3l2.6 11.2A2 2 0 0 0 9.6 16H18v-2H9.6l-.4-2H19l2-7H6.2L5.6 3zM9 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm8 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4z'/%3E%3C/svg%3E"); }
.ic-people { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm8 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM1 20c0-3.3 3-6 7-6s7 2.7 7 6zm15.5 0c0-2-1-3.8-2.6-5 .7-.2 1.4-.3 2.1-.3 3.3 0 6 2.3 6 5.3z'/%3E%3C/svg%3E"); }

.stat-row.stat4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .stat-row.stat4 { grid-template-columns: repeat(2, 1fr); } }
.check .grow { flex: 1; min-width: 0; }

/* license gate */
body.locked .tabbar, body.locked .nav { display: none; }
.gate-err { background: var(--acc-soft); color: var(--warn); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin: 0; }

/* ---------- Callback Queen */
.wait-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wait-row:first-of-type { border-top: 0; }
.wait-row .grow { flex: 1; min-width: 160px; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; border-radius: 999px; padding: 4px 12px; background: var(--mint-soft); color: #0E6B55; white-space: nowrap; }
.timer.slow { background: #FFF1CC; color: #6B4E00; }
.timer.late { background: var(--acc-soft); color: var(--warn); }
[data-theme="night"] .timer { color: #9BF0D8; } [data-theme="night"] .timer.slow { background: #4A3D14; color: #FFE7A3; } [data-theme="night"] .timer.late { color: #FF9C9C; }
.st { font-size: .75rem; font-weight: 800; border-radius: 999px; padding: 3px 10px; white-space: nowrap; background: var(--pri-soft); }
.st.new { background: #FFF1CC; color: #6B4E00; } .st.contacted { background: #E3EEFF; color: #1D4E9E; } .st.quoted { background: var(--pri-soft); color: var(--pri); }
.st.won { background: var(--mint-soft); color: #0E6B55; } .st.lost { background: var(--line); color: var(--soft); }
[data-theme="night"] .st { color: var(--ink) !important; }
.lead { display: flex; gap: 12px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; border-radius: 10px; }
.lead:first-child { border-top: 0; }
.lead:hover { background: var(--pri-soft); }
.lead .grow { flex: 1; min-width: 0; }
.lead .t { font-weight: 700; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.total td { font-weight: 800; border-bottom: 0; }
table.tbl input.spend { width: 84px; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); text-align: right; }
.best { color: #0E6B55; font-weight: 800; } .worst { color: var(--warn); font-weight: 800; }
[data-theme="night"] .best { color: #9BF0D8; }
.sbars { display: grid; gap: 12px; }
.sbar { display: grid; grid-template-columns: 130px 1fr 70px; gap: 12px; align-items: center; }
.sbar .track { height: 26px; background: var(--line); border-radius: 999px; overflow: hidden; }
.sbar .track i { display: block; height: 100%; border-radius: 999px; background: var(--mint); }
.sbar .pct { font-weight: 800; text-align: right; }
.fu { display: flex; gap: 8px; flex-wrap: wrap; }
.fu .step { border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: .85rem; font-weight: 700; background: var(--card); cursor: pointer; }
.fu .step.done { background: var(--mint-soft); border-color: var(--mint-soft); color: #0E6B55; }
.fu .step.due { border-color: var(--sun); background: #FFF6DB; }
[data-theme="night"] .fu .step.due { background: #4A3D14; } [data-theme="night"] .fu .step.done { color: #9BF0D8; }
.script-box { background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 14px; white-space: pre-wrap; font-size: .95rem; }
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi .stat .n { font-size: 1.5rem; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.timeline li { padding: 6px 0; border-top: 1px dashed var(--line); color: var(--soft); }
.timeline li:first-child { border-top: 0; }
.empty { padding: 14px; text-align: center; color: var(--soft); background: var(--bg); border-radius: 14px; }
@media (max-width: 860px) {
  .kpi { grid-template-columns: 1fr 1fr; }
  .sbar { grid-template-columns: 96px 1fr 52px; gap: 8px; }
}
@media (max-width: 600px) {
  .list li { flex-wrap: wrap; }
  .list li > .grow { flex: 1 1 100%; }
  .wait-row .grow { flex: 1 1 calc(100% - 110px); }
}

input[type="datetime-local"].input { min-width: 0; }
.fgrid > * { min-width: 0; }
