/* ============================================================
   33min Production Tracker – Redesign CSS
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --bg: #0b0d14;
    --bg-gradient: linear-gradient(180deg, #0b0d14 0%, #131620 100%);

    --panel: rgba(21, 26, 38, 0.95);
    --panel-alt: rgba(30, 38, 55, 0.92);
    --panel-hover: rgba(38, 48, 68, 0.9);

    --shadow-out: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-out-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-in: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.6);

    --border: rgba(255, 255, 255, 0.07);
    --border-light: rgba(255, 255, 255, 0.12);

    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.25);
    --accent: #8b5cf6;

    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;

    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 9999px;

    --font: 'Spline Sans', sans-serif;

    --input-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(21, 26, 38, 0.92);

    --stat-red: #ef4444;
    --stat-purple: #8b5cf6;
    --stat-green: #22c55e;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
}

/* ── App Shell ── */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Top Navigation Bar ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--panel-alt);
    padding: 4px;
    border-radius: var(--radius-md);
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.nav-btn .material-icons {
    font-size: 22px;
}

.nav-btn img {
    width: 22px;
    height: 22px;
    filter: none;
    opacity: 0.7;
}

.nav-btn.active img {
    opacity: 1;
    filter: brightness(10);
}

.nav-btn.logged-in {
    color: var(--success);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-actions .nav-btn {
    background: var(--panel-alt);
}

/* Nav title preservation for old code */
.nav-title {
    display: none;
}

.main-export-wrap {
    display: none;
}

.sidebar-footer {
    display: contents;
}

.sidebar {
    display: contents;
}

.nav-group {
    display: contents;
}

/* ── Stats Bar ── */
.stats-bar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    flex-shrink: 0;
}

.stat-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-out-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-icons {
    font-size: 26px;
    color: white;
}

.stat-icon.red {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.stat-icon.green {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Content Area ── */
.content-area {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 0 24px 24px;
    gap: 20px;
}

/* ── Composer Sidebar ── */
.composer-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.composer-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
}

.composer-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.panel-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.composer-toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.composer-toggle-btn:hover {
    background: var(--panel-hover);
    color: var(--text);
}

/* ── Form Fields ── */
.field-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field>label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.input-wrap .material-icons {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.88rem;
    min-width: 0;
}

.input-wrap input::placeholder {
    color: var(--text-muted);
}

.input-wrap select {
    cursor: pointer;
    appearance: none;
}

.input-wrap select option {
    background: var(--panel);
    color: var(--text);
}

.helper-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.quick-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Switch ── */
.switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.switch input[type="checkbox"] {
    width: 32px;
    height: 18px;
    appearance: none;
    background: var(--panel-alt);
    border-radius: var(--radius-pill);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid var(--border);
}

.switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.2s, background 0.2s;
}

.switch input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.switch input[type="checkbox"]:checked::after {
    transform: translateX(14px);
    background: white;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--panel-hover);
}

.btn .material-icons {
    font-size: 18px;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.primary-action {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    margin-top: auto;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.icon-btn .material-icons {
    font-size: 20px;
}

.action-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* ── Console Panel ── */
.console-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.console-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.console-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.console-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Chips & Filters ── */
.chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ── Search Field ── */
.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 200px;
    margin-left: auto;
}

.search-field .material-icons {
    font-size: 18px;
    color: var(--text-muted);
}

.search-field input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    min-width: 0;
}

.search-field input::placeholder {
    color: var(--text-muted);
}

.shortcut {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ── Console Actions ── */
.console-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* ── Badge Count ── */
.badge-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Table ── */
.table-wrapper {
    flex: 1;
    overflow: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-grid thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-grid th {
    background: rgba(30, 38, 55, 0.98);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    border-right: none;
    border-left: none;
    cursor: default;
}

.data-grid th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-grid th.sortable:hover {
    color: var(--text);
    background: rgba(40, 50, 70, 0.98);
}

.data-grid td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    border-right: none;
    border-left: none;
    vertical-align: middle;
    color: var(--text-secondary);
}

.data-grid tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-grid tr.editing td {
    background: rgba(139, 92, 246, 0.05);
}

.editable-cell input,
.editable-cell select,
.editable-cell textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
}

