/* Webfactory-Portal – Salzer & Siegel Designsystem (Tokens von salzer-siegel.de) */

@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plus-jakarta-sans-400-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plus-jakarta-sans-500-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/plus-jakarta-sans-600-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/plus-jakarta-sans-700-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/plus-jakarta-sans-800-latin.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-400-latin.woff2) format("woff2"); }

:root {
  /* Marke */
  --black: #0d0d0d;
  --dark-1: #141414;
  --dark-2: #1c1c1c;
  --dark-3: #242424;
  --orange: #f68d2e;
  --orange-dark: #d9751a;
  --orange-text: #b85f12;          /* Orange für Text auf Weiß (ausreichender Kontrast) */
  --orange-soft: #fef3e8;
  --orange-glow: rgba(246, 141, 46, .22);
  --ink-20: #c4c4c4;
  --ink-40: #8a8a8a;
  --ink-60: #555;
  --surface-1: #f9fafb;
  --surface-2: #f2f5f7;
  --surface-3: #e8ecef;
  --on-dark: #f2f5f7;
  --on-dark-2: rgba(242, 245, 247, .55);

  /* Rollen */
  --bg: var(--surface-1);
  --surface: #fff;
  --border: var(--surface-3);
  --border-strong: #c8cdd2;
  --text: var(--black);
  --text-2: var(--ink-60);
  --text-3: var(--ink-40);
  --accent: var(--orange);
  --accent-hover: var(--orange-dark);
  --accent-soft: var(--orange-soft);
  --ok: #2f7d4f; --ok-soft: #e7f4ec;
  --info: #2c5d8a; --info-soft: #e8f0f7;
  --warn: #9a5a0c; --warn-soft: #fdf1e2;
  --danger: #b3261e; --danger-soft: #fbe9e7;
  --muted-soft: var(--surface-2);

  /* Form: diagonale Ecken wie auf salzer-siegel.de */
  --br-lg: 16px 0 16px 0;
  --br-md: 10px 0 10px 0;
  --br-sm: 6px 0 6px 0;
  --radius: var(--br-md);
  --radius-sm: var(--br-sm);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .09);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .12);
  --shadow: none;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* Platz für die Scrollleiste immer reservieren – sonst springt der zentrierte Header zwischen kurzen und langen Seiten */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--orange-glow); }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--ink-20); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--orange-text); text-decoration-color: var(--orange); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.03em; }
