/* =========================================================================
   bilder.letsgoo.io
   Zwei Welten: die Galerie (hell, zurückhaltend, das Bild trägt) und
   die Werkstatt (dunkel, dicht, für die Arbeit am Handy und am Schreibtisch).
   ========================================================================= */

:root {
    --paper: #faf8f5;
    --paper-2: #f2efe9;
    --ink: #17150f;
    --ink-2: #4a453c;
    --ink-3: #837c6f;
    --line: #e0dbd1;
    --line-2: #cbc4b7;
    --brass: #8c6d46;
    --brass-light: #b4996e;
    --ok: #3f6b4a;
    --warn: #9a6b25;
    --bad: #8d3a2f;

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

    --radius: 3px;
    --shadow: 0 1px 2px rgba(23, 21, 15, .05), 0 8px 28px -12px rgba(23, 21, 15, .18);
    --shadow-lift: 0 2px 6px rgba(23, 21, 15, .07), 0 22px 48px -20px rgba(23, 21, 15, .28);
    --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

/* Ohne !important gewinnt jedes display:flex/grid gegen das Attribut und
   versteckte Boxen (Warnhinweise, Statusleiste) bleiben sichtbar. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 28px; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }

/* ------------------------------------------------------------- Kopfzeile */

.site-head {
    border-bottom: 1px solid var(--line);
    background: rgba(250, 248, 245, .92);
    backdrop-filter: saturate(180%) blur(12px);
    position: sticky; top: 0; z-index: 40;
}
.site-head .wrap { display: flex; align-items: center; gap: 32px; height: 74px; }
.brand { display: flex; align-items: baseline; gap: 12px; margin-right: auto; }
.brand-mark { font-family: var(--serif); font-size: 23px; letter-spacing: .01em; }
.brand-icon { display: none; width: 21px; height: 21px; color: var(--brass); }
.brand-sub { font-size: 12.5px; color: var(--ink-3); letter-spacing: .09em; text-transform: uppercase; }
.site-nav { display: flex; gap: 26px; font-size: 14.5px; color: var(--ink-2); }
.site-nav a { padding: 6px 0; border-bottom: 1px solid transparent; transition: border-color .18s var(--ease), color .18s var(--ease); }
.site-nav a:hover, .site-nav a.on { color: var(--ink); border-color: var(--brass); }

/* --------------------------------------------------------------- Hero */

.hero { padding: 76px 0 44px; border-bottom: 1px solid var(--line); }
.hero h1 { font-family: var(--serif); font-size: clamp(34px, 5.2vw, 58px); line-height: 1.08; font-weight: 400; margin: 0 0 20px; letter-spacing: -.012em; max-width: 17ch; }
.hero p { max-width: 62ch; color: var(--ink-2); font-size: 17.5px; margin: 0; }
.hero-meta { display: flex; gap: 34px; margin-top: 34px; font-size: 13px; color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; flex-wrap: wrap; }
.hero-meta b { display: block; font-family: var(--serif); font-size: 27px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 400; margin-bottom: 2px; }

/* --------------------------------------------------------------- Filter */

.filterbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 22px 0; border-bottom: 1px solid var(--line); position: sticky; top: 74px; background: rgba(250, 248, 245, .95); backdrop-filter: blur(10px); z-index: 30; }
.filterbar form { display: contents; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--radius); font-size: 14.5px; transition: border-color .18s; }
.search input:focus { outline: none; border-color: var(--brass); }
select.pill, .pill {
    padding: 9px 14px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--radius);
    font-size: 14px; color: var(--ink-2); cursor: pointer; transition: border-color .18s, color .18s;
}
select.pill:hover, .pill:hover { border-color: var(--brass); color: var(--ink); }
.count { margin-left: auto; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Grid */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 46px 34px; padding: 54px 0 90px; }

