/* Assen Alert — chat-style UI (IDEA-003, D-013). Phone first (Q-083); no horizontal scrolling at 360 px and up (responsive-layout).
   Sections: tokens · base · app bar and navigation · forms and buttons · cards and notices · chats list · conversation ·
   composer · sheet · media · administration. */

/* ---- Tokens ---- */
:root {
    --brand: #1F4E8C;
    --brand-dark: #163A69;
    --brand-soft: #DCE8F7;
    --brand-softer: #EEF2F6;
    --own-bubble: #D6E6FA;
    --own-quote: #C3D8F3;
    --text: #14202E;
    --text-2: #33465C;
    --muted: #4A5868;
    --bg: #FFFFFF;
    --surface: #F6F8FB;
    --chat-bg: #EEF2F6;
    --border: #E6EBF1;
    --border-strong: #C9D2DC;
    --emergency: #C2410C;
    --emergency-text: #9A3412;
    --emergency-bg: #FFF4EC;
    --emergency-border: #F3B48A;
    --danger: #A3290B;
    --success: #1B6E2A;
    --radius: 12px;
    --tab-height: 64px;
    --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* Kept for components that still use the earlier names. */
    --accent: var(--brand);
    --accent-text: #FFFFFF;
    color-scheme: light;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    overflow-wrap: anywhere;
}

img, video { max-width: 100%; height: auto; }

a { color: var(--brand); }

a:hover { color: var(--brand-dark); }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.5rem 0 1rem; }

h1:focus { outline: none; }

h2 { font-size: 1.15rem; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.icon { flex: none; display: block; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.meta { color: var(--muted); }

.help { margin: 0.1rem 0 0.25rem; color: var(--muted); font-size: 0.9rem; }

.status { color: var(--success); }

#blazor-error-ui { display: none; }

/* ---- App bar and navigation ---- */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 56px;
    padding: 0.5rem 1rem;
    background: var(--brand);
    color: #FFFFFF;
}

.site-nav { display: flex; align-items: center; gap: 1.5rem; min-width: 0; }

.site-nav .brand { display: inline-flex; align-items: center; gap: 0.5rem; color: #FFFFFF; font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }

/* site-identity: the logo next to the app name (Q-114 B), and larger on the home and sign-in pages. */
.brand-logo { flex: none; width: 32px; height: 32px; object-fit: contain; }

.page-intro { text-align: center; }

.page-logo { display: block; max-width: 40%; height: auto; margin: 0.5rem auto 0.75rem; }
/* The brand settings page: the logo and app icon now in use (A-046). */
.brand-current { display: block; width: auto; height: 64px; max-width: 100%; object-fit: contain; margin: 0.5rem 0 1rem; }

/* Phone: the items are a bottom tab bar. */
.nav-items {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    margin: 0;
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
    list-style: none;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.nav-items a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    color: var(--muted);
    font-size: 0.75rem;
    text-decoration: none;
}

.nav-items .nav-icon { display: flex; padding: 2px 14px; border-radius: 14px; }

.nav-items a.active { color: var(--brand); font-weight: 700; }

.nav-items .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-items a.active .nav-icon { background: var(--brand-soft); }

.nav-count {
    position: absolute;
    top: 0;
    left: calc(50% + 6px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--emergency);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
}

.language { display: flex; gap: 4px; margin: 0; }

/* Same size, shape and colours as the menu buttons in the top bar, so it stays inside the blue bar (Q-109 A). */
.language button {
    min-width: 44px;
    min-height: 0;
    height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--brand-soft);
    font: 600 0.95rem var(--font);
    cursor: pointer;
}

.language button:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }

.language button[aria-pressed="true"] { background: #FFFFFF; color: var(--brand); font-weight: 700; }

.language abbr { text-decoration: none; }

.site-main { max-width: 760px; margin: 0 auto; padding: 1rem 1rem calc(var(--tab-height) + 1.5rem); }

/* From 768 px: the same design in a wider, centred column; the tabs move to the top bar (Q-083 A). */
@media (min-width: 768px) {
    .app-bar { padding: 0 max(1rem, calc((100% - 760px) / 2)); }

    .nav-items {
        position: static;
        display: flex;
        gap: 4px;
        padding: 0;
        background: transparent;
        border: 0;
    }

    .nav-items a { flex-direction: row; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 20px; color: var(--brand-soft); font-size: 0.95rem; }

    .nav-items .nav-icon { display: none; }

    .nav-items a:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); }

    .nav-items a.active { background: #FFFFFF; color: var(--brand); }

    .nav-count { position: static; }

    .site-main { padding-bottom: 2rem; }
}

/* ---- Forms and buttons ---- */
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 1.1rem;
    border: 1px solid var(--brand);
    border-radius: 22px;
    background: var(--brand);
    color: #FFFFFF;
    font: 600 0.95rem var(--font);
    text-decoration: none;
    cursor: pointer;
}

