/*
 * Copyright (c) 2026 Feuerwehr Worb. All rights reserved.
 *
 * UI-Redesign 06/2026: modernisiertes Erscheinungsbild.
 * Alle Klassennamen und das funktionale Verhalten (Nav-Toggle,
 * Combo-Selects, Drag & Drop, Modals) sind unveraendert.
 */

:root {
    --bg: #f2f4f7;
    --panel: #ffffff;
    --ink: #1c2430;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --red: #d81920;
    --red-dark: #b01218;
    --red-soft: #fdf0f0;
    --yellow: #f7d600;
    --dark: #14171c;
    --success: #16784f;
    --danger: #b42323;
    --radius: 12px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --text-line-height: 1.45;
    --reading-line-height: 1.6;
    --panel-padding: 20px;
    --panel-spacing: 18px;
    --table-row-padding: 12px;
}

:root[data-density="medium"] {
    font-size: 93.75%;
    --text-line-height: 1.4;
    --reading-line-height: 1.5;
    --panel-padding: 17px;
    --panel-spacing: 15px;
    --table-row-padding: 10px;
}

:root[data-density="compact"] {
    font-size: 87.5%;
    --text-line-height: 1.35;
    --reading-line-height: 1.45;
    --panel-padding: 14px;
    --panel-spacing: 12px;
    --table-row-padding: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    letter-spacing: 0;
    line-height: var(--text-line-height);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(216, 25, 32, .16);
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid rgba(216, 25, 32, .35);
    outline-offset: 2px;
}

input,
select,
textarea,
button {
    font: inherit;
}

.pwa-update-banner {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--red);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-lg);
    color: var(--ink);
}

.pwa-update-banner span {
    font-weight: 700;
}

.pwa-update-banner .button {
    width: auto;
    min-height: 36px;
    padding: 8px 13px;
    white-space: nowrap;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(216, 25, 32, .13);
}

textarea {
    resize: vertical;
}

summary {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.enhanced-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.combo-select {
    position: relative;
    display: grid;
    gap: 5px;
}

.combo-input {
    min-height: 42px;
}

.combo-options {
    position: fixed;
    z-index: 1000;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.combo-select.is-open .combo-options,
.combo-options.is-open {
    display: block;
}

.combo-options-portal {
    right: auto;
}

.combo-option,
.combo-empty {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 0;
    padding: 8px 12px;
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.combo-option:hover,
.combo-option:focus,
.combo-option.is-selected {
    background: var(--red-soft);
    color: var(--red-dark);
}

.combo-option:disabled {
    color: #a7b0bb;
    cursor: not-allowed;
}

.combo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.combo-tag {
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 11px;
    background: #eef2f6;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.wizard-steps a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, color .15s ease;
}

.wizard-steps a:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.wizard-steps a.active {
    border-color: rgba(216, 25, 32, .45);
    background: var(--red-soft);
    color: var(--red-dark);
}

.wizard-steps span {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--dark);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.wizard-steps a.active span {
    background: var(--red);
}

.actions-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.compact-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 10px 8px 0;
    font-size: 13px;
    color: var(--muted);
}

.compact-check input {
    margin: 0;
}

.agenda-edit-actions {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 16px;
}

.agenda-edit-actions .agenda-delete-form {
    margin-left: auto;
}

.agenda-delete-button.button.danger {
    border-color: rgba(180, 35, 35, .45);
    background: #fff;
    color: var(--danger);
}

.agenda-delete-button.button.danger:hover {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.agenda-secondary-action {
    display: grid;
    grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr);
    gap: 16px;
    align-items: end;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    background: #f8fafc;
}

.agenda-secondary-action-copy h4,
.agenda-secondary-action-copy p {
    margin: 0;
}

.agenda-secondary-action-copy h4 {
    font-size: 0.9375rem;
}

.agenda-secondary-action-copy p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.agenda-file-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.agenda-file-form label {
    min-width: 0;
}

.agenda-convert-form {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(190px, 1.2fr) auto;
    gap: 10px;
    align-items: end;
}

.icon-delete-button {
    width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #f0c2c2;
    border-radius: var(--radius-sm);
    background: #fdf3f3;
    color: var(--danger);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.icon-delete-button svg {
    width: 18px;
    height: 18px;
}

.icon-delete-button:hover {
    background: #fbe4e4;
    border-color: #e3a2a2;
}

.standard-template-list .protocol-item {
    margin-bottom: 8px;
}

.standard-template-list .protocol-title {
    align-items: center;
    margin-bottom: 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 18, 24, .55);
    backdrop-filter: blur(2px);
}

.modal-panel {
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.modal-panel h2 {
    margin-top: 0;
}

/* Warte-Overlay für länger laufende Formular-Aktionen (z.B. PDF-Erzeugung beim Protokollversand) */
.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 18, 24, .55);
    backdrop-filter: blur(2px);
}

.busy-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    min-width: 260px;
    max-width: 420px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 28px 32px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.busy-card p {
    margin: 0;
    font-weight: 600;
}

.busy-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 4px solid var(--line);
    border-top-color: var(--red);
    animation: busy-spin .8s linear infinite;
}

@keyframes busy-spin {
    to {
        transform: rotate(360deg);
    }
}

.standard-preview-list {
    display: grid;
    gap: 6px;
    margin: 16px 0;
}

.standard-preview-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: #fff;
}

.standard-preview-item.is-group {
    background: #f1f4f8;
    font-weight: 700;
}

.standard-preview-item.is-child {
    margin-left: 28px;
}

.standard-preview-item small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-weight: 600;
}

label {
    display: grid;
    gap: 6px;
    color: #44505e;
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Login / Install / Gast ---------- */

.login-screen,
.install-screen,
.guest-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 480px at 85% -10%, rgba(216, 25, 32, .28), transparent 64%),
        radial-gradient(700px 420px at -10% 100%, rgba(247, 214, 0, .12), transparent 60%),
        linear-gradient(160deg, #181b21 0%, #101216 100%);
}

.login-panel,
.install-panel,
.guest-panel {
    width: min(420px, 100%);
    background: var(--panel);
    border-radius: 18px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.guest-panel {
    width: min(1100px, 100%);
}

.login-logo,
.install-logo,
.guest-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    margin-bottom: 22px;
    background: #000;
    border-radius: 12px;
}

.login-panel h1,
.install-panel h1 {
    margin: 0;
    font-size: 1.75rem;
    letter-spacing: -.02em;
}

.login-panel p {
    margin: 6px 0 24px;
    color: var(--muted);
}

.login-panel form,
.install-panel form {
    display: grid;
    gap: 16px;
}

.install-panel .notice > span {
    min-width: 0;
}

.install-panel .notice code {
    white-space: nowrap;
}

.login-links {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 0.875rem;
}

.login-links a {
    color: var(--red);
    font-weight: 700;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.app-version-link {
    display: inline-flex;
    margin-top: 18px;
    color: #8792a2;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.app-version-link:hover {
    color: var(--red);
}

.app-info-panel {
    width: min(520px, 100%);
}

.app-info-list {
    display: grid;
    gap: 10px;
    margin: 22px 0;
}

.app-info-list div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.app-info-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.app-info-list dd {
    margin: 0;
    font-weight: 600;
}

.app-info-list a {
    color: var(--red);
    text-decoration: none;
}

.app-info-list a:hover {
    text-decoration: underline;
}

/* ---------- App-Grundgeruest ---------- */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px 1fr;
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #1a1d23 0%, #131519 100%);
    color: #fff;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
}

.nav-toggle,
.nav-toggle-button {
    display: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px;
    text-decoration: none;
    font-weight: 700;
}

.brand span {
    display: grid;
    gap: 2px;
}

.brand small {
    color: #9aa3af;
    font-size: 12px;
    font-weight: 600;
}

.brand img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #000;
    border-radius: 10px;
}