.card { display: block; }
.card-frame {
    position: relative; background: var(--paper-2); border: 1px solid var(--line);
    aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden;
    transition: box-shadow .32s var(--ease), border-color .32s var(--ease);
}
.card:hover .card-frame { box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.card-frame img { max-width: 88%; max-height: 88%; width: auto; height: auto; object-fit: contain; box-shadow: 0 2px 5px rgba(23, 21, 15, .13), 0 14px 34px -16px rgba(23, 21, 15, .4); transition: transform .5s var(--ease); }
.card:hover .card-frame img { transform: scale(1.028); }
.card-empty { color: var(--ink-3); font-size: 13px; }
.card-body { padding-top: 15px; }
.card-artist { font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.card-title { font-family: var(--serif); font-size: 19px; line-height: 1.3; margin-bottom: 6px; }
.card-meta { font-size: 13.5px; color: var(--ink-3); }
.card-price { font-size: 14.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line-2); border-radius: 100px; color: var(--ink-3); }
.tag-sold { border-color: var(--bad); color: var(--bad); }
.tag-reserved { border-color: var(--warn); color: var(--warn); }

/* ------------------------------------------------------------ Werkseite */

.work { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .85fr); gap: 68px; padding: 52px 0 96px; align-items: start; }
.stage { position: sticky; top: 108px; }
.stage-main { background: var(--paper-2); border: 1px solid var(--line); display: grid; place-items: center; padding: 40px; min-height: 380px; }
.stage-main img { max-height: 74vh; width: auto; box-shadow: 0 3px 8px rgba(23, 21, 15, .14), 0 26px 60px -24px rgba(23, 21, 15, .45); cursor: zoom-in; }
.thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.thumb { width: 74px; height: 74px; border: 1px solid var(--line); background: #fff; padding: 5px; cursor: pointer; display: grid; place-items: center; transition: border-color .18s; }
.thumb img { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; }
.thumb.on, .thumb:hover { border-color: var(--brass); }

.work-head h1 { font-family: var(--serif); font-size: clamp(27px, 3.4vw, 40px); font-weight: 400; line-height: 1.16; margin: 0 0 10px; letter-spacing: -.01em; }
.work-artist { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px; }
.work-lead { font-size: 16.5px; color: var(--ink-2); margin: 22px 0; }

.spec { border-top: 1px solid var(--line); margin: 28px 0; }
.spec div { display: grid; grid-template-columns: 132px 1fr; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.spec dt { color: var(--ink-3); }
.spec dd { margin: 0; }

.price-box { border: 1px solid var(--line-2); background: #fff; padding: 24px; margin: 30px 0; }
.price-value { font-family: var(--serif); font-size: 31px; letter-spacing: -.01em; }
.price-note { font-size: 13px; color: var(--ink-3); margin-top: 5px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 13px 26px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
    border-radius: var(--radius); font-size: 15px; cursor: pointer;
    transition: background .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--brass); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .icon { flex: none; }
.btn-block { text-align: center; }

.disclaimer { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; border-left: 2px solid var(--line-2); padding-left: 14px; margin: 26px 0; }

/* Formular */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); background: #fff;
    border-radius: var(--radius); font-size: 15px; transition: border-color .18s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brass); }
.field textarea { min-height: 110px; resize: vertical; }