button:hover, .button:hover { background: var(--brand-dark); color: #FFFFFF; }

button:disabled { opacity: 0.55; cursor: not-allowed; }

button.secondary { background: var(--bg); color: var(--brand); border-color: var(--border-strong); }

button.secondary:hover { background: var(--brand-softer); color: var(--brand); }

.button.secondary { background: var(--bg); color: var(--brand); border-color: var(--border-strong); }

.button.secondary:hover { background: var(--brand-softer); color: var(--brand); }

.media-input:focus-visible + .choose-media { outline: 3px solid var(--brand); outline-offset: 2px; }

/* profile-avatar (D-032): the picture button is the label of a hidden file field and shows that field's focus. */
.avatar-form input[type=file]:focus-visible + .choose-avatar { outline: 3px solid var(--brand); outline-offset: 2px; }

button.danger { background: var(--danger); border-color: var(--danger); }

.button.block { display: flex; width: 100%; min-height: 52px; border-radius: 26px; font-size: 1rem; }

.link-button { min-height: 0; padding: 0.25rem 0; border: 0; background: none; color: var(--brand); text-decoration: underline; font-weight: 600; }

.link-button:hover { background: none; color: var(--brand-dark); }

label { display: block; font-weight: 600; margin-top: 1rem; }

input:not([type=file]):not([type=hidden]):not([type=checkbox]):not([type=radio]), textarea, select {
    display: block;
    width: 100%;
    max-width: 32rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

textarea { max-width: 100%; }

input[type=file] { display: block; max-width: 100%; margin: 0.25rem 0 0.75rem; }

input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }

form button[type=submit] { margin-top: 0.75rem; }

.invalid, input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger) !important; outline: 1px solid var(--danger); }

.field-error { color: var(--danger); margin: 0.25rem 0; }

label.checkbox { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }

.actions button { margin-top: 0; }

/* ---- Cards and notices ---- */
.card { margin: 1rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }

.card h2 { margin-top: 0; }

.notice { padding: 0.75rem 1rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }

/* maintenance-notice (D-040) and the administrators' "maintenance mode is on" line (A-020). */
.maintenance-notice, .maintenance-on { display: flex; gap: 0.5rem; align-items: flex-start; max-width: 60rem; margin: 0.75rem auto 0; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }

.maintenance-on { border-color: var(--danger); font-weight: 600; flex-wrap: wrap; }

.emergency-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--emergency-border);
    border-radius: var(--radius);
    background: var(--emergency-bg);
    color: #7A2E0A;
}

/* IDEA-035 (A-037): the icon and "112" open the dialler; the icon's tap area is at least 44 by 44 px. */
.emergency-call-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; min-height: 44px; margin: -0.6rem -0.4rem -0.6rem -0.6rem; border-radius: 999px; color: inherit; }
.emergency-call-icon:hover { background: var(--emergency-border); }
.emergency-call { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.emergency-call-icon:focus-visible, .emergency-call:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.page-links { display: flex; flex-direction: column; margin: 1rem 0; border-top: 1px solid var(--border); }

.page-links a, .page-links button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 0.25rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: none;
    color: var(--text);
    font: 400 1rem var(--font);
    text-decoration: none;
}

.page-links form { margin: 0; }

.page-links .sign-out { color: var(--danger); font-weight: 600; }

.page-links button:hover, .page-links a:hover { background: var(--surface); color: inherit; }

.terms-text { white-space: pre-line; }

/* Why the terms must be accepted again (IDEA-025, A-027). */
.terms-changed { display: flex; gap: 0.75rem; align-items: flex-start; margin: 1rem 0; padding: 0.85rem 1rem; border: 2px solid var(--emergency); border-radius: var(--radius); background: var(--emergency-bg); color: var(--emergency-text); }

.terms-changed .icon { flex: none; }

.terms-changed p { margin: 0 0 0.35rem; }

.terms-changed p:last-child { margin-bottom: 0; }

.terms-changed strong { font-size: 1.1rem; }

.terms-changed a { display: inline-block; padding: 0.6rem 0; color: var(--emergency-text); font-weight: 600; }

/* IDEA-037: summaries and the exact changes inside the banner. */
.terms-summaries { margin-top: 0.5rem; }

.terms-changed .terms-summary strong { font-size: 1rem; }

.terms-diff { margin-top: 0.5rem; }

.terms-diff summary { cursor: pointer; font-weight: 600; padding: 0.4rem 0; }

.terms-diff-list { margin: 0 0 0.5rem; padding-left: 1.1rem; }

.terms-diff-list li { margin: 0.25rem 0; }

.terms-diff-list ins { text-decoration: underline; }

.terms-diff-list del { text-decoration: line-through; }

