/* app.fix.do – Repair and Run CI (see docs/SPECIFICATION.md §8) */
:root {
  --brand-primary: #2A3884;
  --brand-primary-dark: #081B7D;
  --brand-accent: #F41A49;
  --brand-accent-text: #D6113D;   /* AA-safe accent for small text/links */
  --text: #081B36;
  --text-muted: #5A6478;
  --surface: #FFFFFF;
  --bg: #F5F6F8;
  --surface-muted: #E7EAEB;
  --border: #D9DDE3;
  --on-primary: #FFFFFF;
  --success: #1E7F4F; --success-bg: #E3F4EA;
  --warning: #8A5A00; --warning-bg: #FFF3D6;
  --danger: #B3122E;  --danger-bg: #FDE5E9;
  --info: var(--brand-primary); --info-bg: #E6E9F6;
  --radius-pill: 999px; --radius-card: 12px; --radius-input: 8px;
  --shadow: 0 1px 2px rgba(8, 27, 54, .06), 0 2px 8px rgba(8, 27, 54, .05);
  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #E8EBF2; --text-muted: #A3ABBD; --surface: #0F2240; --bg: #081B36;
    --surface-muted: #1A2E50; --border: #2A3E60; --brand-accent-text: #FF5A7A;
    --success-bg: #12382A; --success: #6FD8A2; --warning-bg: #3A2E10; --warning: #F2C462;
    --danger-bg: #42121E; --danger: #FF8FA3; --info-bg: #1C2A5E; --info: #AEB9F2;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--brand-accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; color: var(--brand-primary); margin: 0 0 .25rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) h1 { color: var(--text); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.subtle { color: var(--text-muted); margin: 0; }
.small { font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); font-weight: 600; }
.pos { color: var(--success); }
.warn { color: var(--warning); font-weight: 600; }
.danger-text { color: var(--danger) !important; }