h1 { font-size: 1.85rem; font-weight: 800; }
h2 { font-size: 1.2rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
code, pre, .mono { font-family: var(--mono); font-size: .84em; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
a.plain { color: inherit; text-decoration: none; }
.faded { opacity: .5; }

/* Overline-Label (wie „AUTOMATISIERUNG & KI“ auf der Website) */
.overline { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 10px; }
.overline::before { content: ""; display: block; width: 16px; height: 1px; background: currentColor; opacity: .5; flex-shrink: 0; }
.overline.orange { color: var(--orange-text); }
.dot { color: var(--orange); }

/* Navigationsleiste: hell, Logo und Akzente wie auf der Website */
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); color: var(--text); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); }
.topbar .inner { max-width: 1240px; margin: 0 auto; padding: 0 1.25rem; height: 60px; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand img.mark { height: 30px; width: auto; display: block; }
.brand img.wordmark { height: 22px; width: auto; display: block; }
.brand small { font-weight: 600; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-text); padding-left: .65rem; border-left: 1px solid var(--border); }
.topnav { display: flex; gap: 2px; flex: 1; }
.topnav a { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: .92rem; padding: 6px 14px; border-radius: 999px; transition: color .2s, background .2s; }
.topnav a:hover, .topnav a.active { color: var(--text); background: var(--surface-2); }
.topbar .user { color: var(--text-2); font-size: .85rem; text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.topbar .user:hover, .topbar .user.active { color: var(--text); background: var(--surface-2); }
.topbar form { margin: 0; }

main.container { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

/* Projektkopf + Phasen + Tabs */
.project-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: .75rem; }
.project-head h1 { margin: .35rem 0 0; }
.crumbs { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--orange-text); }
.phases { display: flex; gap: 6px; margin: 1rem 0 1.25rem; overflow-x: auto; }
.phase { flex: 1; min-width: 110px; padding: .5rem 0 0; border-top: 3px solid var(--surface-3); color: var(--text-3); font-size: .8rem; }
.phase b { display: block; color: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .12em; }
.phase.done { border-color: var(--black); color: var(--text-2); }
.phase.current { border-color: var(--orange); color: var(--text); font-weight: 600; }
.phase.current b { color: var(--orange-text); }
/* Grundlinie als innerer Schatten: kein Überstand, daher kein vertikales Scrollen */
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 1.5rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs a { padding: .65rem .85rem; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); font-weight: 600; border-color: var(--orange); }
.tabs .count { font-size: .7rem; font-weight: 700; background: var(--orange); color: #fff; border-radius: 999px; padding: .05rem .42rem; margin-left: .35rem; vertical-align: 1px; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.35rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card + .card { margin-top: 1rem; }
.card.tight { padding: .85rem 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .85rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.layout-main { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.25rem; align-items: start; }
@media (max-width: 960px) { .layout-main { grid-template-columns: 1fr; } }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-1); }
td a.title, a.title { font-weight: 600; text-decoration: none; color: var(--text); }
td a.title:hover, a.title:hover { color: var(--orange-text); }

/* Feld-Ansicht */
dl.fields { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: .65rem 1.2rem; margin: 0; }
dl.fields dt { color: var(--text-3); font-size: .85rem; }
dl.fields dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 720px) { dl.fields { grid-template-columns: 1fr; } dl.fields dd { margin-bottom: .6rem; } }
.empty { color: var(--text-3); font-style: italic; }
.subrows { display: grid; gap: .5rem; }
.subrow { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .75rem; white-space: normal; }
.subrow div { white-space: pre-wrap; }
.subrow b { font-weight: 600; color: var(--text-3); font-size: .8rem; margin-right: .3rem; }

