/* Veckopengsappen – Organic-designsystemets tokens + appens komponenter. */
@font-face { font-family: 'Caprasimo'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/caprasimo-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/figtree-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/figtree-latin-600-normal.woff2) format('woff2'); }

:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-accent-2: #7a8a5e;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  --color-neutral-100: #f9f4ed; --color-neutral-200: #eee7db; --color-neutral-300: #dcd3c4; --color-neutral-400: #c0b6a5; --color-neutral-500: #a19786;
  --color-neutral-600: #82796a; --color-neutral-700: #645c50; --color-neutral-800: #474238; --color-neutral-900: #2e2b25;
  --color-accent-100: #fff2eb; --color-accent-200: #ffe1d0; --color-accent-300: #ffc6a5; --color-accent-400: #f6a06b; --color-accent-500: #d67f48;
  --color-accent-600: #b2622d; --color-accent-700: #8c491a; --color-accent-800: #643312; --color-accent-900: #402310;
  --color-accent-2-100: #f0fae1; --color-accent-2-200: #e1eecc; --color-accent-2-300: #ccdbb2; --color-accent-2-400: #aebf92; --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157; --color-accent-2-700: #56633f; --color-accent-2-800: #3d472b; --color-accent-2-900: #272e1b;

  --font-heading: 'Caprasimo', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, sans-serif;
  --space-1: 4.4px; --space-2: 8.8px; --space-3: 13.2px; --space-4: 17.6px; --space-6: 26.4px; --space-8: 35.2px;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 28px;
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);
  --tabbar-h: 74px;
}

