/* "Till Morning Night" look, shared by the popup and extension pages. Taken from the iPhone app
   (app/expo/src/ui/theme.ts): blue is the action colour, violet for tickets and big moments,
   mint = fine, amber = careful, coral = stop. Fredoka for headings, Figtree for text. */
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url("fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("fonts/figtree-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 800; font-display: swap; src: url("fonts/figtree-latin-800-normal.woff2") format("woff2"); }

[hidden] { display: none !important; }
:root {
  --night: #0D0F2E; --surface: #161942; --surface-top: #1B1F50; --edge: #282C68; --raised: #1E2256; --input: #12153A;
  --t1: #F3F2FF; --t2: #B4B6E4; --t3: #8A8EC6;
  --blue: #4361FF; --blue-top: #5B76FF; --blue-edge: #2A3BC0; --blue-l: #93A5FF;
  --violet: #8B5CF6; --violet-deep: #5B33D6; --purple-a: #7E3FF2; --purple-b: #B455F0; --stub: #9B4CF4; --lilac: #C4B5FD;
  --mint: #5EE9B5; --amber: #FFC94D; --amber-edge: #C9952A; --coral: #FF8F78; --ink: #14163A;
  --display: "Fredoka", "SF Pro Rounded", ui-rounded, system-ui, sans-serif;
  --body: "Figtree", -apple-system, "Segoe UI", system-ui, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1); --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* The app's night sky: a violet glow from the top, and a few stars. */
body {
  margin: 0; color: var(--t1); font: 500 14.5px/1.45 var(--body); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.4px 1.4px at 88% 26%, rgba(201,211,255,.6), transparent 60%),
    radial-gradient(1px 1px at 30% 6%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1px 1px at 58% 22%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(120% 420px at 50% 0%, rgba(124,92,255,.32), transparent 72%),
    var(--night);
  background-repeat: no-repeat; min-height: 100vh;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.15; letter-spacing: -.01em; }
b, strong { font-weight: 700; }
button { font: inherit; cursor: pointer; border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2.5px solid var(--blue-l); outline-offset: 2px; }
a { color: var(--blue-l); }

.brand { display: flex; align-items: center; gap: 9px; font: 600 15px var(--display); color: var(--t1); letter-spacing: .01em; }
.dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--blue-top), var(--blue)); display: grid; place-items: center; color: #fff; font-size: 12px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 4px 10px rgba(2,3,18,.5); }
img.dot { object-fit: cover; }

/* Chunky buttons that press down, as in the app. */
.btn { display: block; text-decoration: none; width: 100%; padding: 12px 16px; border-radius: 99px; text-align: center; font: 600 16px var(--display); letter-spacing: .01em;
  transition: transform .18s var(--spring), box-shadow .18s var(--ease), filter .18s; }