/* Badges */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .14rem .55rem; border-radius: var(--br-sm); white-space: nowrap; letter-spacing: .01em; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--orange-soft); color: var(--orange-text); }
.badge-muted { background: var(--surface-2); color: var(--text-3); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: .55rem 1.05rem; border-radius: var(--br-md); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; line-height: 1.3; transition: background .2s var(--ease), border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s; white-space: nowrap; }
.btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px var(--orange-glow); }
.btn.ok { background: var(--black); border-color: var(--black); color: #fff; }
.btn.ok:hover { background: var(--dark-3); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.small { padding: .32rem .7rem; font-size: .82rem; border-radius: var(--br-sm); }
.btn.link { border: 0; background: none; padding: 0; color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--ink-20); text-underline-offset: 3px; }
.btn.link:hover { color: var(--orange-text); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
form.inline { display: inline; margin: 0; }

/* Formulare */
.field { margin-bottom: 1.15rem; }
.field > label, .label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.field .help { color: var(--text-2); font-size: .83rem; margin: -.1rem 0 .45rem; }
.req { color: var(--orange); margin-left: .15rem; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--br-sm); padding: .55rem .7rem; transition: border-color .15s, box-shadow .15s;
}
input[type=file] { font: inherit; font-size: .85rem; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: .82rem; border: 1px solid var(--border-strong); background: var(--surface); padding: .35rem .8rem; border-radius: var(--br-sm); margin-right: .7rem; cursor: pointer; }
textarea { min-height: 96px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: .82rem; min-height: 220px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-glow); }
input[type=checkbox], input[type=radio] { accent-color: var(--orange); }
.checks { display: grid; gap: .4rem; }
.checks label { font-weight: 400; display: flex; gap: .55rem; align-items: flex-start; }
.repeater { display: grid; gap: .75rem; }
.repeater-row { border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem .95rem .2rem; background: var(--surface-1); position: relative; }
.repeater-row .remove { position: absolute; right: .6rem; top: .45rem; }
.repeater-row .field { margin-bottom: .7rem; }
.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* Hinweise */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; font-weight: 500; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: #cbe6d5; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #f2c9c4; }
.flash-info { background: var(--info-soft); color: var(--info); }
.callout { background: var(--surface-1); border: 1px solid var(--border); border-left: 3px solid var(--orange); border-radius: var(--radius-sm); padding: .85rem 1rem; }
.callout.warn { background: var(--orange-soft); border-color: #f7d8b8; border-left-color: var(--orange); color: var(--warn); }
.callout ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.secret { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem .95rem; font-family: var(--mono); font-size: .8rem; white-space: pre-wrap; word-break: break-all; position: relative; }
.copy { position: absolute; right: .45rem; top: .45rem; background: var(--orange); color: #fff; border: 0; border-radius: var(--br-sm); font: 600 .72rem var(--font); padding: .22rem .55rem; cursor: pointer; }

/* Aktivität / Log */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.timeline li:last-child { border: 0; }
.timeline time { color: var(--text-3); font-size: .76rem; display: block; }

/* Gerenderter Markdown-Text (Briefing, Gedächtnis …) */
.md { white-space: normal; line-height: 1.6; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .7em; }
.md h3, .md h4, .md h5, .md h6 { margin: 1.1em 0 .45em; letter-spacing: -.015em; }
.md h3 { font-size: 1.05rem; }
.md h4 { font-size: .98rem; }
.md h5, .md h6 { font-size: .9rem; color: var(--text-2); }
.md ul, .md ol { margin: 0 0 .7em; padding-left: 1.3rem; }
.md li { margin: .15em 0; }
.md li::marker { color: var(--orange); }
.md code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: .05em .35em; }
.md pre.md-code { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem; margin: 0 0 .8em; overflow-x: auto; white-space: pre; }
.md pre.md-code code { background: none; border: 0; padding: 0; }
.md blockquote { margin: 0 0 .8em; padding: .3rem 0 .3rem .9rem; border-left: 3px solid var(--orange); color: var(--text-2); }
.md hr { margin: 1em 0; }
.md table.md-table { margin: 0 0 .8em; font-size: .9rem; border: 1px solid var(--border); }
.md table.md-table th { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--text); background: var(--surface-1); }

/* Sitemap-Baum */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 1.25rem; padding-left: .9rem; border-left: 1px dashed var(--border-strong); }
.tree li { margin: .5rem 0; }
.page-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .9rem; }
.page-node .title { font-weight: 700; }
.page-node ul.points { list-style: none; margin: .35rem 0 0; padding: 0; border: 0; color: var(--text-2); font-size: .88rem; }
.page-node ul.points li { margin: .15rem 0; padding-left: 1rem; position: relative; }
.page-node ul.points li::before { content: "→"; position: absolute; left: 0; color: var(--orange); }
.page-node .logic { font-size: .84rem; color: var(--orange-text); margin-top: .35rem; }

/* Designsystem */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.swatch .chip { height: 64px; }
.swatch .meta { padding: .5rem .65rem; font-size: .8rem; }
.swatch .meta b { display: block; font-size: .88rem; }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.preview-frame.tall { height: 78vh; margin-top: 1.75rem; }
.style-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: transform .24s var(--ease), box-shadow .24s, border-color .2s; }
.style-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: transparent; transition: background .2s; z-index: 1; }
a.style-card:hover, .style-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
a.style-card:hover::before { background: var(--orange); }
.style-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--surface-2); display: block; }
.style-card .body { padding: .75rem .9rem; flex: 1; }
.style-card .placeholder { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); }