.editable-cell input:focus,
.editable-cell select:focus,
.editable-cell textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.editable-cell textarea {
    min-height: 40px;
    resize: vertical;
}

/* ── Type Badge ── */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: rgba(139, 92, 246, 0.12);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: none;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.status-none {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

.status-draft {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-ready {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-exported {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-edited {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge:hover {
    filter: brightness(1.2);
}

/* ── Person Badge ── */
.person-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.badge-jerry {
    color: #19baf0;
    background: rgba(25, 186, 240, 0.12);
}

.badge-marc {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.badge-kodiak {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
}

.badge-taube {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.badge-kaethe {
    color: #f97316;
    background: rgba(249, 115, 22, 0.12);
}

/* ── Pagination ── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0;
    flex-shrink: 0;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ── Empty State ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
}

/* ── Status Menu ── */
.status-menu {
    display: none;
    position: fixed;
    z-index: 10000;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-float);
    min-width: 200px;
}

.status-menu-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.status-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}

.status-chip:hover,
.status-chip.active {
    filter: brightness(1.3);
}

/* ── Global Fields ── */
.global-fields {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.global-fields.visible {
    display: flex;
}

/* ── Status Selector (Composer) ── */
.status-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.status-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Details / Notes ── */
details#notesPanel {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

details#notesPanel summary {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 0;
}

details#notesPanel>div {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Modals ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-float);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.fullscreen {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    max-height: none !important;
}

.close-btn {
    border: none !important;
    background: transparent;
}

/* ── Cloud Page ── */
.cloud-page {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cloud-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    flex-shrink: 0;
}

.cloud-page-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.cloud-back-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cloud-back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cloud-page-title-block {
    flex: 1;
}

.cloud-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.cloud-page-actions {
    display: flex;
    gap: 8px;
}

.cloud-toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cloud-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cloud-filter-group label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.cloud-filter-input,
.cloud-filter-select {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    outline: none;
}

.cloud-filter-input:focus,
.cloud-filter-select:focus {
    border-color: var(--primary);
}

.cloud-export-group {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.cloud-export-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cloud-export-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.cloud-page-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.cloud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.cloud-table th {
    background: var(--panel-alt);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.cloud-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-secondary);
}

.cloud-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.cloud-page-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--panel);
    flex-shrink: 0;
}

/* ── Auth Divider ── */
.auth-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 16px 0;
    position: relative;
}

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

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

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

/* ── Export Modal ── */
.export-opt-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.export-opt-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* ── Save Status ── */
#saveStatus {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.85rem;
    box-shadow: var(--shadow-float);
    z-index: 11000;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

/* ── Notification ── */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--panel);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    color: var(--text);
    font-size: 0.88rem;
    box-shadow: var(--shadow-float);
    z-index: 11000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(60px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(60px);
        opacity: 0;
    }
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Game ── */
.obstacle {
    position: absolute;
    bottom: 10px;
    right: -50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.obstacle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.obstacle.cactus-small {
    width: 28px;
    height: 40px;
}

.obstacle.cactus-large {
    width: 40px;
    height: 55px;
}

.obstacle.bird {
    width: 46px;
    height: 32px;
}

/* ── Geld / Money fields ── */
.geld-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.geld-preview {
    grid-column: 1 / -1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.geld-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.geld-change-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.currency-input {
    position: relative;
}

.currency-input::after {
    content: '€';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ── Ticket fields ── */
.ticket-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── City Grid (Übersicht) ── */
.city-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.city-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ── Samsung ── */
.samsung-note {
    padding: 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Preview ── */
.preview-window {
    background: #000;
    border-radius: var(--radius-md);
    aspect-ratio: 16/9;
    overflow: hidden;
}

.preview-dim {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Version Pill ── */
.version-pill {
    background: var(--panel-alt);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Avatar Builder ── */
.avatar-creator-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 20px;
}

.avatar-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.avatar-color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    box-shadow: var(--shadow-out-sm);
}

.avatar-color-option:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-float);
}

.avatar-color-option.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
    transform: scale(1.05);
}

#profileAvatarContainer:hover .avatar-hover-edit {
    opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .stats-bar {
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
    }
}

