:root {
    --bg-main: #f4e4cf;
    --bg-box: #fff7ea;
    --bg-content: #fffaf1;
    --accent: #a06d2e;
    --accent-dark: #824f18;
    --text-main: #2b2620;
    --text-muted: #6b5b4a;
    --border-soft: #e3d2b8;
    --shadow-soft: 0 6px 14px rgba(0, 0, 0, 0.12);
    --radius-lg: 18px;
    --radius-md: 12px;
    --transition-fast: 0.18s ease-out;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 32px 16px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: radial-gradient(circle at top, #fff7ea 0, #f4e4cf 45%, #e0c9a6 100%);
    color: var(--text-main);
}

/* Zurück-Button */

.back-button {
    position: fixed;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 247, 234, 0.94);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
    transition: background var(--transition-fast), transform var(--transition-fast),
        box-shadow var(--transition-fast);
    z-index: 10;
}

.back-button:hover {
    background: #fffaf1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.back-icon {
    font-size: 16px;
    line-height: 1;
}

.back-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* Main Box */

.generator-box {
    background: var(--bg-box);
    width: 100%;
    max-width: 980px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 26px 26px 24px;
}

/* Header */

.generator-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fffaf1;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.logo-text {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-main);
}

.generator-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Layout */

.generator-content {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
    gap: 20px;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tabs */

.tab-row {
    display: inline-flex;
    background: rgba(255, 250, 241, 0.96);
    border-radius: 999px;
    padding: 3px;
    border: 1px solid rgba(226, 196, 148, 0.85);
    margin-bottom: 10px;
}

.tab-button {
    border-radius: 999px;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: background var(--transition-fast), color var(--transition-fast),
        transform var(--transition-fast), box-shadow var(--transition-fast);
}

.tab-button--active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fffaf1;
    box-shadow: 0 3px 8px rgba(130, 79, 24, 0.4);
    transform: translateY(-1px);
}

/* Sections */

.section {
    display: none;
}

.section--active {
    display: block;
}

/* Form Elements */

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}

.label-inline {
    margin-top: 6px;
}

.field-input {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    padding: 9px 11px;
    font-size: 14px;
    background: var(--bg-content);
    color: var(--text-main);
    outline: none;
    transition: border var(--transition-fast), box-shadow var(--transition-fast),
        background var(--transition-fast), transform var(--transition-fast);
}

.field-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(160, 109, 46, 0.4);
    background: #fffdf7;
    transform: translateY(-1px);
}

.textarea {
    resize: vertical;
    min-height: 80px;
    font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    line-height: 1.4;
}

.small-textarea {
    min-height: 64px;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
    gap: 10px;
}

.field-row--tight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group {
    display: flex;
    flex-direction: column;
}

/* FAQ List */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 6px;
}

.faq-item {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: var(--bg-content);
    padding: 8px 10px 9px;
}

.faq-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.faq-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.faq-remove-btn {
    border-radius: 999px;
    border: 1px solid rgba(190, 62, 62, 0.3);
    background: rgba(248, 113, 113, 0.06);
    color: #b91c1c;
    font-size: 11px;
    padding: 3px 8px;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.faq-remove-btn:hover {
    background: rgba(248, 113, 113, 0.16);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(185, 28, 28, 0.25);
}

.faq-item textarea {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
}

/* Buttons */

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.primary-button,
.secondary-button,
.ghost-button {
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: none;
    transition: background var(--transition-fast), transform var(--transition-fast),
        box-shadow var(--transition-fast), color var(--transition-fast),
        border-color var(--transition-fast);
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fffaf1;
    box-shadow: 0 4px 10px rgba(130, 79, 24, 0.4);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(130, 79, 24, 0.46);
}

.secondary-button {
    background: var(--bg-content);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    flex: 1;
}

.secondary-button:hover {
    background: #fffdf7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.ghost-button {
    background: transparent;
    color: var(--accent-dark);
    border: 1px dashed rgba(160, 109, 46, 0.55);
}

.ghost-button:hover {
    background: rgba(160, 109, 46, 0.08);
    transform: translateY(-1px);
}

.ghost-button--small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Preview Card */

.preview-column {
    display: flex;
}

.preview-card {
    background: var(--bg-content);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    padding: 14px 14px 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.preview-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-main);
}

.output-toggle-row {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid rgba(226, 196, 148, 0.85);
    background: rgba(255, 250, 241, 0.96);
    padding: 3px;
    gap: 3px;
    margin-bottom: 8px;
}

.output-toggle {
    border-radius: 999px;
    border: none;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: background var(--transition-fast), color var(--transition-fast),
        transform var(--transition-fast), box-shadow var(--transition-fast);
}

.output-toggle--active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fffaf1;
    box-shadow: 0 2px 6px rgba(130, 79, 24, 0.4);
    transform: translateY(-1px);
}

.code-textarea {
    min-height: 240px;
    font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}

/* Meta-Bar */

.meta-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 6px;
}

.meta-item {
    background: linear-gradient(135deg, #fffdf7, #f6e7d1);
    border-radius: var(--radius-md);
    padding: 6px 8px;
    border: 1px solid rgba(226, 196, 148, 0.8);
}

.meta-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 1px;
}

.meta-value {
    font-size: 13px;
    font-weight: 700;
}

/* Help Box / Hints */

.help-box {
    margin-top: 6px;
    padding: 10px 11px;
    border-radius: var(--radius-md);
    background: rgba(255, 250, 241, 0.96);
    border: 1px solid rgba(226, 196, 148, 0.85);
}

.help-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text-main);
}

.help-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: var(--text-muted);
}

.help-list li + li {
    margin-top: 2px;
}

.hint-text {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

.hint-text--bottom {
    margin-top: 6px;
}

/* Code + Scrollbar */

code {
    background: rgba(0, 0, 0, 0.04);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 11px;
}

textarea::-webkit-scrollbar {
    width: 6px;
}

textarea::-webkit-scrollbar-track {
    background: transparent;
}

textarea::-webkit-scrollbar-thumb {
    background: rgba(160, 109, 46, 0.35);
    border-radius: 999px;
}

/* Responsive */

@media (max-width: 880px) {
    body {
        padding: 64px 10px 16px;
    }

    .generator-box {
        padding: 20px 16px 16px;
    }

    .generator-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .preview-card {
        max-width: 480px;
        margin: 0 auto;
    }

    .back-button {
        top: 10px;
        left: 10px;
    }
}

@media (max-width: 520px) {
    .field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .meta-bar {
        grid-template-columns: minmax(0, 1fr);
    }

    .tab-row,
    .output-toggle-row {
        width: 100%;
    }

    .tab-button,
    .output-toggle {
        flex: 1;
        text-align: center;
    }

    .logo-text {
        font-size: 15px;
    }
}