.btn.primary { background: linear-gradient(180deg, var(--blue-top), var(--blue)); color: #fff; box-shadow: 0 5px 0 var(--blue-edge), 0 10px 22px -8px rgba(67,97,255,.7); }
.btn.second { background: var(--raised); color: var(--t1); border: 1.5px solid var(--edge); box-shadow: 0 4px 0 var(--edge); }
.btn.violet { background: linear-gradient(90deg, #7C4DFF, #A066FF); color: #fff; box-shadow: 0 5px 0 var(--violet-deep), 0 10px 22px -8px rgba(139,92,246,.7); }
.btn:hover:not([disabled]) { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 1px 0 var(--blue-edge); }
.btn.second:active:not([disabled]) { box-shadow: 0 1px 0 var(--edge); }
.muted { color: var(--t2); }
.small { font-size: 13px; }
/* The app's small caps label above a card ("WAITING ROOM"). */
.label { font: 800 11.5px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--t3); }

/* Waiting-room tickets: a torn ticket with a dashed tear line and two bites out of it. */
.ticket { position: relative; display: flex; align-items: stretch; border-radius: 16px; overflow: hidden; background: linear-gradient(90deg, var(--purple-a), var(--purple-b)); color: #fff;
  box-shadow: 0 4px 0 #4A23A8, 0 12px 24px -12px rgba(139,92,246,.8); animation: pop .5s var(--spring) both; }
.ticket::before, .ticket::after { content: ""; position: absolute; right: 85px; width: 14px; height: 14px; border-radius: 50%; background: var(--night); }
.ticket::before { top: -7px; }
.ticket::after { bottom: -7px; }
.ticket .main { flex: 1; min-width: 0; padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; }
.ticket .main b { font: 600 16px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket .main span { font-size: 12.5px; opacity: .9; font-weight: 600; }
.ticket .stub { border-left: 2px dashed rgba(255,255,255,.65); background: var(--stub); padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; font: 600 13px/1.15 var(--display); width: 92px; flex: none; text-align: center; gap: 5px; }
.ticket.done { background: linear-gradient(90deg, #3A2E7A, #4B3A8E); box-shadow: 0 4px 0 #2A2160; }
.ticket.done .stub { background: #45388A; }
.ticket .stub button { white-space: nowrap; background: rgba(255,255,255,.2); color: #fff; border-radius: 99px; padding: 4px 9px; font: 700 12px var(--body); transition: background .15s; }
.ticket .stub button:hover { background: rgba(255,255,255,.32); }
.ticket .stub button[data-act="open"] { background: #fff; color: var(--violet-deep); }

/* Stickers: the app's mascot art with a white die-cut edge, a glow, a slow float and a pop-in. */
.sticker { position: relative; flex: none; display: grid; place-items: center; pointer-events: none; } /* art only: never in the way of a click */
.sticker::before { content: ""; position: absolute; inset: -22%; border-radius: 50%; background: radial-gradient(closest-side, rgba(92,112,255,.5), rgba(139,92,246,.2) 58%, transparent); z-index: 0; }
.sticker img, .sticker svg { position: relative; z-index: 1; display: block; animation: pop .55s var(--spring) both, float 4.2s ease-in-out .6s infinite; }
.sticker img { filter: drop-shadow(2.5px 0 0 #fff) drop-shadow(-2.5px 0 0 #fff) drop-shadow(0 2.5px 0 #fff) drop-shadow(0 -2.5px 0 #fff) drop-shadow(0 10px 8px rgba(2,3,18,.5)); }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Budget meter, shared by the pop-up and the report. */
.bar { height: 10px; border-radius: 99px; background: #2A2F72; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-l), #C4B5FD); border-radius: 99px; transition: width .8s var(--ease); }
.bar.full i { background: linear-gradient(90deg, var(--amber), #FF9E6A); }

.card { position: relative; background: linear-gradient(180deg, var(--surface-top), var(--surface)); border: 1.5px solid var(--edge); border-radius: 22px; padding: 16px 18px;
  box-shadow: 0 4px 0 #0A0C26, inset 0 1px 0 rgba(255,255,255,.05); animation: rise .45s var(--ease) both; }
/* The app's bright blue "volt" card for the big number. */
.card.volt { background: radial-gradient(120% 90% at 50% 0%, #7088FF, transparent 62%), linear-gradient(160deg, #3F5BFF, #2730C9); border-color: rgba(255,255,255,.18);
  box-shadow: 0 5px 0 #1C2399, 0 18px 34px -16px rgba(67,97,255,.9); }
.card.volt .muted, .card.volt .small { color: rgba(255,255,255,.85); }
.card.volt .bar { background: rgba(10,14,80,.45); }
.card.volt .bar i { background: linear-gradient(90deg, #fff, #DCE3FF); }
.card.volt .bar.full i { background: linear-gradient(90deg, var(--amber), #FFB36B); }
.card.volt a { color: #fff; }

input[type="number"], input[type="text"], input[type="date"], select {
  background: var(--input); color: var(--t1); border: 1.5px solid #2E3374; border-radius: 14px; padding: 9px 11px; font: 600 14.5px var(--body); transition: border-color .15s, box-shadow .15s; }
input[type="number"]:focus, input[type="text"]:focus, input[type="date"]:focus, select:focus { border-color: #5B76FF; box-shadow: 0 0 0 3px rgba(91,118,255,.25); outline: none; }

/* On/off switches, still real checkboxes underneath. */
input[type="checkbox"].switch { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; border-radius: 99px; background: #2A2E6B; position: relative; cursor: pointer; margin: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.4); transition: background .2s var(--ease); }
input[type="checkbox"].switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.35); transition: transform .25s var(--spring); }
input[type="checkbox"].switch:checked { background: linear-gradient(180deg, var(--blue-top), var(--blue)); }
input[type="checkbox"].switch:checked::after { transform: translateX(18px); }

/* Little rounded pills, like the app's "Shields on". */
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 3px 10px; font: 800 11.5px var(--body); background: rgba(94,233,181,.14); color: var(--mint); }
.pill.sun { background: rgba(255,201,77,.16); color: var(--amber); }
.pill.lilac { background: rgba(196,181,253,.18); color: var(--lilac); }

/* Page heroes: a sticker beside the big title, as on the app's sticker pages. */
.hero { display: flex; align-items: center; gap: 22px; margin: 6px 0 4px; }
.hero > div { min-width: 0; }
.hero .sticker img { width: 104px; height: 104px; }
.hero h1 { font-size: 34px; line-height: 1.08; }
.hero .lead { margin-top: 8px; }
@media (max-width: 480px) { .hero { gap: 14px; } .hero .sticker img { width: 76px; height: 76px; } .hero h1 { font-size: 27px; } }

/* Numbered steps with round badges, like the app's "How to get it". */
ol.steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
ol.steps > li { position: relative; padding-left: 40px; counter-increment: step; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 700 14px var(--display); color: #fff; background: linear-gradient(180deg, var(--blue-top), var(--blue)); box-shadow: 0 3px 0 var(--blue-edge); }
ol.steps > li:nth-child(2)::before { background: linear-gradient(180deg, #A066FF, var(--violet)); box-shadow: 0 3px 0 var(--violet-deep); }
ol.steps > li:nth-child(3)::before { background: linear-gradient(180deg, #7DF0C6, #3FCF98); color: var(--ink); box-shadow: 0 3px 0 #23966B; }
ol.steps > li:nth-child(4)::before { background: linear-gradient(180deg, #FFD978, var(--amber)); color: var(--ink); box-shadow: 0 3px 0 var(--amber-edge); }
ol.steps > li:nth-child(5)::before { background: linear-gradient(180deg, #FFAB98, var(--coral)); color: var(--ink); box-shadow: 0 3px 0 #C65B45; }

/* Navigation on every page (drawn by nav.js): a bar across the top that stays put as you scroll,
   with the five tabs. On a narrow window the tabs move to the bottom, like the app's tab bar. */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(13,15,46,.8); border-bottom: 1px solid rgba(40,44,104,.85);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.topbar-in { max-width: 940px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .brand { text-decoration: none; flex: none; font-size: 16px; }
.navtabs { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(22,25,66,.92); border: 1.5px solid var(--edge); box-shadow: 0 3px 0 #0A0C26; }
.navtabs a { position: relative; display: flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 99px; color: var(--t2); font: 600 14.5px var(--display);
  text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, transform .18s var(--spring); }
.navtabs a:hover { color: var(--t1); background: rgba(255,255,255,.08); }
.navtabs a:active { transform: scale(.95); }
.navtabs a[aria-current="page"] { background: linear-gradient(180deg, var(--blue-top), var(--blue)); color: #fff; box-shadow: 0 3px 0 var(--blue-edge); }
.navtabs .ic { position: relative; display: grid; place-items: center; }
.navtabs svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.navtabs .badge { min-width: 20px; height: 20px; padding: 0 6px; margin-left: -1px; border-radius: 99px; background: var(--lilac); color: var(--ink);
  font: 800 11.5px/20px var(--body); text-align: center; animation: pop .45s var(--spring) both; }
.navtabs .badge.ready { background: var(--mint); }
@media (max-width: 780px) {
  .topbar { position: static; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar-in { padding: 18px 16px 0; }
  .navtabs { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 50; justify-content: space-around; border-radius: 24px; padding: 6px; background: rgba(20,23,63,.95);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 4px 0 #0A0C26, 0 18px 40px -10px rgba(0,0,0,.85); }
  .navtabs a { flex: 1; min-width: 0; flex-direction: column; gap: 3px; padding: 7px 2px 6px; border-radius: 18px; font-size: 11.5px; }
  .navtabs .tx { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .navtabs .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; box-shadow: 0 0 0 2px #14173F; }
  body { padding-bottom: 84px; }
}

