/* Gloed design — tokens and screens mirror "Habit Tracker Gloed.dc.html". */

/* ---------- Themes: hue (--h), chroma factor (--k) and accents ---------- */
body { --h: 60; --k: 1; --acc: #e8913a; --accA: #ffc27a; --accB: #d9731f; }
body[data-theme="oceaan"] { --h: 200; --k: 1; --acc: #2bb3b1; --accA: #7fe3d8; --accB: #16868f; }
body[data-theme="bos"] { --h: 145; --k: 0.9; --acc: #5fae5a; --accA: #a8dd8a; --accB: #3a8342; }
body[data-theme="lavendel"] { --h: 295; --k: 1; --acc: #9b7be0; --accA: #c9b0ff; --accB: #6f52c4; }
body[data-theme="roos"] { --h: 10; --k: 1; --acc: #e0607e; --accA: #ffa3b5; --accB: #bf3a5e; }
body[data-theme="maan"] { --h: 255; --k: 0.35; --acc: #8e98ad; --accA: #d3d9e4; --accB: #636d84; }

/* ---------- Light mode ---------- */
/* Shared with the design system (tokens.json): radius by role, and the one danger red. */
body {
  --radius-cell: 3px; --radius-seg: 9px; --radius-control: 12px; --radius-card: 20px;
  --radius-panel: 22px; --radius-sheet: 28px; --radius-pill: 999px;
  --danger: #ff5f7e;
  --text: oklch(0.28 calc(0.06 * var(--k)) var(--h));
  --muted: oklch(0.5 calc(0.06 * var(--k)) var(--h));
  --hair: oklch(0.28 calc(0.06 * var(--k)) var(--h) / 0.08);
  --ringc: oklch(0.28 calc(0.06 * var(--k)) var(--h) / 0.3);
  --track: oklch(0.28 calc(0.06 * var(--k)) var(--h) / 0.08);
  --doneName: oklch(0.72 calc(0.04 * var(--k)) var(--h));
  --card: #ffffff;
  --cardShadow: 0 1px 3px oklch(0.28 calc(0.06 * var(--k)) var(--h) / 0.06);
  --mix: #ffffff;
  --lift: #ffffff;
  --seg: oklch(0.28 calc(0.06 * var(--k)) var(--h) / 0.06);
  --segOn: #ffffff;
  --nav: rgba(255, 255, 255, 0.92);
  --navShadow: 0 2px 10px oklch(0.28 calc(0.06 * var(--k)) var(--h) / 0.07);
  --navOn: var(--accB);
  --navOff: oklch(0.68 calc(0.04 * var(--k)) var(--h));
  --fabFg: #ffffff;
  --accent: var(--accB);
  --bgRing: #ffffff;
  --catInk: 80%;
  --top: oklch(0.89 calc(0.07 * var(--k)) var(--h));
  color-scheme: light;
  --catBg: 14%;
  --pageEnd: oklch(0.99 calc(0.006 * var(--k)) var(--h));
  /* A warm glow from the top, over the page's vertical fade. */
  --grad:
    radial-gradient(140% 55% at 50% 0%, oklch(0.86 calc(0.09 * var(--k)) var(--h) / 0.55) 0%, transparent 72%),
    linear-gradient(180deg, oklch(0.93 calc(0.05 * var(--k)) var(--h)) 0%, oklch(0.97 calc(0.02 * var(--k)) var(--h)) 40%, oklch(0.99 calc(0.006 * var(--k)) var(--h)) 100%);
}

/* ---------- Dark mode ---------- */
/* Dark: chosen, or "Systeem" on a device set to dark. Both blocks are the same tokens. */
body[data-appearance="dark"] {
  --text: oklch(0.93 calc(0.035 * var(--k)) var(--h));
  --muted: oklch(0.7 calc(0.05 * var(--k)) var(--h));
  --hair: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.08);
  --ringc: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.4);
  --track: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.09);
  --doneName: oklch(0.52 calc(0.04 * var(--k)) var(--h));
  --card: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.06);
  --cardShadow: none;
  --mix: oklch(0.16 calc(0.03 * var(--k)) var(--h));
  --lift: oklch(0.27 calc(0.035 * var(--k)) var(--h));
  --seg: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.08);
  --segOn: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.16);
  --nav: oklch(0.2 calc(0.035 * var(--k)) var(--h) / 0.9);
  --navShadow: inset 0 0 0 1px oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.06);
  --navOn: var(--accA);
  --navOff: oklch(0.58 calc(0.04 * var(--k)) var(--h));
  --fabFg: oklch(0.16 calc(0.03 * var(--k)) var(--h));
  --accent: var(--accA);
  --bgRing: oklch(0.2 calc(0.03 * var(--k)) var(--h));
  --catInk: 100%;
  --catBg: 16%;
  --pageEnd: oklch(0.13 calc(0.02 * var(--k)) var(--h));
  /* A warm glow from the top, over a fade that ends deep brown rather than black. */
  --grad:
    radial-gradient(140% 55% at 50% 0%, oklch(0.42 calc(0.11 * var(--k)) var(--h) / 0.6) 0%, transparent 72%),
    linear-gradient(180deg, oklch(0.27 calc(0.065 * var(--k)) var(--h)) 0%, oklch(0.17 calc(0.038 * var(--k)) var(--h)) 50%, oklch(0.13 calc(0.02 * var(--k)) var(--h)) 100%);
  --sheet: oklch(0.2 calc(0.03 * var(--k)) var(--h));
  /* Solid colour behind the Android status bar (see bridge/appearance_controller.js). */
  --top: oklch(0.36 calc(0.095 * var(--k)) var(--h));
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  body[data-appearance="system"] {
    --text: oklch(0.93 calc(0.035 * var(--k)) var(--h));
    --muted: oklch(0.7 calc(0.05 * var(--k)) var(--h));
    --hair: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.08);
    --ringc: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.4);
    --track: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.09);
    --doneName: oklch(0.52 calc(0.04 * var(--k)) var(--h));
    --card: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.06);
    --cardShadow: none;
    --mix: oklch(0.16 calc(0.03 * var(--k)) var(--h));
    --lift: oklch(0.27 calc(0.035 * var(--k)) var(--h));
    --seg: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.08);
    --segOn: oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.16);
    --nav: oklch(0.2 calc(0.035 * var(--k)) var(--h) / 0.9);
    --navShadow: inset 0 0 0 1px oklch(0.93 calc(0.035 * var(--k)) var(--h) / 0.06);
    --navOn: var(--accA);
    --navOff: oklch(0.58 calc(0.04 * var(--k)) var(--h));
    --fabFg: oklch(0.16 calc(0.03 * var(--k)) var(--h));
    --accent: var(--accA);
    --bgRing: oklch(0.2 calc(0.03 * var(--k)) var(--h));
    --catInk: 100%;
    --catBg: 16%;
    --pageEnd: oklch(0.13 calc(0.02 * var(--k)) var(--h));
    /* A warm glow from the top, over a fade that ends deep brown rather than black. */
    --grad:
      radial-gradient(140% 55% at 50% 0%, oklch(0.42 calc(0.11 * var(--k)) var(--h) / 0.6) 0%, transparent 72%),
      linear-gradient(180deg, oklch(0.27 calc(0.065 * var(--k)) var(--h)) 0%, oklch(0.17 calc(0.038 * var(--k)) var(--h)) 50%, oklch(0.13 calc(0.02 * var(--k)) var(--h)) 100%);
    --sheet: oklch(0.2 calc(0.03 * var(--k)) var(--h));
    /* Solid colour behind the Android status bar (see bridge/appearance_controller.js). */
    --top: oklch(0.36 calc(0.095 * var(--k)) var(--h));
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
/* No rubber band past the page edge: the overscroll area would show the plain page
   colour (near black) instead of the gradient. Also keeps the app's nav from flexing. */
html, body { overscroll-behavior: none; }
/* No grey/blue box on tap (Android web view); every control has its own press feedback.
   Inherited, so set once. Keyboard focus keeps its ring through :focus-visible. */