.sidebar nav {
    display: grid;
    gap: 3px;
}

.sidebar nav a,
.logout {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: var(--radius-sm);
    padding: 0 12px;
    color: #b6bdc7;
    font-size: 0.90625rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.sidebar nav a .nav-icon,
.logout .nav-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #828b97;
    transition: color .15s ease;
}

.sidebar nav a .nav-icon svg,
.logout .nav-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar nav a:hover,
.logout:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.sidebar nav a:hover .nav-icon,
.logout:hover .nav-icon {
    color: #fff;
}

.sidebar nav a.active {
    background: rgba(216, 25, 32, .16);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--red);
}

.sidebar nav a.active .nav-icon {
    color: #ff5a5f;
}

.logout {
    margin-top: auto;
}

.sidebar-version {
    margin-top: auto;
    padding: 10px 12px 0;
    color: #6f7885;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-version:hover {
    color: #fff;
}

.sidebar-version + .logout {
    margin-top: 4px;
}

.pwa-install-panel .actions-row {
    align-items: center;
}

.pwa-version-button {
    background: #fff5f5;
    border-color: #ffc9c9;
    color: var(--red);
    box-shadow: 0 8px 18px rgba(216, 25, 32, .12);
}

.pwa-version-button:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.pwa-install-hint {
    margin-top: 12px;
}

.topbar a {
    color: inherit;
    text-decoration: none;
}

.content {
    padding: 28px 32px 40px;
    background:
        linear-gradient(90deg, var(--red) 0 14%, #ffae00 14% 22%, var(--yellow) 22% 28%, transparent 28%) top left / 100% 4px no-repeat,
        var(--bg);
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 14px 5px 6px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.user-chip:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(160deg, #2a2f37, var(--dark));
    color: var(--yellow);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
}

.user-chip-text {
    display: grid;
    gap: 0;
    line-height: 1.25;
}

.user-chip-text strong {
    font-size: 0.875rem;
}

.user-chip-text span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.page-head {
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -.02em;
    overflow-wrap: anywhere;
}

.page-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.page-actions form {
    margin: 0;
}

/* ---------- Karten / Panels ---------- */

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metrics > div,
.metrics > a,
.split > div,
.form-panel,
.table-panel,
.protocol-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--panel-padding);
    box-shadow: var(--shadow-sm);
}

.metrics > div,
.metrics > a {
    position: relative;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.metrics > div::before,
.metrics > a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--red), #ff7a30 60%, var(--yellow));
    opacity: .85;
}

.metrics > a:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-md);
}

.metrics > a:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 3px;
}

.topic-accordion-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.topic-accordion-panel summary::-webkit-details-marker {
    display: none;
}

.topic-accordion-panel summary::after {
    content: "+";
    color: var(--muted);
    font-size: 1.375rem;
    line-height: 1;
}

.topic-accordion-panel[open] summary::after {
    content: "−";
}

.topic-accordion-panel summary h2 {
    margin: 0;
}

.topic-accordion-panel .sortable-table {
    margin-top: 14px;
}

.planning-accordion:not([open]):hover,
.planning-accordion:not([open]):has(> summary:focus-visible) {
    background-color: #eef1f5;
}

.metrics strong {
    display: block;
    font-size: 2.125rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.metrics span,
.task-list,
.compact-list {
    color: var(--muted);
}

.task-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
}