/* Top bar */
.topbar { background: var(--brand-primary); color: var(--on-primary); display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.25rem; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--on-primary); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; }
.mainnav { display: flex; gap: .25rem; flex: 1; }
.mainnav a { color: var(--on-primary); padding: .45rem .8rem; border-radius: var(--radius-pill); font-weight: 500; }
.mainnav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.mainnav a[aria-current="page"] { background: rgba(255,255,255,.18); }
.topbar-tools { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.topbar-tools form { margin: 0; }
.site-switch select { background: rgba(255,255,255,.12); color: var(--on-primary); border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius-pill); padding: .3rem .6rem; }
.site-switch option { color: #081B36; }
.site-name { opacity: .9; }
.lang-switch { display: flex; gap: 2px; }
.lang-switch button { background: transparent; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: .2rem .35rem; font: inherit; font-size: .8rem; border-radius: 4px; }
.lang-switch button.active { opacity: 1; font-weight: 700; background: rgba(255,255,255,.15); }
.linkish { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; opacity: .9; }
.linkish:hover { opacity: 1; text-decoration: underline; }
.nav-toggle { display: none; background: none; border: 0; color: var(--on-primary); font-size: 1.4rem; cursor: pointer; margin-left: auto; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.crumb { margin: 0 0 .2rem; font-size: .85rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem 1.1rem; border-radius: var(--radius-pill); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; line-height: 1.2; white-space: nowrap; }
.btn-primary { background: var(--brand-accent); color: #fff; }
.btn-primary:hover { background: #D9103C; }
.btn-secondary { background: var(--surface); color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-secondary:hover { background: var(--info-bg); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-muted); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-small { padding: .3rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid rgba(42, 56, 132, .45); outline-offset: 2px; }

/* Cards & layout */
.card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-flush { padding: 0; overflow: hidden; }
.padded { padding: 1rem 1.25rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; }
.narrow { max-width: 640px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .15rem; color: var(--text); border-top: 4px solid var(--brand-primary); }
.kpi:hover { text-decoration: none; box-shadow: 0 2px 12px rgba(8,27,54,.12); }
.kpi-label { font-size: .82rem; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .8rem; color: var(--text-muted); }
.kpi-alert { border-top-color: var(--warning); }

/* Tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--surface-muted); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 600; background: var(--surface); }
.table th.num, .table td.num { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: var(--bg); }
.table tfoot th { font-size: .9rem; text-transform: none; color: var(--text); border-top: 2px solid var(--border); }
.table th:first-child, .table td:first-child { padding-left: 1.25rem; }
.table th:last-child, .table td:last-child { padding-right: 1.25rem; }
a.sort { color: inherit; }
.row-actions { text-align: right; }

/* Badges */
.badge { display: inline-block; padding: .12rem .6rem; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-neutral { background: var(--surface-muted); color: var(--text); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--surface-muted); color: var(--text-muted); }

/* Tabs & filters */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; color: var(--text-muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current] { color: var(--brand-primary); border-bottom-color: var(--brand-accent); font-weight: 600; }
.filters { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.filters label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--text-muted); }
.filters label.check { flex-direction: row; align-items: center; gap: .4rem; padding-bottom: .55rem; color: var(--text); font-size: .9rem; }
.filters input[type=search] { min-width: 260px; }

/* Forms */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-input); padding: .5rem .65rem; width: 100%; }
.filters input, .filters select { width: auto; }
textarea { resize: vertical; }
input[type=checkbox] { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem 1.25rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-size: .85rem; font-weight: 600; }
.field small, .stack small { color: var(--text-muted); font-size: .78rem; }
.field-wide { grid-column: 1 / -1; }
.field-check label { display: flex; align-items: center; gap: .5rem; font-weight: 500; padding-top: 1.6rem; }
.req { color: var(--brand-accent-text); }
.inline { display: flex; gap: .5rem; align-items: center; }
.errorlist { list-style: none; margin: .2rem 0 0; padding: 0; color: var(--danger); font-size: .8rem; }
.has-error input, .has-error select { border-color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.stack label { font-size: .82rem; font-weight: 600; margin-top: .3rem; }
.stack button { margin-top: .6rem; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: .75rem 0; border-top: 1px solid var(--border); }

/* Invoice line editor */
.lines-table td { padding: .4rem .35rem; vertical-align: top; }
.lines-table input, .lines-table select { padding: .4rem .45rem; }
.col-article { min-width: 210px; }
.col-desc { min-width: 220px; }
.col-qty input { width: 80px; text-align: right; }
.col-price input { width: 110px; text-align: right; }
.col-disc input { width: 70px; text-align: right; }
.col-unit select { width: 90px; }
.col-vat select { width: 82px; }
.col-net { padding-top: .85rem !important; font-weight: 600; }
.line-row.deleted { opacity: .4; }
.line-row.deleted input, .line-row.deleted select { text-decoration: line-through; }
.del { cursor: pointer; display: inline-flex; padding: .45rem; border-radius: 6px; color: var(--text-muted); }
.del:hover { background: var(--danger-bg); color: var(--danger); }
.del input { display: none; }

.totals { display: grid; grid-template-columns: auto auto; gap: .25rem 1.5rem; margin: 0; min-width: 280px; }
.totals dt { color: var(--text-muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; font-size: 1.1rem; color: var(--text); border-top: 2px solid var(--border); padding-top: .35rem; }

.meta-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; border-bottom: 1px solid var(--surface-muted); }
.meta-row .label { display: block; font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.pay-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--surface-muted); }
.pay-row.current { font-weight: 600; }
.pay-open { border-bottom: 0; font-size: 1.05rem; }
.notes { white-space: normal; color: var(--text); background: var(--bg); border-radius: 8px; margin: 0 1.25rem 1rem; }
.notes.internal { background: var(--warning-bg); }

/* Messages */
.messages { margin-bottom: 1rem; display: grid; gap: .5rem; }
.msg { padding: .7rem 1rem; border-radius: 10px; border-left: 4px solid; margin-bottom: .5rem; }
.msg-success { background: var(--success-bg); border-color: var(--success); }
.msg-error { background: var(--danger-bg); border-color: var(--danger); }
.msg-warning { background: var(--warning-bg); border-color: var(--warning); }
.msg-info { background: var(--info-bg); border-color: var(--info); }
.empty-inline { padding: 1.25rem; color: var(--text-muted); margin: 0; }
.empty { text-align: center; padding: 4rem 1rem; }

.pagination { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 1rem; }

/* Login */
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login-card { background: var(--surface); padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); width: min(400px, 100%); border-top: 6px solid var(--brand-primary); }
.login-card form { display: flex; flex-direction: column; gap: .4rem; }
.login-card label { font-size: .85rem; font-weight: 600; margin-top: .5rem; }
.login-card button.btn { margin-top: 1rem; }
.login-brand { font-weight: 700; color: var(--brand-primary); font-size: 1.3rem; margin-bottom: 1rem; }
.lang-switch-light { justify-content: center; margin-top: 1.25rem; }
.lang-switch-light button { color: var(--text-muted); }
.lang-switch-light button.active { color: var(--brand-primary); background: var(--info-bg); }

/* Responsive */
@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; flex-basis: 100%; flex-direction: column; }
  .mainnav.open { display: flex; }
  .topbar-tools { flex-basis: 100%; justify-content: space-between; flex-wrap: wrap; }
  .topbar { gap: .5rem; padding: .6rem 1rem; }
  .container { padding: 1rem 1rem 4rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi-value { font-size: 1.25rem; }
  .hide-sm { display: none; }
  .meta-row { grid-template-columns: 1fr 1fr; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 140px; }
  .filters input, .filters select { width: 100%; }
  .totals { min-width: 0; width: 100%; }
}

