/* Neutral look of the shell, the adult area, the profile picker and mails (#34): Lexend, light grey, white, button blue. */
@font-face {
    font-family: Lexend;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/lexend/lexend-latin-400-normal-UQBIWfp.woff2") format('woff2');
}

@font-face {
    font-family: Lexend;
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/lexend/lexend-latin-700-normal-5qqu1Qn.woff2") format('woff2');
}

:root {
    --background: #f4f4f2;
    --card: #ffffff;
    --ink: #1f2430;
    --muted: #5f6673;
    --line: #e2e2de;
    --accent: #2f5bd3;
    --accent-background: #e8eefc;
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--ink);
    font: 400 17px/1.5 Lexend, system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }

/* ---------- wordmark and icon (#33) ---------- */
.wordmark { white-space: nowrap; letter-spacing: -.035em; font-weight: 400; color: var(--ink); }
.wordmark b { font-weight: 700; color: var(--accent); }
.app-icon { display: block; border-radius: 22.37%; }

/* ---------- the frame of the pages for the public: start page, ways in, legal pages (home.css has the rest) ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: env(safe-area-inset-top);
    background: rgba(244, 244, 242, .88);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
}
.site-header-inner {
    width: min(1120px, 100% - 48px);
    min-height: 72px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 32px;
}
.site-brand { margin-right: auto; display: inline-flex; align-items: center; gap: 10px; font-size: 24px; text-decoration: none; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--ink); font-size: 16px; text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-account { display: flex; align-items: center; gap: 14px; padding-left: 32px; border-left: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.site-sign-in {
    min-height: 44px;
    padding: 0 20px 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}
.site-sign-in:hover { background: var(--accent); }
.site-sign-in:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.site-sign-in svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer-inner {
    width: min(1120px, 100% - 48px);
    margin-inline: auto;
    padding: 24px 0 max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}
.site-footer-brand { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); }

@media (max-width: 759px) {
    .site-header-inner { min-height: 64px; gap: 16px; }
    .site-nav, .site-account > span { display: none; }
    .site-account { padding: 0; border: 0; }
}

@media (max-width: 379px) {
    .site-brand { gap: 8px; font-size: 20px; }
    .site-brand img { width: 30px; height: 30px; }
    .site-sign-in { padding: 0 16px; }
    .site-sign-in svg { display: none; }
}

/* Whatever the browser scrolls to, an anchor or a focused link, stays below the header. */
@media (display-mode: browser) {
    html:has(.site-header) { scroll-padding-top: 88px; }
}

/* The installed app is no website: the logo and the legal pages, nothing to find out about VociHeld. */
@media (display-mode: standalone) {
    .site-header { position: static; }
    .site-nav, .site-account, .site-footer-brand { display: none; }
    .site-footer { border: 0; }
    .site-footer-inner { justify-content: center; }
}

.legal-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
.legal-links a { color: var(--muted); }
.adult-main > .legal-links { margin-top: 40px; }

