/* ═══════════════════════════════════════════════════════════════════
   EPOS-AI — Das Atelier | Styles v5.0 WELTKLASSE
   "Das Pergament-Atelier" — Warm, edel, einladend wie ein Schreibzimmer
   mit altem Holz, Kerzenlicht und frischem Papier.

   DUAL THEME:
   • [data-theme="light"]  = Standard: Warmes Pergament-Atelier (Creme)
   • [data-theme="dark"]   = Nacht-Modus: Tiefes Leder-Dunkel
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════════════════════════════════
   DESIGN TOKENS — LIGHT (Pergament-Atelier)
══════════════════════════════════════════════════════════════════ */
:root,
[data-theme="light"] {
    /* Grundfarben */
    --bg:           #F5EFE0;     /* Warmes Pergament — Haupthintergrund */
    --bg-2:         #EDE5D0;     /* Etwas dunkler für Sidebar */
    --bg-3:         #E8DFC8;     /* Karten, Panels */
    --bg-4:         #DFD5B8;     /* Borders, Felder */
    --bg-5:         #D4C89A;     /* Betonte Borders */

    /* Text */
    --ink:          #2A1F0E;     /* Tiefes Tintenbraun — Haupttext */
    --ink-2:        #4A3820;     /* Zweite Textebene */
    --ink-3:        #7A6040;     /* Leiser Text, Labels */
    --ink-4:        #9A8060;     /* Platzhalter, Deaktiviert */

    /* Gold — wärmer, satter, edler */
    --gold:         #A07820;     /* Hauptgold */
    --gold-bright:  #C09030;     /* Hover, Akzent */
    --gold-dim:     #C8AA70;     /* Leises Gold */
    --gold-bg:      rgba(160,120,32,0.08);
    --gold-bg-2:    rgba(160,120,32,0.14);
    --gold-border:  rgba(160,120,32,0.25);
    --gold-border-2:rgba(160,120,32,0.40);

    /* Semantisch */
    --success:      #2D7A4A;
    --error:        #B83030;
    --warning:      #C06820;
    --info:         #2060A0;

    /* Schatten */
    --shadow-xs:    0 1px 4px rgba(42,31,14,0.08);
    --shadow-sm:    0 2px 10px rgba(42,31,14,0.10);
    --shadow-md:    0 4px 24px rgba(42,31,14,0.12);
    --shadow-lg:    0 8px 40px rgba(42,31,14,0.16);
    --shadow-gold:  0 0 0 2px rgba(160,120,32,0.20);

    /* Textur-Overlay */
    --paper-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ══════════════════════════════════════════════════════════════════
   DESIGN TOKENS — DARK (Nacht-Atelier)
══════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg:           #18120A;
    --bg-2:         #201810;
    --bg-3:         #2A2016;
    --bg-4:         #352818;
    --bg-5:         #402E1C;

    --ink:          #F0E8D4;
    --ink-2:        #D8CDB0;
    --ink-3:        #A89880;
    --ink-4:        #787060;

    --gold:         #C09A38;
    --gold-bright:  #D8B050;
    --gold-dim:     #907030;
    --gold-bg:      rgba(192,154,56,0.08);
    --gold-bg-2:    rgba(192,154,56,0.14);
    --gold-border:  rgba(192,154,56,0.20);
    --gold-border-2:rgba(192,154,56,0.35);

    --success:      #4AAA70;
    --error:        #E05050;
    --warning:      #D88840;
    --info:         #5090D0;

    --shadow-xs:    0 1px 4px rgba(0,0,0,0.30);
    --shadow-sm:    0 2px 12px rgba(0,0,0,0.40);
    --shadow-md:    0 4px 28px rgba(0,0,0,0.50);
    --shadow-lg:    0 8px 48px rgba(0,0,0,0.60);
    --shadow-gold:  0 0 0 2px rgba(192,154,56,0.25);
}

