/* ═══════════════════════════════════════════════════
   ASCII KOMMENTAR EDITOR  — ascii-kommentar.css
   Akzentfarbe: #37474F (Blue-Grey Dark)
═══════════════════════════════════════════════════ */

:root {
    --ak-accent:      #37474F;
    --ak-accent-m:    #546E7A;
    --ak-accent-l:    #90A4AE;
    --ak-accent-bg:   #ECEFF1;
    --ak-surface:     #FFFFFF;
    --ak-surface-2:   #F5F7F8;
    --ak-border:      #CFD8DC;
    --ak-text:        #263238;
    --ak-text-m:      #546E7A;
    --ak-text-s:      #78909C;
    --ak-radius:      10px;
    --ak-shadow:      0 2px 8px rgba(55,71,79,.10);
    --ak-shadow-md:   0 4px 16px rgba(55,71,79,.14);
}

/* ── Seite ──────────────────────────────────────── */
.ak-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Header ─────────────────────────────────────── */
.ak-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--ak-accent-bg);
}

.ak-header-icon {
    width: 52px;
    height: 52px;
    background: var(--ak-accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(55,71,79,.28);
}

.ak-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--ak-text);
    margin: 0 0 2px;
}

.ak-subtitle {
    color: var(--ak-text-m);
    font-size: .88rem;
    margin: 0;
}

/* ── Haupt-Layout ────────────────────────────────── */
.ak-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ── Linkes Panel ────────────────────────────────── */
.ak-panel-left {
    width: 370px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Section ─────────────────────────────────────── */
.ak-section {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    padding: 16px;
    box-shadow: var(--ak-shadow);
}

.ak-section-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ak-accent);
    margin-bottom: 12px;
}

/* ── Template-Buttons ────────────────────────────── */
.ak-template-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ak-tpl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    background: var(--ak-surface-2);
    border: 2px solid var(--ak-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .18s;
    color: var(--ak-text-m);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.ak-tpl-btn i {
    font-size: 1.1rem;
    color: var(--ak-accent-l);
    transition: color .18s;
}

.ak-tpl-btn:hover {
    border-color: var(--ak-accent-m);
    background: var(--ak-accent-bg);
    color: var(--ak-accent);
}

.ak-tpl-btn:hover i { color: var(--ak-accent); }

.ak-tpl-btn.active {
    border-color: var(--ak-accent);
    background: var(--ak-accent);
    color: #fff;
}

.ak-tpl-btn.active i { color: rgba(255,255,255,.85); }

/* ── Felder ──────────────────────────────────────── */
.ak-tpl-fields {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.ak-field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ak-label {
    font-size: .77rem;
    font-weight: 600;
    color: var(--ak-text-m);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ak-input,
.ak-select,
.ak-textarea-sm {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--ak-border);
    border-radius: 7px;
    font-size: .87rem;
    color: var(--ak-text);
    background: var(--ak-surface);
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
    font-family: inherit;
}

.ak-input:focus,
.ak-select:focus,
.ak-textarea-sm:focus {
    outline: none;
    border-color: var(--ak-accent-m);
    box-shadow: 0 0 0 3px rgba(84,110,122,.15);
}

.ak-textarea-sm {
    resize: vertical;
    min-height: 58px;
    line-height: 1.5;
}

.ak-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .87rem;
    color: var(--ak-text);
}

.ak-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ak-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.ak-hint {
    font-size: .78rem;
    color: var(--ak-text-s);
    background: var(--ak-accent-bg);
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1.5;
}

.ak-hint i { color: var(--ak-accent-m); margin-right: 4px; }

/* ── Stil-Grid (Border & Separator) ─────────────── */
.ak-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.ak-style-btn {
    padding: 6px 4px;
    background: var(--ak-surface-2);
    border: 1.5px solid var(--ak-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: .82rem;
    font-family: 'Consolas', 'Courier New', monospace;
    color: var(--ak-text-m);
    transition: all .15s;
    text-align: center;
    white-space: nowrap;
}

.ak-style-btn:hover {
    border-color: var(--ak-accent-m);
    color: var(--ak-accent);
    background: var(--ak-accent-bg);
}

.ak-style-btn.active {
    border-color: var(--ak-accent);
    background: var(--ak-accent);
    color: #fff;
}

/* ── Slider ──────────────────────────────────────── */
.ak-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ak-slider {
    flex: 1;
    height: 4px;
    accent-color: var(--ak-accent);
    cursor: pointer;
}

.ak-slider-val {
    font-size: .85rem;
    font-weight: 700;
    color: var(--ak-accent);
    min-width: 28px;
    text-align: right;
}

/* ── Rechtes Panel ───────────────────────────────── */
.ak-panel-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    box-shadow: var(--ak-shadow-md);
    overflow: hidden;
}

/* Preview-Header */
.ak-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--ak-accent);
    gap: 12px;
    flex-wrap: wrap;
}

.ak-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    color: rgba(255,255,255,.75);
    flex-wrap: wrap;
}

.ak-info-sep { opacity: .5; }

.ak-preview-btns {
    display: flex;
    gap: 8px;
}

.ak-btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.45);
    border-radius: 7px;
    color: #fff;
    font-size: .83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

.ak-btn-primary:hover {
    background: rgba(255,255,255,.30);
    border-color: rgba(255,255,255,.75);
}

.ak-btn-secondary {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: 7px;
    color: rgba(255,255,255,.75);
    font-size: .85rem;
    cursor: pointer;
    transition: all .18s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-btn-secondary:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
}

/* Preview-Textarea */
.ak-preview {
    flex: 1;
    width: 100%;
    min-height: 480px;
    padding: 16px 18px;
    background: #1C2529;
    color: #B0BEC5;
    font-family: 'Consolas', 'Courier New', 'Lucida Console', monospace;
    font-size: .82rem;
    line-height: 1.6;
    border: none;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    tab-size: 2;
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
}

.ak-preview::placeholder { color: #546E7A; }

/* Preview-Footer */
.ak-preview-footer {
    padding: 8px 14px;
    background: #263238;
    border-top: 1px solid #37474F;
}

.ak-preview-hint {
    font-size: .75rem;
    color: #546E7A;
}

.ak-preview-hint i { margin-right: 5px; }

/* ── Hinweise ────────────────────────────────────── */
.ak-notes { }

.ak-note-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.ak-note-card {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    padding: 14px 16px;
    font-size: .83rem;
    color: var(--ak-text-m);
    line-height: 1.65;
    box-shadow: var(--ak-shadow);
}

.ak-note-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--ak-accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ak-note-card code {
    background: var(--ak-accent-bg);
    color: var(--ak-accent);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .82rem;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ── Toast ───────────────────────────────────────── */
.ak-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ak-accent);
    color: #fff;
    padding: 9px 22px;
    border-radius: 8px;
    font-size: .86rem;
    font-weight: 600;
    box-shadow: 0 4px 18px rgba(55,71,79,.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s, transform .22s;
    z-index: 9000;
    white-space: nowrap;
}

.ak-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    .ak-layout {
        flex-direction: column;
    }

    .ak-panel-left {
        width: 100%;
    }

    .ak-preview {
        min-height: 320px;
    }
}
