/* cs 3D Maps – Oberfläche nach dem 3dtools-Design-System (App-Hülle). Nur Token-Variablen. */

:root {
  --shell: var(--navy-800);
  --panel-w: 380px;
  --bar-h: 84px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-body); color: var(--text-body); background: var(--surface-page); font-size: 15px; }
.mono { font-family: var(--font-mono); }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -0.012em; color: var(--text-strong); margin: 6px 0 14px; }
.eyebrow { font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-600); margin: 0 0 6px; }
.eyebrow.light { color: var(--blue-300); }
.hint { font-size: 13px; line-height: 1.5; color: var(--text-muted); margin: 8px 0; }
hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 20px 0; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; display: inline-block; }

.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

/* Kopfzeile */
.top { height: 62px; flex: 0 0 62px; background: var(--shell); display: flex; align-items: center; padding: 0 18px; gap: 14px; color: var(--white); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { height: 38px; width: 38px; object-fit: contain; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.025em; }
.brand-name span { font-weight: 500; opacity: .55; }
.top-sep { width: 1px; height: 26px; background: rgba(255,255,255,.16); }
.top-app { font-weight: 600; font-size: 14px; color: var(--blue-300); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-phone { font-family: var(--font-mono); font-size: 12px; color: rgba(255,255,255,.52); }
.top-btn { display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 15px; border: 0; border-radius: 6px; background: rgba(255,255,255,.10); color: var(--white); font: 600 14px var(--font-body); cursor: pointer; transition: background 140ms var(--ease); }
.top-btn:hover { background: rgba(255,255,255,.18); }

/* Hauptbereich */
.main { flex: 1; display: flex; min-height: 0; }
.panel { width: var(--panel-w); flex: 0 0 var(--panel-w); border-right: 1px solid var(--border-subtle); background: var(--surface-subtle); display: flex; flex-direction: column; min-height: 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border-subtle); background: var(--surface-card); }
.steps button { border: 0; background: none; padding: 14px 4px 12px; font: 600 13px var(--font-body); color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: color 140ms var(--ease), border-color 200ms var(--ease); }
.steps button b { font-family: var(--font-mono); font-size: 11px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-muted); }
.steps button.on { color: var(--text-strong); border-bottom-color: var(--blue-500); }
.steps button.on b { background: var(--blue-500); color: var(--white); }
.steps button.done b { background: var(--navy-700); color: var(--white); }
.panel-body { flex: 1; overflow: auto; padding: 22px 22px 40px; }
.pane { display: none; }
.pane.on { display: block; animation: rise 200ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Formularelemente */
.field { margin: 14px 0; }
.field > label { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; color: var(--text-strong); margin-bottom: 6px; }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=tel], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-default); border-radius: 6px; background: var(--surface-card);
  font: 15px var(--font-body); color: var(--text-strong); transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(0,112,192,.28); }