.diff-label { font-weight: 600; }

.sign-in { display: flex; flex-direction: column; gap: 0.75rem; }

.sign-in p { margin: 0; }

.sign-in .button { width: 100%; min-height: 52px; border-radius: 26px; background: var(--bg); color: var(--text); border-color: var(--border-strong); }

.sign-in .button:hover { background: var(--surface); }

.sign-in-form { display: flex; flex-direction: column; gap: 0.75rem; }

.sign-in-form button[type=submit] { margin-top: 0; }

/* The form's first button, so Enter in the e-mail field sends a code (not Google); hidden from sight and from screen readers. */
.default-submit { position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* stay-signed-in: the tick box, its label and the shared-computer warning (A-011). */
.stay-signed-in { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.25rem 0.6rem; }

.stay-signed-in input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }

.stay-signed-in label { margin: 0; font-weight: 600; }

.email-sign-in label { margin-top: 0; }

.stay-signed-in .help { grid-column: 2; }

.dev-sign-in { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border-strong); }

.badge { display: inline-block; padding: 0 0.45rem; border-radius: 4px; background: var(--brand-softer); color: var(--muted); font-size: 0.75rem; font-weight: 600; line-height: 1.6; }

.emergency-badge { background: var(--emergency); color: #FFFFFF; font-weight: 700; }

.official-badge { display: inline-flex; align-items: center; gap: 3px; padding: 0 0.45rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; line-height: 1.6; color: #FFFFFF; }

.official-badge.police { background: #12355B; }

.official-badge.municipality { background: var(--success); }

.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }

.avatar.small { width: 32px; height: 32px; font-size: 0.85rem; }

.avatar.medium { width: 48px; height: 48px; font-size: 1.05rem; }

.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 2.25rem;
    font-weight: 700;
}

/* ---- Chats list ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.chat-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0 0 0.75rem; padding: 4px; border-radius: var(--radius); background: var(--brand-softer); }

/* official-overview (Q-240 B): the link to the monitoring page under the Chats tabs, and its items with the group's picture. */
.monitor-link { display: flex; align-items: center; gap: 0.6rem; min-height: 48px; margin: 0 0 0.75rem; padding: 0.5rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--brand); font-weight: 600; text-decoration: none; }
.monitor-link .icon:last-child { margin-left: auto; color: var(--muted); }
.watch-item { display: flex; gap: 0.6rem; align-items: flex-start; }
.watch-item > .message { flex: 1; min-width: 0; }
.group-avatar.small { width: 36px; height: 36px; }
.group-avatar.small .icon { width: 18px; height: 18px; }
.group-avatar.small .kind-lock { width: 16px; height: 16px; border-width: 1px; }
.group-avatar.small .kind-lock .icon { width: 10px; height: 10px; }

.chat-views a { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 0.9rem; text-decoration: none; }

.chat-views a[aria-current="page"] { background: var(--bg); color: var(--brand); font-weight: 700; box-shadow: 0 1px 2px rgba(20, 32, 46, 0.12); }

.notices-bar { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.75rem; padding: 0.75rem 0.9rem; border-radius: var(--radius); background: var(--emergency-bg); color: #7A3E00; font-weight: 600; text-decoration: none; }

.notices-bar span { flex: 1; }

.group-list, .member-list, .chat-list { list-style: none; margin: 0; padding: 0; }
.member-list .member-business, .member-list .member-since { display: block; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }

.chat-list li { border-bottom: 1px solid var(--border); }

.chat-row { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 0.25rem; color: var(--text); text-decoration: none; }

.chat-row:hover { background: var(--surface); color: var(--text); }

.group-avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 1.05rem; }

/* group-kind-picture (A-030): dark blue for announcements, a small lock at the lower right when they also need approval. */
.group-avatar { position: relative; }

