/* cs-netzpeiler – 3dtools Design-System (Anthrazit / Neongrün / Signalorange), Tokens in tokens.css, Schriften lokal */
@import url("tokens.css");

@font-face { font-family: "Archivo"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url("../vendor/fonts/archivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  /* App-Flächen nach der App-Hülle (templates/app-huelle): hell / dunkel. Schaltflächenfarben drehen nie mit. */
  --topbar-h:62px; --tabs-h:48px; --bar-h:72px; --inspector-w:340px;
  --ease:var(--ease-standard);
  --s-shell:var(--anthrazit-800); --s-mehr:var(--anthrazit-800);
  --surface-stage:var(--grey-100);
  --sel-bg:rgba(140,227,60,.16); --sel-ring:var(--neon-600); --sel-fg:var(--neon-800);
}
:root[data-thema="dunkel"] {
  --s-shell:var(--anthrazit-950); --s-mehr:rgba(255,255,255,.09);
  --surface-page:var(--anthrazit-950); --surface-card:var(--anthrazit-900); --surface-subtle:#20262C;
  --surface-sunken:var(--anthrazit-950); --surface-stage:#0D1013;
  --text-strong:#fff; --text-body:rgba(255,255,255,.78); --text-muted:rgba(255,255,255,.5);
  --border-subtle:rgba(255,255,255,.09); --border-default:rgba(255,255,255,.18);
  --sel-fg:var(--neon-400); --text-link:var(--neon-400);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body); font-size: 15px; line-height: 1.5; color: var(--text-body);
  background: var(--surface-page); -webkit-font-smoothing: antialiased;
  overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--text-strong); letter-spacing: -0.012em; line-height: 1.18; font-weight: 700; margin: 0; }
.mono, input.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ App-Hülle: Kopfzeile · Schritte · Arbeitsfläche · Leiste */
body.app { display: flex; flex-direction: column; }
.topbar {
  flex: none; position: relative; z-index: 20;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  background-color: var(--s-shell); background-image: var(--pattern-raster); background-size: var(--pattern-raster-size);
  color: #fff; display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; flex: none; }
.wortmarke { font: 800 19px/1 var(--font-display); letter-spacing: -0.025em; color: var(--neon-400); white-space: nowrap; }
.wortmarke i { font-style: normal; font-weight: 700; color: var(--orange-500); }
.brand-sep { width: 1px; height: 26px; background: rgba(255,255,255,.16); margin: 0 4px; flex: none; }
.app-name { font: 600 14px var(--font-body); color: rgba(255,255,255,.82); white-space: nowrap; }
.topbar-right { margin-left: auto; position: relative; }
.shell-btn {
  appearance: none; border: 0; display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 15px;
  border-radius: var(--radius-md); background: rgba(255,255,255,.10); color: #fff; cursor: pointer;
  font: 600 13px var(--font-body); letter-spacing: .02em; transition: background-color var(--dur-fast) var(--ease);
}
.shell-btn:hover { background: rgba(255,255,255,.18); }
.shell-btn svg { width: 16px; height: 16px; }

/* Aufklappmenüs (Einstellungen oben rechts, „Mehr" unten rechts) */
.menu {
  position: absolute; z-index: 40; width: 256px; background: var(--surface-card); color: var(--text-body);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-4), 0 0 0 1px var(--border-subtle); padding: 6px;
  display: flex; flex-direction: column; animation: menu-in var(--dur-base) var(--ease);
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.topbar .menu { top: 46px; right: 0; }
.menu .eyebrow { margin: 10px 10px 6px; }
.menu-item {
  appearance: none; border: 0; background: none; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border-radius: var(--radius-md); font: 500 14px var(--font-body); color: var(--text-body);
  text-align: left; cursor: pointer; text-decoration: none; min-height: 44px;
}
.menu-item:hover { background: var(--surface-subtle); }
.menu-item svg { width: 16px; height: 16px; flex: none; }
.menu-item .check { margin-left: auto; color: var(--neon-600); visibility: hidden; }
.menu-item.on .check { visibility: visible; }
.menu-item.warn { color: var(--orange-600); }
.menu-sep { height: 1px; background: var(--border-subtle); margin: 6px 8px; }
.menu-note { font-size: 12px; line-height: 1.5; color: var(--text-muted); margin: 6px 10px 8px; }

.steps {
  flex: none; display: flex; gap: 4px; height: var(--tabs-h); padding: 0 max(12px, env(safe-area-inset-left));
  background: var(--surface-card); box-shadow: inset 0 -1px 0 var(--border-subtle);
  overflow-x: auto; scrollbar-width: none;
}
.steps button {
  appearance: none; background: none; border: 0; color: var(--text-muted);
  font: 600 15px var(--font-body); padding: 0 14px; height: 100%; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 8px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease);
}
.steps button .num {
  width: 24px; height: 24px; border-radius: 999px; display: inline-grid; place-items: center;
  font: 500 12px var(--font-mono); background: var(--surface-sunken); color: var(--text-body);
}
.steps button.active { color: var(--text-strong); border-bottom-color: var(--neon-500); }
.steps button.active .num { background: var(--neon-500); color: var(--anthrazit-900); }
.steps button.done .num { background: var(--sel-bg); color: var(--sel-fg); }
.steps button:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------ Arbeitsfläche */
.work { display: flex; flex: 1; min-height: 0; }
.stage {
  position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--surface-stage);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.loupe {
  position: absolute; width: 168px; height: 168px; border-radius: 999px; pointer-events: none;
  box-shadow: var(--shadow-4), 0 0 0 3px #fff, 0 0 0 4px var(--anthrazit-800); z-index: 5;
}

