/* =========================================================
   Betriebsanweisung-Generator – Stylesheet
   =========================================================
   1. Variablen & Reset
   2. Mode-System (Maschine/Gefahrstoff)
   3. Navigation
   4. Hero + Mode-Switcher
   5. Editor-Panel
   6. Preview-Panel & A4-Seite
   7. Modals
   8. SEO-Bereich & FAQ
   9. Footer
  10. Toasts & Hinweise
  11. Subpages
  12. Mobile / Responsive / Print
   ========================================================= */

/* ---------- 1. Variablen & Reset ---------- */
:root {
    --ba-blue: #004b87;
    --ba-blue-dark: #003663;
    --ba-blue-soft: #e6f0fa;
    --ba-bg: #f4f7f6;
    --ba-green: #237F52;
    --ba-green-dark: #1a633f;
    --ba-orange: #d35400;
    --ba-orange-dark: #a04000;
    --ba-orange-soft: #fdebd0;
    --ba-warning-yellow: #fff3cd;
    --ba-text: #333;
    --ba-text-soft: #555;
    --ba-border: #ddd;
    --nav-height: 60px;
    --accent: var(--ba-blue);
    --accent-dark: var(--ba-blue-dark);
    --accent-soft: var(--ba-blue-soft);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--ba-bg);
    color: var(--ba-text);
    line-height: 1.5;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ba-blue);
    color: #fff;
    padding: 8px 16px;
    z-index: 2000;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}
.skip-link:focus { top: 0; }

/* ---------- 2. Mode-System ---------- */
body[data-mode="hazard"] {
    --accent: var(--ba-orange);
    --accent-dark: var(--ba-orange-dark);
    --accent-soft: var(--ba-orange-soft);
}