.group-avatar.kind-announcements, .group-avatar.kind-both { background: var(--brand); color: #FFFFFF; }

.group-avatar .kind-lock { position: absolute; right: -2px; bottom: -2px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; color: var(--brand); border: 2px solid var(--brand); }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.chat-top, .chat-bottom { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }

.chat-name { font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-time { flex: none; font-size: 0.75rem; color: var(--muted); }

.chat-time.has-unread { color: var(--brand); font-weight: 600; }

.chat-preview { min-width: 0; font-size: 0.9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-preview .badge { margin-right: 0.3rem; }

.chat-sub { font-size: 0.75rem; color: var(--muted); }

.unread-count { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--brand); color: #FFFFFF; font-size: 0.75rem; font-weight: 700; line-height: 22px; text-align: center; }

.more-groups { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 0.25rem; color: var(--brand); font-weight: 600; text-decoration: none; }

.more-groups .group-avatar { background: transparent; border: 2px dashed #9FB4CF; }

/* A row of a list: who or what on the left, its actions on the right; what does not fit moves to the next line. */
.group-list li, .member-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--border); }

.member-about { min-width: 0; flex: 1 1 10rem; display: flex; flex-direction: column; gap: 2px; }

.member-about .meta { font-size: 0.85rem; }

.group-actions { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; max-width: 100%; }

.group-actions form { margin: 0; }

.group-actions form button[type=submit] { margin-top: 0; }

/* Phone: wide or several actions get their own line under the name (group-approval). */
@media (max-width: 767px) {
    .group-actions.own-line { flex-basis: 100%; }

    .group-avatar ~ .group-actions.own-line { padding-left: calc(48px + 0.75rem); }
}

.group-list form { margin: 0; }

.group-list form button[type=submit], .role-actions form button[type=submit] { margin-top: 0; }

.group-summary { min-width: 0; flex: 1 1 7.5rem; display: flex; flex-direction: column; gap: 2px; }

.group-summary .meta { margin: 0; font-size: 0.85rem; }

.overview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.overview-link { display: block; color: inherit; text-decoration: none; }

.overview .message { padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

.overview-link:hover .message, .overview-link:focus .message { border-color: var(--brand); }

.overview .message.emergency { background: var(--emergency-bg); border: 2px solid var(--emergency); }

/* ---- Conversation ---- */
.chat-header { position: sticky; top: 56px; z-index: 40; display: flex; align-items: center; gap: 0.5rem; margin: -1rem -1rem 0; padding: 0.5rem 0.75rem; background: var(--bg); border-bottom: 1px solid var(--border); }

.chat-header .back-link { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--brand); }

.chat-header h1 { margin: 0; font-size: 1.05rem; }

.chat-header .chat-main { gap: 0; }

.group-info { margin: 0; }

.group-info summary { color: var(--muted); font-size: 0.8rem; cursor: pointer; }

.group-info form { margin: 0.25rem 0 0; }

.group-info form button[type=submit] { margin-top: 0.25rem; min-height: 36px; padding-block: 0.3rem; white-space: normal; text-align: left; }

.chat-stream {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 -1rem;
    padding: 0.75rem;
    min-height: 40vh;
    background: var(--chat-bg);
}

.day-separator, .new-separator { align-self: center; padding: 2px 12px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 0.75rem; font-weight: 600; }

.new-separator { background: var(--brand-soft); color: var(--brand); }

.bubble-row { display: flex; gap: 0.5rem; align-items: flex-end; max-width: 88%; }

.bubble-row.own { align-self: flex-end; flex-direction: row-reverse; }

.chat-stream .message {
    min-width: 0;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
    background: var(--bg);
    box-shadow: 0 1px 1px rgba(20, 32, 46, 0.08);
}

.bubble-row.own .message { border-radius: var(--radius) var(--radius) 4px var(--radius); background: var(--own-bubble); }

.chat-stream .message.emergency { padding: 0; overflow: hidden; border: 2px solid var(--emergency); background: var(--emergency-bg); }

.chat-stream .message.emergency > :not(.emergency-strip) { margin-left: 0.65rem; margin-right: 0.65rem; }

.chat-stream .message.emergency > :last-child { margin-bottom: 0.5rem; }

.emergency-strip { display: flex; align-items: center; gap: 6px; padding: 4px 0.65rem; background: var(--emergency); color: #FFFFFF; font-size: 0.8rem; font-weight: 700; }

.message-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.4rem; font-size: 0.85rem; }

.message-header .author { font-weight: 700; color: var(--brand); }

.emergency .message-header .author { color: var(--emergency-text); }

/* IDEA-024: the author's business, on its own line under the name. */
.message .business-name { margin: 0; font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }

.message-header .group-label { font-weight: 600; color: var(--muted); }

.message-text { margin: 0.2rem 0 0; white-space: pre-line; font-size: 0.95rem; }

.quote { display: flex; flex-direction: column; margin: 0.3rem 0 0.15rem; padding: 0.3rem 0.5rem; border-radius: 6px; background: var(--brand-softer); font-size: 0.82rem; color: var(--muted); }

.bubble-row.own .quote { background: var(--own-quote); color: var(--text-2); }

.quote strong { color: var(--brand); font-size: 0.78rem; }

.quote span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.message-footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; margin-top: 0.2rem; font-size: 0.72rem; color: var(--muted); }

.message-footer .reply-count { margin-right: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px; border-radius: 12px; background: var(--brand-softer); color: var(--brand); font-weight: 600; text-decoration: none; }

.new-label { color: var(--brand); font-weight: 700; }

.menu-button { min-height: 28px; min-width: 32px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }

.menu-button:hover { background: rgba(20, 32, 46, 0.06); color: var(--text); }

.message-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }

.message-actions button, .inline-form button { margin-top: 0.4rem; margin-right: 0.4rem; }

.inline-form { flex-basis: 100%; margin-top: 0.3rem; }

.own-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.confirm { font-weight: 600; }

.edit-form { margin-top: 0.3rem; }

.read-only { margin: 0 -1rem; padding: 0.75rem 1rem; background: var(--chat-bg); }

/* ---- Composer ---- */
.composer {
    position: sticky;
    bottom: calc(var(--tab-height) + env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 -1rem;
    padding: 0.6rem 0.75rem 0.75rem;
    background: var(--chat-bg);
    border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
    .composer { bottom: 0; }
}

.composer fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

/* IDEA-008: "new messages" button, just above the composer, while the member reads further up (D-022). */
.new-messages-bar { position: fixed; left: 50%; bottom: var(--new-messages-bottom, 96px); z-index: 40; transform: translateX(-50%); }

.new-messages { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; margin: 0; padding: 0 16px; border: 0; border-radius: 20px; background: var(--brand); color: #FFFFFF; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); white-space: nowrap; }

.new-messages[hidden] { display: none; }

.new-messages svg { transform: rotate(90deg); }

.composer legend { padding: 0; margin-bottom: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }

.category-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.pill { position: relative; margin: 0; }

.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.pill span { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--own-quote); background: var(--bg); color: var(--brand); font-size: 0.85rem; font-weight: 500; cursor: pointer; }

.pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #FFFFFF; font-weight: 700; }

.pill.emergency input:checked + span { background: var(--emergency); border-color: var(--emergency); }

.pill input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

.composer .emergency-notice { margin: 0; }

.reply-banner { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.4rem 0.6rem; border-radius: 8px; background: var(--bg); }

.reply-banner .quote { flex: 1; min-width: 0; margin: 0; }

.reply-banner button { min-height: 36px; min-width: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); }

.composer-row { display: flex; gap: 0.5rem; align-items: flex-end; }

.composer-row textarea { flex: 1; max-width: none; min-height: 48px; max-height: 10rem; padding: 0.7rem 1rem; border: 0; border-radius: 24px; resize: vertical; }

.send-button { flex: none; width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 50%; }

.composer .media-picker { margin: 0; }

.composer .also-post-in { margin: 0; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }

.composer label { margin-top: 0; }

/* ---- Sheet (message actions) ---- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(20, 32, 46, 0.45); }

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    max-width: 760px;
    margin: 0 auto;
    padding: 0.5rem 0 calc(1rem + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    background: var(--bg);
    box-shadow: 0 -4px 16px rgba(20, 32, 46, 0.18);
}

.sheet h2 { margin: 0.25rem 1.25rem 0.5rem; font-size: 0.85rem; color: var(--muted); }

.sheet-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    width: 100%;
    min-height: 52px;
    padding: 0 1.25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font: 400 1rem var(--font);
    text-decoration: none;
}

.sheet-item:hover { background: var(--surface); color: var(--text); }

.sheet-item .icon { color: var(--brand); }

.sheet-item.danger, button.sheet-item.danger:hover { color: var(--danger); font-weight: 600; }

.sheet-item.danger .icon { color: var(--danger); }

.sheet-section { margin: 0.4rem 1.25rem; padding-top: 0.6rem; border-top: 1px solid var(--border); font-size: 0.75rem; font-weight: 600; color: var(--muted); }

.sheet-cancel { display: flex; width: calc(100% - 2rem); margin: 0.6rem 1rem 0; background: var(--brand-softer); color: var(--brand); border-color: var(--brand-softer); }

.sheet-cancel:hover { background: var(--brand-soft); color: var(--brand); }

/* ---- Media ---- */
.media-gallery { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0.4rem 0 0; padding: 0; }

.media-thumb { position: relative; display: block; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: var(--surface); overflow: hidden; cursor: pointer; line-height: 0; }

.media-thumb:hover { background: var(--surface); }

.media-thumb img { width: 120px; height: 120px; object-fit: cover; }

.media-thumb.video::after { content: "▶"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #FFFFFF; text-shadow: 0 0 6px rgba(0, 0, 0, 0.8); line-height: 1; }

.media-placeholder { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; padding: 0.5rem; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--muted); font-size: 0.85rem; text-align: center; }

/* attachment-preview (D-016): attachments before posting, as small pictures with a remove button. */
.staged-files { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0.4rem 0 0; padding: 0; }

.staged { position: relative; }

.staged.refused { display: flex; flex-direction: column; gap: 0.15rem; max-width: 100%; padding: 0.4rem 2.2rem 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }

.staged.refused .file-name { overflow-wrap: anywhere; font-size: 0.85rem; }

.staged-thumb { position: relative; display: block; width: 72px; height: 72px; border-radius: 8px; background: var(--surface); overflow: hidden; line-height: 0; }