html { -webkit-tap-highlight-color: transparent; }
/* Turbo's loading bar sits on <html>, outside the themed body: the Gloed accent, not its default blue. */
.turbo-progress-bar { height: 2px; background: #e8913a; }
:focus:not(:focus-visible) { outline: none; }
/* In the app a long press selects nothing and opens no link menu, like a native screen;
   fields stay selectable. */
body[data-native] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body[data-native] :is(input, textarea) { -webkit-user-select: text; user-select: text; }
::selection { background: color-mix(in srgb, var(--acc) 38%, transparent); }
input, textarea { caret-color: var(--acc); }
/* Chrome's autofill paints fields light blue; keep the field's own colours. */
input:-webkit-autofill, input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 40px var(--seg) inset; -webkit-text-fill-color: var(--text); transition: background-color 9999s; }
body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--pageEnd);
  background-image: var(--grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Outfit", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: "Outfit", sans-serif; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
form { margin: 0; }
h1, h2, p { margin: 0; }
.scr, .strip { scrollbar-width: none; }
.scr::-webkit-scrollbar, .strip::-webkit-scrollbar { width: 0; height: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.grad-text { background: linear-gradient(90deg, var(--accB), var(--accA)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }

@keyframes gl-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gl-strip { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.gloed-shell {
  max-width: 412px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(120px + env(safe-area-inset-bottom));
  animation: gl-in .16s ease-out both;
}

.page-title { font-size: 28px; font-weight: 600; margin-top: 6px; }

.flash {
  /* Centred with margins: gl-in animates transform, which would undo a translateX. */
  position: fixed; z-index: 50; top: calc(14px + env(safe-area-inset-top)); left: 0; right: 0; margin: 0 auto;
  width: min(380px, calc(100% - 32px)); padding: 12px 16px; border-radius: 16px;
  background: var(--nav); box-shadow: var(--navShadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 14px; animation: gl-in .25s ease both;
}

/* ---------- Native chrome ---------- */
/* The Android shell draws the toolbar and the tab bar itself (bridge--toolbar, bridge--tabs).
   Hidden only when those components exist; an older install keeps the web ones. */
body[data-bridge-toolbar] :is(.page-head, .nf-top, .title-row, .day-head, .icon-btn.back) { display: none; }
body[data-bridge-toolbar] .gloed-shell { padding-top: 8px; }
/* Nieuwe gewoonte and Bewerken: the native bar has their title and Back, so the form starts under it. */
body[data-bridge-toolbar] .hf { padding-top: 8px; }
body[data-bridge-toolbar] .hf .nf-name { margin-top: 0; }
/* The native title already leaves room below it: the first block after the hidden web title starts flush. */
body[data-bridge-toolbar] .title-row + *,
body[data-bridge-toolbar] .title-row + .mg-groups > .mg-head:first-child,
body[data-bridge-toolbar] .title-row + .settings-groups > .settings-group:first-child .group-title { margin-top: 0; }
/* A full-screen page sheet covers the page, not the native bar: it keeps its own head and Back. */
body[data-bridge-toolbar] .page-sheet :is(.page-head, .icon-btn.back) { display: flex; }
/* The day strip sits right under the native bar: the page padding is its gap. */
body[data-bridge-toolbar] .strip-open .strip { margin-top: -4px; }
body[data-bridge-tabs] :is(.bottom-nav, .nav-fade) { display: none; }
body[data-bridge-tabs] .gloed-shell:not(.no-nav) { padding-bottom: 32px; }

/* ---------- Bottom navigation ---------- */
/* Content scrolls under the nav; this fades it into the page's bottom colour so it
   recedes instead of showing sharply around and below the bar. */
.nav-fade {
  position: fixed; z-index: 9; left: 0; right: 0; bottom: 0; pointer-events: none;
  height: calc(118px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, color-mix(in srgb, var(--pageEnd) 0%, transparent) 0%, color-mix(in srgb, var(--pageEnd) 85%, transparent) 55%, var(--pageEnd) 100%);
}
.bottom-nav {
  position: fixed; z-index: 10;
  left: max(16px, calc(50% - 190px)); right: max(16px, calc(50% - 190px));
  bottom: calc(16px + env(safe-area-inset-bottom));
  height: 68px; border-radius: 34px;
  background: var(--nav); box-shadow: var(--navShadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.nav-item {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--navOff); transition: color .15s;
}
.nav-item i { font-size: 22px; }
.nav-item span { font-size: 10.5px; font-weight: 500; }
.nav-item::after { content: ""; position: absolute; bottom: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--navOn); opacity: 0; }
.nav-item.on { color: var(--navOn); }
.nav-item.on::after { opacity: 1; }
.nav-glyph { display: block; width: 22px; height: 22px; }
/* Vandaag, in the middle: the sun inside today's progress ring, a size up from the others. */
.nav-ring { position: relative; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.nav-ring-arc, .nav-ring .day-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nav-ring .day-ring circle { stroke-width: 7; }
.nav-ring .day-ring .ring-tip circle { r: 6px; fill: currentColor; }
.nav-item .nav-ring i { position: relative; font-size: 17px; }
.nav-today { gap: 2px; }
/* A day's progress ring (shared/_ring): Vandaag's tab icon. */
.day-ring .ring-track { fill: none; stroke: var(--track); stroke-width: 5; }
.day-ring .ring-arc { fill: none; stroke: url(#kGrad); stroke-width: 5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dasharray .6s cubic-bezier(.3, .7, .3, 1); }
.day-ring .ring-tip { transform-origin: 50px 50px; transition: transform .6s cubic-bezier(.3, .7, .3, 1); }
.day-ring .ring-tip circle { fill: var(--text); }

/* ---------- Today ---------- */
.day-head { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.icon-btn i { font-size: 17px; }
.day-head .icon-btn i { font-size: 18px; }
/* Under the habits, one quiet row without fills: Voltooid (its list opens below). */
.today-foot { position: relative; margin-top: 36px; }
.today-foot .foot-pill { display: flex; align-items: center; gap: 7px; width: fit-content; height: 40px; min-height: 0; margin: 0; padding: 0 4px; background: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.today-foot .foot-pill i { font-size: 15px; }
.today-foot .done-sec > .foot-pill { color: var(--text); }
.today-foot .done-sec > .foot-pill .ph-check-circle { color: var(--acc); }
.today-foot .done-sec > .rt-head .chev { font-size: 12px; color: var(--muted); transform: none; }
.today-foot .done-sec[open] > .rt-head .chev { transform: rotate(180deg); }
.today-foot .done-sec[open] > .foot-pill { margin-bottom: 6px; }
/* Phone: Voltooid sits at the bottom of the screen when the list is shorter. */
@media (max-width: 1023px) {
  main.today, main.today > #today-body, #today-body > .today-main { display: flex; flex-direction: column; }
  main.today > #today-body, #today-body > .today-main { flex: 1; }
  .today-foot { margin-top: auto; padding-top: 36px; }
}
.day-title { display: block; flex: 1; min-width: 0; border: none; background: transparent; color: var(--text); text-align: left; padding: 0; }
.day-title h1 { display: flex; align-items: center; gap: 6px; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.day-title h1 i { font-size: 14px; color: var(--muted); transition: transform .2s; }
.strip-open .day-title h1 i { transform: rotate(180deg); }
.day-title span { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
/* Phone: ‹ day ⌄ › on one line; the title names the day, so no date under it. */
.day-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.day-nav .icon-btn { width: 44px; height: 44px; color: var(--text); }
.day-nav .icon-btn i { font-size: 22px; }
.day-nav .icon-btn.off { opacity: .3; pointer-events: none; }
.day-nav .day-title { flex: none; padding: 0 4px; }
.day-nav .day-title h1 { font-size: 26px; }
.day-nav .day-title h1 i { display: none; }
.day-nav .day-title span { display: none; }

.strip { display: none; }
.strip-open .strip { position: relative; display: flex; gap: 6px; overflow-x: auto; margin: 18px -20px 0; padding: 0 20px; }
.strip-anim .strip { animation: gl-strip .2s ease both; }
/* Frame updates (another day) swap content in place; replaying the page entrance there reads as a glitch. */
turbo-frame .gloed-shell { animation: none; }
/* The app opens a tab from Turbo's cache and then renders it fresh: an entrance there plays twice, a blink. */
turbo-frame#app .ov-card { animation: none; }
.strip a { flex: none; width: 50px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 0 9px; border-radius: 25px; color: var(--muted); transition: background .15s; }
.strip a.on { background: var(--segOn); color: var(--text); }
.strip .wd { font-size: 11.5px; opacity: .75; }
.strip .num { font-size: 16px; font-weight: 600; }
.strip a.today:not(.on) .num { color: var(--accent); }
.strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--track); }
.strip .dot.part { background: color-mix(in srgb, var(--acc) 45%, transparent); }
.strip .dot.full { background: var(--acc); }


.zen-art { position: relative; width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; }
.zen-art::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 30%, transparent) 0%, transparent 66%); }
.zen-art svg { position: relative; width: 132px; height: 132px; }

.habit-btn { width: 100%; border: none; font-family: "Outfit", sans-serif; color: var(--text); text-align: left; }

.hero-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; margin-top: 12px; border: none; border-radius: 22px; background: var(--accB); color: var(--fabFg); font-size: 15px; font-weight: 600; white-space: nowrap; }
.hero-btn i { font-size: 17px; }

.sect-head { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 4px 6px; }

/* The day's progress: "vast" a card with what is left, "minimaal" a thin line and 3/5. */
.rt-sec.plain { margin-top: 14px; }

/* Shared (Samen): how many of the group are done, after the name. */
.mates-tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; margin-left: 6px; border-radius: 10px; vertical-align: 2px; background: color-mix(in srgb, var(--accB) 16%, transparent); color: var(--accB); font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.mates-tag i { font-size: 11px; }

/* Vandaag's head: a small + for a new habit, then your photo (to Profiel). */
.head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn.add-habit { position: relative; width: 32px; height: 32px; flex: none; background: var(--card); box-shadow: var(--cardShadow); color: var(--text); }
.icon-btn.add-habit::after { content: ""; position: absolute; inset: -6px; }
.icon-btn.add-habit i.ph-bold { font-size: 15px; }
.me-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accA), var(--accB)); color: #fff; font-size: 16px; font-weight: 600; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }

.habit-main { flex: 1; min-width: 0; }
.habit-name { font-size: 17px; }
.done .habit-name { color: var(--doneName); text-decoration: line-through; }
.habit-slot { display: flex; align-items: center; gap: 4px; }
.habit-slot i { font-size: 13px; flex: none; }
.habit-slot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Habits on Vandaag: one card each. */
.habits-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.card-row { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 16px 16px 18px; border-radius: var(--radius-card); background: var(--card); box-shadow: var(--cardShadow); transition: opacity .2s; }
.card-row.done { opacity: .55; }
.card-row > i { font-size: 26px; color: var(--c); flex: none; }
.card-row .habit-slot { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-row .tally { text-align: right; flex: none; }
.card-row .tally b { display: block; font-size: 18px; font-weight: 600; color: var(--c); font-variant-numeric: tabular-nums; }
.card-row .tally span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.card-row .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p); background: var(--c); border-radius: 0 2px 2px 0; transition: width .3s; }


/* Grootte (Instellingen): compact or ruim cards on Vandaag; normal is the above. */
.density-compact .habits-stack { gap: 6px; }
.density-compact .habit-slot { font-size: 12px; margin-top: 1px; }
.density-compact .card-row { gap: 12px; padding: 10px 14px 12px; border-radius: 16px; }
.density-compact .card-row > i { font-size: 22px; }
.density-compact .card-row .tally b { font-size: 16px; }
.density-ruim .habits-stack { gap: 14px; }
.density-ruim .habit-slot { font-size: 14px; margin-top: 4px; }
.density-ruim .card-row { gap: 16px; padding: 22px 18px 24px; border-radius: 24px; }
.density-ruim .card-row > i { font-size: 30px; }

/* Weekly habits: "Deze week", one pip per day needed (and extra days beyond it). */
.week-head { font-size: 14px; color: var(--muted); margin: 28px 0 2px; }
/* Cards colour their pips like the rest of the habit. */


.empty { text-align: center; color: var(--muted); font-size: 15px; padding: 10px 0; }
.empty-card { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 18px; padding: 22px 18px 24px; border-radius: var(--radius-panel); background: var(--card); box-shadow: var(--cardShadow); animation: gl-in .3s ease both; }
.empty-card .zen-art { width: 120px; height: 120px; }
.empty-card .zen-art svg { width: 96px; height: 96px; }
.empty-card h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; }
.empty-card p { font-size: 15px; color: var(--muted); margin-top: 6px; line-height: 1.4; text-wrap: pretty; }
.empty-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.empty-card .hero-btn { margin-top: 18px; }

/* ---------- Overview ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; margin: 26px 0 8px; }
.bars > button { border: none; background: transparent; padding: 0; color: inherit; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.bars i { width: 100%; max-width: 30px; border-radius: 8px; background: color-mix(in srgb, var(--acc) 55%, transparent); transition: height .3s; }
.bars span { font-size: 12.5px; color: var(--muted); }
/* The highlight fades in and out (a gradient cannot transition, its opacity can). */
.bars i { position: relative; overflow: hidden; }
.bars i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--accA), var(--accB)); opacity: 0; transition: opacity .35s ease; }
.bars .on i::after { opacity: 1; }
.bars span { transition: color .3s ease; }
.bars .on span { color: var(--text); font-weight: 600; }
.per-habit .unit { font-weight: 400; font-size: 13px; }
.section-title { font-size: 16px; font-weight: 600; margin: 34px 0 4px; }
.per-habit { padding: 14px 0; border-bottom: 1px solid var(--hair); }
.per-habit > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.per-habit .name { flex: 1; min-width: 0; font-size: 16px; }
.per-habit .pct { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.per-habit .track { height: 5px; border-radius: 3px; background: var(--track); margin-top: 10px; overflow: hidden; }
.per-habit .track i { display: block; height: 100%; border-radius: 3px; background: var(--c); }

/* ---------- Widgets ---------- */
.widget-card { background: var(--card); box-shadow: var(--cardShadow); border-radius: 24px; }
.quick { padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.quick-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.quick-head b { font-size: 14px; font-weight: 600; }
.quick-head span { font-size: 12px; color: var(--muted); }
.quick-list { display: flex; flex-direction: column; gap: 6px; max-height: 270px; overflow-y: auto; }
.status-list { max-height: 216px; overflow-y: auto; }
:is(.quick-list, .status-list) { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
.quick-btn { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 9px 0 8px; border-radius: 15px; background: var(--seg); }
.quick-btn.done { background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.quick-btn .dot-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--c); display: flex; align-items: center; justify-content: center; flex: none; }
.quick-btn .dot-icon i { font-size: 15px; color: #fff; }
.quick-btn .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.quick-btn .nm b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-btn.done .nm b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.quick-btn .bar { height: 4px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--c) 18%, var(--seg)); }
.quick-btn .bar i { display: block; height: 100%; border-radius: 2px; background: var(--c); }
.quick-btn .ck { flex: none; width: 26px; height: 26px; border-radius: 50%; box-sizing: border-box; border: 2px solid color-mix(in srgb, var(--c) 55%, var(--seg)); display: grid; place-items: center; }
.quick-btn.done .ck { border: 0; background: var(--c); }
.quick-btn .ck i { font-size: 15px; color: #fff; }
.quick-btn .cnt { flex: none; font-size: 13px; font-weight: 600; color: var(--c); font-variant-numeric: tabular-nums; }
.pill-btn { border: none; background: var(--seg); color: var(--text); font-size: 14px; font-weight: 500; padding: 9px 16px; border-radius: 18px; }
.status { padding: 10px 18px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.status-row .name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14.5px; white-space: nowrap; }
.status-row .name span:last-child { overflow: hidden; text-overflow: ellipsis; }
.status-row .dot-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--c); display: flex; align-items: center; justify-content: center; flex: none; }
.status-row .dot-icon i { font-size: 12px; color: #fff; }
.status-row.days { padding: 0 0 2px; }
.status-row.days .cells b { width: 18px; padding: 2px 0; border-radius: 5px; text-align: center; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.status-row.days .cells b.today { background: var(--text); color: var(--card); font-weight: 600; }
.status-row .cells { display: flex; gap: 4px; flex: none; }
.status-row .cells i { width: 18px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--c) 16%, var(--mix)); }
.status-row .cells i.part { background: color-mix(in srgb, var(--c) 45%, var(--mix)); }
.status-row .cells i.next { box-sizing: border-box; background: transparent; border: 1.5px dashed color-mix(in srgb, var(--c) 40%, var(--mix)); }
.status-row .cells i.full { background: var(--c); }
.status-row .cells i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--track); }
.popover { margin: auto; border: none; border-radius: var(--radius-card); padding: 18px 20px; max-width: 300px; background: var(--mix); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); font-size: 15px; line-height: 1.45; text-align: center; }
.popover::backdrop { background: rgba(0, 0, 0, .35); }