/* ══════════════════════════════════════════════════════════════════
   TOKENS — SPACING, TYPO, LAYOUT
══════════════════════════════════════════════════════════════════ */
:root {
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-ui:      'DM Sans', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    --sidebar-w:    268px;
    --header-h:     58px;
    --radius-sm:    6px;
    --radius:       10px;
    --radius-md:    12px;
    --radius-lg:    16px;
    --radius-xl:    24px;

    --ease:         cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in:      cubic-bezier(0.4, 0, 1, 1);
    --ease-out:     cubic-bezier(0, 0, 0.2, 1);
    --t-fast:       150ms;
    --t-norm:       250ms;
    --t-slow:       400ms;
}

/* ══════════════════════════════════════════════════════════════════
   RESET
══════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    transition: background var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--bg-5);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ══════════════════════════════════════════════════════════════════
   LOADING SCREEN
══════════════════════════════════════════════════════════════════ */
.loading-screen {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 24px; z-index: 9999;
    transition: opacity 0.5s var(--ease);
}

.loading-screen .logo {
    font-family: var(--font-display);
    font-size: 32px; font-weight: 600;
    color: var(--gold);
    letter-spacing: 2px;
    animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.spinner {
    width: 36px; height: 36px;
    border: 2px solid var(--bg-4);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px; color: var(--ink-3);
    letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════════════════════════════════ */
.auth-screen {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background-image: var(--paper-texture);
}

.auth-screen::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 800px 600px at 50% 40%,
        rgba(160,120,32,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.auth-deco {
    position: absolute;
    font-size: 320px;
    color: var(--gold);
    opacity: 0.03;
    font-family: var(--font-display);
    user-select: none;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.auth-container {
    background: var(--bg-2);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-xl);
    padding: 48px 44px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative; z-index: 1;
    animation: auth-enter 0.5s var(--ease) both;
}

@keyframes auth-enter {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-container .logo {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 600;
    color: var(--gold);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.auth-tagline {
    text-align: center;
    font-size: 14px;
    color: var(--ink-3);
    margin-bottom: 36px;
    font-style: italic;
    font-family: var(--font-display);
}

.auth-container form {
    display: flex; flex-direction: column; gap: 14px;
}

.auth-divider {
    text-align: center;
    font-size: 12px;
    color: var(--ink-4);
    margin: 16px 0;
    position: relative;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute; top: 50%;
    width: 42%; height: 1px;
    background: var(--bg-4);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--ink-3);
}

.auth-switch a {
    color: var(--gold); cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-fast);
}

.auth-switch a:hover { border-bottom-color: var(--gold); }

/* ══════════════════════════════════════════════════════════════════
   INPUTS, TEXTAREAS, SELECTS
══════════════════════════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    padding: 11px 14px;
    width: 100%;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
    outline: none;
}

input::placeholder,
textarea::placeholder { color: var(--ink-4); }

input:focus,
textarea:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-bg-2);
    background: var(--bg-2);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A07820' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea { resize: vertical; min-height: 80px; line-height: 1.7; }

/* ══════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════ */
button,
.btn {
    font-family: var(--font-ui);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: var(--radius);
    padding: 11px 22px;
    transition: all var(--t-fast) var(--ease);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 7px;
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;

    /* Primär: Gold auf Bg */
    background: var(--gold);
    color: #FFF8EC;
    letter-spacing: 0.3px;
}

button::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--t-fast);
    border-radius: inherit;
}

button:hover::after { background: rgba(255,255,255,0.12); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.42; cursor: not-allowed; }
button:disabled:hover::after { background: transparent; }
button:disabled:active { transform: none; }

/* Sekundär */
button.btn-secondary,
.btn-secondary {
    background: var(--bg-3);
    color: var(--ink-2);
    border: 1px solid var(--bg-4);
}

button.btn-secondary:hover { background: var(--bg-4); }

/* Ghost */
button.btn-ghost,
.btn-ghost {
    background: transparent;
    color: var(--ink-3);
    border: 1px solid var(--bg-4);
}

button.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }

/* Danger */
button.btn-danger,
.btn-danger {
    background: rgba(184,48,48,0.1);
    color: var(--error);
    border: 1px solid rgba(184,48,48,0.2);
}