.task-list li {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.task-list li.task-due-soon,
.task-list li.task-due-overdue {
    margin: 0 -10px;
    padding: 9px 10px 9px 14px;
    border-left: 4px solid transparent;
    border-radius: var(--radius-sm);
}

.task-list li.task-due-soon:first-child,
.task-list li.task-due-overdue:first-child {
    padding-top: 9px;
}

.task-list li.task-due-soon:last-child,
.task-list li.task-due-overdue:last-child {
    padding-bottom: 9px;
}

.task-list li.task-due-soon {
    background: #fff7db;
    border-left-color: #f2b705;
    border-bottom-color: #f4dfa3;
}

.task-list li.task-due-overdue {
    background: #fff0f0;
    border-left-color: #d81920;
    border-bottom-color: #f0b8b8;
}

.task-list li.task-due-soon:hover {
    background: #fff1c2;
}

.task-list li.task-due-overdue:hover {
    background: #ffe1e1;
}

.task-list li:first-child {
    padding-top: 0;
}

.task-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.task-list a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.task-list a:hover {
    color: var(--red-dark);
    text-decoration: underline;
}

.task-list small {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.dashboard-split {
    margin-bottom: 18px;
}

h2 {
    margin: 0 0 14px;
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.compact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.compact-list span,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: #eef2f6;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #3c4a5a;
}

.badge.high {
    background: #fdf3cd;
    color: #8a6d00;
}

.badge.urgent {
    background: #fde5e5;
    color: var(--danger);
}

.function-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.function-badge {
    min-height: 24px;
    background: #e8f3e9;
    color: #245331;
    font-size: 12px;
}

.role-badges,
.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-badge {
    min-height: 24px;
    gap: 6px;
    background: #eef1f5;
    color: #273442;
    font-size: 12px;
}

.role-badge strong {
    color: #111827;
    letter-spacing: .04em;
}

.status-badge {
    min-height: 24px;
    font-size: 12px;
}

.status-active {
    background: #dcf3e6;
    color: #17633a;
}

.status-inactive {
    background: #fde5e5;
    color: #9f1d1d;
}

.status-admin {
    background: #ece4fb;
    color: #5c2f9b;
}

.user-contact,
.user-platoon {
    white-space: nowrap;
}

.filter-set-admin {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.filter-set-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 140px auto auto auto;
    gap: 12px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.filter-set-create {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.function-checkboxes {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.function-checkboxes legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.function-checkboxes label {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: #f1f4f8;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 600;
}

.function-checkboxes small {
    color: var(--muted);
}

.summary-list {
    margin: 6px 0 10px;
    padding-left: 20px;
}

.summary-list li {
    margin: 3px 0;
}

.summary-heading {
    margin: 12px 0 0;
}

.summary-agenda-list {
    display: grid;
    gap: 3px;
    margin-top: 8px;
}

.summary-agenda-group {
    margin-top: 10px;
    color: var(--red-dark);
    font-weight: 700;
}

.summary-agenda-group:first-child {
    margin-top: 0;
}

.summary-agenda-item,
.summary-agenda-group {
    display: flex;
    gap: 2px;
}

.summary-agenda-number {
    flex: 0 0 auto;
    min-width: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.summary-agenda-item.is-child {
    padding-left: 30px;
}

.summary-agenda-item.is-child .summary-agenda-number {
    min-width: 34px;
}

.form-panel,
.table-panel,
.protocol-list {
    margin-bottom: var(--panel-spacing);
}

.table-panel {
    overflow-x: auto;
    scrollbar-width: thin;
}

.table-panel::-webkit-scrollbar {
    height: 8px;
}

.table-panel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c2ccd6;
}

.table-panel::-webkit-scrollbar-track {
    background: transparent;
}

.opening-panel {
    overflow: visible;
}

.attendance-response-panel {
    border-left: 5px solid var(--accent, #b41720);
}

.attendance-response-panel .page-actions {
    justify-content: flex-start;
}

.attendance-response-detail {
    max-width: 52ch;
    color: #7c4a00;
    line-height: 1.4;
}

.opening-panel .session-role-form,
.opening-panel label,
.opening-panel .combo-select {
    min-width: 0;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .875rem;
    align-items: end;
}

.profile-display-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .875rem;
}

.span-4 {
    grid-column: span 4;
}

.form-hints {
    margin: 0 0 16px;
    padding-left: 20px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.form-hints li + li {
    margin-top: 3px;
}

.form-break {
    grid-column: 1 / -1;
    height: 0;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: end;
}

.agenda-insert-form,
.insert-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.insert-kind-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.insert-kind-grid legend {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.insert-kind-grid label {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s ease, background .15s ease;
}

.insert-kind-grid input {
    width: auto;
}

.insert-kind-grid label:has(input:checked) {
    border-color: var(--red);
    background: var(--red-soft);
}

.insert-fields {
    grid-column: 1 / -1;
}

.insert-fields[hidden] {
    display: none;
}

.committee-tabs {
    margin-bottom: 18px;
}

/* ---------- Buttons ---------- */

.button {
    min-height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.button:hover {
    border-color: #aeb9c6;
    box-shadow: var(--shadow-md);
}

.btn-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.icon-only-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
}

.icon-only-button .btn-icon {
    margin: 0;
}

.topic-edit-modal {
    display: none;
}

.topic-edit-modal:target {
    display: grid;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-head h2 {
    margin: 0;
}

.modal-panel .actions-row {
    grid-column: 1 / -1;
    align-items: center;
}

.ai-category-modal {
    width: min(900px, 100%);
}

.glossary-layout {
    display: grid;
    gap: 18px;
}

.glossary-term-form {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, auto);
}

.glossary-term-form .span-4 {
    grid-column: 1 / -1;
}

.form-actions-inline {
    display: flex;
    align-items: end;
}

.form-actions-inline .button {
    width: auto;
    min-width: 150px;
}

.ai-category-create-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 140px 120px auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.ai-category-create-form .button {
    width: auto;
    min-width: 170px;
}

.ai-category-list {
    display: grid;
    gap: 8px;
}

.ai-category-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 140px 110px 92px;
    gap: 10px;
    align-items: end;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.ai-category-row label {
    display: grid;
    gap: 5px;
    margin: 0;
}

.ai-category-row label span,
.ai-category-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ai-category-row .check-line {
    min-height: 44px;
    margin: 0;
}

.ai-category-row .table-action-cell {
    justify-content: flex-start;
}

.ai-category-head {
    align-items: center;
    padding-top: 0;
}

.ai-category-head span {
    padding: 0 0 2px;
}

@media (max-width: 820px) {
    .glossary-term-form,
    .ai-category-create-form,
    .ai-category-row {
        grid-template-columns: 1fr;
    }

    .ai-category-head {
        display: none;
    }
}

.task-read-facts {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.task-read-facts dd {
    white-space: normal;
}

.task-read-description {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.task-read-description h3 {
    margin: 0 0 8px;
}

.button.primary {
    border-color: var(--red);
    background: linear-gradient(180deg, #e6242b, var(--red) 55%, #c81117);
    color: #fff;
    box-shadow: 0 2px 8px rgba(216, 25, 32, .32);
}

.button.primary:hover {
    border-color: var(--red-dark);
    background: linear-gradient(180deg, #d81920, #c01016);
    box-shadow: 0 4px 14px rgba(216, 25, 32, .38);
}

.button.ghost {
    background: transparent;
    box-shadow: none;
}

.button.ghost:hover {
    background: #fff;
}

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

.button.danger:hover {
    background: #9c1d1d;
    border-color: #9c1d1d;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meeting-actions-cell {
    min-width: 104px;
}

.meeting-actions-cell form {
    margin: 0;
}

/*
 * Kompakte Tabellen-Aktionen: nur Icon, Beschriftung bleibt fuer
 * Screenreader erhalten (.action-label) und als Tooltip (title-Attribut).
 */
.compact-action {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-color: var(--line);
    background: #fff;
    color: #4a5666;
    font-size: 0.875rem;
    white-space: nowrap;
}

.compact-action:hover {
    color: var(--red-dark);
    border-color: rgba(216, 25, 32, .35);
    background: var(--red-soft);
}

.compact-action span[aria-hidden="true"] {
    display: inline-grid;
    place-items: center;
    font-size: 1.0625rem;
    line-height: 1;
}

.compact-action svg {
    width: 17px;
    height: 17px;
}

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

.compact-action:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.danger-text {
    color: var(--danger);
    border-color: rgba(180, 35, 35, .3);
}

.danger-text:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

/*
 * Tabellen mit .stack-table werden auf schmalen Screens zu Karten:
 * kein Querscrollen. Zellen mit data-label erhalten eine kleine
 * Beschriftung (CSS attr()).
 */
@media (max-width: 760px) {
    .stack-table {
        min-width: 0;
    }

    .stack-table thead {
        display: none;
    }

    .stack-table tbody {
        display: grid;
        gap: 10px;
    }

    .stack-table tr {
        display: block;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 12px 14px;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }

    .stack-table tr.task-due-soon {
        background: #fffaf0;
    }

    .stack-table tr.task-due-overdue {
        background: #fff3f3;
    }

    .stack-table tbody tr:hover {
        background: #fff;
    }

    .stack-table tbody tr.task-due-soon:hover {
        background: #fff4d6;
    }

    .stack-table tbody tr.task-due-overdue:hover {
        background: #ffe7e7;
    }

    .stack-table td {
        display: block;
        border: 0;
        padding: 0;
    }

    .stack-table td + td {
        margin-top: 8px;
    }

    .stack-table td:empty {
        display: none;
    }

    .stack-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 1px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    /* Sitzungsliste: Gremium ausblenden, Datum hervorheben, Aktionen abtrennen */
    .meetings-table td:nth-child(2) {
        display: none;
    }

    .meetings-table td:nth-child(3) {
        margin-top: 6px;
        color: var(--muted);
        font-weight: 600;
    }

    .meetings-table td.actions-cell {
        display: flex;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }

    .meeting-actions-cell {
        min-width: 0;
        gap: 8px;
    }
}

.danger-zone {
    border-color: #f0c2c2;
}

.notice {
    border-radius: var(--radius-sm);
    border-left: 4px solid #94a3b8;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #eef2f6;
}

.notice.success,
.notice.danger,
.notice.info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notice.success::before,
.notice.danger::before,
.notice.info::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    background: currentColor;
    -webkit-mask: var(--notice-icon) center / contain no-repeat;
    mask: var(--notice-icon) center / contain no-repeat;
}

.notice.success {
    --notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.1V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpath d='m9 11 3 3L22 4'/%3E%3C/svg%3E");
    border-left-color: var(--success);
    background: #e4f4ec;
    color: #115c3c;
}

.notice.danger {
    --notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
    border-left-color: var(--danger);
    background: #fdecec;
    color: #8c1c1c;
}

.notice.info {
    --notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1d4b7a;
}

/* ---------- Tabellen ---------- */

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: var(--table-row-padding) 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

tbody tr {
    transition: background .12s ease;
}

tbody tr:hover {
    background: #f7f9fb;
}

tbody tr.task-due-soon {
    background: #fffaf0;
}

tbody tr.task-due-soon:hover {
    background: #fff4d6;
}

tbody tr.task-due-overdue {
    background: #fff3f3;
}

tbody tr.task-due-overdue:hover {
    background: #ffe7e7;
}

tbody tr.task-due-soon td:first-child {
    border-left: 4px solid #f2b705;
}

tbody tr.task-due-overdue td:first-child {
    border-left: 4px solid #d81920;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.sortable-table th {
    cursor: pointer;
    user-select: none;
    transition: color .12s ease;
}

.sortable-table th:hover {
    color: var(--ink);
}

/* Leere Tabellenzustaende ("Keine ...") dezent darstellen */
td[colspan] {
    color: var(--muted);
}

.sortable-table th[aria-sort="ascending"]::after {
    content: " ▲";
    font-size: 9px;
}

.sortable-table th[aria-sort="descending"]::after {
    content: " ▼";
    font-size: 9px;
}

.compact-role-table {
    table-layout: fixed;
}

.compact-role-table th:first-child,
.compact-role-table td:first-child {
    width: 16%;
}

.compact-role-table td {
    font-size: 13px;
    line-height: 1.45;
}

.committee-role-list {
    display: block;
    overflow-wrap: anywhere;
}

td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
}

td a {
    text-decoration: none;
}

td a:hover {
    color: var(--red-dark);
    text-decoration: underline;
}

.protocol-list {
    display: grid;
    gap: 14px;
}

.agenda-category-heading {
    border-left: 5px solid var(--red);
    padding: 6px 0 6px 14px;
}

.agenda-category-heading h2 {
    margin: 0 0 4px;
}

.agenda-category-heading p {
    margin: 0;
    color: var(--muted);
}

.protocol-title {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.agenda-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.agenda-attachment-indicator {
    margin-left: auto;
    align-self: center;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
    flex: 0 0 auto;
}

.agenda-number {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    color: var(--yellow);
    font-weight: 700;
    flex: 0 0 auto;
}

.agenda-title-heading::after {
    content: "▾";
    display: inline-block;
    margin-left: 10px;
    color: var(--muted);
    font-size: 0.9375rem;
}

.agenda-title-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.agenda-title-heading {
    display: block;
    font-size: 1.3125rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
}

.agenda-run-item .agenda-title-heading {
    font-size: 1.75rem;
}

.agenda-description {
    display: block;
    margin: 0;
    color: var(--muted);
}

.agenda-description[hidden] {
    display: none;
}

.agenda-meta {
    display: block;
    color: var(--red-dark);
    font-size: 13px;
    font-weight: 700;
}

.agenda-run-item {
    display: grid;
    gap: 16px;
}

.preparation-copy-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft, #f7f9fb);
}

.preparation-copy-action small {
    color: var(--muted);
}

.agenda-run-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.run-step-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    border-bottom: 3px solid #d3d9e1;
    margin: 0 0 18px;
    padding: 0 0 6px;
}

.run-step-action {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0 auto;
}

.run-step-action .button {
    min-height: 54px;
    white-space: nowrap;
}

.run-step-nav a {
    min-width: 104px;
    min-height: 74px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: #6b7686;
    text-decoration: none;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}

.run-step-nav a:hover {
    background: #f1f4f8;
    color: var(--ink);
}

.run-step-nav a.done {
    background: #ecf7f0;
    color: #2c6648;
}

.run-step-nav a.in_progress {
    background: #fdf6d8;
    color: #7a6206;
}

.run-step-nav a.active {
    border-color: var(--line);
    border-bottom: 5px solid var(--red);
    background: #fff;
    color: var(--red-dark);
}

.run-step-icon {
    display: inline-grid;
    place-items: center;
    font-size: 1.875rem;
    line-height: 1;
}

.run-step-icon svg {
    width: 26px;
    height: 26px;
}

.participant-list {
    display: grid;
    gap: 10px;
}

.participant-row {
    min-height: 62px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding-right: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.participant-row strong {
    overflow-wrap: anywhere;
}

.participant-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.participant-name-cell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    align-items: center;
}

.participant-name-cell strong,
.participant-name-cell small {
    min-width: 0;
    grid-column: 1;
}

.participant-name-cell .meeting-role-pill {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
}

.guest-name-cell {
    grid-template-columns: minmax(0, 1fr);
}

.guest-name-cell small {
    grid-column: 1;
}

.participant-subsection-title {
    margin-top: 24px;
}

.role-adjust-panel {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
}

.role-adjust-panel h3 {
    margin: 0 0 6px;
}

.role-adjust-panel .muted {
    margin: 0 0 12px;
}

.status-form {
    margin: 0;
}

.attendance-icon {
    width: 62px;
    min-height: 62px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0;
    color: #142018;
    font-size: 1.875rem;
    font-weight: 700;
    text-decoration: none;
}

button.attendance-icon {
    cursor: pointer;
}

.status-invited {
    background: #cdefdb;
}

.status-present {
    background: #16784f;
    color: #fff;
}

.status-excused {
    background: #fbdf85;
}

.status-absent {
    background: #f3b3aa;
}

.agenda-child-item {
    margin-left: 34px;
}

.agenda-sort-item {
    position: relative;
}

.agenda-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 12px;
}

.dashboard-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-shortcut {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--red);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.dashboard-shortcut:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-md);
}

.dashboard-shortcut strong {
    color: var(--ink);
    font-size: 1.1875rem;
    line-height: 1.3;
}

.dashboard-shortcut > span:last-child {
    color: var(--muted);
    font-size: 0.875rem;
}

.dashboard-shortcut-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--red-soft);
    color: var(--red-dark);
}

.dashboard-shortcut-icon svg {
    width: 24px;
    height: 24px;
}

.agenda-view-toolbar h2 {
    margin: 0;
}

.agenda-sort-list.is-compact .agenda-description {
    display: none;
}

.agenda-sort-list.is-compact .agenda-sort-item {
    padding: 12px 16px;
}

.agenda-sort-list.is-compact .agenda-title-heading {
    font-size: 1.0625rem;
}

.preparation-source-panel summary {
    font-weight: 700;
}

.preparation-source-panel:not([open]) .disclosure-open,
.preparation-source-panel[open] .disclosure-closed {
    display: none;
}

.task-filter-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.task-filter-form label {
    flex: 1 1 240px;
    min-width: 0;
}

.task-filter-shortcuts {
    flex-wrap: wrap;
    margin-top: 16px;
}

[data-sort-handle] {
    cursor: grab;
    user-select: none;
}

.sort-grip {
    display: inline-block;
    padding-inline: .35em;
    color: var(--muted);
}

.agenda-sort-item[id],
.agenda-edit-panel {
    scroll-margin-top: 1rem;
}

.agenda-edit-panel .protocol-editor[contenteditable="true"] {
    cursor: text;
}

.agenda-sort-item.is-dragging {
    opacity: .45;
}

.agenda-sort-item.drop-before::before,
.agenda-sort-item.drop-after::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    height: 4px;
    border-radius: 999px;
    background: var(--red);
}

.agenda-sort-item.drop-before::before {
    top: -9px;
}

.agenda-sort-item.drop-after::after {
    bottom: -9px;
}

.agenda-sort-item.drop-into {
    border-color: #8e98a6;
    background: #eef2f6;
}

[data-committee-list-item] {
    position: relative;
}

[data-committee-list-item].is-dragging {
    opacity: .45;
}

[data-committee-list-item].drop-before,
[data-committee-list-item].drop-after {
    outline: 2px solid var(--red);
    outline-offset: -2px;
}

.help-document main {
    max-width: none;
}

.help-overview-panel,
.help-terms-panel,
.help-pdf-panel {
    max-width: 980px;
}

.help-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 16px;
}

.help-card {
    min-height: 185px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.help-card:hover {
    transform: translateY(-2px);
    border-color: rgba(216, 25, 32, .5);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .1);
}

.help-card-icon {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: var(--red-soft);
    color: var(--red);
}

.help-card-icon svg {
    width: 22px;
    height: 22px;
}

.help-card strong {
    font-size: 1.25rem;
}

.help-card span:not(.help-card-icon) {
    color: var(--muted);
    line-height: 1.55;
}

.help-card em {
    margin-top: auto;
    color: var(--red-dark);
    font-style: normal;
    font-weight: 800;
}

.help-terms-panel ul {
    margin: 14px 0 0;
    padding-left: 22px;
    line-height: 1.65;
}

.help-pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.help-pdf-card {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--red);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: border-color .12s ease, background .12s ease;
}

