/* ExposION – Dark Theme */
:root {
	--bg: #0d0f12;
	--panel: #15181d;
	--panel-2: #1b1f26;
	--line: #262b33;
	--text: #e6e8eb;
	--muted: #8b939e;
	--accent: #f5b942;
	--accent-2: #ffd27a;
	--ok: #3ccf7a;
	--warn: #f2c94c;
	--bad: #ff5a5f;
	--radius: 10px;
	--font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
	--mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--font); }
body { display: flex; flex-direction: column; overflow: hidden; }
button, select, input { font: inherit; color: inherit; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 20px; padding: 8px 16px; background: #0a0b0e; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.brand svg { width: 34px; height: 34px; }
.brand strong { display: block; font-size: 19px; letter-spacing: 0.5px; color: var(--text); }
.brand strong span { color: var(--accent); }
.brand small { display: block; color: var(--muted); font-size: 11.5px; margin-top: -2px; }
.topinfo { flex: 1; color: var(--muted); font-size: 13px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topctl { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.topctl select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; margin-left: 6px; }
.ver { font-family: var(--mono); font-size: 11px; opacity: 0.7; }

/* Grundaufteilung */
.layout { flex: 1 1 auto; display: grid; grid-template-columns: 310px minmax(0, 1fr) 340px; min-height: 0; }
.panel { overflow-y: auto; background: var(--panel); padding: 10px 12px 24px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); }
.group { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.group h2 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ctrl .row { display: flex; align-items: baseline; gap: 8px; }
.ctrl h3 { margin: 0; font-size: 13.5px; font-weight: 600; flex: 1; }
.ctrl output { font-family: var(--mono); font-size: 15px; color: var(--accent-2); }
.ctrl.sub { margin-top: 10px; }
.auto { display: none; font-size: 10px; letter-spacing: 1px; padding: 1px 5px; border-radius: 4px; background: #2a3442; color: #9cc2ff; }
.ctrl.is-auto .auto { display: inline-block; }
.ctrl.is-auto input[type=range] { opacity: 0.55; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; min-height: 1.4em; }
.fx { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.fx li { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.fx li b { color: var(--text); font-weight: 500; text-align: right; }
.fx li.warn b { color: var(--warn); }
.fx li.bad b { color: var(--bad); }

/* Schieberegler */
input[type=range] { width: 100%; margin: 8px 0 2px; accent-color: var(--accent); height: 22px; background: transparent; -webkit-appearance: none; appearance: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, #3a3f48, #555c66); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); margin-top: -6px; border: 2px solid #1a1a1a; box-shadow: 0 0 0 1px var(--accent); }
input[type=range]::-moz-range-track { height: 4px; background: #474d56; border-radius: 2px; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #1a1a1a; }

/* Segmentschalter und Schalter */
.seg { display: flex; background: #111419; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 4px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button:hover { color: var(--text); background: #1d222a; }
.seg button.on { background: var(--accent); color: #1a1405; }
#modeSeg button { font-family: var(--mono); font-size: 16px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tg { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 20px; background: #111419; user-select: none; }
.tg input { accent-color: var(--accent); margin: 0; }
.tg.block { margin-top: 8px; }
.mini { border: 1px solid var(--line); background: #111419; border-radius: 6px; padding: 1px 8px; font-size: 12px; cursor: pointer; color: var(--muted); }
.mini:hover { color: var(--text); border-color: var(--accent); }
.phase { margin-top: 4px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.phase b { color: var(--accent-2); font-weight: 600; }
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.wgrid button { border: 1px solid var(--line); background: #111419; border-radius: 7px; padding: 6px 6px; cursor: pointer; text-align: left; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.wgrid button:hover { color: var(--text); }
.wgrid button.on { border-color: var(--accent); color: var(--text); background: #221d12; }
.wgrid i { font-style: normal; font-size: 15px; width: 18px; text-align: center; }

/* Livebild */
.stagearea { display: flex; align-items: center; justify-content: center; padding: 14px; min-width: 0; min-height: 0; background: radial-gradient(ellipse at center, #15181d 0%, #0b0c0f 70%); }
.viewport { position: relative; background: #000; box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px #2a2f37; border-radius: 4px; overflow: hidden; }
.viewport canvas { display: block; width: 100%; height: 100%; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 8px 12px; font: 12px var(--mono); color: #fff; text-shadow: 0 1px 3px #000; pointer-events: none; background: linear-gradient(#0008, transparent); }
.live { color: #ff6b6b; }
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 18px; align-items: center; justify-content: center; padding: 8px 12px; font: 600 15px var(--mono); color: #fff; background: linear-gradient(transparent, #000c); text-shadow: 0 1px 2px #000; pointer-events: none; }
.hud-bottom .hm { background: #fff; color: #000; padding: 0 6px; border-radius: 3px; }
.hscale { display: inline-block; width: 180px; height: 20px; }
.af { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 2px solid rgba(120,255,140,0.9); border-radius: 3px; pointer-events: none; box-shadow: 0 0 0 1px #0006; transition: left 0.08s, top 0.08s; }
.af::after { content: ""; position: absolute; inset: 40%; border: 1px solid rgba(120,255,140,0.9); }
.warns { position: absolute; top: 34px; right: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.warns span { background: #000b; border: 1px solid; border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.warns .w { color: var(--warn); border-color: var(--warn); }
.warns .b { color: var(--bad); border-color: var(--bad); }
.toast { position: absolute; left: 50%; top: 40px; transform: translate(-50%, -10px); background: #000d; border: 1px solid var(--accent); color: var(--text); padding: 6px 12px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0b0c0f; color: var(--muted); gap: 12px; }
.loading.hide { display: none; }
.spin { width: 38px; height: 38px; border: 3px solid #333; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dreieck */
.triangle { width: 100%; display: block; color: var(--ok); transition: color 0.3s; }
.triangle.y { color: var(--warn); }
.triangle.r { color: var(--bad); }
.triangle .axis { stroke: currentColor; stroke-opacity: 0.25; stroke-dasharray: 3 4; }
.triangle #triDot { fill: currentColor; stroke: #000; stroke-width: 2; transition: cx 0.2s, cy 0.2s; }
.triangle .cn { fill: var(--muted); font-size: 11px; letter-spacing: 1.5px; font-weight: 600; }
.triangle .cv { fill: var(--text); font: 600 15px var(--mono); }
.triangle .tri-ev { fill: currentColor; font: 700 22px var(--mono); }
.triangle .tri-side { fill: var(--muted); font-size: 10px; opacity: 0.8; }
.tri-legend { display: flex; justify-content: center; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.tri-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.tri-legend .g::before { background: var(--ok); }
.tri-legend .y::before { background: var(--warn); }
.tri-legend .r::before { background: var(--bad); }

/* Belichtungsmesser */
.meter { width: 100%; display: block; }
.meter text { font: 11px var(--mono); fill: var(--muted); }
.evrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; text-align: center; }
.evrow small { display: block; color: var(--muted); font-size: 11px; }
.evrow b { font: 600 15px var(--mono); }

/* Histogramm */
.histo { width: 100%; height: 110px; display: block; background: #0b0d10; border-radius: 6px; border: 1px solid var(--line); }
.clip { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.clip .hot { color: var(--bad); }

/* Vorschläge und Werte */
#suggest p { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips button { border: 1px solid var(--accent); background: #221d12; color: var(--accent-2); padding: 4px 9px; border-radius: 14px; cursor: pointer; font-size: 12.5px; }
.chips button:hover { background: var(--accent); color: #1a1405; }
.calc { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0; font-size: 12.5px; }
.calc dt { color: var(--muted); }
.calc dd { margin: 0; text-align: right; font-family: var(--mono); }
.calc .sep { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 4px 0; }

/* Mittlere Bildschirme: rechte Spalte unter das Bild */
@media (max-width: 1250px) {
	.layout { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
	.panel.right { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); max-height: 42vh; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; align-content: start; }
	.panel.right .group { margin: 0; }
	.panel.left { grid-row: 1 / span 2; }
}
/* Telefon */
@media (max-width: 760px) {
	body { overflow: auto; }
	.topbar { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
	.topinfo { order: 3; flex-basis: 100%; text-align: left; }
	.layout { display: flex; flex-direction: column; }
	.stagearea { order: -1; padding: 8px 0; position: sticky; top: 0; z-index: 5; background: #0b0c0f; }
	.panel { overflow: visible; padding: 10px 16px; }
	.panel.right { max-height: none; display: block; }
	.panel.right .group { margin-bottom: 10px; }
	.hud-bottom { font-size: 12px; gap: 10px; }
	.hscale { width: 110px; }
}

/* 1.1.0: Zurücksetzen, Fokuspunkt, Dreieck ziehen */
.reset { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.reset:hover { border-color: var(--accent); color: var(--accent-2); }
.viewport canvas { cursor: crosshair; }
.af.manual { border-color: rgba(255,210,122,0.95); }
.af.manual::after { border-color: rgba(255,210,122,0.95); }
.triangle #triDot { cursor: grab; }
.triangle.dragging #triDot { cursor: grabbing; }
.triangle .tri-focal { fill: var(--text); font: 600 13px var(--mono); opacity: 0.85; }
#afReset { margin-top: 4px; }
.meter { cursor: ew-resize; touch-action: none; }
.triangle { touch-action: none; }

/* Impressum und Datenschutz */
.legal-link { border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }
.legal-link:hover { color: var(--accent-2); }
dialog.legal { width: min(920px, calc(100vw - 32px)); height: min(85vh, 900px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,0.7); overflow: hidden; }
dialog.legal[open] { display: flex; flex-direction: column; }
dialog.legal::backdrop { background: rgba(0,0,0,0.65); backdrop-filter: blur(3px); }
.legal-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.legal-head .seg { flex: 0 1 320px; }
.legal-head .legal-close { margin-left: auto; }
.legal-close { border: 1px solid var(--line); background: #111419; color: var(--text); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.legal-close:hover { border-color: var(--accent); color: var(--accent-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 760px) { .legal-head { flex-wrap: wrap; } .legal-head .seg { flex-basis: 100%; order: 3; } }

.info-btn { border: 1px solid var(--accent); background: #221d12; color: var(--accent-2); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.info-btn:hover { background: var(--accent); color: #1a1405; }
.legal-body { flex: 1; overflow-y: auto; padding: 18px 26px 28px; line-height: 1.6; font-size: 14.5px; scrollbar-width: thin; }
.legal-body h1 { font-size: 24px; margin: 4px 0 12px; color: var(--accent-2); }
.legal-body h2 { font-size: 17px; margin: 22px 0 6px; color: var(--text); }
.legal-body h3 { font-size: 15px; margin: 16px 0 4px; color: var(--text); }
.legal-body p, .legal-body li { color: #cfd3d8; }
.legal-body ul, .legal-body ol { padding-left: 22px; }
.legal-body li { margin: 3px 0; }
.legal-body a { color: var(--accent-2); }
.legal-body img { max-width: 100%; height: auto; background: #fff; border-radius: 6px; padding: 6px; }
.legal-body hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.legal-body .lead { font-size: 15.5px; color: var(--text); }
.legal-body .small { font-size: 12.5px; color: var(--muted); margin-top: 22px; }
.legal-body table { border-collapse: collapse; width: 100%; }
.legal-body td, .legal-body th { border: 1px solid var(--line); padding: 4px 8px; }
@media (max-width: 760px) { .legal-body { padding: 14px 16px 24px; } }

/* 1.8.0: Auslöser und Fokusbestätigung */
.af { border-color: rgba(255,255,255,0.85); }
.af::after { border-color: rgba(255,255,255,0.85); }
.af.busy, .af.busy::after { border-color: #ffd23f; }
.af.busy { animation: afpulse 0.35s ease-in-out infinite alternate; }
.af.ok, .af.ok::after { border-color: #3cff6e; }
.af.ok { box-shadow: 0 0 0 1px #0006, 0 0 10px rgba(60,255,110,0.55); }
@keyframes afpulse { from { transform: scale(1); } to { transform: scale(0.9); } }
.shutter { position: absolute; right: 16px; bottom: 54px; width: 62px; height: 62px; border-radius: 50%; border: 3px solid #fff; background: rgba(0,0,0,0.35); cursor: pointer; padding: 0; touch-action: none; box-shadow: 0 2px 12px #0008; }
.shutter span { display: block; width: 44px; height: 44px; margin: auto; border-radius: 50%; background: #e8e8e8; transition: transform 0.08s, background 0.08s; }
.shutter:hover span { background: #fff; }
.shutter.half span { transform: scale(0.86); background: var(--accent); }
.flash { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 0.28s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.shot { position: absolute; left: 12px; bottom: 54px; width: 120px; border: 2px solid #fff; border-radius: 4px; overflow: hidden; background: #000; box-shadow: 0 2px 12px #0009; cursor: pointer; text-decoration: none; }
.shot img { display: block; width: 100%; }
.shot span { position: absolute; left: 0; right: 0; bottom: 0; background: #000b; color: #fff; font-size: 11.5px; text-align: center; padding: 2px; }
.shot:hover { border-color: var(--accent); }
@media (max-width: 760px) { .shutter { width: 50px; height: 50px; bottom: 44px; } .shutter span { width: 34px; height: 34px; } .shot { width: 80px; bottom: 44px; } }
