/* Fallback: web port of the Flutter app */
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url('assets/fonts/Lora-Italic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('assets/fonts/Lora-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 500 700; font-display: swap; src: url('assets/fonts/Lora-SemiBoldItalic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/Lora-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-display: swap; src: url('assets/fonts/SourceSans3-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 500; font-display: swap; src: url('assets/fonts/SourceSans3-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-display: swap; src: url('assets/fonts/SourceSans3-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 700; font-display: swap; src: url('assets/fonts/SourceSans3-Bold.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --indigo: #4657D9; --indigo-dark: #3442B5; --blue: #65A8E8; --amber: #F2B85B;
  --bg: #F5F7FB; --surface: #FFFFFF; --pale: #EEF0FC; --border: #DDE2EC; --ink: #20263A; --slate: #70778A;
  --amber-soft: #FDF1DC; --amber-deep: #B9852F; --blue-soft: #E6F1FC; --blue-deep: #2F78BE; --mist: #A9AFBF;
  --worked: #3E9A7A; --worked-soft: #E2F3EC; --partly: #D99B3A; --failed: #CF5C67; --failed-soft: #FBE7E9;
  --grey-soft: #EDEFF3;
  --route: linear-gradient(135deg, #4657D9, #3442B5);
  --switch: linear-gradient(135deg, #F6C877, #F2B85B);
  --sky: linear-gradient(135deg, #86BCF0, #65A8E8);
  --display: 'Lora', Georgia, 'Times New Roman', serif;
  --body: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #E6E9F2; color: var(--ink); font: 400 15px/1.4 var(--body);
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg.ic { display: block; flex: none; fill: currentColor; }
input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(70, 87, 217, .2); }

#app {
  position: relative; height: 100vh; height: 100dvh; max-width: 480px; margin: 0 auto;
  background: var(--bg); overflow: hidden; box-shadow: 0 0 40px rgba(32, 38, 58, .12);
}

/* ---------- screens & navigation ---------- */
.screen { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.screen.enter { animation: scrIn .3s cubic-bezier(.2, .8, .2, 1); }
.screen.leave { animation: scrOut .22s ease-in forwards; pointer-events: none; }
.screen.under { visibility: hidden; }
@keyframes scrIn { from { opacity: 0; transform: translateY(24px); } }
@keyframes scrOut { to { opacity: 0; transform: translateY(24px); } }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.hscroll { display: flex; overflow-x: auto; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }

.appbar { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: var(--st) 6px 0 4px; background: var(--bg); flex: none; }
.appbar h1 { flex: 1; margin: 0 0 0 4px; font: 600 20px/1.15 var(--display); letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background .15s; }
.icon-btn:hover { background: rgba(32, 38, 58, .06); }
.icon-btn:active { background: rgba(32, 38, 58, .1); }
.pad { padding: 0 20px 40px; }

.tabs { position: relative; flex: 1; min-height: 0; }
.tab { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding-top: var(--st); padding-bottom: calc(110px + var(--sb)); overscroll-behavior: contain; }
.tab[hidden] { display: block; visibility: hidden; pointer-events: none; }
.nav {
  position: absolute; left: 16px; right: 16px; bottom: calc(12px + var(--sb)); height: 64px; padding: 7px;
  display: flex; background: var(--ink); border-radius: 24px; box-shadow: 0 8px 22px rgba(32, 38, 58, .22); z-index: 5;
}
.nav button {
  flex: 3 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 18px; color: #9AA1B8; transition: flex-grow .26s cubic-bezier(.2, .8, .2, 1), background .26s;
}
.nav button.on { flex-grow: 5; background: var(--indigo); color: #fff; }
.nav button span { font: 700 14px/1 var(--body); white-space: nowrap; overflow: hidden; }

/* ---------- typography ---------- */
.d { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -.2px; }
.di { font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: -.2px; color: var(--slate); }
.eyebrow { font: 700 11.5px/1.3 var(--body); letter-spacing: 1.6px; color: var(--slate); text-transform: uppercase; }
.muted { color: var(--slate); }
.strong { font-weight: 700; }
p { margin: 0; }

.page-head { display: flex; align-items: flex-start; padding: 14px 16px 6px 20px; }
.page-head .grow { flex: 1; min-width: 0; }
.page-head .eb { display: flex; align-items: center; gap: 8px; }
.page-head .eb i { width: 18px; height: 2px; background: var(--amber); flex: none; }
.page-head h2 { margin: 6px 0 0; font: 600 30px/1.15 var(--display); letter-spacing: -.2px; }
.page-head .sub { margin-top: 4px; font: italic 400 15px/1.15 var(--display); color: var(--slate); }

.sec { display: flex; align-items: center; padding: 22px 12px 10px 20px; min-height: 36px; }
.sec h3 { flex: 1; margin: 0; font: 600 19px/1.15 var(--display); letter-spacing: -.2px; }
.link { color: var(--indigo); font: 600 14px/1 var(--body); padding: 8px 10px; border-radius: 10px; }
.link:hover { background: rgba(70, 87, 217, .08); }

/* ---------- surfaces ---------- */
.card { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; position: relative; overflow: hidden; }
button.card, .card.tap { cursor: pointer; transition: filter .15s, transform .1s; }
button.card:active, .card.tap:active { filter: brightness(.97); }
.stack > * + * { margin-top: 12px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3.5px 9px; border-radius: 20px; font: 700 12px/1.2 var(--body); white-space: nowrap; }
.badge { display: grid; place-items: center; flex: none; }
.badge img { width: 100%; height: 100%; object-fit: contain; }

.btn {
  position: relative; display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 14px; border-radius: 16px; background: var(--route); color: #fff; font: 700 16px/1 var(--body);
  overflow: hidden; transition: filter .15s, opacity .2s;
}
.btn span, .ghost span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn:hover { filter: brightness(1.05); }
.btn:active { filter: brightness(.93); }
.btn.sw { background: var(--switch); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.ghost {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 12px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--indigo); font: 600 15px/1 var(--body);
}
.ghost:active { background: #F7F8FC; }
.round { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.round:active { background: #F2F4F9; }

.chips { gap: 8px; padding: 0 20px; height: 38px; }
.chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  color: var(--slate); font: 500 14px/1 var(--body); transition: all .18s; white-space: nowrap;
}
.chip.on { background: var(--pale); border: 1.4px solid var(--indigo); color: var(--indigo); font-weight: 700; }

.empty { padding: 24px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.empty img { height: 130px; width: auto; }
.empty h4 { margin: 16px 0 8px; font: 600 21px/1.15 var(--display); letter-spacing: -.2px; }
.empty p { color: var(--slate); }
.empty .btn { width: 230px; height: 50px; margin-top: 20px; }

/* ---------- IF / THEN ---------- */
.ifthen { display: flex; gap: 8px; }
.branch { position: relative; width: 34px; flex: none; }
.branch .n1 { position: absolute; left: 10px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--amber); }
.branch .n1::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.branch .ln { position: absolute; left: 15.5px; width: 3px; top: 19px; bottom: calc(38% + 8px); background: repeating-linear-gradient(var(--amber) 0 5px, transparent 5px 10px); border-radius: 2px; }
.branch .n2 { position: absolute; left: 9px; top: calc(62% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; }
.ifthen .txt { flex: 1; min-width: 0; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font: 700 11px/1.3 var(--body); }
.tag.if { color: var(--amber-deep); background: var(--amber-soft); }
.tag.then { color: var(--blue-deep); background: var(--blue-soft); }
.ifthen .c { margin-top: 4px; font-weight: 500; font-size: 15.5px; }
.ifthen .a { margin-top: 4px; font: 600 17px/1.15 var(--display); letter-spacing: -.2px; }
.ifthen.compact .c { font-size: 14.5px; }
.ifthen.compact .a { font-size: 15.5px; }
.ifthen .gap { height: 14px; }
.ifthen.compact .gap { height: 10px; }

/* ---------- plan & fallback cards ---------- */
.plan-card .top { display: flex; align-items: flex-start; gap: 12px; }
.plan-card .t { font: 600 17px/1.15 var(--display); letter-spacing: -.2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-card .cat { margin-top: 3px; font: 600 13px/1.4 var(--body); }
.plan-card .desc { margin-top: 10px; color: var(--slate); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-card .foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font: 600 13.5px/1.3 var(--body); }
.plan-card .foot span { flex: 1; }

.fb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.fb-plan { display: flex; align-items: center; gap: 6px; width: 100%; padding: 9px 10px 9px 14px; background: var(--pale); color: var(--indigo); font: 700 13.5px/1.3 var(--body); text-align: left; }
.fb-plan span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 0 12px; min-height: 48px; }
.fb-head .pl { font: 700 13.5px/1.3 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fb-head .sp { flex: 1; }
.prio { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #fff; font: 700 15px/1 var(--display); flex: none; }
.fb-body { padding: 4px 16px 0 10px; }
.fb-note { padding: 10px 16px 0 52px; font: italic 400 14px/1.35 var(--display); color: var(--slate); }
.fb-foot { padding: 14px; }
.fb-foot .btn { height: 48px; }

/* route map */
.stop { display: flex; gap: 12px; }
.stop .rail { position: relative; width: 32px; flex: none; }
.stop .rail .up { position: absolute; left: 14.5px; top: 0; height: 18px; width: 3px; background: rgba(101, 168, 232, .4); }
.stop .rail .down { position: absolute; left: 14.5px; top: 18px; bottom: 0; width: 3px; background: rgba(101, 168, 232, .4); }
.stop.main .rail .up { background: transparent; }
.stop.main .rail .down { background: rgba(70, 87, 217, .35); }
.stop .dot { position: absolute; left: 2px; top: 12px; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; display: grid; place-items: center; color: #fff; font: 700 13px/1 var(--display); }
.stop.last .dot { background: var(--surface); border-color: var(--border); color: var(--slate); }
.stop .body { flex: 1; min-width: 0; padding-bottom: 14px; }

/* switch tiles / history */
.sw-tile { display: flex; gap: 10px; }
.sw-tile .date { width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; }
.sw-tile .date b { font: 700 20px/1.1 var(--display); }
.sw-tile .date i { flex: 1; width: 2px; background: var(--border); margin-top: 6px; }
.sw-tile .card { padding: 14px; margin-bottom: 14px; flex: 1; min-width: 0; }
.sw-row { display: flex; align-items: flex-start; gap: 6px; }
.sw-note { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--bg); font: italic 400 13.5px/1.4 var(--display); }
.kebab { width: 30px; height: 28px; display: grid; place-items: center; color: var(--mist); border-radius: 8px; flex: none; }
.kebab:hover { background: rgba(32, 38, 58, .06); }
.filter-btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font: 600 14px/1.2 var(--body); max-width: 100%; }
.filter-btn span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.filter-btn.on { background: var(--pale); border-color: var(--indigo); color: var(--indigo); }

/* ---------- forms ---------- */
.lbl { display: flex; align-items: baseline; gap: 6px; padding: 16px 0 7px; font: 700 14px/1.3 var(--body); }
.lbl small { font: 400 13px/1.3 var(--body); color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field { position: relative; display: flex; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: var(--indigo); box-shadow: inset 0 0 0 .6px var(--indigo); }
.field.err { border-color: var(--failed); }
.field input, .field textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 14px 16px; font-size: 16px; line-height: 1.35; resize: none; }
.field textarea { field-sizing: content; min-height: 50px; }
.field ::placeholder { color: var(--mist); }
.field .pre { margin: 12px 0 0 10px; width: 46px; padding: 4px 0; text-align: center; border-radius: 7px; font: 700 12px/1.2 var(--body); flex: none; }
.field .pre + input, .field .pre + textarea { padding-left: 8px; }
.field.soft { background: var(--pale); border-color: transparent; }
.field.soft:focus-within { border-color: var(--indigo); }
.errtxt { color: var(--failed); font-size: 12.5px; padding: 6px 12px 0; }
.counter { text-align: right; font-size: 12px; color: var(--slate); padding: 4px 12px 0; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cat-tile { padding: 12px 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 6px; font: 500 13.5px/1.2 var(--body); transition: all .18s; }
.cat-tile img { height: 38px; width: 38px; object-fit: contain; }
.cat-tile.on { background: var(--pale); border: 1.6px solid var(--indigo); color: var(--indigo); font-weight: 700; }
.opt-row { display: flex; align-items: center; gap: 12px; }
.choice-chip { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font: 600 14px/1 var(--body); color: var(--slate); }

/* ---------- overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 50; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); animation: fade .2s; }
.overlay.out .scrim { animation: fadeOut .2s forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--st) - 24px); overflow-y: auto;
  background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + var(--sb));
  animation: sheetIn .28s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain;
}
.overlay.out .sheet { animation: sheetOut .2s ease-in forwards; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 16px; }
.sheet h3 { margin: 0 0 14px; font: 600 22px/1.15 var(--display); letter-spacing: -.2px; }
.dialog {
  position: absolute; left: 50%; top: 50%; width: min(340px, calc(100% - 48px)); transform: translate(-50%, -50%);
  background: var(--surface); border-radius: 22px; padding: 24px 24px 12px; animation: dlgIn .2s ease-out;
}
.overlay.out .dialog { animation: fadeOut .15s forwards; }
@keyframes dlgIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.92); } }
.dialog h3 { margin: 0 0 14px; font: 600 20px/1.2 var(--display); letter-spacing: -.2px; }
.dialog p { color: var(--slate); font-size: 15px; }
.dialog .acts { display: flex; justify-content: flex-end; gap: 4px; margin-top: 18px; }
.dialog .acts.center { justify-content: center; }
.dialog .acts button { padding: 10px 12px; border-radius: 20px; font: 600 15px/1 var(--body); }
.dialog .acts button:hover { background: rgba(70, 87, 217, .07); }
.menu {
  position: absolute; min-width: 180px; max-width: 280px; background: var(--surface); border-radius: 14px; padding: 8px 0;
  box-shadow: 0 6px 24px rgba(32, 38, 58, .18), 0 1px 3px rgba(32, 38, 58, .1); animation: menuIn .16s ease-out; transform-origin: top right;
}
@keyframes menuIn { from { opacity: 0; transform: scale(.9); } }
.overlay.out .menu { animation: fadeOut .12s forwards; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 0 16px; height: 48px; font: 500 15px/1 var(--body); text-align: left; }
.menu button:hover { background: #F4F5FA; }
.overlay.clear .scrim { background: transparent; }
.toast {
  position: absolute; left: 16px; right: 16px; bottom: 24px; z-index: 80; padding: 14px 16px; border-radius: 14px;
  background: var(--ink); color: #fff; font: 500 14.5px/1.35 var(--body); box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
  animation: toastIn .25s ease-out;
}
.toast.out { animation: fadeOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
.result-opt { flex: 1; padding: 14px 4px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 6px; font: 700 13.5px/1.2 var(--body); text-align: center; transition: all .18s; }
.date-row { display: flex; align-items: center; gap: 10px; padding: 13px 14px; position: relative; }
.date-row input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

/* ---------- onboarding ---------- */
.onb { display: flex; flex-direction: column; height: 100%; padding-top: var(--st); padding-bottom: var(--sb); }
.onb-top { display: flex; align-items: center; gap: 10px; padding: 12px 12px 0 20px; min-height: 52px; }
.onb-top img { width: 34px; height: 34px; border-radius: 10px; }
.pages { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pages::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; scroll-snap-align: start; overflow-y: auto; padding: 0 24px; display: flex; flex-direction: column; justify-content: center; }
.page.choice { justify-content: flex-start; padding-top: 16px; }
.halo { width: 260px; height: 260px; max-width: 70vw; max-height: 70vw; border-radius: 50%; background: var(--pale); padding: 46px; margin: 0 auto; display: grid; place-items: center; }
.page h2 { margin: 36px 0 14px; font: 600 29px/1.2 var(--display); letter-spacing: -.2px; white-space: pre-line; }
.page.choice h2 { margin-top: 0; margin-bottom: 10px; }
.onb-foot { display: flex; align-items: center; padding: 8px 20px 18px; min-height: 76px; }
.dots { display: flex; gap: 6px; flex: 1; }
.dots i { height: 8px; width: 8px; border-radius: 4px; background: var(--border); transition: all .25s; }
.dots i.on { width: 26px; background: var(--indigo); }
.opt-card { display: flex; align-items: center; gap: 14px; }
.opt-card .ill { width: 72px; height: 72px; padding: 10px; border-radius: 18px; flex: none; }

/* ---------- overview ---------- */
.summary { position: relative; border-radius: 24px; background: var(--route); color: #fff; box-shadow: 0 10px 24px rgba(70, 87, 217, .28); overflow: hidden; padding: 18px 18px 16px; }
.summary svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.summary .metrics { position: relative; display: flex; align-items: center; }
.metric { flex: 1; min-width: 0; }
.metric b { display: block; font: 700 34px/1.05 var(--display); letter-spacing: -.2px; }
.metric span { display: block; margin-top: 4px; font: 600 12.5px/1.2 var(--body); color: rgba(255, 255, 255, .82); }
.vdiv { width: 1px; height: 46px; margin: 0 12px; background: rgba(255, 255, 255, .2); flex: none; }
.progress { position: relative; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: hidden; flex: 1; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--amber); border-radius: 4px; transition: width .5s; }
.qlinks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qlink { padding: 12px 10px 12px 12px; border-radius: 16px; }
.qlink .r { display: flex; align-items: center; justify-content: space-between; color: var(--indigo); }
.qlink .r b { font: 600 17px/1.15 var(--display); color: var(--ink); }
.qlink .l { margin-top: 8px; font: 600 14px/1.3 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { gap: 12px; padding: 0 20px; }
.tool { flex: none; width: 150px; height: 150px; border-radius: 20px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.tool img { height: 60px; width: auto; }
.tool b { margin-top: auto; font: 600 17px/1.15 var(--display); letter-spacing: -.2px; }
.tool span { font-size: 13px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.strike { text-decoration: line-through; text-decoration-color: var(--mist); }

/* ---------- insights ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { height: 96px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between; }
.stat b { font: 700 25px/1.15 var(--display); }
.stat span { font: 600 12.5px/1.2 var(--body); color: var(--slate); }
.chart-card { margin-top: 14px; padding: 16px 16px 18px; }
.chart-head { display: flex; align-items: flex-start; margin-bottom: 16px; gap: 8px; }
.chart-head .grow { flex: 1; }
.chart-head h4 { margin: 0; font: 600 18px/1.15 var(--display); letter-spacing: -.2px; }
.chart-head p { font-size: 13px; color: var(--slate); }
.legend { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend span { flex: 1; }
.legend b { font: 700 15px/1 var(--display); }
.hbar { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.hbar img { width: 26px; height: 26px; }
.hbar .n { width: 74px; flex: none; font: 500 14px/1.2 var(--body); }
.hbar .tr { flex: 1; height: 12px; border-radius: 6px; background: var(--bg); position: relative; overflow: hidden; }
.hbar .tr i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.hbar b { width: 28px; text-align: right; font: 700 15px/1 var(--display); }
.list-tile { display: flex; align-items: center; gap: 16px; width: 100%; padding: 8px 0; text-align: left; }

/* ---------- reading ---------- */
.bar { position: relative; height: 6px; border-radius: 4px; background: var(--pale); overflow: hidden; flex: 1; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--indigo); border-radius: 4px; }
.cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.art-row { display: flex; align-items: center; gap: 14px; padding: 10px; }
.art-row img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; flex: none; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article { background: var(--surface); }
.article .hero { height: 300px; width: 100%; object-fit: cover; }
.art-bar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; padding: calc(6px + var(--st)) 6px 6px; transition: background .2s, box-shadow .2s; }
.art-bar.solid { background: var(--surface); box-shadow: 0 1px 0 var(--border); }
.art-bar .ttl { flex: 1; margin-left: 12px; font: 600 18px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.art-bar.solid .ttl { opacity: 1; }
.art-prog { position: absolute; left: 0; bottom: -3px; height: 3px; background: var(--amber); }
.art-body { padding: 22px 22px 0; }
.art-body h5 { margin: 24px 0 8px; font: 600 20px/1.15 var(--display); letter-spacing: -.2px; }
.art-body .p { font-size: 16.5px; line-height: 1.6; color: #353B50; }
.takeaway { margin-top: 28px; padding: 18px; background: var(--pale); border-radius: 18px; border-left: 4px solid var(--indigo); }

/* ---------- play ---------- */
.game { display: flex; align-items: center; gap: 14px; padding: 12px; }
.game .ill { width: 88px; height: 88px; padding: 12px; border-radius: 18px; flex: none; }
.wheel-wrap { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.wheel { width: calc(100% - 16px); height: calc(100% - 16px); transform-origin: 50% 50%; }
.spin-hub { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: var(--ink); border: 5px solid #fff; color: var(--amber); font: 700 16px/1 var(--body); box-shadow: 0 0 14px rgba(32, 38, 58, .3); }
.pointer { position: absolute; top: 0; left: 50%; margin-left: -17px; filter: drop-shadow(0 2px 2px rgba(32, 38, 58, .35)); }
.slots { padding: 16px 12px 14px; border-radius: 26px; background: var(--route); box-shadow: 0 8px 20px rgba(70, 87, 217, .3); }
.lights { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.lights i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .24); }
.lights i.on { background: var(--amber); }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.reel { height: 176px; padding: 10px 8px; border-radius: 16px; background: #fff; border: 2px solid #fff; display: flex; flex-direction: column; align-items: center; }
.reel.spin { border-color: var(--amber); }
.reel .eyebrow { font-size: 9.5px; letter-spacing: 1.1px; }
.reel img { height: 56px; width: 56px; margin: 8px 0; }
.reel p { flex: 1; display: flex; align-items: center; text-align: center; font: 700 13px/1.2 var(--body); overflow: hidden; }
.reel.spin p { color: var(--mist); }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.counters div { padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.counters b { display: block; font: 700 20px/1.2 var(--display); }
.pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pc { aspect-ratio: .9; border-radius: 18px; display: grid; place-items: center; }
.pc.back { background: var(--route); color: rgba(255, 255, 255, .55); }
.pc.face { background: var(--surface); border: 2px solid var(--amber); padding: 16px; }
.pc.face.done { background: var(--pale); border-color: var(--indigo); }
.pc.face img { width: 100%; height: 100%; object-fit: contain; }
.pc.pop { animation: pop .26s ease-out; }
@keyframes pop { from { transform: scale(.2); opacity: .3; } }
.timer { height: 6px; border-radius: 4px; background: var(--pale); overflow: hidden; }
.timer i { display: block; height: 100%; border-radius: 4px; transition: width 1s linear, background .2s; }

@media (min-width: 481px) {
  body { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
