/* GMC Projektdokumentation – Moor-Palette, keine externen Schriften oder Ressourcen. */

:root {
    --bg: #f4f2eb;
    --surface: #ffffff;
    --surface-2: #f9f8f4;
    --text: #1d2a23;
    --muted: #5d6a62;
    --line: #dedbd0;
    --line-strong: #c7c2b3;
    --primary: #1f4d3a;
    --primary-hover: #173b2c;
    --primary-soft: #e6efe7;
    --moss: #6b8f3c;
    --peat: #7a5a3a;
    --water: #3f6f8a;
    --danger: #a3362a;
    --danger-soft: #f8e7e4;
    --success-soft: #e5f1e3;
    --info-soft: #e5eef3;
    --warn-soft: #f6eedb;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(30, 40, 30, .06), 0 4px 16px rgba(30, 40, 30, .05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141a17;
        --surface: #1c2420;
        --surface-2: #212b26;
        --text: #e6ebe7;
        --muted: #9fada5;
        --line: #2f3a34;
        --line-strong: #43504a;
        --primary: #5fa37f;
        --primary-hover: #74b892;
        --primary-soft: #23382d;
        --danger: #e07a6c;
        --danger-soft: #3a2420;
        --success-soft: #213527;
        --info-soft: #1f2e37;
        --warn-soft: #35301f;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
img { max-width: 100%; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
main.container { flex: 1; }

.muted { color: var(--muted); }
.small { font-size: .87rem; }
.tiny { font-size: .75rem; }
.strong { font-weight: 600; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.dim { opacity: .45; }

/* ── Header ─────────────────────────────────────────────────────────────── */

.topbar { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .topbar { background: #10251b; } }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand img { background: #fff; border-radius: 50%; padding: 3px; }
.brand strong { display: block; font-size: 1rem; letter-spacing: .01em; }
.brand small { display: block; font-size: .8rem; opacity: .8; }

.mainnav { display: flex; align-items: center; gap: 4px; }
.mainnav > a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; opacity: .88; }
.mainnav > a:hover, .mainnav > a.active { background: rgba(255, 255, 255, .14); opacity: 1; color: #fff; }
.nav-user { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.nav-user small { display: block; font-size: .72rem; opacity: .8; line-height: 1.1; }
.nav-user span { line-height: 1.2; }
.mainnav .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.mainnav .btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255, 255, 255, .4); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }

@media (max-width: 860px) {
    .topbar-inner { flex-wrap: wrap; }
    .nav-toggle { display: block; }
    .mainnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
    .mainnav.open { display: flex; }
    .nav-user { margin-left: 0; }
    .brand small { display: none; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); background: var(--surface); font-size: .85rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 16px; padding-bottom: 16px; }
.footer a { color: var(--muted); }

/* ── Building blocks ────────────────────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 820px; margin-left: auto; margin-right: auto; }
.card.highlight { border-left: 4px solid var(--moss); background: linear-gradient(90deg, var(--primary-soft), var(--surface) 60%); }
.card.empty { text-align: center; color: var(--muted); padding: 40px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 2px 0 0; }
.page-head-title { display: flex; align-items: center; gap: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }

.breadcrumb { font-size: .87rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid-2.align-start { align-items: start; }
.span-2 { grid-column: span 2; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-tight { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline { display: inline; margin: 0; }

/* ── Buttons & forms ────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 500;
    text-decoration: none; cursor: pointer; line-height: 1.3; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #0e1a14; } }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); background: var(--danger); color: #fff; }
.btn-danger-text { color: var(--danger); }
.btn-small { padding: 4px 10px; font-size: .85rem; }
.btn-block { width: 100%; }

input, select, textarea {
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 1px; border-color: var(--primary);
}
input[type="checkbox"] { width: auto; accent-color: var(--primary); }
input[type="file"] { padding: 6px; background: var(--surface-2); }
input:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--danger); }
.input-narrow { width: 90px; }

label { font-weight: 600; font-size: .9rem; }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.hint { color: var(--muted); font-size: .8rem; margin: 0; }
.field-error { color: var(--danger); font-size: .85rem; margin: 0; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; cursor: pointer; margin: 6px 0; }
.checkbox input { margin-top: 4px; }
.checkbox-list { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface-2); }
.checkbox-list .checkbox { margin: 3px 0; font-size: .9rem; }

fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; color: var(--primary); }
.form-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }

.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone h2 { color: var(--danger); margin-bottom: 2px; }
.danger-zone p { margin: 0; }

/* ── Alerts, badges, tags ───────────────────────────────────────────────── */

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--moss) 40%, transparent); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--water) 40%, transparent); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-active { background: var(--success-soft); color: #2d6a2f; }
.badge-planned { background: var(--info-soft); color: var(--water); }
.badge-paused { background: var(--warn-soft); color: #8a6516; }
.badge-completed { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge-role-admin { background: var(--primary); color: #fff; }
.badge-role-project_admin { background: var(--primary-soft); color: var(--primary); }
.badge-role-user { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge-cat-access { background: var(--info-soft); color: var(--water); }
.badge-cat-change { background: var(--warn-soft); color: #8a6516; }
.badge-cat-auth { background: var(--success-soft); color: #2d6a2f; }
@media (prefers-color-scheme: dark) {
    .badge-active, .badge-cat-auth { color: #9fd3a1; }
    .badge-paused, .badge-cat-change { color: #e2c179; }
    .badge-planned, .badge-cat-access { color: #9cc7de; }
}

.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); text-decoration: none; }
a.tag:hover { border-color: var(--primary); color: var(--primary); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.status-active { background: #4f9a4a; }
.status-planned { background: var(--water); }
.status-paused { background: #c8952a; }
.status-completed { background: var(--line-strong); }

/* ── Logos & avatars ────────────────────────────────────────────────────── */

.logo { flex: none; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.logo-sm { width: 32px; height: 32px; border-radius: 6px; }
.logo-md { width: 44px; height: 44px; }
.logo-lg { width: 56px; height: 56px; }
.logo-xl { width: 112px; height: 112px; border-radius: 14px; padding: 6px; }
.logo-placeholder { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; border: 0; letter-spacing: .02em; }
.logo-sm.logo-placeholder { font-size: .72rem; }
.logo-md.logo-placeholder { font-size: .9rem; }
.logo-lg.logo-placeholder { font-size: 1.1rem; }
.logo-xl.logo-placeholder { font-size: 2rem; }
.tone-0 { background: #2f6b4f; } .tone-1 { background: #5b7f2a; } .tone-2 { background: #7a5a3a; } .tone-3 { background: #3f6f8a; }
.tone-4 { background: #8a6d2f; } .tone-5 { background: #4d5f8f; } .tone-6 { background: #6a4f7a; } .tone-7 { background: #2f7a72; }

.avatar { display: inline-flex; width: 36px; height: 36px; flex: none; border-radius: 50%; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .8rem; }
.avatar-lead { background: var(--primary); color: #fff; }
.nav-user .avatar { width: 30px; height: 30px; background: rgba(255, 255, 255, .2); color: #fff; }

/* ── Toolbar, tabs, filters ─────────────────────────────────────────────── */

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--primary); color: #fff; }
@media (prefers-color-scheme: dark) { .tab.active { color: #0e1a14; } }
.tabs-underline { display: flex; flex-wrap: wrap; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; margin-bottom: 20px; }
.tabs-underline .tab { border-radius: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs-underline .tab.active { background: none; color: var(--primary); border-bottom-color: var(--primary); }

.tab-icon { width: 16px; height: 16px; display: inline-block; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.tab-icon-liste { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 2h14v2H1zM1 7h14v2H1zM1 12h14v2H1z'/%3E%3C/svg%3E"); }
.tab-icon-baum { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 1h6v4H1zM5 5h1v3h3v2H5zM9 7h6v4H9zM5 10h1v3h3v2H5zM9 12h6v3H9z'/%3E%3C/svg%3E"); }
.tab-icon-organigramm { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 1h6v4H5zM7.5 5h1v2H13v3h-1V8H4v2H3V7h4.5zM1 10h5v5H1zM10 10h5v5h-5z'/%3E%3C/svg%3E"); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type="search"] { width: 300px; max-width: 100%; }
.filters select { width: auto; }
.card.filters { padding: 12px; }

/* ── Tables ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-logo { width: 48px; padding-right: 0; }
.table tr.inactive td { color: var(--muted); }
.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]::after { content: " ↕"; opacity: .35; }
.sortable th[aria-sort="ascending"]::after { content: " ↑"; opacity: 1; }
.sortable th[aria-sort="descending"]::after { content: " ↓"; opacity: 1; }
.card > .table-wrap, .card.table-wrap { padding: 0; }

/* ── Tree view ──────────────────────────────────────────────────────────── */

.tree-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--line); }
.tree li { margin: 2px 0; }
.tree summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; border-radius: 8px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: "▸"; width: 16px; color: var(--muted); transition: transform .15s; flex: none; text-align: center; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree-leaf { padding-left: 22px; }
.tree-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; flex: 1; }
.tree summary:hover .tree-row, .tree-leaf:hover .tree-row { background: var(--surface-2); }
.tree-title { font-weight: 600; text-decoration: none; }
.tree-title:hover { text-decoration: underline; }
.tree-count { font-size: .75rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.tree-leads { margin-left: auto; }

/* ── Org chart ──────────────────────────────────────────────────────────── */

.org-wrap { overflow-x: auto; }
.org-hint { margin-bottom: 4px; }
.org { display: inline-block; min-width: 100%; padding: 8px 0 16px; }
.org ul { position: relative; display: flex; justify-content: center; padding: 22px 0 0; margin: 0; }
.org li { list-style: none; position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.org > ul { padding-top: 0; }
.org > ul > li { padding-top: 0; }
/* horizontal connectors between siblings */
.org li::before, .org li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--line-strong); }
.org li::after { right: auto; left: 50%; border-left: 2px solid var(--line-strong); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 22px; }
.org li:only-child::after { display: block; border-top: 0; left: 50%; width: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 2px solid var(--line-strong); border-radius: 0 8px 0 0; }
.org li:first-child::after { border-radius: 8px 0 0 0; }
.org > ul > li::before, .org > ul > li::after { display: none; }
/* vertical connector from parent down */
.org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--line-strong); }

.org-node {
    display: flex; flex-direction: column; align-items: center; gap: 4px; width: 176px; padding: 12px 10px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; text-align: center;
    text-decoration: none; color: var(--text); box-shadow: var(--shadow); position: relative; z-index: 1;
}
a.org-node:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.org-unit { border-top: 4px solid var(--peat); background: var(--surface-2); }
.org-project { border-top: 4px solid var(--moss); }
.org-root { background: var(--primary); color: #fff; border-color: var(--primary); width: 210px; }
.org-root .logo { background: #fff; border-radius: 50%; padding: 3px; }
.org-title { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.org-sub { font-size: .76rem; color: var(--muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.org-lead { font-size: .76rem; color: var(--primary); font-weight: 600; }
.org-meta { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.org-stack { position: relative; margin-top: 22px; display: flex; flex-direction: column; gap: 6px; width: 200px; }
.org-stack::before { content: ""; position: absolute; top: -22px; left: 50%; height: 22px; border-left: 2px solid var(--line-strong); }
.org-stack-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--line);
    border-left: 3px solid var(--moss); border-radius: 8px; text-decoration: none; color: var(--text); text-align: left; font-size: .85rem;
}
.org-stack-item:hover { border-color: var(--primary); color: var(--text); }
.org-stack-item span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.25; }
.org-stack-item small { display: block; color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Project page ───────────────────────────────────────────────────────── */

.project-head { display: flex; gap: 24px; align-items: flex-start; }
.project-head-text { flex: 1; min-width: 0; }
.project-head-text h1 { margin-bottom: 2px; }
.project-head-meta { display: flex; gap: 6px; margin-bottom: 8px; }
.project-head-actions { display: flex; flex-direction: column; gap: 8px; }
.acronym { color: var(--peat); font-weight: 700; letter-spacing: .03em; margin-bottom: 8px; }
.lead { font-size: 1.05rem; }
@media (max-width: 760px) { .project-head { flex-direction: column; } .project-head-actions { flex-direction: row; flex-wrap: wrap; } }

.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .project-grid { grid-template-columns: 1fr; } }
.prose { max-width: 75ch; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people li > div { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow-wrap: anywhere; }

.mini-list, .plain { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.mini-list a { flex: 1; }
.plain li { padding: 3px 0; }
.sessions li { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--line); }
.gallery figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 8px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--moss); border: 2px solid var(--surface); }
.timeline time { font-size: .8rem; color: var(--muted); }
.timeline h3 { margin: 2px 0 4px; }

.logo-edit { display: flex; gap: 20px; align-items: flex-start; }
.image-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.image-admin-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.image-admin-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.image-admin-item p { margin: 0; }

/* ── Audit ──────────────────────────────────────────────────────────────── */

.audit-filter { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; align-items: end; }
.audit-filter .field-wide { grid-column: span 2; }
.audit-filter .field-actions { flex-direction: row; }
.quick-ranges { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.audit-table td { font-size: .87rem; }
.changes summary { cursor: pointer; color: var(--primary); font-size: .8rem; margin-top: 4px; }
.changes table { border-collapse: collapse; margin-top: 6px; font-size: .8rem; width: 100%; }
.changes th, .changes td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.changes td.old { background: var(--danger-soft); }
.changes td.new { background: var(--success-soft); }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; }

/* ── Login ──────────────────────────────────────────────────────────────── */

.login { display: flex; justify-content: center; padding: 40px 0; }
.login-card { width: 100%; max-width: 440px; text-align: center; padding: 32px; }
.login-card form { text-align: left; margin: 16px 0; }
.login-logo { margin-bottom: 8px; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--line-strong); margin: 0; }

/* ── Cookie notice ──────────────────────────────────────────────────────── */

.gmc-infobar {
    position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin: 0 auto; z-index: 50;
    display: flex; gap: 16px; align-items: center; padding: 14px 18px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
    font-size: .88rem;
}
.gmc-infobar p { margin: 0; flex: 1; }
.gmc-infobar form { margin: 0; }
@media (max-width: 600px) { .gmc-infobar { flex-direction: column; align-items: stretch; } }

/* ── Lightbox ───────────────────────────────────────────────────────────── */

.lightbox { position: fixed; inset: 0; background: rgba(10, 15, 12, .9); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); border-radius: 6px; }
.lightbox p { color: #fff; margin-top: 12px; }
.lightbox button { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, .15); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 1.4rem; cursor: pointer; }
.lightbox .lb-prev, .lightbox .lb-next { top: 50%; transform: translateY(-50%); }
.lightbox .lb-prev { left: 16px; right: auto; }
.lightbox .lb-next { right: 16px; }

@media print {
    .topbar, .footer, .gmc-infobar, .project-head-actions, .toolbar, .tree-actions { display: none !important; }
    .card { box-shadow: none; break-inside: avoid; }
}
