/* Integrations-Cockpit Bern · palette taken from the Canton Bern flag (red, gold, bear black),
   the Swiss cross and the black-and-white Stadt Bern mark. System fonts only; no external assets. */
:root {
  color-scheme: light;
  --bear: #16110f;
  --bear-2: #241b18;
  --bear-3: #3a2d28;
  --red: #d52b1e;
  --red-strong: #b3261e;
  --red-deep: #7c1913;
  --coral: #e0503f;
  --gold: #f9d548;
  --gold-soft: #fff4c7;
  --gold-text: #7a5b00;
  --paper: #f6f3ee;
  --paper-2: #efeae3;
  --panel: #ffffff;
  --ink: #1d1714;
  --muted: #6d625b;
  --line: #e9e2d9;
  --line-strong: #d9cfc4;
  --ring: #d52b1e55;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px #2a18100d, 0 6px 18px -8px #2a181024;
  --shadow-lift: 0 2px 4px #2a181012, 0 16px 32px -12px #2a181036;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red-strong); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 780; }
h2 { font-size: 1.12rem; margin: 0 0 1rem; letter-spacing: -.02em; font-weight: 720; }
h3 { font-size: 1rem; margin-bottom: .85rem; font-weight: 720; letter-spacing: -.01em; }
p { line-height: 1.55; }
.mono, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; overflow-wrap: anywhere; }
code { background: var(--paper-2); padding: .08rem .32rem; border-radius: 5px; }
.skip-link { position: fixed; top: .6rem; left: .6rem; z-index: 50; padding: .7rem 1rem; background: var(--panel); border-radius: 8px; box-shadow: var(--shadow-lift); }
.skip-link:not(:focus) { clip-path: inset(50%); }

