/* Refill tablet app. Colours and sizes follow the clickable prototype (tablet prototype, docs/handoff.md section 1):
   big touch targets (≥ 60 px), high contrast by day, low luminance at night. Brand: assets/logo/README.md. */

/* ---- Theme tokens: day by default, night when the tablet says so or the operator chose "Dunkel". */
:root, [data-theme="light"] {
    --bg: #F3F4F6; --surface: #FFFFFF; --surface-2: #F9FAFB; --surface-3: #F3F4F6;
    --text: #111827; --text-2: #374151; --text-3: #4B5563;
    --border: #D1D5DB; --border-soft: #E5E7EB; --border-strong: #9CA3AF;
    --primary: #1D4ED8; --on-primary: #FFFFFF; --on-primary-2: #DBEAFE; --primary-soft: #EFF6FF; --primary-text: #1E3A8A;
    --disabled-bg: #E5E7EB;
    --ok: #065F46; --ok-bg: #D1FAE5; --warn: #78350F; --warn-bg: #FEF3C7; --warn-border: #F59E0B; --err: #7F1D1D; --err-bg: #FEE2E2;
    --scrim: rgba(17, 24, 39, .6);
    --chrome: #111827; --chrome-text: #F9FAFB; --chrome-text-2: #D1D5DB; --chrome-text-3: #9CA3AF; --chrome-border: #4B5563; --chrome-border-strong: #6B7280;
    --refill-blue: #077bc0;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0A0E15; --surface: #151B26; --surface-2: #11161F; --surface-3: #1B2230;
        --text: #E2E5EA; --text-2: #C2C7D0; --text-3: #959EAD;
        --border: #2C3544; --border-soft: #222A37; --border-strong: #465062;
        --primary: #1E4CC8; --on-primary: #E8ECF5; --on-primary-2: #BCCBEE; --primary-soft: #16224A; --primary-text: #9CB8F5;
        --disabled-bg: #1B2230;
        --ok: #6FD9AE; --ok-bg: #0B2B22; --warn: #F2CB5C; --warn-bg: #2E2307; --warn-border: #A1660B; --err: #F3A3A3; --err-bg: #341010;
        --scrim: rgba(0, 0, 0, .72);
        --chrome: #05070B; --chrome-text: #E2E5EA; --chrome-text-2: #B4BAC4; --chrome-text-3: #878F9C; --chrome-border: #323A48; --chrome-border-strong: #465062;
        color-scheme: dark;
    }
}

[data-theme="dark"] {
    --bg: #0A0E15; --surface: #151B26; --surface-2: #11161F; --surface-3: #1B2230;
    --text: #E2E5EA; --text-2: #C2C7D0; --text-3: #959EAD;
    --border: #2C3544; --border-soft: #222A37; --border-strong: #465062;
    --primary: #1E4CC8; --on-primary: #E8ECF5; --on-primary-2: #BCCBEE; --primary-soft: #16224A; --primary-text: #9CB8F5;
    --disabled-bg: #1B2230;
    --ok: #6FD9AE; --ok-bg: #0B2B22; --warn: #F2CB5C; --warn-bg: #2E2307; --warn-border: #A1660B; --err: #F3A3A3; --err-bg: #341010;
    --scrim: rgba(0, 0, 0, .72);
    --chrome: #05070B; --chrome-text: #E2E5EA; --chrome-text-2: #B4BAC4; --chrome-text-3: #878F9C; --chrome-border: #323A48; --chrome-border-strong: #465062;
    color-scheme: dark;
}