input[type=number] { font-family: var(--font-mono); }
input[type=range] { width: 100%; accent-color: var(--blue-500); }
.unit { display: flex; align-items: center; border: 1px solid var(--border-default); border-radius: 6px; background: var(--surface-card); }
.unit input { border: 0; height: 38px; }
.unit input:focus { box-shadow: none; }
.unit:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(0,112,192,.28); }
.unit span { padding: 0 12px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; margin: 8px 0; color: var(--text-body); }
.check.tight { margin-top: 30px; }
.check input { width: 16px; height: 16px; accent-color: var(--blue-500); }
.sub { padding-left: 2px; }
.scale-row { display: flex; align-items: center; gap: 8px; }
.scale-row .pre { color: var(--text-muted); }
.scale-row input { flex: 1; }
.scale-row select { width: 130px; flex: 0 0 130px; }
.hp { position: absolute; left: -9999px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 40px; padding: 0 18px; border-radius: 6px; border: 1px solid transparent; font: 600 14px var(--font-body); cursor: pointer; transition: background 140ms var(--ease), border-color 140ms var(--ease); white-space: nowrap; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--action-primary-bg); color: var(--white); }
.btn.primary:hover { background: var(--action-primary-bg-hover); }
.btn.accent { background: var(--action-accent-bg); color: var(--white); }
.btn.accent:hover { background: var(--action-accent-bg-hover); }
.btn.fund { background: var(--action-fund-bg); color: var(--lime-800); }
.btn.fund:hover { background: var(--action-fund-bg-hover); color: var(--white); }
.btn.ghost { background: var(--surface-card); border-color: var(--border-default); color: var(--navy-800); }
.btn.ghost:hover { background: var(--surface-subtle); border-color: var(--navy-700); }
.btn.ghost.light { background: transparent; border-color: rgba(255,255,255,.3); color: var(--white); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.big { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 8px; }
.row-btns { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.row-btns.wrap { flex-wrap: wrap; justify-content: flex-start; }

.seg { display: inline-flex; background: var(--surface-sunken); border-radius: 8px; padding: 3px; gap: 2px; margin: 10px 0; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 6px; font: 600 13px var(--font-body); color: var(--text-muted); cursor: pointer; transition: background 200ms var(--ease), color 140ms var(--ease); }
.seg button.on { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-1, 0 1px 2px rgba(16,26,51,.12)); }
.seg.small button { height: 28px; padding: 0 10px; font-size: 12px; }

/* Suche */
.search { position: relative; }
.search input { height: 46px; padding-left: 40px; background: var(--surface-card) url(../img/ic/search.svg) 12px center / 18px no-repeat; }
.search-results { list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; left: 0; right: 0; z-index: 10; background: var(--surface-card); border-radius: 10px; box-shadow: 0 24px 56px -16px rgba(11,17,35,.42), 0 0 0 1px rgba(16,26,51,.05); max-height: 320px; overflow: auto; }
.search-results li { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.search-results li small { display: block; color: var(--text-muted); font-size: 12px; }
.search-results li:hover, .search-results li.on { background: var(--surface-accent-soft); }
.coords { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Formen */
.shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 4px; }
.shapes button { border: 1px solid var(--border-default); background: var(--surface-card); border-radius: 8px; padding: 12px 4px 10px; font: 600 12px var(--font-body); color: var(--text-body); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: border-color 140ms var(--ease); }
.shapes button.on { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(0,112,192,.18); color: var(--text-strong); }
.sh { display: block; background: var(--navy-700); }
.sh-rect { width: 34px; height: 24px; border-radius: 2px; }
.sh-square { width: 26px; height: 26px; border-radius: 2px; }
.sh-circle { width: 28px; height: 28px; border-radius: 50%; }
.sh-hex { width: 30px; height: 26px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

/* Farbschemen */
.schemes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scheme { border: 1px solid var(--border-subtle); background: var(--surface-card); border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; font: inherit; transition: border-color 140ms var(--ease), transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.scheme:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(16,26,51,.25); }
.scheme.on { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(0,112,192,.18); }
.scheme b { display: block; font-family: var(--font-display); font-size: 14px; color: var(--text-strong); margin-top: 8px; }
.scheme small { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-top: 2px; }
.strip { display: flex; height: 22px; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(16,26,51,.08); }
.strip i { flex: 1; }

/* Farbstopps und Ebenen */
.stops, .layers { display: flex; flex-direction: column; gap: 6px; }
.stop, .layer { display: flex; align-items: center; gap: 10px; background: var(--surface-card); border-radius: 8px; padding: 8px 10px; box-shadow: 0 0 0 1px rgba(16,26,51,.05); }
.stop input[type=range] { flex: 1; }
.stop .pct { width: 40px; text-align: right; font-size: 12px; color: var(--text-muted); }
.layer .name { flex: 1; font-size: 14px; color: var(--text-strong); }
.layer .opt { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.layer .opt select { height: 28px; width: auto; font-size: 12px; padding: 0 6px; }
.layer.off .name, .layer.off .sw { opacity: .45; }
.sw { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 6px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(16,26,51,.18); position: relative; }
.sw.silk { background-image: linear-gradient(120deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 70%) !important; }
.sw.translucent { opacity: .75; }
.icon-btn { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-sunken); color: var(--red-600); }
.fcount { margin-top: 14px; font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--status-info-bg); color: var(--status-info-fg); }
.fcount.warn { background: var(--status-warning-bg); color: var(--status-warning-fg); }

/* Zusammenfassung */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.summary dt { color: var(--text-muted); }
.summary dd { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--text-strong); text-align: right; }
.usage { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.usage .u { display: grid; grid-template-columns: 22px 20px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.usage .u .sw { width: 20px; height: 20px; flex-basis: 20px; cursor: default; }
.usage .u .n { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.usage .u .g { font-family: var(--font-mono); font-size: 12px; color: var(--text-strong); }
.order .btn { width: 100%; margin-top: 6px; }

/* Bühne */
.stage { flex: 1; position: relative; min-width: 0; background: var(--surface-sunken); }
.view { position: absolute; inset: 0; display: none; }
.view.on { display: block; }
#map, #preview3d { position: absolute; inset: 0; }
.view.deep { background: var(--gradient-deep); }
.view.deep::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 40px 40px; }
.map-badge { position: absolute; left: 14px; top: 14px; background: var(--surface-card); color: var(--text-strong); border-radius: 6px; padding: 7px 10px; font-size: 12px; box-shadow: 0 8px 20px -8px rgba(16,26,51,.3); pointer-events: none; }
.float-tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 8px; }
.glass { height: 34px; padding: 0 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.10); color: var(--white); backdrop-filter: saturate(140%) blur(14px); font: 600 13px var(--font-body); cursor: pointer; }
.glass.on { background: rgba(255,255,255,.28); }
.preview-info { position: absolute; left: 14px; bottom: 12px; font-size: 11px; color: rgba(255,255,255,.6); }
.stale { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--surface-card); padding: 8px 8px 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 12px 28px -10px rgba(11,17,35,.5); }
.busy { position: absolute; inset: 0; background: rgba(11,17,35,.55); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 30; }
.busy-card { width: min(360px, 90%); background: var(--navy-900); color: var(--white); border-radius: 10px; padding: 22px; box-shadow: 0 24px 56px -16px rgba(11,17,35,.6); }
.busy-card p { margin: 0 0 12px; }
.track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); box-shadow: inset 0 1px 2px rgba(0,0,0,.35); overflow: hidden; margin-bottom: 16px; }
.busy-bar { height: 100%; width: 0; background: var(--gradient-rim); transition: width 320ms var(--ease); }
.toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--navy-900); color: var(--white); padding: 12px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 12px 28px -10px rgba(11,17,35,.6); z-index: 40; max-width: 90%; }
.toast.err { background: var(--red-700); }