.staged-thumb img { width: 100%; height: 100%; object-fit: cover; }

.staged-thumb.pending { display: flex; align-items: center; justify-content: center; padding: 0.3rem; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 0.7rem; line-height: 1.2; text-align: center; }

.staged-thumb.video::after { content: "▶"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #FFFFFF; text-shadow: 0 0 6px rgba(0, 0, 0, 0.8); line-height: 1; }

.staged-length { position: absolute; right: 4px; bottom: 4px; padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.65); color: #FFFFFF; font-size: 0.68rem; line-height: 1.4; }

.staged-remove { position: absolute; top: 2px; right: 2px; min-height: 24px; min-width: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #FFFFFF; font-size: 1rem; line-height: 1; }

.staged-remove:hover { background: rgba(0, 0, 0, 0.8); color: #FFFFFF; }

/* IDEA-015 (A-018): the officials' per-photo choice under its small picture, and the hint that faces are covered. */
.keep-faces, .keep-plates { display: flex; align-items: center; gap: 0.25rem; max-width: 72px; margin: 0.2rem 0 0; font-size: 0.7rem; font-weight: 400; line-height: 1.2; }

.keep-faces input, .keep-plates input { flex: none; width: 1rem; height: 1rem; margin: 0; }

.faces-hint { margin: 0.35rem 0 0; font-size: 0.8rem; }

.media-viewer { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 3rem 0.5rem 0.5rem; background: rgba(0, 0, 0, 0.92); }

.media-viewer img, .media-viewer video { max-width: 100%; max-height: 100%; object-fit: contain; }

.media-viewer:focus { outline: none; }

/* IDEA-038 (A-043): no long-press menu, dragging or selecting on photos and videos of messages. */
[data-protected-media] img, [data-protected-media] video { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }

.media-viewer { flex-direction: column; gap: 0.75rem; }

.media-frame { display: flex; flex: 1 1 auto; min-height: 0; max-width: 100%; align-items: center; justify-content: center; }

.media-download { flex: none; padding: 0.6rem 1.2rem; border-radius: 0.4rem; background: #fff; color: #1F4E8C; font-weight: 600; text-decoration: none; }

.media-download:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.media-close { position: absolute; top: 0.5rem; right: 0.5rem; background: #FFFFFF; color: #000000; border-color: #FFFFFF; }

.media-picker { margin-top: 0.75rem; }

.file-name { font-weight: 600; overflow-wrap: anywhere; }

.edit-media { margin: 0.75rem 0 0; border: 1px solid var(--border); border-radius: 8px; }

.edit-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }

/* ---- Administration (same colours and fonts only, Q-081) ---- */
/* The areas as a matrix of buttons (IDEA-021, D-048): two side by side on a phone, three from 768 px. */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }

.admin-grid li { display: flex; }

.admin-tile {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    min-height: 112px;
    padding: 1rem 0.4rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--brand);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    hyphens: auto;
}

.admin-tile > span { max-width: 100%; }

.admin-tile:hover { background: var(--brand-softer); color: var(--brand-dark); }

.admin-tile .nav-count { position: absolute; top: 0.5rem; right: 0.5rem; left: auto; min-width: 24px; height: 24px; border-radius: 12px; font-size: 0.8rem; line-height: 24px; }

@media (min-width: 768px) {
    .admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .admin-tile { font-size: 0.95rem; }
}

.table-scroll { overflow-x: auto; }

table.list { border-collapse: collapse; width: 100%; }

table.list th, table.list td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }

.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin-bottom: 1rem; }

.search label { flex-basis: 100%; }

.search input { flex: 1 1 12rem; }

.search button[type=submit] { margin-top: 0; }

.language button[type=submit] { margin-top: 0; }

.role-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.back { margin: 0 0 0.25rem; }

.also-post-in { margin: 0.75rem 0 0; border: 1px solid var(--border); border-radius: 8px; }

.official-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.official-form select { width: auto; }

.reported-text { margin: 0.4rem 0; padding: 0.4rem 0.75rem; border-radius: 6px; background: var(--surface); white-space: pre-line; }

.report-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }

.report-actions form { flex: 1 1 16rem; }

.notice-list { list-style: none; margin: 0; padding: 0; }

.notice-list li { padding: 0.5rem 0; border-top: 1px solid var(--border); }

.notice-list li:first-child { border-top: 0; }

.unread-notice p:first-of-type { font-weight: 700; }

.notices { background: var(--emergency-bg); border-color: var(--emergency-border); }

.block-form input[type=datetime-local] { max-width: 16rem; }

.provider-mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-softer); color: var(--brand); font-weight: 700; }

.category-chip { align-self: flex-start; min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--own-quote); background: var(--bg); color: var(--brand); font-size: 0.85rem; }