/* ── Shell ─────────────────────────────────────────── */
.dashboard { display: grid; grid-template-columns: 268px minmax(0, 1fr); }
aside {
  position: sticky; top: 0; height: 100vh; overflow: hidden auto; isolation: isolate;
  display: flex; flex-direction: column; padding: 1.4rem 1rem 1.1rem;
  background: linear-gradient(175deg, var(--bear) 0%, var(--bear-2) 100%); color: #e9e1dc;
}
/* The diagonal gold band of the Bernese flag, faint behind the navigation. */
aside::before {
  content: ""; position: absolute; z-index: -1; left: -40%; bottom: 14%; width: 190%; height: 92px;
  background: linear-gradient(90deg, #f9d54800, #f9d5481c 30%, #f9d5480d 80%, #f9d54800);
  transform: rotate(32deg); pointer-events: none;
}
.brand { display: flex; align-items: center; gap: .75rem; padding: .2rem .35rem; text-decoration: none; font-weight: 760; font-size: 1rem; letter-spacing: -.02em; line-height: 1.15; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { width: 2.9rem; height: 2.9rem; padding: .28rem .5rem; object-fit: contain; background: #fff; border-radius: 10px; box-shadow: 0 0 0 1px #ffffff26, 0 6px 14px -4px #000a; }
.brand small { display: block; margin-top: .22rem; color: var(--gold); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 760; }
nav { display: grid; gap: .25rem; margin-top: 2rem; }
nav a {
  position: relative; display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 10px;
  color: #cbbfb8; text-decoration: none; font-size: .92rem; font-weight: 560; transition: background .15s, color .15s;
}
nav a:hover { color: #fff; background: #ffffff0f; }
nav a[aria-current=page] { color: #fff; font-weight: 700; background: linear-gradient(90deg, #d52b1e40, #d52b1e14); }
nav a[aria-current=page]::before { content: ""; position: absolute; left: -1rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--red); }
.nav-icon { width: 1.2rem; height: 1.2rem; flex: none; color: #a8998f; }
nav a:hover .nav-icon { color: #fff; }
nav a[aria-current=page] .nav-icon { color: var(--gold); }
.aside-bottom { margin-top: auto; padding-top: 1rem; border-top: 1px solid #ffffff17; font-size: .78rem; color: #b5a79f; }
.role-label { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .7rem; padding: .3rem .65rem; border-radius: 99px; background: #ffffff12; color: #f3ebe6; font-weight: 650; }
.role-label::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px #f9d54833; }
.aside-bottom form { display: grid; gap: .5rem; align-items: stretch; margin-bottom: .2rem; }
.aside-bottom label { display: grid; gap: .3rem; font-size: .75rem; color: #b5a79f; font-weight: 600; }
.aside-bottom select { width: 100%; background: #ffffff10; color: #fff; border-color: #ffffff26; }
.aside-bottom select option { color: var(--ink); }
.aside-bottom button { justify-content: center; background: #ffffff14; border-color: #ffffff2b; box-shadow: none; }
.aside-bottom button:hover { background: #ffffff24; }
.aside-marks { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; padding: .2rem .35rem; opacity: .8; }
.aside-marks img:first-child { height: 24px; border-radius: 4px; }
.aside-marks img + img { height: 24px; }

.workspace { min-width: 0; }
header {
  position: sticky; top: 0; z-index: 20; min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .7rem clamp(1rem, 3vw, 2.6rem); background: #fffdfbd9; backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
header::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--red) 0 62%, var(--gold) 62% 80%, var(--red) 80%); }
.header-context { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.snapshot { display: inline-flex; align-items: center; gap: .45rem; padding: .38rem .75rem; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.snapshot strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.snapshot .icon { width: 15px; height: 15px; color: var(--red-strong); }
.header-actions { display: flex; gap: .55rem; align-items: center; margin-left: auto; }
.header-actions form { display: block; }
.languages { display: flex; gap: .15rem; padding: .2rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 99px; }
.languages a { padding: .32rem .62rem; border-radius: 99px; font-size: .72rem; font-weight: 760; letter-spacing: .04em; text-decoration: none; color: var(--muted); }
.languages a:hover { color: var(--ink); }
.languages a[aria-current=page] { background: var(--bear); color: #fff; }
.swiss-flag { position: relative; display: inline-block; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 4px; background: var(--red); box-shadow: 0 1px 2px #0002; }
.swiss-flag::before, .swiss-flag::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; }
.swiss-flag::before { width: 13px; height: 4.2px; }
.swiss-flag::after { width: 4.2px; height: 13px; }

main { max-width: 1420px; margin: 0 auto; padding: clamp(1.1rem, 2.6vw, 2.4rem) clamp(1rem, 3vw, 2.6rem) 2rem; }
main > .heading { margin-bottom: 1.5rem; }
.heading::before { content: ""; display: block; width: 52px; height: 6px; margin-bottom: .9rem; border-radius: 99px; background: linear-gradient(90deg, var(--red) 0 58%, var(--gold) 58%); }
.heading p { margin-top: .55rem; color: var(--muted); font-size: 1rem; }

/* ── Hero ──────────────────────────────────────────── */
.hero, .login-hero { position: relative; isolation: isolate; overflow: hidden; color: #fff; border-radius: 20px; background: var(--red-deep); box-shadow: var(--shadow-lift); }
.hero { display: flex; align-items: flex-end; min-height: 250px; margin-bottom: 1.4rem; padding: clamp(1.4rem, 3.5vw, 2.8rem); }
.bern-image { position: absolute; z-index: -3; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero::before, .login-hero::before { content: ""; position: absolute; inset: 0; z-index: -2; }
.hero::before { background: linear-gradient(100deg, #7c1913 0%, #a01f17f2 34%, #b3261eb0 56%, #16110f30 100%); }
/* Gold diagonal echoing the Bernese band. */
.hero::after, .login-hero::after { content: ""; position: absolute; z-index: -1; right: -12%; top: -40%; width: 46%; height: 180%; transform: rotate(32deg); background: linear-gradient(90deg, #f9d54800, #f9d5482e 40%, #f9d54814); pointer-events: none; }
.hero .heading { margin: 0; }
.hero .heading::before { background: linear-gradient(90deg, #fff 0 58%, var(--gold) 58%); }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); text-shadow: 0 2px 18px #0003; }
.hero .heading p, .login-hero p { color: #fff3ea; font-size: 1.05rem; max-width: 46ch; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem; padding: .3rem .7rem; border-radius: 99px; background: #16110f59; border: 1px solid #f9d54866; color: var(--gold) !important; font-size: .7rem !important; letter-spacing: .14em; font-weight: 760; text-transform: uppercase; backdrop-filter: blur(6px); }

/* ── Cards & KPIs ──────────────────────────────────── */
.kpis, .two, .three { display: grid; gap: 1rem; margin-bottom: 1rem; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.2rem; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi, .panel, .login-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: clamp(1rem, 2vw, 1.6rem); margin-bottom: 1rem; }
.two > .panel, .three > .panel { margin-bottom: 0; }
.panel > p { margin-bottom: .85rem; color: #463c36; }
.panel > p:last-child { margin-bottom: 0; }
.kpi { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .9rem; align-items: center; padding: 1.15rem 1.25rem; transition: transform .18s, box-shadow .18s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.kpi::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--kpi-accent, var(--line-strong)); }
.kpi-icon { grid-row: span 2; width: 2.9rem; height: 2.9rem; padding: .68rem; border-radius: 12px; color: var(--kpi-accent, var(--ink)); background: var(--kpi-tint, var(--paper-2)); }
.kpi span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.kpi strong { display: block; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 780; letter-spacing: -.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-people { --kpi-accent: var(--bear-3); --kpi-tint: #efe9e4; }
.kpi-homes { --kpi-accent: #b38600; --kpi-tint: var(--gold-soft); }
.kpi-met { --kpi-accent: #1f7a4a; --kpi-tint: #e1f3e8; }
.kpi-follow { --kpi-accent: var(--red-strong); --kpi-tint: #fde4e0; }

main > h2 { margin: 1.6rem 0 .9rem; font-size: 1.3rem; }
.goal-card { position: relative; overflow: hidden; }
.goal-card .goal-number { position: absolute; right: 1rem; top: .2rem; font-size: 4.6rem; font-weight: 800; letter-spacing: -.06em; line-height: 1; color: var(--paper-2); pointer-events: none; }
.goal-card h3, .goal-card .state-bar, .goal-card .breakdown { position: relative; }
.goal-card h3 { font-size: 1.05rem; padding-right: 3.2rem; }
.state-bar { display: block; width: 100%; height: 10px; margin: .2rem 0 1rem; border-radius: 99px; overflow: hidden; background: var(--paper-2); }
.seg-achieved { fill: #2a9160; } .seg-late { fill: #e08a2c; } .seg-ontrack { fill: #f2c230; }
.seg-risk { fill: #e85a3c; } .seg-overdue { fill: var(--red-strong); } .seg-review { fill: #7c5cc4; } .seg-na { fill: #cfc6be; }
.breakdown { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.breakdown li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.breakdown strong { font-variant-numeric: tabular-nums; font-size: 1.02rem; }

/* ── Status badges: colour, text and a symbol ─────── */
.badge { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; padding: .26rem .6rem .26rem .3rem; border-radius: 99px; font-size: .74rem; font-weight: 700; color: #554c46; background: #efebe7; border: 1px solid #0000000a; }
.badge i { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: currentColor; font-style: normal; }
.badge i::before { content: "–"; color: #fff; font-size: .68rem; font-weight: 900; line-height: 1; }
.badge.achieved { background: #e1f3e8; color: #1c6b41; } .badge.achieved i::before { content: "✓"; }
.badge.ontrack { background: var(--gold-soft); color: var(--gold-text); } .badge.ontrack i::before { content: "→"; }
.badge.late { background: #fde9d6; color: #8f4a0c; } .badge.late i::before { content: "✓"; }
.badge.risk { background: #fde4e0; color: #a3271a; } .badge.risk i::before { content: "!"; }
.badge.overdue { background: var(--red-strong); color: #fff; } .badge.overdue i { background: #fff; } .badge.overdue i::before { content: "!"; color: var(--red-strong); }
.badge.review { background: #ece6f8; color: #553a92; } .badge.review i::before { content: "?"; }

/* ── Tables ────────────────────────────────────────── */
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: .72rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #faf7f3; color: var(--muted); font-size: .72rem; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
td { white-space: nowrap; }
td:last-child:not(:first-child) { white-space: normal; min-width: 12rem; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fdf8f1; }
tr:last-child td { border-bottom: 0; }
.panel > .tablewrap { margin-bottom: .9rem; }
.panel > .tablewrap:last-child { margin-bottom: 0; }
.case-link { font-weight: 750; color: var(--red-strong); text-decoration: none; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .84rem; letter-spacing: -.01em; }
.case-link:hover { text-decoration: underline; }
.result-count { margin: .3rem 0 .9rem; color: var(--muted); font-size: .88rem; }

/* ── Forms, buttons, chips ─────────────────────────── */
form { display: flex; align-items: flex-end; gap: .7rem; flex-wrap: wrap; }
form label { display: grid; gap: .35rem; min-width: 0; font-size: .8rem; font-weight: 680; color: #4a403a; }
input, select { min-height: 2.5rem; max-width: 100%; padding: .5rem .75rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #bfb1a4; }
input:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px #d52b1e1f; }
input[type=file] { padding: .4rem .5rem; }
input[type=file]::file-selector-button { margin-right: .7rem; padding: .35rem .7rem; border: 0; border-radius: 7px; background: var(--paper-2); color: var(--ink); font-weight: 650; cursor: pointer; }
button, .button, .chip, .pagination a {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.5rem; padding: .5rem 1rem;
  border-radius: 10px; border: 1px solid transparent; font-size: .84rem; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
button { background: linear-gradient(180deg, var(--red) 0%, var(--red-strong) 100%); color: #fff; box-shadow: 0 1px 0 #ffffff33 inset, 0 2px 6px -2px #b3261e80; }
button:hover { background: var(--red-deep); color: #fff; }
button:active, .button:active, .chip:active { transform: translateY(1px); }
.button { background: var(--bear); color: #fff; }
.button:hover { background: var(--bear-3); color: #fff; }
.chip, .pagination a, header button { background: var(--panel); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.chip:hover, .pagination a:hover, header button:hover { background: var(--paper-2); color: var(--ink); border-color: #c9bcb0; }
.chip[aria-current=page] { background: var(--bear); color: #fff; border-color: var(--bear); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.chips .chip { min-height: 2.15rem; padding: .4rem .85rem; border-radius: 99px; font-size: .8rem; }
.inline { margin-bottom: .6rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.inline label input { min-width: 14rem; }
.back-link { margin-bottom: 1.1rem; }
.back-link::before { content: "←"; }
.pagination { display: flex; gap: .5rem; margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: .8rem; }
.actions > form { align-content: flex-start; flex: 1 1 300px; padding: .9rem; background: #faf7f3; border: 1px solid var(--line); border-radius: 12px; }
.actions > form label { flex: 1 1 160px; }
.actions > form select, .actions > form input { width: 100%; }
.actions > form[action="/seed-invalid"] button { background: var(--panel); color: var(--red-strong); border-color: #e8b9b2; box-shadow: none; }
.actions > form[action="/seed-invalid"] button:hover { background: #fdf0ee; }
.actions > .button { align-self: center; }
.actions > .button::before { content: "↓"; font-weight: 900; }
.pricing input { width: 7.5rem; }
.pricing .tablewrap { width: 100%; }
.feedback { margin-bottom: 1rem; padding: .9rem 1.1rem; border: 1px solid #f0c6bf; border-left: 4px solid var(--red); border-radius: 10px; background: #fdf1ee; color: #5c1d16; }
.feedback ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.feedback ul:empty { display: none; }
details { margin-top: .8rem; }
summary { cursor: pointer; font-weight: 650; color: var(--red-strong); }
summary:hover { color: var(--red-deep); }

/* ── Definition lists (case facts, coverage) ───────── */
dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0 1rem; margin: .4rem 0 0; }
dt, dd { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
dt { color: var(--muted); font-size: .82rem; }
dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
dl > :nth-last-child(-n+2) { border-bottom: 0; }
.three .panel > .badge { margin-bottom: .55rem; }
.reading dl { grid-template-columns: minmax(10rem, auto) 1fr; }
.reading dd { text-align: left; }
.source { color: var(--muted); font-size: .82rem; }

/* ── Forecast ──────────────────────────────────────── */
.forecast-value { display: block; margin: .2rem 0 .6rem; font-size: 3.4rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--red-strong); }
.forecast-value small { font-size: 1rem; font-weight: 650; letter-spacing: 0; color: var(--muted); }
.series { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .4rem; margin: 1rem 0; }
meter { width: 100%; height: 10px; border-radius: 99px; }
meter::-webkit-meter-bar { background: var(--paper-2); border: 0; border-radius: 99px; height: 10px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: linear-gradient(90deg, var(--red), var(--coral)); border-radius: 99px; }
meter::-moz-meter-bar { background: linear-gradient(90deg, var(--red), var(--coral)); border-radius: 99px; }

/* ── Institutional marks ───────────────────────────── */
.institutions { margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.institutions > p { color: var(--muted); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; }
.institutions > p.independence { margin-top: .2rem; letter-spacing: 0; text-transform: none; font-weight: 500; }
.institutions-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin: .7rem 0; }
.mark { display: inline-flex; align-items: center; gap: .6rem; height: 58px; padding: 0 .9rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
a.mark:hover { border-color: var(--red); transform: translateY(-1px); color: inherit; }
.mark strong, .mark small { display: block; }
.mark strong { font-size: .86rem; letter-spacing: .01em; }
.mark small { font-size: .66rem; color: var(--muted); }
.city-mark img { height: 38px; width: auto; }
.canton-mark img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.sem-mark img { width: 24px; height: 28px; }
.photo-credit { margin: .6rem 0 0; font-size: .72rem; color: var(--muted); }

/* ── Sign-in ───────────────────────────────────────── */
body.signin { background: radial-gradient(1200px 600px at 85% -10%, #f9d54826, transparent 60%), radial-gradient(900px 500px at -10% 110%, #d52b1e1a, transparent 60%), var(--paper); }
.signin header { background: #fffdfb99; }
.signin main { max-width: 1120px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.2rem; align-items: stretch; padding-top: min(6vh, 3.2rem); }
.login-hero { display: flex; align-items: flex-end; min-height: 460px; padding: clamp(1.5rem, 4vw, 3rem); }
.login-hero::before { background: linear-gradient(0deg, #5e130ef7 6%, #8d1c15c4 45%, #16110f1f 92%); }
.login-hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); letter-spacing: -.055em; text-shadow: 0 2px 22px #0004; }
.login-hero p:last-child { margin-top: 1rem; }
.login-signature { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.login-signature .eyebrow { margin: 0; }
.login-signature .brand-mark { width: 3.2rem; height: 3.2rem; border-radius: 12px; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.4rem, 3.6vw, 3rem); border-radius: 20px; box-shadow: var(--shadow-lift); }
.login-logo { width: 190px; height: auto; margin-bottom: 1.8rem; }
.login-card .heading { margin-bottom: 1.2rem; }
.login-card h1 { font-size: 2.1rem; }
.login-card form { display: grid; gap: .9rem; }
.login-card input { width: 100%; min-height: 2.9rem; }
.login-card button { min-height: 3rem; margin-top: .3rem; font-size: .95rem; }
.signin .institutions, .signin .photo-credit { grid-column: 1 / -1; }
.signin .institutions { margin-top: .4rem; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1100px) {
  .dashboard { grid-template-columns: 224px minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dashboard { display: block; }
  aside { position: static; height: auto; padding: .8rem .8rem .7rem; overflow: visible; }
  aside::before { display: none; }
  .brand { font-size: .92rem; }
  .brand-mark { width: 2.3rem; height: 2.3rem; padding: .22rem .4rem; }
  nav { display: flex; gap: .3rem; margin: .8rem -.8rem 0; padding: 0 .8rem .2rem; overflow-x: auto; scrollbar-width: none; }
  nav a { flex: none; padding: .5rem .75rem; border-radius: 99px; background: #ffffff0d; font-size: .84rem; white-space: nowrap; }
  nav a[aria-current=page] { background: var(--red); }
  nav a[aria-current=page]::before { display: none; }
  nav a[aria-current=page] .nav-icon { color: #fff; }
  .aside-bottom { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-top: .7rem; padding-top: .7rem; }
  .role-label { margin: 0; }
  .aside-bottom form { display: flex; flex: 1 1 220px; align-items: end; }
  .aside-bottom label { flex: 1; }
  .aside-marks { display: none; }
  header { position: static; flex-wrap: wrap; }
  .two, .signin main { grid-template-columns: 1fr; }
  .hero { min-height: 210px; }
  .hero::before { background: linear-gradient(100deg, #7c1913f5, #a01f17d9 60%, #b3261e99); }
  .kpi { padding: .9rem; column-gap: .65rem; }
  .kpi-icon { width: 2.3rem; height: 2.3rem; padding: .5rem; }
  .login-hero { min-height: 260px; }
  .signin main { padding-top: 1rem; }
  .inline label, .inline label input { width: 100%; min-width: 0; flex: 1 1 100%; }
  .actions > form { flex-basis: 100%; }
  .mark { height: 50px; }
  .city-mark img { height: 32px; }
}
@media (max-width: 420px) {
  .kpis { gap: .6rem; }
  .kpi strong { font-size: 1.6rem; }
  .goal-card .goal-number { font-size: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
.panel > form + form, .panel > form + .tablewrap, .panel > .tablewrap + form { margin-top: .9rem; }

/* ── Help "!" buttons (details/summary, no script) ── */
.tip { position: relative; display: inline-block; vertical-align: super; margin: 0 0 0 -.1rem; flex: none; line-height: 0; }
.tip > summary { list-style: none; display: grid; place-items: center; width: .95rem; height: .95rem; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid currentColor; font: italic 700 .6rem/1 Georgia, "Times New Roman", serif;
  opacity: .45; transition: opacity .15s, background .15s, color .15s; }
.tip > summary::-webkit-details-marker { display: none; }
.tip > summary:hover, .tip > summary:focus-visible { opacity: 1; }
.tip[open] > summary { opacity: 1; background: var(--bear); border-color: var(--bear); color: #fff; }
.tip-body { position: absolute; z-index: 40; top: calc(100% + .55rem); left: 50%; transform: translateX(-50%); width: min(290px, 78vw);
  padding: .75rem .85rem; border-radius: 12px; background: var(--bear); color: #f6efe9; font-size: .8rem; font-weight: 500; line-height: 1.5;
  text-align: left; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-lift); white-space: normal; }
.tip-body::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; background: var(--bear); transform: translateX(-50%) rotate(45deg); }
form .tip { align-self: center; }
header .tip-body { left: auto; right: -1rem; transform: none; }
header .tip-body::before { left: auto; right: 1.3rem; }
.nav-row { display: flex; align-items: center; gap: .35rem; }
.nav-row > a { flex: 1; min-width: 0; }
aside .tip > summary { color: #fff; opacity: .3; }
aside .tip > summary:hover, aside .tip[open] > summary { opacity: .9; background: transparent; border-color: #fff; color: #fff; }
aside .tip-body { left: auto; right: 0; transform: none; width: 210px; background: #fff; color: var(--ink); }
aside .tip-body::before { left: auto; right: .35rem; transform: rotate(45deg); background: #fff; }
.section-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .2rem; }
.section-head h2 { margin-bottom: .6rem; }
main > .section-head { margin-top: 1.4rem; }
.button-row, .back-row { display: inline-flex; align-items: center; gap: .5rem; }
.back-row { display: flex; margin-bottom: 1rem; }
.back-row .back-link { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Traffic lights ───────────────────────────────── */
.lights { display: inline-flex; gap: .3rem; }
.light { display: inline-grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 50%; font-style: normal; font-size: .72rem; font-weight: 900; color: #fff; background: #cfc6be; box-shadow: inset 0 -2px 0 #0000001f; }
.light i { font-style: normal; line-height: 1; }
.light.achieved { background: #2a9160; }
.light.ontrack { background: #f2c230; color: #4a3600; }
.light.risk { background: #e85a3c; }
.light.overdue, .light.late { background: var(--red-strong); }
.light.late { box-shadow: inset 0 0 0 3px #f6b48d; }
.light.review { background: #7c5cc4; }
.light.na { background: #d9d1c9; color: #6d625b; }
.legend { margin: .2rem 0 .8rem; font-size: .8rem; color: var(--muted); }
.when { display: grid; line-height: 1.25; }
.when strong { font-variant-numeric: tabular-nums; }
.when small { color: var(--muted); font-size: .74rem; }
td .lights { white-space: nowrap; }

/* ── This week ────────────────────────────────────── */
.week { border-top: 4px solid var(--red); }
.week-list { list-style: none; counter-reset: week; margin: .8rem 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .7rem; }
.week-list li { counter-increment: week; position: relative; display: grid; gap: .45rem; align-content: start; padding: .85rem .95rem .85rem 2.6rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fffdfa; }
.week-list li::before { content: counter(week); position: absolute; left: .8rem; top: .85rem; display: grid; place-items: center; width: 1.3rem; height: 1.3rem;
  border-radius: 50%; background: var(--bear); color: #fff; font-size: .72rem; font-weight: 800; }
.week-list p { margin: 0; font-size: .88rem; line-height: 1.45; color: var(--ink); }
.week-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.worker { margin-left: auto; font-size: .76rem; color: var(--muted); }

/* ── Case page ────────────────────────────────────── */
.case-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.case-summary div { padding: .7rem .9rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.case-summary span { display: block; font-size: .74rem; color: var(--muted); }
.case-summary strong { font-size: .98rem; }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; margin-bottom: 1rem; padding: 1rem 1.2rem;
  border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line-strong); }
.callout.urgent { background: #fdf0ee; border-color: #f0c6bf; box-shadow: inset 4px 0 0 var(--red); }
.eyebrow-dark { width: 100%; margin: 0; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 760; color: var(--red-strong); }
.callout-text { flex: 1 1 320px; margin: 0; font-size: 1.05rem; font-weight: 650; }
.goal-detail .reason { margin: .5rem 0 .8rem; color: var(--muted); font-size: .88rem; }
.explain { margin-bottom: 1rem; padding: .8rem .9rem; border-radius: 10px; background: #faf7f3; border: 1px solid var(--line); }
.explain h3, .goal-detail > h3 { margin-bottom: .35rem; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.explain p { margin: 0; font-size: .92rem; }
.evidence { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .45rem; }
.evidence li { padding: .55rem .7rem; border-left: 3px solid var(--gold); background: #fffdf6; border-radius: 0 8px 8px 0; font-size: .84rem; overflow-wrap: anywhere; }
.source-tag { display: block; margin-bottom: .15rem; font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); font-size: .86rem; }

@media (max-width: 760px) {
  .tip-body, aside .tip-body, header .tip-body { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; transform: none; background: var(--bear); color: #f6efe9; }
  .tip-body::before { display: none; }
  nav .nav-row { flex: none; }
  nav .nav-row .tip { display: none; }
}

/* ── Management: targets and group analysis ───────── */
.targets h3 { margin: 1.1rem 0 .6rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.targets .state-bar { width: 120px; margin: 0; }
.targets tbody tr:last-child td { background: #faf7f3; border-top: 2px solid var(--line-strong); }
.rate-bar { display: block; width: 160px; height: 14px; }
.rate-bar .track { fill: var(--paper-2); }
.rate-bar .rate { fill: var(--red-strong); }
.rate-bar .band { fill: none; stroke: var(--bear); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.insight { margin: .2rem 0 .7rem; padding: .85rem 1rem; border-radius: 12px; background: var(--gold-soft); border: 1px solid #f1dc8c; font-size: .95rem; font-weight: 560; color: #3d2e00; }
.targets th { white-space: normal; vertical-align: bottom; min-width: 4.5rem; }
.targets .state-bar { width: 90px; }
.targets td:nth-child(6) { color: var(--red-strong); font-size: 1rem; }

/* ── Planning, help and data protection ───────── */
.section-head .jump { margin: 0; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .7rem; margin: 1rem 0; }
.figure { display: grid; gap: .3rem; align-content: start; padding: .9rem 1rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.figure strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--red-strong); }
.figure span { font-size: .84rem; font-weight: 600; color: var(--muted); line-height: 1.35; }
.panel[id] { scroll-margin-top: 5rem; }
.panel > p + p, .panel > p + .figures, .panel > .callout { margin-top: .7rem; }
.panel > details { margin-top: .4rem; }
.panel h3 { margin: 1.2rem 0 .5rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#payments .callout { margin: 1rem 0; }
#payments tbody tr:last-child td { background: #faf7f3; border-top: 2px solid var(--line-strong); }
.pv-card { display: grid; gap: .55rem; align-content: start; padding: 1.25rem; }
.pv-card .kpi-icon { color: var(--red-strong); background: #fdf0ee; }
.pv-card h2 { font-size: 1.05rem; }
.pv-card p { color: var(--muted); line-height: 1.5; }
.flow { list-style: none; counter-reset: flow; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .7rem; margin: .9rem 0 0; padding: 0; }
.flow li { counter-increment: flow; position: relative; padding: 2.6rem .95rem .95rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); font-size: .9rem; line-height: 1.45; font-weight: 560; }
.flow li::before { content: counter(flow); position: absolute; left: .95rem; top: .85rem; display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--bear); color: var(--gold); font-size: .75rem; font-weight: 800; }
.access { display: inline-block; padding: .2rem .55rem; border-radius: 99px; font-size: .8rem; font-weight: 650; }
.access.cell_all { background: #e3f3ea; color: #1d6b45; }
.access.cell_own { background: var(--gold-soft); color: var(--gold-text); }
.access.cell_sums { background: #ece6f8; color: #57409a; }
.access.cell_no { background: var(--paper-2); color: var(--muted); }
.plain { margin: .7rem 0 0; padding-left: 1.1rem; display: grid; gap: .55rem; line-height: 1.5; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .8rem; margin: .9rem 0 0; padding: 0; }
.steps li { counter-increment: step; position: relative; display: grid; gap: .5rem; align-content: start; padding: 1rem 1.05rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.steps li::after { content: counter(step); position: absolute; right: 1rem; top: .8rem; font-size: 1.6rem; font-weight: 800; color: var(--line-strong); }
.steps h3 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.steps h3 .nav-icon { width: 1.2rem; height: 1.2rem; color: var(--red-strong); }
.steps p { font-size: .9rem; line-height: 1.5; color: var(--muted); }
.steps a { font-weight: 700; color: var(--red-strong); text-decoration: none; }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .9rem 1.4rem; margin: .9rem 0 0; }
.glossary dt { font-weight: 750; margin-bottom: .25rem; }
.glossary dd { margin: 0; color: var(--muted); line-height: 1.5; font-size: .92rem; }
.glossary dt, .glossary dd { padding: 0; border: 0; text-align: left; font-variant-numeric: normal; }
.glossary dt { color: var(--ink); font-size: .95rem; }
.glossary > div { padding-bottom: .9rem; border-bottom: 1px dashed var(--line); }
.pricing th { white-space: normal; vertical-align: bottom; }
.pricing td:last-child { white-space: nowrap; }
.pricing input { width: 6.5rem; }
#arrivals .two > div { min-width: 0; }
#arrivals .two { margin-top: .4rem; }
@media (max-width: 760px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure strong { font-size: 1.5rem; }
}
main > .tablewrap td:nth-child(3) { white-space: normal; min-width: 18rem; }

/* ── AI forecast, contact and privacy shield ───────── */
.ai-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: linear-gradient(120deg, #5b3fd0, #b3261e); }
.ai-panel { border-color: #d9cff5; box-shadow: inset 4px 0 0 #6d4fd8, var(--shadow); }
.two.assist { align-items: start; }
.two.assist > .panel { margin-bottom: 0; }
.pred-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem 1rem; margin: .8rem 0 .4rem; }
.pred-figure strong { font-size: 3rem; font-weight: 850; letter-spacing: -.05em; line-height: 1; }
.pred-figure strong.high { color: #1d6b45; }
.pred-figure strong.mid { color: var(--gold-text); }
.pred-figure strong.low { color: var(--red-strong); }
.pred-figure span { color: var(--muted); font-size: .88rem; }
.pred-bar { display: block; width: 100%; height: 10px; margin-bottom: .8rem; }
.pred-bar .track { fill: var(--paper-2); }
.pred-bar .fill.high { fill: #2a9160; }
.pred-bar .fill.mid { fill: #e2b322; }
.pred-bar .fill.low { fill: var(--red); }
.pred-bar .base { fill: var(--bear); }
.pred-scenario { margin: .3rem 0 .6rem; padding: .6rem .8rem; border-radius: 10px; background: #efeafc; color: #3f2c8f; font-weight: 650; }
.pred-factors { list-style: none; margin: .4rem 0 .7rem; padding: 0; display: grid; gap: .35rem; }
.pred-factors li { display: flex; align-items: baseline; gap: .5rem; font-size: .92rem; }
.pred-factors li span { font-size: .7rem; }
.pred-factors li.up span, .pred-factors li.up em { color: #1d6b45; }
.pred-factors li.down span, .pred-factors li.down em { color: var(--red-strong); }
.pred-factors em { font-style: normal; font-weight: 700; font-size: .8rem; }
.legend.caution { color: var(--red-strong); font-weight: 650; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .8rem 0 1rem; }
.button.call { background: #1d6b45; border-color: #1d6b45; }
.contact-mail { font-weight: 650; overflow-wrap: anywhere; }
.button .icon, .chip .icon { width: 1rem; height: 1rem; margin-right: .35rem; vertical-align: -.15rem; }
.mail-template { margin: .4rem 0 .8rem; }
.mail-template h3 { margin: 0 0 .45rem; font-size: .95rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.mail-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .4rem; }
.button.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.mail-body, .shield-text { white-space: pre-wrap; margin: .5rem 0 0; padding: .8rem .9rem; border-radius: 10px; background: var(--paper); border: 1px solid var(--line);
  font: .86rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.more-templates { margin-top: .4rem; }
.shield { box-shadow: inset 4px 0 0 #1d6b45, var(--shadow); }
.shield h2 { display: flex; align-items: center; gap: .45rem; }
.shield h2 .icon { width: 1.3rem; height: 1.3rem; color: #1d6b45; }
.shield-chip { display: inline-block; margin: .15rem .25rem .15rem 0; padding: .18rem .55rem; border-radius: 99px; background: #e2f2e9; color: #1d6b45; font-size: .8rem; font-weight: 700; }
.shield-text mark { background: #1d6b45; color: #fff; border-radius: 4px; padding: 0 .25rem; font-weight: 700; }
.ai-answer { margin: .6rem 0; padding: 1rem 1.1rem; border-radius: 12px; background: linear-gradient(135deg, #f4f0ff, #fff7f5); border: 1px solid #e2d9fa; }
.ai-answer h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; font-size: .85rem; color: #4a33a8; }
.ai-answer p { margin: .35rem 0; line-height: 1.55; }
.ai-state { font-size: .84rem; color: var(--muted); margin: .3rem 0 .8rem; }
.ai-state.answered { color: #1d6b45; font-weight: 650; }
.ai-state.blocked, .ai-state.error { color: var(--red-strong); font-weight: 650; }
.ai-callout { background: linear-gradient(120deg, #f4f0ff, #fff); border-color: #e2d9fa; }
.ai-answer h3 .icon { width: 1.1rem; height: 1.1rem; flex: none; }