/* Fussleiste */
footer.bar { height: var(--bar-h); flex: 0 0 var(--bar-h); border-top: 1px solid var(--border-subtle); background: var(--surface-subtle); display: flex; align-items: center; gap: 14px; padding: 0 22px; }
footer.bar .view-sel { margin: 0; }
footer.bar .seg button { height: 44px; padding: 0 18px; font-size: 14px; }
.bar-info { white-space: nowrap; font-size: 12px; color: var(--text-muted); }
#btnOrder { margin-left: auto; }

/* Filamentwahl */
.picker { position: fixed; z-index: 100; width: 340px; max-height: 440px; display: flex; flex-direction: column; background: var(--surface-card); border-radius: 10px; box-shadow: 0 24px 56px -16px rgba(11,17,35,.42), 0 0 0 1px rgba(16,26,51,.06); }
.picker-head { display: grid; grid-template-columns: 1fr 130px; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border-subtle); }
.picker-head input, .picker-head select { height: 34px; font-size: 13px; }
.picker-list { overflow: auto; padding: 6px 10px 10px; }
.picker-list h4 { font: 700 11px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin: 10px 0 6px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.pf { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; font: 12px var(--font-body); color: var(--text-body); }
.pf:hover { background: var(--surface-accent-soft); }
.pf.on { background: var(--surface-accent-soft); box-shadow: inset 0 0 0 1px var(--blue-500); }
.pf .sw { width: 22px; height: 22px; flex-basis: 22px; }

.dlg { border: 0; border-radius: 10px; padding: 26px; max-width: 520px; box-shadow: 0 24px 56px -16px rgba(11,17,35,.42); }
.dlg::backdrop { background: rgba(11,17,35,.55); backdrop-filter: blur(2px); }
.dlg ol { padding-left: 20px; line-height: 1.6; }

/* Kleine Bildschirme: Karte oben, Bedienfeld darunter */
@media (max-width: 900px) {
  .main { flex-direction: column; }
  .stage { flex: 0 0 46vh; order: -1; }
  .panel { width: auto; flex: 1; border-right: 0; border-top: 1px solid var(--border-subtle); }
  footer.bar { height: auto; padding: 10px; flex-wrap: wrap; gap: 8px; }
  .btn.big { height: 46px; padding: 0 14px; font-size: 14px; flex: 1; }
  .bar-info, .top-phone { display: none; }
  #btnOrder { margin-left: 0; }
}

[hidden] { display: none !important; }