.category-chip:hover { background: var(--brand-softer); color: var(--brand); }

.category-chip.emergency { background: var(--emergency); border-color: var(--emergency); color: #FFFFFF; }

.attach-button { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 48px; margin: 0; border-radius: 50%; color: var(--muted); cursor: pointer; }

.attach-button:hover { background: var(--bg); color: var(--brand); }

button.sheet-item, button.sheet-item.danger, button.sheet-item:hover { border: 0; background: transparent; }

button.sheet-item:hover, a.sheet-item:hover { background: var(--surface); }

/* The compact media picker is not a row of its own: only its list of chosen files takes space. */
.composer .media-picker { display: contents; }

button, .button { white-space: nowrap; }

/* The accept button's text is long ("Ik ga akkoord met de voorwaarden en de privacyverklaring"): on a phone it wraps
   onto two lines instead of making the page scroll sideways (INC-018). */
.terms-accept button { max-width: 100%; white-space: normal; text-align: center; line-height: 1.3; padding-block: 0.5rem; }

.group-list form { flex: none; }

.group-summary .badge { align-self: flex-start; }

.reply-button { color: var(--brand); }

/* Scrolling to the newest message stops above the sticky composer and tab bar. */
#conversation-end { scroll-margin-bottom: calc(var(--tab-height) + 9rem); }

@media (min-width: 768px) {
    #conversation-end { scroll-margin-bottom: 9rem; }
}

.site-main:has(.composer) { padding-bottom: var(--tab-height); }

@media (min-width: 768px) {
    .site-main:has(.composer) { padding-bottom: 0; }
}

/* The first-time welcome (IDEA-010): the letters or picture centred above the upload, the skip below it. */
.welcome-step .avatar { display: flex; align-items: center; justify-content: center; margin: 0.5rem auto 1rem; font-size: 2rem; }
.welcome-skip { margin-top: 0.75rem; }

/* Installing the app (IDEA-012): a quiet panel with a close button in the corner. */
.install-app { position: relative; display: flex; gap: 0.75rem; margin-top: 1rem; padding: 1rem 3rem 1rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--brand-softer); }
.install-app[hidden], .install-app [hidden] { display: none; }
.install-app p { margin: 0.25rem 0 0; }
.install-app .install-button { margin-top: 0.75rem; }
.install-close { position: absolute; top: 0.25rem; right: 0.25rem; min-height: 44px; width: 44px; padding: 0; border: 0; background: transparent; color: var(--text-2); }
.install-close:hover { background: var(--brand-soft); color: var(--brand); }

/* Account deletion (INC-021): the confirmation page. */
.delete-account ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.delete-account form { display: inline; }
.delete-account .button.secondary { margin: 0.75rem 0 0 0.5rem; }