.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; }
.empty[hidden] { display: none; }
.empty-card { background: var(--surface-card); border-radius: 16px; box-shadow: var(--shadow-3); padding: 40px; max-width: 520px; text-align: center; }
.empty-icon { width: 48px; height: 48px; color: var(--text-link); }
.empty-card h2 { font-size: 28px; margin: 12px 0 8px; }
.empty-card p { margin: 0 0 24px; color: var(--text-muted); }
.empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4;
  background: var(--anthrazit-900); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 500; box-shadow: var(--shadow-3); max-width: calc(100% - 32px);
  display: flex; gap: 12px; align-items: center;
}
.hint[hidden] { display: none; }
.hint .btn { height: 32px; padding: 0 12px; font-size: 13px; }

.zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.btn-icon { width: 48px; height: 48px; padding: 0; background: var(--surface-card); box-shadow: var(--shadow-2); color: var(--text-strong); font-size: 24px; font-weight: 500; }
.btn-icon svg { width: 20px; height: 20px; }

.busy {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 4;
  background: var(--surface-card); border-radius: 999px; padding: 10px 18px; box-shadow: var(--shadow-3);
  display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--text-strong);
}
.busy[hidden] { display: none; }
.spinner { width: 16px; height: 16px; border-radius: 999px; border: 2px solid var(--neon-200); border-top-color: var(--neon-600); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Inspektor */
.inspector {
  width: var(--inspector-w); flex: none; background: var(--surface-card); overflow-y: auto; -webkit-overflow-scrolling: touch;
  box-shadow: -1px 0 0 var(--border-subtle);
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
}
.inspector h3 { font-size: 22px; margin-bottom: 4px; }
.inspector .lead { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
.eyebrow { font: 600 11px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin: 20px 0 8px; }
.section + .section { margin-top: 20px; }

.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-body); display: flex; justify-content: space-between; gap: 8px; }
.field label .tag { font: 500 11px var(--font-mono); color: var(--text-muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
input[type=text], input[type=number], input[type=password], input:not([type]) {
  height: 44px; width: 100%; border: 1px solid var(--border-default); border-radius: 6px; padding: 0 12px;
  font: 400 16px var(--font-body); color: var(--text-strong); background: var(--surface-card); outline: none;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
input.mono { font-size: 15px; }
input:focus { border-color: var(--border-focus); box-shadow: var(--shadow-focus); }
input.ocr { background: var(--sel-bg); }

.btn {
  appearance: none; border: 0; border-radius: 6px; height: 48px; padding: 0 18px; cursor: pointer;
  font: 600 15px var(--font-body); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 140ms var(--ease), box-shadow 140ms var(--ease), transform 140ms var(--ease);
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn svg { width: 18px; height: 18px; flex: none; } /* Standardgrösse Symbole (Design-System: 18px) */
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { height: 56px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
/* Farblogik: Neongrün führt und bestätigt, Anthrazit arbeitet, Orange warnt */
.btn-primary { background: var(--action-primary-bg); color: #fff; }
.btn-primary:hover { background: var(--action-primary-bg-hover); }
:root[data-thema="dunkel"] .btn-primary { background: var(--anthrazit-950); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
:root[data-thema="dunkel"] .btn-primary:hover { background: #000; }
.btn-primary.on { box-shadow: inset 0 0 0 2px var(--neon-500); color: var(--neon-400); }
.btn-accent { background: var(--action-accent-bg); color: var(--action-accent-fg); }
.btn-accent:hover { background: var(--action-accent-bg-hover); }
.btn-signal { background: var(--action-signal-bg); color: #fff; }
.btn-signal:hover { background: var(--action-signal-bg-hover); }
.btn-secondary { background: var(--surface-card); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--border-default); }
.btn-secondary:hover { background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--grey-400); }
.btn-secondary.on { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring); color: var(--sel-fg); }
.btn-ghost { background: none; color: var(--text-link); padding: 0 8px; }
.btn-ghost-inv { background: rgba(255,255,255,.08); color: #fff; height: 40px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.btn-ghost-inv:hover { background: rgba(255,255,255,.14); }
.btn-danger-ghost { background: none; color: var(--orange-600); padding: 0 8px; height: 36px; font-size: 13px; }
.stack { display: grid; gap: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.note { border-radius: 6px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin: 8px 0; }
.note strong { font-weight: 600; }
.note-warn { background: var(--amber-100); color: #6b4000; }
.note-danger { background: var(--orange-100); color: var(--orange-800); }
.note-info { background: var(--blue-100); color: var(--navy-900); }
.note-ok { background: var(--neon-100); color: var(--neon-800); }

.card { background: var(--surface-card); border-radius: 10px; box-shadow: var(--shadow-1); padding: 14px; margin-bottom: 12px; }
.card.selected { box-shadow: 0 0 0 2px var(--sel-ring), var(--shadow-2); }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h4 { font-size: 16px; flex: 1; }
.dot { width: 14px; height: 14px; border-radius: 999px; border: 3px solid currentColor; flex: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; margin-top: 8px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-family: var(--font-mono); color: var(--text-strong); text-align: right; }

.metric { display: flex; align-items: baseline; gap: 8px; }
.metric .val { font: 500 28px var(--font-mono); color: var(--text-strong); }
.metric .unit { color: var(--text-muted); }

.gps-box { background: var(--surface-subtle); border-radius: 10px; padding: 14px; margin-top: 12px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; margin: 10px 0; box-shadow: var(--shadow-inner-sunken); }
.progress > span { display: block; height: 100%; background: var(--gradient-neon); transition: width 320ms var(--ease); }

.kabel { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.kabel input { width: 96px; height: 40px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { height: 40px; border-radius: 999px; padding: 0 14px; background: var(--surface-subtle); border: 0; box-shadow: inset 0 0 0 1px var(--border-default); font: 600 14px var(--font-body); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-strong); }
.chip.on { box-shadow: inset 0 0 0 2px var(--sel-ring); background: var(--sel-bg); color: var(--sel-fg); }

.ref { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.ref-head { display: flex; justify-content: space-between; align-items: baseline; }
.ref-head .d { font: 500 20px var(--font-mono); color: var(--text-strong); }
.card-refs .ref:first-child { border-top: 0; padding-top: 0; } /* ohne Kopf: ausgewählte Muffe ist am Chip erkennbar */

table.summary { width: 100%; border-collapse: collapse; font-size: 13px; }
table.summary th { font: 600 11px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 6px 4px; background: var(--surface-subtle); }
table.summary td { padding: 8px 4px; border-top: 1px solid var(--border-subtle); vertical-align: top; }
table.summary td.num { font-family: var(--font-mono); text-align: right; }

details { margin-top: 12px; }
details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-link); padding: 6px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--anthrazit-900); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-4);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease); max-width: min(560px, 90vw); font-weight: 500;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  :root { --inspector-w: 300px; }
  .steps button { padding: 0 8px; font-size: 13px; }
}
@media (orientation: portrait) and (max-width: 1100px) {
  .work { flex-direction: column; }
  .inspector { width: 100%; height: 42%; box-shadow: 0 -1px 0 var(--border-subtle); }
  .stage { flex: 1; }
  .steps button { padding: 0 8px; }
}
.tag-auto { font: 600 11px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--sel-fg); background: var(--sel-bg); border-radius: 4px; padding: 2px 6px; vertical-align: 2px; margin-left: 6px; }
.kabel-row { background: var(--surface-card); border-radius: 10px; box-shadow: var(--shadow-1); padding: 12px 14px; margin-bottom: 8px; border-top: 3px solid rgba(227,0,15,.6); }
.kabel-name { font-weight: 600; color: var(--text-strong); margin-bottom: 8px; }
.kabel-hint { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.card-head h4 { min-width: 0; }
.card-head .btn-danger-ghost { padding: 0 4px; }
.type-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 12px; }
.type-chips .chip { justify-content: center; padding: 0 6px; font-size: 13px; height: 44px; }
.type-chips .chip:first-child { grid-column: 1 / -1; }
.stage-tools {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px;
}
.tool-btn { height: 48px; padding: 0 16px; background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-2); }
.tool-btn svg { width: 20px; height: 20px; }
.tool-btn.on { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring), var(--shadow-2); color: var(--sel-fg); }
.tool-btn[hidden], .sat-box[hidden], .sat-slider[hidden], .sat-credit[hidden] { display: none; }
.sat-box { display: flex; gap: 8px; align-items: center; }
.sat-slider {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 6px;
  background: var(--surface-card); box-shadow: var(--shadow-2); font-size: 13px; font-weight: 500; color: var(--text-body);
}
.sat-slider input { width: 180px; accent-color: var(--neon-600); height: 32px; }
.sat-credit {
  position: absolute; right: 72px; bottom: 12px; z-index: 3; font-size: 11px; color: var(--grey-600);
  background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 4px;
}
textarea {
  width: 100%; min-height: 88px; border: 1px solid var(--border-default); border-radius: 6px; padding: 10px 12px;
  font: 400 16px var(--font-body); color: var(--text-strong); background: var(--surface-card); resize: vertical; outline: none;
}
textarea:focus { border-color: var(--border-focus); box-shadow: var(--shadow-focus); }
.swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.swatch { min-width: 0; padding: 0; height: 44px; border: 0; border-radius: 6px; background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--border-default); display: grid; place-items: center; cursor: pointer; }
.swatch span { width: 24px; height: 24px; border-radius: 999px; }
.swatch.on { box-shadow: inset 0 0 0 3px var(--sel-ring); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg .chip { justify-content: center; height: 44px; }
.empty-open { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.empty-open p { margin: 8px 0 0; font-size: 13px; }
.punkt-farben { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.punkt-farben .swatch { height: 40px; }
.punkt-farben .swatch span { width: 20px; height: 20px; }
.inspector[hidden], .zoom[hidden] { display: none; }
.chip.repair { width: 100%; justify-content: center; height: 44px; margin-top: 6px; }
.chip.repair.on { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring); color: var(--sel-fg); }
.muffe-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.muffe-chips .chip { justify-content: center; padding: 0 4px; font-size: 12px; height: 40px; }
.muffe-chips .chip:disabled { opacity: .4; cursor: not-allowed; }
.card-head h4 { overflow-wrap: anywhere; }
/* iPad/Safari: Symbole in Knöpfen dürfen den Tipp nicht abfangen */
.btn svg, .chip svg, button svg { pointer-events: none; }
.card-head h4 .sub { display: block; font: 500 13px var(--font-body); color: var(--text-muted); margin-top: 2px; }
.muffe-chips .chip { font-size: 14px; white-space: nowrap; min-width: 0; }
.type-chips .chip { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .type-chips .chip { font-size: 12px; padding: 0 4px; }
}


/* Auswahlfenster Punktart */
.dialog-scrim {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: var(--overlay-scrim); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.dialog-scrim[hidden] { display: none; }
.dialog-card {
  background: var(--surface-card); border-radius: 10px; box-shadow: var(--shadow-4); padding: 24px;
  width: min(460px, 100%); max-height: calc(100% - 32px); overflow-y: auto;
  animation: dlg-in 200ms var(--ease);
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dialog-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.dialog-head h3 { font-size: 22px; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-grid .type-tile:nth-child(-n+2) { grid-column: 1 / -1; }
.type-tile {
  appearance: none; border: 0; border-radius: 10px; background: var(--surface-subtle); cursor: pointer; text-align: left;
  box-shadow: inset 0 0 0 1px var(--border-default); padding: 14px 16px; min-height: 56px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; color: var(--text-strong);
  transition: background 140ms var(--ease), box-shadow 140ms var(--ease);
}
.type-tile .tt { font: 600 16px var(--font-body); }
.type-tile .ts { font-size: 12px; color: var(--text-muted); }
.type-tile.on { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring); }
.type-tile:active { transform: scale(.985); }
.type-tile:disabled { opacity: .45; cursor: not-allowed; }

/* Position scannen */
.src-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.src-buttons .breit { grid-column: 1 / -1; }
/* Punkt über Hilfspunkt: Distanz in m */
.hilf-d { display: flex; align-items: center; gap: 8px; }
.hilf-d input { flex: 1; min-width: 0; }
.src-buttons .btn { padding: 0 10px; font-size: 15px; }
.scan-card { background: var(--surface-card); border-radius: 10px; box-shadow: var(--shadow-4); padding: 20px; width: min(560px, 100%); max-height: calc(100% - 32px); overflow-y: auto; animation: dlg-in 200ms var(--ease); }
.scan-card h3 { font-size: 22px; margin-bottom: 12px; }
.scan-view { position: relative; background: #000; border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 3; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18% 22%; border: 3px solid rgba(255,255,255,.9); border-radius: 10px; box-shadow: 0 0 0 999px rgba(17,20,24,.35); }

/* Anmelden / Einrichten */
.auth-page { overflow: auto; }
.auth-main { min-height: calc(100% - var(--topbar-h)); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { text-align: left; width: min(440px, 100%); }
.auth-card h2 { margin-top: 0; }
.auth-card p { margin: 0 0 16px; }
.auth-form { margin-top: 8px; }
.auth-form .btn { margin-top: 8px; }
.src-buttons .btn { white-space: nowrap; min-width: 0; }
@media (max-width: 900px) {
  .src-buttons .btn { font-size: 13px; padding: 0 6px; gap: 6px; }
  .src-buttons .btn svg { width: 16px; height: 16px; }
}
.repair-pick { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.repair-pick.todo { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring); }
.chip.toup { width: 100%; justify-content: center; height: 44px; margin-top: 10px; white-space: nowrap; }
.chip.toup.on { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring); color: var(--sel-fg); }

/* ------------------------------------------------------------ Leiste unten: wichtige Schaltflächen, „Mehr" ganz rechts */
.bar {
  flex: none; position: relative; z-index: 15; display: flex; align-items: center; gap: 12px;
  min-height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding: 10px max(18px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: var(--surface-subtle); box-shadow: inset 0 1px 0 var(--border-subtle);
}
.bar .btn { height: 52px; padding: 0 22px; font-size: 16px; letter-spacing: .02em; }
.bar .btn svg { width: 19px; height: 19px; }
.btn-tool { background: var(--surface-card); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--border-default); }
.btn-tool:hover { background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--grey-400); }
.btn-mehr { margin-left: auto; background: var(--s-mehr); color: #fff; }
.btn-mehr:hover { background: var(--anthrazit-900); }
.bar .menu { right: max(18px, env(safe-area-inset-right)); bottom: calc(100% + 8px); }
@media (max-width: 900px) {
  .bar { gap: 8px; }
  .bar .btn { padding: 0 14px; font-size: 15px; }
}
@media (max-width: 520px) {
  .wortmarke { font-size: 16px; }
  .app-name, .brand-sep { display: none; }
  .shell-btn .lbl-long { display: none; }
}
.lbl-short { display: none; }
.bar-actions { display: flex; gap: inherit; min-width: 0; flex: 1; }
.bar-actions .btn { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.bar-actions .btn-tool:first-child { flex: none; }
.btn-mehr { flex: none; }
@media (max-width: 600px) {
  .bar .lbl-long { display: none; }
  .bar .lbl-short { display: inline; }
  .bar .btn { padding: 0 14px; }
}
.punkt-card { cursor: pointer; }
.punkt-card .chev { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--text-muted); transition: transform var(--dur-base) var(--ease); flex: none; }
.punkt-card.open .chev { transform: rotate(180deg); }
.punkt-card .kv { margin-top: 12px; }
.punkt-card .actions { justify-content: space-between; align-items: center; }
.badge-warn { font: 600 11px var(--font-body); letter-spacing: .02em; text-transform: uppercase; color: var(--status-warning-fg); background: var(--status-warning-bg); border-radius: var(--radius-sm); padding: 3px 7px; flex: none; }
.kabel-head { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 28px; }
.kabel-head .kabel-name { flex: 1; margin: 0; min-width: 0; }
.kabel-len { font-weight: 500; color: var(--text-strong); flex: none; }
.kabel-row .chev { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--text-muted); transition: transform var(--dur-base) var(--ease); flex: none; }
.kabel-row.open .chev { transform: rotate(180deg); }
.kabel-row.open .kabel { margin-top: 10px; }
.tf-grid .type-tile:nth-child(-n+2) { grid-column: auto; } /* Trassen-Enden: zwei Kacheln nebeneinander */

/* Layer */
.layer-bar { margin: 0 0 16px; padding: 12px; border-radius: var(--radius-lg); background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.layer-hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.layer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-chip { display: inline-flex; align-items: stretch; border-radius: 999px; background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--border-default); overflow: hidden; }
.layer-chip.on { background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring); }
.layer-chip.aus .layer-name { opacity: .45; }
.layer-chip button { appearance: none; border: 0; background: none; cursor: pointer; color: var(--text-strong); font: 600 14px var(--font-body); min-height: 40px; }
.layer-chip.on .layer-name { color: var(--sel-fg); }
.layer-name { padding: 0 4px 0 14px; white-space: nowrap; }
.layer-n { font: 500 12px var(--font-mono); color: var(--text-muted); margin-left: 2px; }
.layer-eye { padding: 0 12px 0 6px; color: var(--text-muted); display: inline-grid; place-items: center; }
.layer-eye svg { width: 18px; height: 18px; }
.layer-add svg { width: 16px; height: 16px; }
.layer-edit { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.layer-edit input { height: 40px; font-size: 15px; }
.layer-move { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.layer-move .chip { height: 34px; font-size: 13px; }
/* Einzelne Layer-PDFs: langer Dateiname bricht im Knopf um statt überzulaufen */
.file-btn { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 48px; padding: 10px 14px; margin-bottom: 8px; min-width: 0; }
.file-btn .mono { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.inspector { overflow-x: hidden; }
/* Aufklappbare Blöcke in der Finalansicht */
.klappe .card-head { cursor: pointer; }
.klappe .chev { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--text-muted); transition: transform var(--dur-base) var(--ease); flex: none; }
.klappe.open .chev { transform: rotate(180deg); }
.klappe-n { font: 500 13px var(--font-mono); color: var(--text-muted); }
.klappe-body { margin-top: 10px; }
.klappe-body .note:last-child { margin-bottom: 0; }

/* Freischaltung / Ansichtsmodus */
.nur-ansicht-only { display: none; }
.nur-ansicht .nur-ansicht-only { display: inline-flex; }
.nur-ansicht p.nur-ansicht-only { display: block; }
.nur-ansicht .empty-actions [data-action="paste"], .nur-ansicht .empty-actions label,
.nur-ansicht .src-buttons, .nur-ansicht [data-action="trasse-start"], .nur-ansicht .layer-add, .nur-ansicht .layer-edit,
.nur-ansicht [data-action="punkt-del"], .nur-ansicht [data-action="type-dialog"], .nur-ansicht [data-action="trasse-del"],
.nur-ansicht #text-tool, .nur-ansicht [data-action="pdf"], .nur-ansicht [data-action="pdf-einzeln"],
.nur-ansicht [data-action="ref-next"], .nur-ansicht [data-action="ref-free"], .nur-ansicht [data-action="calib-add"],
.nur-ansicht [data-action="calib-del"], .nur-ansicht [data-action="reset"], .nur-ansicht .layer-move { display: none !important; }
.profil-menu { padding: 0 10px 6px; }
.profil-status { display: grid; gap: 2px; font-size: 13px; line-height: 1.4; color: var(--text-body); padding: 8px 10px; border-radius: var(--radius-md); background: var(--sel-bg); }
.profil-status b { color: var(--text-strong); font-weight: 600; }
.profil-status.aus { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.profil-status.aus b { color: var(--status-warning-fg); }
.profil-status .warn { color: var(--orange-600); font-weight: 600; }
.profil-kennung { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.profil-kennung b { color: var(--text-strong); letter-spacing: .04em; }
.dialog-card .profil-status { margin-bottom: 4px; }
.dialog-card .profil-kennung { margin: 6px 0 0; }

/* Mitarbeiter verwalten (mitarbeiter.php), Häkchen in Formularen */
.auth-card.auth-breit { width: min(860px, 100%); }
.check-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; color: var(--text-body); cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--neon-600); flex: none; }
.check-row small { color: var(--text-muted); }
.ma-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.ma-kopf h2 { margin: 0; }
.ma-hinweis { font-size: 13px; color: var(--text-muted); margin: 6px 0 12px; }
.ma-code summary { cursor: pointer; font-weight: 600; color: var(--text-link); margin: 4px 0 8px; }
.ma-code textarea { margin-bottom: 8px; }
.ma-liste { list-style: none; margin: 0; padding: 0; }
.ma-liste li { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.ma-liste li:first-child { border-top: 0; }
.ma-liste li.alt { opacity: .6; }
.ma-info { flex: 1; min-width: 0; }
.ma-name { color: var(--text-strong); overflow-wrap: anywhere; }
.ma-name strong { font-weight: 600; margin-right: 4px; }
.ma-meta { font-size: 13px; color: var(--text-muted); }
.ma-aktionen { display: flex; gap: 6px; flex-wrap: wrap; }
.ma-aktionen form.inline { display: inline; margin: 0; }
.badge { display: inline-block; font: 600 11px var(--font-body); letter-spacing: .04em; text-transform: uppercase; border-radius: var(--radius-sm); padding: 2px 6px; margin-right: 4px; vertical-align: 1px; background: var(--status-info-bg); color: var(--status-info-fg); }
.badge-ok { background: var(--status-success-bg); color: var(--status-success-fg); }
.badge-muted { background: var(--surface-sunken); color: var(--text-muted); }
.badge-danger { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.neu-pw b { font-size: 15px; }
@media (max-width: 700px) {
  .auth-card .row { grid-template-columns: 1fr; gap: 0; }
}

/* Aufträge (auftraege.php) */
.auth-card select { width: 100%; height: 44px; border: 1px solid var(--border-default); border-radius: 6px; padding: 0 10px; font: 400 16px var(--font-body); color: var(--text-strong); background: var(--surface-card); }
.auth-card input[type=file] { font: 400 14px var(--font-body); color: var(--text-body); }
.auftrag-notiz { font-size: 13px; color: var(--text-body); background: var(--surface-subtle); border-radius: 6px; padding: 8px 10px; margin-top: 6px; }
.auftrag-notiz.rueck { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.ma-liste li.fertig .ma-name strong { color: var(--text-body); }
.ma-kopf span { display: flex; gap: 6px; }

/* Aufträge in der App: Zähler im Menü, Auswahl-Dialog, Karte im Seitenbereich */
.menu-zahl { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--neon-500); color: var(--anthrazit-900); font: 600 12px/22px var(--font-body); text-align: center; }
.menu-zahl[hidden] { display: none; }
.auftrag-wahl { list-style: none; margin: 0 0 8px; padding: 0; max-height: 55vh; overflow-y: auto; }
.auftrag-wahl li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.auftrag-wahl li:first-child { border-top: 0; }
.auftrag-wahl li > div { flex: 1; min-width: 0; }
.auftrag-wahl li.fertig { opacity: .6; }
.auftrag-wahl b { color: var(--text-strong); font-weight: 600; }
.auftrag-sub { display: block; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.badge-status { font: 600 11px var(--font-body); letter-spacing: .04em; text-transform: uppercase; border-radius: var(--radius-sm); padding: 2px 6px; margin-left: 4px; background: var(--status-info-bg); color: var(--status-info-fg); }
.badge-status.s-arbeit { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.badge-status.s-erledigt { background: var(--status-success-bg); color: var(--status-success-fg); }
.auftrag-karte { margin: -4px 0 16px; padding: 10px 12px; border-radius: var(--radius-lg); background: var(--status-info-bg); color: var(--navy-900); }
:root[data-thema="dunkel"] .auftrag-karte { background: rgba(0,112,192,.18); color: var(--text-body); }
.auftrag-kopf { appearance: none; border: 0; background: none; padding: 0; width: 100%; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.auftrag-kopf .eyebrow { display: block; margin: 0 0 2px; }
.auftrag-kopf b { font-weight: 600; color: var(--text-strong); }
.auftrag-karte .auftrag-notiz { white-space: pre-wrap; margin: 8px 0 0; background: rgba(255,255,255,.55); }
:root[data-thema="dunkel"] .auftrag-karte .auftrag-notiz { background: rgba(255,255,255,.06); }
.auftrag-liste { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.auftrag-liste li { padding: 2px 0; }
.auftrag-liste li.ok { color: var(--status-success-fg); }
:root[data-thema="dunkel"] .auftrag-liste li.ok { color: var(--neon-400); }
.field .check-row { justify-content: flex-start; font-weight: 400; }
.badge-neu { background: var(--neon-500); color: var(--anthrazit-900); }
.ma-liste li.neu { background: var(--sel-bg); box-shadow: inset 3px 0 0 var(--neon-500); padding-left: 10px; border-radius: 6px; }

/* Startseite (kein Plan geladen): links Aufträge mit Tabs, rechts Neue Einmessung + Verwaltung – ein Bildschirm */
.empty { overflow: hidden; place-items: stretch; padding: 20px max(18px, env(safe-area-inset-right)) 20px max(18px, env(safe-area-inset-left)); }
.start { width: 100%; max-width: 1440px; margin: 0 auto; height: 100%; min-height: 0; display: flex; flex-direction: column; }
.start-kopf { flex: none; margin: 0 0 14px; }
.start-kopf[hidden] { display: none; }
.start-kopf h2 { font-size: 26px; margin: 0; }
.start-kopf p { margin: 2px 0 0; color: var(--text-muted); }
.start-raster { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 16px; }
.start-raster.ohne-auftraege { grid-template-columns: minmax(0, 560px); justify-content: center; }
.start-rechts { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.start-karte { background: var(--surface-card); border-radius: 16px; box-shadow: var(--shadow-3); padding: 18px 20px; }
.start-karte[hidden] { display: none; }
.start-auftraege { min-height: 0; display: flex; flex-direction: column; }
.start-titel { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.start-titel h3 { font-size: 20px; margin: 0; flex: 1; }
.start-tabs { flex: none; display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.start-tabs button { appearance: none; border: 0; height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--font-body); color: var(--text-body); background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--border-default); }
.start-tabs button.aktiv { background: var(--sel-bg); color: var(--sel-fg); box-shadow: inset 0 0 0 2px var(--sel-ring); }
.start-inhalt { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.start-leer { margin: 24px 0; text-align: center; }
.start-mehr { flex: none; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text-link); text-decoration: none; }
.start-zahl { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-body); font: 700 12px/22px var(--font-body); text-align: center; }
.start-zahl.neu { background: var(--neon-500); color: var(--anthrazit-900); }
.start-liste { list-style: none; margin: 0; padding: 0; }
.start-liste li { display: flex; gap: 12px; align-items: center; padding: 12px; margin: 0 0 8px; border-radius: 10px; background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.start-liste li.neu { background: var(--sel-bg); box-shadow: inset 4px 0 0 var(--neon-500), inset 0 0 0 1px var(--border-subtle); }
.start-liste li > div:first-child { flex: 1; min-width: 0; }
.start-liste b { color: var(--text-strong); font-weight: 600; }
.start-knoepfe { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.auftrag-rueck { display: block; margin-top: 6px; font-size: 13px; padding: 6px 8px; border-radius: 6px; background: var(--status-warning-bg); color: var(--status-warning-fg); white-space: pre-wrap; }
.start-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.start-kachel { display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 64px; border-radius: 12px; text-decoration: none; color: var(--text-strong); background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--border-default); }
.start-kachel:hover { background: var(--surface-sunken); }
.start-kachel svg { width: 22px; height: 22px; flex: none; color: var(--text-link); }
.start-kachel b { display: block; font-weight: 600; }
.start-kachel small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
/* Neue Einmessung kompakt (gleiche Knöpfe wie bisher) */
.start-plan { max-width: none; padding: 18px 20px; text-align: left; box-shadow: var(--shadow-3); }
.start-plan .empty-icon { display: none; }
.start-plan h2 { font-size: 20px; margin: 0 0 4px; }
.start-plan > p { font-size: 13px; margin: 0 0 12px; }
.start-plan .empty-actions { justify-content: flex-start; gap: 8px; }
.start-plan .empty-actions .btn-lg, .start-plan .empty-open .btn-lg { height: 48px; font-size: 15px; padding: 0 16px; }
.start-plan .empty-open { margin-top: 12px; padding-top: 12px; }
@media (max-width: 900px) {
  .empty { overflow-y: auto; }
  .start { height: auto; }
  .start-raster { grid-template-columns: minmax(0, 1fr); }
  .start-rechts { overflow: visible; }
  .start-inhalt { overflow: visible; }
  .start-knoepfe { max-width: none; }
  .start-liste li { flex-wrap: wrap; }
}
/* Zähler am Knopf „Mehr" (offene Aufträge + neue Rückmeldungen) */
.btn-mehr { position: relative; }
.mehr-zahl { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--neon-500); color: var(--anthrazit-900); font: 700 12px/22px var(--font-body); box-shadow: 0 0 0 2px var(--surface-page); }
.mehr-zahl[hidden] { display: none; }

/* Verwaltungsseiten (auftraege.php, mitarbeiter.php): volle Breite, feste Leiste „Zur App“ + Tabs, zwei Spalten */
body.v-seite { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.v-nav { flex: none; display: flex; align-items: center; gap: 16px; padding: 10px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left)); background: var(--surface-card); box-shadow: inset 0 -1px 0 var(--border-subtle); position: sticky; top: 0; z-index: 10; }
.v-zurueck { height: 42px; }
.v-tabs { display: flex; gap: 6px; }
.v-tabs a { height: 42px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 8px; color: var(--text-muted); font-weight: 600; text-decoration: none; }
.v-tabs a:hover { color: var(--text-strong); background: var(--surface-subtle); }
.v-tabs a.aktiv { color: var(--sel-fg); background: var(--sel-bg); box-shadow: inset 0 0 0 2px var(--sel-ring); }
.v-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1440px; margin: 0 auto; padding: 16px max(18px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.v-meldung { flex: none; margin: 0; }
.v-meldung .note { margin: 0; }
.v-raster { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 16px; }
.v-raster.v-raster-eins { grid-template-columns: minmax(0, 1fr); }
.v-karte { min-height: 0; overflow-y: auto; background: var(--surface-card); border-radius: 16px; box-shadow: var(--shadow-3); padding: 20px 22px; }
.v-karte h2 { font-size: 22px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.v-karte .eyebrow { margin-top: 22px; }
.v-karte select { width: 100%; height: 44px; border: 1px solid var(--border-default); border-radius: 6px; padding: 0 10px; font: 400 16px var(--font-body); color: var(--text-strong); background: var(--surface-card); }
.v-karte input[type=file] { font: 400 14px var(--font-body); color: var(--text-body); }
.v-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.v-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; padding: 4px 0 10px; position: sticky; top: -20px; z-index: 1; background: var(--surface-card); box-shadow: 0 1px 0 var(--border-subtle); }
.v-filter a { height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; text-decoration: none; font: 600 14px var(--font-body); color: var(--text-body); background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--border-default); }
.v-filter a.aktiv { background: var(--sel-bg); color: var(--sel-fg); box-shadow: inset 0 0 0 2px var(--sel-ring); }
.v-zahl { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-body); font: 700 12px/22px var(--font-body); text-align: center; }
.v-zahl.neu { background: var(--neon-500); color: var(--anthrazit-900); }
.v-liste .ma-liste li { flex-direction: row; align-items: flex-start; gap: 16px; }
.v-liste .ma-aktionen { flex: none; max-width: 48%; justify-content: flex-end; }
@media (max-width: 900px) {
  body.v-seite { height: auto; overflow: visible; }
  .v-raster { grid-template-columns: minmax(0, 1fr); }
  .v-liste { order: -1; }
  .v-karte { overflow: visible; }
  .v-liste .ma-liste li { flex-direction: column; }
  .v-liste .ma-aktionen { max-width: none; justify-content: flex-start; }
  .v-filter { top: 62px; }
}
@media (max-width: 480px) { .v-checks { grid-template-columns: 1fr; } .v-tabs a { padding: 0 10px; } }
.start-plan .empty-open { border-top: 0; margin-top: 8px; padding-top: 0; }
.start-plan .empty-open p { display: none; }
.start-kachel:last-child:nth-child(odd) { grid-column: 1 / -1; }
.v-app-knopf { margin-top: 8px; }
/* Aufträge vorbereiten / zurückgeben (2026-09-30) */
.start-plan.hervor { box-shadow: 0 0 0 3px var(--neon-500), var(--shadow-3); }
.dialog-card select { width: 100%; height: 44px; border: 1px solid var(--border-default); border-radius: 6px; padding: 0 10px; font: 400 16px var(--font-body); color: var(--text-strong); background: var(--surface-card); }
.dialog-card .check-row { margin: 4px 0; }
.auftrag-pdfs { margin: 0 0 10px; padding-left: 18px; font: 500 13px var(--font-mono); color: var(--text-body); }
.layer-regel { margin: 0 0 10px; }
.auftrag-karte > .eyebrow { display: block; margin: 0 0 2px; }
.layer-edit input[readonly] { color: var(--text-muted); background: var(--surface-subtle); }

/* Bearbeitung als Rahmen; Lightbox für „Neuer Auftrag“ und „Rückmeldung ansehen“ (body.lightbox) */
.editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.editor-kopf { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface-card); box-shadow: inset 0 -1px 0 var(--border-subtle); }
.editor-kopf[hidden] { display: none; }
.editor-kopf > div { flex: 1; min-width: 0; }
.editor-kopf b { display: block; font: 700 19px var(--font-display); color: var(--text-strong); }
.editor-kopf span { display: block; font-size: 13px; color: var(--text-muted); }
body.lightbox::before { content: ''; position: fixed; inset: 0; z-index: 25; background: rgba(10, 12, 15, .62); }
body.lightbox .editor { position: fixed; z-index: 26; inset: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); border-radius: 16px; overflow: hidden; background: var(--surface-page); box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px var(--border-subtle); }
body.lightbox .toast { z-index: 45; }
.steps[hidden] { display: none; }
.ef-select { width: 100%; height: 44px; border: 1px solid var(--border-default); border-radius: 6px; padding: 0 10px; font: 400 16px var(--font-body); color: var(--text-strong); background: var(--surface-card); }
.pdf-liste .btn { white-space: normal; height: auto; min-height: 44px; padding: 10px 12px; justify-content: flex-start; text-align: left; overflow-wrap: anywhere; }
/* Neuer Auftrag, Schritt Hinweise: zwei Knöpfe mit zweizeiliger Beschriftung (passt auch in schmale Spalten) */
.hinweis-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hinweis-knoepfe .btn { height: auto; min-height: 64px; padding: 8px 10px; white-space: normal; }
.hinweis-knoepfe .btn span { display: grid; gap: 2px; text-align: center; line-height: 1.2; }
.hinweis-knoepfe .btn small { font-size: 12px; font-weight: 500; opacity: .75; }
/* In der Lightbox (Neuer Auftrag, Rückmeldung) kein „Mehr“ – geschlossen wird oben mit Abbrechen/Schliessen */
body.lightbox .btn-mehr, body.lightbox #menu-mehr { display: none; }

/* Peiler live testen */
.livetest .scan-view { aspect-ratio: 4 / 3; }
.lt-rahmen { position: absolute; left: 50%; top: 50%; width: calc(75% * var(--f)); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 3px solid rgba(166,245,99,.95); border-radius: 8px; box-shadow: 0 0 0 999px rgba(17,20,24,.35); max-height: calc(100% * var(--f)); }
.lt-optionen { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.lt-optionen .chip { height: 34px; font-size: 13px; }