/* ---------- imprint and privacy policy: a sheet ---------- */
.legal { flex: 1; width: min(1120px, 100% - 48px); margin: 0 auto; padding: 56px 0 80px; display: flex; justify-content: center; align-items: flex-start; }
.legal-text { width: min(760px, 100%); padding: clamp(24px, 6vw, 56px); overflow-wrap: break-word; background: var(--card); border: 1px solid var(--line); border-radius: 28px; }
/* Long German words like «Datenschutzerklärung» break on a phone instead of widening the page. */
:is(.legal-text, .flow-card) :is(h1, h2) { -webkit-hyphens: auto; hyphens: auto; }
.legal-text h1 { margin: 0 0 12px; font-size: clamp(28px, 4.6vw, 48px); font-weight: 700; line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
.legal-text h2 { margin: 36px 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.legal-text p, .legal-text ul { margin: 0 0 12px; }
.legal-text ul { padding-left: 22px; }
.legal-text li { margin-bottom: 6px; }
.legal-date { color: var(--muted); font-size: 15px; }

/* ---------- ways in: founding, signing in, choosing the animal; a card ---------- */
.flow { flex: 1; width: min(1120px, 100% - 48px); margin: 0 auto; padding: 56px 0 80px; display: flex; justify-content: center; align-items: flex-start; }
.flow-card {
    width: min(560px, 100%);
    padding: clamp(24px, 6vw, 44px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
}
.flow-card h1 { margin: 0; font-size: clamp(28px, 4.2vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.flow-card p { margin: 0; }

/* On the white card, what is white itself stands out by its own background. */
.flow-card .form-stack :is(input[type="text"], input[type="email"], input[type="password"]),
.flow-card .profile { background: var(--background); }
.flow-card .button-secondary { background: var(--accent-background); border-color: transparent; }

@media (max-width: 599px) {
    :is(.legal, .flow) { padding: 24px 0 48px; }
    :is(.legal-text, .flow-card) { border-radius: 22px; }
}

.lead { color: var(--muted); }
.small { color: var(--muted); font-size: 15px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 22px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font: 700 17px/1.2 Lexend, system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { filter: brightness(1.08); }

.notice { padding: 12px 16px; border-radius: 12px; background: var(--accent-background); }
.notice-error { background: #fdecea; color: #8a1c12; }

/* Forms in the default Symfony layout: one field per div, help and errors below. */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack label { display: block; margin-bottom: 6px; font-weight: 700; }
.form-stack input[type="text"], .form-stack input[type="email"], .form-stack input[type="password"] {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
}
.form-stack input:focus-visible { outline: 3px solid var(--accent-background); border-color: var(--accent); }
.form-stack .help-text { margin-top: 6px; color: var(--muted); font-size: 15px; }
.form-stack ul { margin: 6px 0 0; padding: 0; list-style: none; color: #b3261e; font-size: 15px; }
.code-input { font-size: 22px !important; letter-spacing: .12em; text-transform: uppercase; }
.pin-input { max-width: 220px; font-size: 22px !important; letter-spacing: .3em; }

/* The admin PIN as one box per digit (pin_input_controller.js): the real input lies invisibly over the boxes. */
.pin-boxes { --pin-gap: 10px; position: relative; display: flex; gap: var(--pin-gap); width: fit-content; max-width: 100%; }
.pin-box {
    position: relative;
    width: min(56px, calc((100vw - 48px - 5 * var(--pin-gap)) / 6));
    aspect-ratio: 4 / 5;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
}
.pin-box.is-filled::before { content: ''; position: absolute; inset: 50% auto auto 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.pin-box.is-current { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.pin-box.is-current:not(.is-filled)::after { content: ''; position: absolute; inset: 22% auto 22% 50%; width: 2px; background: var(--ink); animation: pin-caret 1s steps(1) infinite; }
@keyframes pin-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin-box.is-current::after { animation: none; } }
.form-stack .pin-boxes input.pin-input {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    /* 16px and more keeps iOS from zooming in. */
    font-size: 16px !important;
    caret-color: transparent;
    cursor: pointer;
}

.checkbox-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; }
.checkbox-row input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent); }
.checkbox-row label { margin: 0; font-weight: 400; }
.checkbox-row ul { grid-column: 2; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

.reasons { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.sign-in-reasons { display: flex; flex-direction: column; gap: 8px; }
.sign-in-reasons[hidden] { display: none; }

/* The animal picker, 4 × 3 (#24). */
.animals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.animal { position: relative; display: flex !important; flex-direction: column; align-items: center; gap: 4px; margin: 0 !important; padding: 10px 4px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); font-weight: 400 !important; font-size: 15px; text-align: center; cursor: pointer; }
.animal input { position: absolute; opacity: 0; }
.animal:has(input:checked) { border-color: var(--accent); background: var(--accent-background); }
.animal:has(input:focus-visible) { outline: 3px solid var(--accent); }
.animal:has(input:disabled) { cursor: not-allowed; opacity: .45; }
.animal small { color: var(--muted); font-size: 13px; }
@media (max-width: 420px) { .animals { grid-template-columns: repeat(3, 1fr); } }

/* The profile choice of a shared device (ADR 0004, #17): a child with a tap, an adult with their Passkey. */
.profiles { display: flex; flex-direction: column; gap: 12px; }
.profile-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.profile-list form { height: 100%; }
.profile { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); font: inherit; font-size: 18px; cursor: pointer; }
.profile:hover { border-color: var(--accent); }
.profile:focus-visible { outline: 3px solid var(--accent); }
.profile small { color: var(--muted); font-size: 14px; }

/* ---------- adult area (#24, scaffold D): rail left, on a phone a row on top ---------- */
.adult { flex: 1; display: flex; }
.adult-rail {
    width: 120px;
    flex-shrink: 0;
    padding: max(16px, env(safe-area-inset-top)) 10px max(16px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: var(--card);
    border-right: 1px solid var(--line);
}
.rail-children { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; color: var(--ink); font-size: 15px; text-align: center; text-decoration: none; }
a.rail-item:hover { background: var(--background); }
.rail-item.is-active { background: var(--accent-background); color: var(--accent); font-weight: 700; }
.rail-item small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.rail-divider { width: 60%; margin: 4px auto; border: 0; border-top: 1px solid var(--line); }
.rail-me { margin-top: auto; }
.adult-main { flex: 1; min-width: 0; padding: max(24px, env(safe-area-inset-top)) 32px 32px; }
.adult-main h1 { margin: 8px 0 12px; font-size: 30px; }
/* A child in the rail (#55): its avatar, its first name, its streak and the switch «Statistik | Wörter» (#90) over the whole width, its shelf or its statistics below. */
.adult-child-head { display: flex; align-items: center; gap: 8px 16px; margin-bottom: 20px; }
.adult-child-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.adult-child-head h1 { margin: 0; }
.adult-streak { margin-left: auto; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--muted); font-size: 15px; }
.adult-streak b { color: var(--ink); }
.adult-child-switch { flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 12px; background: var(--line); }
.adult-child-switch a { padding: 8px 16px; border-radius: 10px; color: var(--muted); font-size: 15px; text-align: center; text-decoration: none; }
.adult-child-switch a[aria-current="page"] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
/* «Zurück» only on a phone: wider, the rail and the lit learning package show where one is. */
.adult-back { display: none; }
/* The hint «Home-Bildschirm» where an adult lands (#56): above the words of a child, or on the start without children. */
.adult-main .home-screen-hint { max-width: 760px; margin: 0 0 20px; padding: 10px 10px 10px 18px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: none; font-size: 17px; }
.adult-main .home-screen-hint-head { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.adult-main .home-screen-hint-head p { margin: 0; }
.adult-main .home-screen-hint :is(.button, .secondary-button) { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; border: 0; border-radius: 12px; box-shadow: none; font: 700 16px/1.2 Lexend, system-ui, sans-serif; cursor: pointer; }
.adult-main .home-screen-hint .secondary-button { background: var(--accent-background); color: var(--accent); }
.adult-main .home-screen-hint .icon-button { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.adult-main .home-screen-hint .icon-button svg { width: 22px; height: 22px; }
.adult-main .home-screen-hint-steps { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 8px; }
.adult-main .home-screen-hint-steps ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.adult-main .home-screen-hint-key { font-weight: 700; white-space: nowrap; }
.adult-main .home-screen-hint-key svg { width: 1em; height: 1em; vertical-align: -.15em; }
.adult-main :is(.home-screen-hint[hidden], .home-screen-hint [hidden]) { display: none; }
/* Its shelf and the capture screen come from the scaffold (scaffold-neutral.css); the main column keeps the room around them. */
.adult-main :is(.shelf, .capture-form) { min-height: 0; padding: 0; }
.adult-main :is(.learning-package-what, .capture-head) h1 { margin: 0; }
.adult-main .capture-foot { margin: 0 -32px; padding: 10px 32px max(14px, env(safe-area-inset-bottom)); }
/* The learning state in the bar of a learning package, which an adult gets instead of «Los». */
.adult-main .learning-package-bar .learning-bar { flex: 0 1 240px; }
.me { display: flex; align-items: center; gap: 20px; }
/* «Ich» (#24): «Mein Konto» and «Dieses Gerät». */
.me-section { max-width: 640px; margin-top: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.me-section h2 { margin: 0; font-size: 22px; }
.me-section h3 { margin: 8px 0 0; font-size: 17px; }
.me-section p { margin: 0; }
.me-section .form-stack, .me-section .admin-access { align-self: stretch; margin-top: 0; }
.passkeys, .device-members { align-self: stretch; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.passkeys li, .device-members li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.passkeys li { flex-direction: column; align-items: flex-start; }
.passkeys small, .device-members small { color: var(--muted); font-size: 14px; font-weight: 400; }
.device-members form { margin-left: auto; }
.sign-out { margin-top: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.button-secondary { background: var(--card); color: var(--accent); border: 1px solid var(--line); }

@media (max-width: 640px) {
    .adult { flex-direction: column; }
    .adult-rail { width: auto; flex-direction: row; align-items: center; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .rail-children { flex-direction: row; }
    .rail-divider { width: auto; height: 40px; margin: 0 4px; border-top: 0; border-left: 1px solid var(--line); }
    .rail-me { margin: 0 0 0 auto; }
    .adult-main { padding: 20px 16px 32px; }
    .adult-main .home-screen-hint-head { grid-template-columns: 1fr auto; }
    .adult-main .home-screen-hint-head > .secondary-button { grid-row: 2; grid-column: 1; justify-self: start; }
    .adult-main .adult-back { display: inline-grid; }
    /* The head of a child stays one row with «Zurück» and the switch: the streak small under the first name, a long name cut. */
    .adult-child-head { gap: 10px; }
    .adult-child-name { flex-direction: column; align-items: flex-start; gap: 0; }
    .adult-main .adult-back, .adult-child-head .avatar { width: 44px; height: 44px; flex-shrink: 0; }
    .adult-back svg { width: 24px; height: 24px; }
    .adult-child-head h1 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 26px; line-height: 1.1; }
    .adult-streak { margin: 0; padding: 0; border: 0; background: none; font-size: 14px; white-space: nowrap; }
    .adult-child-switch a { padding: 8px 10px; font-size: 14px; }
    .adult-main .capture-foot { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
}

/* ---------- statistics of a child (#87, #90, scaffold B «Spalten»): the head over a list and a detail, each column scrolling on its own ---------- */
.adult:has(> .adult-main.is-statistics) { height: 100dvh; }
.adult-main.is-statistics { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.statistics {
    --learning-day: #4fa66a;
    --only-started: #cfe6d6;
    --secure: #2e9e4f;
    --shaky: #f0a43a;
    --new: #d9d9d4;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.statistics > .home-screen-hint { margin: max(16px, env(safe-area-inset-top)) 28px 0; }
.statistics .adult-child-head { margin: 0; padding: max(20px, env(safe-area-inset-top)) 28px 16px; border-bottom: 1px solid var(--line); }
.statistics-columns { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(240px, 30%, 320px) minmax(0, 1fr); }
.statistics-columns > turbo-frame { display: block; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.statistics-list { padding: 8px 0 32px; border-right: 1px solid var(--line); background: var(--card); }
.statistics-detail { padding: 20px 28px max(48px, env(safe-area-inset-bottom)); }
.statistics-detail[aria-busy="true"] { opacity: .6; transition: opacity .2s .1s; }
.statistics .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.statistics-items { margin: 0; padding: 0; list-style: none; }
.statistics-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--background); color: var(--ink); text-decoration: none; }
.statistics-items:first-child > li:first-child .statistics-item { border-top: 0; }
a.statistics-item:hover { background: var(--background); }
.statistics-item[aria-current="page"] { background: var(--accent-background); }
.statistics-item b { font-weight: 400; }
.statistics-item small { color: var(--muted); font-size: 14px; }
.statistics-group { margin: 0; padding: 18px 18px 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.statistics-hint { margin: 0; padding: 4px 18px; color: var(--muted); font-size: 15px; }

/* The learning state bar of the scaffold (theme/_learning_bar.html.twig), here green, orange and grey. */
.statistics .learning-bar { display: flex; flex-direction: column; gap: 4px; }
.statistics .learning-bar-text { color: var(--muted); font-size: 14px; }
.statistics .learning-bar-text b { color: var(--ink); }
.statistics .learning-bar-segments { display: flex; gap: 2px; height: 9px; overflow: hidden; border-radius: 5px; }
.statistics .learning-bar-segments > i { display: block; min-width: 0; }
.statistics .learning-bar-segments > .secure { background: var(--secure); }
.statistics .learning-bar-segments > .shaky { background: var(--shaky); }
.statistics .learning-bar-segments > .new { background: var(--new); }

.statistics-crumb { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; color: var(--muted); font-size: 15px; }
.statistics-crumb > * + *::before { content: "›"; margin-right: 6px; color: var(--muted); }
.statistics-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 20px; }
.statistics-title h2 { margin: 0; font-size: 26px; }
.statistics-title span { color: var(--muted); font-size: 15px; }
.statistics-figures { margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.statistics-figures > div { display: flex; flex-direction: column-reverse; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.statistics-figures dt { color: var(--muted); font-size: 14px; }
.statistics-figures dd { margin: 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.statistics-section { margin-bottom: 24px; }
.statistics-section h3 { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.statistics-empty { max-width: 560px; margin: 0 0 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--muted); }

.statistics-chart { margin: 0; padding: 14px 14px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.statistics-chart-plot { position: relative; height: 150px; }
/* A line of the minutes: its bottom border on the height of the minutes, the label above it on the right. */
.statistics-chart-line { position: absolute; left: 0; right: 0; padding-bottom: 2px; border-bottom: 1px solid var(--background); color: var(--muted); font-size: 11px; line-height: 1; text-align: right; }
.statistics-chart-days, .statistics-chart-labels { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); }
.statistics-chart-days { position: relative; height: 100%; align-items: end; }
.statistics-chart-day { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; }
.statistics-chart-day:not(.is-learning-day):not(.is-only-started)::after { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--new); }
.statistics-chart-bar { width: 100%; max-width: 18px; border-radius: 3px 3px 1px 1px; background: var(--learning-day); }
.is-only-started .statistics-chart-bar { background: var(--only-started); }
.statistics-chart-labels { margin-top: 4px; color: var(--muted); font-size: 11px; }
.statistics-chart-labels li { overflow: visible; white-space: nowrap; text-align: center; }
.statistics-chart-labels li:last-child { color: var(--ink); }

.statistics-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.statistics-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 3px; background: var(--legend); }
.statistics-legend .learning-day { --legend: var(--learning-day); }
.statistics-legend .only-started { --legend: var(--only-started); }
.statistics-legend .secure { --legend: var(--secure); }
.statistics-legend .shaky { --legend: var(--shaky); }
.statistics-legend .new { --legend: var(--new); }
.statistics-tiles { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.statistics-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.statistics-tile b { font-weight: 400; }

/* The crumb leads back to the list only where the list is not beside it. */
.statistics-crumb > a::before { content: "‹ "; }
@media (min-width: 701px) {
    .statistics-crumb > a::before { content: none; }
}

/* A phone shows only the deepest column of the address, with the crumb back (#87). */
@media (max-width: 700px) {
    .adult:has(> .adult-main.is-statistics) { height: auto; }
    .adult-main.is-statistics { overflow: visible; }
    .statistics .adult-child-head { padding: 16px; }
    .statistics-columns { display: block; }
    .statistics-columns > turbo-frame { overflow: visible; }
    .statistics-list { border-right: 0; }
    .statistics-detail { padding: 16px 16px max(32px, env(safe-area-inset-bottom)); }
    .statistics[data-deepest="detail"] :is(.adult-child-head, .statistics-list) { display: none; }
    .statistics[data-deepest="list"] .statistics-detail { display: none; }
}

/* «E-Mail bestätigen» under «Familie» (#46). */
.confirm-email { max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.confirm-email h2 { margin: 8px 0 0; font-size: 22px; }
.confirm-email p { margin: 0; }

/* The admin PIN (#47): the gate in front of the admin area, and the chip while it is unlocked. */
.pin-gate, .admin-access { max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.pin-gate h2, .admin-access h2 { margin: 8px 0 0; font-size: 22px; }
.pin-gate p, .admin-access p { margin: 0; }
.pin-gate .form-stack { align-self: stretch; }
.admin-chip { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 6px 8px 6px 14px; border-radius: 99px; background: var(--accent-background); color: var(--accent); font-size: 15px; font-weight: 700; }
.link-button { padding: 4px 6px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }
.admin-chip .link-button { font-weight: 400; }
.admin-access { margin-top: 32px; }
.admin-access dl { margin: 0; }
.admin-access dt { font-weight: 700; }
.admin-access dd { margin: 0; }
.admin-access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-access-form { max-width: 560px; }

/* «Familie» behind the admin PIN: members, «+ Kind einladen», the open app codes (#48). */
.family-section { max-width: 640px; margin-top: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.family-section h2 { margin: 0; font-size: 22px; }
.family-section p { margin: 0; }
.app-codes { align-self: stretch; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.app-codes li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.app-codes li div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.app-codes small { color: var(--muted); font-size: 14px; }
/* With «Nochmals senden» and «Widerrufen» the text keeps the whole line, the buttons go below (#82). */
.app-codes li:has(form + form) div { flex-basis: 100%; }

/* The members under «Familie» and a member with their Passkeys (#50). */
.members { align-self: stretch; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.members li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.members li div { display: flex; flex-direction: column; gap: 2px; }
.members a { color: inherit; }
.members small { color: var(--muted); font-size: 14px; font-weight: 400; }
/* «Link nochmals senden» and «Ernennung zurückziehen» of an appointed admin (#83), in the list on a line of their own. */
.appointment-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.members li:has(.appointment-actions) { flex-wrap: wrap; }
.members li .appointment-actions { flex-direction: row; flex-basis: 100%; }
.passkey-info { display: flex; flex-direction: column; gap: 2px; }
.passkey-actions { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.button-danger { background: #b3261e; }
.child-invitation, .adult-invitation { max-width: 560px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions .small { flex-basis: 100%; margin: 0; }

/* The dialog after issuing an app code: the code in large, only now. */
.app-code-dialog { max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.app-code-dialog p { margin: 0; }
.app-code { padding: 16px 24px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font: 700 44px/1 Lexend, system-ui, sans-serif; letter-spacing: .08em; user-select: all; }
.app-code-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
