/* IBCSC Support — Civic Observatory, applied to a working client portal.
   Square controls, 1px structural rules, cyan strictly as signal.
   Dark navy carries navigation and identity; technical paper carries work. */

@font-face { font-family: "Gilroy"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/gilroy-regular.woff2") format("woff2"); }
@font-face { font-family: "Gilroy"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("../fonts/gilroy-medium.woff2") format("woff2"); }
@font-face { font-family: "Gilroy"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../fonts/gilroy-semibold.woff2") format("woff2"); }
@font-face { font-family: "Gilroy"; font-style: normal; font-weight: 700 900; font-display: swap;
    src: url("../fonts/gilroy-bold.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }

:root {
    --ink: #07131d;
    --ink-deep: #030b12;
    --surface: #0b1c28;
    --surface-2: #102631;
    --paper: #f2efe7;
    --paper-2: #e7e3d9;
    --paper-3: #dcd7ca;
    --text: #12232c;
    --text-muted: #566871;
    --text-faint: #7d8c94;
    --on-dark: #f1efe9;
    --on-dark-muted: #9bacb5;
    --cyan: #19b9e6;
    --cyan-ink: #06637b;
    --line: #c9c4b6;
    --line-strong: #b3ac9a;
    --line-dark: rgba(155, 184, 197, .22);
    --ok: #2f6a4f;
    --ok-bg: #e2ece4;
    --warn: #8a6524;
    --warn-bg: #f4ecd9;
    --danger: #a33a2e;
    --danger-bg: #f6e5e1;
    --info-bg: #dfeaef;
    --font: "Gilroy", "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
    --font-num: "Barlow Condensed", "Gilroy", sans-serif;
    --gutter: clamp(20px, 3vw, 40px);
    --rail: 244px;
    --header-h: 64px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* A class-level `display` would otherwise outrank the browser's own
   [hidden] rule and keep hidden elements on screen. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; line-height: 1.12; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--cyan); color: var(--ink-deep); padding: 12px 20px; font-weight: 700;
}
.skip-link:focus { left: 0; }

.label {
    font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-faint);
}

/* ---------- Shell ---------- */

.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }

.rail {
    background: var(--ink);
    color: var(--on-dark);
    border-right: 1px solid var(--ink-deep);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.rail__brand {
    display: block; padding: 22px var(--gutter) 20px;
    border-bottom: 1px solid var(--line-dark); color: var(--on-dark);
}
.rail__brand:hover { text-decoration: none; }
.rail__wordmark { display: block; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.rail__wordmark span { color: var(--cyan); }
.rail__tagline { display: block; font-size: .7rem; color: var(--on-dark-muted); letter-spacing: .04em; margin-top: 4px; }

.rail__nav { padding: 14px 0; flex: 1; }
.rail__group { padding: 16px var(--gutter) 6px; }
.rail__group .label { color: #6d818c; }
.rail__link {
    display: flex; align-items: center; gap: 10px; justify-content: space-between;
    padding: 10px var(--gutter); color: var(--on-dark-muted);
    border-left: 2px solid transparent; font-weight: 500;
    transition: color .15s var(--ease), background .15s var(--ease);
}
.rail__link:hover { color: var(--on-dark); background: rgba(255, 255, 255, .04); text-decoration: none; }
.rail__link.is-active {
    color: var(--on-dark); background: rgba(25, 185, 230, .1);
    border-left-color: var(--cyan); font-weight: 600;
}
/* This badge only ever appears when something is waiting on the reader, which
   is exactly what the signal colour is for. */
.rail__count {
    font-family: var(--font-num); font-weight: 700; font-size: .92rem;
    background: var(--cyan); color: var(--ink-deep);
    padding: 1px 7px; min-width: 24px; text-align: center;
}

.rail__foot { padding: 18px var(--gutter); border-top: 1px solid var(--line-dark); font-size: .78rem; }
.rail__foot a { color: var(--on-dark-muted); }
.rail__user { color: var(--on-dark); font-weight: 600; }
.rail__mail { color: var(--on-dark-muted); word-break: break-all; font-size: .74rem; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: var(--header-h); display: flex; align-items: center; gap: 16px;
    padding: 0 var(--gutter); background: var(--paper);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
.topbar__spacer { flex: 1; }

.langs { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.langs a {
    padding: 5px 9px; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
    background: var(--paper); color: var(--text-muted);
}
.langs a:hover { background: var(--paper-2); text-decoration: none; }
.langs a.is-current { background: var(--ink); color: var(--on-dark); }

.content { padding: var(--gutter); max-width: 1360px; width: 100%; }

.page-head { margin-bottom: 24px; }
.page-head__row { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.page-head__intro { color: var(--text-muted); max-width: 68ch; margin-top: 6px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Controls ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 11px 20px; border: 1px solid transparent; border-radius: 0;
    font: inherit; font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase;
    cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--cyan); color: var(--ink-deep); }
.btn--primary:hover { background: #35c8f0; }
.btn--dark { background: var(--ink); color: var(--on-dark); }
.btn--dark:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); }
.btn--small { min-height: 36px; padding: 7px 13px; font-size: .72rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.field { margin-bottom: 18px; }
.field__label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: 6px; }
.field__hint { display: block; color: var(--text-muted); font-size: .78rem; margin-top: 5px; }
.field__error { display: block; color: var(--danger); font-size: .8rem; margin-top: 5px; font-weight: 600; }
.field__optional { color: var(--text-faint); font-weight: 400; text-transform: none; letter-spacing: 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], input[type="number"], input[type="tel"], select, textarea {
    width: 100%; min-height: 48px; padding: 11px 13px;
    background: #fff; color: var(--text);
    border: 1px solid var(--line-strong); border-radius: 0;
    font: inherit; font-size: .95rem;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: var(--cyan); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 3px; flex: 0 0 auto; accent-color: var(--cyan-ink); }

.file-drop {
    border: 1px dashed var(--line-strong); background: var(--paper-2);
    padding: 14px; font-size: .85rem;
}
.file-drop input { border: 0; background: none; min-height: 0; padding: 0; font-size: .85rem; }

/* ---------- Surfaces ---------- */

.panel { background: #fff; border: 1px solid var(--line); }
.panel__head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.panel__head h2 { font-size: .92rem; letter-spacing: .01em; }
.panel__head .btn { margin-left: auto; }
.panel__body { padding: 20px; }
.panel__body--flush { padding: 0; }
/* Stacked panels are separated; panels that are grid cells are aligned by the
   grid itself and must not inherit that separation. */
.panel + .panel { margin-top: 20px; }
.grid > .panel + .panel { margin-top: 0; }

.grid { display: grid; gap: 20px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid--halves { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { background: #fff; border: 1px solid var(--line); padding: 18px 20px; }
.stat--signal { border-left: 3px solid var(--cyan); }
.stat--alert { border-left: 3px solid var(--danger); }
.stat__value { font-family: var(--font-num); font-size: 2.4rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.stat__label { margin-top: 6px; font-size: .8rem; color: var(--text-muted); }

/* ---------- Badges ---------- */

.badge {
    display: inline-block; padding: 3px 9px; font-size: .68rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; border: 1px solid; white-space: nowrap;
}
.badge--info { color: var(--cyan-ink); background: var(--info-bg); border-color: #b6cfd8; }
.badge--accent { color: #124a5e; background: #d8ecf3; border-color: #a9cfdc; }
.badge--ok { color: var(--ok); background: var(--ok-bg); border-color: #b8d3c1; }
.badge--warn { color: var(--warn); background: var(--warn-bg); border-color: #ddcb9f; }
.badge--danger { color: var(--danger); background: var(--danger-bg); border-color: #ddb3aa; }
.badge--muted { color: var(--text-muted); background: var(--paper-2); border-color: var(--line); }

.ref { font-family: var(--font-num); font-weight: 700; letter-spacing: .02em; font-size: 1.02rem; }

/* ---------- Tables and lists ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th {
    font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-faint); background: var(--paper-2); border-bottom: 1px solid var(--line-strong);
    position: sticky; top: 0;
}
table.data tbody tr:hover { background: var(--paper-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { font-family: var(--font-num); font-weight: 600; }
.row-title { font-weight: 600; color: var(--text); }
.row-sub { color: var(--text-muted); font-size: .82rem; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; }
.filters select, .filters input { min-height: 40px; padding: 7px 11px; font-size: .88rem; }
.filters select { background-position: calc(100% - 17px) 17px, calc(100% - 11px) 17px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a {
    padding: 7px 13px; font-size: .78rem; font-weight: 600;
    background: var(--paper); color: var(--text-muted); border: 1px solid var(--line);
}
.chips a:hover { background: var(--paper-2); text-decoration: none; }
.chips a.is-current { background: var(--ink); color: var(--on-dark); }
.chips .count { font-family: var(--font-num); opacity: .75; margin-left: 5px; }

.pager { display: flex; gap: 1px; margin-top: 20px; background: var(--line); border: 1px solid var(--line); width: max-content; }
.pager__item { padding: 8px 14px; background: var(--paper); font-family: var(--font-num); font-weight: 600; color: var(--text-muted); }
.pager__item:hover { background: var(--paper-2); text-decoration: none; }
.pager__item.is-current { background: var(--ink); color: var(--on-dark); }
.pager__gap { padding: 8px 6px; background: var(--paper); color: var(--text-faint); }

.empty { padding: 48px 20px; text-align: center; color: var(--text-muted); }
.empty__title { font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* ---------- Thread ---------- */

.thread { display: flex; flex-direction: column; }
.message { border-bottom: 1px solid var(--line); padding: 20px; }
.message:last-child { border-bottom: 0; }
.message__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar {
    width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center;
    background: var(--paper-3); color: var(--text); font-weight: 700; font-size: .78rem; letter-spacing: .02em;
}
.message--agent .avatar { background: var(--ink); color: var(--cyan); }
.message--system .avatar { background: var(--paper-2); color: var(--text-faint); }
.message__author { font-weight: 700; font-size: .9rem; }
.message__meta { color: var(--text-faint); font-size: .76rem; }
.message__body { font-size: .95rem; }
.message__body a { word-break: break-word; }
.message--agent { background: #fbfaf7; border-left: 3px solid var(--cyan); }
.message--internal { background: var(--warn-bg); border-left: 3px solid var(--warn); }
.message--internal .message__author::after {
    content: attr(data-note); margin-left: 8px; font-size: .66rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--warn); font-weight: 700;
}

.attach-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attach-list a {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px;
    border: 1px solid var(--line-strong); background: var(--paper-2); font-size: .82rem; color: var(--text);
}
.attach-list a:hover { background: #fff; text-decoration: none; border-color: var(--cyan); }
.attach-list .size { color: var(--text-faint); font-family: var(--font-num); }

.reply-box { border-top: 1px solid var(--line-strong); background: var(--paper-2); padding: 20px; }
.reply-box__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.reply-box__actions .check { margin-right: 4px; }

/* ---------- Detail metadata ---------- */

.meta-list { list-style: none; margin: 0; padding: 0; }
.meta-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .87rem; }
.meta-list li:last-child { border-bottom: 0; }
.meta-list dt, .meta-list .k { color: var(--text-muted); }
.meta-list .v { font-weight: 600; text-align: right; }

/* ---------- Order progress ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.steps li { flex: 1 1 130px; background: var(--paper-2); padding: 11px 14px; font-size: .76rem; color: var(--text-faint); }
.steps li .n { font-family: var(--font-num); font-weight: 700; display: block; font-size: .9rem; }
.steps li.is-done { background: #fff; color: var(--text-muted); }
.steps li.is-current { background: var(--ink); color: var(--on-dark); }
.steps li.is-current .n { color: var(--cyan); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 1px solid var(--line-strong); margin-left: 4px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; background: var(--line-strong);
}
.timeline li.is-signal::before { background: var(--cyan); }
.timeline__what { font-size: .87rem; font-weight: 600; }
.timeline__when { font-size: .76rem; color: var(--text-faint); }

/* ---------- Catalogue ---------- */

.service-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.service {
    background: #fff; border: 1px solid var(--line); padding: 20px;
    display: flex; flex-direction: column; gap: 10px; height: 100%;
}
.service:hover { border-color: var(--line-strong); }
.service__title { font-weight: 700; font-size: .98rem; }
.service__summary { font-size: .85rem; color: var(--text-muted); flex: 1; }
.service__foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.service__price { font-family: var(--font-num); font-weight: 700; font-size: 1.15rem; }
.service__foot .btn { margin-left: auto; }

/* ---------- Flash ---------- */

.flashes { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.flash { border: 1px solid; border-left-width: 3px; padding: 12px 16px; font-size: .9rem; }
.flash--success { background: var(--ok-bg); border-color: #b8d3c1; border-left-color: var(--ok); color: #21503b; }
.flash--error { background: var(--danger-bg); border-color: #ddb3aa; border-left-color: var(--danger); color: #7d2b21; }
.flash--warning { background: var(--warn-bg); border-color: #ddcb9f; border-left-color: var(--warn); color: #6b4e1b; }
.flash--info { background: var(--info-bg); border-color: #b6cfd8; border-left-color: var(--cyan-ink); color: #114a5c; }

.announcement { background: var(--ink); color: var(--on-dark); padding: 12px var(--gutter); font-size: .88rem; border-bottom: 1px solid var(--ink-deep); }
.announcement strong { color: var(--cyan); }

/* ---------- Auth pages ---------- */

.auth {
    min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
    background: var(--paper);
}
.auth__aside {
    --aside-pad: clamp(32px, 5vw, 72px);
    position: relative; overflow: hidden;
    background: var(--ink); color: var(--on-dark); padding: var(--aside-pad);
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
/* The institutional lockup, matched to the public site: heavy wordmark, a hair
   rule, then the full name set small and uppercase. */
.auth__brand {
    display: grid; grid-template-columns: auto auto; align-items: center; gap: 12px;
    width: max-content; color: var(--on-dark); line-height: 1.02;
}
.auth__brand:hover { text-decoration: none; }
.auth__brand strong { font-size: clamp(1.5rem, 1.9vw, 1.95rem); font-weight: 800; letter-spacing: -.055em; }
.auth__brand span {
    padding-left: 12px; border-left: 1px solid rgba(241, 239, 233, .4);
    color: #c8d0d3; font-size: .61rem; font-weight: 500; letter-spacing: .015em;
    text-transform: uppercase;
}

/* The observatory owl from the public footer, as a quiet watermark rather than
   a picture: it sits behind the corner the eye leaves last. */
.auth__owl {
    /* A touch below the contact block's own line, so the bird reads as
       standing on the corner rather than sharing the text baseline. */
    position: absolute; right: var(--aside-pad); bottom: max(16px, calc(var(--aside-pad) - 28px));
    width: auto; height: clamp(120px, 20vh, 200px);
    opacity: .75; pointer-events: none; user-select: none;
}
@media (max-height: 760px) { .auth__owl { display: none; } }
.auth__claim { font-size: clamp(1.7rem, 2.7vw, 2.5rem); font-weight: 700; line-height: 1.08; letter-spacing: -.025em; max-width: 16ch; }
.auth__points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth__points li { display: flex; gap: 12px; font-size: .9rem; color: var(--on-dark-muted); border-top: 1px solid var(--line-dark); padding-top: 12px; }
.auth__points b { color: var(--cyan); font-family: var(--font-num); font-size: 1rem; flex: 0 0 auto; }
.auth__legal { font-size: .74rem; color: #6d818c; }
.auth__legal a { color: var(--on-dark-muted); }

.auth__panel { display: flex; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 64px); }
.auth__form { width: 100%; max-width: 420px; }
.auth__form h1 { margin-bottom: 8px; }
.auth__intro { color: var(--text-muted); margin-bottom: 26px; }
.auth__divider { display: flex; align-items: center; gap: 12px; margin: 26px 0; color: var(--text-faint); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; }
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: .86rem; }
.auth__langs { position: absolute; top: 20px; right: 20px; }

/* ---------- Error pages ---------- */

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 40px; background: var(--ink); color: var(--on-dark); text-align: center; }
.error-page__code { font-family: var(--font-num); font-size: clamp(5rem, 16vw, 11rem); font-weight: 700; line-height: .85; color: var(--cyan); }
.error-page h1 { margin: 16px 0 10px; }
.error-page p { color: var(--on-dark-muted); max-width: 48ch; margin-inline: auto; }
.error-page .btn { margin-top: 26px; }

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
    .grid--split { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
    .shell { grid-template-columns: 1fr; }
    .rail { position: static; height: auto; flex-direction: column; border-right: 0; border-bottom: 1px solid var(--ink-deep); }
    .rail__nav { display: flex; flex-wrap: wrap; padding: 8px var(--gutter) 14px; gap: 2px; }
    .rail__group { display: none; }
    .rail__link { padding: 9px 13px; border-left: 0; border-bottom: 2px solid transparent; }
    .rail__link.is-active { border-left: 0; border-bottom-color: var(--cyan); }
    .rail__foot { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
    .auth { grid-template-columns: 1fr; }
    .auth__aside { display: none; }
}
@media (max-width: 640px) {
    body { font-size: 14px; }
    .content { padding: 20px 16px; }
    .topbar { padding: 0 16px; }
    .panel__body, .message, .reply-box { padding: 16px; }
    .page-head__actions { margin-left: 0; width: 100%; }
    .page-head__actions .btn { flex: 1; }
    table.data th, table.data td { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

@media print {
    .rail, .topbar, .reply-box, .page-head__actions, .filters, .pager { display: none; }
    body { background: #fff; }
    .panel { border-color: #999; }
}

/* ---------- Utilities ----------
   A short, closed set. The strict Content-Security-Policy forbids inline style
   attributes, so spacing exceptions live here rather than in the templates. */

.u-full { width: 100%; }
.u-w-auto { width: max-content; }
.u-right { text-align: right; }
.u-nowrap { white-space: nowrap; }
.u-break { word-break: break-all; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-s { margin-bottom: 8px; }
.u-mb-m { margin-bottom: 14px; }
.u-mb-l { margin-bottom: 20px; }
.u-mb-xl { margin-bottom: 24px; }
.u-mb-nav { margin-bottom: 26px; }
.u-mt-xs { margin-top: 6px; }
.u-mt-s { margin-top: 8px; }
.u-mt-sm { margin-top: 10px; }
.u-mt-m { margin-top: 12px; }
.u-mt-ml { margin-top: 14px; }
.u-mt-l { margin-top: 20px; }

.subhead {
    margin: 18px 0 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-faint);
}
textarea.is-short { min-height: 110px; }
textarea.is-shorter { min-height: 90px; }
.check--inline { min-height: 40px; align-items: center; }
.btn--on-dark { color: var(--on-dark); border-color: var(--line-dark); }
.btn--on-dark:hover { background: rgba(255, 255, 255, .06); }

.reply-box.is-internal { background: var(--warn-bg); border-top-color: var(--warn); }
.message.is-highlighted { outline: 2px solid var(--cyan); outline-offset: -2px; }
.counter.is-low { color: var(--danger); font-weight: 600; }

/* The sign-in aside ends on something useful: the two ways to reach the
   institute when the portal itself is not the answer. */
.auth__foot { display: flex; flex-direction: column; gap: 18px; }
.auth__contact { list-style: none; margin: 0; padding: 0; display: flex; gap: 32px; flex-wrap: wrap; }
.auth__contact li { display: flex; flex-direction: column; gap: 3px; }
.auth__contact .label { color: #6d818c; }
.auth__contact a { color: var(--on-dark); font-size: .92rem; }

/* Reference columns are fixed-width content; letting them share the table's
   free space pushed the title far away from its own identifier. */
table.data td.num, table.data th.num { width: 1%; white-space: nowrap; }

/* Related-item lists in a narrow aside: a long title and a status badge cannot
   share one line at 300px, so the badge sits under the link instead of
   squeezing it into a column of single words. */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: block; font-size: .87rem; font-weight: 600; line-height: 1.35; }
.link-list .meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; }

/* Opening-days picker: seven short labels that should read as one control. */
.fieldset { border: 0; margin: 0; padding: 0; }
.day-picker { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 8px; }
.day-picker .check { font-size: .86rem; }
input[type="time"] { max-width: 180px; }

/* The payment card is the one place on screen where a number has to be copied
   by hand, so it is set large, monospaced-wide and unambiguous. */
.pay-card__iban, .pay-card__communication, .pay-card__amount {
    margin: 4px 0 0; font-family: var(--font-num); font-weight: 700; letter-spacing: .02em;
}
.pay-card__iban { font-size: 1.15rem; }
.pay-card__communication { font-size: 1.35rem; color: var(--cyan-ink); word-break: break-all; }
.pay-card__amount { font-size: 1.6rem; }
.pay-card .label { display: block; }

/* The owl closes the rail as it closes the sign-in panel: same bird, same
   restraint, sized down to the narrower column. */
.rail__owl {
    display: block; width: auto; height: clamp(74px, 9vh, 116px);
    margin: 0 var(--gutter) 4px auto; opacity: .55; pointer-events: none; user-select: none;
}
@media (max-height: 720px) { .rail__owl { display: none; } }
@media (max-width: 880px) { .rail__owl { display: none; } }

/* ---------- Estimator ---------- */

/* The invitation is a panel, not a modal: it never traps the reader, and
   dismissing it is a real decision the portal remembers. */
.invite {
    display: flex; align-items: stretch; gap: var(--gutter);
    /* It already sits inside the content padding, so it only needs to clear
       the heading below it. */
    margin: 0 0 var(--gutter);
    background: var(--ink); color: var(--on-dark);
    border-left: 3px solid var(--cyan); overflow: hidden;
}
.invite__body { padding: 22px var(--gutter); flex: 1; }
.invite__body .label { color: #6d818c; }
.invite__title { margin: 6px 0 8px; font-size: 1.25rem; }
.invite__text { color: var(--on-dark-muted); max-width: 62ch; font-size: .92rem; }
.invite__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.invite__actions .btn--ghost { color: var(--on-dark); border-color: var(--line-dark); }
.invite__actions .btn--ghost:hover { background: rgba(255, 255, 255, .06); }
.invite__owl { flex: 0 0 auto; width: auto; height: 150px; align-self: flex-end; opacity: .6; margin-right: var(--gutter); }
@media (max-width: 880px) { .invite__owl { display: none; } }

.estimate-summary { font-size: 1.02rem; line-height: 1.55; }
.estimate-list { margin: 8px 0 0; padding-left: 20px; font-size: .9rem; color: var(--text-muted); }
.estimate-list li { margin-bottom: 6px; }
.estimate-steps { margin: 0; padding-left: 20px; font-size: .9rem; color: var(--text-muted); }
.estimate-steps li { margin-bottom: 8px; }

.estimate-range { margin-top: 20px; padding: 16px 20px; background: var(--paper-2); border: 1px solid var(--line); }
.estimate-range__value { margin: 4px 0 6px; font-family: var(--font-num); font-weight: 700; font-size: 1.9rem; line-height: 1; }
.estimate-range__dash { color: var(--text-faint); margin: 0 6px; }

/* The disclaimer is the one thing on this screen nobody may miss. */
.estimate-disclaimer {
    margin-top: 20px; padding: 14px 16px;
    background: var(--warn-bg); border: 1px solid #ddcb9f; border-left: 3px solid var(--warn);
    font-size: .88rem; color: #6b4e1b;
}
.estimate-disclaimer strong { display: block; margin-bottom: 4px; }
.estimate-disclaimer p { margin: 0; }

.estimate-working { margin-left: 12px; font-size: .86rem; color: var(--text-muted); }

.estimate-pending { display: flex; align-items: center; gap: 16px; }
.estimate-pending__title { margin: 0 0 4px; font-weight: 600; }
.estimate-pending__pulse {
    flex: 0 0 auto; width: 12px; height: 12px; background: var(--cyan);
    animation: estimate-pulse 1.4s ease-in-out infinite;
}
@keyframes estimate-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Estimator ---------- */

/* The invitation is a panel, not a modal: it never traps the reader, and
   dismissing it is a real decision the portal remembers. */
.invite {
    display: flex; align-items: stretch; gap: var(--gutter);
    /* It already sits inside the content padding, so it only needs to clear
       the heading below it. */
    margin: 0 0 var(--gutter);
    background: var(--ink); color: var(--on-dark);
    border-left: 3px solid var(--cyan); overflow: hidden;
}
.invite__body { padding: 22px var(--gutter); flex: 1; }
.invite__body .label { color: #6d818c; }
.invite__title { margin: 6px 0 8px; font-size: 1.25rem; }
.invite__text { color: var(--on-dark-muted); max-width: 62ch; font-size: .92rem; }
.invite__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.invite__actions .btn--ghost { color: var(--on-dark); border-color: var(--line-dark); }
.invite__actions .btn--ghost:hover { background: rgba(255, 255, 255, .06); }
.invite__owl { flex: 0 0 auto; width: auto; height: 150px; align-self: flex-end; opacity: .6; margin-right: var(--gutter); }
@media (max-width: 880px) { .invite__owl { display: none; } }

.estimate-summary { font-size: 1.02rem; line-height: 1.55; }
.estimate-list { margin: 8px 0 0; padding-left: 20px; font-size: .9rem; color: var(--text-muted); }
.estimate-list li { margin-bottom: 6px; }
.estimate-steps { margin: 0; padding-left: 20px; font-size: .9rem; color: var(--text-muted); }
.estimate-steps li { margin-bottom: 8px; }

.estimate-range { margin-top: 20px; padding: 16px 20px; background: var(--paper-2); border: 1px solid var(--line); }
.estimate-range__value { margin: 4px 0 6px; font-family: var(--font-num); font-weight: 700; font-size: 1.9rem; line-height: 1; }
.estimate-range__dash { color: var(--text-faint); margin: 0 6px; }

/* The disclaimer is the one thing on this screen nobody may miss. */
.estimate-disclaimer {
    margin-top: 20px; padding: 14px 16px;
    background: var(--warn-bg); border: 1px solid #ddcb9f; border-left: 3px solid var(--warn);
    font-size: .88rem; color: #6b4e1b;
}
.estimate-disclaimer strong { display: block; margin-bottom: 4px; }
.estimate-disclaimer p { margin: 0; }

.estimate-working { margin-left: 12px; font-size: .86rem; color: var(--text-muted); }

.estimate-pending { display: flex; align-items: center; gap: 16px; }
.estimate-pending__title { margin: 0 0 4px; font-weight: 600; }
.estimate-pending__pulse {
    flex: 0 0 auto; width: 12px; height: 12px; background: var(--cyan);
    animation: estimate-pulse 1.4s ease-in-out infinite;
}
@keyframes estimate-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Public estimator ----------
   Reached without an account, so it carries its own shell: dark left column for
   the invitation, paper right column for the work. */

.public { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.public__head {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 18px var(--gutter); background: var(--ink); color: var(--on-dark);
}
.public__brand {
    display: grid; grid-template-columns: auto auto; align-items: center; gap: 12px;
    color: var(--on-dark); line-height: 1.02;
}
.public__brand:hover { text-decoration: none; }
.public__brand strong { font-size: 1.35rem; font-weight: 800; letter-spacing: -.055em; }
.public__brand span {
    padding-left: 12px; border-left: 1px solid rgba(241, 239, 233, .4);
    color: #c8d0d3; font-size: .58rem; font-weight: 500; letter-spacing: .015em; text-transform: uppercase;
}
.public__head .langs a { background: transparent; color: var(--on-dark-muted); border-color: var(--line-dark); }
.public__head .langs a.is-current { background: var(--cyan); color: var(--ink-deep); border-color: var(--cyan); }

.public__main {
    flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    gap: clamp(28px, 5vw, 72px); align-items: start;
    padding: clamp(32px, 6vw, 72px) var(--gutter);
    max-width: 1280px; width: 100%; margin-inline: auto;
}
.public__intro h1 { margin: 8px 0 12px; font-size: clamp(1.9rem, 3.4vw, 2.9rem); letter-spacing: -.025em; }
.public__lead { color: var(--text-muted); max-width: 52ch; font-size: 1.02rem; }
.public__points { list-style: none; margin: 26px 0 0; padding: 0; }
.public__points li {
    padding: 12px 0 12px 22px; border-top: 1px solid var(--line);
    font-size: .92rem; color: var(--text-muted); position: relative;
}
.public__points li::before {
    content: ""; position: absolute; left: 0; top: 20px; width: 8px; height: 1px; background: var(--cyan-ink);
}
.public__panel { background: #fff; border: 1px solid var(--line); padding: clamp(22px, 3vw, 32px); }
.public__result .subhead { margin-top: 22px; }

.public__foot {
    padding: 20px var(--gutter); border-top: 1px solid var(--line);
    color: var(--text-faint); font-size: .8rem;
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.public__foot p { margin: 0; }

/* Off-screen rather than display:none, so a bot that reads CSS still fills it. */
.honeypot {
    position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

@media (max-width: 900px) {
    .public__main { grid-template-columns: 1fr; }
    .public__brand span { display: none; }
}