button.btn-danger:hover { background: rgba(184,48,48,0.2); }

/* ══════════════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════════════ */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════════════ */
.header {
    grid-column: 1 / -1;
    background: var(--bg-2);
    border-bottom: 1px solid var(--bg-4);
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    gap: 20px;
}

[data-theme="dark"] .header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--gold-border);
}

.logo {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 700;
    color: var(--gold);
    letter-spacing: 1.5px;
    display: flex; align-items: center; gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-ornament {
    font-size: 12px; opacity: 0.6;
    animation: ornament-fade 4s ease-in-out infinite;
}

@keyframes ornament-fade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.25; }
}

.header-center {
    display: flex; align-items: center;
    gap: 16px; flex: 1; justify-content: center;
    min-width: 0;
}

.project-selector {
    display: flex; align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-4);
    background: var(--bg-3);
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: var(--ink-2);
    transition: all var(--t-fast);
    max-width: 280px;
    min-width: 120px;
}

.project-selector:hover {
    border-color: var(--gold-border-2);
    background: var(--bg-2);
    color: var(--ink);
}

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

.project-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    animation: dot-pulse 3s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.85); }
}

.word-count-badge {
    font-size: 12px; font-weight: 600;
    color: var(--ink-3);
    padding: 4px 10px;
    background: var(--bg-3);
    border-radius: 20px;
    border: 1px solid var(--bg-4);
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.header-actions {
    display: flex; align-items: center;
    gap: 12px; flex-shrink: 0;
}

.memory-badge {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--ink-3);
    padding: 6px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-4);
    background: var(--bg-3);
    cursor: default;
}

.memory-badge span:first-child {
    color: var(--success);
    font-size: 10px;
    animation: dot-pulse 3s ease-in-out infinite;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    color: var(--ink-3);
    padding: 7px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    transition: all var(--t-fast);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-4);
    border-color: var(--gold-border);
    color: var(--gold);
}

.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius);
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: var(--ink-2);
    transition: all var(--t-fast);
}

.user-chip:hover {
    background: var(--bg-4);
    border-color: var(--gold-border);
}

.tier-badge {
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 10px;
}

.tier-badge.starter    { background: var(--bg-4); color: var(--ink-3); }
.tier-badge.professional { background: var(--gold-bg-2); color: var(--gold); }
.tier-badge.enterprise { background: var(--gold); color: #FFF8EC; }

/* ══════════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════════ */
.sidebar {
    background: var(--bg-2);
    border-right: 1px solid var(--bg-4);
    overflow-y: auto;
    padding: 16px 0;
    display: flex; flex-direction: column;
    gap: 0;
    transition: background var(--t-slow);
}

[data-theme="dark"] .sidebar {
    border-right-color: var(--gold-border);
}

.nav-section {
    margin-bottom: 4px;
}

.nav-title {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ink-4);
    padding: 10px 20px 6px;
}

.nav-item {
    display: flex; align-items: center;
    gap: 10px;
    padding: 9px 20px;
    font-size: 13px; font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    border-radius: 0;
    transition: all var(--t-fast);
    position: relative;
    margin: 1px 8px;
    border-radius: var(--radius-sm);
}

.nav-item:hover {
    background: var(--bg-3);
    color: var(--ink);
}

.nav-item.active {
    background: var(--gold-bg-2);
    color: var(--gold);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute; left: 0;
    width: 3px; height: 60%;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
    top: 20%;
    left: -8px;
}

.nav-item-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-item-icon { opacity: 1; }

.nav-item-tier {
    margin-left: auto;
    font-size: 9px; font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--gold-dim);
    background: var(--gold-bg);
    padding: 2px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

.nav-divider {
    height: 1px;
    background: var(--bg-4);
    margin: 8px 16px;
}

