/*
 * Editor layout: steps, form pane, preview pane, drawer, lists, checks.
 * ≥1024 px side by side; below: tabs "Eingabe | Vorschau"; <768 px preview as full-screen overlay.
 * Uses the --ui-* tokens from app.css.
 */

.page-editor { background: var(--ui-surface); }

/* ---------------------------------------------------------- top bars */
.editor-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.45rem 16px; background: var(--ui-surface); border-bottom: 1px solid var(--ui-line);
}
.editor-bar-left, .editor-bar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
#btn-mappen { color: var(--ui-text); background: var(--ui-surface-2); border: 1px solid var(--ui-line); }
#btn-mappen:hover { background: var(--ui-brand-softer); border-color: #cfdcea; }
.save-status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.83rem; color: var(--ui-muted); }
.save-status:not(:empty)::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #1e9e5a; box-shadow: 0 0 0 3px rgba(30, 158, 90, 0.15); }
#mappe-titel { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ampel { border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-text); border-radius: 999px; padding-left: 0.65rem; padding-right: 0.85rem; }
.ampel:hover { background: var(--ui-surface-2); }
.ampel-dot { width: 12px; height: 12px; border-radius: 50%; background: #1e9e5a; display: inline-block; box-shadow: 0 0 0 4px rgba(30, 158, 90, 0.16); }
.ampel[data-ampel="gelb"] .ampel-dot { background: #d29a00; box-shadow: 0 0 0 4px rgba(210, 154, 0, 0.18); }
.ampel[data-ampel="rot"] .ampel-dot { background: #c62d24; box-shadow: 0 0 0 4px rgba(198, 45, 36, 0.16); }
#btn-export { border-radius: 999px; padding-left: 0.95rem; padding-right: 1.05rem; }

.steps { background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); overflow-x: auto; scrollbar-width: thin; }
.steps ol { display: flex; list-style: none; margin: 0; padding: 0.45rem 12px; gap: 0.3rem; min-width: max-content; }
.step {
  display: flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0 0.85rem 0 0.4rem;
  border: 1px solid transparent; border-radius: 999px; background: transparent; font: inherit; font-size: 0.92rem; font-weight: 550;
  color: var(--ui-text-2); cursor: pointer; white-space: nowrap; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.step:hover { color: var(--ui-text); background: #f1f4f8; }
.step-nr {
  width: 1.65rem; height: 1.65rem; border-radius: 50%; display: inline-grid; place-items: center;
  background: #eef2f7; color: var(--ui-text-2); font-size: 0.78rem; font-weight: 700; border: 1px solid var(--ui-line);
}
.step[aria-current="step"] { color: var(--ui-brand); background: var(--ui-brand-soft); border-color: #cfe0f1; font-weight: 650; }
.step[aria-current="step"] .step-nr { background: var(--ui-gradient); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(31, 78, 121, 0.3); }
.step.done .step-nr { background: var(--ui-ok-soft); color: var(--ui-ok); border-color: #c9ead7; }

.pane-tabs { display: flex; gap: 3px; margin: 0.5rem 12px; padding: 3px; background: #edf1f6; border: 1px solid var(--ui-line); border-radius: 12px; }
.pane-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 600; color: var(--ui-text-2); cursor: pointer; }
.pane-tabs button[aria-selected="true"] { color: var(--ui-brand); background: var(--ui-surface); box-shadow: var(--ui-shadow-s); }

/* ------------------------------------------------------------- panes */
.editor { display: block; }
.pane-form { padding: 1.5rem 16px 2.5rem; max-width: 52rem; margin: 0 auto; background: var(--ui-surface); }
.pane-preview {
  display: none;
  background-color: #eef2f7;
  background-image: radial-gradient(rgba(31, 78, 121, 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
}
body.show-preview .pane-form { display: none; }
body.show-preview .pane-preview { display: flex; flex-direction: column; }
.preview-close { display: none; }

@media (max-width: 767px) {
  body.show-preview .pane-preview { position: fixed; inset: 0; z-index: 60; }
  body.show-preview .preview-close { display: inline-flex; }
  body.show-preview .pane-form { display: block; }
}
@media (min-width: 1024px) {
  .pane-tabs { display: none; }
  .editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .pane-form, body.show-preview .pane-form { display: block; max-width: none; margin: 0; padding: 2rem 32px 3rem; }
  .pane-preview, body.show-preview .pane-preview {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-left: 1px solid var(--ui-line);
  }
}
@media (min-width: 1280px) {
  .editor { grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); }
  .pane-form, body.show-preview .pane-form { padding-left: 48px; padding-right: 48px; }
}

.step-panel { max-width: 46rem; }
.step-panel h1 { font-size: 1.75rem; letter-spacing: -0.03em; margin-bottom: 0.35rem; }
.step-panel > .lead { margin-bottom: 1.5rem; }
.step-panel h2 { font-size: 1.15rem; }
.step-nav { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--ui-line); }

/* ----------------------------------------------------------- preview */
.preview-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.55rem 14px; background: rgba(255, 255, 255, 0.82); border-bottom: 1px solid var(--ui-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.preview-docs { display: flex; gap: 3px; flex-wrap: wrap; padding: 3px; background: #edf1f6; border: 1px solid var(--ui-line); border-radius: 12px; }
.chip {
  min-height: 32px; padding: 0.2rem 0.75rem; border-radius: 9px; border: 0; background: transparent;
  font: inherit; font-size: 0.84rem; font-weight: 550; color: var(--ui-text-2); cursor: pointer; transition: background-color 0.15s, color 0.15s;
}
.chip:hover { color: var(--ui-text); }
.chip[aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-brand); box-shadow: var(--ui-shadow-s); }
.preview-meta { display: flex; align-items: center; gap: 0.5rem; }
.page-fill { font-size: 0.83rem; font-weight: 600; color: var(--ui-text-2); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 999px; padding: 0.2rem 0.7rem; }
.page-fill:empty { display: none; }
.page-fill.warn { color: var(--ui-danger); border-color: #efc2be; background: var(--ui-danger-soft); }
.preview-frame-wrap { position: relative; flex: 1; overflow: auto; padding: 0.75rem 0 0; }
.preview-scale { position: relative; transform-origin: 0 0; width: 820px; }
/* Double buffer: the next render loads invisibly in .is-buffer and is swapped in when complete. */
.preview-frame { display: block; width: 820px; height: 1200px; border: 0; background: transparent; }
.preview-frame.is-buffer { position: absolute; top: 0; left: 0; visibility: hidden; pointer-events: none; }
.preview-loading {
  position: absolute; top: 0.75rem; right: 1rem; margin: 0; display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; font-weight: 600; background: rgba(255, 255, 255, 0.95); padding: 0.3rem 0.75rem; border-radius: 999px;
  color: var(--ui-text-2); box-shadow: var(--ui-shadow); border: 1px solid var(--ui-line);
}
.preview-loading::before { content: ''; width: 12px; height: 12px; border: 2px solid #c9d8e8; border-top-color: var(--ui-brand); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ------------------------------------------------------------ cards */
.cards { display: grid; gap: 0.65rem; grid-template-columns: 1fr; border: 0; padding: 0; margin: 0 0 1.5rem; }
@media (min-width: 560px) { .cards-situation, .cards-design { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cards-situation { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cards-design { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cards-ton { grid-template-columns: 1fr; }
@media (min-width: 768px) { .cards-ton { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card-radio { position: relative; display: block; cursor: pointer; }
.card-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.card-radio-body {
  position: relative; display: flex; flex-direction: column; gap: 0.2rem; height: 100%; padding: 0.9rem 2.4rem 0.9rem 1rem;
  border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); box-shadow: var(--ui-shadow-s);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s, transform 0.15s;
}
.card-radio-body strong { font-weight: 650; letter-spacing: -0.01em; }
.card-radio-body span { font-size: 0.86rem; color: var(--ui-muted); line-height: 1.45; }
.card-radio-body::after {
  content: ''; position: absolute; top: 0.85rem; right: 0.85rem; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--ui-line-strong); background: var(--ui-surface);
}
.card-radio:hover .card-radio-body { border-color: #b9cbe0; box-shadow: var(--ui-shadow); transform: translateY(-1px); }
.card-radio input:checked + .card-radio-body { border-color: var(--ui-brand-bright); box-shadow: var(--ui-ring), var(--ui-shadow-s); background: var(--ui-brand-softer); }
.card-radio input:checked + .card-radio-body::after { border: 5px solid var(--ui-brand); }
.card-radio input:focus-visible + .card-radio-body { outline: 3px solid #2f74b5; outline-offset: 2px; }
.card-radio input:disabled + .card-radio-body { opacity: 0.5; cursor: not-allowed; transform: none; }
.ats-note { font-size: 0.8rem; color: var(--ui-warn); font-style: normal; }

.design-thumb { display: block; height: 58px; margin-bottom: 0.45rem; border-radius: 8px; background: var(--ui-surface-2); border: 1px solid var(--ui-line); position: relative; overflow: hidden; }
.design-thumb i { position: absolute; display: block; background: #c5d0dd; height: 5px; border-radius: 3px; }
.design-thumb i:nth-child(1) { top: 10px; left: 10px; width: 40%; height: 7px; background: var(--ui-brand); }
.design-thumb i:nth-child(2) { top: 26px; left: 10px; width: 70%; }
.design-thumb i:nth-child(3) { top: 38px; left: 10px; width: 55%; }
.design-thumb-klassik i:nth-child(2), .design-thumb-zeitstrahl i:nth-child(2) { left: 34%; width: 55%; }
.design-thumb-klassik i:nth-child(3), .design-thumb-zeitstrahl i:nth-child(3) { left: 34%; width: 45%; }
.design-thumb-zeitstrahl::after { content: ''; position: absolute; left: 30%; top: 18px; bottom: 6px; width: 2px; background: var(--ui-brand); }
.design-thumb-akzent { background: linear-gradient(90deg, #1F4E79 0 28%, #f8fafd 28% 100%); }
.design-thumb-akzent i { left: 34% !important; }
.design-thumb-akzent i:nth-child(1) { width: 40%; }
.design-thumb-executive i:nth-child(1) { left: 25%; width: 50%; background: var(--ui-text); }
.design-thumb-standard i { height: 4px; }

.swatches { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.swatch { position: relative; display: inline-flex; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-color { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ui-line-strong), var(--ui-shadow-s); transition: transform 0.15s, box-shadow 0.15s; }
.swatch:hover .swatch-color { transform: scale(1.06); }
.swatch input:checked + .swatch-color { box-shadow: 0 0 0 2px var(--ui-text), var(--ui-shadow); }
.swatch input:focus-visible + .swatch-color { outline: 3px solid #2f74b5; outline-offset: 3px; }
.swatch-1f4e79 { background: #1F4E79; }
.swatch-2e5e4e { background: #2E5E4E; }
.swatch-5b2c6f { background: #5B2C6F; }
.swatch-7a1f2b { background: #7A1F2B; }
.swatch-1f6f8b { background: #1F6F8B; }
.swatch-3c3c3c { background: #3C3C3C; }
.swatch-8a5a00 { background: #8A5A00; }
.swatch-24527a { background: #24527A; }
.swatch-custom { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; }
.swatch-custom input { width: 44px; height: 44px; padding: 0; border: 1px solid var(--ui-line-strong); border-radius: 10px; background: #fff; }
.font-source-serif { font-family: Georgia, 'Liberation Serif', serif; }
input[type="range"] { width: 100%; accent-color: var(--ui-brand); min-height: 44px; box-shadow: none; border: 0; padding: 0; }
output { font-weight: 500; color: var(--ui-muted); margin-left: 0.4rem; }

/* ------------------------------------------------------- field extras */
.field-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.field-tools { display: flex; gap: 0.25rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.25rem; }
.field-tools .btn-ghost { background: var(--ui-brand-softer); border: 1px solid #dbe7f3; }
.field-tools .btn-ghost:hover { background: var(--ui-brand-soft); }
.counter { font-size: 0.8rem; color: var(--ui-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.counter.warn { color: var(--ui-danger); font-weight: 600; }
.word-total { font-size: 0.9rem; color: var(--ui-text-2); font-variant-numeric: tabular-nums; }
.word-total.warn { color: var(--ui-danger); font-weight: 600; }
.ph-status { margin-top: 0.35rem; font-size: 0.85rem; background: var(--ui-warn-soft); color: #5c4300; border: 1px solid #f0d98c; border-radius: 8px; padding: 0.35rem 0.65rem; }
.field.needs-variant textarea, .field.needs-variant input { border-color: #d29a00; background: #fffbea; }
.variant-note { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.35rem; font-size: 0.85rem; color: #5c4300; }
.inline-check { font-size: 0.85rem; margin: 0.35rem 0 0; padding: 0.35rem 0.65rem; border-radius: 8px; background: var(--ui-warn-soft); color: #5c4300; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1rem; }
.depends { margin-left: 2rem; }
.disclosure { background: var(--ui-surface-2); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 0.7rem 1rem; margin: 0.5rem 0 1.25rem; }
.disclosure summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.disclosure[open] summary { margin-bottom: 0.5rem; }
.subsection { margin: 2.25rem 0 0; }
.subsection-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.subsection-head h2 { margin: 0; }
.email-betreff { font-size: 0.95rem; }

.media-row { margin-top: 1rem; }
.media-box { background: var(--ui-surface-2); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.media-box h2 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.media-preview { margin: 0.6rem 0; }
.media-foto img { width: 90px; height: 120px; border-radius: 10px; border: 1px solid var(--ui-line); object-fit: cover; box-shadow: var(--ui-shadow-s); }
.media-sig img { max-width: 220px; max-height: 80px; background: repeating-conic-gradient(#eef1f4 0 25%, #fff 0 50%) 0 0 / 12px 12px; border: 1px solid var(--ui-line); border-radius: 6px; }

/* ------------------------------------------------------------- lists */
.liste { display: grid; gap: 0.85rem; margin: 0.6rem 0 0.85rem; }
.item {
  position: relative; background: var(--ui-surface-2); border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
  padding: 3rem 1.1rem 0.35rem; margin: 0; min-width: 0; transition: box-shadow 0.15s, border-color 0.15s;
}
.item:focus-within { border-color: #c7d7e8; box-shadow: var(--ui-shadow); background: var(--ui-surface); }
.item::before { content: ''; position: absolute; left: 0; right: 0; top: 2.45rem; border-top: 1px solid var(--ui-line); }
.item-kompakt { padding-top: 2.9rem; }
.item.dragging { opacity: 0.55; }
.item.drop-target { box-shadow: 0 -3px 0 var(--ui-brand-bright); }
.item-title { position: absolute; top: 0.65rem; left: 1.1rem; right: 13rem; padding: 0; font-weight: 650; font-size: 0.92rem; color: var(--ui-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-tools { position: absolute; top: 0.3rem; right: 0.35rem; display: flex; gap: 0; }
.item-tools .btn-icon { min-height: 34px; min-width: 34px; border-radius: 8px; }
.drag-handle { cursor: grab; }
.field-check-inline { align-self: end; margin-bottom: 1.4rem; }
.order-list { list-style: none; padding: 0; display: grid; gap: 0.4rem; max-width: 28rem; }
.order-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 10px; padding: 0.2rem 0.3rem 0.2rem 0.85rem; box-shadow: var(--ui-shadow-s); }
.order-list li.dragging { opacity: 0.55; }

.gap-item { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; background: var(--ui-warn-soft); border: 1px solid #f0d98c; border-radius: 10px; padding: 0.55rem 0.85rem; margin-bottom: 0.5rem; color: #5c4300; }
.gap-ok { color: var(--ui-ok); font-size: 0.9rem; font-weight: 500; }

.check-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.5rem 0 0.85rem; }
.check-chip { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; padding: 0.2rem 0.85rem; border: 1px solid var(--ui-line); border-radius: 999px; background: var(--ui-surface); cursor: pointer; font-size: 0.9rem; box-shadow: var(--ui-shadow-s); }
.check-chip:hover { border-color: #b9cbe0; }
.check-chip:has(input:checked) { background: var(--ui-brand-softer); border-color: #b7cde3; color: var(--ui-brand-strong); }
.check-chip input { width: 18px; height: 18px; accent-color: var(--ui-brand); }

/* ------------------------------------------------------------- abgleich */
.abgleich-summary { font-weight: 650; margin-bottom: 0.6rem; }
.abgleich-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.abgleich-item { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.7rem; padding: 0.65rem 0.75rem; border-radius: 10px; border: 1px solid var(--ui-line); background: var(--ui-surface); box-shadow: var(--ui-shadow-s); }
.abgleich-item .badge { grid-row: span 2; align-self: start; }
.abgleich-item .meta { font-size: 0.85rem; color: var(--ui-muted); display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.18rem 0.55rem; border-radius: 999px; white-space: nowrap; letter-spacing: 0.01em; }
.badge-abgedeckt { background: var(--ui-ok-soft); color: #145a32; }
.badge-fehlt { background: var(--ui-danger-soft); color: #8a1c14; }
.badge-irrelevant { background: #eef2f7; color: var(--ui-muted); }
.badge-muss { background: var(--ui-brand); color: #fff; }
.badge-kann { background: var(--ui-brand-soft); color: var(--ui-brand-strong); }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.85rem; font-size: 0.9rem; margin: 0.5rem 0; }
.meta-list dt { font-weight: 600; }
.meta-list dd { margin: 0; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; padding: 0; margin: 0.3rem 0 0; }

/* --------------------------------------------------------------- checks */
.check-summary { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; font-weight: 650; margin-bottom: 0.6rem; padding: 0.75rem 1rem; border-radius: var(--ui-radius); background: var(--ui-surface-2); border: 1px solid var(--ui-line); }
.check-group { margin: 0.85rem 0; }
.check-group h3 { font-size: 0.8rem; margin: 0 0 0.45rem; color: var(--ui-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.finding { border: 1px solid var(--ui-line); border-left: 4px solid #8a9099; background: var(--ui-surface); border-radius: 10px; padding: 0.65rem 0.85rem; margin-bottom: 0.45rem; box-shadow: var(--ui-shadow-s); }
.finding-rot { border-left-color: #c62d24; }
.finding-gelb { border-left-color: #d29a00; }
.finding-hinweis { border-left-color: var(--ui-brand-bright); }
.finding-title { font-weight: 600; margin: 0; }
.finding-sev { font-size: 0.7rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 0.4rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: #eef2f7; }
.finding-rot .finding-sev { color: #b3261e; background: var(--ui-danger-soft); }
.finding-gelb .finding-sev { color: #7a5200; background: var(--ui-warn-soft); }
.finding-hinweis .finding-sev { color: var(--ui-brand); background: var(--ui-brand-soft); }
.finding-why { font-size: 0.88rem; color: var(--ui-text-2); margin: 0.25rem 0 0; }
.finding-alt { font-size: 0.88rem; margin: 0.25rem 0 0; color: #145a32; }
.finding-actions { display: flex; gap: 0.3rem; margin-top: 0.4rem; flex-wrap: wrap; }
.check-ok { color: var(--ui-ok); font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0.25rem 0 1rem; }
.checklist li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.35rem 0; border-bottom: 1px dashed var(--ui-line); }
.checklist li:last-child { border-bottom: 0; }
.checklist input { width: 20px; height: 20px; margin-top: 0.15rem; accent-color: var(--ui-brand); flex: none; }
.checklist label { flex: 1; }
.checklist-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.checklist-head h3 { margin-bottom: 0.2rem; }
.checklist-count { font-size: 0.82rem; font-weight: 600; color: var(--ui-muted); background: #eef2f7; border-radius: 999px; padding: 0.1rem 0.6rem; }

.export-actions .button-grid { display: grid; gap: 0.6rem; grid-template-columns: 1fr; margin-top: 0.85rem; }
@media (min-width: 560px) { .export-actions .button-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.export-actions .button-grid .btn { justify-content: flex-start; min-height: 50px; }
.not-configured { align-self: center; }

/* ---------------------------------------------------------------- drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(30rem, 100vw);
  background: var(--ui-surface); box-shadow: -24px 0 60px rgba(15, 27, 45, 0.18); display: flex; flex-direction: column;
  border-left: 1px solid var(--ui-line); animation: drawer-in 0.2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.8rem 0.75rem 0.6rem 1.1rem; border-bottom: 1px solid var(--ui-line); }
.drawer-head h2 { margin: 0; font-size: 1.1rem; }
.drawer-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--ui-line); background: var(--ui-surface-2); }
.drawer-filters input[type="search"] { flex-basis: 100%; }
.drawer-hint { padding: 0.5rem 1.1rem 0; }
.drawer-list { flex: 1; overflow-y: auto; padding: 0.75rem 1.1rem 1.5rem; display: grid; gap: 0.55rem; align-content: start; }
.drawer-item {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--ui-text); background: var(--ui-surface);
  border: 1px solid var(--ui-line); border-radius: 10px; padding: 0.7rem 0.85rem; cursor: pointer; box-shadow: var(--ui-shadow-s);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.drawer-item:hover { border-color: #9fbbd8; background: var(--ui-brand-softer); box-shadow: var(--ui-shadow); }
.drawer-item .bs-tags { margin-bottom: 0.3rem; }
.drawer-item .bs-hint { margin: 0.35rem 0 0; }

/* --------------------------------------------------------------- dialogs */
.builder-preview { background: var(--ui-brand-softer); border: 1px solid #d3e1ef; border-radius: 10px; padding: 0.7rem 0.85rem; min-height: 2.6rem; }
.crop-stage { display: flex; justify-content: center; background: #1b2433; border-radius: 12px; padding: 0.85rem; }
#crop-canvas { width: min(270px, 70vw); height: auto; aspect-ratio: 3 / 4; background: #fff; touch-action: none; cursor: grab; border-radius: 6px; }
.plain-list { padding-left: 1.2rem; font-size: 0.9rem; }
.mappen-list { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
.mappen-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; border: 1px solid var(--ui-line); border-radius: 10px; padding: 0.5rem 0.7rem; background: var(--ui-surface-2); }
.mappen-list .aktiv { font-weight: 700; }
.ai-result { white-space: pre-wrap; background: var(--ui-surface-2); border: 1px solid var(--ui-line); border-radius: 10px; padding: 0.75rem; }
.ai-consent-given { font-size: 0.85rem; color: var(--ui-muted); }
.spinner { width: 22px; height: 22px; border: 3px solid #c9d8e8; border-top-color: var(--ui-brand); border-radius: 50%; animation: spin 0.9s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.offscreen-frame { position: absolute; left: -10000px; top: 0; width: 820px; height: 1200px; border: 0; }
