/* Avacura Montageportal – einfache Version
   Eine Spalte, ein Schritt pro Bildschirm, Fotos groß, große Tipp-Flächen (Tablet am Montagetisch).
   Farben/Schrift wie 4elements-electronics.com. */
:root {
  --petrol: #0b5f6d; --petrol-dark: #084652; --teal: #1aa295; --teal-soft: #e4f4f2;
  --ink: #17252a; --muted: #5c6b70; --line: #e4e9eb; --bg: #ffffff; --bg-alt: #f5f8f8;
  --ok: #1f8a5b; --ok-soft: #e3f4ea; --warn: #b7791f; --warn-soft: #fbf1dc; --crit: #b23a3a; --crit-soft: #f9e5e5;
  --radius: 14px; --radius-s: 10px; --shadow: 0 10px 30px rgba(11, 95, 109, 0.10);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Consolas", "SF Mono", "Cascadia Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --petrol: #3ab8c6; --petrol-dark: #2a9aa6; --teal: #35c3b5; --teal-soft: #123c42;
    --ink: #e6eef0; --muted: #9fb0b5; --line: #243a3f; --bg: #0f1b1e; --bg-alt: #152529;
    --ok: #4cc48a; --ok-soft: #153426; --warn: #e0a84a; --warn-soft: #3a2d12; --crit: #e46a6a; --crit-soft: #3d1b1b;
    --shadow: 0 10px 30px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --petrol: #3ab8c6; --petrol-dark: #2a9aa6; --teal: #35c3b5; --teal-soft: #123c42;
  --ink: #e6eef0; --muted: #9fb0b5; --line: #243a3f; --bg: #0f1b1e; --bg-alt: #152529;
  --ok: #4cc48a; --ok-soft: #153426; --warn: #e0a84a; --warn-soft: #3a2d12; --crit: #e46a6a; --crit-soft: #3d1b1b;
  --shadow: 0 10px 30px rgba(0,0,0,.35); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--petrol); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* Kopf */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; min-height: 58px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top .back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 10px 8px 0; cursor: pointer; font-weight: 600; color: var(--petrol); text-decoration: none; min-height: 44px; }
.top .back svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.top .mid { flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .mid small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.top .right { display: flex; gap: 6px; align-items: center; }
.top .bar { height: 4px; background: var(--line); }
.top .bar i { display: block; height: 100%; background: var(--teal); transition: width .2s; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--bg-alt); }
.brand .b1 { font-weight: 800; letter-spacing: .02em; font-size: .95rem; line-height: 1.1; }
.brand .b2 { font-size: .62rem; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.langsel select { font: inherit; font-size: .9rem; padding: 8px 28px 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg-alt); color: var(--ink); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; background-size: 5px 5px; background-repeat: no-repeat; min-height: 44px; }

/* Inhalt */
.page { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 110px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; min-height: 52px; border: 2px solid var(--petrol); background: var(--petrol); color: #fff; border-radius: var(--radius-s); cursor: pointer; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.btn:hover { background: var(--petrol-dark); border-color: var(--petrol-dark); }
.btn.ghost { background: transparent; color: var(--petrol); }
.btn.ghost:hover { background: var(--teal-soft); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.big { width: 100%; font-size: 1.15rem; min-height: 58px; }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: .9rem; font-weight: 600; }
.btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--crit); }