/* ══════════════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════════════ */
.main-content {
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

.view {
    display: none;
    height: 100%;
    overflow-y: auto;
    animation: view-enter 0.3s var(--ease) both;
}

.view.active { display: flex; flex-direction: column; }

@keyframes view-enter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.view-header {
    padding: 28px 40px 20px;
    border-bottom: 1px solid var(--bg-4);
    display: flex; justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-shrink: 0;
}

.view-title {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 4px;
}

.view-subtitle {
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.5;
    max-width: 560px;
}

.view-body {
    padding: 28px 40px;
    flex: 1;
}

/* ══════════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    position: relative; overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--t-norm);
}

.stat-card:hover {
    border-color: var(--gold-border-2);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover::before { opacity: 1; }

.stat-label {
    font-size: 11px; font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 10px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 600;
    color: var(--gold);
    line-height: 1.1;
    margin-bottom: 6px;
}

.stat-sub {
    font-size: 12px; color: var(--ink-3);
}

.stat-trend {
    font-size: 11px;
    margin-top: 4px;
    color: var(--ink-4);
}

.stat-trend.up { color: var(--success); }

.progress-bar-track {
    height: 4px;
    background: var(--bg-4);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
    border-radius: 4px;
    transition: width 0.6s var(--ease);
}

.progress-bar-label {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--ink-4);
    margin-bottom: 4px;
}

.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-card {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 16px;
}

.dashboard-card h3 {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600;
    color: var(--ink);
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}

/* Chapter list mini */
.chapter-list-mini {
    list-style: none;
    display: flex; flex-direction: column;
    gap: 4px;
}

.chapter-list-mini li {
    display: flex; justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-2);
    transition: all var(--t-fast);
}

.chapter-list-mini li:hover {
    background: var(--bg-3);
    color: var(--ink);
}

.chapter-list-mini .ch-words {
    font-size: 11px; color: var(--ink-4);
    flex-shrink: 0;
}

/* Quick actions */
.quick-action-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.quick-action-btn {
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    padding: 14px 12px;
    cursor: pointer;
    text-align: center;
    transition: all var(--t-fast);
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
}

