/* Beta-Vorlagen – eigenes Stylesheet, unabhaengig vom Haupt-Editor.
   Alle Klassen mit bt- Praefix, damit nichts mit style.css kollidiert. */

:root {
    --bt-bg: #05070d;
    --bt-surface: rgba(13, 20, 38, 0.72);
    --bt-surface-2: rgba(5, 10, 22, 0.85);
    --bt-text: #e6edf7;
    --bt-muted: #9fb3c8;
    --bt-accent: #2dd4bf;
    --bt-accent-2: #22d3ee;
    --bt-accent-3: #818cf8;
    --bt-border: rgba(255, 255, 255, 0.12);
    --bt-radius: 14px;
    --bt-zoom: 0.75;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bt-bg);
    color: var(--bt-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

a { color: var(--bt-accent); }

/* --- Kopfzeile ---------------------------------------------------------- */

.bt-top {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--bt-border);
    background: var(--bt-surface-2);
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
}

.bt-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--bt-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bt-brand span.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bt-accent);
    box-shadow: 0 0 12px var(--bt-accent);
}

.bt-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.5);
    color: var(--bt-accent);
}

.bt-top nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-left: auto;
    font-size: 14px;
}

.bt-top nav a {
    color: var(--bt-muted);
    text-decoration: none;
}

.bt-top nav a:hover,
.bt-top nav a[aria-current="page"] {
    color: var(--bt-text);
}

/* --- Hinweisband ------------------------------------------------------- */

.bt-notice {
    margin: 18px auto 0;
    max-width: 1180px;
    padding: 12px 16px;
    border: 1px dashed rgba(129, 140, 248, 0.5);
    border-radius: var(--bt-radius);
    background: rgba(129, 140, 248, 0.08);
    color: var(--bt-muted);
    font-size: 14px;
}

.bt-notice strong { color: var(--bt-text); }

/* --- Seitenrahmen ------------------------------------------------------ */

.bt-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 22px 60px;
}

.bt-wrap h1 {
    font-size: 30px;
    margin: 10px 0 6px;
}

.bt-wrap .lead {
    color: var(--bt-muted);
    max-width: 68ch;
    margin: 0 0 24px;
}

/* --- Uebersicht: Karten ------------------------------------------------- */

.bt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.bt-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    background: var(--bt-surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 120ms ease, transform 120ms ease;
}

.bt-card:hover,
.bt-card:focus-visible {
    border-color: rgba(45, 212, 191, 0.55);
    transform: translateY(-2px);
}

.bt-card h2 {
    font-size: 17px;
    margin: 0;
}

.bt-card p {
    margin: 0;
    color: var(--bt-muted);
    font-size: 14px;
}

.bt-card .bt-open {
    margin-top: auto;
    font-size: 13px;
    color: var(--bt-accent);
}

/* Mini-Vorschau der Layouts (nur CSS, keine Bilder) */
.bt-thumb {
    height: 150px;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    padding: 10px;
    overflow: hidden;
    display: flex;
    gap: 8px;
    font-size: 6px;
    line-height: 1.35;
}

.bt-thumb .bar {
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin-bottom: 4px;
}