.notice { padding: 13px 17px; border-radius: var(--radius); font-size: 14.5px; margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-start; }
.notice-ok { background: #eef3ee; color: var(--ok); border: 1px solid #d3e2d6; }
.notice-warn { background: #fbf3e6; color: var(--warn); border: 1px solid #eeddc0; }
.notice-bad { background: #fbeeec; color: var(--bad); border: 1px solid #eed3ce; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(14, 13, 10, .95); z-index: 200; display: none; place-items: center; padding: 30px; cursor: zoom-out; }
.lightbox.on { display: grid; }
.lightbox img { max-width: 96vw; max-height: 94vh; width: auto; object-fit: contain; }
.lightbox-close { position: absolute; top: 22px; right: 26px; color: #fff; opacity: .7; background: none; border: 0; cursor: pointer; }
.lightbox-close:hover { opacity: 1; }

/* Fuß */
.site-foot { border-top: 1px solid var(--line); padding: 44px 0; margin-top: 40px; font-size: 13.5px; color: var(--ink-3); }
.site-foot .wrap { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.site-foot a:hover { color: var(--ink); }

.empty-state { text-align: center; padding: 110px 20px; color: var(--ink-3); }
.empty-state svg { margin: 0 auto 20px; color: var(--line-2); }
.empty-state h2 { font-family: var(--serif); font-weight: 400; color: var(--ink); font-size: 25px; margin: 0 0 10px; }

@media (max-width: 900px) {
    .wrap, .wrap-narrow { padding: 0 18px; }
    .site-head .wrap { height: 62px; gap: 14px; }
    .brand-sub { display: none; }
    .brand-mark { font-size: 19px; }
    .site-nav { gap: 14px; font-size: 13.5px; }
    .hero { padding: 46px 0 30px; }
    .work { grid-template-columns: 1fr; gap: 34px; padding: 26px 0 60px; }
    .stage { position: static; }
    .stage-main { padding: 18px; }
    .filterbar { top: 62px; }
    .grid { gap: 34px 20px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 30px 0 60px; }
    .card-title { font-size: 16.5px; }
}

/* =========================================================================
   Werkstatt — Erfassung und Verwaltung
   ========================================================================= */

.studio {
    --paper: #14130f;
    --paper-2: #1d1b16;
    --ink: #f4f1ea;
    --ink-2: #b8b2a5;
    --ink-3: #7d776b;
    --line: #2c2922;
    --line-2: #3d392f;
    --brass: #c39a5f;
    --ok: #7fb98a;
    --warn: #d9a445;
    --bad: #d97a68;
    background: var(--paper); color: var(--ink); min-height: 100vh;
}
.studio .site-head { background: rgba(20, 19, 15, .93); border-color: var(--line); }
.studio .search input, .studio select.pill, .studio .pill,
.studio .field input, .studio .field textarea, .studio .field select {
    background: var(--paper-2); border-color: var(--line-2); color: var(--ink);
}
.studio .filterbar { background: rgba(20, 19, 15, .96); border-color: var(--line); }
.studio .btn { background: var(--brass); border-color: var(--brass); color: #14130f; font-weight: 500; }
.studio .btn:hover { background: #d3aa6c; border-color: #d3aa6c; }
.studio .btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); font-weight: 400; }
.studio .btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--brass); }
.studio .card-frame, .studio .stage-main, .studio .thumb { background: var(--paper-2); border-color: var(--line); }
.studio .price-box { background: var(--paper-2); border-color: var(--line-2); }
.studio .notice-ok { background: #1b2a1e; border-color: #2e4633; color: var(--ok); }
.studio .notice-warn { background: #2b2416; border-color: #473b22; color: var(--warn); }
.studio .notice-bad { background: #2c1c19; border-color: #4a2c26; color: var(--bad); }
.studio .spec div { border-color: var(--line); }
.studio .spec { border-color: var(--line); }

/* Erfassung */
.capture { max-width: 620px; margin: 0 auto; padding: 22px 18px 130px; }

.btn-gross { padding: 21px 26px; font-size: 17px; gap: 12px; margin-bottom: 6px; }
.los-hint { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 0 0 20px; }

.pruefliste { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pruefzeile {
    display: grid; grid-template-columns: 9px 1fr auto; gap: 11px; align-items: center;
    background: var(--paper-2); padding: 12px 14px; font-size: 14px;
}
.pruefpunkt { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pruefzeile.gut .pruefpunkt { background: var(--ok); }
.pruefzeile.schlecht .pruefpunkt { background: var(--bad); }
.pruefzeile.schlecht .pruefwert { color: var(--bad); }
.pruefzeile.gut .pruefwert { color: var(--ok); }
.pruefwert { font-size: 13.5px; }
.pruefhinweis { grid-column: 2 / -1; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.capture h1 { font-family: var(--serif); font-weight: 400; font-size: 27px; margin: 0 0 6px; }
.capture .sub { color: var(--ink-3); font-size: 14.5px; margin-bottom: 26px; }

.step { border: 1px solid var(--line); background: var(--paper-2); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.step-head { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--brass); color: var(--brass); display: grid; place-items: center; font-size: 12.5px; flex: none; font-variant-numeric: tabular-nums; }
.step-head h2 { font-size: 15.5px; font-weight: 500; margin: 0; letter-spacing: .01em; }
.step-head .hint { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }

.role-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.role-btn {
    padding: 12px 8px; border: 1px solid var(--line-2); background: transparent; border-radius: var(--radius);
    font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    transition: border-color .16s, color .16s, background .16s;
}
.role-btn:hover { border-color: var(--brass); color: var(--ink); }
.role-btn.on { border-color: var(--brass); background: rgba(195, 154, 95, .12); color: var(--ink); }
.role-btn .icon { color: currentColor; }

.dropzone {
    border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 30px 20px; text-align: center;
    color: var(--ink-3); cursor: pointer; transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brass); background: rgba(195, 154, 95, .06); color: var(--ink-2); }
.dropzone .icon { margin: 0 auto 10px; color: var(--brass); }
.dropzone b { color: var(--ink); font-weight: 500; display: block; margin-bottom: 3px; font-size: 15px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; margin-top: 15px; }
.shot { position: relative; aspect-ratio: 1; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: #0e0d0a; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .badge { position: absolute; left: 0; bottom: 0; right: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); color: #fff; font-size: 10.5px; padding: 14px 5px 4px; text-align: center; letter-spacing: .04em; }
.shot .kill { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .62); border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .16s, background .16s; }
.shot:hover .kill { opacity: 1; }
.shot .kill:hover { background: var(--bad); }
/* Ohne Zeigegerät gibt es kein Hover — dort muss der Knopf dauerhaft sichtbar sein. */
@media (hover: none) {
    .shot .kill { opacity: .9; width: 30px; height: 30px; }
}
.shot.busy::after { content: ""; position: absolute; inset: 0; background: rgba(20, 19, 15, .68) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26' fill='none' stroke='%23c39a5f' stroke-width='2'%3E%3Ccircle cx='13' cy='13' r='10' opacity='.25'/%3E%3Cpath d='M13 3a10 10 0 0 1 10 10'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 13 13' to='360 13 13' dur='.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") center no-repeat; }
.shot.fail { border-color: var(--bad); }
.shot .retry { position: absolute; inset: 0; background: rgba(44, 28, 25, .9); color: var(--bad); border: 0; font-size: 11.5px; cursor: pointer; display: grid; place-items: center; gap: 4px; }

.queuebar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(20, 19, 15, .97); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: center; z-index: 50; }
.queuebar .status { font-size: 13px; color: var(--ink-3); flex: 1; min-width: 0; }
.queuebar .status b { color: var(--ink); font-weight: 500; }
.queuebar .btn { padding: 12px 20px; }

.bar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 7px; }
.bar span { display: block; height: 100%; background: var(--brass); width: 0; transition: width .25s var(--ease); }

/* Verwaltungsliste */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 22px 0 4px; }
.stat { background: var(--paper-2); padding: 16px 18px; }
.stat b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }

.rows { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 24px 0 70px; }
.row { display: grid; grid-template-columns: 62px minmax(0, 2.2fr) minmax(0, 1fr) 110px 128px 40px; gap: 16px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--paper-2); transition: background .16s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #23201a; }
.row-thumb { width: 62px; height: 62px; background: #0e0d0a; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-title { font-size: 15px; margin-bottom: 2px; }
.row-title .no { color: var(--ink-3); font-family: var(--mono); font-size: 12px; margin-right: 8px; }
.row-sub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-price { font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 100px; font-size: 11.5px; border: 1px solid var(--line-2); color: var(--ink-3); white-space: nowrap; }
.chip-run { border-color: var(--brass); color: var(--brass); }
.chip-ok { border-color: #2e4633; color: var(--ok); }
.chip-err { border-color: #4a2c26; color: var(--bad); }
.chip-live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Werkstatt-Detail */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 34px; padding: 26px 0 90px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--paper-2); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel h3 { font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.panel h3 .icon { color: var(--brass); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 34%); padding: 22px 0 16px; display: flex; gap: 11px; align-items: center; }

.conf { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.conf-dot { width: 7px; height: 7px; border-radius: 50%; }
.conf-hoch .conf-dot { background: var(--ok); }
.conf-mittel .conf-dot { background: var(--warn); }
.conf-gering .conf-dot, .conf-unbekannt .conf-dot { background: var(--bad); }

.aibox { font-size: 14px; color: var(--ink-2); line-height: 1.62; }
.aibox p { margin: 0 0 12px; }
.aibox ul { margin: 0 0 12px; padding-left: 18px; }
.aibox li { margin-bottom: 5px; }
.aibox a { color: var(--brass); border-bottom: 1px solid transparent; }
.aibox a:hover { border-color: var(--brass); }
.comp { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.comp:last-child { border-bottom: 0; }
.comp .t { color: var(--ink); }
.comp .s { color: var(--ink-3); font-size: 12.5px; }
.comp .v { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }

details.raw { margin-top: 14px; }
details.raw summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
details.raw pre { background: #0e0d0a; border: 1px solid var(--line); padding: 13px; overflow: auto; font-size: 11.5px; max-height: 380px; border-radius: var(--radius); color: var(--ink-2); }

@media (max-width: 560px) {
    .site-head .wrap { height: 56px; gap: 10px; }
    .brand-mark { font-size: 17px; }
    .site-nav { gap: 12px; font-size: 12.5px; }
}

/* Auf schmalen Geräten weicht der Schriftzug einer Bildmarke — sonst
   drängt die Navigation über den rechten Rand hinaus. */
@media (max-width: 440px) {
    .brand-mark { display: none; }
    .brand-icon { display: block; }
    .site-nav { gap: 13px; font-size: 13px; }
}

@media (max-width: 560px) {
    .capture { padding: 16px 14px 130px; }
    .step { padding: 16px 14px; }
    .role-picker { grid-template-columns: 1fr 1fr; gap: 7px; }
    .field label { font-size: 11.5px; letter-spacing: .05em; }
    .btn { padding: 13px 18px; }
    /* Der Hinweis rutscht unter die Überschrift, statt sie zweizeilig zu quetschen */
    .step-head { flex-wrap: wrap; }
    .step-head h2 { flex: 1 0 auto; }
    .step-head .hint { flex: 1 0 100%; margin: 2px 0 0 35px; }
}

@media (max-width: 900px) {
    .editor { grid-template-columns: 1fr; }
    .row { grid-template-columns: 52px minmax(0, 1fr) 40px; gap: 12px; }
    .row-hide { display: none; }
    .two, .four { grid-template-columns: 1fr 1fr; }
}


/* =========================================================================
   Kamera — Vollbildsucher für die Erfassung am Handy
   ========================================================================= */

.kamera {
    position: fixed; inset: 0; z-index: 300; background: #08080a;
    display: flex; flex-direction: column; overscroll-behavior: none;
    -webkit-user-select: none; user-select: none;
}
.kamera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Drittel-Raster zum Ausrichten der Rahmenkanten */
.k-raster { position: absolute; inset: 0; pointer-events: none; }
.k-raster::before, .k-raster::after {
    content: ""; position: absolute; inset: 0;
    background-repeat: no-repeat;
}
.k-raster::before {
    background-image: linear-gradient(to right, rgba(255,255,255,.26) 1px, transparent 1px),
                      linear-gradient(to right, rgba(255,255,255,.26) 1px, transparent 1px);
    background-size: 1px 100%, 1px 100%;
    background-position: 33.33% 0, 66.66% 0;
}
.k-raster::after {
    background-image: linear-gradient(to bottom, rgba(255,255,255,.26) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,.26) 1px, transparent 1px);
    background-size: 100% 1px, 100% 1px;
    background-position: 0 33.33%, 0 66.66%;
}

/* Libelle: zeigt, ob das Handy parallel zur Bildebene steht */
.k-libelle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.k-libelle-feld {
    width: 132px; height: 132px; border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .3); position: relative;
    transition: border-color .25s var(--ease);
}
.k-mitte {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45);
}
.k-blase {
    position: absolute; top: 50%; left: 50%; margin: -13px 0 0 -13px;
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255, 255, 255, .28); border: 1.5px solid #fff;
    transition: transform .09s linear, background .25s var(--ease), border-color .25s var(--ease);
}
.k-libelle-text {
    font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: rgba(255, 255, 255, .72);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .7); font-variant-numeric: tabular-nums;
}
.k-libelle.fast .k-blase { background: rgba(217, 164, 69, .4); border-color: #d9a445; }
.k-libelle.fast .k-libelle-feld { border-color: rgba(217, 164, 69, .55); }
.k-libelle.gut .k-blase { background: rgba(127, 185, 138, .55); border-color: #7fb98a; }
.k-libelle.gut .k-libelle-feld { border-color: rgba(127, 185, 138, .75); }
.k-libelle.gut .k-libelle-text { color: #9ed3a8; }

/* Kopf- und Werkzeugleiste */
.k-kopf {
    position: relative; z-index: 2; display: flex; align-items: center; gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    background: linear-gradient(rgba(0, 0, 0, .62), transparent);
}
.k-titel {
    flex: 1; text-align: center; color: #fff; font-size: 14px; letter-spacing: .05em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
.k-info {
    font-size: 11.5px; color: rgba(255, 255, 255, .75); text-align: right; line-height: 1.35;
    font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
.k-info span { display: block; font-size: 10px; color: rgba(255, 255, 255, .5); }
.k-info.schwach { color: #e0a97c; }

.k-rund {
    width: 42px; height: 42px; border-radius: 50%; flex: none;
    background: rgba(20, 20, 22, .55); border: 1px solid rgba(255, 255, 255, .18);
    color: #fff; display: grid; place-items: center; cursor: pointer;
    backdrop-filter: blur(8px); transition: background .18s, border-color .18s, color .18s;
    font-size: 12px; font-variant-numeric: tabular-nums;
}
.k-rund:hover { background: rgba(40, 40, 44, .7); }
.k-rund.on { background: rgba(195, 154, 95, .9); border-color: transparent; color: #14130f; }

.k-werkzeuge {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 2;
    display: flex; flex-direction: column; gap: 10px;
}

.k-zoom {
    position: absolute; left: 50%; transform: translateX(-50%); bottom: 148px; z-index: 2;
    display: flex; align-items: center; gap: 11px; padding: 8px 15px; border-radius: 100px;
    background: rgba(20, 20, 22, .58); backdrop-filter: blur(8px);
}
.k-zoom input { width: 168px; accent-color: var(--brass); }
.k-zoom span { color: #fff; font-size: 12px; min-width: 38px; font-variant-numeric: tabular-nums; }

/* Fuß mit Rollen und Auslöser */
.k-fuss {
    margin-top: auto; position: relative; z-index: 2;
    padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(0, 0, 0, .74) 42%);
}
.k-titeln {
    display: flex; gap: 7px; overflow-x: auto; padding-bottom: 14px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.k-titeln::-webkit-scrollbar { display: none; }
.k-titel-chip {
    flex: none; padding: 7px 14px; border-radius: 100px; font-size: 13px; cursor: pointer;
    background: rgba(20, 20, 22, .55); border: 1px solid rgba(255, 255, 255, .2); color: rgba(255,255,255,.8);
    backdrop-filter: blur(8px); transition: background .16s, color .16s, border-color .16s;
}
.k-titel-chip.on { background: #fff; color: #14130f; border-color: #fff; }

.k-ausloeser-zeile { display: grid; grid-template-columns: 62px 1fr 62px; align-items: center; }
.k-ausloeser {
    width: 74px; height: 74px; border-radius: 50%; justify-self: center; cursor: pointer;
    background: transparent; border: 3px solid #fff; padding: 4px;
    transition: transform .1s var(--ease);
}
.k-ausloeser span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: background .16s; }
.k-ausloeser:active { transform: scale(.94); }
.k-ausloeser:active span { background: rgba(255, 255, 255, .7); }
.k-ausloeser:disabled { opacity: .5; cursor: wait; }

.k-letzte { width: 52px; height: 52px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.09); }
.k-letzte img { width: 100%; height: 100%; object-fit: cover; }
.k-zaehler {
    color: #fff; font-size: 16px; text-align: center; font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

.k-fokus {
    position: absolute; width: 76px; height: 76px; margin: -38px 0 0 -38px; z-index: 3;
    border: 1.5px solid #fff; border-radius: 50%; pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .25);
}
.k-fokus.an { animation: k-fokus .55s var(--ease); }
@keyframes k-fokus {
    0% { transform: scale(1.5); opacity: 0; }
    35% { transform: scale(1); opacity: 1; }
    100% { transform: scale(.92); opacity: .75; }
}

.k-hinweis {
    position: absolute; left: 50%; transform: translateX(-50%); top: 78px; z-index: 4;
    background: rgba(20, 20, 22, .82); color: #f0e2c8; font-size: 12.5px;
    padding: 8px 15px; border-radius: 100px; backdrop-filter: blur(8px);
    pointer-events: none; white-space: nowrap;
}

.k-blitz { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5; }
.k-blitz.an { animation: k-blitz .17s ease-out; }
@keyframes k-blitz { from { opacity: .92; } to { opacity: 0; } }

.k-countdown {
    position: absolute; inset: 0; display: grid; place-items: center; z-index: 4;
    font-family: var(--serif); font-size: 108px; color: #fff; pointer-events: none;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .6);
}
.k-fehler {
    position: absolute; left: 14px; right: 14px; top: 50%; transform: translateY(-50%); z-index: 6;
    background: rgba(44, 28, 25, .96); border: 1px solid #4a2c26; color: #f0d5cf;
    padding: 15px 18px; border-radius: var(--radius); font-size: 14px; line-height: 1.55;
}

@media (min-width: 720px) {
    .kamera video { object-fit: contain; }
    .k-zoom { bottom: 132px; }
}