.quick-action-btn:hover {
    background: var(--gold-bg);
    border-color: var(--gold-border-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-action-icon {
    font-size: 20px;
    line-height: 1;
}

/* ══════════════════════════════════════════════════════════════════
   EDITOR
══════════════════════════════════════════════════════════════════ */
.editor-toolbar {
    padding: 10px 20px;
    border-bottom: 1px solid var(--bg-4);
    display: flex; align-items: center;
    gap: 6px; flex-wrap: wrap;
    background: var(--bg-2);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex; align-items: center;
    gap: 2px;
    padding-right: 10px;
    border-right: 1px solid var(--bg-4);
}

.toolbar-group:last-child { border-right: none; }

.tool-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 5px 9px;
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
    font-family: var(--font-ui);
}

.tool-btn:hover {
    background: var(--bg-3);
    border-color: var(--bg-4);
    color: var(--ink);
}

.tool-btn:active { background: var(--bg-4); }

.chapter-nav {
    display: flex; align-items: center;
    gap: 4px;
}

.chapter-nav-btn {
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    color: var(--ink-2);
    padding: 5px 10px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.chapter-nav-btn:hover { background: var(--bg-4); }

.chapter-nav-label {
    font-size: 12px; font-weight: 600;
    color: var(--ink-2);
    padding: 0 8px;
    min-width: 80px;
    text-align: center;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.editor-container {
    overflow-y: auto;
    padding: 48px 56px;
    display: flex; justify-content: center;
}

.editor {
    width: 100%; max-width: 720px;
    min-height: 100%;
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.85;
    color: var(--ink);
    outline: none;
    caret-color: var(--gold);
    background: transparent;
}

.editor[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: var(--ink-4);
    font-style: italic;
    pointer-events: none;
}

/* Schreiblinien-Effekt */
.editor-container {
    background-image: repeating-linear-gradient(
        transparent,
        transparent calc(1.85em * 17px / 16 - 1px),
        rgba(160,120,32,0.04) calc(1.85em * 17px / 16 - 1px),
        rgba(160,120,32,0.04) calc(1.85em * 17px / 16)
    );
    background-size: 100% calc(1.85em);
    background-attachment: local;
}

[data-theme="dark"] .editor-container {
    background-image: repeating-linear-gradient(
        transparent,
        transparent 31.44px,
        rgba(192,154,56,0.04) 31.44px,
        rgba(192,154,56,0.04) 31.45px
    );
}

/* Editor Side Panel */
.editor-panel {
    background: var(--bg-2);
    border-left: 1px solid var(--bg-4);
    padding: 20px 16px;
    display: flex; flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.panel-widget {
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.panel-widget-title {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 10px;
}

.panel-stat {
    display: flex; justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--bg-4);
    font-size: 12px;
}

.panel-stat:last-child { border-bottom: none; }

.panel-stat-label { color: var(--ink-3); }
.panel-stat-value { font-weight: 600; color: var(--ink); }

/* Spelling errors */
.spelling-error { border-bottom: 2px solid var(--error); cursor: pointer; }
.spelling-error.grammar { border-bottom-color: var(--warning); }

.spelling-tooltip {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-md);
    min-width: 280px; max-width: 380px;
}

.tooltip-message { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.tooltip-suggestion { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; }

.spelling-indicator {
    position: fixed;
    bottom: 20px; right: 20px;
    background: var(--bg-2);
    border: 1px solid var(--error);
    color: var(--error);
    font-size: 12px; font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: none; z-index: 200;
}

/* ══════════════════════════════════════════════════════════════════
   SPARRING
══════════════════════════════════════════════════════════════════ */
.sparring-info-bar {
    background: var(--gold-bg);
    border-bottom: 1px solid var(--gold-border);
    padding: 10px 24px;
    display: flex; align-items: center;
    gap: 8px; font-size: 12px;
    color: var(--ink-3);
    flex-shrink: 0;
}

.sparring-info-bar span:first-child {
    color: var(--gold); font-size: 10px;
}

#sparringChat {
    flex: 1; overflow-y: auto;
    padding: 24px;
    display: flex; flex-direction: column;
    gap: 16px;
}

.chat-message {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    font-size: 14px; line-height: 1.7;
    animation: msg-enter 0.25s var(--ease) both;
}

@keyframes msg-enter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-message.ai {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    color: var(--ink-2);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-message.user {
    background: var(--gold);
    color: #FFF8EC;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.msg-label {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
    opacity: 0.8;
}

.sparring-input-area {
    border-top: 1px solid var(--bg-4);
    padding: 16px 24px 20px;
    background: var(--bg-2);
    flex-shrink: 0;
}

.sparring-quick-prompts {
    display: flex; flex-wrap: wrap;
    gap: 6px; margin-bottom: 12px;
}

.quick-prompt {
    font-size: 12px; font-weight: 500;
    padding: 5px 12px;
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    border-radius: 20px;
    cursor: pointer;
    color: var(--ink-2);
    transition: all var(--t-fast);
}

.quick-prompt:hover {
    background: var(--gold-bg-2);
    border-color: var(--gold-border-2);
    color: var(--gold);
}

.sparring-actions {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: 10px;
}

/* ══════════════════════════════════════════════════════════════════
   LEKTORAT
══════════════════════════════════════════════════════════════════ */
.lektorat-modes {
    display: flex; flex-wrap: wrap;
    gap: 8px; margin-bottom: 20px;
}

.lektorat-mode-btn {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    color: var(--ink-2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px; font-weight: 500;
}

.lektorat-mode-btn:hover {
    background: var(--bg-3);
    border-color: var(--gold-border);
    color: var(--ink);
}

.lektorat-mode-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #FFF8EC;
    font-weight: 600;
}

/* Lektorat Filter-Buttons */
.lektorat-filter-btn {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    color: var(--ink-3);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lektorat-filter-btn:hover {
    background: var(--bg-3);
    color: var(--ink);
}
.lektorat-filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #FFF8EC;
    font-weight: 600;
}

.lektorat-result {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 28px;
    white-space: pre-wrap;
    font-size: 14px; line-height: 1.85;
    color: var(--ink-2);
    font-family: var(--font-display);
    font-size: 15px;
}

/* ══════════════════════════════════════════════════════════════════
   ANALYSE-CONTAINER / RESULT CARDS
══════════════════════════════════════════════════════════════════ */
.analyse-container {
    display: flex; flex-direction: column;
    gap: 20px;
}

#tensionCanvas {
    width: 100%; height: 280px;
    display: block;
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
}

.result-card {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    animation: view-enter 0.3s var(--ease) both;
}

.result-card h3 {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    color: var(--gold);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bg-4);
}

.result-card p,
.result-card .result-text {
    font-size: 14px; line-height: 1.85;
    color: var(--ink-2);
    white-space: pre-wrap;
}

/* Stil-Analyse */
.stil-radar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stil-item {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.stil-item-label {
    font-size: 12px; font-weight: 600;
    color: var(--ink-2);
}

.stil-bar {
    height: 6px;
    background: var(--bg-4);
    border-radius: 6px; overflow: hidden;
}

.stil-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
    border-radius: 6px;
    transition: width 0.8s var(--ease);
}

.stil-value {
    font-size: 11px; font-weight: 600;
    color: var(--gold);
    text-align: right;
}

/* Figuren-Karten */
.char-card {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex; align-items: flex-start;
    gap: 14px;
}

.char-status {
    width: 10px; height: 10px;
    border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}

.char-status.consistent { background: var(--success); }
.char-status.warning    { background: var(--warning); }

/* ══════════════════════════════════════════════════════════════════
   CHARAKTER-WORKSHOP
══════════════════════════════════════════════════════════════════ */
.cw-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    height: calc(100vh - 260px);
}

.cw-list-panel {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.cw-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-4);
}