/* IDEA-014, D-034: frequently asked questions on About — a panel per subject, one question open at a time. */
.faq { margin: 1.5rem 0; }
/* IDEA-029 (A-031): the search field above the subjects; what the search leaves out is hidden. */
.faq [hidden] { display: none !important; }
.faq-search { margin: 0 0 0.75rem; }
.faq-search label { display: block; margin-bottom: 0.3rem; font-weight: 600; }
.faq-search input { width: 100%; min-height: 48px; }
.faq-search .meta { min-height: 1.4em; margin: 0.35rem 0 0; }
.faq-group { padding: 0.75rem; }
.faq-group h3 { display: flex; align-items: center; gap: 0.6rem; margin: 0.25rem 0 0.6rem; font-size: 1.05rem; }
.faq-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.faq details { margin: 0.4rem 0 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.faq details[open] { border-color: var(--brand-soft); background: var(--brand-softer); box-shadow: inset 3px 0 0 var(--brand); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 48px; padding: 0.6rem 0.85rem; font-weight: 600; cursor: pointer; list-style: none; border-radius: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; color: var(--muted); transition: transform 0.15s ease; }
.faq details[open] summary { color: var(--brand); }
.faq details[open] summary svg { transform: rotate(90deg); color: var(--brand); }
.faq summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.faq details p { margin: 0; padding: 0 0.85rem 0.85rem; overflow-wrap: anywhere; }

/* Notifications on this device (IDEA-022): only the line and the button that apply. */
#push [hidden] { display: none; }
.push-choices fieldset { margin: 1rem 0 0; padding: 0; border: 0; min-width: 0; }
.push-choices legend { padding: 0; }
.push-choices label.checkbox { min-height: 44px; margin: 0; }
.push-choices input[type=checkbox] { flex: none; }

/* IDEA-031 (A-033): the monitoring page as a control-room view; this page alone uses the full width. */
.site-main:has(.monitor) { max-width: none; }
.monitor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
/* Narrow: choices, then the summary, then the list (A-033); wide: the columns in their own order. */
.monitor-summary { order: 1; }
.monitor-shown { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.4rem; min-width: 0; }
.monitor-shown-lead { line-height: 32px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.filter-pills { display: flex; flex: 1 1 0; flex-wrap: wrap; gap: 0.4rem; min-width: 12rem; margin: 0; padding: 0; list-style: none; }
.filter-pill { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; min-height: 32px; padding: 0.2rem 0.7rem; border: 1px solid var(--brand); border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 0.85rem; font-weight: 600; }
.filter-pill > span:not(.group-avatar) { min-width: 0; overflow-wrap: anywhere; }
.filter-pill .group-avatar { width: 22px; height: 22px; flex: none; }
.filter-pill .group-avatar .icon { width: 13px; height: 13px; }
.filter-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 0; margin: -0.2rem -0.5rem -0.2rem 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--brand-dark); }
.filter-remove:hover { background: var(--brand-softer); }
.time-pick { position: relative; display: inline-flex; align-items: center; margin-left: auto; color: var(--brand-dark); }
.time-pick > .icon { position: absolute; left: 0.7rem; pointer-events: none; }
.time-pick > .icon:last-child { left: auto; right: 0.6rem; transform: rotate(90deg); }
.time-pick-select { display: inline-block; width: auto; max-width: 100%; appearance: none; min-height: 32px; padding: 0.2rem 2rem 0.2rem 2.1rem; border: 1px solid var(--brand); border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.time-pick-select:hover { background: var(--brand-softer); }
.monitor-list { order: 2; }
.monitor-filters-toggle { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 48px; border: 1px solid var(--border); background: var(--surface); color: var(--brand); font-weight: 600; justify-content: flex-start; }
.monitor-filters-toggle .icon:last-child { margin-left: auto; transition: transform 0.15s ease; }
.monitor-choices.open .monitor-filters-toggle .icon:last-child { transform: rotate(90deg); }
.monitor-choice-fields { display: none; padding: 0.75rem 0 0; }
.monitor-choices.open .monitor-choice-fields { display: block; }
.monitor-choice { margin: 0 0 1rem; }
.monitor-choice h2 { margin: 0 0 0.35rem; font-size: 0.95rem; }
/* IDEA-032 (A-034): toggles in the style of the Beheer buttons; "on" in the app's blue with a check mark. */
.toggle-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.toggle-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; min-height: 88px; padding: 0.6rem 0.4rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--brand); font-size: 0.85rem; font-weight: 600; line-height: 1.25; text-align: center; white-space: normal; hyphens: auto; }
.toggle-card > span:not(.toggle-check) { max-width: 100%; overflow-wrap: anywhere; }
.toggle-card:hover, .toggle-button:hover { background: var(--brand-softer); }
.toggle-card.on, .toggle-button.on { border: 2px solid var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.toggle-check { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #FFFFFF; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.toggle-button { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0.35rem 0.75rem; border: 1px solid var(--border-strong); border-radius: 22px; background: var(--bg); color: var(--brand); font-size: 0.85rem; font-weight: 600; }
.monitor-sound { margin-top: 0.25rem; }
/* The summary as cards (Q-248 B). */
.count-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin: 0 0 0.75rem; padding: 0; list-style: none; }
.count-card { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; min-height: 104px; padding: 0.75rem 0.4rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--brand); text-align: center; }
.count-card strong { font-size: 1.6rem; line-height: 1.1; color: var(--text); }
.count-card span:last-child { font-size: 0.85rem; font-weight: 600; overflow-wrap: anywhere; }
.count-card.emergency { border: 2px solid var(--emergency); background: var(--emergency-bg); color: var(--emergency); }
.count-card.emergency strong { color: var(--emergency); }
.monitor-emergencies { margin: 0 0 1rem; padding: 0.75rem; border: 2px solid var(--emergency); border-radius: var(--radius); background: var(--emergency-bg); }
.monitor-emergencies h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-size: 1.1rem; color: #7A3E00; }
.monitor-summary h2 { margin-top: 0; font-size: 1.1rem; }
.monitor-summary h3 { margin: 1rem 0 0.3rem; font-size: 0.95rem; }
@media (min-width: 1200px) {
    .monitor { grid-template-columns: 20rem minmax(0, 1fr) 20rem; align-items: start; }
    .monitor { grid-template-rows: auto 1fr; }
    .monitor-choices { grid-column: 1; grid-row: 1 / span 2; }
    .monitor-shown { grid-column: 2; grid-row: 1; }
    .monitor-list { grid-column: 2; grid-row: 2; }
    .monitor-summary { grid-column: 3; grid-row: 1 / span 2; }
    .monitor-filters-toggle { display: none; }
    .monitor-choice-fields { display: block; padding: 0; }
    .monitor-choices, .monitor-summary { position: sticky; top: 1rem; }
}