@media print {
  .topbar, .actions, .tabs, .filters, .no-print, .pagination, .messages { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* Audit history */
.history { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.history li { padding: .4rem 0; border-bottom: 1px dashed var(--surface-muted); display: grid; grid-template-columns: auto 1fr; gap: 0 .6rem; }
.history .when { color: var(--text-muted); white-space: nowrap; }
.history .what { font-weight: 600; }
.history .who { grid-column: 2; color: var(--text-muted); }
.history details { grid-column: 1 / -1; margin-top: .2rem; }
.history summary { cursor: pointer; color: var(--text-muted); font-size: .8rem; }
.history dl { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; margin: .3rem 0 0; }
.history dt { color: var(--text-muted); }
.history dd { margin: 0; word-break: break-word; }
.hash { font-size: .78rem; }
.field .label { font-size: .85rem; font-weight: 600; }

/* Headquarters */
.readonly-bar { background: var(--warning-bg); color: var(--text); border-bottom: 1px solid var(--border); padding: .55rem 1.25rem; font-size: .9rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.readonly-bar a { font-weight: 600; }
.mainnav a.nav-hq { border: 1px solid rgba(255,255,255,.35); }
.row-inactive td { opacity: .55; }
.inline-form { display: inline; margin: 0; }
.row-actions .btn + .btn, .row-actions .inline-form + .inline-form, .row-actions .inline-form + .btn { margin-left: .25rem; }
.credentials code { font-size: 1.05rem; }
.credentials .secret { background: var(--warning-bg); padding: .15rem .5rem; border-radius: 6px; user-select: all; }

/* Workshop */
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.wo-problem { white-space: pre-line; }
.status-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.status-buttons .btn { font-size: .82rem; padding: .35rem .8rem; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.timeline li { padding: .35rem 0 .35rem 1rem; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .7rem; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); }
.timeline .when { color: var(--text-muted); font-size: .78rem; display: block; }
.late { color: var(--danger); font-weight: 600; }
.roles dt { font-weight: 600; margin-top: .5rem; }
.roles dd { margin: 0; color: var(--text-muted); font-size: .85rem; }
.vehicle-box { border: 1px dashed var(--border); border-radius: 10px; padding: 1rem; margin-top: 1rem; }
.vehicle-box legend { font-weight: 600; font-size: .9rem; padding: 0 .4rem; }

/* Emails */
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-list li { border-bottom: 1px solid var(--surface-muted); padding: .6rem 1.25rem; }
.mail-list summary { cursor: pointer; display: grid; grid-template-columns: auto 1fr 2fr auto; gap: .75rem; align-items: center; }
.mail-list .when { color: var(--text-muted); font-size: .82rem; white-space: nowrap; }
.mail-list .mail-subject { font-weight: 600; }
.mail-body { white-space: pre-wrap; font-family: inherit; background: var(--bg); border-radius: 8px; padding: .75rem; font-size: .88rem; margin: .5rem 0 0; }
.mail-mini { font-size: .85rem; padding: .3rem 0; border-bottom: 1px dashed var(--surface-muted); }
.mail-mini summary { cursor: pointer; }
@media (max-width: 760px) { .mail-list summary { grid-template-columns: 1fr; gap: .2rem; } }

/* Login and other sign-in pages (brand layout) */
body.auth-page { background: var(--brand-primary); }
body.auth-page .container { max-width: none; padding: 0; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: clamp(2rem, 5vw, 4.5rem); display: flex; flex-direction: column; gap: 1.5rem;
  background: radial-gradient(1200px 600px at -10% 110%, rgba(244, 26, 73, .28), transparent 60%), linear-gradient(160deg, #2A3884 0%, #1d2866 55%, #081B36 100%); }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.5rem; letter-spacing: -.01em; }
.auth-mark { width: 42px; height: 42px; }
.auth-claim { font-size: clamp(1.5rem, 2.6vw, 2.3rem); line-height: 1.2; font-weight: 700; margin: auto 0 0; max-width: 22ch; color: #fff; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: 1rem; opacity: .92; }
.auth-points li { padding-left: 1.6rem; position: relative; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: .5em; width: .8rem; height: .8rem; border-radius: 50%; background: var(--brand-accent); }
.auth-wheels { width: min(320px, 70%); margin-top: auto; }
.auth-foot { margin: 0; font-size: .8rem; opacity: .6; letter-spacing: .05em; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; padding: 2rem 1.25rem; background: var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 16px; padding: 2rem; box-shadow: 0 10px 40px rgba(8, 27, 54, .18); border-top: 6px solid var(--brand-accent); }
.auth-card h1 { font-size: 1.45rem; margin-bottom: .35rem; }
.auth-card .subtle { margin-bottom: 1rem; }
.auth-form { display: flex; flex-direction: column; gap: .35rem; }
.auth-form label { font-size: .85rem; font-weight: 600; margin-top: .55rem; }
.auth-form .btn { margin-top: 1.1rem; padding: .7rem 1.1rem; }
.auth-form input:focus { border-color: var(--brand-primary); }
.auth-links { margin: 1rem 0 0; font-size: .9rem; text-align: center; }
.auth-lang button { color: var(--text-muted); }
.auth-lang button.active { color: var(--brand-primary); background: var(--info-bg); }
.otp-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 1.5rem 1.25rem 1.25rem; gap: .75rem; }
  .auth-claim { font-size: 1.15rem; margin: 0; }
  .auth-points, .auth-wheels, .auth-foot { display: none; }
  .auth-main { justify-content: flex-start; padding-top: 1.5rem; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-main { background: var(--bg); } }

/* Two-factor setup */
.twofa-bar { background: var(--info-bg); }
.setup-steps { padding-left: 1.2rem; display: grid; gap: 1rem; }
.qr { background: #fff; display: block; width: fit-content; padding: .5rem; border-radius: 10px; margin: .6rem 0; border: 1px solid var(--border); }
.qr svg { width: 200px; height: 200px; display: block; }
.secret-key { font-size: 1rem; letter-spacing: .08em; user-select: all; }
.setup-confirm { margin-top: .5rem; max-width: 320px; }
.setup-confirm .otp-input { font-size: 1.3rem; }
.codes { columns: 2; font-size: 1.1rem; line-height: 2; padding-left: 1.4rem; }

/* Test environment marker */
.env-ribbon { background: repeating-linear-gradient(45deg, #F2A900, #F2A900 14px, #081B36 14px, #081B36 28px); color: #fff; text-align: center; font-weight: 700; font-size: .8rem; letter-spacing: .06em; padding: .3rem; text-shadow: 0 1px 2px #000; }
.check-inline { display: flex !important; align-items: center; gap: .5rem; font-weight: 500 !important; }
.check-inline input { width: auto; }

/* Footer and legal pages */
.site-footer { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; padding: 1.25rem 1rem 2rem; font-size: .8rem; color: var(--text-muted); }
.site-footer a { color: var(--text-muted); }
.auth-legal { margin: 0; font-size: .8rem; }
.auth-legal a { color: var(--text-muted); }
.legal { max-width: 860px; margin: 0 auto; }
.legal-brand { font-weight: 700; font-size: 1.2rem; margin: 0 0 1rem; }
.legal-brand a { color: var(--brand-primary); }
.legal-text { line-height: 1.65; }
.legal-text h1 { font-size: 1.6rem; }
.legal-text h2 { font-size: 1.1rem; margin-top: 1.6rem; color: var(--brand-primary); }
.legal-text .table { margin: .5rem 0; font-size: .9rem; }
.legal-text .table th:first-child, .legal-text .table td:first-child { padding-left: .5rem; }
.legal-missing { background: #FFE9A8; color: #5A3E00; padding: .05rem .35rem; border-radius: 4px; font-weight: 600; }
.legal-de { color: inherit; text-decoration: underline; }

/* Top bar on laptop widths: keep everything on one line */
@media (min-width: 761px) and (max-width: 1440px) {
  .topbar { gap: .6rem; padding: .6rem 1rem; flex-wrap: nowrap; }
  .brand { font-size: 1.05rem; white-space: nowrap; }
  .brand-mark { width: 28px; height: 28px; }
  .mainnav { gap: 0; min-width: 0; }
  .mainnav a { padding: .4rem .55rem; font-size: .9rem; white-space: nowrap; }
  .topbar-tools { gap: .5rem; font-size: .8rem; white-space: nowrap; }
  .site-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .site-name, .lang-switch { display: none; }
}