/* Start */
.start { display: grid; gap: 22px; padding-top: 24px; }
.start .logo { display: flex; justify-content: center; }
.start h1 { font-size: 2rem; font-weight: 800; text-align: center; letter-spacing: -.01em; }
.start .sub { text-align: center; color: var(--muted); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form input, .form textarea { font: inherit; font-size: 1.1rem; padding: 14px 14px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--bg); color: var(--ink); width: 100%; min-height: 54px; }
.form input:focus { border-color: var(--teal); outline: 0; }
.form .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.start .hero { border-radius: var(--radius); overflow: hidden; background: #0e1518; box-shadow: var(--shadow); }
.start .hero img { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 520; object-fit: cover; }
.start .lh { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.devlist { display: grid; gap: 8px; }
.devlist .dev { display: grid; grid-template-columns: 1fr 56px; gap: 8px; }
.devlist .open { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 12px 16px; border: 2px solid var(--line); background: var(--bg); border-radius: var(--radius-s); cursor: pointer; min-height: 64px; min-width: 0; color: var(--ink); }
.devlist .open:hover { border-color: var(--teal); background: var(--teal-soft); }
.devlist .open > span:first-child { min-width: 0; }
.devlist .sn { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; word-break: break-all; }
.devlist .op { color: var(--muted); font-size: .85rem; }
.devlist .bar { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden; }
.devlist .bar i { display: block; height: 100%; background: var(--teal); }
.devlist .pr { font-variant-numeric: tabular-nums; color: var(--petrol); font-weight: 700; font-size: 1.05rem; }
.devlist .pr svg { width: 28px; height: 28px; stroke: var(--ok); fill: none; stroke-width: 3; display: block; }
.devlist .dev.done .open { border-color: var(--ok-soft); background: var(--ok-soft); }
.devlist .dev.done .bar i { background: var(--ok); }
.devlist .del { display: grid; place-items: center; border: 2px solid var(--line); background: var(--bg); border-radius: var(--radius-s); color: var(--muted); cursor: pointer; min-height: 64px; }
.devlist .del svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.devlist .del:hover { border-color: var(--crit); color: var(--crit); background: var(--crit-soft); }
.dlg { display: grid; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 95; place-items: center; padding: 16px; }
.dlg .box { background: var(--bg); color: var(--ink); border-radius: var(--radius); padding: 22px 20px 18px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: grid; gap: 18px; }
.dlg .m { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.dlg .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.notice { font-size: .82rem; color: var(--muted); background: var(--warn-soft); border-radius: var(--radius-s); padding: 8px 12px; text-align: center; }

/* Abschnitte */
.sections { display: grid; gap: 12px; margin-top: 14px; }
.sec { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; color: var(--ink); min-height: 84px; }
.sec:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.sec.done { border-color: var(--ok); }
.sec .pl { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; color: #fff; background: var(--petrol); }
.sec.done .pl { background: var(--ok); }
.sec .t { display: block; font-weight: 700; font-size: 1.05rem; }
.sec .d { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sec .bar { display: block; height: 6px; background: var(--line); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.sec .bar i { display: block; height: 100%; background: var(--teal); }
.sec.done .bar i { background: var(--ok); }
.sec .ch { width: 26px; height: 26px; stroke: var(--muted); fill: none; stroke-width: 2.4; }
.sec .mid { min-width: 0; }
.secfoot { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* Schritt */
.side-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; background: var(--teal-soft); color: var(--petrol); border: 2px solid var(--teal); }
.side-badge.R { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.sid { font-family: var(--mono); color: var(--petrol); font-weight: 700; font-size: 1rem; }
.stitle { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; margin-top: 4px; }
.when { margin-top: 8px; font-size: .95rem; color: var(--muted); }
.when strong { color: var(--ink); }
.block { margin-top: 20px; }
.block > h2 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.need { background: var(--bg-alt); border-radius: var(--radius); padding: 14px 16px; }
.need ul { margin: 0; padding-left: 22px; font-size: 1.02rem; }
.need li { margin: 4px 0; }
.need .tools { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.need .tools strong { color: var(--ink); }
.photos { display: grid; gap: 10px; }
.photos .main { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); cursor: zoom-in; }
.photos .main img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: var(--bg-alt); }
.photos .main .cap { padding: 12px 14px; font-size: 1.1rem; font-weight: 700; line-height: 1.35; color: var(--ink); background: var(--teal-soft); border-top: 3px solid var(--teal); }
.photos .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos .thumbs button { border: 2px solid var(--line); background: var(--bg-alt); border-radius: var(--radius-s); padding: 0; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; }
.photos .thumbs button.active { border-color: var(--teal); }
.photos .thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-tile { border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg-alt); min-height: 200px; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); }
.ph-tile svg { width: 40px; height: 40px; stroke: var(--muted); fill: none; stroke-width: 1.6; }
.ph-tile .pm { font-weight: 600; margin-top: 8px; }
.ph-tile .pid { font-family: var(--mono); font-size: .7rem; margin-top: 4px; word-break: break-all; opacity: .8; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.ph-grid .ph-tile { min-height: 150px; }
details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
details.fold > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; min-height: 54px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary svg { width: 20px; height: 20px; stroke: var(--petrol); fill: none; stroke-width: 2.4; transition: transform .15s; margin-left: auto; flex: none; }
details.fold[open] > summary svg { transform: rotate(180deg); }
details.fold > summary .cnt { color: var(--muted); font-weight: 500; font-size: .9rem; }
details.fold .body { padding: 0 16px 16px; }
.proc { counter-reset: s; display: grid; gap: 8px; margin: 0; padding: 0; }
.proc li { list-style: none; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding: 10px 12px; background: var(--bg-alt); border-radius: var(--radius-s); font-size: 1rem; }
.proc li::before { counter-increment: s; content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--petrol); }
.checks { display: grid; gap: 8px; }
.chk { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--bg); cursor: pointer; min-height: 64px; user-select: none; }
.chk.crit { border-left-width: 6px; border-left-color: var(--crit); }
.chk .box { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--muted); display: grid; place-items: center; background: var(--bg); }
.chk .box svg { width: 28px; height: 28px; stroke: #fff; fill: none; stroke-width: 3.2; opacity: 0; }
.chk.on { border-color: var(--ok); background: var(--ok-soft); }
.chk.on .box { background: var(--ok); border-color: var(--ok); }
.chk.on .box svg { opacity: 1; }
.chk .txt { font-size: 1.02rem; }
.chk .txt .ts { display: block; font-size: .75rem; color: var(--muted); }
.readonly .chk { cursor: default; opacity: .7; }
.remark textarea { font: inherit; font-size: 1rem; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--bg); color: var(--ink); width: 100%; min-height: 90px; resize: vertical; }
.remark label.cb { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-weight: 700; color: var(--crit); cursor: pointer; min-height: 44px; }
.remark label.cb input { width: 26px; height: 26px; accent-color: var(--crit); }
.warnbox { display: grid; grid-template-columns: 6px 1fr; gap: 12px; border-radius: var(--radius-s); background: var(--crit-soft); overflow: hidden; margin-top: 10px; }
.warnbox i { background: var(--crit); }
.warnbox .b { padding: 10px 12px 10px 0; font-size: .95rem; }
.warnbox .k { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--crit); margin-bottom: 2px; }
.notes { display: grid; gap: 8px; }
.note-c { display: grid; grid-template-columns: 5px 1fr; gap: 12px; border-radius: var(--radius-s); background: var(--bg-alt); overflow: hidden; }
.note-c > i { background: var(--petrol); }
.note-c .nb { padding: 10px 12px 10px 0; font-size: .92rem; }
.note-c .nk { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-bottom: 2px; color: var(--petrol); }
.note-c.future > i { background: var(--warn); } .note-c.future .nk { color: var(--warn); }
.note-c.tbd > i { background: var(--muted); } .note-c.tbd .nk { color: var(--muted); }
.note-c.info > i { background: var(--teal); } .note-c.info .nk { color: var(--teal); }
.incomplete { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-size: .85rem; color: var(--warn); font-weight: 600; }
.incomplete svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }

/* untere Leiste */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottom .in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 10px; }
.bottom .btn.ghost { min-width: 110px; }
.bottom .next.alldone { background: var(--ok); border-color: var(--ok); }
.bottom .prog { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; margin-top: -4px; }

/* Bericht */
.rep h1 { font-size: 1.5rem; font-weight: 800; }
.rep .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; margin-top: 12px; }
.rep .k { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rep .v { font-weight: 600; }
.rep table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.rep th, .rep td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rep th { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--bg-alt); }
.rep td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rep .s-done { color: var(--ok); font-weight: 700; } .rep .s-open { color: var(--muted); } .rep .s-issue { color: var(--crit); font-weight: 700; } .rep .s-partial { color: var(--petrol); }
.rep .rn { font-size: .85rem; color: var(--muted); }
.rep h2 { font-size: 1.05rem; margin-top: 22px; }
.rep .sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.rep .sign .box { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; display: grid; gap: 8px; }
.rep .sign input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; }
.rep .sign .line { border-top: 1px solid var(--ink); margin-top: 26px; padding-top: 4px; font-size: .75rem; color: var(--muted); display: none; }
.rep .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 80; }

/* Lightbox */
.lb { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 90; place-items: center; padding: 16px; }
.lb.show { display: grid; }
.lb img { max-width: 100%; max-height: 88vh; border-radius: 6px; }
.lb .cap { color: #fff; margin-top: 10px; text-align: center; font-size: .95rem; }
.lb button { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); border: 0; background: rgba(255,255,255,.18); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; cursor: pointer; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .stitle { font-size: 1.35rem; }
  .sec { grid-template-columns: 48px 1fr auto; padding: 12px; }
  .sec .pl { width: 48px; height: 48px; font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .top, .bottom, .noprint { display: none !important; }
  .page { padding: 0; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .rep .sign .line { display: block; }
  .rep .sign input { border: 0; border-bottom: 1px solid #000; border-radius: 0; }
}