/* ---------- 3. Navigation ---------- */
nav {
    background: #fff;
    padding: 0 30px;
    border-bottom: 1px solid var(--ba-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
}
nav .logo {
    font-weight: bold;
    color: var(--ba-blue);
    font-size: 1.2rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
nav ul li a {
    text-decoration: none;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
nav ul li a:hover { color: var(--ba-blue); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--ba-blue);
    border-radius: 2px;
}

/* ---------- 4. Hero + Mode-Switcher ---------- */
.hero {
    padding: 30px 30px 0 30px;
    max-width: 1400px;
    margin: 0 auto;
}
.hero h1 {
    color: var(--ba-blue);
    font-size: 1.9rem;
    margin: 0 0 10px 0;
    line-height: 1.25;
}
.hero-subtitle {
    color: var(--ba-text-soft);
    font-size: 15px;
    max-width: 900px;
    margin: 0 0 20px 0;
    line-height: 1.55;
}
.hero abbr {
    text-decoration: none;
    border-bottom: 1px dotted #999;
    cursor: help;
}

.mode-switcher {
    display: inline-flex;
    gap: 0;
    margin-bottom: 25px;
    border: 1px solid #d0d4d9;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #fff;
    border: none;
    border-right: 1px solid #e3e6ea;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: #475569;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.mode-btn:last-child { border-right: none; }
.mode-btn:hover { background: #f6f7f9; }
.mode-btn .mode-icon { font-size: 14px; opacity: 0.85; }
.mode-btn .mode-label { font-weight: 600; font-size: 13px; }
.mode-btn .mode-hint { font-size: 11px; color: #94a3b8; margin-left: 4px; font-weight: 400; }

/* Aktiv = vollfarbig in der Mode-Farbe */
.mode-btn[data-mode="machine"].active {
    background: var(--ba-blue);
    color: #fff;
}
.mode-btn[data-mode="hazard"].active {
    background: var(--ba-orange);
    color: #fff;
}
.mode-btn.active .mode-label { color: #fff; }
.mode-btn.active .mode-hint { color: rgba(255,255,255,0.78); }
.mode-btn.active .mode-icon { opacity: 1; }

/* ---------- 5. Main Layout & Editor-Panel ---------- */
.main-wrapper {
    display: flex;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
}
.editor-panel {
    width: 45%;
    background: white;
    padding: 25px 40px 40px 25px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.editor-intro {
    background-color: #f8f9fa;
    border-left: 4px solid var(--accent);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    transition: border-color 0.3s;
}
.editor-intro .intro-title {
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    transition: color 0.3s;
}
.editor-intro p { margin: 0 0 10px 0; color: #555; }
.editor-intro ol { margin: 0; padding-left: 20px; line-height: 1.6; color: #555; }

.editor-warning {
    background-color: var(--ba-warning-yellow);
    border-left: 4px solid #ffb300;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    font-size: 13px;
}
.editor-warning strong:first-child {
    color: #d84315;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
.editor-warning p { margin: 0 0 8px 0; line-height: 1.6; color: #555; }
.editor-warning p:last-child { margin-bottom: 0; }

.form-section {
    border-bottom: 2px solid var(--accent);
    margin-bottom: 20px;
    padding-bottom: 10px;
    transition: border-color 0.3s;
}
.form-group { margin-bottom: 15px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--ba-text);
}

input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    overflow: hidden;
    min-height: 50px;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input { min-height: auto; }
input:focus, textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-template {
    background: var(--ba-green);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
    margin-bottom: 15px;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(35, 127, 82, 0.2);
}
.btn-template:hover { background: var(--ba-green-dark); transform: translateY(-1px); }

.btn-add-icon {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px dashed var(--accent);
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
    transition: background 0.2s, color 0.2s, border-color 0.3s;
}
.btn-add-icon:hover { background: var(--accent); color: #fff; }

.btn-download {
    width: 100%;
    padding: 18px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0,75,135,0.3);
    transition: background 0.2s, transform 0.2s;
}
.btn-download:hover { background: var(--accent-dark); transform: translateY(-2px); }
body[data-mode="hazard"] .btn-download { box-shadow: 0 4px 15px rgba(211,84,0,0.3); }

.btn-coffee {
    display: block;
    text-align: center;
    background: #FFDD00;
    color: #000;
    text-decoration: none;
    padding: 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    margin-top: 20px;
    border: 1px solid #e1c400;
    transition: background 0.2s;
}
.btn-coffee:hover { background: #f5d400; }

.btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    background: #fff;
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}
.btn-secondary:hover { background: var(--accent-soft); }

/* === Unterweisungs-Nachweis (A4-PDF) === */
/* Komplettes Layout muss zwingend in 297mm Höhe passen.
   Mit 5mm Rahmen + 4mm Innen-padding bleibt nutzbare Höhe ~ 279mm. */
.unterweisung-page {
    width: 210mm;
    height: 297mm;
    background: white;
    border: 5mm solid var(--accent);
    padding: 4mm 6mm;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    color: #000;
    font-size: 9.5pt;
    line-height: 1.3;
    overflow: hidden;
}
.uw-header { text-align: center; margin-bottom: 3mm; padding-bottom: 2mm; border-bottom: 2px solid var(--accent); }
.uw-header h1 { font-size: 14pt; color: var(--accent); margin: 0 0 0.5mm 0; letter-spacing: 0.4px; }
.uw-legal { font-size: 8pt; color: #555; margin: 0; }

.uw-meta { width: 100%; border-collapse: collapse; margin-bottom: 3mm; }
.uw-meta td { border: 1px solid #aaa; padding: 2px 6px; vertical-align: middle; font-size: 9pt; height: 6mm; }
.uw-meta .uw-label { background: var(--accent-soft); color: var(--accent); font-weight: bold; width: 22mm; white-space: nowrap; font-size: 8.5pt; }

.uw-section-title {
    background: var(--accent);
    color: #fff;
    font-size: 9.5pt;
    padding: 2px 6px;
    margin: 3mm 0 1.5mm 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.uw-content {
    white-space: pre-wrap;
    font-size: 8.5pt;
    line-height: 1.35;
    padding: 2mm 3mm;
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 2px;
    min-height: 25mm;
    max-height: 55mm;
    overflow: hidden;
}

.uw-sign-table { width: 100%; border-collapse: collapse; }
.uw-sign-table td { padding: 2px 6px 4px 6px; vertical-align: top; border: 1px solid #aaa; }
.uw-mini-label { font-size: 7pt; color: var(--accent); font-weight: bold; display: block; margin-bottom: 0.5mm; }
.uw-value { font-size: 9.5pt; min-height: 5mm; }
.uw-sign-line { border-bottom: 1px solid #000; height: 6mm; }

.uw-participant-note {
    font-size: 7.5pt;
    font-style: italic;
    color: #444;
    margin: 0 0 1.5mm 0;
}
.uw-participants { width: 100%; border-collapse: collapse; }
.uw-participants th {
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 8pt;
    border: 1px solid #aaa;
    padding: 2px 5px;
    text-align: left;
}
.uw-participants td {
    border: 1px solid #aaa;
    height: 7mm;
    padding: 1px 5px;
    font-size: 8.5pt;
}

.uw-footer {
    margin-top: 2mm;
    padding-top: 1.5mm;
    border-top: 1px solid #ccc;
    font-size: 7pt;
    color: #777;
    text-align: center;
    font-style: italic;
}

.btn-preview-mobile { display: none; }

.autosave-hint {
    text-align: center;
    color: var(--ba-green);
    font-size: 12px;
    margin: 10px 0 0 0;
    font-weight: 600;
}

/* Icon-Auswahl */
.selected-icons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 45px;
}
.selected-icon-item {
    position: relative;
    width: 50px;
    height: 50px;
    border: 1px solid var(--ba-border);
    border-radius: 4px;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}
.selected-icon-item img { width: 100%; height: 100%; object-fit: contain; }
.remove-icon {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #d12;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

/* ---------- 6. Preview-Panel & A4-Seite ---------- */
.preview-panel {
    width: 55%;
    background: #525659;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow: hidden;
}
.preview-panel::-webkit-scrollbar { display: none; }

.zoom-wrapper {
    transform: scale(0.65);
    transform-origin: top center;
    margin-bottom: -350px;
}

.a4-page {
    width: 210mm;
    height: 297mm;
    background: white;
    border: 8mm solid var(--accent);
    padding: 0;
    position: relative;
    font-family: Arial, sans-serif;
    color: #000;
    transition: border-color 0.3s;
}

.ba-header-table { width: 100%; border-collapse: collapse; border-bottom: 2px solid var(--accent); transition: border-color 0.3s; }
.ba-header-table td { border: 1px solid var(--ba-border); padding: 5px 10px; vertical-align: top; font-size: 10px; }
.ba-doc-label { font-size: 11px; text-align: center; margin: 0; }
.title-large { font-size: 22px; font-weight: bold; margin: 2px 0; color: var(--accent); text-transform: uppercase; text-align: center; transition: color 0.3s; }
.header-label { font-weight: bold; color: var(--accent); display: block; margin-bottom: 2px; font-size: 9px; transition: color 0.3s; }
.header-value { font-size: 11px; }
.sign-line { border-bottom: 1px solid #000; height: 12px; }

.ba-section h3 {
    margin: 0;
    background: var(--accent);
    color: white;
    padding: 4px 10mm;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid white;
    transition: background 0.3s;
}
.ba-content-wrapper { display: grid; grid-template-columns: 70px 1fr; gap: 5mm; padding: 5px 10mm; }
.ba-text { grid-column: 2; font-size: 10pt; line-height: 1.3; white-space: pre-wrap; margin: 0; }
.ba-icons { grid-column: 1; display: flex; flex-direction: column; gap: 3mm; align-items: center; padding-top: 5px; }
.ba-icons img { width: 45px; height: 45px; }

.footer-info {
    position: absolute;
    bottom: 6mm; left: 10mm; right: 10mm;
    border-top: 1px solid #ccc;
    padding-top: 3px;
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #777;
}

/* ---------- 7. Modals ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}
.modal-header {
    background: var(--accent);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.template-disclaimer {
    background: #fff8e1;
    border-bottom: 1px solid #f0c800;
    border-left: 5px solid #ffb300;
    padding: 12px 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #6c4d02;
}
.template-disclaimer strong { color: #8a3a00; }

/* Bestätigungs-Checkbox im Vorlagen-Modal */
.confirm-check {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 18px 0 10px 0;
    cursor: pointer;
    padding: 14px 16px;
    background: #fff8e1;
    border-left: 4px solid #ffb300;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.45;
}
.confirm-check input[type="checkbox"] {
    /* explizit, weil die allgemeinen input-Styles sonst greifen */
    width: 24px;
    height: 24px;
    min-height: 24px;
    min-width: 24px;
    padding: 0;
    margin: 0;
    border: 2px solid #b87900;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #d35400;
    box-shadow: none;
}
.confirm-check input[type="checkbox"]:focus {
    outline: 2px solid #d35400;
    outline-offset: 2px;
    box-shadow: none;
}

.modal-search-bar { padding: 15px 20px; background: #f8f9fa; border-bottom: 1px solid var(--ba-border); }
.modal-search-bar input { width: 100%; padding: 12px; font-size: 16px; border: 1px solid #ccc; border-radius: 6px; }
.modal-grid {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.modal-template-card {
    border: 1px solid var(--ba-border);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    border-left: 6px solid var(--ba-green);
    word-wrap: break-word;
}
.modal-template-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); background: #f4fbf7; }
.template-title { font-weight: bold; color: var(--accent); margin-bottom: 5px; font-size: 16px; transition: color 0.3s; }
.template-desc { font-size: 12px; color: #666; margin-bottom: 8px; }
.template-source { font-size: 11px; color: #237F52; padding: 6px 8px; background: #eaf6ef; border-radius: 4px; line-height: 1.4; }
.template-source a { color: #237F52; text-decoration: underline; }
.template-source--missing { color: #b34000; background: #fff4eb; }
.close-modal { background: none; border: none; color: white; font-size: 30px; cursor: pointer; line-height: 1; padding: 0 8px; }

.icon-card {
    border: 1px solid var(--ba-border);
    padding: 10px;
    cursor: pointer;
    text-align: center;
    border-radius: 6px;
    transition: border-color 0.15s, background 0.15s;
}
.icon-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.icon-card img { width: 48px; height: 48px; }
.icon-card .icon-name { font-size: 11px; margin-top: 4px; color: var(--ba-text); }

/* Mobile-Preview-Modal */
#mobilePreviewModal .modal-content {
    background: #525659;
    padding: 20px;
    overflow: auto;
    align-items: center;
}
#mobilePreviewModal .zoom-wrapper {
    transform: scale(0.5);
    transform-origin: top center;
    margin-bottom: -700px;
}

/* ---------- 8. SEO-Bereich & FAQ ---------- */
.seo-container { background: white; padding: 80px 20px; border-top: 1px solid var(--ba-border); }
.seo-max-width { max-width: 1000px; margin: 0 auto; line-height: 1.7; }
.seo-max-width h2 { color: var(--ba-blue); margin-top: 40px; }
.seo-h2-center { text-align: center; font-size: 32px; margin-bottom: 40px; }
.seo-h2-spaced { margin-top: 60px; }
.seo-ol-spaced { line-height: 2; }
.seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 20px 0; }

.highlight-box {
    background-color: var(--ba-blue-soft);
    padding: 18px 22px;
    border-left: 4px solid var(--ba-blue);
    border-radius: 4px;
    font-size: 14px;
}
.highlight-box h3 { margin-top: 0; color: var(--ba-blue); }
.highlight-box--green { background-color: #e8f5ee; border-left-color: var(--ba-green); }
.highlight-box--green h3 { color: var(--ba-green); }
.highlight-box--blue-soft { background-color: var(--ba-blue-soft); border-left-color: var(--ba-blue); }
.highlight-box--orange-soft { background-color: var(--ba-orange-soft); border-left-color: var(--ba-orange); }
.highlight-box--orange-soft h3 { color: var(--ba-orange); }

.faq-section { margin-top: 50px; }

.accordion-item {
    background: #fff;
    border: 1px solid var(--ba-border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.accordion-item:hover { border-color: var(--ba-blue); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.accordion-header {
    width: 100%;
    padding: 18px 25px;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: var(--ba-blue);
    font-family: inherit;
}
.accordion-header:after { content: '+'; font-size: 22px; color: var(--ba-blue); margin-left: 12px; }
.accordion-item.active .accordion-header:after { content: '−'; }
.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
    background: #f9f9f9;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    font-size: 14px;
    line-height: 1.6;
}
.accordion-item.active .accordion-content {
    max-height: 600px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
}

/* ---------- 9. Footer ---------- */
.site-footer {
    margin-top: 80px;
    text-align: center;
    font-size: 13px;
    color: #888;
    border-top: 1px solid #eee;
    padding: 40px 20px;
    background: #fff;
}
.site-footer p { margin: 6px 0; }
.site-footer a { color: #666; margin: 0 6px; text-decoration: none; }
.site-footer a:hover { color: var(--ba-blue); text-decoration: underline; }
.counter-wrapper { margin-bottom: 15px; color: #666; font-size: 14px; }
.counter-wrapper strong { color: var(--ba-blue); }

/* ---------- 10. Toasts & Hinweise ---------- */
#overflow-warning {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 20px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    border-left: 5px solid #f39c12;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1100;
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.close-warning {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: #856404;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: #fff;
    border-left: 5px solid var(--ba-green);
    padding: 14px 18px;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1100;
    font-size: 13px;
    max-width: 320px;
    animation: slideInLeft 0.3s ease-out;
}
.toast button {
    background: var(--ba-green);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    margin-right: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    margin-top: 8px;
}
.toast button.secondary { background: #eee; color: #333; }
@keyframes slideInLeft {
    from { transform: translateX(-120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---------- 11. Subpages ---------- */
.container {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 5px solid var(--ba-blue);
}
.container h1 { color: var(--ba-blue); font-size: 28px; margin-top: 0; }
.container h2 { color: var(--ba-green); font-size: 18px; margin-top: 30px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.container h3 { font-size: 16px; color: #444; margin-top: 20px; }
.container a { color: var(--ba-blue); text-decoration: none; font-weight: 500; }
.container a:hover { text-decoration: underline; }
.back-link {
    display: inline-block;
    margin-bottom: 25px;
    font-weight: bold;
    color: var(--ba-blue);
    background: var(--ba-blue-soft);
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.2s, color 0.2s;
}
.back-link:hover {
    background: var(--ba-blue);
    color: white !important;
    text-decoration: none !important;
}
.highlight {
    background-color: var(--ba-blue-soft);
    padding: 15px 20px;
    border-left: 4px solid var(--ba-blue);
    border-radius: 4px;
    margin: 20px 0;
    font-size: 14px;
}

/* ---------- 12. Mobile / Responsive / Print ---------- */
@media (max-width: 1023px) {
    nav { padding: 0 16px; }
    nav .logo { font-size: 1.05rem; }
    .nav-toggle { display: flex; }
    nav ul {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
        border-bottom: 1px solid var(--ba-border);
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    }
    nav ul.open { display: flex; }
    nav ul li { width: 100%; }
    nav ul li a {
        display: block;
        padding: 14px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .hero { padding: 20px 16px 0 16px; }
    .hero h1 { font-size: 1.5rem; }
    .hero-subtitle { font-size: 14px; }

    .mode-switcher { display: flex; width: 100%; }
    .mode-btn { flex: 1; justify-content: center; padding: 10px 12px; }
    .mode-btn .mode-hint { display: none; }

    .main-wrapper { flex-direction: column; }

    .editor-panel {
        width: 100%;
        padding: 20px 16px 100px 16px;
        box-shadow: none;
    }
    .form-row { grid-template-columns: 1fr; gap: 0; }

    .preview-panel { display: none; }
    .btn-preview-mobile {
        display: block;
        width: 100%;
        padding: 14px;
        background: #fff;
        border: 2px dashed var(--accent);
        color: var(--accent);
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 15px;
        transition: background 0.2s;
    }
    .btn-preview-mobile:hover { background: var(--accent-soft); }

    .btn-download {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        z-index: 90;
        font-size: 16px;
        padding: 16px;
    }
    .btn-coffee { margin-bottom: 70px; }

    .seo-container { padding: 50px 16px; }
    .seo-h2-center { font-size: 24px; margin-bottom: 25px; }
    .seo-grid { grid-template-columns: 1fr; gap: 18px; }
    .accordion-header { padding: 16px 18px; font-size: 15px; }

    .modal-content { width: 100%; height: 100vh; border-radius: 0; max-width: 100%; }
    .modal-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 14px; gap: 10px; }

    #overflow-warning { left: 16px; right: 16px; bottom: 80px; width: auto; }
    .toast { left: 16px; right: 16px; bottom: 80px; max-width: none; }

    .site-footer { margin-top: 40px; padding: 30px 16px 80px 16px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.3rem; }
}

@media print {
    nav, .hero, .editor-panel, .seo-container, .site-footer,
    #overflow-warning, .modal-overlay, .btn-preview-mobile { display: none !important; }
    .main-wrapper, .preview-panel { display: block !important; position: static !important; height: auto !important; padding: 0 !important; background: #fff !important; }
    .zoom-wrapper { transform: none !important; margin: 0 !important; }
    .a4-page { box-shadow: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
