/* Korrektur – ergänzt app.css */
[hidden] { display: none !important; }

/* Kundensicht: Kopfzeile im Branding */
body.client { background: var(--bg); }
.cbar { background: var(--brand-dark, #1f1f1f); color: #fff; border-bottom: 3px solid var(--brand); }
.cbar-in { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 18px; }
.clogo { max-height: 30px; }
.cname { color: #fff; font-size: 1.05rem; }
.cproj { opacity: .75; font-size: .9rem; }
.cfoot { text-align: center; color: var(--muted); font-size: .8rem; padding: 30px 16px; }
.ov-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.ov-row:first-child { border-top: 0; }
.ov-row:hover { background: var(--soft); }

/* Projekt */
.proj-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .proj-grid { grid-template-columns: 1fr; } }
.drop { display: grid; gap: 4px; place-items: center; text-align: center; border: 2px dashed var(--line); border-radius: 10px; padding: 22px 12px; cursor: pointer; background: var(--soft); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.drop.has { border-style: solid; border-color: var(--brand); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-files { color: var(--ink); font-weight: 600; word-break: break-all; }
.ct-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.ct-row:first-of-type { border-top: 0; }
.api-pre { background: var(--soft); color: var(--text2); font-size: .8rem; border-radius: 8px; white-space: pre-wrap; }
details > summary { cursor: pointer; }

/* ---------- Ansicht ---------- */
body.vw { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.vw-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 54px; flex-wrap: wrap; }
.is-client .vw-bar { background: var(--brand-dark, #1f1f1f); color: #fff; border-bottom: 3px solid var(--brand); }
.is-client .vw-bar .vw-proj, .is-client .vw-bar .vw-title { color: #fff; }
.is-client .vw-bar .button:not(.is-brand) { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.is-client .vw-bar .select select { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.is-client .vw-bar .select select option { color: #1f1d1a; }
.is-client .vw-bar .select:not(.is-multiple):not(.is-loading)::after { border-color: #fff; }
.vw-back { text-decoration: none; font-size: 1.2rem; color: var(--muted); }
.vw-proj { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.vw-title { font-weight: 700; font-size: 1.02rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.vw-grow { flex: 1; }
.vw-tools { display: flex; align-items: center; gap: 14px; padding: 7px 16px; border-bottom: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
.ml-auto { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; padding: 4px 11px; font: inherit; font-size: .82rem; color: var(--muted); cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--ink); color: var(--card); }
.seg button span:empty { display: none; }
.seg button span { font-weight: 700; margin-left: 2px; }
.vw-main { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.vw-stage { overflow: auto; background: color-mix(in srgb, var(--ink) 9%, var(--bg)); position: relative; padding: 24px; }
.vw-stage[data-kind=html] { padding: 0; overflow: hidden; display: flex; }
.vw-side { border-left: 1px solid var(--line); background: var(--card); overflow-y: auto; display: flex; flex-direction: column; }
@media (max-width: 900px) {
  body.vw { height: auto; overflow: auto; }
  .vw-main { grid-template-columns: 1fr; }
  .vw-stage { height: 70vh; }
  .vw-side { border-left: 0; border-top: 1px solid var(--line); }
  .vw-title { max-width: 60vw; }
}
.loading { text-align: center; padding: 80px 20px; color: var(--muted); }

/* PDF/Bild-Seiten */
.pg { position: relative; margin: 0 auto 24px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.18); cursor: crosshair; touch-action: pan-x pan-y; user-select: none; }
.pg canvas, .pg .pg-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pg .layer { position: absolute; inset: 0; z-index: 2; }
.pg-no { position: absolute; right: -34px; top: 0; font-size: .75rem; color: var(--muted); }
.pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50% 50% 50% 4px; background: var(--brand); color: #fff; font: 700 12px/28px Inter, system-ui, sans-serif; text-align: center; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px #fff; z-index: 3; transition: transform .12s; }
.pin.done { background: #8a847b; }
.pin.sel { transform: scale(1.25); z-index: 4; }
.pin.temp { background: #1f1d1a; }
.pin.pulse { animation: pulse 1s ease 2; }
@keyframes pulse { 50% { transform: scale(1.6); } }
.area { position: absolute; border: 2px solid var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 2px; pointer-events: none; }
.area.done { border-color: #8a847b; background: rgba(138,132,123,.1); }
.area.temp { border-style: dashed; border-color: #1f1d1a; }
.area.sel { border-width: 3px; }

/* HTML-Rahmen */
.frame-wrap { flex: 1; display: flex; justify-content: center; min-height: 0; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.frame-wrap.device { padding: 18px 0; }
.frame-wrap.device iframe { border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,.25); max-width: 100%; }

/* Seitenleiste */
#banner .banner { margin: 12px 14px 0; padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: .9rem; }
#banner .banner.green { background: var(--pill-green); color: var(--green); }
#banner .banner.orange { background: var(--pill-orange); color: var(--pill-orange-ink); }
.side-head { padding: 12px 14px 6px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.empty { color: var(--muted); padding: 18px 16px; font-size: .9rem; }
.cm { padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; font-size: .9rem; }
.cm:hover { background: var(--soft); }
.cm.sel { background: color-mix(in srgb, var(--brand) 7%, var(--card)); box-shadow: inset 3px 0 0 var(--brand); }
.cm.done .cm-t { color: var(--muted); }
.cm-h { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.cm-h strong { color: var(--ink); }
.cm .num { min-width: 22px; height: 22px; border-radius: 50% 50% 50% 3px; background: var(--brand); color: #fff; font-weight: 700; font-size: .72rem; display: inline-grid; place-items: center; padding: 0 4px; }
.cm.done .num { background: #8a847b; }
.cm .chk { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.cm .ok { margin-left: auto; color: var(--green); font-weight: 600; }
.cm-t { margin: 5px 0 3px; white-space: pre-wrap; word-wrap: break-word; }
.cm-w { font-size: .75rem; color: var(--muted); }
.cm-w:empty { display: none; }
.tag-k { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--pill-orange); color: var(--pill-orange-ink); border-radius: 4px; padding: 1px 5px; }
.rep { margin: 8px 0 0 12px; padding-left: 10px; border-left: 2px solid var(--line); }
.cm-foot { display: flex; gap: 12px; margin-top: 6px; font-size: .78rem; }
.lnk { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 3px; }
.lnk:hover { color: var(--ink); }
.rep-form { margin-top: 8px; cursor: default; }
.rep-form .textarea { font-size: .88rem; min-height: 56px; }
.older-h { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 18px 14px 6px; border-top: 1px solid var(--line); }
.side-foot { padding: 14px; margin-top: auto; }

/* Kommentarfeld */
.composer { position: fixed; z-index: 50; width: 320px; max-width: calc(100vw - 16px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.25); padding: 12px; }
.composer .textarea { font-size: .9rem; min-height: 80px; }
.comp-who { display: grid; gap: 6px; margin-bottom: 8px; }
.comp-act { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 8px; }
.comp-act .muted { margin-right: auto; font-size: .72rem; }

/* Dialoge */
.dlg-in { padding: 22px 26px 24px; }
.mdlg.narrow { width: min(480px, 94vw); }
.events { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.events li { padding: 4px 0; border-top: 1px dashed var(--line); }
