/*
 * Aventurica — Alle globalen Styles
 * Stilbild : DSA-Pergament
 * Fonts    : Cinzel (Überschriften) · EB Garamond (Fließtext)
 *
 * WICHTIG: _Layout.cshtml.css ist bewusst leer, da ASP.NET-Core-TagHelper-
 * Elemente (asp-page, etc.) das Scoping-Attribut nicht erhalten und dadurch
 * alle Scoped-CSS-Regeln ignoriert würden. Deshalb stehen ALLE Styles hier.
 */

/* ═══════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
═══════════════════════════════════════════════════════════ */
:root {
    /* Flächen */
    --pg:        #f0e0b0;
    --pg-light:  #faf3dc;
    --pg-dark:   #ddc88a;
    --pg-mid:    #e6d29c;

    /* Tinte */
    --ink:       #160802;
    --ink-2:     #3c1e0c;
    --ink-3:     #6e4820;

    /* Gold */
    --gold:      #9e7318;
    --gold-2:    #c8991e;
    --gold-3:    #6a4e10;

    /* Leder */
    --leather:   #16080c;

    /* Links */
    --link:      #601010;
    --link-h:    #8c1818;

    /* Typografie */
    --f-title: 'Cinzel', 'Palatino Linotype', Georgia, serif;
    --f-body:  'EB Garamond', Georgia, 'Times New Roman', serif;

    /* Header-Höhe (58px Inhalt + 3px Border-Bottom) */
    --hh: 61px;

    /* Kompatibilitäts-Aliases — werden von Admin/Kasse-Styles verwendet */
    --surface:   var(--pg-light);
    --surface-2: var(--pg-mid);
    --border:    var(--pg-dark);
}

/* ═══════════════════════════════════════════════════════════
   RESET & GLOBALE BASIS
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 17px; width: 100%; }

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--pg) !important;
    color: var(--ink);
    font-family: var(--f-body);
    line-height: 1.7;
}

h1, h2, h3, h4 {
    font-family: var(--f-title);
    color: var(--ink);
    margin-top: 0;
    letter-spacing: .04em;
}

a { color: var(--link); }
a:hover { color: var(--link-h); text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
.app-header {
    width: 100%;
    background: var(--leather) !important;
    border-bottom: 3px solid var(--gold-3);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .65);
}

.header-inner {
    padding: 0 2rem;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

/* Brand */
.app-brand {
    font-family: var(--f-title) !important;
    font-size: 1.55rem !important;
    font-weight: 700 !important;
    letter-spacing: .18em !important;
    color: var(--gold-2) !important;
    text-decoration: none !important;
    flex-shrink: 0;
    text-transform: uppercase;
    transition: color 140ms;
}
.app-brand:hover { color: #e8c84a !important; text-decoration: none !important; }

/* Desktop Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: .1rem;
    flex: 1;
}

.header-nav .nav-item,
.mobile-nav  .nav-item {
    font-family: var(--f-title) !important;
    font-size: .78rem !important;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(220, 195, 140, .85) !important;
    text-decoration: none !important;
    padding: .32rem 1rem;
    border-radius: 2px;
    transition: background 140ms, color 140ms;
    white-space: nowrap;
}
.header-nav .nav-item:hover,
.mobile-nav  .nav-item:hover {
    background: rgba(158, 115, 24, .22);
    color: var(--gold-2) !important;
    text-decoration: none !important;
}
.header-nav .nav-item.active,
.mobile-nav  .nav-item.active {
    background: var(--gold) !important;
    color: var(--leather) !important;
    font-weight: 600;
}

/* Header-Suchleiste */
.header-search {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--gold-3);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 240, 190, .06);
    transition: border-color 140ms;
}
.header-search:focus-within { border-color: var(--gold); }

.search-input {
    background: transparent !important;
    border: none !important;
    outline: none;
    color: #ecddb0 !important;
    padding: .3rem .9rem;
    font-family: var(--f-body);
    font-size: 1rem;
    width: 210px;
    box-shadow: none !important;
}
.search-input::placeholder { color: rgba(200, 153, 30, .45); }
.search-input:focus { box-shadow: none !important; border: none !important; }

.search-btn {
    background: var(--gold);
    border: none;
    cursor: pointer;
    padding: 0 .8rem;
    display: flex;
    align-items: center;
    color: var(--leather);
    transition: background 140ms;
}
.search-btn:hover { background: var(--gold-2); }
.search-btn svg { width: 15px; height: 15px; }

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: .35rem;
    margin-left: auto;
}
.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold-2);
    border-radius: 2px;
}

/* Mobile Nav Drawer */
.mobile-nav {
    background: var(--leather);
    border-top: 1px solid rgba(158, 115, 24, .3);
    padding: .6rem 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

/* ═══════════════════════════════════════════════════════════
   MAIN & FOOTER
═══════════════════════════════════════════════════════════ */
.app-main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.app-footer {
    width: 100%;
    background: var(--leather) !important;
    border-top: 2px solid var(--gold-3);
    padding: .7rem 2rem;
    text-align: center;
    font-family: var(--f-title);
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(158, 115, 24, .55);
}

/* ── User-Bereich im Header ─────────────────────────────────── */
.header-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

/* Glocken-Icon */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--ink-3);
    text-decoration: none;
    transition: color 130ms;
    flex-shrink: 0;
}
.notif-bell svg { width: 18px; height: 18px; display: block; }
.notif-bell:hover,
.notif-bell.active { color: var(--gold-2); }