/* Login */
body.auth-page { background: var(--surface-1); min-height: 100vh; }
.auth { max-width: 400px; margin: 0 auto; padding: 12vh 1.25rem 3rem; }
.auth .brand-head { display: flex; justify-content: center; margin-bottom: 2rem; }
.auth .brand-head img { height: 64px; }
.auth .card { box-shadow: var(--shadow-md); }

/* ===== Workflow, Übersicht, Dateien ===== */
.status-panel .status-now .badge { font-size: .88rem; padding: .3rem .75rem; }
.actions { display: flex; flex-direction: column; gap: .65rem; margin-top: .55rem; }
.actions.compact { flex-direction: row; flex-wrap: wrap; gap: .35rem; margin-top: 0; }
.action-hint { font-size: .8rem; color: var(--text-2); margin-top: .3rem; }
.action-hint.blocked { color: var(--orange-text); }
.action-secondary { display: flex; flex-wrap: wrap; gap: .35rem; padding-top: .6rem; border-top: 1px dashed var(--border); }
.action-secondary .btn { padding: .25rem .6rem; font-size: .8rem; color: var(--text-2); font-weight: 500; }
.action-details summary { list-style: none; cursor: pointer; display: inline-flex; }
.action-details summary::-webkit-details-marker { display: none; }
.action-details[open] summary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.action-form { margin-top: .6rem; min-width: 280px; max-width: 420px; padding: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); text-align: left; white-space: normal; }
.action-form .field { margin-bottom: .7rem; }
td .actions.compact { justify-content: flex-end; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.step { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .8rem .95rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; }
.step::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border); }
.step-body { min-width: 0; padding-left: .2rem; }
.step-tone { display: flex; align-items: center; gap: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; margin-bottom: .15rem; }
.step-do { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.tone-action::before { background: var(--orange); }
.tone-action .step-tone { color: var(--orange-text); }
.tone-waiting { background: var(--surface-1); }
.tone-waiting::before { background: var(--ink-20); }
.tone-waiting .step-tone { color: var(--text-3); }
.tone-agent::before { background: var(--black); }
.tone-agent .step-tone { color: var(--text); }
@media (max-width: 640px) { .step { flex-direction: column; align-items: flex-start; } .step-do { justify-content: flex-start; } }

.stand { list-style: none; margin: 0; padding: 0; }
.stand li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.stand li:last-child { border: 0; }
.stand a { text-decoration: none; font-weight: 500; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.file-tile { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--text); font-size: .8rem; }
.file-tile .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-tile .meta { color: var(--text-3); font-size: .72rem; }
.thumb { display: grid; place-items: center; aspect-ratio: 4/3; border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; background: var(--surface-2); }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb.ext { font-weight: 700; color: var(--text-3); font-size: .78rem; letter-spacing: .08em; }
.checker { background-color: #eceff1; background-image: linear-gradient(45deg, #dde2e6 25%, transparent 25%, transparent 75%, #dde2e6 75%), linear-gradient(45deg, #dde2e6 25%, transparent 25%, transparent 75%, #dde2e6 75%); background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.file-keep { display: grid; gap: .4rem; margin-bottom: .6rem; }
.file-keep-item { display: flex; align-items: center; gap: .6rem; font-weight: 400; }
.file-keep-item .thumb { width: 56px; aspect-ratio: 1; flex: none; }

.color-input { display: flex; gap: .5rem; align-items: center; }
.color-input input[type=color] { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--br-sm); background: var(--surface); flex: none; cursor: pointer; }
.color-input input[type=text] { max-width: 150px; }
.color-chip { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 3px 0 3px 0; border: 1px solid rgba(0, 0, 0, .15); vertical-align: -.15em; }

.frame-thumb { display: block; position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.frame-thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; }
.frame-thumb.tall { aspect-ratio: 4/3; }
.thumb-link { display: block; }

/* ===== Kundenbereich ===== */
body.customer { background: var(--surface-1); font-size: 16px; overflow-x: hidden; }
.c-top { background: var(--surface); border-bottom: 1px solid var(--border); }
.c-header { max-width: 820px; margin: 0 auto; padding: 1.1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.c-header .brand img.wordmark { height: 40px; }
.c-header .btn.link { color: var(--text-2); text-decoration: none; font-weight: 500; }
.c-header .btn.link:hover { color: var(--orange-text); }
.c-header.wide, .c-main.wide { max-width: 1100px; }
.c-main { max-width: 820px; margin: 0 auto; padding: 0 1.25rem 5rem; display: flex; flex-direction: column; }
.c-main > .flash { margin-top: 1.25rem; margin-bottom: 0; }
.c-main > .card:first-child { margin-top: 1.75rem; }
/* Seitenkopf im Kundenbereich: weißes Band, steht immer zuoberst */
.c-hello { order: -1; position: relative; padding: 1.5rem 0 2.2rem; isolation: isolate; }
.c-hello::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: var(--surface); border-bottom: 1px solid var(--border); z-index: -1; }
.c-hello .overline a { color: inherit; text-decoration: none; }
.c-hello .overline a:hover { color: var(--orange-text); }
.c-hello h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: .7rem 0 .55rem; }
.c-hello p { color: var(--text-2); font-size: 1.05rem; max-width: 52ch; margin: 0 0 .5rem; }
.c-hello .callout { margin: 1rem 0 .5rem; }
.c-hello .flash { margin-top: 1rem; }
.c-hello + * { margin-top: 1.75rem; }
.c-section { margin-top: 2.4rem; }
.c-section > h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; }
.c-section .intro { color: var(--text-2); margin-bottom: 1.2rem; }
.c-steps { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .55rem; }
.c-steps li { display: flex; gap: .85rem; align-items: center; color: var(--text-3); }
.c-steps li .dot { width: 28px; height: 28px; border-radius: 8px 0 8px 0; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; color: var(--text-3); }
.c-steps li.done { color: var(--text-2); }
.c-steps li.done .dot { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.c-steps li.current { color: var(--text); font-weight: 600; }
.c-steps li.current .dot { background: var(--orange); border-color: var(--orange); color: #fff; }
.c-task { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.c-task-link { text-decoration: none; color: inherit; position: relative; overflow: hidden; transition: border-color .2s, box-shadow .24s, transform .24s var(--ease); }
.c-task-link::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); }
.c-task-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.c-feature { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--br-lg); overflow: hidden; background: var(--surface); text-decoration: none; color: inherit; transition: box-shadow .24s, transform .24s var(--ease); }
.c-feature:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); color: inherit; }
.c-feature-body { display: flex; flex-direction: column; gap: .35rem; padding: 1.25rem 1.35rem; }
@media (max-width: 640px) { .c-feature { grid-template-columns: 1fr; } }
.c-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.c-card { display: flex; flex-direction: column; gap: .5rem; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; position: relative; overflow: hidden; transition: border-color .2s, transform .24s var(--ease), box-shadow .24s; }
.c-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: transparent; transition: background .2s; }
.c-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit; }
.c-card:hover::before { background: var(--orange); }
.c-card .frame-thumb { border-radius: var(--br-sm); }
.c-card .badge { align-self: flex-start; }
.c-card-icon { display: grid; place-items: center; aspect-ratio: 16/10; border-radius: var(--br-sm); background: var(--surface-2); font-size: 1.7rem; color: var(--orange); }
.style-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.style-pick label { cursor: pointer; display: block; font-weight: 400; }
.style-pick input { position: absolute; opacity: 0; }
.style-pick input:checked + .style-card { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.style-pick input:checked + .style-card::before { background: var(--orange); }
.style-pick input:focus-visible + .style-card { outline: 2px solid var(--orange); outline-offset: 2px; }
.style-pick.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; margin-top: .8rem; }
.style-pick.compact .style-card .body { padding: .6rem .75rem; }
.style-group-label { margin-bottom: .6rem; }
.style-more { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: .9rem; }
.style-more summary { cursor: pointer; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.savebar { position: sticky; bottom: .75rem; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: .8rem 1rem; margin-top: 2rem; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; border-radius: var(--br-md); }
.savebar .status { color: var(--text-3); font-size: .85rem; margin-left: auto; }
.decision { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .decision { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  .topbar .inner { flex-wrap: wrap; height: auto; padding-top: .6rem; padding-bottom: .6rem; gap: .5rem 1rem; }
  .topnav { order: 3; flex-basis: 100%; }
  .brand img.wordmark { display: none; }
  .preview-frame { height: 480px; }
}

/* Fortschritt (Phase 5) */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width .4s var(--ease); }
.progress.mini { height: 4px; width: 120px; margin-top: .35rem; }
.progress-block { margin: .25rem 0 1rem; }
.progress-block .row { margin-bottom: .4rem; }
.page-status { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .3rem; }
.page-status li { display: flex; gap: .6rem; align-items: baseline; font-size: .9rem; }
.page-status .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--surface-3); flex: none; transform: translateY(1px); }
.page-status .dot.in_arbeit { background: var(--orange-dark); opacity: .55; }
.page-status .dot.fertig { background: var(--orange); }