/* ---------- Settings ---------- */
.settings-card { display: block; background: var(--card); box-shadow: var(--cardShadow); border-radius: var(--radius-panel); padding: 4px 18px; margin-top: 22px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--hair); width: 100%; background: transparent; border-top: 0; border-left: 0; border-right: 0; color: var(--text); text-align: left; font-size: 16px; }
.set-row:last-child { border-bottom: none; }
.set-row > i:first-child { font-size: 22px; color: var(--muted); }
.set-row .label { flex: 1; min-width: 0; font-size: 16px; }
.set-row .label small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.set-row .caret { font-size: 17px; color: var(--muted); }
/* Instellingen and Profiel: compact rows; Thema, Taal and Grootte with their choice small on the right. */
.settings-groups .set-row { gap: 12px; padding: 12px 0; font-size: 15px; }
.settings-groups .set-row .label { font-size: 15px; }
.settings-groups .set-row > i:first-child { font-size: 20px; }
.segmented.mini { flex: none; padding: 2px; border-radius: 10px; }
.segmented.mini button { height: 28px; padding: 0 9px; border-radius: 8px; font-size: 12px; }
/* Geavanceerd: its rows folded under a switch. */
.advanced-rows > summary { list-style: none; cursor: pointer; }
.advanced-rows > summary::-webkit-details-marker { display: none; }
.advanced-rows[open] > summary .switch { background: var(--acc); }
.advanced-rows[open] > summary .switch::after { left: 21px; }
.advanced-rows[open] > summary { border-bottom: 1px solid var(--hair); }
.switch { width: 46px; height: 28px; border-radius: 14px; border: none; position: relative; flex: none; padding: 0; background: var(--track); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch.on { background: var(--acc); }
.switch.on::after { left: 21px; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.theme-opt { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 10px; border-radius: 16px; border: none; background: transparent; color: var(--text); font-size: 13px; }
.theme-opt.on { background: var(--segOn); box-shadow: inset 0 0 0 1px var(--hair); }
.theme-opt .swatch { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(145deg, var(--sA), var(--sB)); }
.theme-opt .logo-tile { width: 40px; height: 40px; border-radius: 11px; }
.theme-opt.on .logo-tile { box-shadow: 0 0 0 3px var(--bgRing), 0 0 0 5px var(--acc); }
.theme-opt.on .swatch { box-shadow: 0 0 0 3px var(--bgRing), 0 0 0 5px var(--s); }
.segmented { display: flex; gap: 3px; background: var(--seg); border-radius: var(--radius-control); padding: 3px; }
.segmented form { flex: 1; }
.segmented button { width: 100%; height: 38px; border: none; border-radius: var(--radius-seg); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 500; background: transparent; color: var(--muted); }
.segmented button.on { background: var(--segOn); color: var(--text); }
.segmented i { font-size: 15px; }

/* ---------- Full-screen flows (new habit, onboarding) ---------- */
.flow {
  max-width: 412px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  animation: gl-fade .2s ease both;
}
.flow > form { display: contents; }
.flow-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 0; }
.flow-top .icon-btn { color: var(--text); }
.flow-top .icon-btn i { font-size: 20px; }
.flow-top .spacer { width: 44px; }
.dots { display: flex; gap: 6px; }
.dots span { height: 6px; width: 6px; border-radius: 3px; background: var(--track); transition: all .25s; }
.dots span.past { background: var(--text); }
.dots span.on { width: 22px; background: var(--text); }
.flow h2 { font-size: 26px; font-weight: 400; line-height: 1.3; letter-spacing: -0.015em; text-align: center; text-wrap: pretty; }
.step { flex: 1; display: flex; flex-direction: column; animation: gl-in .3s ease both; }
.hint { text-align: center; font-size: 14px; color: var(--muted); }
.name-input { margin-top: 28px; width: 100%; padding: 17px 18px; border-radius: 18px; border: none; outline: none; background: var(--seg); color: var(--text); font-size: 18px; }
.name-input::placeholder { color: var(--muted); opacity: .7; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chips button { border: none; background: transparent; box-shadow: inset 0 0 0 1px var(--hair); color: var(--text); font-size: 14px; padding: 9px 14px; border-radius: 18px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--seg); color: var(--text); display: flex; align-items: center; justify-content: center; }
.round-btn i { font-size: 15px; }
.stepper output { min-width: 34px; text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.wheel { display: flex; align-items: center; gap: 10px; margin-top: 34px; }
.wheel-col { display: flex; flex-direction: column; align-items: center; gap: 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
.wheel-sep { font-size: 34px; font-weight: 300; color: var(--muted); }
.wheel-col button { border: none; background: transparent; font-size: 26px; font-weight: 300; color: var(--muted); opacity: .6; padding: 6px 0; font-variant-numeric: tabular-nums; }
.wheel-col output { width: 92px; padding: 12px 0; border-radius: 20px; background: color-mix(in srgb, var(--acc) 18%, transparent); text-align: center; font-size: 40px; font-weight: 400; font-variant-numeric: tabular-nums; }
.wheel.compact { margin-top: 0; gap: 8px; }
.wheel.compact .wheel-col button { font-size: 19px; padding: 3px 0; }
.wheel.compact .wheel-col output { width: 72px; padding: 8px 0; border-radius: 16px; font-size: 30px; }
.wheel.compact .wheel-sep { font-size: 26px; }
.primary { width: 100%; height: 56px; border-radius: var(--radius-pill); border: none; background: var(--text); color: var(--fabFg); font-size: 17px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 10px; }
.text-link { margin: 14px 0 36px; border: none; background: transparent; font-size: 15px; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; padding: 8px; }

/* Habit form shared parts (name with its icon, icons and colours, cards) */
.nf-top { display: flex; align-items: center; gap: 8px; padding: 14px 0 4px; }
.nf-top .icon-btn { margin-left: -10px; color: var(--text); }
.nf-top .icon-btn i { font-size: 20px; }
.nf-top h1 { flex: 1; font-size: 19px; font-weight: 600; }
.nf-quick { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px; }
.nf-pick { flex: none; display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 12px; border: none; border-radius: 19px; background: var(--card); box-shadow: var(--cardShadow); color: var(--text); font-size: 14px; white-space: nowrap; }
.nf-pick i { font-size: 16px; }
.hf-ideas { margin-top: 14px; }
.hf-ideas[hidden] { display: none; }
.hf-idea i { color: var(--c); }
.nf-name { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; border-radius: 20px; background: var(--card); box-shadow: var(--cardShadow); }
.nf-preview { position: relative; width: 48px; height: 48px; padding: 0; border: none; border-radius: 15px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--c); transition: background .2s; }
.nf-preview > i { font-size: 22px; color: #fff; }
.nf-name input { flex: 1; min-width: 0; height: 44px; border: none; outline: none; background: transparent; color: var(--text); font-size: 17px; }
.nf-name input::placeholder { color: var(--muted); opacity: .8; }
.nf-card { padding: 14px 16px; border-radius: var(--radius-panel); background: var(--card); box-shadow: var(--cardShadow); }
.nf-icons { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.nf-icons input, .nf-colours input { position: absolute; opacity: 0; pointer-events: none; }
.nf-icons span { height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--seg); color: var(--muted); font-size: 19px; cursor: pointer; }
.nf-icons input:checked + span { background: var(--c); color: #fff; }
.nf-colours { display: flex; justify-content: space-between; margin-top: 14px; padding: 0 4px; }
.nf-colours span { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--c); cursor: pointer; }
.nf-colours input:checked + span { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
.nf-icons input:focus-visible + span, .nf-colours input:focus-visible + span { outline: 2px solid var(--acc); }

/* Nieuwe gewoonte and Bewerken (habits/_habit_form). Rows open a sheet ("edit");
   in "waterval" the parts fold open in place. */
.hf { padding: env(safe-area-inset-top) 20px calc(110px + env(safe-area-inset-bottom)); }
.hf .nf-top .icon-btn:last-child:not(:first-child) { margin-right: -10px; }
.hf .nf-name { margin-top: 8px; }
.hf .nf-preview { width: 40px; height: 40px; border-radius: 13px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.hf .nf-preview > i { font-size: 20px; color: var(--c); }
.hf .sect-head { margin: 24px 4px 8px; }
.hf-rows { padding: 0 16px; border-radius: var(--radius-panel); background: var(--card); box-shadow: var(--cardShadow); }
.hf-freq-sec { display: contents; }
.hf[data-kind="quit"] .hf-freq-sec { display: none; }
.hf-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 8px 0; border: none; border-bottom: 1px solid var(--hair); background: none; color: var(--text); text-align: left; }
.hf-rows > :last-child .hf-row, .hf-rows > .hf-row:last-child { border-bottom: none; }
.hf-ic { font-size: 20px; color: var(--muted); flex: none; width: 20px; }
.hf-label { flex: 1; min-width: 0; font-size: 15.5px; }
.hf-val { max-width: 55%; font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-caret { font-size: 15px; color: var(--muted); flex: none; }
.hf-row .lock { font-size: 13px; color: var(--muted); }
.hf-row.locked .hf-val { max-width: 50%; }
.group-settings .hf-rows { margin-top: 10px; }
.group-settings .unit-input { display: block; }
.group-settings .hf-look-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--c); }
.hf-title { font-size: 21px; font-weight: 600; margin-bottom: 14px; }
.hf-done { width: 100%; height: 52px; margin-top: 22px; border: none; border-radius: 26px; background: var(--accB); color: #fff; font-size: 15.5px; font-weight: 600; }
.hf-bar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--pageEnd) 35%); }
.hf-cta { display: block; width: 100%; max-width: 372px; height: 54px; margin: 0 auto; border: none; border-radius: 27px; background: var(--accB); color: #fff; font-size: 16px; font-weight: 600; }
.hf-extra { margin-top: 14px; padding: 2px 16px; }

/* A part's fields as a sheet over the page. */
.hf-sheet { position: fixed; inset: 0; z-index: 60; display: none; flex-direction: column; justify-content: flex-end; align-items: center; }
.hf-sec.open .hf-sheet, .hf-look:not([hidden]) { display: flex; }
.hf-backdrop { position: absolute; inset: 0; background: rgba(20, 14, 8, .4); animation: gl-fade .2s ease both; }
.hf-panel { position: relative; width: 100%; max-width: 440px; max-height: 88dvh; overflow-y: auto; padding: 12px 22px calc(30px + env(safe-area-inset-bottom)); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; background: var(--sheet); animation: gl-sheet .28s cubic-bezier(.2, .8, .2, 1) both; }
.hf-look .nf-icons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hf-look .nf-icons span { height: 48px; border-radius: 15px; font-size: 21px; }

/* Waterval: the open part's fields right under its row; done parts get a check. */
.hf-waterval .hf-sec.open .hf-sheet { position: static; display: block; }
.hf-waterval .hf-sec.open .hf-backdrop, .hf-waterval .hf-sec .grabber, .hf-waterval .hf-sec .hf-title { display: none; }
.hf-waterval .hf-sec.open .hf-panel { max-width: none; max-height: none; overflow: visible; padding: 4px 0 16px; border-radius: 0; background: none; animation: gl-in .2s ease both; }
.hf-waterval .hf-sec.open .hf-val, .hf-waterval .hf-sec.open .hf-caret { display: none; }
.hf-waterval .hf-sec.open .hf-label { font-size: 17px; font-weight: 600; }
.hf-waterval .hf-sec.done .hf-ic { color: var(--accent); }
.hf-waterval .hf-sec.done .hf-ic::before { content: "\e184"; font-family: "Phosphor-Fill"; }
.hf-waterval .hf-sec .hf-done { height: 46px; margin-top: 14px; }

/* Parts' fields */
.hf-kinds { display: flex; flex-direction: column; gap: 10px; }
.hf-kind { position: relative; display: block; color: var(--text); }
.hf-kind input { position: absolute; opacity: 0; pointer-events: none; }
.hf-kind > span { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--cardShadow); cursor: pointer; }
.hf-kind .tile { width: 42px; height: 42px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--seg); color: var(--muted); font-size: 21px; }
.hf-kind .tile .ph-fill, .hf-kind input:checked + span .tile .ph { display: none; }
.hf-kind input:checked + span .tile .ph-fill { display: inline; }
.hf-kind input:checked + span { box-shadow: inset 0 0 0 2px var(--accB); }
.hf-kind input:checked + span .tile { background: color-mix(in srgb, var(--accB) 14%, transparent); color: var(--accent); }
.hf-kind input:focus-visible + span { outline: 2px solid var(--acc); }
.hf-kind .label { flex: 1; min-width: 0; }
.hf-kind b { display: block; font-size: 16px; font-weight: 600; }
.hf-kind small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.hf-kind .lock { font-size: 12px; color: var(--muted); }
.hf-timer { display: none; }
.hf[data-kind="timer"] .hf-timer { display: block; }
.hf-timer .sect-head { margin-top: 20px; }
.hf-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.hf-chip span, .hf-chip-btn { display: flex; align-items: center; height: 40px; padding: 0 12px; border: none; border-radius: var(--radius-pill); background: var(--seg); color: var(--text); font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.hf-chip input:checked + span { background: var(--accB); color: var(--fabFg); font-weight: 600; }
.hf-time input[type=time] { height: 40px; padding: 0 12px; border: none; border-radius: 20px; background: var(--seg); color: var(--text); font: inherit; font-size: 14.5px; }
.hf-time .extra-reminders { margin-top: 10px; }
.hf-switch-row { padding: 8px 0 14px; border-bottom: none; cursor: pointer; }
.hf-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hf-cat { position: relative; }
.hf-cat input { position: absolute; opacity: 0; pointer-events: none; }
.hf-cat span { height: 80px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 500; cursor: pointer; color: color-mix(in srgb, var(--c) 80%, var(--text)); background: color-mix(in srgb, var(--c) 14%, var(--card)); transition: transform .15s, box-shadow .15s; }
.hf-cat span i { font-size: 24px; }
.hf-cat input:checked + span { box-shadow: inset 0 0 0 2px var(--c); transform: scale(.97); font-weight: 600; }
.hf-cat input:focus-visible + span { outline: 2px solid var(--acc); }
.hf .freq > .segmented, .group-settings .freq > .segmented { margin-top: 0; }
.choice-input { position: absolute; opacity: 0; pointer-events: none; }
label.choice-row { cursor: pointer; }
.choice-rows > label:last-child { border-bottom: none; }
.choice-input:checked + .dot { border: 7px solid var(--accB); }
.choice-input:focus-visible + .dot { outline: 2px solid var(--acc); }


/* Onboarding */
.splash { flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); padding: 0 0 40px; animation: gl-fade .6s ease both; }
.glow { position: relative; display: flex; align-items: center; justify-content: center; }
.splash .glow { width: 200px; height: 200px; }
.glow::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 32%, transparent) 0%, rgba(232, 145, 58, 0) 68%); }
.glow svg { position: relative; }
.splash .glow svg { width: 120px; height: 120px; }
.splash strong { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; animation: gl-fade .6s ease 1.3s both; }
/* Splash: the horizon draws itself out from the middle, then the sun comes up behind it. */
.splash svg :is(path, rect) { transform-box: fill-box; }
.splash svg path { animation: onb-sunrise 1.1s cubic-bezier(.2, .8, .2, 1) .5s both; }
.splash svg rect { transform-origin: center; animation: onb-draw .6s cubic-bezier(.3, .7, .2, 1) both; }
.splash svg rect + rect { animation-delay: .15s; }
.splash .glow::before { animation: onb-glow 1.4s ease 1s both; }
/* Leaving the splash, its logo glides into the first slide's (onboarding_controller.js). */
.splash .glow svg, .onb-logo svg { view-transition-name: onb-logo; }
::view-transition-group(onb-logo) { animation-duration: .9s; animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }
@keyframes onb-sunrise { from { transform: translateY(100%); clip-path: inset(0 0 100% 0); } }
@keyframes onb-draw { from { transform: scaleX(0); } }
@keyframes onb-glow { from { opacity: 0; transform: scale(.6); } }
.onb-top { display: flex; justify-content: flex-end; padding: 14px 18px 0; }
.onb-top button { border: none; background: transparent; font-size: 15px; color: var(--muted); padding: 10px 6px; }
.onb-body { flex: 1; display: flex; flex-direction: column; padding: 0 28px; min-height: 0; }
.onb-step { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 34px; animation: onb-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.flow[data-back] .onb-step { animation-name: onb-back; }
/* The first slide stays put for the logo coming from the splash; only its words come in. */
.onb-step:first-child { animation: none; }
.onb-step:first-child h2 { animation: gl-in .5s ease .45s both; }
@keyframes onb-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes onb-back { from { opacity: 0; transform: translateX(-40px); } }
.onb-step h2 { font-size: 28px; color: var(--muted); text-align: left; }
.onb-logo { width: 132px; height: 132px; }
.onb-logo::before { inset: -20px; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 24%, transparent) 0%, rgba(232, 145, 58, 0) 66%); }
.onb-logo svg { width: 104px; height: 104px; }
.onb-logo::before { animation: onb-breathe 5s ease-in-out .9s infinite; }
@keyframes onb-breathe { 50% { transform: scale(1.08); opacity: .6; } }
.onb-stack { position: relative; height: 266px; }
.onb-stack .mini { position: absolute; height: 60px; border-radius: 20px; background: color-mix(in srgb, var(--c) 20%, var(--mix)); display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; font-size: 15.5px; animation: onb-rise .5s cubic-bezier(.2, .8, .2, 1) calc(.1s + var(--i) * .12s) both; }
.onb-stack .mini .ic { width: 26px; height: 26px; border-radius: 8px; background: var(--c); display: flex; align-items: center; justify-content: center; }
.onb-stack .mini .ic i { font-size: 15px; color: #fff; }
.onb-stack .front { position: absolute; top: 78px; left: 0; right: 0; border-radius: 24px; background: color-mix(in srgb, #ff8a5c 20%, var(--mix)); padding: 16px 16px 18px; box-shadow: 0 -6px 20px rgba(0, 0, 0, .12); }
.onb-stack .front-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.onb-stack .front-head .ic { width: 40px; height: 40px; border-radius: 12px; background: #ff8a5c; display: flex; align-items: center; justify-content: center; }
.onb-stack .front-head .ic i { font-size: 22px; color: #fff; }
.onb-stack .front-head b { display: block; font-size: 17px; font-weight: 500; }
.onb-stack .front-head span { font-size: 13px; color: var(--muted); }
.onb-days { display: flex; justify-content: space-between; }
.onb-days > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.onb-days span { font-size: 11.5px; color: var(--muted); }
.onb-days :is(b, button) { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 400; border: 1.5px solid var(--ringc); color: var(--muted); }
.onb-days .full { background: #ff8a5c; color: #fff; border-color: #ff8a5c; }
/* The week fills in day by day; today waits for a tap. */
.onb-days b.full { animation: onb-fill .35s ease calc(.5s + var(--i) * .14s) both; }
.onb-days .now { padding: 0; font-family: inherit; border-color: #ff8a5c; background: transparent; color: var(--text); animation: onb-pulse 1.6s ease-out 1.4s infinite; }
.onb-days .now.full { background: #ff8a5c; color: #fff; animation: onb-pop .3s ease; }
.onb-days .now i { font-size: 17px; }
.onb-streak { margin-top: 14px; font-size: 13px; color: var(--muted); opacity: 0; transform: translateY(4px); transition: opacity .4s, transform .4s; }
.front.ticked .onb-streak { opacity: 1; transform: none; }
@keyframes onb-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes onb-fill { from { background: transparent; border-color: var(--ringc); color: var(--muted); } 60% { transform: scale(1.1); } }
@keyframes onb-pop { 50% { transform: scale(1.12); } }
@keyframes onb-pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, #ff8a5c 50%, transparent); } to { box-shadow: 0 0 0 10px transparent; } }
.onb-grids { display: flex; flex-direction: column; gap: 10px; }
.onb-grid { border-radius: 18px; padding: 12px 14px 14px; background: var(--card); box-shadow: var(--cardShadow); }
.onb-grid-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 14px; }
.onb-grid-head .ic { width: 22px; height: 22px; border-radius: 7px; background: var(--c); display: flex; align-items: center; justify-content: center; }
.onb-grid-head .ic i { font-size: 12px; color: #fff; }
.onb-cells { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.onb-cells i { aspect-ratio: 1; border-radius: var(--radius-cell); background: color-mix(in srgb, var(--c) 14%, var(--mix)); }
.onb-cells i.on { background: var(--c); animation: onb-cell .3s ease calc(.2s + var(--d)) both; }
/* The grids fill column by column, like weeks going by. */
@keyframes onb-cell { from { background: color-mix(in srgb, var(--c) 14%, var(--mix)); } }
@media (prefers-reduced-motion: reduce) {
  .flow:has(.onb-body) :is(*, *::before), ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.onb-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 28px 40px; }
.onb-next { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--text); color: var(--fabFg); display: flex; align-items: center; justify-content: center; }
.onb-next i { font-size: 20px; }
.onb-begin { width: auto; padding: 0 26px; }
.onb-begin i { font-size: 17px; }

/* ---------- Auth ---------- */
.auth-page { min-height: 100dvh; animation: gl-fade .3s ease both; }
.auth-panel { padding: calc(64px + env(safe-area-inset-top)) 28px 40px; }
.auth { display: block; width: 100%; max-width: 380px; margin: 0 auto; }
.auth > * { animation: gl-fade .2s ease both; }
.auth-logo svg { width: 56px; height: 56px; display: block; margin-bottom: 26px; }
.auth-title { font-size: 30px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.auth-sub { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.auth-tabs { margin-top: 26px; }
.auth-tabs a { flex: 1; height: 40px; border-radius: var(--radius-seg); display: flex; align-items: center; justify-content: center; font-size: 14.5px; font-weight: 500; color: var(--muted); }
.auth-tabs a.on { background: var(--segOn); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth .field { display: flex; flex-direction: column; gap: 6px; }
.auth .field > span { font-size: 13px; color: var(--muted); }
.auth .field input { height: 52px; width: 100%; padding: 0 16px; border-radius: 16px; border: none; outline: none; background: var(--seg); color: var(--text); font-size: 16px; -webkit-user-select: text; user-select: text; }
.auth .field input:focus { box-shadow: inset 0 0 0 1.5px var(--acc); }
.reveal { position: relative; }
.reveal input { padding-right: 52px !important; }
.reveal button { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.reveal button i { font-size: 19px; }
.auth-forgot { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-forgot a { color: var(--accent); font-size: 14px; padding: 6px 0; }
.auth-error { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: #ff4f7b; }
.auth-error i { font-size: 16px; }
.auth-form .primary { margin-top: 8px; height: 54px; border-radius: 27px; font-size: 16.5px; cursor: pointer; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 6px 0; color: var(--muted); font-size: 14.5px; }
.auth-back i { font-size: 13px; }
.auth-terms { font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.45; text-align: center; }
.auth-sent { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--acc) 18%, transparent); margin-top: 26px; }
.auth-sent i { font-size: 30px; color: var(--acc); }

.onb-step-days h2 { font-weight: 500; }

/* ---------- Habits list (Gewoontes beheren) ---------- */
.gloed-shell.no-nav { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-head .icon-btn { flex: none; background: var(--seg); color: var(--text); }
.page-head .icon-btn i { font-size: 18px; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.page-head .spacer { width: 44px; }
.manage-list { margin: 0 -9px; }
.manage-row { display: flex; align-items: center; gap: 4px; padding: 0 9px 0 0; border-bottom: 1px solid var(--hair); background: transparent; transition: background .15s, box-shadow .15s; touch-action: pan-y; }
.manage-row.dragging { position: relative; z-index: 2; background: var(--mix); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.grip { width: 40px; height: 48px; flex: none; border: none; background: transparent; color: var(--muted); opacity: .7; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; transition: opacity .15s, color .15s; }
.grip i { font-size: 20px; }
.grip:hover, .dragging .grip { opacity: 1; color: var(--text); }
.dragging .grip { cursor: grabbing; }
.wide-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; margin-top: 20px; border-radius: 23px; background: var(--seg); color: var(--text); font-size: 16px; font-weight: 500; }
.wide-btn i { font-size: 17px; }

/* ---------- Edit sheet ---------- */
body { --sheet: oklch(0.985 calc(0.01 * var(--k)) var(--h)); }
body.sheet-lock { overflow: hidden; }
.habit-btn { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.sheet-layer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: gl-fade .2s ease both; }
.sheet {
  position: relative; width: 100%; max-width: 412px; max-height: 92dvh; overflow-y: auto;
  background: var(--sheet); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom));
  animation: gl-sheet .28s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes gl-sheet { from { transform: translateY(100%); } to { transform: none; } }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--track); margin: 0 auto 16px; }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sheet-head h2 { flex: 1; font-size: 20px; font-weight: 600; text-align: left; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { font-size: 19px; }
.sheet-streak { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.sheet-streak i { font-size: 14px; color: var(--track); }
.sheet-streak.on i { color: var(--acc); }
.sheet-head .icon-btn { color: var(--muted); margin-right: -10px; }
.sheet-head .icon-btn i { font-size: 20px; }
.sheet-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--c); display: flex; align-items: center; justify-content: center; transition: background .2s; }
.sheet-icon i { font-size: 18px; color: #fff; }
.sheet .name-input { margin-top: 0; font-size: 17px; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.sheet-row .label, .sheet-label { font-size: 16px; }
.sheet-label { margin: 22px 0 10px; }
.segmented.choice label { flex: 1; }
.segmented.choice input { position: absolute; opacity: 0; pointer-events: none; }
.segmented.choice span { display: flex; align-items: center; justify-content: center; height: 36px; border-radius: var(--radius-seg); font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.segmented.choice input:checked + span { background: var(--segOn); color: var(--text); }
.segmented.choice input:focus-visible + span { outline: 2px solid var(--acc); }

/* Frequency (habits/_frequency): the chosen radio shows its own parts. */
.freq > .segmented { margin-top: 22px; }
.freq .segmented.choice span { font-size: 13.5px; }
.day-chips { display: none; justify-content: space-between; gap: 6px; margin-top: 14px; }
.freq:has(input[value="days"]:checked) .day-chips { display: flex; }
.day-chips label { position: relative; }
.day-chips input { position: absolute; opacity: 0; pointer-events: none; }
.day-chips span { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; background: var(--seg); color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.day-chips input:checked + span { background: var(--text); color: var(--fabFg); }
.nf-card .day-chips span { width: 38px; height: 38px; }
.day-chips input:focus-visible + span { outline: 2px solid var(--acc); }
.freq-target { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.freq-target .label { font-size: 16px; }
.freq-target .label small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.freq-target.weekly-target, .freq:has(input[value="week"]:checked) .daily-target { display: none; }
.freq:has(input[value="week"]:checked) .weekly-target { display: flex; }
.manual-row { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.manual-row .label { flex: 1; min-width: 0; font-size: 16px; }
.manual-row .label small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.unit-input { display: none; margin-top: 12px; width: 100%; padding: 13px 16px; border-radius: 14px; border: none; outline: none; background: var(--seg); color: var(--text); font-size: 15px; animation: gl-in .2s ease both; }
.freq:has(.manual-row .switch-input:checked) .unit-input { display: block; }
.freq:has(input[value="week"]:checked) :is(.manual-row, .unit-input) { display: none; }
.swatches { display: flex; justify-content: space-between; padding: 4px; }
.swatches label { width: 30px; height: 30px; border-radius: 50%; background: var(--s); cursor: pointer; transition: box-shadow .15s; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px var(--s); }
.swatches label:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 6px; }
.sheet .primary { margin-top: 24px; cursor: pointer; }
.danger-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 10px; border: none; background: transparent; color: var(--danger); font-size: 16px; font-weight: 500; }
.danger-link i { font-size: 18px; }
.danger-link.neutral { color: var(--text); }
.switch-input { position: absolute; opacity: 0; pointer-events: none; }
label.switch { cursor: pointer; }
.switch-input:checked + .switch { background: var(--acc); }
.switch-input:checked + .switch::after { left: 21px; }
.switch-input:focus-visible + .switch { outline: 2px solid var(--text); outline-offset: 2px; }
.reminder-row { gap: 12px; margin-top: 22px; }
.reminder-row .label { flex: 1; }
.time-chip { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: none; border-radius: 18px; background: color-mix(in srgb, var(--acc) 16%, transparent); color: var(--text); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.time-chip i { font-size: 12px; color: var(--muted); transition: transform .2s; }
/* Extra reminder times (Premium), under the habit's own reminder while it is on */
form:has(#reminder-on:not(:checked)) .extra-reminders { display: none; }
.extra-reminder .reminder-row { margin-top: 10px; }
.extra-reminder:has(.reminder-wheel:not([hidden])) .time-chip i { transform: rotate(180deg); }
.extra-reminder .remove-time { width: 36px; height: 36px; color: var(--muted); }
.add-time { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 0; border: none; background: transparent; color: var(--accent); font-size: 15px; font-weight: 500; cursor: pointer; }
.add-time .lock { margin-left: 2px; }
.reminder-wheel { display: flex; justify-content: center; padding: 2px 0 10px; animation: gl-in .2s ease both; }
.reminder-wheel[hidden] { display: none; }

/* ---------- Widgets carousel ---------- */
.carousel { margin: 22px -20px 0; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; min-width: 0; box-sizing: border-box; padding: 0 20px; scroll-snap-align: center; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center; text-align: center; }
.slide h2 { font-size: 22px; font-weight: 500; margin: 8px 0 22px; }
.slide-preview { width: 100%; min-width: 0; min-height: 210px; display: flex; align-items: center; text-align: left; }
.slide-preview > * { width: 100%; }
.add-btn { margin-top: 22px; height: 44px; padding: 0 22px; border: none; border-radius: 22px; background: var(--text); color: var(--fabFg); font-size: 15px; font-weight: 500; }
.widgets-hint { margin: 18px 28px 0; text-align: center; font-size: 13px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.carousel-dots { justify-content: center; margin-top: 26px; }
.carousel-dots { gap: 0; }
.carousel-dots button { display: flex; align-items: center; justify-content: center; height: 24px; padding: 0 3px; border: none; background: transparent; }
.carousel-dots button::after { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--track); transition: all .25s; }
.carousel-dots button.on::after { width: 22px; background: var(--text); }

/* ---------- Confirm dialog ---------- */
.confirm-dialog { width: min(320px, calc(100% - 48px)); margin: auto; padding: 22px 20px 16px; border: none; border-radius: 24px; background: var(--sheet); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, .4); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.confirm-dialog[open] { animation: gl-in .2s ease both; }
.confirm-dialog p { font-size: 17px; font-weight: 500; text-align: center; line-height: 1.4; }
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-actions button { flex: 1; height: 46px; border: none; border-radius: 23px; font-size: 15px; font-weight: 500; }
.confirm-cancel { background: var(--seg); color: var(--text); }
.confirm-ok { background: var(--danger); color: #fff; }
.confirm-dialog.neutral .confirm-ok { background: var(--text); color: var(--fabFg); }

/* ---------- Motion ---------- */
@keyframes gl-sheet-out { to { transform: translateY(100%); } }
@keyframes gl-fade-out { to { opacity: 0; } }

/* Press feedback on everything tappable. */
.habit-btn, .quick-btn, .round-btn, .primary, .pill-btn, .add-btn, .wide-btn, .cat, .theme-opt,
  transition: transform .14s cubic-bezier(.3, .7, .4, 1), background-color .2s, box-shadow .2s, opacity .2s, color .15s;
}
.habit-btn:active, .quick-btn:active, .round-btn:active, .primary:active, .pill-btn:active,
.add-btn:active, .wide-btn:active, .cat:active, .theme-opt:active, .chips button:active, .icon-btn:active, .strip a:active { transform: scale(.96); }
.habit-btn:active { transform: scale(.985); }

/* Progress changes glide (morphed streams keep the elements). */
.card-row .habit-name { transition: color .25s; }
.quick-btn { transition: background-color .25s, transform .14s cubic-bezier(.3, .7, .4, 1); }
.status-row .cells i, .strip .dot { transition: background-color .3s; }
.per-habit .track i { transition: width .45s cubic-bezier(.3, .7, .4, 1); }
.bars i { transition: height .45s cubic-bezier(.3, .7, .4, 1), background-color .2s; }

/* Nav: the active tab lifts a little. */
.nav-item > :is(i, .nav-ring, .nav-glyph) { transition: transform .2s cubic-bezier(.3, .7, .4, 1.4); }
.nav-item.on > :is(i, .nav-ring, .nav-glyph) { transform: translateY(-1px) scale(1.06); }

/* The Overview day detail folds open and shut (grid rows 0fr ↔ 1fr animate its height). */
.day-detail { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .4s cubic-bezier(.3, .7, .3, 1), opacity .3s ease; }
.day-detail > div { min-height: 0; overflow: hidden; }
.day-detail.open { grid-template-rows: 1fr; opacity: 1; }

/* Sheet and toast leave as smoothly as they arrive. */
.sheet-layer.closing .sheet { animation: gl-sheet-out .2s ease-in both; }
.sheet-layer.closing .sheet-backdrop { animation: gl-fade-out .2s ease both; }
.flash.leaving { animation: gl-fade-out .25s ease both; }

/* Pull to refresh: the logo mark comes down with the finger, turns with the pull, and
   spins (the ring) or breathes (the other logos) while the page loads. */
.ptr { position: fixed; z-index: 55; top: env(safe-area-inset-top); left: 0; right: 0; height: 0; display: flex; justify-content: center; pointer-events: none; }
.ptr-mark { --pull: 0; --y: 0px; width: 44px; height: 44px; margin-top: -48px; padding: 6px; border-radius: 50%; background: var(--card); box-shadow: var(--cardShadow);
  opacity: 0; transform: translateY(var(--y)) rotate(calc(var(--pull) * 300deg)) scale(calc(.6 + var(--pull) * .4)); transition: transform .25s ease, opacity .2s; }
.ptr-mark svg { display: block; width: 100%; height: 100%; }
.ptr-mark.pulling { opacity: min(1, calc(var(--pull) * 1.6)); transition: none; }
.ptr-mark.loading { opacity: 1; transform: translateY(var(--y)); transition: transform .25s ease; }
.ptr-mark.loading svg { animation: ptr-breathe 1s ease-in-out infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@keyframes ptr-breathe { 50% { transform: scale(.8); opacity: .6; } }

/* Dragging a habit lifts it. */
.manage-row.dragging { transform-origin: center; scale: 1.02; transition: scale .15s, box-shadow .15s; }

/* Android app: no rubber-band stretch that drags the fixed nav along with the page. */
/* In the Android app a screen change is native; a page fading in on top of it reads as a flash. */
body[data-native] .gloed-shell, body[data-native] .flow, body[data-native] .auth-page { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Account (Settings, Over, delete) ---------- */
.settings-card + .settings-card { margin-top: 14px; }
.space-card .set-row .label b { font-weight: 600; }
.space-habit { gap: 8px; }
.space-habit .mg-icon { width: 28px; height: 28px; border-radius: 9px; }
.space-habit .mg-icon i { font-size: 14px; }
.space-card.off .space-habit { opacity: .45; }
.space-habit .switch[disabled] { cursor: default; }
.danger-row, .danger-row > i:first-child { color: var(--danger); }
.row-form { display: block; }
.row-form:not(:last-child) .set-row { border-bottom: 1px solid var(--hair); }
.set-row .value { font-size: 15px; color: var(--muted); white-space: nowrap; }
.about-brand { display: flex; align-items: center; gap: 14px; }
.about-logo { width: 52px; height: 52px; border-radius: 14px; }
.about-brand strong { display: block; font-size: 18px; font-weight: 600; }
.about-brand span { font-size: 14px; color: var(--muted); }
.about-intro { font-size: 15px; color: var(--muted); margin: 14px 0 6px; line-height: 1.45; }
.about-list { margin: 8px 0 22px; }
.about-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.about-list dt { color: var(--muted); }
.about-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.sheet-text { font-size: 15px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.sheet-text a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.primary.danger { background: var(--danger); color: #fff; margin-top: 22px; cursor: pointer; }

/* ---------- Overzicht blocks ---------- */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.title-row .page-title { margin-top: 0; }
.title-actions { display: flex; align-items: center; gap: 8px; }
.title-actions .icon-btn { margin-right: 0; }
.title-row .icon-btn { margin-right: -10px; color: var(--text); }
.title-row .icon-btn i { font-size: 22px; }
.title-row .add-habit { margin-right: 0; }
.icon-btn.add-habit { width: 44px; height: 44px; background: var(--seg); box-shadow: none; }
.icon-btn.add-habit i.ph-bold { font-size: 18px; }
.pill-btn.with-icon { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; font-size: 13.5px; flex: none; }
.pill-btn.with-icon i { font-size: 15px; }
.pill-btn.dark { background: var(--text); color: var(--fabFg); height: 46px; padding: 0 26px; border-radius: 23px; font-size: 15px; }
.ov-blocks { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.ov-tabs { display: flex; gap: 3px; background: var(--seg); border-radius: var(--radius-control); padding: 3px; margin-top: 16px; }
.ov-tabs a { flex: 1; height: 38px; border-radius: var(--radius-seg); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; color: var(--muted); }
.ov-tabs a.on { background: var(--segOn); color: var(--text); font-weight: 600; }
.ov-tabs a i { font-size: 12px; margin-left: 5px; color: var(--muted); }
.ov-tabs + .ov-blocks, .insights { margin-top: 12px; }
.insights { display: flex; flex-direction: column; gap: 12px; }
.review-pct { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.review-pct b { font-size: 38px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.review-pct span { font-size: 14px; color: var(--muted); }
.review-pct span.up { color: var(--accent); }
.review-lines { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding: 0; }
.review-lines li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.review-lines i { font-size: 18px; color: var(--acc); flex: none; }
.insights .ov-card > p { font-size: 13px; margin-top: 12px; }
.insights a.ov-card { display: block; color: var(--text); }
.ov-card.locked .ins-body { filter: blur(5px); opacity: .55; }
.lock-tag { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; color: var(--muted); font-weight: 500; }
.lock-tag i { font-size: 13px; }
.ins-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent); font-weight: 600; }
.ins-label i { font-size: 15px; }
.ins-label .lock-tag { margin: 0 0 0 auto; }
.corr-text { font-size: 18px; line-height: 1.35; margin-top: 8px; text-wrap: pretty; }
.corr-text b { font-weight: 600; }
.corr-text .lift { color: var(--accent); }
.corr-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.corr-bars > div { display: flex; align-items: center; gap: 10px; }
.corr-bars span:first-child { width: 70px; }
.corr-bars span:last-child { width: 36px; text-align: right; }
.corr-bars i { flex: 1; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.corr-bars b { display: block; height: 100%; border-radius: 4px; background: var(--acc); }
.corr-bars b.without { background: var(--ringc); }
.ins-body.trend { display: flex; align-items: flex-end; gap: 8px; height: 100px; margin-top: 16px; }
.trend > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.trend span { font-size: 11px; color: var(--muted); }
.trend i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--acc) 40%, transparent); }
.trend i.last { background: linear-gradient(180deg, var(--accA), var(--accB)); }
.trend small { font-size: 11.5px; color: var(--muted); }
.trend small.last { color: var(--text); font-weight: 600; }
.ov-card { background: var(--card); box-shadow: var(--cardShadow); border-radius: var(--radius-panel); padding: 18px 20px 20px; min-width: 0; animation: gl-in .25s ease both; }
.ov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ov-head h2 { font-size: 16px; font-weight: 600; }
.bars > button:disabled i { background: var(--track); }
.ov-head > span, .ov-head > a { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ov-card .bars { height: 130px; margin: 18px 0 0; }
.ov-card .day-detail .per-habit:last-child { border-bottom: none; }
.ov-sub { font-size: 14px; font-weight: 600; margin-top: 18px; }
.ov-note { font-size: 14px; margin-top: 14px; }
/* A week box's own ‹ › (a sideways swipe on the box does the same). */
.ov-head .box-nav { display: flex; gap: 2px; margin: -8px -10px -8px auto; align-self: center; }
.box-nav .icon-btn { color: var(--text); }
.box-nav .icon-btn.off { opacity: .3; pointer-events: none; }
/* Per gewoonte: icon, name and count, then a cell per day. */
.hw-list { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.hw-row { display: flex; flex-direction: column; gap: 7px; color: var(--text); }
.hw-top { display: flex; align-items: center; gap: 8px; }
.hw-top i { font-size: 16px; color: var(--c); flex: none; }
.hw-top span { flex: 1; min-width: 0; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-top small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hw-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.hw-cells i { height: 14px; border-radius: 4px; background: var(--track); }
.hw-cells i.f { background: var(--c); }
.hw-cells i.p { background: color-mix(in srgb, var(--c) 45%, var(--mix)); }
.hw-cells i.x { background: transparent; box-shadow: inset 0 0 0 1.5px var(--track); }
/* Lopende reeksen */
.run-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--text); }
.run-row i { font-size: 20px; color: var(--c); flex: none; }
.run-row span { flex: 1; min-width: 0; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-row b { font-size: 15px; font-weight: 600; color: var(--accA); }
.run-row + .ov-note, .ov-head + .ov-note { font-size: 13.5px; color: var(--muted); }
.bars.static > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars.static small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars.static i { background: color-mix(in srgb, var(--acc) 45%, transparent); }


.year-grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin-top: 6px; }
.year-grid i { aspect-ratio: 1; border-radius: var(--radius-cell); background: color-mix(in srgb, var(--c) 12%, var(--mix)); }
.year-grid i.p { background: color-mix(in srgb, var(--c) 45%, var(--mix)); }
.year-grid i.f { background: var(--c); }
.year-grid i.x { background: transparent; }


/* ---------- Habit page: today, the month, three tiles ---------- */
#habit-page { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
#habit-page .shared-link { margin-top: -4px; }
#habit-month { display: block; }
.today-card { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px; border: none; border-radius: 26px; background: var(--card); box-shadow: var(--cardShadow); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .3s; }
.today-card.done { background: color-mix(in srgb, var(--c) 20%, var(--card)); }
.detail-icon { width: 50px; height: 50px; border-radius: 15px; background: var(--c); display: flex; align-items: center; justify-content: center; flex: none; }
.detail-icon i { font-size: 25px; color: #fff; }
.tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tc-main b { font-size: 23px; font-weight: 600; letter-spacing: -0.01em; }
.tc-main span { font-size: 14.5px; color: var(--muted); }
.today-card.done .tc-main span { color: var(--accent); }
.tc-ring { width: 46px; height: 46px; flex: none; box-sizing: border-box; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 30%, transparent); display: flex; align-items: center; justify-content: center; transition: background .25s, border-color .25s; }
.tc-ring i { font-size: 22px; color: var(--mix); opacity: 0; }
.today-card.done .tc-ring { background: var(--c); border-color: var(--c); }
.today-card.done .tc-ring i { opacity: 1; }
.cal-card { border-radius: 24px; background: var(--card); box-shadow: var(--cardShadow); padding: 8px 14px 12px; }
.cal-head { display: flex; align-items: center; }
.cal-head h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.cal-head .icon-btn { color: var(--text); }
.cal-head .gone { visibility: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; align-items: center; row-gap: 6px; margin-top: 4px; }
.cal-grid form { display: contents; }
.cal-wd { font-size: 12px; color: var(--muted); }
.cal-day { position: relative; width: 36px; height: 36px; padding: 0; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: inherit; font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; background: var(--track); color: var(--text); transition: background .2s; }
button.cal-day, a.cal-day { cursor: pointer; }
button.cal-day::after, a.cal-day::after { content: ""; position: absolute; inset: -4px; }
.cal-day.part { background: color-mix(in srgb, var(--c) 45%, transparent); }
.cal-day.done { background: var(--c); color: #fff; }
.cal-day.rest, .cal-day.future { background: transparent; color: var(--muted); }
.cal-day.future { opacity: .45; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.today.done { box-shadow: 0 0 0 2px var(--accent); }
.detail-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.detail-tiles > div { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; border-radius: 20px; background: var(--card); box-shadow: var(--cardShadow); }
.detail-tiles > div > span:first-child { font-size: 12.5px; color: var(--muted); }
.detail-tiles small { font-size: 12px; color: var(--muted); }
.detail-tiles b { font-size: 26px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.detail-tiles b.hot { color: var(--accent); }
.tile-bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.tile-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); }
.tile-blocks { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; }
.tile-blocks i { height: 6px; border-radius: 2px; background: var(--track); }
.tile-blocks i.on { background: var(--c); }
.tile-bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.tile-bars i { flex: 1; border-radius: 2px; background: color-mix(in srgb, var(--c) 40%, transparent); }
.tile-bars i.on { background: var(--c); }

/* ---------- Full-screen sheet (Overzicht aanpassen) ---------- */
.page-layer .sheet-backdrop { display: none; }
.page-sheet { position: fixed; inset: 0; max-width: none; max-height: none; border-radius: 0; background: var(--grad); background-color: var(--pageEnd); padding: calc(12px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); overflow-y: auto; animation: gl-fade .2s ease both; }
.page-sheet > * { max-width: 412px; margin-left: auto; margin-right: auto; }
.page-sheet .page-head h2 { font-size: 18px; font-weight: 600; white-space: nowrap; }
.page-sheet .page-head .close { visibility: hidden; }
.page-layer.closing .page-sheet { animation: gl-fade-out .2s ease both; }
.sheet-foot { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }
.text-btn { height: 46px; padding: 0 18px; border-radius: 23px; border: none; background: transparent; color: var(--muted); font-size: 14.5px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.text-btn i { font-size: 16px; }

/* Parts that only exist in one layout. */
.side-brand, .side-only { display: none; }
/* Profiel */
.profile-card { display: block; margin-top: 12px; padding: 18px 20px 20px; border-radius: var(--radius-panel); background: var(--card); box-shadow: var(--cardShadow); color: var(--text); }
.card-kicker { font-size: 16px; font-weight: 600; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head .muted { font-size: 13px; white-space: nowrap; }

/* Habittrack Premium (premium/show) */
.paywall { max-width: 440px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); animation: gl-fade .2s ease both; }
.paywall-top { display: flex; padding: 12px 8px 0; }
.paywall-top .icon-btn { color: var(--text); }
.paywall-top .icon-btn i { font-size: 20px; }
.paywall-body { flex: 1; padding: 0 20px 8px; }
/* The account's own logo, glowing: Premium is more of this app, not a separate product. */
.paywall-glow { width: 112px; height: 112px; margin: 0 auto; }
.paywall-glow svg { width: 72px; height: 72px; }
.paywall h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; text-align: center; margin-top: 4px; }
.paywall-lede { font-size: 15px; color: var(--muted); text-align: center; margin-top: 6px; text-wrap: balance; }
.perks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; margin: 26px 0 0; }
.perks li { display: flex; align-items: center; gap: 14px; }
.perk-icon { width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--acc) 18%, transparent); }
.perk-icon i { font-size: 20px; color: var(--accent); }
.perk-text { flex: 1; min-width: 0; }
.perk-text b { display: block; font-size: 15px; font-weight: 600; }
.perk-text small { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; line-height: 1.35; }
.perk-check { font-size: 17px; color: var(--acc); flex: none; }
.plans { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.plan { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: var(--radius-card); border: none; color: var(--text); text-align: left; background: var(--card); box-shadow: var(--cardShadow); }
.plan.on { box-shadow: inset 0 0 0 2px var(--accB); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--track); display: flex; align-items: center; justify-content: center; }
.plan.on .radio { box-shadow: inset 0 0 0 2px var(--accB); }
.plan.on .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accB); }
.plan-text { flex: 1; min-width: 0; }
.plan-text b { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.plan-text em { font-style: normal; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: color-mix(in srgb, var(--acc) 20%, transparent); color: var(--accent); }
.plan-text small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.plan .price { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The button stays in reach while the perks and plans scroll under it. */
.paywall-foot { position: sticky; bottom: 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; background: linear-gradient(to bottom, transparent, var(--pageEnd) 22px); }
.paywall-foot .primary { height: 54px; border-radius: 27px; font-size: 16px; font-weight: 600; background: var(--accB); }
.paywall-foot .primary:disabled { opacity: .5; }
.paywall-foot p { text-align: center; font-size: 13px; color: var(--muted); text-wrap: balance; }
@media (min-width: 1024px) {
  /* Desktop: one calm column in the middle of the window, the close button in the corner. */
  .paywall { justify-content: center; padding-block: 48px; }
  .paywall-top { position: fixed; top: 24px; right: 24px; padding: 0; }
  .paywall-body { flex: none; }
  .paywall-foot { position: static; background: none; padding-top: 24px; }
}

/* Buying: after Play took the purchase. One glowing orb that spins while Rails checks,
   fills and bursts on success, and dims when it could not be confirmed. */
.buying { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; padding: calc(24px + env(safe-area-inset-top)) 28px calc(28px + env(safe-area-inset-bottom)); background: var(--grad); background-color: var(--pageEnd); text-align: center; animation: gl-fade .25s ease both; }
.buying[hidden] { display: none; }
.buying > * { max-width: 340px; }
.buying [data-for] { display: none; }
.buying[data-state="processing"] [data-for="processing"], .buying[data-state="done"] [data-for="done"], .buying[data-state="failed"] [data-for="failed"] { display: block; }
.buying[data-state="done"] .buying-foot[data-for="done"], .buying[data-state="failed"] .buying-foot[data-for="failed"] { display: flex; }
.buying[data-state="done"] .buying-steps { display: none; }
.buying-panel, .buying-foot { width: 100%; }
.buying h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; outline: none; text-wrap: balance; }
.buying-panel p { font-size: 15.5px; line-height: 1.5; color: var(--muted); margin-top: 8px; text-wrap: pretty; }

.buying-orb { position: relative; flex: none; width: 132px; height: 132px; margin-bottom: 30px; display: flex; align-items: center; justify-content: center; }
.buying-orb::before { content: ""; position: absolute; inset: -34px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 45%, transparent) 0%, transparent 65%); animation: glow-breathe 2.4s ease-in-out infinite; transition: opacity .4s; }
.buying-orb::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--accA), var(--accB)); box-shadow: 0 12px 34px color-mix(in srgb, var(--accB) 45%, transparent); transition: filter .4s, opacity .4s; }
.buying-orb svg { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.buying-orb circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.buying-orb .track { stroke: color-mix(in srgb, var(--acc) 22%, transparent); }
.buying-orb .arc { stroke: var(--accB); stroke-dasharray: 60 251.3; transform-box: fill-box; transform-origin: center; }
.buying-orb i { position: relative; z-index: 1; font-size: 44px; color: #fff; }
.buying[data-state="processing"] .arc { animation: ptr-spin 1.1s linear infinite; }
.buying[data-state="done"] .buying-orb { animation: gl-burst .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.buying[data-state="done"] .arc { stroke-dasharray: 251.3; animation: gl-draw .7s cubic-bezier(.4, 0, .2, 1) both; }
.buying[data-state="failed"] .arc { stroke: transparent; }
.buying[data-state="failed"] .buying-orb::before { animation: none; opacity: .2; }
.buying[data-state="failed"] .buying-orb::after { filter: saturate(.15); opacity: .55; }

/* The three steps; the first is done as soon as Play took the purchase. */
.buying-steps { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.buying-steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); }
.buying-steps .dot { width: 24px; height: 24px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px var(--track); }
.buying-steps .dot i { display: none; font-size: 13px; color: #fff; }
.buying-steps li:first-child, .buying-steps li:nth-child(2) { color: var(--text); }
.buying-steps li:first-child .dot { background: var(--accB); box-shadow: none; }
.buying-steps li:first-child .ph-check { display: block; }
.buying[data-state="processing"] .buying-steps li:nth-child(2) .dot { box-shadow: inset 0 0 0 2px var(--accB); }
.buying[data-state="processing"] .buying-steps li:nth-child(2) .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accB); animation: ptr-breathe 1s ease-in-out infinite; }
.buying[data-state="failed"] .buying-steps li:nth-child(2) .dot { background: var(--danger); box-shadow: none; }
.buying[data-state="failed"] .buying-steps li:nth-child(2) .ph-exclamation-mark { display: block; }

/* Welcome: what is on now, one after another. */
.buying[data-state="done"] h2 { font-size: 32px; animation: gl-in .4s .3s ease both; }
.buying[data-state="done"] .buying-panel p { animation: gl-in .4s .38s ease both; }
.buying-perks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.buying-perks li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px; background: var(--card); box-shadow: var(--cardShadow); font-size: 15px; animation: gl-in .35s calc(.5s + var(--i) * .08s) ease both; }
.buying-perks li > i:first-child { font-size: 19px; color: var(--accent); }
.buying-perks span { flex: 1; min-width: 0; }
.buying-perks li > i:last-child { font-size: 15px; color: var(--acc); }

.buying-foot { flex-direction: column; gap: 4px; margin-top: 30px; }
.buying-foot .primary { height: 54px; border-radius: 27px; font-size: 16px; font-weight: 600; background: var(--accB); }
.buying-foot .text-btn { justify-content: center; }
.buying-foot small { font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 8px; text-wrap: pretty; }
.buying[data-state="done"] .buying-foot { animation: gl-in .4s .9s ease both; }
@media (prefers-reduced-motion: reduce) {
  .buying, .buying *, .buying *::before, .buying *::after { animation: none !important; }
  .buying .confetti { display: none; }
}
.profile-title { font-size: 14px; color: var(--muted); margin: 24px 4px 8px; }
.profile .settings-card, .reminders-page .settings-card { margin-top: 0; }
.reminders-page .page-head + .settings-card { margin-top: 22px; }
.page-note { font-size: 13px; color: var(--muted); margin: 10px 4px 0; }
/* Profiel: photo (tap to change), name, plan; then the account rows and the settings groups. */
.profile > .back { margin: 0 0 -10px; background: var(--seg); color: var(--text); }
.profile > .back i { font-size: 18px; }
.profile-top { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.profile-who { min-width: 0; }
.avatar-form { display: contents; }
.profile-avatar { position: relative; flex: none; width: 68px; height: 68px; border-radius: 50%; cursor: pointer; background: linear-gradient(135deg, var(--accA), var(--accB)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: 600; }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-avatar .cam { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 50%; background: var(--card); color: var(--text); box-shadow: var(--cardShadow); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.profile-avatar:has(.pick-input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 3px; }
.profile-top h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-top .muted { font-size: 14px; margin-top: 2px; }
.set-row .value { overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.account-form { display: flex; flex-direction: column; gap: 10px; }
.account-form .primary { margin-top: 6px; }
/* Geavanceerd: a row with a switch that folds the rarer rows open. */
.profile .set-row .count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Milestone popup (habit_entries/_milestone) */
.milestone { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.milestone-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); animation: gl-fade .2s ease both; }
.milestone-card { position: relative; width: 100%; max-width: 360px; box-sizing: border-box; background: var(--sheet); color: var(--text); border-radius: 30px; padding: 30px 24px 22px; text-align: center; animation: gl-in .35s ease both; }
.milestone-ring { position: relative; width: 150px; height: 150px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.milestone-ring::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 32%, transparent) 0%, transparent 66%); }
.milestone-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.milestone-ring div { position: relative; }
.milestone-ring b { display: block; font-size: 52px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.milestone-ring span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.milestone-card h2 { font-size: 22px; font-weight: 500; margin-top: 18px; }
.milestone-card p { font-size: 15px; color: var(--muted); margin-top: 6px; line-height: 1.45; text-wrap: pretty; }
.milestone-card .primary { margin-top: 22px; height: 52px; border-radius: 26px; font-size: 16px; }

/* Timer sheet */
.timer-ring { position: relative; width: 200px; height: 200px; margin: 22px auto 6px; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle[data-timer-target] { transition: stroke-dashoffset .5s linear; }
.timer-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-ring b { font-size: 44px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.timer-ring span { font-size: 14px; color: var(--muted); margin-top: 8px; }
.timer-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 12px; }
.timer-controls .round-btn { width: 52px; height: 52px; font-size: 14px; font-weight: 600; }
.timer-controls .round-btn i { font-size: 18px; }
.timer-play { width: 72px; height: 72px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; background: var(--text); color: var(--fabFg); cursor: pointer; }
.timer-play i { font-size: 28px; }
.timer-manual { display: block; text-align: center; margin-top: 18px; padding: 12px; color: var(--muted); font-size: 14.5px; }

/* Samen */
.avatar { width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--c, var(--seg)); color: #fff; font-size: calc(var(--s) * .42); font-weight: 600; box-shadow: 0 0 0 2px var(--card); }
.avatar.more { background: var(--seg); color: var(--muted); }
.avatar-stack .avatar.done { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--acc); }
.avatar-stack:has(.done) .avatar:not(.done):not(.more) { opacity: .45; }
.avatar-stack { display: inline-flex; align-items: center; flex: none; }
.avatar-stack .avatar + .avatar { margin-left: calc(var(--s) * -.3); }
.circle-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.circle-card, .circle-habit { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-panel); background: var(--card); box-shadow: var(--cardShadow); color: var(--text); }
.circle-main { flex: 1; min-width: 0; }
.circle-main b { display: block; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circle-main small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.circle-stat { text-align: right; }
.circle-habit-wrap { position: relative; }
.circle-habit-wrap .join-btn { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }
.share-ideas { margin-top: 16px; }
.share-preview { margin-top: 6px; }
.share-done { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 10px 0 4px; }
.share-done h3 { font-size: 20px; font-weight: 600; margin: 4px 0 0; }
.share-done .primary, .share-done .pill-btn { width: 100%; justify-content: center; }
.share-done button.add-link { border: none; background: none; font-family: inherit; cursor: pointer; }
.circle-stat b { display: block; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.circle-stat small { font-size: 12px; color: var(--muted); }
.samen-empty { text-align: center; padding: 60px 0; color: var(--muted); }
.samen-empty .pill-btn { margin-top: 16px; display: inline-flex; }
.circle-flow .circle-body { flex: 1; display: flex; flex-direction: column; padding: 30px 28px 24px; animation: gl-in .3s ease both; }
.circle-flow .primary { margin-top: 18px; }
.invitation { align-items: center; text-align: center; }
.invitation h2 { margin-top: 20px; }
.invitation .invite-form, .invitation .primary { width: 100%; }
.pick-list { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.pick { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--card); box-shadow: var(--cardShadow); cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { box-shadow: inset 0 0 0 2px var(--acc); }
.pick:has(input:focus-visible) { outline: 2px solid var(--acc); }
.pick-icon { width: 40px; height: 40px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--c); color: #fff; font-size: 18px; }
.pick-text { flex: 1; min-width: 0; }
.pick-text b { display: block; font-size: 16px; font-weight: 600; }
.pick-text small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.pick-check { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1.5px var(--hair); color: transparent; font-size: 14px; }
.pick:has(input:checked) .pick-check { background: var(--acc); box-shadow: none; color: #fff; }
/* Samen: the "Gewoonte toevoegen" sheet. Every row is a button that saves. */
button.pick { width: 100%; border: none; color: var(--text); font: inherit; text-align: left; }
.pick-check:not(.on) { color: var(--muted); }
.pick-check.on { background: var(--acc); box-shadow: none; color: #fff; }
.add-sheet { max-height: min(70vh, 640px); overflow-y: auto; margin: 0 -4px; padding: 0 4px 8px; }
.add-sheet .pick-list { margin-top: 12px; }
.add-tabs { margin-bottom: 4px; }
.together-card { margin-top: 12px; }
.together-row { gap: 12px; margin-top: 8px; cursor: pointer; }
.together-row > i { font-size: 20px; color: var(--accent); }
.together-row .label small { display: block; font-size: 13px; color: var(--muted); }
.add-sheet:has(.add-tabs) .together-row + .add-pane { margin-top: 0; }
.add-sheet:has(.add-tabs input[value="own"]:checked) .add-new, .add-sheet:has(.add-tabs input[value="new"]:checked) .add-own { display: none; }
.add-new { padding-top: 14px; }
.add-new .invite-name { padding-bottom: 6px; }
.circle-habits { display: flex; flex-direction: column; gap: 10px; }
.circle-stats { margin-top: 4px; }
.circle-stats .bars { height: 96px; }
.circle-stats .bars .later i { background: var(--track); }
.circle-nums { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; padding-top: 14px; box-shadow: 0 -1px 0 var(--hair); }
.circle-nums > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.circle-nums > div + div { padding-left: 16px; box-shadow: -1px 0 0 var(--hair); }
.circle-nums b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.circle-nums small { font-size: 12.5px; color: var(--muted); }
.circle-page .settings-card { margin-top: 0; }
.circle-page .page-head h1 { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-pill { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 10px; white-space: nowrap; flex: none; background: var(--seg); color: var(--muted); }
.role-pill.is-admin { background: color-mix(in srgb, var(--acc) 20%, transparent); color: var(--accent); }
.circle-today { margin-top: 16px; }
.circle-today .embers-bar { height: 8px; border-radius: 4px; margin-top: 12px; }
.member-row .label { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
.member-row .label small { flex-basis: 100%; }
.crown { font-size: 14px; color: var(--accent); }
.member-menu { position: relative; }
.member-menu summary { list-style: none; color: var(--muted); }
.member-menu summary::-webkit-details-marker { display: none; }
.member-menu > div { position: absolute; right: 0; top: 44px; z-index: 5; min-width: 220px; padding: 6px; border-radius: 16px; background: var(--sheet); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.member-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: none; border-radius: 12px; background: transparent; color: var(--text); font-size: 15px; text-align: left; }
.member-menu button.is-danger { color: #ff4f7b; }
.invite-row { cursor: default; }
.invite-block { margin-top: 0; }
.invite-note { color: var(--text); }
.invite-row .icon-chip { cursor: pointer; }
.invite-name { display: flex; gap: 8px; padding: 4px 0 12px; }
.invite-name input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 14px; border: none; outline: none; background: var(--seg); color: var(--text); font: inherit; font-size: 15px; }
.invite-name input:focus { box-shadow: inset 0 0 0 1.5px var(--acc); }
.invite-card { margin-bottom: 14px; }
.invite-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 0 14px; }
.invite-actions .pill-btn.dark { height: auto; padding: 9px 18px; border-radius: 18px; font-size: 14px; }
.circle-empty { padding: 24px 0; }
.circle-empty .pill-btn { margin-top: 12px; display: inline-flex; }
.invite-row > i:first-child { color: var(--accent); font-size: 20px; }
.member-note { display: flex; gap: 8px; padding: 12px 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.circle-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 26px; }
/* The group page's header: name with members and role under it, then add and settings. */
.circle-head { justify-content: flex-start; }
.circle-page .circle-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding-left: 4px; font-size: 24px; }
.circle-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Samen: shared habit, group goal, activity */
.habit-name .avatar-stack { margin-left: 8px; vertical-align: middle; }
.page-note.center { text-align: center; }
.pick-icon.big { width: 48px; height: 48px; border-radius: 16px; font-size: 22px; }
.duo-head { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.duo-head h2 { font-size: 22px; font-weight: 600; }
.duo-head p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.duo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 12px 8px; margin-top: 18px; background: var(--card); box-shadow: var(--cardShadow); border-radius: var(--radius-panel); padding: 16px 18px; }
.duo-stats span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 4px; min-width: 0; }
.duo-stats b { display: block; font-size: 28px; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.duo-together { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: color-mix(in srgb, var(--acc) 14%, transparent); font-size: 14.5px; }
.duo-together i { font-size: 18px; color: var(--accent); }
.duo-together b { font-weight: 600; }
.duo-grid { margin-top: 12px; }
.person-grid { display: grid; grid-template-columns: 52px repeat(14, minmax(0, 1fr)); gap: 3px; align-items: center; margin-top: 14px; }
.person-grid .who { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-grid i { aspect-ratio: 1; border-radius: 4px; background: var(--track); }
.person-grid i.f { background: var(--c); }
.person-grid i.p { background: color-mix(in srgb, var(--c) 40%, transparent); }
.person-grid i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--track); }
.nudge { margin-top: 18px; height: 52px; border-radius: 26px; font-size: 16px; }
.nudge.sent, .nudge:disabled { background: var(--seg); color: var(--muted); }
.shared-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13.5px; color: var(--accent); }

/* Rustdag on Today, Weekschema */
.day-note { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 16px auto 0; padding: 8px 14px; border-radius: 18px; background: var(--seg); font-size: 13.5px; color: var(--muted); }
.day-note i { font-size: 15px; color: var(--acc); }
.schedule-card { padding: 18px 20px 20px; }
.schedule-head { display: flex; align-items: center; gap: 14px; font-size: 17px; font-weight: 600; }
.schedule-head i { font-size: 26px; color: var(--acc); }
.schedule-head small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.schedule-days { display: flex; justify-content: space-between; gap: 6px; margin-top: 16px; }
.day-chip { width: 40px; height: 40px; border-radius: 50%; border: none; padding: 0; font-size: 14px; font-weight: 500; background: var(--seg); color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.day-chip.on { background: var(--text); color: var(--fabFg); }
.day-chip:disabled { cursor: default; }
.schedule-card p { font-size: 13px; line-height: 1.4; margin-top: 12px; }
.schedule-card + .schedule-card { margin-top: 12px; }
.schedule-head > div { flex: 1; min-width: 0; }
.lock { font-size: 13px; color: var(--muted); }
a.switch { display: inline-block; }
.set-row a.label { color: inherit; }
.vacation-card.on { box-shadow: inset 0 0 0 2px var(--acc); }
.vacation-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.vacation-dates label { border-radius: 14px; background: var(--seg); padding: 10px 14px; min-width: 0; }
.vacation-dates span { display: block; font-size: 12px; color: var(--muted); }
.vacation-dates b, .vacation-dates input { display: block; font-size: 15px; font-weight: 400; margin-top: 2px; }
.vacation-dates input { width: 100%; border: none; padding: 0; background: transparent; color: var(--text); font-family: inherit; color-scheme: light dark; }

@media (max-width: 1023px) { .desktop-only { display: none !important; } }
@media (min-width: 1024px) { .mobile-only { display: none !important; } }

/* Gewoontes beheren (habits/index): a card per routine, its habits on a line; then the loose ones. */
.mg-actions { display: flex; gap: 8px; margin-top: 14px; }
.primary-pill { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 24px; background: var(--accB); color: var(--fabFg); font-size: 15px; font-weight: 600; white-space: nowrap; }
.primary-pill.soft { background: var(--seg); color: var(--text); }
/* Gewoontes: Nieuwe routine, a dashed row under the routines. */
.mg-new { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; margin-top: 14px; border-radius: 22px; border: 1.5px dashed var(--track); color: var(--muted); font-size: 14px; font-weight: 500; }
.primary-pill i { font-size: 16px; }
.mg-head { display: flex; align-items: center; gap: 6px; min-height: 30px; margin: 20px 4px 6px; }
.mg-head > i { font-size: 14px; color: var(--accent); flex: none; }
.mg-head b { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mg-head span { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-head .icon-btn { width: 36px; height: 36px; }
.mg-card { padding: 0 4px 0 6px; border-radius: 20px; background: var(--card); box-shadow: var(--cardShadow); }
.mg-row { position: relative; display: flex; align-items: center; min-height: 62px; touch-action: pan-y; }
.mg-card:not(.linked) .mg-row:not(:last-child) { box-shadow: inset 0 -1px 0 var(--hair); }
.mg-row.dragging { z-index: 2; background: var(--lift); border-radius: 8px; box-shadow: var(--liftShadow); scale: .97; }
/* Held: a ring fills around the icon until the row comes loose (450 ms, after a short wait so a tap shows nothing). */
.mg-row.holding { background: var(--seg); border-radius: 16px; transition: background-color .2s .12s; }
.mg-main { position: relative; }
.mg-row.holding .mg-main::before { content: ""; position: absolute; left: -6px; top: 50%; width: 48px; height: 48px; margin-top: -24px; padding: 2.5px; box-sizing: border-box; border-radius: 15px; background: conic-gradient(var(--accent) calc(var(--hold) * 1%), transparent 0); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: hold-ring .33s linear .12s both; }
@property --hold { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes hold-ring { to { --hold: 100; } }
/* Reordering (reorder controller): the lifted copy in the row's colour, its old place a ghost, a line where it lands. The lift colour spreads 6px past the row so the icon does not sit against the ring. */
[data-controller~="reorder"] { position: relative; --liftShadow: 0 0 0 6px var(--lift), 0 0 0 8px color-mix(in srgb, var(--c, var(--accent)) 55%, transparent), 0 18px 40px rgba(0, 0, 0, .35); }
.reordering [data-reorder-target="item"] { opacity: .5; transition: opacity .15s; }
.reordering .ghost { opacity: .2; }
.gloed-shell:has(.reordering) :is(.mg-card, .mg-head):not(.reordering, .reordering *) { opacity: .5; transition: opacity .15s; }
/* Per category, every category is somewhere to drop a habit: an empty one shows only while dragging. */
.mg-groups:not(.reordering) .spare:not(:has(.mg-row)) { display: none; }
.mg-groups .mg-card:not(:has(.mg-row)) { min-height: 62px; }
/* The lifted copy is nearly always over the line, so the line runs out into the margins, a dot at each end. */
.drop-line { position: absolute; z-index: 1; left: -10px; right: -10px; height: 2px; margin-top: -1px; background: var(--accent); pointer-events: none; }
.drop-line::before, .drop-line::after { content: ""; position: absolute; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.drop-line::before { left: -4px; }
.drop-line::after { right: -4px; }
/* The grip stays quiet until it is used. */
.mg-row .grip { width: 20px; height: 44px; flex: none; padding: 0; border: none; background: none; color: var(--muted); opacity: .28; }
.mg-row .grip i { font-size: 15px; }
.mg-row .grip:active, .mg-row.dragging .grip { opacity: .9; color: var(--text); }
.mg-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 10px 0; color: var(--text); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mg-icon { position: relative; width: 36px; height: 36px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--c); }
.mg-icon i { font-size: 19px; color: #fff; }
/* A routine's habits hang on a line through their icons. */
.mg-card.linked .mg-row:not(:first-child) .mg-icon::before, .mg-card.linked .mg-row:not(:last-child) .mg-icon::after { content: ""; position: absolute; left: 17px; width: 2px; height: 13px; background: var(--track); }
.mg-card.linked .mg-icon::before { bottom: 100%; }
.mg-card.linked .mg-icon::after { top: 100%; }
.mg-main .label { flex: 1; min-width: 0; }
.mg-go { flex: none; padding-right: 10px; font-size: 14px; color: var(--muted); }
.mg-main b { display: block; font-size: 16px; font-weight: 500; }
.mg-main small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.mg-row .more { width: 44px; height: 44px; color: var(--muted); }
.mg-card .add-link { padding-left: 12px; margin: 0; }
@media (max-width: 1023px) { .mg-card { padding-left: 16px; } }

/* ---------- Routines on Today, long-press menu, routine editor ---------- */
.rt-sec > summary { list-style: none; cursor: pointer; }
.rt-sec > summary::-webkit-details-marker { display: none; }
.rt-head { display: flex; align-items: center; gap: 7px; min-height: 36px; margin: 14px 4px 6px; }
.rt-head i { font-size: 15px; flex: none; }
.rt-head span { white-space: nowrap; }
.rt-head .count { font-weight: 400; font-variant-numeric: tabular-nums; }
.rt-head .chev { font-size: 13px; transition: transform .2s; transform: rotate(-90deg); }
.rt-sec[open] .rt-head .chev { transform: none; }
.rt-head .grow { flex: 1; }
.rt-all { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; padding: 0; border: none; background: none; color: var(--text); }
.rt-all i { font-size: 16px; }
.rt-sec:not([open]) .rt-all { display: none; }
.rt-more { width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.rt-more i { font-size: 18px; }
.rt-sec[open] > .habits-stack { animation: gl-in .2s ease both; }

.menu-layer { flex-direction: column; justify-content: flex-end; align-items: center; gap: 10px; padding: 20px 20px calc(36px + env(safe-area-inset-bottom)); }
.menu-layer .sheet-backdrop { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.menu-head, .menu-items { position: relative; width: 100%; max-width: 360px; border-radius: var(--radius-card); background: var(--sheet, var(--card)); box-shadow: 0 8px 30px rgba(0, 0, 0, .14); animation: gl-in .2s ease both; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.menu-tile { width: 40px; height: 40px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center; }
.menu-tile i { font-size: 19px; color: #fff; }
.menu-head .label { flex: 1; min-width: 0; }
.menu-head b { display: block; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head small { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.menu-items { overflow: hidden; }
.menu-items form { display: block; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 18px; border: none; background: transparent; color: var(--text); font-size: 15.5px; text-align: left; }
.menu-items > :not(:last-child) .menu-item, .menu-items > a.menu-item:not(:last-child) { box-shadow: inset 0 -1px 0 var(--hair); }
.menu-item > span { flex: 1; min-width: 0; }
.menu-item small { font-size: 14px; color: var(--muted); white-space: nowrap; }
.menu-item i { font-size: 20px; flex: none; }
.menu-item.danger { color: var(--danger); }
.menu-item:hover { background: var(--seg); }

.sheet-h { font-size: 21px; font-weight: 600; }
.choice-rows { display: flex; flex-direction: column; margin-top: 8px; }
.choice-rows form { display: block; }
.choice-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 8px 0; border: none; border-bottom: 1px solid var(--hair); background: none; color: var(--text); text-align: left; }
.choice-rows > :last-child .choice-row { border-bottom: none; }
.choice-row .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; box-sizing: border-box; border: 2px solid var(--muted); }
.choice-row .dot.box { border-radius: 7px; }
.choice-row.on .dot { border: 7px solid var(--accB); }
.choice-row .label b { display: block; font-size: 16px; font-weight: 600; }
.choice-row .label small { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.add-link { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-top: 4px; color: var(--accent); font-size: 15px; font-weight: 600; }
.add-link i { font-size: 18px; }
.routine-sheet .nf-name { margin-top: 14px; }
.routine-sheet .nf-quick { margin: 12px -22px 0; padding: 2px 22px; }
.routine-icon { background: linear-gradient(135deg, var(--accA), var(--accB)); }
.pick-list { padding: 2px 16px; }
.pick-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.pick-row:last-child { border-bottom: none; }
.pick-row .tile { width: 34px; height: 34px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; }
.pick-row .tile i { font-size: 17px; color: #fff; }
.pick-row .label { flex: 1; min-width: 0; }
.pick-row .label b { display: block; font-size: 15.5px; font-weight: 500; }
.pick-row .label small { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.pick-input { position: absolute; opacity: 0; pointer-events: none; }
.pick-check { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px var(--track); color: transparent; }
.pick-input:checked + .pick-check { background: var(--accB); color: #fff; box-shadow: none; }
.pick-input:focus-visible + .pick-check { outline: 2px solid var(--acc); }
.routine-save { margin-top: 18px; height: 52px; border-radius: 26px; background: var(--accB); font-size: 16px; font-weight: 600; }
.routine-sheet .danger-link { display: block; margin: 12px auto 0; }

/* ---------- Instellingen groups ---------- */
.group-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 22px 4px 8px; }
.settings-group > .group-card:first-child { margin-top: 22px; }
.settings-card.group-card { margin-top: 0; padding: 0 16px; }
/* Instellingen, as in the prototype: who you are on top, rows of 54px. */
.me-card { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 16px; border-radius: 22px; background: var(--card); box-shadow: var(--cardShadow); color: var(--text); }
.me-photo { width: 52px; height: 52px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; background: linear-gradient(135deg, var(--accA), var(--accB)); color: #fff; font-size: 21px; font-weight: 600; }
.me-photo img { width: 100%; height: 100%; object-fit: cover; }
.me-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-who b { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-who small { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-premium { flex: none; height: 26px; padding: 0 10px; border-radius: 13px; display: flex; align-items: center; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--accB) 22%, transparent); color: var(--accent); }
.me-card .caret { font-size: 17px; color: var(--muted); }
.settings-groups .set-row { min-height: 54px; padding: 8px 0; }
.settings-groups .set-row .label { font-size: 15.5px; }
/* ---------- Desktop (Habit Tracker Gloed Desktop) ----------
   From 1024px: the bottom bar becomes a sidebar, pages widen, sheets become dialogs. */
.side-brand-row { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.side-brand-row svg { width: 30px; height: 30px; flex: none; }
.row-edit { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: color .15s; }
.row-edit:hover { color: var(--text); }
.row-edit i { font-size: 17px; }
.today-week .bars { height: 90px; margin: 0; }
.today-week .bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.today-week .week-head { margin: 40px 0 14px; }
/* Desktop "Nieuwe gewoonte": the categories as an even grid of small tiles, like the phone's cards. */
/* The edit sheet: one row that scrolls sideways. */

@media (min-width: 1024px) {
  /* Sidebar */
  .nav-fade { display: none; }
  .bottom-nav {
    left: 0; right: auto; top: 0; bottom: 0; width: 232px; height: auto; border-radius: 0;
    background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 44px 18px 28px; /* brand level with the page title */
  }
  .bottom-nav .side-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; margin-bottom: 28px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
  .bottom-nav .side-brand svg { width: 30px; height: 30px; }
  .bottom-nav .side-only { display: flex; }
  .bottom-nav .bar-only { display: none; }
  /* Vandaag first in the sidebar, after the brand and the new-habit button. */
  .bottom-nav :is(.side-brand, .side-new) { order: -2; }
  .nav-today { order: -1; }
  .nav-ring { width: 22px; height: 22px; }
  .nav-item .nav-ring i { font-size: 11px; }
  .nav-glyph { width: 19px; height: 19px; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 14px; border-radius: 12px; color: var(--muted); transition: background .15s, color .15s; }
  .nav-item:hover { background: var(--seg); }
  .nav-item i { font-size: 19px; }
  .nav-item span { font-size: 15px; }
  .nav-item::after { display: none; }
  .nav-item.on { background: var(--seg); color: var(--text); }
  .nav-item.on > :is(i, .nav-ring, .nav-glyph) { transform: none; }
  .side-new { height: 46px; margin-bottom: 14px; padding: 0 14px; border-radius: 14px; background: var(--accB); color: var(--fabFg); font-size: 15px; font-weight: 600; align-items: center; gap: 10px; }
  .side-new i { font-size: 17px; }
  .nav-item.side-end { margin-top: auto; }

  /* Pages */
  /* Content up to 1120px; on wide screens it centres in the window, never under the sidebar. */
  .gloed-shell, .gloed-shell.no-nav { max-width: 1208px; margin: 0 auto 0 max(232px, (100% - 1208px) / 2); padding: 40px 56px 60px 32px; }
  .page-title { font-size: 34px; letter-spacing: -0.02em; line-height: 1.1; margin-top: 0; }
  .title-row { align-items: flex-end; margin-top: 0; }

  /* Vandaag: title left, day buttons right; list and a sticky side column */
  .today .day-head { gap: 8px; }
  /* Desktop keeps the big title with the day buttons on the right. */
  .today .day-nav { display: contents; }
  .today .day-nav .day-title { flex: 1; order: -1; padding: 0; }
  .today .day-nav .day-title h1 { font-size: 34px; }
  .today .day-nav .day-title h1 i { font-size: 16px; }
  .today .day-nav .day-title span { display: block; }
  .today .day-nav .icon-btn.off { opacity: 1; visibility: hidden; }
  .today .day-head .go-today { order: -1; }
  .today .day-title { cursor: pointer; }
  .today .day-title h1 { font-size: 34px; letter-spacing: -0.02em; line-height: 1.1; }
  .today .day-title h1 { width: max-content; }
  .today .day-title h1 i { font-size: 16px; }
  .today .day-title span { display: block; font-size: 15px; margin-top: 6px; }
  .today .day-head .icon-btn { width: 40px; height: 40px; background: var(--seg); color: var(--text); }
  .today .day-head .icon-btn i { font-size: 16px; }
  .go-today { height: 40px; padding: 0 16px; border-radius: 20px; display: flex; align-items: center; }
  /* The days as a row under the title, two weeks back to a week ahead; opened from the title. */
  .today .strip { display: none; }
  .strip-open .today .strip { display: flex; gap: 6px; overflow-x: auto; margin: 26px 0 0; padding: 2px 0;
    mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
  .today .strip a { width: 54px; padding: 11px 0 10px; }
  .today .strip a:not(.on):hover { background: var(--seg); color: var(--text); }
  #today-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 280px); column-gap: 64px; margin-top: 28px; align-items: start; }
    .today-side { grid-column: 2; grid-row: 1; position: sticky; top: 40px; }
  .today-main { grid-column: 1; grid-row: 1; }
  .row-wrap { position: relative; display: flex; align-items: center; gap: 4px; }
  /* Reorder grip in the gutter left of the row, shown on hover. */
  .row-wrap > .grip { position: absolute; right: 100%; width: 28px; opacity: 0; }
  .row-wrap:hover > .grip, .row-wrap.dragging > .grip { opacity: .7; }
  .row-wrap > .grip:hover { opacity: 1; }
  /* Lifted: an opaque card (the rows themselves are see-through) that grows a little. */
  .row-wrap.dragging { z-index: 2; background: var(--lift); border-radius: 8px; box-shadow: var(--liftShadow); scale: .97; }
  .row-wrap > form { flex: 1; min-width: 0; }
  .today-main > .sect-head:first-child { margin-top: 0; }
  .habits-stack .row-wrap { gap: 8px; }

  /* Overzicht: a grid of blocks, the wide ones across */
  /* Blocks side by side are equally tall; their bars grow into the extra height. */
  .ov-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; margin-top: 32px; align-items: stretch; }
  .ov-card { display: flex; flex-direction: column; }
  .ov-card > .bars { flex: 1; min-height: 130px; height: auto; }
  .ov-card.wide { grid-column: 1 / -1; }

  /* Detail */
  .detail > * { max-width: 760px; }
  .detail .page-head { margin: 0 0 28px; }
  .detail .page-head .back { display: none; }
  /* Breadcrumb: a muted trail on the title's line height, so the title below keeps its place. */
  .crumbs { display: flex; align-items: center; gap: 8px; height: 40px; font-size: 15px; color: var(--muted); min-width: 0; }
  .crumbs a { color: var(--muted); transition: color .15s; }
  .crumbs a:hover { color: var(--text); }
  .crumbs i { font-size: 11px; opacity: .7; }
  .crumbs span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .detail .page-head .pill-btn { height: 40px; padding: 0 14px; border-radius: 20px; font-size: 14px; }
  .detail-head { margin-top: 0; }

  /* Gewoontes: a table */
  .habits-empty { text-align: left; padding: 24px 0; }

  /* Instellingen: one card per group */
  .settings-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); grid-auto-rows: 4px; gap: 0 16px; align-items: start; grid-auto-flow: dense; margin-top: 6px; }
  .settings-card.group-card { padding: 4px 22px; }
  .settings-card { padding: 4px 22px; }
  .themes:has(.swatch) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }

  /* Sheets become centred dialogs */
  .sheet-layer { justify-content: center; padding: 24px; }
  .sheet { max-width: 460px; max-height: calc(100dvh - 48px); border-radius: 24px; padding: 24px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: gl-pop .25s cubic-bezier(.2, .8, .2, 1) both; }
  .sheet-layer.closing .sheet { animation: gl-fade-out .18s ease both; }
  .sheet .grabber { display: none; }
  .sheet .name-input { padding: 14px 16px; border-radius: 14px; font-size: 16px; }

  .menu-layer { justify-content: center; }
  /* Overzicht aanpassen: a dialog too */
  .page-layer .sheet-backdrop { display: block; }
  .page-sheet { position: relative; inset: auto; max-width: 540px; max-height: calc(100dvh - 48px); background: var(--sheet); border-radius: 24px; padding: 24px 28px 20px; animation: gl-pop .25s cubic-bezier(.2, .8, .2, 1) both; }
  .page-sheet > * { max-width: none; }
  .page-sheet .page-head { margin: 0 0 10px; }
  .page-sheet .page-head .back { display: none; }
  .page-sheet .page-head .close { visibility: visible; color: var(--muted); }
  .page-sheet .page-head h2 { flex: 1; font-size: 22px; }
  .page-sheet .sheet-foot { justify-content: space-between; }
  .page-sheet .text-btn { margin-left: -18px; }

  /* Onboarding: text left, art right */
  .flow:has(.onb-body) { max-width: none; }
  .onb-top { justify-content: space-between; align-items: center; padding: 32px 48px 0; }
  .onb-body { align-items: center; justify-content: center; padding: 0 48px; }
  .onb-step { width: 100%; max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 80px; align-items: center; justify-items: center; }
  .onb-step[hidden] { display: none; }
  .onb-step h2 { order: -1; font-size: 44px; line-height: 1.2; justify-self: stretch; }
  .onb-step > :not(h2) { width: 100%; max-width: 420px; }
  .onb-step .onb-logo { width: 132px; }
  .onb-foot { width: 100%; max-width: 1136px; margin: 0 auto; padding: 0 48px 48px; }
  .onb-next { width: auto; height: 56px; padding: 0 28px; border-radius: var(--radius-pill); display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 500; }
  .onb-next[hidden] { display: none; }

  /* Sign in and sign up: brand panel and form panel */
  .auth-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); height: 100dvh; }
  .auth-brand { display: flex !important; flex-direction: column; justify-content: space-between; padding: 40px 56px; min-width: 0; }
  .auth-story { max-width: 520px; }
  .auth-glow { position: relative; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; margin-left: -24px; }
  .auth-glow::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 30%, transparent) 0%, transparent 68%); animation: glow-breathe 5s ease-in-out infinite; }
  .auth-glow svg { position: relative; width: 110px; height: 110px; }
  .auth-brand h1 { font-size: 44px; font-weight: 400; line-height: 1.2; letter-spacing: -0.02em; color: var(--muted); text-wrap: pretty; }

  /* The three stories share one grid cell and cross-fade on the form panel's mode. */
  .auth-modes { display: grid; margin-top: 24px; }
  .auth-mode { grid-area: 1 / 1; opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; pointer-events: none; }
  .auth-page[data-mode="login"] .auth-mode[data-for="login"],
  .auth-page[data-mode="signup"] .auth-mode[data-for="signup"],
  .auth-page[data-mode="reset"] .auth-mode[data-for="reset"] { opacity: 1; transform: none; }
  .auth-mode > :last-child { margin-top: 36px; }
  .auth-page[data-mode="signup"] .story-habit { animation: story-in .5s cubic-bezier(.2, .8, .2, 1) both; }
  .story-habit:nth-child(2) { animation-delay: .08s !important; }
  .story-habit:nth-child(3) { animation-delay: .16s !important; }

  .story-streak { max-width: 380px; padding: 18px 20px; border-radius: var(--radius-panel); background: var(--card); box-shadow: var(--cardShadow); }
  .story-days { display: flex; justify-content: space-between; }
  .story-days > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .story-days span { font-size: 11.5px; color: var(--muted); }
  .story-days b { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
  .story-days b.full { background: var(--acc); color: #fff; }
  .story-days b.full i { font-size: 14px; }
  .story-days b.now { border: 1.5px dashed var(--acc); }
  .story-streak p { display: flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 14px; color: var(--muted); }
  .story-streak p i { font-size: 16px; color: var(--acc); }

  .story-habits { display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
  .story-habit { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--c) 14%, var(--mix)); }
  .story-habit .ic { width: 32px; height: 32px; border-radius: 50%; background: var(--c); display: flex; align-items: center; justify-content: center; flex: none; }
  .story-habit .ic i { font-size: 16px; color: #fff; }
  .story-habit .name { flex: 1; font-size: 15.5px; color: var(--text); }
  .story-habit .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--c); display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
  .story-habit .tick i { font-size: 13px; color: #fff; opacity: 0; }
  .story-habit.done .tick { background: var(--c); }
  .story-habit.done .tick i { opacity: 1; }

  .story-mail { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); }
  .story-mail i { width: 48px; height: 48px; border-radius: 50%; background: color-mix(in srgb, var(--acc) 18%, transparent); color: var(--acc); font-size: 24px; display: flex; align-items: center; justify-content: center; flex: none; }
  .auth-brand small { font-size: 13px; color: var(--muted); }
  .auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--card); overflow-y: auto; }
}
@keyframes glow-breathe { 0%, 100% { opacity: .75; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes story-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes gl-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Handmatig invullen (habit_entries/edit) ---------- */
.entry-amount { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }
.entry-amount .round-btn { width: 48px; height: 48px; flex: none; }
.entry-amount > div { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.entry-amount input { width: 150px; text-align: center; border: none; outline: none; background: transparent; color: var(--text); font-size: 56px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; padding: 0; -moz-appearance: textfield; appearance: textfield; }
.entry-amount input::-webkit-outer-spin-button, .entry-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.entry-amount span { font-size: 14px; color: var(--muted); margin-top: 2px; }
.entry-track { height: 8px; border-radius: 4px; background: var(--track); margin-top: 24px; overflow: hidden; }
.entry-track i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--c); transition: width .3s cubic-bezier(.2, .8, .2, 1); }
.entry-status { font-size: 13.5px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.entry-quick { display: flex; gap: 8px; margin-top: 20px; }
.entry-quick button { flex: 1; height: 40px; border-radius: 20px; border: none; background: var(--seg); color: var(--text); font-size: 14.5px; font-weight: 500; cursor: pointer; transition: transform .14s cubic-bezier(.3, .7, .4, 1), background-color .2s; }
.entry-quick button:active { transform: scale(.96); }
.entry-quick .goal { background: color-mix(in srgb, var(--c) 22%, var(--seg)); }
.entry-sheet .primary { margin-top: 22px; height: 54px; }
@media (min-width: 1024px) { .row-wrap > a.habit-btn { flex: 1; min-width: 0; } }

/* ---------- Embers (points, levels, badges) ---------- */
.emblem { flex: none; overflow: visible; }
.icon-chip { width: 36px; height: 36px; border-radius: 18px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--seg); color: var(--text); font-size: 18px; }
.embers-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 10px; }
.embers-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accB), var(--accA)); border-radius: 3px; transition: width .4s ease; }

.embers-page .ov-tabs { margin-top: 12px; }
.embers-page > .settings-card:last-child { margin-top: 24px; }
.embers-level { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 26px; }
.embers-level .muted { font-size: 16px; margin-top: 16px; }
.embers-level h2 { font-size: 30px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.embers-total { font-size: 15px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.embers-level .embers-bar { width: 200px; }
.embers-level .small { font-size: 13.5px; margin-top: 8px; }
.embers-trend { margin-top: 24px; }
.embers-trend svg { display: block; width: 100%; height: 80px; margin-top: 14px; overflow: visible; }
.embers-trend polygon { fill: var(--acc); opacity: .14; }
.embers-trend polyline { fill: none; stroke: var(--acc); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.embers-days { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.embers-rules .set-row > i { font-size: 18px; color: var(--acc); }
.embers-rules .set-row b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.embers-rules p, .embers-log p { padding: 13px 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; text-wrap: pretty; }
.embers-levels .set-row.on { font-weight: 600; }
.embers-levels .you { font-size: 12px; font-weight: 600; color: var(--accent); }
.embers-levels .range { min-width: 96px; text-align: right; font-size: 13.5px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.embers-count { font-size: 15px; color: var(--muted); text-align: center; margin-top: 22px; }
.embers-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; margin-top: 22px; }
.embers-badges > * { text-align: center; color: var(--text); }
.embers-badges b { display: block; font-size: 14px; font-weight: 600; margin-top: 10px; }
.embers-badges small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.embers-badges span { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.medal { width: 64px; height: 64px; margin: 0 auto; }
.medal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.medal:not(.on) svg { opacity: .75; }
.medal.on svg { filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--accB) 35%, transparent)); }
.medal-text { font-weight: 600; letter-spacing: -0.03em; }
.embers-log { margin-top: 22px; }
.embers-log .why { display: flex; gap: 6px; color: var(--muted); font-size: 14px; }
.embers-log .set-row b { min-width: 40px; text-align: right; font-size: 15px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.embers-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 4px 0; font-size: 12.5px; color: var(--muted); }
.embers-legend span { display: flex; align-items: center; gap: 5px; }

.embers-toast { position: fixed; z-index: 70; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; background: var(--text); color: var(--fabFg); font-size: 14.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .4); pointer-events: none; animation: gl-strip .25s ease both; }
.embers-toast i { font-size: 16px; color: var(--acc); }
.embers-toast.leaving { animation: gl-fade-out .25s ease both; }

/* Celebrations: confetti, the milestone's label, chips and share, a new level. */
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.confetti span { position: absolute; left: 50%; top: 34%; animation-name: gl-conf; animation-timing-function: cubic-bezier(.15, .6, .4, 1); animation-fill-mode: both; }
@keyframes gl-conf { 0% { transform: translate(0, 0) rotate(0deg); opacity: 1; } 30% { transform: translate(var(--dx), var(--up)) rotate(calc(var(--r) * .4)); opacity: 1; } 100% { transform: translate(calc(var(--dx) * 1.4), 260px) rotate(var(--r)); opacity: 0; } }
@keyframes gl-burst { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes gl-draw { from { stroke-dashoffset: 251.3; } to { stroke-dashoffset: 0; } }
.milestone-card { animation: gl-burst .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.milestone-label { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.milestone-ring svg { transform: rotate(-90deg); }
.milestone-ring .draw { animation: gl-draw 1s .15s cubic-bezier(.4, 0, .2, 1) both; }
.milestone-ring > div { animation: gl-burst .5s .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.milestone-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; animation: gl-in .4s .8s ease both; }
.milestone-chips span { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--seg); font-size: 13.5px; font-weight: 600; }
.milestone-chips i { font-size: 14px; color: var(--acc); }
.milestone-chips + .primary { margin-top: 20px; }
.milestone-share { border: none; background: transparent; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; margin-top: 6px; color: var(--accent); font-size: 15px; font-weight: 500; }
.level-up-emblem { display: flex; justify-content: center; margin-bottom: 18px; animation: gl-burst .6s .25s cubic-bezier(.2, .9, .3, 1.2) both; }
.milestone-card .level-up-name { font-size: 30px; font-weight: 600; letter-spacing: -0.015em; margin-top: 2px; }

/* Samen: today's shared habits, groups, this week's embers. */
.samen-head { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 4px 8px; font-size: 14px; color: var(--muted); }
.samen-head span:last-child { font-size: 13px; }
/* Samen, as in the prototype: the group's name over its people, the score on the right. */
.circle-card { padding: 16px; border-radius: 20px; }
.circle-card .circle-main b { font-size: 17px; }
.circle-meta { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.circle-meta small { margin: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circle-meta .avatar { box-shadow: 0 0 0 2px var(--card); }
.circle-card .circle-stat b { font-size: 19px; font-weight: 600; }
.circle-list { gap: 8px; margin-top: 16px; }
.invite-card { border-radius: 22px; padding: 2px 16px; }
.invite-card .label { font-size: 16px; font-weight: 500; }
.invite-card .label small { font-size: 13.5px; font-weight: 400; }
.invite-actions .pill-btn { height: 40px; padding: 0 18px; border-radius: 20px; font-size: 15px; font-weight: 500; }
.invite-actions .pill-btn.dark { height: 40px; padding: 0 18px; border-radius: 20px; font-size: 15px; font-weight: 600; background: var(--accB); color: #fff; }
.circle-sub { margin: 2px 4px 6px; font-size: 15px; color: var(--muted); }
.circle-habit { padding: 12px 14px; border-radius: 18px; }
.ch-top { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.ch-top .circle-main { flex: 1; min-width: 0; }
.ch-top .circle-main b { font-size: 15.5px; font-weight: 500; }
.ch-people { flex: none; display: flex; gap: 3px; }
.ch-people .avatar:not(.done) { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--track); }
.ch-done { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--c); color: #fff; font-size: 14px; }
.circle-habit-wrap:has(.join-btn) .ch-top { padding-right: 104px; }
.member-row .role-pill { padding: 0; background: none; font-size: 13.5px; font-weight: 400; }
.circle-main .crown { font-size: 13px; color: #f5b300; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.rank-row:last-child { border-bottom: none; }
.rank-row .place { width: 16px; font-size: 14px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rank-row .label { flex: 1; min-width: 0; }
.rank-row .label div:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.rank-row.me .label span { font-weight: 600; }
.rank-row b { font-weight: 500; font-variant-numeric: tabular-nums; }
.rank-bar { height: 4px; border-radius: 2px; background: var(--track); margin-top: 6px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--c); border-radius: 2px; }

/* Android app: a tab that takes a moment to load dims its page (after .15s, so a fast
   switch shows nothing), instead of looking stuck. */
turbo-frame#app[aria-busy="true"] .gloed-shell { opacity: .55; transition: opacity .2s ease .15s; }

/* Everything on Vandaag done (dashboard/_day_done): the logo as a scene that builds itself. */
/* The day's progress as a big ring on top of Vandaag (Instellingen → Voortgangsring). */
.today-ring { position: relative; width: 180px; height: 180px; margin: 10px auto 18px; }
.today-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.today-ring-track, .today-ring-arc { fill: none; stroke-width: 12; }
.today-ring-track { stroke: var(--track); }
.today-ring-arc { stroke: url(#kGrad); stroke-linecap: round; transition: stroke-dasharray .45s ease; }
.today-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.today-ring b { font-size: 44px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.today-ring span { margin-top: 6px; font-size: 14px; color: var(--muted); }
.day-done { display: flex; flex-direction: column; align-items: center; padding: 34px 0; text-align: center; }
.day-done svg { width: 190px; max-width: 100%; height: auto; overflow: visible; }
.day-done p { margin-top: 18px; font-size: 15px; color: var(--muted); animation: gl-in .5s 1.6s ease-out both; }
.dd-glow { fill: var(--acc); opacity: .2; filter: blur(9px); transform-box: fill-box; transform-origin: center; animation: dd-glow 1s 1.1s ease-out both; }
.dd-sun { transform-box: fill-box; transform-origin: center bottom; animation: dd-rise 1.1s cubic-bezier(.3, .7, .3, 1) both; }
.dd-line { fill: var(--text); transform-box: fill-box; transform-origin: center; animation: dd-line .6s .2s cubic-bezier(.3, .7, .3, 1) both; }
.dd-line.b { opacity: .45; animation-delay: .4s; }
@keyframes dd-rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes dd-line { from { transform: scaleX(0); } to { transform: none; } }
@keyframes dd-glow { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: .32; } 100% { opacity: .2; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .day-done *, .day-done p { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}