.cw-list-header h3 {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600;
    color: var(--ink);
}

.cw-dev-panel {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 28px;
    overflow-y: auto;
}

.cw-card {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin: 4px 8px;
    transition: all var(--t-fast);
    border: 1px solid transparent;
}

.cw-card:hover {
    background: var(--bg-3);
}

.cw-card.selected {
    background: var(--gold-bg);
    border-color: var(--gold-border);
}

.cw-card-name {
    font-size: 13px; font-weight: 600;
    color: var(--ink);
}

.cw-card-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 2px;
}

.cw-card-actions button {
    background: transparent;
    border: none;
    color: var(--ink-4);
    padding: 2px 6px;
    font-size: 12px;
}

.cw-card-actions button:hover {
    color: var(--error);
    background: transparent;
}

.cw-dev-response {
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    padding: 20px;
    white-space: pre-wrap;
    font-size: 14px; line-height: 1.8;
    color: var(--ink-2);
    font-family: var(--font-display);
}

/* ══════════════════════════════════════════════════════════════════
   WELTENBAU
══════════════════════════════════════════════════════════════════ */
.wb-tabs {
    display: flex; flex-wrap: wrap;
    gap: 6px; margin-bottom: 16px;
}

.wbTab {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    color: var(--ink-2);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
}

.wbTab:hover { background: var(--bg-3); }

.wbTab.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #FFF8EC;
    font-weight: 600;
}