.bt-thumb .bar.accent { background: #0f766e; }
.bt-thumb .bar.name { height: 7px; width: 60%; background: #0f172a; }
.bt-thumb .col { flex: 1; display: flex; flex-direction: column; }
.bt-thumb .side { width: 34%; background: #f1f5f9; border-radius: 4px; padding: 6px; }
.bt-thumb .band { background: #0f766e; height: 26px; border-radius: 4px; margin-bottom: 6px; }
.bt-thumb .dot { width: 5px; height: 5px; border-radius: 50%; background: #0f766e; display: inline-block; margin-right: 3px; }

/* --- Editor-Aufbau ------------------------------------------------------ */

.bt-editor {
    display: grid;
    grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 22px 70px;
}

.bt-editor > * { min-width: 0; }

.bt-panel {
    background: var(--bt-surface);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    padding: 18px;
    position: sticky;
    top: 82px;
    max-height: calc(100vh - 104px);
    overflow: auto;
}

.bt-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.bt-step-btn {
    font: inherit;
    font-size: 13px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid var(--bt-border);
    background: transparent;
    color: var(--bt-muted);
    cursor: pointer;
}

.bt-step-btn[aria-selected="true"] {
    border-color: var(--bt-accent);
    color: var(--bt-text);
    background: rgba(45, 212, 191, 0.12);
}

.bt-step-panel[hidden] { display: none; }

.bt-step-panel h2 {
    font-size: 18px;
    margin: 0 0 4px;
}

.bt-step-panel .hint {
    color: var(--bt-muted);
    font-size: 13px;
    margin: 0 0 14px;
}

.bt-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--bt-muted);
}

.bt-field input,
.bt-field textarea,
.bt-field select {
    font: inherit;
    font-size: 14px;
    color: var(--bt-text);
    background: var(--bt-surface-2);
    border: 1px solid var(--bt-border);
    border-radius: 9px;
    padding: 9px 11px;
    width: 100%;
}

.bt-field textarea { resize: vertical; min-height: 70px; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; }

.bt-field input:focus-visible,
.bt-field textarea:focus-visible,
.bt-field select:focus-visible {
    outline: 2px solid rgba(45, 212, 191, 0.6);
    outline-offset: 1px;
}

.bt-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.bt-btn {
    font: inherit;
    font-size: 13px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--bt-border);
    background: transparent;
    color: var(--bt-text);
    cursor: pointer;
}

.bt-btn.primary {
    background: linear-gradient(135deg, var(--bt-accent), var(--bt-accent-2));
    color: #04231f;
    border: none;
    font-weight: 600;
}

.bt-btn:hover { border-color: var(--bt-accent); }

/* Layout-Auswahl */
.bt-layouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bt-layout-option {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
}

.bt-layout-option:has(input:checked) {
    border-color: var(--bt-accent);
    background: rgba(45, 212, 191, 0.1);
}

.bt-layout-option input { accent-color: var(--bt-accent); }

/* --- Vorschau-Buehne ---------------------------------------------------- */

.bt-stage {
    min-width: 0;
}

.bt-stage-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.bt-seg {
    display: inline-flex;
    border: 1px solid var(--bt-border);
    border-radius: 999px;
    overflow: hidden;
}

.bt-seg button {
    font: inherit;
    font-size: 13px;
    padding: 7px 13px;
    background: transparent;
    color: var(--bt-muted);
    border: none;
    cursor: pointer;
}

.bt-seg button[aria-pressed="true"] {
    background: rgba(45, 212, 191, 0.16);
    color: var(--bt-text);
}

.bt-paper-frame {
    background: #0b1220;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    padding: 18px;
    overflow: auto;
    scrollbar-gutter: stable;
    max-height: calc(100vh - 150px);
    width: 100%;
    min-width: 0;
}

.bt-paper-scaler {
    width: 210mm;
    transform: scale(var(--bt-zoom));
    transform-origin: top left;
    margin: 0 auto;
}

/* --- Dokument (A4) ------------------------------------------------------ */

.bt-sheet {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    color: #101828;
    padding: 16mm 15mm;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    font-size: 10.5pt;
    line-height: 1.45;
    overflow: hidden;
}

.bt-sheet + .bt-sheet { margin-top: 18px; }

.bt-sheet[hidden] { display: none; }

.bt-sheet h1 { margin: 0; }
.bt-sheet h2 { margin: 0; }
.bt-sheet p { margin: 0 0 8px; }
.bt-sheet ul { margin: 0; padding-left: 16px; }
.bt-sheet li { margin: 0 0 2px; }

/* --- Druck -------------------------------------------------------------- */

@media print {
    html, body { background: #fff; color: #000; }
    .bt-top, .bt-notice, .bt-panel, .bt-stage-bar, .bt-wrap .lead, .bt-no-print { display: none !important; }
    .bt-editor { display: block; padding: 0; }
    .bt-paper-frame { border: none; padding: 0; background: transparent; max-height: none; overflow: visible; }
    .bt-paper-scaler { transform: none; width: auto; margin: 0; }
    .bt-sheet {
        box-shadow: none;
        margin: 0;
        padding: 14mm 15mm;
        width: auto;
        min-height: 0;
        page-break-after: always;
    }
    .bt-sheet[hidden] { display: none !important; }
    .bt-sheet:last-child { page-break-after: auto; }
    @page { size: A4; margin: 0; }
}

/* --- Mobil -------------------------------------------------------------- */

@media (max-width: 980px) {
    .bt-editor { grid-template-columns: minmax(0, 1fr); }
    .bt-panel { position: static; max-height: none; }
    .bt-paper-frame { max-height: none; }
    .bt-top nav { width: 100%; margin-left: 0; }
    .bt-paper-scaler { margin: 0; }
}

/* --- Galerie ------------------------------------------------------------ */

.bt-gallery-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.bt-search {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--bt-muted);
    min-width: 260px;
}

.bt-search input {
    font: inherit;
    font-size: 14px;
    color: var(--bt-text);
    background: var(--bt-surface-2);
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    padding: 9px 11px;
}

.bt-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.bt-chip {
    font: inherit;
    font-size: 12.5px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--bt-border);
    background: transparent;
    color: var(--bt-muted);
    cursor: pointer;
}

.bt-chip.is-active,
.bt-chip:hover {
    border-color: var(--bt-accent);
    color: var(--bt-text);
    background: rgba(45, 212, 191, 0.1);
}

.bt-meta {
    font-size: 12.5px;
    color: var(--bt-muted);
    margin: 0;
    width: 100%;
}

.bt-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bt-photo-editor {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 4px 0 12px;
}

.bt-photo-editor canvas {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--bt-surface-2);
    border: 1px solid var(--bt-border);
    cursor: grab;
    flex: 0 0 auto;
    touch-action: none;
}