/* Kundenbereich: Feedback, Listen */
.feedback-box { display: grid; gap: 1rem; }
.feedback-list { margin: 0; padding: 0 0 0 1.4rem; display: grid; gap: .5rem; }
.feedback-list li { padding: .55rem .2rem .55rem .3rem; border-bottom: 1px solid var(--border); }
.feedback-list li:last-child { border-bottom: 0; }
.feedback-list li > * { vertical-align: middle; }
.feedback-list li { display: list-item; }
.feedback-list li .feedback-text { display: inline; }
.feedback-list li form { float: right; margin-left: .8rem; }
.feedback-add { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: .2rem 1rem; align-items: start; }
.feedback-add .field { margin: 0; }
.feedback-add > .btn { grid-column: 2; justify-self: start; }
@media (max-width: 640px) { .feedback-add { grid-template-columns: 1fr; } .feedback-add > .btn { grid-column: 1; } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-3); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.final-release { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.c-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.c-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* Abnahmeprotokoll */
.protocol dd .md p:first-child { margin-top: 0; }
dl.fields.protocol dd { white-space: normal; }
.service-block { margin-bottom: .5rem; }
.service-block ul, ol.tight { margin: .2rem 0 0; padding-left: 1.2rem; }
.clause-details { margin-bottom: .4rem; }
.clause-details summary { cursor: pointer; font-weight: 600; }
.clause-details p { font-size: .88rem; margin: .4rem 0; }
.shot-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: .5rem; max-width: 760px; }
.shot-thumbs a { display: block; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.shot-thumbs img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .25s var(--ease); }
.shot-thumbs a:hover img { transform: scale(1.03); }
.setup-variant { margin-top: .7rem; }
.setup-variant summary { cursor: pointer; margin-bottom: .4rem; }
dl.mini { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: .4rem 0 0; font-size: .88rem; }
dl.mini dt { color: var(--text-3); }
dl.mini dd { margin: 0; }
.setup-steps { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem; }
.setup-step { display: grid; grid-template-columns: 2rem 1fr; gap: .9rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.setup-step:last-child { border-bottom: 0; }
.setup-num { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.setup-step.done .setup-num { background: var(--orange); color: #fff; }
.setup-step p { margin: .2rem 0 .5rem; }
.setup-next { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.danger-zone { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.btn.danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn.danger:hover { background: #8c1d17; }
.archived-note { background: var(--surface-2); border: 1px solid var(--border); padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; }