.wb-content {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* ══════════════════════════════════════════════════════════════════
   GENRE-MODUL
══════════════════════════════════════════════════════════════════ */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.genre-card {
    background: var(--bg-2);
    border: 2px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 18px 12px;
    cursor: pointer;
    text-align: center;
    transition: all var(--t-norm) var(--ease);
}

.genre-card:hover {
    border-color: var(--gold-border-2);
    background: var(--bg-3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.genre-card.selected {
    border-color: var(--gold);
    background: var(--gold-bg-2);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.genre-card-icon { font-size: 24px; margin-bottom: 8px; line-height: 1; }

.genre-card-name {
    font-size: 12px; font-weight: 600;
    color: var(--ink-2);
}

.genre-card.selected .genre-card-name { color: var(--gold); }

/* ══════════════════════════════════════════════════════════════════
   EXPOSÉ
══════════════════════════════════════════════════════════════════ */
.expose-steps {
    display: flex; flex-direction: column;
    gap: 16px;
    max-width: 760px;
}

.expose-step {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--t-fast);
}

.expose-step:focus-within {
    border-color: var(--gold-border-2);
}

.expose-step-header {
    display: flex; align-items: center;
    gap: 12px; margin-bottom: 14px;
}

.expose-step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gold);
    color: #FFF8EC;
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.expose-step strong {
    font-size: 14px; font-weight: 600;
    color: var(--ink);
}

.expose-step-hint {
    font-size: 12px; color: var(--ink-4);
    margin-left: auto;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════════════════
   EXPORT
══════════════════════════════════════════════════════════════════ */
.export-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 760px;
    margin-bottom: 24px;
}

.export-card {
    background: var(--bg-2);
    border: 2px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    cursor: pointer;
    text-align: center;
    transition: all var(--t-norm) var(--ease);
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
}

.export-card:hover {
    border-color: var(--gold-border-2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: var(--bg-3);
}

.export-card-icon { font-size: 36px; }

.export-card-label {
    font-size: 16px; font-weight: 700;
    color: var(--ink);
    font-family: var(--font-display);
}

.export-card-desc {
    font-size: 12px; color: var(--ink-3);
    line-height: 1.5;
}

.export-card button {
    font-size: 12px;
    padding: 8px 18px;
    width: 100%;
}

/* Font cards — Formatierungsassistent */
.font-card {
    background: var(--bg);
    border: 2px solid var(--bg-4);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--t-norm) var(--ease);
}
.font-card:hover {
    border-color: var(--gold-border-2);
    background: var(--bg-3);
}
.font-card.active {
    border-color: var(--gold);
    background: var(--bg-3);
    box-shadow: 0 0 0 3px rgba(201,169,97,.15);
}

/* ══════════════════════════════════════════════════════════════════
   STICKY NOTE / HINTS
══════════════════════════════════════════════════════════════════ */
.sticky-note {
    background: rgba(160,120,32,0.06);
    border: 1px solid var(--gold-border);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════
   TEAM / API
══════════════════════════════════════════════════════════════════ */
.team-member-row {
    display: flex; align-items: center;
    gap: 12px; padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.team-role-badge {
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--gold-dim);
    background: var(--gold-bg);
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.api-key-row {
    display: flex; align-items: center;
    gap: 12px; padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13px;
}

.api-key-row code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--gold);
    background: var(--bg-3);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-3);
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
}

.empty-state-icon {
    font-size: 32px; opacity: 0.4;
    color: var(--gold);
}

/* Upgrade gate */
.upgrade-gate {
    text-align: center; padding: 40px;
    background: var(--bg-2);
    border: 2px dashed var(--gold-border);
    border-radius: var(--radius-lg);
}

.upgrade-gate h3 {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 600;
    color: var(--gold); margin-bottom: 10px;
}

/* ══════════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(42,31,14,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0,0,0,0.65);
}

.modal {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    width: 100%; max-width: 560px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh; overflow-y: auto;
    animation: auth-enter 0.3s var(--ease) both;
}

.modal h2 {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 600;
    color: var(--ink); margin-bottom: 8px;
}

.modal p {
    font-size: 13px; color: var(--ink-3);
    margin-bottom: 20px;
}

/* Modal project items */
.project-modal-item {
    padding: 12px 16px;
    background: var(--bg-3);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex; justify-content: space-between;
    align-items: center;
    font-size: 13px; font-weight: 500;
    color: var(--ink);
    transition: all var(--t-fast);
    margin-bottom: 6px;
}

.project-modal-item:hover {
    background: var(--gold-bg);
    border-color: var(--gold-border-2);
    color: var(--gold);
}

.project-modal-item.current {
    border-color: var(--gold);
    background: var(--gold-bg-2);
    color: var(--gold);
}

/* ══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex; flex-direction: column;
    gap: 8px; z-index: 9999;
    pointer-events: none;
}

.toast {
    background: var(--bg-2);
    border: 1px solid var(--bg-4);
    border-radius: var(--radius);
    padding: 12px 18px;
    font-size: 13px; font-weight: 500;
    color: var(--ink);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center;
    gap: 10px;
    min-width: 220px; max-width: 380px;
    animation: toast-enter 0.3s var(--ease) both;
    pointer-events: all;
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.info    { border-left: 3px solid var(--gold); }

.toast span:first-child {
    font-size: 14px;
    flex-shrink: 0;
}

.toast.success span:first-child { color: var(--success); }
.toast.error   span:first-child { color: var(--error); }
.toast.info    span:first-child { color: var(--gold); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — 1200px
══════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-row  { grid-template-columns: 1fr; }
    .quick-action-row { grid-template-columns: repeat(3, 1fr); }
    .genre-grid     { grid-template-columns: repeat(4, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — 960px
══════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
    :root { --sidebar-w: 56px; }

    .nav-title  { display: none; }
    .nav-item span:not(.nav-item-icon) { display: none; }
    .nav-item-tier { display: none; }
    .nav-item { padding: 10px 0; justify-content: center; margin: 2px 4px; }
    .nav-item-icon { width: auto; font-size: 16px; }

    .memory-badge span:last-child { display: none; }
    .user-chip span:nth-child(2)  { display: none; }

    .header-center { justify-content: flex-start; }
    .word-count-badge { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — 640px
══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .view-header { padding: 20px 20px 16px; flex-direction: column; }
    .view-body   { padding: 20px; }
    .editor-layout { grid-template-columns: 1fr; }
    .editor-panel  { display: none; }
    .editor-container { padding: 24px 20px; }
    .cw-layout    { grid-template-columns: 1fr; grid-template-rows: 240px 1fr; }
    .export-options { grid-template-columns: 1fr; }
    .stil-radar { grid-template-columns: 1fr; }
    .stil-item { grid-template-columns: 120px 1fr 50px; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .quick-action-row { grid-template-columns: repeat(2, 1fr); }
    .genre-grid { grid-template-columns: repeat(3, 1fr); }
    .expose-steps { max-width: 100%; }
    .export-options { max-width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════
   EXTRA FEINHEITEN
══════════════════════════════════════════════════════════════════ */

/* Selektion */
::selection {
    background: var(--gold-bg-2);
    color: var(--ink);
}

/* Code-Blocks in Ergebnissen */
code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gold);
}