.bt-photo-editor canvas:active { cursor: grabbing; }

.bt-photo-controls { flex: 1; min-width: 0; }

.bt-subhead {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bt-accent);
    margin: 18px 0 8px;
    padding-top: 12px;
    border-top: 1px solid var(--bt-border);
}

.bt-family {
    font-size: 12px !important;
    color: var(--bt-accent) !important;
    margin: -4px 0 0 !important;
    letter-spacing: 0.02em;
}

.bt-tagrow { display: flex; flex-wrap: wrap; gap: 6px; }

.bt-tag {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--bt-border);
    color: var(--bt-muted);
}

.bt-card-layout .bt-thumb {
    display: block;
    padding: 10px;
    height: 170px;
}

.bt-card-layout .bt-thumb .t-head {
    height: 14px;
    margin-bottom: 8px;
}

.bt-card-layout .bt-thumb .t-line {
    height: 4px;
    margin-bottom: 5px;
}

.bt-card-layout .bt-thumb .t-cols {
    display: flex;
    gap: 8px;
    height: auto;
}

.bt-card-layout .bt-thumb .t-side {
    width: 36%;
    background: #eef2f6;
    border-radius: 4px;
    padding: 6px;
}

/* --- Vorlagen-Auswahl im Editor ---------------------------------------- */

.bt-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 46vh;
    overflow: auto;
    padding-right: 4px;
}

.bt-pick {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
}

.bt-pick input { display: none; }

.bt-pick.is-active,
.bt-pick:hover {
    border-color: var(--bt-accent);
    background: rgba(45, 212, 191, 0.08);
}

.bt-pick-no {
    font-size: 11px;
    font-weight: 700;
    color: var(--bt-accent);
    letter-spacing: 0.08em;
}

.bt-pick-name { font-weight: 600; }

.bt-pick-tags {
    grid-column: 2;
    font-size: 11px;
    color: var(--bt-muted);
}

.bt-inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.bt-inline input[type="checkbox"] { width: auto; }

.bt-inline-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--bt-muted);
}

.bt-inline-label select {
    font: inherit;
    font-size: 13px;
    color: var(--bt-text);
    background: var(--bt-surface-2);
    border: 1px solid var(--bt-border);
    border-radius: 8px;
    padding: 6px 8px;
    max-width: 180px;
}

.bt-inline-label input[type="range"] { width: 110px; accent-color: var(--bt-accent); }

.bt-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
    font-size: 12.5px;
    color: var(--bt-muted);
}

.bt-stats span { white-space: nowrap; }

.bt-hint { color: var(--bt-muted); font-size: 13px; }

/* Beide Dokumente drucken */
@media print {
    body.bt-print-all .bt-sheet[hidden] { display: block !important; }
    body.bt-print-all .bt-sheet { page-break-after: always; }
}