/* ---- Base */
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Segoe UI", Roboto, system-ui, sans-serif; }
button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: var(--primary-text); }
.app { position: relative; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; user-select: none; -webkit-user-select: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.grow { flex: 1; min-height: 0; }

/* ---- Header (signed in) */
/* Test environment (QA): the same red as the QA icon's band, never a brand colour (assets/logo/README.md). */
.env-banner { flex: none; background: #C62828; color: #FFFFFF; font-size: 16px; font-weight: 600; line-height: 1.3; padding: 8px 24px; text-align: center; }
.header { height: 72px; flex: none; background: var(--chrome); color: var(--chrome-text); display: flex; align-items: center; justify-content: space-between; padding: 0 24px 0 28px; gap: 16px; }
/* Nothing in the header may overlap: the chip and the operator name shrink with an ellipsis, everything else keeps its size. */
.header-left, .header-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.header-left { flex: 0 1 auto; }
.header-right { flex: 0 1 auto; justify-content: flex-end; }
.header-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.home-link { display: flex; align-items: center; gap: 16px; flex: none; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; border-radius: 8px; }
.home-link:focus-visible { outline: 2px solid var(--chrome-text-2); outline-offset: 4px; }
.header-logo { height: 36px; width: auto; display: block; flex: none; }
.header-title { font-size: 22px; font-weight: 800; white-space: nowrap; flex: none; }
.chip { font-size: 16px; font-weight: 600; color: var(--chrome-text-2); border: 1px solid var(--chrome-border); border-radius: 999px; padding: 6px 14px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.operator { font-size: 18px; font-weight: 600; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.operator span { color: var(--chrome-text-3); font-weight: 500; }
.btn-chrome { height: 52px; padding: 0 16px; border: 2px solid var(--chrome-border-strong); border-radius: 12px; background: transparent; color: var(--chrome-text); font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex: none; }
.btn-menu { display: none; width: 52px; padding: 0; justify-content: center; }

/* ---- Side panel (login, PIN, device status) */
.split { display: flex; height: 100%; }
/* Width: the title "Leergutverladung" needs up to 386 px at 44 px (Segoe UI Black, measured), so the wide panel
   leaves 404 px inside the padding and the narrow one (≤ 1100 px) 336 px for the 36 px title (316 px). */
.panel { width: 500px; flex: none; background: var(--chrome); color: var(--chrome-text); padding: 48px 48px 40px; box-sizing: border-box; display: flex; flex-direction: column; gap: 16px; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-logo { height: 72px; width: auto; display: block; }
.panel h1 { margin: 0; font-size: 44px; line-height: 1.1; font-weight: 800; }
.panel h1.panel-hello { font-size: 40px; }
.panel-device-block { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; min-width: 0; }

/* Logo variants: full lockup with DGL, then symbol plus "Refill", then the symbol alone (breakpoints at the end).
   Kept after .header-logo and .panel-logo, which set display: block, so the hidden variants stay hidden. */
.logo-word, .logo-symbol { display: none; }
/* Optical alignment with the header texts. The reference is the centre of their capital letters, which sits about 1 px
   below the middle of the line (fonts keep room for descenders below the baseline; measured on a screenshot).
   - Full logo: the DGL swoosh fills the top of the box, so its letters' centre is at 68.5 % of the height (measured);
     lift by the difference, then down by that 1 px.
   - Wordmark and symbol: already centred in their box (50 %), so only the 1 px. */
.header .logo-full { transform: translateY(calc(-18.5% + 1px)); }
.header .logo-word, .header .logo-symbol { transform: translateY(1px); }
.panel-label { font-size: 15px; color: var(--chrome-text-3); }
.panel-device { font-size: 26px; font-weight: 700; }
.panel-location { font-size: 20px; color: var(--chrome-text-2); }
.panel-help { margin-top: auto; font-size: 19px; line-height: 1.5; color: var(--chrome-text-2); }
.btn-panel { height: 64px; width: 100%; border: 2px solid var(--chrome-border-strong); border-radius: 14px; background: transparent; color: var(--chrome-text); font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.main-col { flex: 1; padding: 40px 72px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 16px; overflow-y: auto; }
.col-440 { width: 440px; max-width: 100%; }
.field-label { font-size: 20px; font-weight: 600; color: var(--text-2); }
.display { height: 80px; box-sizing: border-box; background: var(--surface); border: 2px solid var(--border-strong); border-radius: 14px; display: flex; align-items: center; padding: 0 24px; font-size: 40px; font-weight: 700; letter-spacing: .06em; }
/* PIN: drawn dots (not characters), so they stay exactly centred whatever the font; up to 8 fit in the 440 px field. */
.display.pin { justify-content: center; }
.pin-dots { display: flex; gap: 16px; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; background: currentColor; }
.pin-hint { font-size: 20px; font-weight: 500; letter-spacing: normal; color: var(--text-3); }

/* ---- Keypads */
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.key { height: 80px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 34px; font-weight: 600; }
.key:active, .btn:active, .btn-primary:active { filter: brightness(.92); }
.keys.small { gap: 10px; }
.keys.small .key { height: 72px; border-radius: 12px; font-size: 32px; }

/* ---- Buttons */
.btn-primary { height: 76px; border: 0; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-size: 24px; font-weight: 700; }
.btn { height: 76px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 22px; font-weight: 600; }
.btn-disabled { height: 76px; width: 100%; border: 0; border-radius: 14px; background: var(--disabled-bg); color: var(--text-3); font-size: 22px; font-weight: 600; }
.btn-name { height: 76px; width: 100%; border: 0; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.btn-name small { font-size: 17px; font-weight: 500; color: var(--on-primary-2); margin-left: 12px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
/* A button with an icon before its text ("Beenden"). */
.btn-icon { display: flex; align-items: center; justify-content: center; gap: 10px; }
/* Disabled buttons, e.g. "Abbrechen" in the quit dialog while Refill quits. */
.btn-chrome:disabled, .btn-panel:disabled, .option:disabled, .btn:disabled { opacity: .5; }

/* ---- Messages */
.msg { box-sizing: border-box; padding: 12px 16px; border-radius: 12px; font-size: 18px; font-weight: 600; }
.msg.err { background: var(--err-bg); color: var(--err); }
.msg.info { background: var(--primary-soft); color: var(--primary-text); display: flex; align-items: center; gap: 12px; }
.msg.warn { border: 2px solid var(--warn-border); background: var(--warn-bg); color: var(--warn); border-radius: 14px; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; font-weight: 500; }
.msg.warn strong { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; }

/* ---- Transport list */
.page { flex: 1; min-height: 0; overflow-y: auto; box-sizing: border-box; padding: 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h2 { margin: 0; font-size: 30px; font-weight: 800; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.card { min-height: 128px; box-sizing: border-box; text-align: left; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); padding: 18px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.card:disabled { border-style: dashed; background: var(--surface-2); color: var(--text-3); }
.card-top, .card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; }
.card-tknum { font-size: 30px; font-weight: 800; }
.card-partner { font-size: 22px; font-weight: 600; }
.card-meta { font-size: 17px; color: var(--text-3); }
.badge { font-size: 18px; font-weight: 700; background: var(--primary-soft); color: var(--primary-text); border-radius: 10px; padding: 6px 12px; white-space: nowrap; }
.badge.warn { background: var(--warn-bg); color: var(--warn); font-size: 17px; }
.badge.outline { background: transparent; border: 2px solid var(--primary); font-size: 16px; padding: 3px 10px; }
.empty { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--text-3); text-align: center; }

/* ---- Capture */
.capture { flex: 1; min-height: 0; overflow-y: auto; box-sizing: border-box; padding: 20px 32px 24px; display: flex; flex-direction: column; gap: 16px; }
/* Scrolling columns: children keep their full height. Flex items would otherwise shrink to their min-height once the
   content is taller than the screen (a long transport on a phone), and the quantity row would spill over the next line. */
.capture > *, .page > *, .main-col > * { flex-shrink: 0; }
.capture-head { display: flex; align-items: center; gap: 20px; }
.btn-back { height: 60px; padding: 0 20px 0 14px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.capture-title { font-size: 28px; font-weight: 800; }
.save-state { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.save-state.unsynced { color: var(--warn); }
.save-state.saving { color: var(--text-3); }
.tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.tab { height: 60px; padding: 0 22px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 19px; font-weight: 600; }
.tab.active { border-color: var(--primary); background: var(--primary); color: var(--on-primary); font-weight: 700; }
.lines-head, .line { display: grid; grid-template-columns: minmax(0, 1fr) 120px 400px; gap: 16px; align-items: center; }
.lines-head { padding: 0 20px; font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.line { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 10px 20px; min-height: 88px; box-sizing: border-box; }
.line-text { font-size: 22px; font-weight: 600; }
.line-sub { font-size: 16px; color: var(--text-3); }
.line-sub strong { margin-left: 10px; color: var(--primary-text); }
.line-expected { text-align: right; font-size: 24px; font-weight: 600; color: var(--text-2); }
.qty { display: grid; grid-template-columns: 84px minmax(0, 1fr) 84px; gap: 10px; }
.qty button { height: 68px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 34px; font-weight: 600; }
.qty button.value { border-color: var(--primary); background: var(--primary-soft); font-size: 32px; font-weight: 800; }
.btn-add { height: 68px; border: 2px dashed var(--border-strong); border-radius: 14px; background: transparent; color: var(--primary-text); font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.footer { height: 104px; flex: none; background: var(--surface); border-top: 1px solid var(--border-soft); box-sizing: border-box; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-sum { font-size: 20px; color: var(--text-2); }
.footer-sum strong { color: var(--text); font-size: 24px; }
.footer .btn-primary { width: 340px; font-size: 26px; font-weight: 800; }

/* ---- Result */
.result { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.result-card { width: 760px; max-width: 100%; background: var(--surface); border-radius: 20px; border: 1px solid var(--border-soft); padding: 48px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.result-icon { width: 104px; height: 104px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.result-icon.ok { background: var(--ok-bg); color: var(--ok); }
.result-icon.part { background: var(--primary-soft); color: var(--primary-text); }
.result-icon.warn { background: var(--warn-bg); color: var(--warn); }
.result-icon.err { background: var(--err-bg); color: var(--err); }
.result-card h2 { margin: 0; font-size: 40px; font-weight: 800; }
.result-text { font-size: 22px; line-height: 1.5; color: var(--text-2); }

/* ---- Overlays */
.scrim { position: absolute; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog { width: 640px; max-width: 100%; max-height: 100%; overflow-y: auto; background: var(--surface); border-radius: 20px; padding: 32px; box-sizing: border-box; display: flex; flex-direction: column; gap: 16px; }
.dialog.wide { width: 960px; }
.dialog.keypad { width: 500px; padding: 28px 32px; gap: 14px; }
.dialog.confirm { width: 760px; padding: 36px; gap: 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dialog-title { font-size: 28px; font-weight: 800; }
.dialog-sub { font-size: 18px; color: var(--text-3); }
.btn-close { width: 56px; height: 56px; flex: none; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; }
.kp-display { height: 80px; box-sizing: border-box; border: 2px solid var(--primary); border-radius: 14px; display: flex; align-items: center; justify-content: flex-end; padding: 0 24px; font-size: 44px; font-weight: 800; }
.option { min-height: 88px; box-sizing: border-box; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); padding: 12px 22px; display: flex; align-items: center; gap: 18px; text-align: left; }
.option.selected { border: 3px solid var(--primary); background: var(--primary-soft); padding: 11px 21px; }
.option-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.option-title { font-size: 24px; font-weight: 700; }
.option-sub { font-size: 17px; color: var(--text-3); }
.quit-title { font-size: 32px; }
.articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.article { min-height: 104px; box-sizing: border-box; text-align: left; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.article span:first-child { font-size: 20px; font-weight: 700; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; font-size: 20px; padding: 12px 16px; background: var(--surface-3); border-radius: 12px; }
.summary-row > span:first-child { font-weight: 600; min-width: 0; }
.summary-counts { flex: none; text-align: right; white-space: nowrap; }

/* ---- Responsive steps. The header gives up space in this order:
   1180 px: the title "Leergutverladung"
   1000 px: the DGL lockup becomes symbol + "Refill"
    760 px: symbol only, language/display/sign-out move into the ☰ menu, the tablet chip goes into the menu.
   The login and PIN panels follow the same idea: below 760 px they collapse into a slim top bar. */
@media (max-width: 1180px) {
    .header-title { display: none; }
}

@media (max-width: 1100px) {
    .panel { width: 400px; padding: 32px; }
    .panel-logo { height: 60px; }
    .panel h1 { font-size: 36px; }
    .panel h1.panel-hello { font-size: 34px; }
    .main-col { padding: 32px; }
    .lines-head, .line { grid-template-columns: minmax(0, 1fr) 90px 300px; }
    .qty { grid-template-columns: 68px minmax(0, 1fr) 68px; }
}

@media (max-width: 1000px) {
    .header .logo-full { display: none; }
    .header .logo-word { display: block; }
    /* "Beenden" in the header: the icon only (the label stays for screen readers). */
    .btn-quit-text { display: none; }
    .btn-quit { width: 52px; padding: 0; justify-content: center; }
}

@media (max-width: 760px) {
    /* Header */
    .header { height: 64px; padding: 0 12px 0 16px; gap: 12px; }
    .header .logo-word { display: none; }
    .header .logo-symbol { display: block; height: 40px; }
    .header-actions, .chip, .operator span { display: none; }
    .btn-chrome { height: 48px; }
    .btn-menu { display: flex; width: 48px; }

    /* Login, PIN and device panels: a slim bar on top instead of a side column */
    .split { flex-direction: column; }
    .panel { width: 100%; padding: 12px 12px 14px 16px; gap: 6px; }
    .panel-top { margin-bottom: 0; }
    .panel .logo-full { display: none; }
    .panel .logo-word { display: block; height: 44px; }
    .panel h1 { font-size: 26px; }
    .panel h1:not(.panel-hello), .panel-label, .panel-help, .btn-panel { display: none; }
    .panel h1.panel-hello { font-size: 24px; }
    .panel h1.panel-hello br { display: none; }
    .panel-device-block { flex-direction: row; align-items: baseline; gap: 10px; margin-top: 0; }
    .panel-device { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .panel-location { font-size: 17px; white-space: nowrap; }
    .main-col { flex: 1; padding: 16px; gap: 12px; }
    .display { height: 64px; font-size: 32px; }
    .key { height: 62px; font-size: 28px; }
    .keys { gap: 10px; }
    .keys.small .key { height: 58px; font-size: 26px; }
    .kp-display { height: 64px; font-size: 34px; }

    /* Pages */
    .page, .capture { padding: 16px; }
    .page-head h2 { font-size: 24px; }
    .card { padding: 14px 16px; }
    .card-tknum { font-size: 24px; }
    .card-partner { font-size: 19px; }
    /* Capture header: "‹" only, so the title and "FZ101 · Plan 07:30" (one line, .parts.inline) get the width.
       A "not synced" warning wraps onto its own line below. */
    .capture-head { flex-wrap: wrap; gap: 12px; }
    .capture-head > .grow { flex: 1 1 0; }
    .capture-head .save-state.unsynced { flex-basis: 100%; }
    .capture-title { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .btn-back { height: 52px; width: 52px; padding: 0; justify-content: center; flex: none; }
    .btn-back-text { display: none; }

    /* Order tabs: an even grid (two per row) instead of ragged buttons; supplier on one line with "…", number small below. */
    .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tab { height: auto; min-height: 60px; width: 100%; min-width: 0; padding: 8px 12px; text-align: left; }
    .tab .parts { gap: 0; }
    .tab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }
    .tab-no { font-size: 15px; font-weight: 500; opacity: .85; }
    .lines-head { display: none; }
    .line { grid-template-columns: minmax(0, 1fr) 70px; padding: 10px 14px; }
    .line .qty { grid-column: 1 / -1; }
    .line-text { font-size: 19px; }
    .footer { height: auto; padding: 12px 16px; }
    .footer-sum { font-size: 16px; display: flex; flex-direction: column; gap: 2px; }
    /* Pieces separated by "·" stack on phones, without the dot: info lines (.parts), the footer and the finish dialog. */
    .dot-sep { display: none; }
    .parts { display: flex; flex-direction: column; gap: 2px; }
    /* Short pairs that always fit stay on one line with their dot, e.g. "FZ101 · Plan 07:30". */
    .parts.inline { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .parts.inline .dot-sep { display: inline; }
    .page-updated { align-items: flex-end; text-align: right; }
    .summary-row { font-size: 18px; padding: 12px 14px; gap: 12px; align-items: center; }
    .summary-counts { display: flex; flex-direction: column; gap: 2px; }
    /* Less noise on phones: "saved" and "saving" are hidden, only the "not synced" warning stays. */
    .save-state:not(.unsynced) { display: none; }
    .footer-sum strong { font-size: 20px; }
    .footer .btn-primary { width: auto; flex: 0 1 260px; height: 64px; font-size: 20px; padding: 0 16px; }

    /* Dialogs */
    .scrim { padding: 8px; }
    .dialog, .dialog.keypad, .dialog.confirm { padding: 20px; gap: 12px; }
    .dialog-title { font-size: 22px; }
    .option { min-height: 72px; padding: 10px 16px; }
    .option.selected { padding: 9px 15px; }
    .option-title { font-size: 20px; }
    .result-card { padding: 28px 20px; }
    .result-card h2 { font-size: 30px; }
}

/* ---- Blazor framework UI (template) */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Texts in index.html, shown before the app runs: English, German when the page language is German (js/refill.js sets
   it from the tablet's language, the app later from the chosen one). */
html[lang="de"] .t-en,
html:not([lang="de"]) .t-de {
    display: none;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--refill-blue);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

    html[lang="de"] .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Wird geladen");
    }