.help-pdf-card:hover {
    border-color: var(--red);
    background: var(--red-soft);
}

.help-document .lead {
    font-size: 1.05rem;
    line-height: 1.6;
    border: 1px solid var(--line);
    border-left: 5px solid var(--red);
    border-radius: var(--radius);
    padding: 18px 22px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.help-document img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.help-document figure {
    margin: 22px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.help-document figcaption,
.help-document .muted {
    color: var(--muted);
}

.help-document h2 {
    margin: 42px 0 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 1.75rem;
}

.help-document h2:first-of-type {
    border-top: 0;
}

.help-document h2 .num {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    margin-right: 12px;
    vertical-align: -7px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 1.0625rem;
    font-weight: 800;
}

.help-document .toc,
.help-document .callout {
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: var(--radius);
    padding: 14px 18px 14px 16px;
    margin: 18px 0;
}

.help-document .toc {
    border-left-width: 1px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.help-document .callout.info {
    border-left-color: #2f6fb0;
    background: #eef4fb;
}

.help-document .callout.tip {
    border-left-color: var(--success);
    background: #e9f6ef;
}

.help-document .callout.warn {
    border-left-color: #f2b705;
    background: #fff7db;
}

.help-document .callout .tag {
    display: block;
    margin-bottom: 2px;
    font-weight: 800;
}

.help-document .callout.info .tag {
    color: #2f6fb0;
}

.help-document .callout.tip .tag {
    color: var(--success);
}

.help-document .callout.warn .tag {
    color: #9a7400;
}

.help-document .steps {
    counter-reset: step;
    padding: 0;
    margin: 16px 0;
    list-style: none;
}

.help-document .steps > li {
    position: relative;
    min-height: 62px;
    margin: 12px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px 16px 62px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.help-document .steps > li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 800;
}

.agenda-edit-panel {
    border-top: 1px solid var(--line);
    margin-top: 12px;
    padding-top: 14px;
}

.agenda-run-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.comment-edited-note {
    display: block;
    margin-top: 6px;
    font-size: .78rem;
}

.agenda-run-nav a {
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.agenda-run-nav a:hover {
    border-color: #98a4b3;
}

.agenda-run-nav a.active {
    border-color: var(--red);
    background: var(--red);
    color: #fff;
}

.agenda-run-nav a.status-done:not(.active) {
    border-color: #6cba8c;
    background: #e9f7ee;
    color: #205b3d;
}

.agenda-run-nav a.status-in_progress:not(.active) {
    border-color: #ddb12d;
    background: #fdf6d8;
}

.agenda-run-nav a.status-open:not(.active) {
    background: #fff;
}

.agenda-run-nav a.is-group {
    box-shadow: inset 0 0 0 2px rgba(21, 23, 27, .08);
}

.agenda-run-nav .overview-link {
    border-radius: var(--radius-sm);
    padding: 0 12px;
}

.agenda-title-heading.no-toggle::after {
    content: "";
}

.meeting-welcome {
    min-height: min(560px, calc(100vh - 210px));
    display: grid;
    align-content: center;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        radial-gradient(720px 320px at 100% 0%, rgba(247, 214, 0, .16), transparent 62%),
        linear-gradient(135deg, #ffffff 0%, #f6f8fa 70%, #fdf4e0 100%);
    padding: clamp(24px, 4vw, 52px);
    box-shadow: var(--shadow-sm);
}

.welcome-kicker {
    color: var(--red);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 13px;
}

.meeting-welcome h2 {
    max-width: 1100px;
    margin: 0;
    font-size: clamp(30px, 4.6vw, 56px);
    line-height: 1.08;
    letter-spacing: -.02em;
}

.welcome-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
}

.welcome-facts {
    display: grid;
    gap: 14px;
    margin: 0;
}

.welcome-facts div {
    border-top: 2px solid var(--dark);
    padding-top: 8px;
}

.welcome-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.welcome-facts dd {
    margin: 4px 0 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.welcome-agenda {
    display: grid;
    gap: 6px;
    max-width: 100%;
}

.welcome-agenda div {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) minmax(44px, auto);
    gap: 12px;
    align-items: baseline;
    color: #30343a;
}

.welcome-agenda small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.welcome-agenda .is-group {
    margin-top: 8px;
    color: var(--red-dark);
    font-weight: 700;
}

.welcome-agenda .is-child {
    padding-left: 32px;
}

.welcome-actions,
.closing-actions,
.topic-store-action {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.welcome-actions form,
.closing-actions form,
.topic-store-action {
    margin: 0;
}

label.has-error input,
label.has-error select,
label.has-error textarea {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(186, 12, 47, .14);
}

.role-status-legend,
.participant-role-list {
    display: grid;
    gap: 10px;
}

.role-status-legend {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 14px;
}

.meeting-session-role-status {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.meeting-session-role-status[data-valid="0"] {
    border-color: rgba(186, 12, 47, .35);
    background: #fff7f7;
}

.meeting-session-role-status h3 {
    margin: 0;
    font-size: 1rem;
}

.meeting-session-role-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.meeting-session-role-status dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 0;
}

.meeting-session-role-status dl div {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.meeting-session-role-status dt {
    font-weight: 700;
}

.meeting-session-role-status dd {
    margin: 0;
}

.meeting-session-role-status ul {
    margin: 0;
    padding-left: 20px;
    color: var(--red);
    font-weight: 600;
}

.agenda-drag-hint {
    margin: 12px 0;
    font-weight: 600;
    color: var(--muted);
}

.meeting-role-pill,
.meeting-role-button {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
}

.meeting-role-pill {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 700;
}

.participant-role-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.participant-role-person {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.participant-role-person strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.participant-role-person [data-role-badges] {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.participant-role-person .meeting-role-pill {
    padding: 4px 8px;
}

.participant-role-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.participant-role-controls form {
    margin: 0;
}

.role-toggle-button {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.role-toggle-button:hover {
    border-color: #98a4b3;
}

.role-toggle-button.is-active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.meeting-role-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    color: var(--dark);
    text-align: left;
    cursor: pointer;
}

.meeting-role-button small {
    font-weight: 700;
}

.role-status-0 {
    background: #fff;
}

.role-status-1 {
    background: #e6f5eb;
    border-color: #7cc694;
}

.role-status-2 {
    background: #efe7ff;
    border-color: #9b7adf;
}

.role-status-3 {
    background: #fff0dd;
    border-color: #eba64c;
}

.role-status-4 {
    background: linear-gradient(90deg, #efe7ff 0 50%, #fff0dd 50% 100%);
    border-color: #a986c7;
}

.role-status-5 {
    background: #fff8d7;
    border-color: #e5c84b;
}

.role-status-6 {
    background: #eef1f4;
    border-color: #b8c2cc;
}

.role-status-7 {
    background: #eef3f7;
    border-color: #b9c8d5;
}

.role-state-all {
    background: #efe7ff;
    border-color: #9b7adf;
}

.role-state-chair {
    background: #e8f0ff;
    border-color: #8eb2f2;
}

.role-state-participant-recorder {
    background: #fff0dd;
    border-color: #eba64c;
}

.role-state-recorder {
    background: #fff8d7;
    border-color: #e5c84b;
}

.role-state-participant {
    background: #e6f5eb;
    border-color: #7cc694;
}

.role-state-guest {
    background: #eef3f7;
    border-color: #b9c8d5;
}

.role-state-none {
    background: #fff;
}

@media (max-width: 760px) {
    .participant-role-row {
        grid-template-columns: 1fr;
    }

    .participant-role-controls {
        justify-content: flex-start;
    }
}

.topic-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 10px 0 0;
}

.topic-head-meta div {
    display: grid;
    gap: 2px;
}

.topic-head-meta dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.topic-head-meta dd {
    margin: 0;
    font-weight: 700;
}

.topic-visibility-notice {
    padding: 12px 16px;
    border-left: 4px solid #d08a00;
    background: #fff8e7;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text);
}

.topic-description {
    font-size: 1.125rem;
    line-height: min(1.55, var(--reading-line-height));
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 220px));
    gap: 12px;
}

.attachment-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.attachment-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.attachment-card a {
    display: grid;
    gap: 7px;
    color: inherit;
    text-decoration: none;
}

.attachment-card strong { overflow-wrap: anywhere; }
.attachment-card .attachment-download { display: flex; margin-top: 8px; justify-content: center; font-size: .85rem; }
.attachment-card .mini-form { margin-top: 8px; }

.attachment-card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: #f1f3f5;
    border-radius: 6px;
}

.attachment-picker { display: grid; gap: .5rem; font-weight: normal; min-width: 0; }
.attachment-picker small { white-space: normal; }
.attachment-selection { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.attachment-selection li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .65rem; background: #f4f6f8; border-radius: .4rem; }
.attachment-selection li span { overflow-wrap: anywhere; min-width: 0; }
.attachment-remove { flex-shrink: 0; padding: .3rem .5rem; font-size: .8rem; }
.attachment-error { color: #b71924; }
.file-icon {
    display: grid;
    place-items: center;
    height: 120px;
    border-radius: 6px;
    background: #f1f3f5;
    color: var(--muted);
    font-weight: 700;
}
.file-icon > span:first-child { align-self: end; }
.file-icon > span:last-child { align-self: start; }
.file-icon svg { width: 32px; height: 32px; }
[data-attachment-preview] { cursor: zoom-in; }
.attachment-lightbox { border: 0; border-radius: 12px; padding: 18px; max-width: min(94vw, 1000px); max-height: 94dvh; box-shadow: 0 16px 60px #0005; }
.attachment-lightbox::backdrop { background: #000a; }
.attachment-lightbox[open] { display: grid; gap: 14px; }
.attachment-lightbox header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.attachment-lightbox h2 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.attachment-lightbox img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(94dvh - 160px); object-fit: contain; margin: auto; }
.attachment-lightbox footer { display: flex; justify-content: flex-end; }
.attachment-lightbox [hidden] { display: none; }
.attachment-lightbox-pdf { width: min(94vw, 1100px); height: 90dvh; }
.attachment-lightbox-pdf[open] { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.attachment-lightbox-pdf p { margin: 0; font-size: .85rem; color: var(--muted); }
.attachment-pdf-frame { width: 100%; height: 100%; min-height: 180px; border: 1px solid var(--line); border-radius: 6px; }
.attachment-preview-open { overflow: hidden; }
.attachment-download { white-space: nowrap; }

.discussion-thread {
    display: grid;
    gap: 14px;
}

.discussion-comment {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.discussion-comment header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
}

.discussion-comment time {
    color: var(--muted);
    font-size: 13px;
}

.comment-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.new-comment-form {
    margin-top: 22px;
}

.meeting-welcome > .welcome-actions {
    justify-content: flex-end;
}

.protocol-workspace {
    align-items: start;
}

.protocol-read-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin: 0;
}

.protocol-read-meta.compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-top: 12px;
}

.protocol-read-meta dt {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.protocol-read-meta dd {
    margin: 3px 0 0;
    font-weight: 700;
}

.protocol-read-view {
    display: grid;
    gap: 14px;
}

.protocol-read-block {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.protocol-read-block h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.protocol-read-block p {
    margin: 0;
    line-height: 1.6;
    white-space: normal;
}

.minutes-rendered {
    line-height: var(--reading-line-height);
}

.minutes-rendered p {
    margin: 0 0 .625rem;
}

.minutes-rendered p:last-child {
    margin-bottom: 0;
}

.minutes-rendered ul,
.minutes-rendered ol {
    margin: 0 0 .625rem 20px;
    padding-left: 18px;
}

.minutes-rendered li {
    margin: 3px 0;
}

.task-read-description .minutes-rendered {
    font-size: 1rem;
    line-height: var(--text-line-height);
}

.task-read-description .minutes-rendered p,
.task-read-description .minutes-rendered ul,
.task-read-description .minutes-rendered ol {
    margin-bottom: .5rem;
}

.task-read-description .minutes-rendered li {
    margin-block: 1px;
}

.task-read-description .minutes-rendered > :last-child {
    margin-bottom: 0;
}

.protocol-dialog-actions {
    flex-wrap: wrap;
}

.protocol-meta-card {
    display: grid;
    gap: 16px;
}

.protocol-document {
    display: grid;
    gap: 24px;
}

.protocol-person-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.protocol-person-columns h3,
.protocol-agenda-read h3 {
    margin: 0 0 12px;
}

.protocol-agenda-read {
    display: grid;
    gap: 12px;
}

.protocol-agenda-item {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.protocol-agenda-item header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) minmax(60px, max-content);
    gap: 10px;
    align-items: baseline;
}

.protocol-agenda-item header > span {
    color: var(--red);
    font-weight: 800;
}

.protocol-agenda-item header > strong {
    min-width: 0;
    font-size: 1.125rem;
}

.protocol-agenda-item header > small {
    justify-self: end;
    color: var(--muted);
    font-weight: 700;
}

.protocol-agenda-item.is-group {
    border-top: 3px solid var(--dark);
    background: #f7f9fb;
}

.protocol-agenda-item.is-child {
    margin-left: 32px;
}

.protocol-send-layout {
    display: grid;
    gap: 12px;
}

.protocol-send-layout > .table-panel,
.protocol-send-layout > .form-panel {
    padding: 14px;
}

.protocol-send-layout h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.recipient-list {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.compact-recipient-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recipient-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px 10px;
}

.recipient-row input {
    margin: 0;
}

.recipient-row strong,
.recipient-row small {
    display: block;
}

.recipient-row small {
    margin-top: 3px;
    color: var(--muted);
}

.recipient-row.is-disabled {
    background: #f6f8fa;
    color: var(--muted);
}

.send-options-detail {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfd;
    padding: 8px 12px;
}

.send-options-detail summary {
    cursor: pointer;
    color: var(--ink);
    font-weight: 700;
}

.send-options-detail .recipient-list,
.send-options-detail label {
    margin-top: 12px;
}

.compact-send-panel {
    padding-top: 14px;
    padding-bottom: 14px;
}

.radio-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.radio-card-grid label {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    transition: border-color .15s ease, background .15s ease;
}

.radio-card-grid input {
    width: auto;
    flex: 0 0 auto;
}

.radio-card-grid label:has(input:checked) {
    border-color: var(--red);
    background: var(--red-soft);
}

.protocol-mail-preview pre {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    padding: 14px;
    color: var(--ink);
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.protocol-text-label textarea {
    min-height: 260px;
    font-size: 1.0625rem;
    line-height: 1.55;
}

.protocol-editor-field {
    display: grid;
    gap: 8px;
}

.protocol-editor-field > span {
    color: var(--ink);
    font-weight: 700;
}

.protocol-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: #f6f8fa;
    padding: 7px;
}

.protocol-editor-toolbar button {
    min-width: 34px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
    transition: border-color .15s ease, color .15s ease;
}

.protocol-editor-toolbar button svg { width: 20px; height: 20px; display: block; margin: auto; pointer-events: none; }

.protocol-editor-toolbar button:hover,
.protocol-editor-toolbar button:focus-visible {
    border-color: var(--red);
    color: var(--red);
}

.protocol-editor {
    min-height: 260px;
    border: 1px solid var(--line-strong);
    border-top: 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: #fff;
    padding: 12px 14px;
    font-size: 1.0625rem;
    line-height: 1.55;
    outline: none;
}

.compact-rich-editor {
    min-height: 96px;
    font-size: 0.9375rem;
}

.compact-rich-editor:empty::before {
    content: attr(data-rich-placeholder);
    color: var(--muted);
}

.protocol-editor:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(216, 25, 32, .12);
}

.protocol-editor p {
    margin: 0 0 10px;
}

.protocol-editor ul,
.protocol-editor ol {
    margin: 0 0 10px 22px;
    padding-left: 18px;
}

.ai-assistant-card {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    padding: 0;
    overflow: hidden;
}

.ai-assistant-card.is-disabled {
    background: #f8fafc;
}

.ai-assistant-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    list-style: none;
}

.ai-assistant-head::-webkit-details-marker {
    display: none;
}

.ai-assistant-head::before {
    content: "▶";
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    transition: transform .15s ease;
}

.ai-assistant-card[open] > .ai-assistant-head::before {
    transform: rotate(90deg);
}

.ai-assistant-body {
    display: grid;
    gap: 12px;
    padding: 0 14px 14px;
}

.ai-assistant-head h3 {
    margin: 0 0 4px;
    font-size: 1.0625rem;
}

.ai-assistant-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.ai-status {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    padding: 5px 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.ai-status[data-state="recording"] {
    border-color: rgba(180, 35, 35, .35);
    background: #fff1f2;
    color: var(--danger);
}

.ai-status[data-state="working"] {
    border-color: rgba(138, 111, 0, .25);
    background: #fff8d8;
    color: #7c5f00;
}

.ai-status[data-state="ready"] {
    border-color: rgba(22, 120, 79, .25);
    background: #ecfdf5;
    color: var(--success);
}

.ai-status[data-state="error"] {
    border-color: rgba(180, 35, 35, .35);
    background: #fff1f2;
    color: var(--danger);
}

.ai-recorder-controls,
.ai-actions,
.ai-result-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ai-duration {
    min-width: 62px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.ai-level-meter {
    width: min(260px, 100%);
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 6px 8px;
}

.ai-level-meter span {
    flex: 1 1 0;
    min-width: 3px;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #ef4444 0%, #d81920 56%, #8f1418 100%);
    opacity: .35;
    transform: scaleY(.12);
    transform-origin: center bottom;
    transition: transform .08s linear, opacity .08s linear;
}

.ai-assistant-card:not(.is-recording) .ai-level-meter span {
    background: #cbd5e1;
}

.ai-assistant-card.is-recording {
    border-color: rgba(216, 25, 32, .55);
    box-shadow: 0 0 0 3px rgba(216, 25, 32, .08);
}

.ai-result-switch {
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}

.ai-result-switch button {
    width: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 7px 10px;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.ai-result-switch button.is-active {
    border-color: var(--red);
    color: var(--red);
}

.ai-result-panel {
    min-height: 76px;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px 12px;
}

.ai-result-panel pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
}

.ai-error {
    margin: 0;
}

.autosave-state {
    min-height: 24px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.autosave-state[data-state="saving"],
.autosave-state[data-state="dirty"] {
    color: #8a6f00;
}

.autosave-state[data-state="error"] {
    color: var(--danger);
}

.autosave-state[data-state="saved"] {
    color: #2f855a;
}

.table-action-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.table-action-cell form {
    margin: 0;
}

.online-device-cell {
    white-space: nowrap;
}

.device-chip {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.device-chip + .device-chip {
    margin-left: 4px;
}

.device-chip svg {
    width: 19px;
    height: 19px;
}

.result-button-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    border: 0;
    padding: 0;
}

.result-button-group legend {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.result-choice {
    min-height: 68px;
    display: grid;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.result-choice:hover {
    border-color: #98a4b3;
}

.result-choice.is-active {
    border-color: #2f855a;
    background: #e9f7ee;
    color: #205b3d;
    box-shadow: inset 0 0 0 2px rgba(47, 133, 90, .18);
}

.result-choice:focus-visible {
    outline: 3px solid rgba(124, 25, 20, .24);
    outline-offset: 2px;
}

.result-choice:disabled {
    cursor: default;
    opacity: .75;
}

.protocol-followups {
    display: grid;
    gap: 14px;
}

.task-create-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfd;
    padding: 12px 14px;
}

.task-create-panel summary {
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.task-create-panel form,
.task-list-panel {
    margin-top: 14px;
}

.closing-board {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.closing-board {
    display: grid;
    gap: 18px;
}

.closing-checklist {
    display: grid;
    gap: 12px;
}

.checklist-stack {
    display: grid;
    gap: 12px;
}

.checklist-stack .closing-check {
    color: inherit;
    text-decoration: none;
}

.closing-check {
    min-height: 88px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: #fff;
}

.closing-check > strong {
    grid-column: 2;
    min-width: 0;
}

.closing-check > small {
    grid-column: 2;
    min-width: 0;
}

.closing-check > a {
    grid-column: 3;
    grid-row: 1 / span 2;
}

.closing-check span {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-weight: 800;
}

.closing-check strong,
.closing-check small {
    display: block;
}

.closing-check small {
    margin-top: 4px;
    color: var(--muted);
}

.closing-check a {
    width: auto;
    justify-self: end;
    white-space: nowrap;
    color: var(--red);
    font-weight: 700;
}

.attachments.agenda-attachments-top {
    margin-top: 0;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    padding-top: 0;
    padding-bottom: 14px;
}

.agenda-attachment-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
}

.agenda-attachment-row .attachment-link {
    flex: 1 1 auto;
    margin: 0;
}

.agenda-attachment-row form {
    display: flex;
    align-items: center;
}

.agenda-run-item {
    scroll-margin-top: 18px;
}

.agenda-group-note {
    border-left: 4px solid var(--line-strong);
    padding: 10px 12px;
    background: #f6f8fa;
    color: var(--muted);
    font-weight: 600;
}

.closing-check.ok span {
    background: #e9f7ee;
    color: #205b3d;
}

.closing-check.warn span {
    background: #fdecec;
    color: var(--danger);
}

.closing-check.info span {
    background: #e8eef7;
    color: #1d4b7a;
}

.closing-time-form {
    display: grid;
    gap: 14px;
    width: min(680px, 100%);
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.closing-time-form h3 {
    margin: 0;
}

.attachments {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.attachments h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.attachment-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 8px;
    text-decoration: none;
    background: #f6f8fa;
    transition: background .15s ease, border-color .15s ease;
}

.attachment-link:hover {
    background: #eef2f6;
    border-color: var(--line-strong);
}

.attachment-link span,
.muted {
    color: var(--muted);
}

.attachment-paperclip {
    display: inline-grid;
    place-items: center;
    vertical-align: -3px;
    margin-right: 8px;
    color: var(--muted);
    font-weight: 600;
}

.attachment-paperclip svg {
    width: 15px;
    height: 15px;
}

.attachment-form {
    margin-top: 12px;
}

.category-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.category-actions form {
    margin: 0;
}

.category-admin-list {
    display: grid;
    gap: 12px;
    margin: 14px 0;
}

.category-admin-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.4fr) minmax(120px, .6fr);
    gap: 12px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #f6f8fa;
}

.category-admin-row .span-4 {
    grid-column: 1 / -1;
}

.category-create-form {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.role-matrix {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.role-row {
    min-width: 720px;
    display: grid;
    grid-template-columns: minmax(160px, 1.3fr) repeat(5, minmax(95px, .7fr));
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.role-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.role-sort-button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.role-sort-button:hover {
    color: var(--ink);
}

.role-sort-button[aria-sort]::after {
    content: " ▲";
    font-size: 9px;
}

.check-cell {
    min-height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.check-cell input {
    width: 18px;
    height: 18px;
}

.check-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.check-stack label,
.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 600;
}

.check-stack input,
.check-line input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.check-line {
    min-height: 52px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: #fff;
}

.check-line small,
.role-row small {
    display: block;
    color: var(--muted);
    font-weight: 400;
    margin-top: 2px;
}

.subtable {
    margin-top: 16px;
}

.mini-form {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 8px;
    align-items: center;
}

.lock-notice {
    margin-bottom: 18px;
}

.lock-disabled {
    opacity: .62;
}

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        z-index: 20;
        top: 0;
        height: auto;
        min-height: 64px;
        padding: 8px 14px;
        gap: 8px 10px;
        align-content: center;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        overflow-y: visible;
    }

    .brand {
        padding: 0;
        min-width: 0;
    }

    .brand img {
        width: 40px;
        height: 40px;
    }

    .brand span {
        min-width: 0;
    }

    .brand strong,
    .brand small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-toggle-button {
        width: 44px;
        height: 44px;
        border: 1px solid #3a414c;
        border-radius: var(--radius-sm);
        display: grid;
        place-content: center;
        gap: 5px;
        cursor: pointer;
    }

    .nav-toggle-button span {
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
    }

    .sidebar nav {
        grid-column: 1 / -1;
        display: none;
        gap: 4px;
        padding-top: 4px;
        overflow: visible;
    }

    .nav-toggle:checked ~ nav,
    .nav-toggle:checked ~ .sidebar-version,
    .nav-toggle:checked ~ .logout {
        display: grid;
    }

    .nav-toggle:checked ~ .sidebar-version {
        display: block;
    }

    .nav-toggle:checked ~ .logout {
        display: flex;
    }

    .sidebar nav a,
    .logout {
        min-height: 42px;
        padding: 0 11px;
        white-space: normal;
    }

    .logout {
        margin-top: 0;
        display: none;
        grid-column: 1 / -1;
        width: 100%;
    }

    .sidebar-version {
        display: none;
        grid-column: 1 / -1;
        margin-top: 0;
        padding: 6px 11px;
    }

    .content {
        padding: 22px 14px 32px;
    }

    .topbar {
        justify-content: flex-start;
    }

    .split,
    .grid-form,
    .filter-set-row,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .metrics > div,
    .metrics > a {
        padding: 14px 16px;
    }

    .agenda-run-controls {
        display: grid;
    }

    .run-step-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .run-step-action {
        grid-column: 1 / -1;
        justify-content: stretch;
        margin-left: 0;
    }

    .run-step-action .button {
        width: 100%;
        min-height: 46px;
        white-space: normal;
    }

    .run-step-nav a {
        min-width: 0;
        min-height: 58px;
        font-size: 12px;
    }

    .run-step-icon {
        font-size: 1.4375rem;
    }

    .meeting-welcome {
        min-height: auto;
        padding: 24px 18px;
    }

    .meeting-welcome h2 {
        font-size: 1.875rem;
    }

    .welcome-facts,
    .welcome-layout,
    .welcome-agenda,
    .protocol-person-columns,
    .compact-recipient-list,
    .radio-card-grid,
    .result-button-group,
    .closing-check {
        grid-template-columns: 1fr;
    }

    .protocol-agenda-item header {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .protocol-agenda-item header > small {
        grid-column: 2;
        justify-self: start;
    }

    .protocol-agenda-item.is-child {
        margin-left: 0;
    }

    .closing-check a {
        grid-column: auto;
        grid-row: auto;
        justify-self: start;
        white-space: normal;
    }

    .span-4 {
        grid-column: span 1;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .mini-form {
        grid-template-columns: 1fr;
    }

    .login-screen,
    .install-screen,
    .guest-screen {
        padding: 14px;
        place-items: start center;
    }

    .login-panel,
    .install-panel,
    .guest-panel,
    .form-panel,
    .table-panel,
    .protocol-item {
        padding: 18px 16px;
    }

    .page-head h1 {
        font-size: 1.625rem;
    }

    .metrics strong {
        font-size: 1.75rem;
    }

    .button {
        width: 100%;
    }

    .agenda-secondary-action,
    .agenda-file-form,
    .agenda-convert-form {
        grid-template-columns: 1fr;
    }

    .agenda-edit-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .agenda-edit-actions .agenda-delete-form {
        margin: 4px 0 0;
        border-top: 1px dashed var(--line-strong);
        padding-top: 14px;
    }

    .pwa-update-banner {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
    }

    .pwa-update-banner .button {
        width: auto;
    }

    .compact-action {
        width: 40px;
        min-width: 40px;
    }

    .actions-cell .compact-action {
        width: 40px;
    }

    .protocol-title {
        gap: 10px;
    }

    .agenda-toggle {
        gap: 10px;
    }

    .agenda-title-heading {
        font-size: 1.1875rem;
    }

    .actions-cell {
        display: flex;
    }

    table {
        min-width: 620px;
    }

    .meetings-table {
        min-width: 0;
    }

    .subtable {
        min-width: 680px;
    }

    .role-row {
        min-width: 620px;
    }
}

/* Betrieb: Fachbereiche und Rückmeldungen */
.basic-rich-field { min-width: 0; }
.protocol-editor, .minutes-rendered { overflow-wrap: anywhere; }
.basic-rich-field [hidden] { display: none !important; }
.rich-link-dialog { max-width: 440px; width: calc(100% - 32px); border: 1px solid #d5dce3; border-radius: 12px; padding: 24px; }
.rich-link-dialog::backdrop { background: #17202c80; }
.rich-link-dialog label { display: grid; gap: 6px; margin: 12px 0; }
.betrieb-card { margin-bottom: 16px; }
.betrieb-card > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; cursor: pointer; padding: 10px 0; }
.betrieb-card > summary strong { flex: 1 1 200px; }
.betrieb-card > summary > span:last-child { color: var(--text-muted, #64748b); }
.betrieb-card[open] > summary { margin-bottom: 14px; }
.betrieb-area-settings { border-top: 1px solid var(--border, #d5dce3); padding: 16px 0; }
.betrieb-area-settings > summary > strong { font-size: 1.2rem; }
.betrieb-area-settings h3 { font-size: 1rem; margin-top: 24px; }
.betrieb-area-settings .betrieb-area-person { color: var(--text, #17202c); font-weight: 600; }
.betrieb-area-planned { flex-basis: 100%; font-size: .9rem; }
.betrieb-assignment-entry { border-left: 3px solid var(--border, #d5dce3); padding: 4px 16px 14px; margin: 12px 0; }
.betrieb-assignment-entry > p { margin: 8px 0; }
.betrieb-assignment-entry summary { cursor: pointer; padding: 8px 0; }
.betrieb-card[data-state="open"] { border-left: 4px solid #c48617; }
.betrieb-card[data-state="draft"] { border-left: 4px solid #64748b; }
.betrieb-card[data-state="submitted"], .betrieb-card[data-state="none"] { border-left: 4px solid #238552; }
.betrieb-topic { padding: 14px; margin: 12px 0; border: 1px solid var(--border, #d5dce3); border-radius: 8px; }
.betrieb-topic label { display: grid; gap: 6px; margin-bottom: 12px; }
.betrieb-topic input, .betrieb-topic textarea { width: 100%; box-sizing: border-box; }
.betrieb-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.betrieb-period-form { min-width: 0; }
.betrieb-period-form > label { display: block; margin-bottom: 6px; }
.betrieb-period-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; align-items: center; gap: 10px; }
.betrieb-period-controls select { width: 100%; min-width: 0; max-width: 100%; height: 44px; margin: 0; }
.betrieb-period-controls .button:disabled { opacity: .4; cursor: default; box-shadow: none; }
@media (max-width: 480px) { .betrieb-period-controls { gap: 6px; } }
.betrieb-history { overflow-wrap: anywhere; white-space: pre-wrap; }
.betrieb-check { display: flex !important; flex-direction: row !important; align-items: center; gap: 9px; align-self: end; min-height: 44px; }
.betrieb-check input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; margin: 0; padding: 0; }
.button.betrieb-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; padding: 10px; position: relative; overflow: visible; }
.betrieb-icon-button svg { width: 22px; height: 22px; pointer-events: none; }
.betrieb-icon-button:focus-visible::after { content: attr(aria-label); position: absolute; bottom: calc(100% + 8px); left: 0; width: max-content; max-width: 230px; padding: 7px 10px; border-radius: 6px; background: #17202c; color: #fff; font-size: 13px; line-height: 1.4; z-index: 10; }
.betrieb-report-actions { justify-content: flex-start; gap: 10px; }
.betrieb-delete { margin: 18px 0; padding: 12px; border: 1px solid var(--border, #d5dce3); border-radius: 8px; }
@media print { .betrieb-print-actions { display: none !important; } }