.notif-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    background: #b33;
    color: #fff;
    font-size: .56rem;
    font-family: var(--font-ui, sans-serif);
    font-weight: 700;
    line-height: 1;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
}

.user-name {
    font-family: var(--f-title);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(200, 153, 30, .8) !important;
    text-decoration: none !important;
    transition: color 130ms;
}
.user-name:hover { color: var(--gold-2) !important; }

.user-logout {
    font-family: var(--f-title);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid rgba(158,115,24,.35);
    color: rgba(200,153,30,.6);
    border-radius: 2px;
    padding: .2rem .65rem;
    cursor: pointer;
    transition: background 130ms, color 130ms;
}
.user-logout:hover {
    background: rgba(158,115,24,.2);
    color: var(--gold-2);
}

.user-login {
    font-family: var(--f-title);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold) !important;
    text-decoration: none !important;
    border: 1px solid rgba(158,115,24,.4);
    border-radius: 2px;
    padding: .25rem .8rem;
    transition: background 130ms;
    flex-shrink: 0;
}
.user-login:hover { background: rgba(158,115,24,.18); }

/* Responsive */
@media (max-width: 768px) {
    .header-nav, .header-search { display: none; }
    .mobile-toggle { display: flex; }
    .header-inner  { gap: .75rem; }
    .header-user   { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   GEMEINSAME KOMPONENTEN
═══════════════════════════════════════════════════════════ */
.btn-pg {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.6rem;
    background: var(--gold);
    color: var(--leather) !important;
    border: 1px solid var(--gold-3);
    border-radius: 2px;
    font-family: var(--f-title);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 140ms;
    white-space: nowrap;
}
.btn-pg:hover { background: var(--gold-2); color: var(--leather) !important; }

.btn-pg.outline {
    background: transparent;
    color: var(--ink-2) !important;
    border-color: var(--gold-3);
}
.btn-pg.outline:hover { background: var(--pg-mid); }

/* Kleine Variante für Tabellen-Buttons */
.btn-sm {
    padding: .22rem .75rem !important;
    font-size: .7rem !important;
}

/* ── Admin-Seite ────────────────────────────────────────────────── */
.admin-page { max-width: 1100px; margin: 0 auto; padding-top: 2rem; }
.admin-page h1 { margin-bottom: 1.5rem; }

.admin-pending-banner {
    background: color-mix(in srgb, var(--amber, #c8860a) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--amber, #c8860a) 40%, transparent);
    border-radius: 6px;
    padding: .65rem 1.1rem;
    margin-bottom: 1.2rem;
    font-size: .9rem;
    color: var(--ink-1);
}

.admin-table .row-pending td { background: color-mix(in srgb, #c8860a 6%, transparent); }
.admin-table .row-blocked td { background: color-mix(in srgb, #b03030 6%, transparent); }

.admin-actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }

/* Status-Badges */
.status-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
}
.status-active  { background: #1a6b2e22; color: #1a6b2e; border: 1px solid #1a6b2e55; }
.status-pending { background: #c8860a22; color: #7a5100; border: 1px solid #c8860a55; }
.status-blocked { background: #b0303022; color: #7a1010; border: 1px solid #b0303055; }

/* Rollen-Badges */
.role-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    white-space: nowrap;
}
.role-admin { background: color-mix(in srgb, var(--leather) 30%, transparent); color: var(--ink-1); border: 1px solid var(--leather); }
.role-user  { background: transparent; color: var(--ink-3); border: 1px solid var(--pg-mid); }
.role-beta  { background: color-mix(in srgb, #5b7fbf 25%, transparent); color: var(--ink-1); border: 1px solid #5b7fbf; }

.badge-beta {
    display: inline-block;
    font-size: 0.6em;
    font-family: var(--font-ui, sans-serif);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: color-mix(in srgb, #5b7fbf 25%, transparent);
    color: #5b7fbf;
    border: 1px solid #5b7fbf;
    border-radius: 3px;
    padding: 1px 5px;
    vertical-align: middle;
    line-height: 1.4;
}

.btn-approve { background: #1a6b2e !important; color: #fff !important; border-color: #1a6b2e !important; }
.btn-approve:hover { background: #145523 !important; }

/* Auth pending */
.auth-pending {
    background: color-mix(in srgb, var(--leather) 15%, transparent);
    border: 1px solid var(--leather);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    text-align: center;
    color: var(--ink-1);
    line-height: 1.7;
}

/* Admin-NavLink Highlight */
.nav-admin { color: var(--gold) !important; font-weight: 600; }

.td-actions {
    white-space: nowrap;
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: nowrap;
}

.td-offset {
    white-space: nowrap;
    text-align: center;
}
.td-offset .offset-val {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.btn-offset {
    background: none;
    border: 1px solid var(--pg-mid);
    border-radius: 3px;
    color: var(--ink-2);
    cursor: pointer;
    font-size: .65rem;
    line-height: 1;
    padding: .15rem .35rem;
    transition: background 100ms, color 100ms;
}
.btn-offset:hover:not(:disabled) {
    background: var(--leather);
    color: var(--ink-1);
}
.btn-offset:disabled { opacity: .4; cursor: default; }

/* ═══════════════════════════════════════════════════════════
   AUTOCOMPLETE DROPDOWN
═══════════════════════════════════════════════════════════ */
.ac-wrap {
    position: relative;
    display: contents; /* transparent für Layout-Eltern */
}

.ac-wrap input {
    /* kein width-Override — erbt vom Elternelement */
}

.ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--pg-light);
    border: 1px solid var(--gold);
    border-top: none;
    border-radius: 0 0 2px 2px;
    box-shadow: 0 6px 20px rgba(22,8,12,.3);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}
.ac-dropdown.open { display: block; }

.ac-item {
    padding: .5rem 1rem;
    cursor: pointer;
    font-family: var(--f-body);
    font-size: .95rem;
    color: var(--ink);
    border-bottom: 1px solid var(--pg-mid);
    transition: background 100ms;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-item:last-child  { border-bottom: none; }
.ac-item:hover,
.ac-item.selected    { background: var(--pg-mid); color: var(--link); }

/* Header-Suchleiste: Wrapper braucht relative Positionierung */
.header-search {
    position: relative;
}

.btn-danger {
    background: transparent;
    border: 1px solid rgba(100, 16, 16, .45);
    color: var(--link);
    border-radius: 2px;
    padding: .22rem .7rem;
    font-family: var(--f-title);
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 130ms, color 130ms;
    white-space: nowrap;
}
.btn-danger:hover { background: var(--link); color: var(--pg-light); border-color: var(--link); }

/* ═══════════════════════════════════════════════════════════
   STARTSEITE — HERO
═══════════════════════════════════════════════════════════ */
.hero {
    background: linear-gradient(180deg, var(--pg-dark) 0%, var(--pg) 60%);
    border-bottom: 2px solid var(--gold-3);
    padding: 5.5rem 2rem 4rem;
    text-align: center;
}

.hero-eyebrow {
    font-family: var(--f-title);
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 1.2rem;
}

.hero-title {
    font-family: var(--f-title);
    font-size: 4rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .22em;
    text-transform: uppercase;
    margin: 0 0 .6rem;
    line-height: 1;
}

.hero-sub {
    font-family: var(--f-body);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink-2);
    margin: 0 0 2.5rem;
}

.hero-rule {
    width: 200px;
    margin: 0 auto 2.5rem;
    border: none;
    border-top: 1px solid var(--gold-3);
    opacity: .5;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Feature-Cards */
.cards-section {
    padding: 3.5rem 3rem 4.5rem;
}

.cards-label {
    font-family: var(--f-title);
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: center;
    margin: 0 0 2rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.6rem;
    max-width: 860px;
    margin: 0 auto;
}

.card {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-top: 3px solid var(--gold);
    border-radius: 2px;
    padding: 2rem 1.75rem;
    text-decoration: none !important;
    color: var(--ink) !important;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    transition: box-shadow 140ms, transform 140ms;
}
.card:hover {
    box-shadow: 0 6px 22px rgba(22, 8, 12, .2);
    transform: translateY(-3px);
}

.card-icon  { font-size: 2rem; line-height: 1; }
.card-title {
    font-family: var(--f-title);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0;
}
.card-desc  {
    font-family: var(--f-body);
    font-size: .95rem;
    color: var(--ink-2);
    margin: 0;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   WIKI-SUCHE — INTRO
═══════════════════════════════════════════════════════════ */
.search-intro {
    padding: 4rem 3rem 3rem;
    max-width: 580px;
}
.search-intro h1 {
    font-family: var(--f-title);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0 0 .4rem;
}
.search-intro p {
    font-style: italic;
    color: var(--ink-2);
    margin: 0 0 1.75rem;
}

.search-bar {
    display: flex;
    gap: .5rem;
    max-width: 480px;
}
.search-bar input {
    flex: 1;
    border: 1px solid var(--gold-3);
    border-radius: 2px;
    background: var(--pg-light);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 1.05rem;
    padding: .52rem .9rem;
    outline: none;
    transition: border-color 130ms;
}
.search-bar input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(158, 115, 24, .18);
}
.search-bar input::placeholder { color: var(--ink-3); font-style: italic; }

.search-bar button {
    background: var(--gold);
    color: var(--leather);
    border: none;
    border-radius: 2px;
    padding: .52rem 1.4rem;
    cursor: pointer;
    font-family: var(--f-title);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: background 130ms;
    white-space: nowrap;
}
.search-bar button:hover { background: var(--gold-2); }

/* ═══════════════════════════════════════════════════════════
   WIKI-SUCHE — SPLIT-LAYOUT  (MediaWiki Vector–Stil)
═══════════════════════════════════════════════════════════ */
.wiki-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    height: calc(100vh - var(--hh));
    overflow: hidden;
    background: #f8f9fa;
}

.wiki-sidebar {
    background: #fff;
    border-right: 1px solid #a2a9b1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Portlet = eine Sidebar-Sektion wie im MediaWiki Vector-Skin */
.sidebar-portlet {
    border-bottom: 1px solid #a2a9b1;
}

.sidebar-portlet-header {
    background: #f0f0f0;
    border-bottom: 1px solid #a2a9b1;
    padding: .28em .75em;
    font-size: .72rem;
    font-weight: 700;
    color: #54595d;
    text-transform: uppercase;
    letter-spacing: .06em;
    line-height: 1.4;
}

.sidebar-portlet-body {
    padding: .55rem .75rem;
}

.sidebar-search {
    display: flex;
    gap: .35rem;
}
.sidebar-search input {
    flex: 1;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    background: #fff;
    color: #202122;
    font-family: var(--f-body);
    font-size: .9rem;
    padding: .28rem .55rem;
    outline: none;
    transition: border-color 130ms;
    min-width: 0;
}
.sidebar-search input:focus {
    border-color: #3366cc;
    box-shadow: 0 0 0 1px #3366cc44;
}
.sidebar-search button {
    background: #f8f9fa;
    color: #202122;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: .28rem .6rem;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    transition: background 120ms;
    white-space: nowrap;
    flex-shrink: 0;
}
.sidebar-search button:hover { background: #e8e8e8; }

.sources-label {
    font-size: .72rem;
    font-weight: 700;
    color: #54595d;
    margin: 0 0 .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sources-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .18rem;
}
.sources-list li a {
    display: flex;
    align-items: flex-start;
    gap: .35rem;
    color: #3366cc;
    text-decoration: none;
    font-family: var(--f-body);
    font-size: .85rem;
    line-height: 1.45;
    padding: .08rem 0;
}
.sources-list li a::before {
    content: '§';
    font-size: .74rem;
    color: #888;
    flex-shrink: 0;
    margin-top: .1rem;
}
.sources-list li a:hover { color: #0645ad; text-decoration: underline; }

.sources-empty {
    font-style: italic;
    font-size: .85rem;
    color: #72777d;
    margin: 0;
}

.wiki-panel {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: none;
}

#wiki-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ═══════════════════════════════════════════════════════════
   QUELLEN-VERWALTUNG
═══════════════════════════════════════════════════════════ */
.books-page {
    padding: 2.5rem 3rem 4rem;
}

/* Meldungen (Fehler / Erfolg) */
.books-alert {
    padding: .75rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 4px;
    border: 1px solid transparent;
    font-family: var(--f-body);
    font-size: .95rem;
}
.books-alert-error {
    background: #fde8e8;
    border-color: #c0392b;
    color: #7b241c;
}
.books-alert-success {
    background: #e8f6ee;
    border-color: #27ae60;
    color: #1a6e3c;
}

/* Wiki-Codes Sync-Leiste */
.wikisync-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 .5rem;
    padding: .6rem 1rem;
    background: var(--pg-mid);
    border: 1px solid var(--pg-dark);
    border-radius: 4px;
    flex-wrap: wrap;
}
.wikisync-label {
    font-family: var(--f-title);
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.sync-status {
    font-family: var(--f-body);
    font-size: .88rem;
    font-style: italic;
}
.sync-status.sync-ok  { color: #1a6e3c; }
.sync-status.sync-err { color: #7b241c; }

.books-page > h1 {
    font-family: var(--f-title);
    font-size: 1.9rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0 0 2rem;
    padding-bottom: .65rem;
    border-bottom: 2px solid var(--gold-3);
}

.section-label {
    font-family: var(--f-title);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 0 .9rem;
}

.add-form {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-radius: 2px;
    padding: 1.6rem 2rem 1.4rem;
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: .8rem 1.5rem;
    align-items: end;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: .32rem;
}
.form-field label {
    font-family: var(--f-title);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.form-field input {
    border: 1px solid var(--gold-3);
    border-radius: 2px;
    background: var(--pg);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 1rem;
    padding: .44rem .7rem;
    width: 100%;
    outline: none;
    transition: border-color 130ms, background 130ms;
}
.form-field input:focus {
    border-color: var(--gold);
    background: var(--pg-light);
    box-shadow: 0 0 0 2px rgba(158, 115, 24, .16);
}
.form-field input::placeholder { color: var(--ink-3); font-style: italic; }

.books-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--gold-3);
    background: var(--pg-light);
    font-size: .95rem;
}
.books-table thead tr { background: var(--leather); }
.books-table thead th {
    padding: .65rem 1.1rem;
    text-align: left;
    font-family: var(--f-title);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold-2);
    white-space: nowrap;
}
.books-table tbody tr { border-bottom: 1px solid var(--pg-mid); transition: background 110ms; }
.books-table tbody tr:last-child { border-bottom: none; }
.books-table tbody tr:hover { background: var(--pg-mid); }
.books-table tbody td {
    padding: .6rem 1.1rem;
    font-family: var(--f-body);
    color: var(--ink);
    vertical-align: middle;
}
.books-table .td-path {
    font-family: ui-monospace, Consolas, monospace;
    font-size: .8rem;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-2);
}
.books-table .td-empty {
    text-align: center;
    font-style: italic;
    color: var(--ink-3);
    padding: 2rem;
}


/* FilePath-Zeile mit Browse-Buttons */
.filepath-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.filepath-row input {
    flex: 1;
    min-width: 120px;
}
.filepath-field {
    grid-column: 1 / -1;   /* immer volle Breite im Grid */
}
.pick-btn {
    padding: .44rem .9rem !important;
    font-size: .73rem !important;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Eintragsanzahl-Badge */
.count-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--leather);
    font-family: var(--f-title);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    border-radius: 10px;
    padding: .05rem .55rem;
    vertical-align: middle;
}

/* Feld-Hinweis */
.field-hint {
    font-family: var(--f-body);
    font-size: .72rem;
    color: var(--ink-3);
    cursor: help;
    margin-left: .2rem;
    font-style: normal;
}

/* ═══════════════════════════════════════════════════════════
   AUTH-SEITEN (Login / Register / Account)
═══════════════════════════════════════════════════════════ */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 5rem 1.5rem 3rem;
    flex: 1;
}

.auth-card {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-top: 3px solid var(--gold);
    border-radius: 2px;
    padding: 2.5rem 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(22,8,12,.18);
}

.auth-title {
    font-family: var(--f-title);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 .3rem;
    text-align: center;
}

.auth-sub {
    font-style: italic;
    font-size: .95rem;
    color: var(--ink-3);
    text-align: center;
    margin: 0 0 1.8rem;
}

.auth-error {
    background: rgba(150,20,20,.1);
    border: 1px solid rgba(150,20,20,.35);
    color: #8c1818;
    border-radius: 2px;
    padding: .6rem .9rem;
    font-size: .9rem;
    margin-bottom: 1rem;
}

.auth-success {
    background: rgba(20,100,20,.1);
    border: 1px solid rgba(20,100,20,.35);
    color: #1a5c1a;
    border-radius: 2px;
    padding: .6rem .9rem;
    font-size: .9rem;
    margin-bottom: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.full-width { width: 100%; justify-content: center; margin-top: .4rem; }

.auth-footer {
    text-align: center;
    font-size: .9rem;
    color: var(--ink-3);
    margin: 1.2rem 0 0;
}
.auth-footer a { color: var(--link); }

/* ═══════════════════════════════════════════════════════════
   FILE-BROWSER MODAL
═══════════════════════════════════════════════════════════ */
.fb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 8, 12, .65);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.fb-modal {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-top: 3px solid var(--gold);
    border-radius: 2px;
    width: 100%;
    max-width: 600px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(22,8,12,.5);
}

.fb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1.2rem;
    background: var(--leather);
    border-bottom: 1px solid var(--gold-3);
}

.fb-title {
    font-family: var(--f-title);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-2);
}

.fb-close {
    background: transparent;
    border: none;
    color: rgba(200,153,30,.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: .1rem .4rem;
    border-radius: 2px;
    transition: background 120ms;
}
.fb-close:hover { background: rgba(158,115,24,.25); color: var(--gold-2); }

.fb-breadcrumb {
    padding: .5rem 1.2rem;
    font-family: var(--f-body);
    font-size: .82rem;
    color: var(--ink-3);
    background: var(--pg-mid);
    border-bottom: 1px solid var(--pg-dark);
    overflow-x: auto;
    white-space: nowrap;
}
.fb-crumb-link {
    color: var(--link);
    cursor: pointer;
    text-decoration: underline;
}
.fb-crumb-link:hover { color: var(--link-h); }
.fb-crumb-current { color: var(--ink); font-weight: 600; }

.fb-list {
    flex: 1;
    overflow-y: auto;
    padding: .4rem 0;
}

.fb-item {
    padding: .5rem 1.2rem;
    cursor: pointer;
    font-family: var(--f-body);
    font-size: .95rem;
    color: var(--ink);
    border-bottom: 1px solid rgba(221,200,138,.3);
    transition: background 100ms;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fb-item:hover         { background: var(--pg-mid); }
.fb-item.selected      { background: rgba(158,115,24,.2); color: var(--link); font-weight: 600; }
.fb-dir                { color: var(--ink-2); }
.fb-loading, .fb-error, .fb-empty {
    padding: 2rem;
    text-align: center;
    font-style: italic;
    color: var(--ink-3);
}
.fb-error { color: #8c1818; }

.fb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1.2rem;
    background: var(--pg-mid);
    border-top: 1px solid var(--gold-3);
    gap: 1rem;
}

.fb-selected-path {
    font-family: ui-monospace, Consolas, monospace;
    font-size: .8rem;
    color: var(--ink-2);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   GRUPPEN
═══════════════════════════════════════════════════════════ */
.gruppen-page { max-width: 860px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.gruppen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}
.gruppen-header h1 { margin: 0; }

.gruppen-section { margin-bottom: 2.5rem; }
.gruppen-section h2 {
    font-family: var(--f-title);
    font-size: 1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-2);
    border-bottom: 1px solid var(--gold-3);
    padding-bottom: .4rem;
    margin-bottom: 1rem;
}

.gruppen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gruppe-card-wrap { display: flex; flex-direction: column; gap: .4rem; }

.gruppe-card {
    display: block;
    background: var(--pg-mid);
    border: 1px solid var(--gold-3);
    border-radius: 4px;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--ink-1);
    transition: border-color 150ms, background 150ms;
}
.gruppe-card:hover { border-color: var(--link); background: color-mix(in srgb, var(--pg-mid) 80%, var(--link)); }
.gruppe-card-meister { border-left: 3px solid var(--leather); }
.gruppe-card-name { font-family: var(--f-title); font-size: 1.05rem; margin-bottom: .3rem; }
.gruppe-card-meta { font-size: .78rem; color: var(--ink-3); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.badge-pending {
    display: inline-block;
    font-size: .65rem;
    background: color-mix(in srgb, var(--leather) 20%, transparent);
    color: var(--leather);
    border: 1px solid var(--leather);
    border-radius: 3px;
    padding: 1px 5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.btn-leave { align-self: flex-end; }

/* Einladungs-Karten */
.gruppen-einladungen { background: color-mix(in srgb, var(--pg-mid) 60%, transparent); border: 1px solid var(--gold-3); border-radius: 4px; padding: 1rem 1.2rem; }
.einladung-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: .7rem 0;
    border-bottom: 1px solid var(--gold-3);
}
.einladung-card:last-child { border-bottom: none; }
.einladung-info { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: .2rem; }
.einladung-meister, .einladung-date { font-size: .78rem; color: var(--ink-3); }
.einladung-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.held-select {
    background: var(--pg-dark);
    border: 1px solid var(--gold-3);
    color: var(--ink-1);
    border-radius: 3px;
    padding: .25rem .5rem;
    font-family: var(--f-body);
    font-size: .82rem;
}

.no-heroes-hint { font-size: .82rem; color: var(--ink-3); }
.no-heroes-hint a { color: var(--link); }

.gruppen-empty { text-align: center; padding: 3rem 0; color: var(--ink-3); }
.gruppen-empty-hint { color: var(--ink-3); font-size: .88rem; margin: .5rem 0; }

/* Gruppen-Detail */
.gruppe-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.gruppe-detail-header h1 { margin: .3rem 0; }
.gruppe-meister-label { font-size: .82rem; color: var(--ink-3); }
.gruppe-detail-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.back-link { font-size: .8rem; color: var(--ink-3); text-decoration: none; letter-spacing: .04em; }
.back-link:hover { color: var(--link); }

.gruppe-mitglieder-table td { vertical-align: middle; }

.invite-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* Dialog */
.pg-dialog {
    background: var(--pg-dark);
    border: 1px solid var(--gold-3);
    border-radius: 6px;
    color: var(--ink-1);
    padding: 1.8rem 2rem;
    min-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.pg-dialog::backdrop { background: rgba(0,0,0,.55); }
.pg-dialog h3 { margin: 0 0 1rem; font-family: var(--f-title); font-size: 1.1rem; }
.pg-dialog label { display: block; font-size: .82rem; color: var(--ink-3); margin-bottom: .3rem; }
.pg-input {
    width: 100%;
    background: var(--pg-mid);
    border: 1px solid var(--gold-3);
    color: var(--ink-1);
    border-radius: 3px;
    padding: .4rem .6rem;
    font-family: var(--f-body);
    font-size: .9rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}
.pg-input:focus { outline: none; border-color: var(--link); }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/* Helden-Seite Titel */
.helden-page-title {
    font-family: var(--f-title);
    font-size: 1.6rem;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ═══════════════════════════════════════════════════════════
   GRUPPEN-DETAIL — ZWEISPALTEN-LAYOUT
═══════════════════════════════════════════════════════════ */

/* Detailseite bricht aus dem zentrierten gruppen-page-Container heraus
   und streckt sich auf volle Breite des app-main */
.gruppe-detail-page {
    max-width: none;
    margin: 0;
    padding: 2rem 0 4rem;
    width: 100%;
    box-sizing: border-box;
}

.gruppe-body {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
}
@media (max-width: 760px) {
    .gruppe-body { grid-template-columns: 1fr; }
}

/* Hauptinhalt: linker Bereich mit eigenem padding und max-width */
.gruppe-main {
    padding: 0 2rem 0 2rem;
    max-width: 920px;
}

/* Sidebar — schmal, kein Padding rechts → sitzt direkt am Rand */
.gruppe-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 1.5rem;
    width: 200px;
    min-width: 160px;
    padding-right: 1.5rem;
}

/* Auch der Header braucht den linken Abstand */
.gruppe-detail-header,
.books-alert { padding-left: 2rem; padding-right: 2rem; }

.sidebar-section {
    background: transparent;
    border-left: 2px solid var(--gold-3);
    border-radius: 0;
    padding: .6rem 0 .6rem .9rem;
    margin-bottom: .9rem;
}
.sidebar-section h3 {
    font-family: var(--f-title);
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 0 .6rem;
}

/* Eckdaten — gestapelt statt zweipaltig */
.eckdaten-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin: 0 0 .7rem;
}
.eckdaten-list dt {
    font-size: .65rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: .05rem;
}
.eckdaten-list dd {
    margin: 0;
    color: var(--ink-1);
    font-size: .82rem;
    font-weight: 500;
    word-break: break-word;
}
.eckdaten-ap {
    font-family: var(--f-title);
    font-size: 1.15rem;
    color: var(--link);
}

.sidebar-edit-btn { font-size: .7rem; padding: .2rem .55rem; opacity: .7; }
.sidebar-edit-btn:hover { opacity: 1; }
.sidebar-add-btn  { font-size: .7rem; padding: .2rem .55rem; margin-bottom: .7rem; width: 100%; }

/* Session-Log */
.sidebar-log { }

.log-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    max-height: 520px;
    overflow-y: auto;
}

.log-entry {
    background: transparent;
    border-left: 1px solid var(--gold-3);
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    padding: .35rem 0 .35rem .7rem;
    font-size: .74rem;
    position: relative;
}

.log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .5rem;
    align-items: center;
    margin-bottom: .25rem;
}
.log-date { color: var(--ink-3); white-space: nowrap; }
.log-ap { font-weight: 700; white-space: nowrap; }
.log-ap-plus { color: #5a9e6a; }
.log-ap-minus { color: #c06060; }
.log-datum-change {
    color: var(--link);
    font-style: italic;
    font-size: .74rem;
}

.log-text {
    color: var(--ink-2);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-delete-form { position: absolute; top: .35rem; right: .4rem; }
.log-delete-btn {
    background: none;
    border: none;
    color: var(--ink-3);
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    padding: 0 2px;
    opacity: .5;
    transition: opacity 120ms, color 120ms;
}
.log-delete-btn:hover { opacity: 1; color: var(--link); }

/* Breiter Dialog (Eckdaten + Log) */
.pg-dialog-wide { min-width: 380px; max-width: 500px; }

.pg-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: var(--f-body);
    line-height: 1.5;
}

/* ── Kasse ──────────────────────────────────────────────────────── */
.kasse-page { padding-top: 2rem; }

/* ═══════════════════════════════════════════════════════════
   POSTEINGANG
═══════════════════════════════════════════════════════════ */
.posteingang-page { max-width: 680px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.posteingang-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}
.posteingang-header h1 { margin: 0; }

.posteingang-empty {
    text-align: center;
    padding: 4rem 0;
    color: var(--ink-3);
}
.posteingang-empty-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .4; }

.posteingang-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.posteingang-entry {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    background: var(--pg-mid);
    border: 1px solid var(--gold-3);
    border-radius: 4px;
    padding: .8rem 1rem;
    position: relative;
}

.posteingang-entry-body {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
    min-width: 0;
}

.posteingang-date {
    font-size: .7rem;
    color: var(--ink-3);
    letter-spacing: .03em;
}

.posteingang-text {
    font-size: .88rem;
    color: var(--ink-1);
    line-height: 1.5;
}

.posteingang-link {
    font-size: .78rem;
    color: var(--link);
    text-decoration: none;
    align-self: flex-start;
    margin-top: .1rem;
}
.posteingang-link:hover { text-decoration: underline; }

.posteingang-delete-form { flex-shrink: 0; }

/* ── Posteingang: Tabs ─────────────────────────────────────── */
.inbox-tabs {
    display: flex;
    border-bottom: 2px solid var(--gold-3);
    margin-bottom: 1.5rem;
    gap: 0;
}
.inbox-tab {
    padding: .55rem 1.1rem;
    text-decoration: none;
    color: var(--ink-3);
    font-size: .88rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: color .15s;
}
.inbox-tab:hover { color: var(--ink-2); text-decoration: none; }
.inbox-tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.inbox-tab-badge {
    background: var(--gold);
    color: var(--leather);
    font-size: .68rem;
    padding: .05rem .38rem;
    border-radius: 9999px;
    font-weight: 700;
    line-height: 1.4;
}

/* ── Posteingang: Nachrichten-Einträge ─────────────────────── */
a.posteingang-entry-body { text-decoration: none; color: inherit; }
a.posteingang-entry-body:hover { color: var(--link); text-decoration: none; }

.posteingang-msg-link { flex-direction: row; align-items: center; gap: .75rem; }

.msg-from {
    font-weight: 600;
    font-size: .85rem;
    min-width: 7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}
.msg-subject {
    flex: 1;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-unread .msg-from,
.msg-unread .msg-subject { font-weight: 700; color: var(--ink); }

.posteingang-notif-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .75rem;
}

/* ── Nachricht senden ──────────────────────────────────────── */
.msg-compose-page { max-width: 680px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.msg-form-card {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-radius: 6px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.msg-form-group { display: flex; flex-direction: column; gap: .35rem; }
.msg-form-group label { font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.msg-form-group input,
.msg-form-group select,
.msg-form-group textarea {
    padding: .5rem .7rem;
    border: 1px solid var(--gold-3);
    border-radius: 4px;
    background: var(--pg);
    color: var(--ink);
    font-size: .9rem;
    font-family: var(--f-body);
    width: 100%;
}
.msg-form-group textarea { resize: vertical; min-height: 180px; }
.msg-form-group input:focus,
.msg-form-group select:focus,
.msg-form-group textarea:focus { outline: none; border-color: var(--gold); }
.msg-form-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.msg-error {
    background: #fde8e8;
    border: 1px solid #e88;
    border-radius: 4px;
    padding: .6rem 1rem;
    font-size: .88rem;
    color: #600;
    margin-bottom: .5rem;
}

/* ── Nachricht Detail ──────────────────────────────────────── */
.msg-detail-page { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.msg-detail-actions { display: flex; gap: .6rem; align-items: center; }
.btn-danger { border-color: #a03030 !important; color: #a03030 !important; }
.btn-danger:hover { background: #a03030 !important; color: #fff !important; }

.msg-detail-card {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0 .75rem;
}
.msg-detail-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .3rem .9rem;
    font-size: .88rem;
}
.msg-meta-label { color: var(--ink-3); font-weight: 600; }
.msg-detail-subject {
    font-family: var(--f-title);
    font-size: 1rem;
    color: var(--ink);
}

.msg-detail-body {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-radius: 6px;
    padding: 1.5rem;
    white-space: pre-wrap;
    line-height: 1.75;
    font-size: .95rem;
    color: var(--ink);
    margin-bottom: 1.25rem;
}
.msg-detail-footer { display: flex; gap: .75rem; }

/* ── Anhänge ───────────────────────────────────────────────── */
.msg-attachments {
    background: var(--pg-light);
    border: 1px solid var(--gold-3);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.msg-attachments-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink-2);
    margin-bottom: .6rem;
}
.msg-attachment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.msg-attachment-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: var(--link);
    font-size: .88rem;
    padding: .3rem .5rem;
    border-radius: 4px;
    transition: background .15s;
}
.msg-attachment-link:hover { background: var(--pg-mid); text-decoration: none; }
.msg-attach-icon { flex-shrink: 0; }
.msg-attach-name { font-weight: 500; }
.msg-attach-size { color: var(--ink-3); font-size: .78rem; }
.msg-paperclip { font-size: .8rem; margin-left: .25rem; opacity: .7; }

/* Datei-Input */
.msg-form-group input[type="file"] {
    padding: .35rem .5rem;
    cursor: pointer;
}
.msg-label-hint { font-weight: 400; color: var(--ink-3); font-size: .8rem; }

/* ── Ordner-Picker ─────────────────────────────────────────── */
.folder-picker-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--pg-dark);
    border: 1px solid var(--gold-3);
    border-radius: 3px;
    padding: .35rem .6rem .35rem .8rem;
}
.folder-picker-display {
    flex: 1;
    font-family: ui-monospace, Consolas, monospace;
    font-size: .78rem;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════
   GRUPPEN-KALENDER
═══════════════════════════════════════════════════════════ */
.kal-container {
    border: 1px solid var(--gold-3);
    border-radius: 3px;
    overflow: hidden;
    background: var(--pg-light);
}

.kal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .45rem .75rem;
    background: var(--leather);
    border-bottom: 2px solid var(--gold-3);
}

.kal-nav-btn {
    background: transparent;
    border: none;
    color: var(--gold-2);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: .05rem .35rem;
    border-radius: 2px;
    transition: background 90ms, color 90ms;
    font-family: sans-serif;
}
.kal-nav-btn:hover { background: rgba(158,115,24,.22); color: #e8c84a; }

.kal-month-label {
    font-family: var(--f-title);
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-2);
    flex: 1;
    text-align: center;
}

.kal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--pg-dark);
    border-bottom: 1px solid var(--gold-3);
}

.kal-weekday {
    padding: .28rem .1rem;
    text-align: center;
    font-family: var(--f-title);
    font-size: .55rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.kal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gold-3);
}

.kal-day {
    background: var(--pg-light);
    min-height: 68px;
    padding: .28rem .22rem .18rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    transition: background 70ms;
    position: relative;
}
.kal-day:hover { background: var(--pg-mid); }

.kal-day--empty {
    background: var(--pg);
    cursor: default;
    min-height: 68px;
}
.kal-day--empty:hover { background: var(--pg); }

.kal-day--heute { background: color-mix(in srgb, var(--gold) 10%, var(--pg-light)); }
.kal-day--heute:hover { background: color-mix(in srgb, var(--gold) 16%, var(--pg-light)); }
.kal-day--heute .kal-day-num {
    background: var(--gold);
    color: var(--leather);
    border-radius: 50%;
    width: 1.5em;
    height: 1.5em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kal-day-num {
    font-family: var(--f-title);
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink-2);
    line-height: 1;
    align-self: flex-end;
}

.kal-events {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    flex: 1;
    min-width: 0;
}

.kal-event {
    display: flex;
    align-items: center;
    gap: .15rem;
    border-radius: 2px;
    padding: .07rem .22rem;
    font-size: .6rem;
    line-height: 1.35;
    font-family: var(--f-body);
    min-width: 0;
    overflow: hidden;
}
.kal-event-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kal-event-del {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: .72rem;
    line-height: 1;
    padding: 0 .05rem;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 100ms;
    color: inherit;
}
.kal-event:hover .kal-event-del { opacity: .65; }
.kal-event-del:hover { opacity: 1 !important; }

.kal-event--termin     { background: #d4e6f7; color: #1a4a7a; }
.kal-event--feiertag   { background: #fef3c7; color: #7a5800; }
.kal-event--geburtstag { background: #d1fae5; color: #065f46; }
.kal-event--fest       { background: #ede9fe; color: #4c1d95; }

/* Namenlose Tage */
.kal-nl-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--gold-3);
}
.kal-nl-day {
    background: color-mix(in srgb, var(--leather) 8%, var(--pg-light));
    min-height: 80px;
    padding: .4rem .3rem .3rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .12rem;
    transition: background 70ms;
}
.kal-nl-day:hover { background: color-mix(in srgb, var(--leather) 14%, var(--pg-light)); }
.kal-nl-day--heute { background: color-mix(in srgb, var(--gold) 12%, var(--pg-light)); }
.kal-nl-day--heute .kal-day-num {
    background: var(--gold);
    color: var(--leather);
    border-radius: 50%;
    width: 1.5em; height: 1.5em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kal-nl-label {
    font-family: var(--f-title);
    font-size: .5rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: center;
    line-height: 1.4;
}

/* Legende */
.kal-legend {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .45rem .75rem;
    background: var(--pg-mid);
    border-top: 1px solid var(--gold-3);
    font-size: .65rem;
    font-family: var(--f-body);
}
.kal-legend-item {
    display: flex;
    align-items: center;
    gap: .3rem;
    color: var(--ink-3);
}
.kal-legend-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 2px;
    flex-shrink: 0;
}
.kal-legend-dot--termin     { background: #d4e6f7; outline: 1px solid #1a4a7a44; }
.kal-legend-dot--feiertag   { background: #fef3c7; outline: 1px solid #7a580044; }
.kal-legend-dot--geburtstag { background: #d1fae5; outline: 1px solid #065f4644; }
.kal-legend-dot--fest       { background: #ede9fe; outline: 1px solid #4c1d9544; }

/* ── Account-Header ────────────────────────────────────────── */
.account-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .5rem;
}
.account-header .auth-title,
.account-header .auth-sub { margin-bottom: 0; }