@media (max-width: 880px) {
    .topbar {
        padding: 10px 16px;
    }

    .topbar-brand {
        display: none;
    }

    .stats-bar {
        padding: 12px 16px;
        gap: 10px;
        flex-direction: row;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .content-area {
        padding: 0 16px 16px;
    }

    .composer-sidebar {
        width: 240px;
    }

    .geld-summary {
        grid-template-columns: 1fr;
    }

    .geld-summary .field-group,
    .geld-summary .geld-preview {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .topbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        border-bottom: none;
        border-top: 1px solid var(--border);
        z-index: 1000;
        justify-content: center;
        padding: 8px 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    .topbar-brand,
    .topbar-actions {
        display: none;
    }

    .topbar-nav {
        background: transparent;
        padding: 0;
        gap: 8px;
    }

    .app-shell {
        padding-bottom: 60px;
    }

    .stats-bar {
        padding: 12px 16px;
        gap: 8px;
    }

    .stat-card {
        padding: 10px 14px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .content-area {
        flex-direction: column;
        padding: 0 12px 12px;
        gap: 12px;
        overflow-y: auto;
    }

    .composer-sidebar {
        width: 100%;
        flex-shrink: 0;
    }

    .composer-sidebar.collapsed {
        height: 0;
        width: 100%;
    }

    .composer-panel {
        height: auto;
    }

    .console-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-field {
        margin-left: 0;
        width: 100%;
    }

    .table-wrapper {
        margin: 0 -8px;
        border-radius: var(--radius-md);
    }

    .modal-content {
        width: 95% !important;
        padding: 20px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .avatar-creator-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Dynamic Fields (Quick Input) ── */
.quick-input,
.quick-select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.quick-input:focus,
.quick-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.quick-select option {
    background: var(--panel);
    color: var(--text);
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── City Grid & Checkboxes ── */
.city-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.city-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    color: var(--text);
}

.city-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
}

.city-checkbox input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.city-checkbox.active {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

/* ── Ticket Grid ── */
.ticket-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ticket-grid .field-group {
    margin-bottom: 0;
}

.ticket-row {
    margin-top: 4px;
}

/* ── Cloud Edit Inputs ── */
.cloud-edit-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    outline: none;
    transition: all 0.2s;
}

.cloud-edit-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    background: rgba(255, 255, 255, 0.08);
}

.cloud-edit-input option {
    background: var(--panel);
    color: var(--text);
}

/* ── Cloud Avatar ── */
.cloud-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    vertical-align: middle;
}

.cloud-avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    font-family: var(--font-mono, monospace);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Cloud Console (New) ── */
.cloud-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    /* Darker backdrop */
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cloud-modal-overlay.open {
    display: flex;
    opacity: 1;
}

.console-layout {
    width: 95vw;
    height: 90vh;
    background: var(--bg);
    /* Deep dark bg */
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-out);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Header */
.console-header {
    padding: 16px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.header-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Search */
.console-search {
    position: relative;
    width: 240px;
}

.console-search input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px 8px 36px;
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.console-search input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.console-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Toolbar / Filters */
.console-toolbar {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
    overflow-x: auto;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: var(--text-muted);
    background: var(--panel-hover);
}

.filter-pill select,
.filter-pill input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    outline: none;
    font-weight: 500;
}

/* Content Area */
.console-content {
    flex: 1;
    overflow-y: auto;
    padding: 2px 24px 24px;
    /* Top padding small to avoid jump */
    background: var(--bg);
    /* Ensure contrast */
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Entry Row Card */
.entry-card {
    display: grid;
    grid-template-columns: 60px 1fr 200px 50px;
    /* Avatar | Main | Meta | Actions */
    gap: 16px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.entry-card:hover {
    background: var(--panel-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--border-light);
}

/* Card Sections */
.ec-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.ec-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.ec-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    /* Enable truncation */
}

.ec-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

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

.ec-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.ec-badge.show {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.ec-badge.folge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.ec-badge.type {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.ec-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    opacity: 0.8;
}

.ec-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-indicator.draft {
    color: var(--text-muted);
}

.status-indicator.ready {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.status-indicator.exported {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.status-indicator.error {
    color: var(--danger);
}

.ec-actions {
    display: flex;
    justify-content: flex-end;
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* Expanded Detail Panel (Inline) */
.entry-details {
    grid-column: 1 / -1;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding: 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    animation: slideDown 0.2s ease;
    display: none;
}

.entry-card.expanded .entry-details {
    display: block;
}

.entry-card.expanded {
    background: var(--panel-hover);
    border-color: var(--primary);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-box {
    background: var(--input-bg);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
    font-weight: 700;
}

.detail-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: var(--text);
    white-space: pre-wrap;
    line-height: 1.5;
}

.detail-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ── AI Rewrite Feature ── */
.ai-trigger-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ai-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.ai-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary-glow);
}

.ai-btn.thinking {
    animation: pulse-glow 1.5s infinite;
    cursor: wait;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(139, 92, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

/* Download Progress Ring */
.ai-progress-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 32px;
    height: 32px;
    pointer-events: none;
}

.ai-progress-circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke: var(--primary);
}

/* Suggestions Overlay */
.ai-suggestions {
    /* Position is set dynamically via JS (fixed positioning) */
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-float);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.ai-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-suggestion-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.ai-suggestion-card:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    color: var(--text);
}

.ai-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    justify-content: flex-end;
}

/* Modal tweaks */
.ai-modal-content {
    text-align: center;
    max-width: 400px;
}

.ai-hero-icon {
    width: 64px;
    height: 64px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--primary);
}

.ai-hero-icon .material-icons {
    font-size: 32px;
}

/* ── AI Modal Redesign ── */
.ai-modal-content {
    max-width: 520px !important;
    text-align: center;
    padding: 32px 40px !important;
}

.ai-desc-text {
    text-align: left;
    margin-top: 24px;
}

.ai-desc-text p {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

.ai-desc-text p:first-of-type {
    margin-bottom: 18px;
}

.ai-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 18px 0;
    width: 100%;
}

/* Callout Block - Updated */
.ai-callout {
    margin-top: 20px;
    padding-left: 16px;
    border-left: 2px solid rgba(139, 92, 246, 0.35);
    font-size: 13px;
    /* Reduced to exactly 13px per request */
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 500;
    margin-bottom: 18px;
    /* Added spacing to buttons */
}

/* Open Source Link Styling */
.ai-link-highlight {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;

  gap: 4px;            /* vorher 6px */
  line-height: inherit; /* vorher 1 */
  white-space: nowrap;  /* neu */
}

.ai-link-highlight:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.ai-link-highlight:hover .ai-icon-external {
    opacity: 1;
}

/* Icon Styles */
.ai-icon-external {
  width: 14px;
  height: 14px;
  display: inline-block;
  position: relative;
  top: 1px;            /* damit es optisch mittig sitzt */
  opacity: 0.9;
  color: currentColor;
  transition: opacity 0.2s;
}

.ai-icon-link {
    width: 14px;
    height: 14px;
    margin-left: 8px;
    opacity: 0.85;
    color: inherit;
    transition: all 0.2s;
}

/* Button Layout */
.ai-modal-actions-primary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}

.ai-modal-actions-secondary {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
}

/* Ghost Button for 'Mehr erfahren' - Updated */
.ai-btn-ghost {
    height: 30px;
    /* Reduced */
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ai-btn-ghost:hover {
    border: 1px solid rgba(139, 92, 246, 0.42);
    background: rgba(139, 92, 246, 0.08);
    color: rgba(255, 255, 255, 0.86);
}

.ai-btn-ghost:hover .ai-icon-link {
    opacity: 1;
    color: var(--primary);
    /* subtle shift */
}

/* Fix primary button alignment */
.ai-modal-actions-primary .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Keep existing sizes but ensure flex centering */
}