/* ── Variablen ──────────────────────────────────────────────── */
:root {
    --color-primary:       #2a9d8f;
    --color-primary-dark:  #21867a;
    --color-primary-light: #e8f5f3;
    --color-primary-mid:   #b2dfdb;
    --color-text-dark:     #1a3c34;
    --color-text:          #333;
    --color-border:        #dee2e6;
    --color-bg:            #f5f7f6;
    --color-white:         #fff;
    --radius-card:         14px;
    --radius-sm:           8px;
    --shadow-sm:           0 2px 8px rgba(0,0,0,.08);
    --shadow-md:           0 4px 20px rgba(0,0,0,.12);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; color: var(--color-text); }

/* ── Öffentliche App ─────────────────────────────────────────── */
.app-body { background: var(--color-bg); min-height: 100vh; }

.app-wrapper {
    max-width: 520px;
    margin: 0 auto;
    background: var(--color-white);
    min-height: 100vh;
    box-shadow: var(--shadow-md);
}

/* Header */
.app-header {
    background: var(--color-white);
    padding: 20px 20px 0;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.app-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.2;
    margin: 0 0 12px 0;
    flex: 1;
}

.app-header-actions {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.app-icon-btn {
    color: #aaa;
    font-size: 1.2rem;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color .2s, background .2s;
    background: none;
    border: none;
    line-height: 1;
}
.app-icon-btn:hover { color: var(--color-primary); background: var(--color-primary-light); }

/* Dropdown */
.app-dropdown-wrapper { padding: 12px 0 14px; }

.app-kommune-select {
    width: 100%;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-white);
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.app-kommune-select:focus { border-color: var(--color-primary); }

/* Content */
.app-content { padding: 16px; }

/* Startseite */
.start-card {
    background: #f8fffe;
    border-radius: var(--radius-card);
    padding: 20px;
    border: 1px solid var(--color-primary-mid);
}
.erklaerungstext { color: var(--color-text); line-height: 1.7; margin-bottom: 20px; }
.erklaerungstext a { color: var(--color-primary); }
.impressum-text { font-size: 0.88rem; color: #666; margin-top: 20px; border-top: 1px solid var(--color-border); padding-top: 16px; }
.impressum-text a { color: var(--color-primary); }

/* Kategorien */
.kategorie-list { display: flex; flex-direction: column; gap: 10px; }

.kategorie-item {
    background: var(--color-white);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.kategorie-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background .2s;
}
.kategorie-header:hover { background: var(--color-primary-light); }
.kategorie-header.open { background: var(--color-primary-light); }

.kategorie-icon-wrap {
    width: 42px;
    height: 42px;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.kategorie-titel {
    flex: 1;
    font-weight: 600;
    color: var(--color-text-dark);
    font-size: 1rem;
    line-height: 1.3;
}

.kategorie-chevron {
    color: #999;
    font-size: 0.85rem;
    transition: transform .25s;
    flex-shrink: 0;
}
.kategorie-header.open .kategorie-chevron { transform: rotate(180deg); }

.kategorie-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    padding: 0 16px;
    border-top: 0;
}
.kategorie-body.open {
    max-height: 4000px;
    padding: 16px;
    border-top: 1px solid var(--color-primary-mid);
}

.inhalt-text { margin-bottom: 12px; line-height: 1.7; }
.inhalt-text a { color: var(--color-primary); }
.inhalt-bild { margin-bottom: 12px; }
.inhalt-bild img { max-width: 100%; border-radius: var(--radius-sm); }

.empty-state { text-align: center; padding: 40px 20px; color: #aaa; }
.empty-state i { font-size: 2rem; margin-bottom: 10px; display: block; }

/* Quill output in public view */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
.ql-indent-1 { padding-left: 3em; }
.inhalt-text strong, .erklaerungstext strong, .impressum-text strong { font-weight: 700; }
.inhalt-text em, .erklaerungstext em, .impressum-text em { font-style: italic; }
.inhalt-text u, .erklaerungstext u, .impressum-text u { text-decoration: underline; }
.inhalt-text a, .erklaerungstext a, .impressum-text a { color: var(--color-primary); text-decoration: underline; }

/* ── Login ───────────────────────────────────────────────────── */
.login-body { background: var(--color-bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: var(--color-white); border-radius: var(--radius-card); padding: 36px; box-shadow: var(--shadow-md); }
.login-header { text-align: center; margin-bottom: 28px; }
.login-icon { font-size: 2.5rem; color: var(--color-primary); margin-bottom: 12px; }
.login-header h2 { color: var(--color-text-dark); margin-bottom: 6px; font-size: 1.5rem; }
.btn.btn-primary, button.btn-primary { background: var(--color-primary) !important; border-color: var(--color-primary) !important; color: #fff !important; }
.btn.btn-primary:hover, button.btn-primary:hover { background: var(--color-primary-dark) !important; border-color: var(--color-primary-dark) !important; }