/* Barnens färger: varje barn bär en ramp som återkommer i alla vyer. */
.kid-accent   { --k100:#fff2eb; --k200:#ffe1d0; --k300:#ffc6a5; --k400:#f6a06b; --k500:#d67f48; --k600:#b2622d; --k700:#8c491a; --k800:#643312; --k900:#402310; --k:#c67139; }
.kid-accent-2 { --k100:#f0fae1; --k200:#e1eecc; --k300:#ccdbb2; --k400:#aebf92; --k500:#8fa073; --k600:#728157; --k700:#56633f; --k800:#3d472b; --k900:#272e1b; --k:#7a8a5e; }
.kid-plum     { --k100:#fbf0f6; --k200:#f5dcea; --k300:#e9bfd6; --k400:#d69abb; --k500:#b9779c; --k600:#985c7f; --k700:#764463; --k800:#533046; --k900:#341e2c; --k:#a3668a; }
.kid-sky      { --k100:#eef6fb; --k200:#d9eaf5; --k300:#bcd6e9; --k400:#94bad6; --k500:#6f9cbf; --k600:#557f9f; --k700:#41637d; --k800:#2e4659; --k900:#1d2c38; --k:#5f8db0; }
.kid-sun      { --k100:#fff6dc; --k200:#ffebb3; --k300:#fbd987; --k400:#ebbd55; --k500:#cc9d35; --k600:#a67e22; --k700:#806118; --k800:#5a4411; --k900:#3a2c0b; --k:#c29530; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; line-height: 1.12; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-800); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
svg.i { display: block; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--color-neutral-700); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-family: var(--font-heading); white-space: nowrap; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent-700); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1; min-width: 0; }

/* ── skal ── */
#app { min-height: 100dvh; }
.screen { max-width: 600px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 20px calc(var(--tabbar-h) + 34px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.screen.no-tabs { padding-bottom: 40px; }
.page-head h1 { font-size: 28px; }
.page-head p { font-size: 13px; color: var(--color-neutral-700); margin-top: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.section-head h2 { font-size: 21px; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 0; color: var(--color-accent-700); font-weight: 600; font-size: 14px; cursor: pointer; align-self: flex-start; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-width: 600px; margin: 0 auto;
  background: var(--color-surface); border-radius: 28px 28px 0 0; box-shadow: 0 -2px 14px color-mix(in srgb, #2e2b25 8%, transparent);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 52px;
  color: var(--color-neutral-600); font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 18px; }
.tab:hover { color: var(--color-neutral-800); }
.tab[aria-current='page'] { color: var(--color-accent-700); }
.tab .badge { position: absolute; top: 2px; right: calc(50% - 24px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--color-accent); color: var(--color-bg); font-size: 11px; display: grid; place-items: center; }

/* ── knappar ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent; min-height: 44px; padding: 0 18px; border-radius: 999px; white-space: nowrap; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-outline { border: 1.5px solid var(--color-accent); color: var(--color-accent-800); }
.btn-outline:hover { background: var(--color-accent-100); }
.btn-ghost { color: var(--color-accent-700); padding-inline: 10px; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-sage { background: var(--color-accent-2-700); color: var(--color-accent-2-100); }
.btn-sage:hover { background: var(--color-accent-2-800); }
.btn-danger { color: var(--color-accent-800); border: 1.5px solid var(--color-accent-300); }
.btn-danger:hover { background: var(--color-accent-100); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; border: 1.5px solid var(--color-divider); background: transparent; color: var(--color-neutral-800); }
.icon-btn:hover { background: var(--color-accent-100); }
.icon-btn.ok { border: 0; background: var(--color-accent-2-500); color: var(--color-accent-2-100); }
.icon-btn.ok:hover { background: var(--color-accent-2-600); }

/* ── statusbricka ── */
.status { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.approved { background: var(--color-accent-2-200); color: var(--color-accent-2-900); }
.status.waiting { background: var(--color-neutral-300); color: var(--color-neutral-900); }
.status.denied, .status.warn { background: var(--color-accent-200); color: var(--color-accent-900); }
.status.pop { animation: pop .4s ease-out; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; background: var(--color-accent-100); color: var(--color-accent-800); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ── avatar ── */
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--k300, var(--color-accent-300)); display: grid; place-items: center; font-size: 24px; flex: none; line-height: 1; }
.avatar.sm { width: 30px; height: 30px; font-size: 16px; }
.avatar.md { width: 44px; height: 44px; font-size: 22px; }
.avatar.lg { width: 72px; height: 72px; font-size: 36px; }

/* ── barnets header ── */
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head h1 { font-size: 24px; }
.kid-head .date { font-size: 13px; color: var(--color-neutral-700); }

/* ── pottkort + mätare ── */
.pot-card { background: var(--color-surface); border-radius: 32px; padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.pot-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pot-amount .big { font-family: var(--font-heading); font-size: 52px; line-height: 1; }
.pot-amount .big small { font-size: 22px; margin-left: 4px; }
.pot-amount .side { font-size: 14px; color: var(--color-neutral-600); text-align: right; }
.meter { height: 18px; border-radius: 999px; background: var(--color-neutral-200); display: flex; gap: 3px; overflow: hidden; }
.meter.thin { height: 10px; gap: 2px; }
.meter span { height: 100%; border-radius: 999px; transition: width .6s ease; min-width: 0; }
.meter .earned { background: var(--k, var(--color-accent)); }
.meter .wait { background: var(--color-neutral-400); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--color-neutral-700); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ── uppgiftskort ── */
.task { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 12px 14px 12px 12px; border: 0; border-radius: 24px;
  background: var(--color-surface); text-align: left; cursor: pointer; transition: transform .12s ease, opacity .3s; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.task:active { transform: scale(.98); }
.task.approved { opacity: .72; cursor: default; }
.task.approved:active { transform: none; }
.task .ic { width: 52px; height: 52px; border-radius: 50%; background: var(--k100, var(--color-accent-100)); display: grid; place-items: center; font-size: 26px; flex: none; }
.task .name { font-family: var(--font-heading); font-size: 17px; line-height: 1.2; }
.task .meta { font-size: 13px; color: var(--color-neutral-700); margin-top: 2px; }
.task .todo { width: 48px; height: 48px; border-radius: 50%; border: 2.5px dashed var(--k400, var(--color-accent-400)); display: grid; place-items: center; color: var(--k, var(--color-accent)); flex: none; }
.hint { font-size: 12px; color: var(--color-neutral-600); }

.extra-cta { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 24px; background: var(--color-accent-2-200); }
.extra-cta .ic { width: 46px; height: 46px; border-radius: 50%; background: var(--color-accent-2-100); display: grid; place-items: center; font-size: 22px; flex: none; }
.extra-cta .k { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-accent-2-800); }
.extra-cta .t { font-family: var(--font-heading); font-size: 16px; color: var(--color-accent-2-900); }
.extra-cta .btn { min-height: 40px; padding: 10px 14px; font-size: 13px; }

/* ── generella kort och listor ── */
.card { background: var(--color-surface); border-radius: 28px; padding: 18px; }
.card.tight { padding: 6px 18px; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; }
.list-row + .list-row { border-top: 1px solid var(--color-divider); }
.list-row .t { font-size: 15px; font-weight: 600; }
.list-row .d { font-size: 12px; color: var(--color-neutral-700); }
.list-row .amt { font-family: var(--font-heading); font-size: 18px; white-space: nowrap; }
.list-row.link { cursor: pointer; text-decoration: none; color: inherit; }
.list-row.grey .t, .list-row.grey .amt { color: var(--color-neutral-600); }
.list-row.grey .d { color: var(--color-neutral-700); }

.hero { background: var(--k, var(--color-accent)); color: var(--k100, var(--color-accent-100)); border-radius: 32px; padding: 20px; }
.hero .kicker { color: inherit; opacity: .9; }
.hero .big { font-family: var(--font-heading); font-size: 56px; line-height: 1.05; }
.hero .big small { font-size: 22px; margin-left: 4px; }
.hero p { font-size: 14px; }

.denied-card { background: var(--color-accent-100); border: 1.5px solid var(--color-accent-300); border-radius: 28px; padding: 16px; display: flex; gap: 12px; }
.denied-card .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--color-accent-200); display: grid; place-items: center; font-size: 22px; flex: none; }
.denied-card h3 { font-size: 16px; color: var(--color-accent-900); }
.denied-card .q { font-size: 14px; margin: 4px 0; }
.denied-card .m { font-size: 12px; color: var(--color-accent-800); margin-bottom: 10px; }

.screen-bank { background: var(--color-accent-2-200); border-radius: 28px; padding: 18px; color: var(--color-accent-2-900); }
.screen-bank .k { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-2-800); }
.screen-bank .big { font-family: var(--font-heading); font-size: 40px; line-height: 1.1; }
.screen-bank .big small { font-size: 18px; margin-left: 4px; }
.screen-bank .h { font-size: 13px; display: flex; justify-content: space-between; padding: 4px 0; }
.screen-bank .h b { font-weight: 600; }

/* ── inkorg ── */
.group-head { display: flex; align-items: center; gap: 10px; }
.group-head h3 { font-size: 17px; }
.swipe { position: relative; border-radius: 22px; background: var(--color-accent-2-500); overflow: hidden; touch-action: pan-y; }
.swipe.deny-side { background: var(--color-accent-500); }
.swipe .under { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-family: var(--font-heading); font-size: 14px; color: var(--color-accent-2-100); }
.swipe .under span { display: inline-flex; align-items: center; gap: 6px; }
.swipe .under span:last-child { color: var(--color-accent-100); }
.swipe .fg { position: relative; display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 12px 12px 12px 14px; background: var(--color-surface);
  border-radius: 22px; border-left: 5px solid var(--k, var(--color-accent)); transition: transform .3s ease; }
.swipe.dragging .fg { transition: none; }
.swipe .fg .ic { width: 42px; height: 42px; border-radius: 50%; background: var(--color-bg); display: grid; place-items: center; font-size: 21px; flex: none; }
.swipe .fg .n { font-size: 15px; font-weight: 600; line-height: 1.25; }
.swipe .fg .m { font-size: 12px; color: var(--color-neutral-700); }
.swipe .fg .r { font-family: var(--font-heading); font-size: 15px; white-space: nowrap; }
.swipe.leaving { transition: opacity .25s, max-height .3s .1s; opacity: 0; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 10px; }
.empty .ic { width: 88px; height: 88px; border-radius: 50%; background: var(--color-accent-2-200); display: grid; place-items: center; font-size: 40px; }
.empty h3 { font-size: 20px; }

/* ── familjeöversikt ── */
.kid-card { background: var(--color-surface); border-radius: 32px; padding: 18px; border-left: 6px solid var(--k); display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.kid-card h3 { font-size: 20px; }
.stats4 { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px; }
.stats4 .v { font-family: var(--font-heading); font-size: 19px; white-space: nowrap; }
.stats4 .l { font-size: 11px; color: var(--color-neutral-700); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick button { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 84px; padding: 14px 8px; border-radius: 24px; border: 0; background: var(--color-surface); text-align: center; font-size: 12px; font-weight: 600; cursor: pointer; }
.quick button:hover { background: color-mix(in srgb, var(--color-surface) 80%, var(--color-text) 6%); }
.quick .c { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.quick .c.a { background: var(--color-accent-100); color: var(--color-accent-700); }
.quick .c.b { background: var(--color-accent-2-200); color: var(--color-accent-2-800); }
.notice { background: var(--color-neutral-100); border: 1.5px solid var(--color-neutral-300); border-radius: 24px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }

/* ── veckan ── */
.week-nav { display: flex; align-items: center; justify-content: space-between; }
.week-grid { background: var(--color-surface); border-radius: 28px; padding: 12px 10px; overflow-x: auto; }
.week-grid table { width: 100%; border-collapse: collapse; }
.week-grid th { font-size: 11px; font-weight: 600; color: var(--color-neutral-700); padding: 4px 2px 8px; text-align: center; }
.week-grid th.today { color: var(--color-accent-700); }
.week-grid td { padding: 4px 2px; text-align: center; }
.week-grid table { table-layout: fixed; }
.week-grid tr.name-row td { text-align: left; padding: 12px 4px 2px; }
.week-grid tr.name-row:first-child td { padding-top: 2px; }
.week-grid td.name .n { font-size: 14px; font-weight: 600; }
.week-grid td.name .f { font-size: 12px; color: var(--color-neutral-700); }
.week-grid tr.cells-row td { padding: 3px 0 6px; }
.week-grid tr.cells-row + tr.name-row td { border-top: 1px solid var(--color-divider); }
.cell { width: 36px; height: 36px; max-width: 100%; border-radius: 50%; display: inline-grid; place-items: center; border: 0; background: transparent; padding: 0; font-size: 13px; }
.cell.due { border: 2px dashed var(--k400, var(--color-accent-400)); background: transparent; }
.cell.due.can { cursor: pointer; }
.cell.due.can:hover { background: var(--k100, var(--color-accent-100)); }
.cell.opt { border: 2px dashed var(--color-neutral-400); cursor: pointer; }
.cell.opt:hover { background: var(--k100, var(--color-accent-100)); }
.cell.approved { background: var(--color-accent-2-500); color: var(--color-accent-2-100); }
.cell.waiting { background: var(--color-neutral-300); color: var(--color-neutral-900); }
.cell.denied { background: var(--color-accent-200); color: var(--color-accent-900); }
.cell.missed { background: var(--color-neutral-200); color: var(--color-neutral-500); }
.cell.off { color: var(--color-neutral-400); }
.cell.paused { color: var(--color-neutral-500); font-size: 11px; }

/* ── formulär ── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 600; color: var(--color-neutral-700); }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 8px 14px; font: inherit; font-size: 15px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-neutral-100); border: 1px solid var(--color-divider); border-radius: 999px; }
textarea.input { border-radius: 20px; min-height: 80px; resize: vertical; }
.input::placeholder { color: var(--color-neutral-400); }
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--color-accent); color: var(--color-accent-800); background: transparent; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--color-accent-100); }
.chip[aria-pressed='true'] { background: var(--color-accent); color: var(--color-bg); }
.chip.day { min-width: 46px; justify-content: center; padding: 0 8px; }
.seg { display: inline-flex; border: 1px solid var(--color-divider); border-radius: 999px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 14px; font-size: 13px; cursor: pointer; min-height: 40px; }
.seg button + button { border-left: 1px solid var(--color-divider); }
.seg button[aria-pressed='true'] { background: var(--color-accent); color: var(--color-bg); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: 40px; }
.check input { width: 22px; height: 22px; accent-color: var(--color-accent); }
.err { color: var(--color-accent-800); font-size: 13px; font-weight: 600; min-height: 1em; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent; background: var(--color-neutral-100); font-size: 22px; cursor: pointer; }
.emoji-pick button[aria-pressed='true'] { border-color: var(--color-accent); background: var(--color-accent-100); }
.color-pick { display: flex; gap: 10px; }
.color-pick button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; background: var(--k); cursor: pointer; box-shadow: inset 0 0 0 2px var(--color-bg); }
.color-pick button[aria-pressed='true'] { border-color: var(--color-text); }

/* ── inloggning ── */
.auth { max-width: 440px; margin: 0 auto; min-height: 100dvh; padding: calc(40px + env(safe-area-inset-top)) 24px 40px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 56px; height: 56px; border-radius: 50%; background: var(--color-accent); color: var(--color-bg); display: grid; place-items: center; font-size: 28px; }
.brand h1 { font-size: 30px; }
.blob { position: relative; }
.code-input { font-family: var(--font-heading); font-size: 24px; text-align: center; letter-spacing: .08em; min-height: 60px; text-transform: uppercase; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.profile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 10px; border-radius: 28px; border: 0; background: var(--color-surface); cursor: pointer; }
.profile:hover { background: color-mix(in srgb, var(--color-surface) 80%, var(--color-text) 6%); }
.profile .n { font-family: var(--font-heading); font-size: 18px; }
.profile .r { font-size: 12px; color: var(--color-neutral-700); display: inline-flex; gap: 4px; align-items: center; }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; }
.pinpad button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--color-surface); font-family: var(--font-heading); font-size: 26px; cursor: pointer; }
.pinpad button:active { background: var(--color-neutral-300); }
.pinpad button.fn { background: transparent; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--color-neutral-700); }
.pindots { display: flex; gap: 14px; justify-content: center; min-height: 18px; }
.pindots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--color-neutral-600); }
.pindots i.on { background: var(--color-text); border-color: var(--color-text); }
.pindots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ── ark (bottom sheet) och toast ── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--color-neutral-900) 45%, transparent); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { width: min(600px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--color-neutral-100); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; animation: up .25s ease; }
.sheet h2 { font-size: 22px; }
.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--color-neutral-900); color: var(--color-neutral-100); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md); max-width: calc(100% - 40px); text-align: center; animation: up .2s ease; }
.toast.err { background: var(--color-accent-800); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--color-neutral-600); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--color-neutral-300); border-top-color: var(--color-accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── admin ── */
.menu a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; text-decoration: none; color: inherit; }
.menu a + a { border-top: 1px solid var(--color-divider); }
.menu .c { width: 40px; height: 40px; border-radius: 50%; background: var(--color-accent-100); color: var(--color-accent-700); display: grid; place-items: center; flex: none; font-size: 20px; }
.menu .t { font-weight: 600; }
.menu .d { font-size: 12px; color: var(--color-neutral-700); }
.cat-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--color-neutral-700); margin: 6px 4px 0; }
.search { position: sticky; top: 0; z-index: 5; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.tag { display: inline-flex; align-items: center; font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--color-neutral-200); color: var(--color-neutral-800); font-weight: 600; }
.tag.sage { background: var(--color-accent-2-200); color: var(--color-accent-2-900); }
.tag.acc { background: var(--color-accent-100); color: var(--color-accent-800); }

@media (min-width: 700px) {
  .screen { padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