/* Focus-Ring für Accessibility */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Subtile Eingangs-Animation für Seiten-Elemente */
.dashboard-card,
.result-card,
.expose-step,
.export-card {
    animation: view-enter 0.35s var(--ease) both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

/* ─── spellingIndicator (dynamisch per JS erstellt) ─── */
/* [FIX] Fehlte komplett — wird von showSpellingIndicator() als #spellingIndicator erstellt */
#spellingIndicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--error, #c0392b);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    transition: opacity 0.2s;
}

/* ── SVG-Icons: Genre & Export ──────────────────────────────── */
.genre-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}
.genre-card-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--gold);
    transition: stroke var(--transition-fast);
}
.genre-card:hover .genre-card-icon svg,
.genre-card.active .genre-card-icon svg {
    stroke: var(--gold-bright);
}
.export-card-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}
.export-card-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--gold);
}

/* ── Theme-Toggle: beschriftet ──────────────────────────────── */
.theme-toggle {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 0 12px !important;
    width: auto !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    white-space: nowrap;
}
#themeIcon {
    font-size: 14px;
    line-height: 1;
}
#themeLabel {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


/* ── Logo-Bild im Header ─────────────────────────────────────── */
.logo {
    padding: 0;
    background: none;
}
.logo-img {
    height: 36px;
    width: auto;
    display: block;
    /* Transparenter Hintergrund passt sich dem Theme an;
       im Dark-Mode leicht aufhellen damit das Gold nicht zu dunkel wirkt */
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.15));
    transition: opacity 0.2s ease;
}
.logo-img:hover {
    opacity: 0.85;
}
[data-theme="dark"] .logo-img {
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4)) brightness(1.1);
}

/* ── Logo in Loading & Auth Screen (grösser) ─────────────────── */
.loading-screen .logo-img,
.auth-container .logo-img {
    height: 80px;
    margin: 0 auto 8px;
}
