:root {
  --bg: #121417;
  --glass: rgba(22, 24, 28, 0.62);
  --glass-strong: rgba(20, 22, 26, 0.86);
  --line: rgba(255, 255, 255, 0.10);
  --text: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.64);
  --accent: #c8a46a;
  --accent-2: #e2c48f;
  --radius: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28); }
.hidden, [hidden] { display: none !important; }

/* ---------------- ekran startowy */
.loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(120% 90% at 50% 0%, #2a2c30 0%, #141619 55%, #0c0d0f 100%); transition: opacity .8s ease, visibility .8s; }
.loader.gone { opacity: 0; visibility: hidden; }
.loader-card { width: min(520px, 100%); text-align: center; }
.brand-mark { width: 64px; height: 64px; margin: 0 auto 18px; color: var(--accent); }
.brand-mark svg { width: 64px; height: 64px; stroke-width: 2.4; }
.eyebrow { letter-spacing: .28em; text-transform: uppercase; font-size: 11px; color: var(--accent-2); margin: 0 0 8px; }
.loader h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 9vw, 68px); letter-spacing: .01em; margin: 0; line-height: 1.02; }
.lead { color: var(--muted); margin: 10px 0 26px; font-size: 15px; }
.facts { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.facts li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; font-size: 13px; color: var(--muted); }
.facts b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--text); }
.facts b small { font-size: 13px; color: var(--muted); font-family: var(--sans); }
.facts li > span { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.progress { height: 3px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; margin: 0 auto 10px; width: 70%; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
.status { font-size: 12px; color: var(--muted); margin: 0 0 20px; min-height: 16px; }
.loader.done .progress, .loader.done .status { opacity: .35; }
.ver-line { margin: 18px 0 0; font-size: 11.5px; letter-spacing: .1em; color: var(--muted); font-variant-numeric: tabular-nums; }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.ios-hint { margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 22px; font-weight: 600; font-size: 14px; letter-spacing: .02em; transition: transform .15s ease, background .2s, opacity .2s; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1b1814; box-shadow: 0 8px 24px rgba(200, 164, 106, .25); }
.btn.primary:disabled { opacity: .35; cursor: default; }
.btn.primary:not(:disabled):active { transform: scale(.97); }
.btn.ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, .04); padding: 9px 14px; font-weight: 500; font-size: 13px; }
.btn.ghost:hover { background: rgba(255, 255, 255, .09); }
a.btn { color: inherit; text-decoration: none; }   /* odnośniki w stylu przycisku (np. „Otwórz Konto”) */
a.btn.primary { color: #1b1814; }

/* ---------------- instalacja aplikacji */
.install-tile { display: flex; align-items: center; gap: 12px; margin: 22px auto 0; max-width: 470px; padding: 12px; text-align: left;
  border: 1px solid rgba(200, 164, 106, .32); border-radius: 18px; background: linear-gradient(180deg, rgba(200, 164, 106, .10), rgba(255, 255, 255, .03)); }
.install-tile img { width: 52px; height: 52px; border-radius: 12px; flex: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.it-text { flex: 1; min-width: 0; }
.it-text b { display: block; font-size: 14px; font-weight: 600; }
.it-text span { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.btn.small { padding: 8px 14px; font-size: 13px; flex: none; }
.install-x { flex: none; margin-left: -4px; }
.install-tile.in-panel { margin: 0; max-width: none; }
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; padding: 12px; padding-bottom: calc(12px + var(--sab));
  background: rgba(6, 7, 9, .5); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-card { width: min(520px, 100%); padding: 18px 20px 16px; background: var(--glass-strong); transform: translateY(24px); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.sheet.open .sheet-card { transform: none; }
.sheet header { display: flex; align-items: center; gap: 14px; }
.sheet header img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
.sheet h2 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin: 0 0 2px; }
.sheet header .note { margin: 0; }
.sheet header .close { margin-left: auto; align-self: flex-start; }
.steps { list-style: none; margin: 14px 0 6px; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px;
  background: rgba(200, 164, 106, .2); color: var(--accent-2); font-size: 12px; font-weight: 600; }
.steps svg.inline { width: 18px; height: 18px; vertical-align: -4px; stroke: var(--accent-2); margin: 0 1px; }
@media (min-width: 761px) { .sheet { place-items: center; } }
@media (max-width: 520px) {
  .install-tile { display: grid; grid-template-columns: 52px 1fr auto; grid-template-areas: "img text x" "img go x"; column-gap: 12px; row-gap: 10px; align-items: start; }
  .install-tile img { grid-area: img; }
  .install-tile .it-text { grid-area: text; }
  .install-tile .install-go { grid-area: go; justify-self: start; }
  .install-tile .install-x { grid-area: x; margin: -6px -6px 0 0; }
}
body.standalone #installTileLoader { display: none; }

/* ---------------- HUD */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }
.top { position: absolute; top: calc(12px + var(--sat)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { padding: 10px 14px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(200, 164, 106, .18); }
.brand strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: 11.5px; }
.brand-title { display: flex; align-items: center; gap: 8px; }
.ver-chip { font-size: 10.5px; line-height: 1; letter-spacing: .04em; color: var(--accent-2); padding: 3px 7px; border: 1px solid rgba(200, 164, 106, .35);
  border-radius: 999px; font-variant-numeric: tabular-nums; transition: background .2s; }
.ver-chip:hover { background: rgba(200, 164, 106, .14); }
.modes { margin-left: auto; display: flex; padding: 4px; gap: 2px; border-radius: 999px; }
.modes button { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.modes button.on { background: rgba(255, 255, 255, .92); color: #17191c; }
.tools { display: flex; gap: 2px; padding: 4px; border-radius: 999px; }
.icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.icon:hover { background: rgba(255, 255, 255, .1); }
.icon.small { width: 30px; height: 30px; }
.icon.small svg { width: 16px; height: 16px; }

.map { position: absolute; left: calc(12px + var(--sal)); bottom: calc(12px + var(--sab)); width: 232px; padding: 10px; transition: width .35s ease; }
.map canvas { display: block; width: 100%; height: 200px; border-radius: 10px; background: rgba(255, 255, 255, .03); cursor: crosshair; transition: height .35s ease; }
.map.big { width: min(520px, calc(100vw - 24px)); }
.map.big canvas { height: min(560px, calc(100vh - 220px)); }
.map-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.chip { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); padding: 3px 8px; border: 1px solid rgba(200, 164, 106, .35); border-radius: 999px; }
.map-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 0 2px; }
.map-foot strong { font-family: var(--serif); font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-foot span { color: var(--muted); font-size: 12px; white-space: nowrap; }

.bottom { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--sab)); display: flex; gap: 10px; align-items: center; }
.levels { display: flex; padding: 4px; gap: 2px; border-radius: 999px; }
.levels button { padding: 9px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.levels button.on { background: rgba(200, 164, 106, .22); color: var(--text); box-shadow: inset 0 0 0 1px rgba(200, 164, 106, .5); }
.levels button:disabled { opacity: .3; }
.actions { display: flex; align-items: center; padding: 4px; gap: 2px; border-radius: 999px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.pill svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.pill.on { background: var(--accent); color: #1b1814; }
#timeIcon.moon circle { fill: currentColor; }

.fov { position: absolute; right: calc(12px + var(--sar)); bottom: calc(12px + var(--sab)); width: 230px; padding: 12px 14px; }
.fov label, .field label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.fov label b, .field label b { color: var(--text); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: rgba(255, 255, 255, .18); border-radius: 3px; }
input[type=range]::-moz-range-track { height: 3px; background: rgba(255, 255, 255, .18); border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-2); margin-top: -7.5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent-2); border: 0; }
body[data-mode="orbit"] .fov, body[data-mode="plan"] .fov { display: none; }

.joystick { display: none; position: absolute; left: calc(26px + var(--sal)); bottom: calc(86px + var(--sab)); width: 124px; height: 124px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .22); touch-action: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.joystick .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); transition: transform .08s linear; }
body.touch[data-mode="walk"] .joystick { display: block; }

.hint { position: absolute; left: 50%; top: calc(76px + var(--sat)); transform: translate(-50%, -8px); max-width: min(680px, calc(100vw - 32px)); padding: 10px 16px; font-size: 12.5px; color: var(--text); text-align: center; opacity: 0; transition: opacity .5s, transform .5s; pointer-events: none; }
.hint.show { opacity: 1; transform: translate(-50%, 0); }
.toast { position: absolute; left: 50%; top: 42%; transform: translate(-50%, 10px); padding: 10px 16px; font-size: 13px; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* ---------------- wymiary (nakładka SVG nad sceną, pod panelami HUD) */
.hud > .dims, .hud > .dim-labels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.dims path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dims .halo { stroke: rgba(8, 10, 12, .5); stroke-width: 4.4; }
.dims .line { stroke-width: 1.7; }
.dims .ext { stroke-width: 1; }
.dims .house { stroke: #f0d39b; }
.dims .plot, .dims .setback { stroke: #95d3ff; }
.dims .setback.line { stroke-dasharray: 7 5; }
.dim-label { position: absolute; left: 0; top: 0; padding: 2px 7px; border-radius: 7px; border: 1px solid; white-space: nowrap;
  font: 600 11.5px/1.35 var(--sans); letter-spacing: .01em; background: rgba(14, 16, 20, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dim-label.house { color: #f6e2b8; border-color: rgba(240, 211, 155, .55); }
.dim-label.plot, .dim-label.setback { color: #cdeaff; border-color: rgba(149, 211, 255, .5); }
.dim-label.setback { border-style: dashed; }
.dim-label.area { font-weight: 500; font-style: italic; }
.room-label .dim { color: #f0d39b; }
.room-label { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 10px;
  background: rgba(18, 20, 24, .72); border: 1px solid rgba(255, 255, 255, .14); color: var(--text); white-space: nowrap; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, opacity .2s; }
.room-label b { font-family: var(--serif); font-weight: 500; font-size: 13.5px; }
.room-label span { font-size: 10.5px; color: var(--muted); }
.room-label:hover { background: rgba(200, 164, 106, .85); color: #17191c; }
.room-label:hover span { color: #2c271f; }

.caption { position: absolute; left: 50%; bottom: calc(76px + var(--sab)); transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); padding: 16px 18px 14px; text-align: center; }
.cap-text { font-family: var(--serif); font-size: clamp(17px, 2.4vw, 22px); line-height: 1.3; margin-bottom: 10px; }
.cap-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 12px; }
.cap-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.cap-dots i.past { background: rgba(200, 164, 106, .55); }
.cap-dots i.on { background: var(--accent-2); width: 18px; border-radius: 6px; }
body.touring .map, body.touring .fov, body.touring .joystick, body.touring .levels { opacity: 0; pointer-events: none; }

.fader { position: fixed; inset: 0; background: #0b0c0e; opacity: 0; pointer-events: none; transition: opacity .45s ease; z-index: 40; }
.fader.on { opacity: 1; }

/* ---------------- panele */
.panel { position: fixed; z-index: 30; top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); bottom: calc(10px + var(--sab)); width: min(460px, calc(100vw - 20px)); display: flex; flex-direction: column;
  background: var(--glass-strong); transform: translateX(calc(100% + 30px)); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.panel.open { transform: none; }
.panel header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 20px; }
.panel h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0; }
.panel-body { overflow: auto; padding: 8px 20px 24px; -webkit-overflow-scrolling: touch; user-select: text; -webkit-user-select: text; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 2px 16px 10px 18px; overflow-x: auto; flex: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; line-height: 1.2; padding: 7px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: rgba(200, 164, 106, .5); background: rgba(200, 164, 106, .12); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 14px; }
.kpis div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; }
.kpis b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.kpis span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.lead-sm { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0 0 14px; }
.sum-plan { display: block; width: 100%; border-radius: 12px; background: rgba(255, 255, 255, .92); margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: rgba(255, 255, 255, .05); }
tfoot td { font-weight: 600; border-bottom: 0; }
table.spec th { width: 46%; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
table.spec tbody tr { cursor: default; }
.field { margin: 6px 0 18px; }
.lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; }
.seg button { flex: 1 1 auto; padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--muted); }
.seg button.on { background: rgba(255, 255, 255, .9); color: #17191c; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.toggle input { -webkit-appearance: none; appearance: none; width: 40px; height: 24px; border-radius: 12px; background: rgba(255, 255, 255, .18); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); }
.dims-info { display: none; padding: 2px 0 12px 52px; border-bottom: 1px solid var(--line); }
body.dims-on .dims-info { display: block; }
.dims-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.dims-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.dims-legend .lg { width: 18px; border-top: 2px solid; }
.dims-legend .lg.house { border-color: #f0d39b; }
.dims-legend .lg.plot { border-color: #95d3ff; }
.dims-legend .lg.setback { border-color: #95d3ff; border-top-style: dashed; }
.dims-info .note { margin: 0; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; font-size: 13.5px; margin: 6px 0 18px; }
.keys dt { color: var(--accent-2); font-weight: 600; }
.keys dd { margin: 0; color: var(--muted); }
.app-ver { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 0 2px; font-size: 14px; }
.app-ver b { color: var(--accent-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

/* ---------------- telefony */
@media (max-width: 760px) {
  .brand { display: none; }
  .modes { margin-left: 0; }
  .modes button { padding: 8px 11px; font-size: 12.5px; }
  .top { justify-content: space-between; }
  .map { left: auto; right: calc(10px + var(--sar)); top: calc(62px + var(--sat)); bottom: auto; width: 150px; padding: 8px; }
  .map canvas { height: 130px; }
  .map-foot strong { font-size: 13px; }
  .map-foot span { display: none; }
  .map.big { width: calc(100vw - 20px); }
  .map.big canvas { height: min(460px, calc(100vh - 260px)); }
  .fov { display: none; }
  .bottom { left: auto; right: calc(10px + var(--sar)); transform: none; flex-direction: column; align-items: flex-end; gap: 8px; }
  .levels button { padding: 8px 11px; font-size: 12.5px; }
  .caption { bottom: calc(16px + var(--sab)); }
  .hint { top: auto; bottom: calc(220px + var(--sab)); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .panel { left: calc(8px + var(--sal)); width: auto; }
}
@media (max-width: 760px) and (orientation: landscape) {
  .map { top: calc(10px + var(--sat)); right: auto; left: calc(10px + var(--sal)); }
  .top { left: auto; width: auto; }
}
@media (hover: none) { .icon:hover, .btn.ghost:hover, tbody tr:hover { background: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------- logowanie i konto */
body.auth { overflow-y: auto; -webkit-overflow-scrolling: touch; background: radial-gradient(120% 90% at 50% 0%, #2a2c30 0%, #141619 55%, #0c0d0f 100%) fixed; }
.login { min-height: 100%; display: grid; place-items: center; padding: calc(24px + var(--sat)) calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal)); }
.login-card { width: min(400px, 100%); padding: 30px 26px 20px; text-align: center; background: var(--glass-strong); }
.login-card h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 9vw, 44px); margin: 0; line-height: 1.05; }
.login-card .brand-mark { width: 56px; height: 56px; margin-bottom: 14px; }
.login-card .brand-mark svg { width: 56px; height: 56px; }
.login-card .lead { margin: 8px 0 22px; font-size: 14px; }
.login-card .toggle { border: 0; padding: 4px 0 2px; font-size: 13.5px; color: var(--muted); text-align: left; }
.login-card .note { margin: 14px 0 0; }
.login-card .ver-line { margin-top: 12px; }
.in { display: block; text-align: left; margin: 0 0 12px; }
.in span { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; }
.in input { display: block; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
  color: var(--text); font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text; transition: border-color .2s, background .2s; }
.in input:focus { outline: none; border-color: rgba(200, 164, 106, .7); background: rgba(255, 255, 255, .09); }
.btn.wide { width: 100%; margin-top: 4px; padding: 13px 22px; font-size: 15px; }
.form-msg { min-height: 0; margin: 0; font-size: 13px; line-height: 1.45; color: #f0b4a4; text-align: left; }
.form-msg.show { margin: 2px 0 12px; }
.form-msg.ok { color: #b8d9a8; }
.lang-switch { display: inline-flex; gap: 2px; margin-top: 14px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.lang-switch button { padding: 5px 12px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.lang-switch button.on { background: rgba(255, 255, 255, .9); color: #17191c; }
.panel h3 { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 12px; }
.who { display: flex; align-items: center; gap: 12px; padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 20px;
  color: #1b1814; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.who-text { flex: 1; min-width: 0; }
.who-text b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.who-text small { color: var(--muted); font-size: 12.5px; }
.form { margin: 0 0 22px; }
.form .btn.primary { padding: 10px 20px; }
.admin { border-top: 1px solid var(--line); padding-top: 18px; }
.admin > .note { margin: -4px 0 12px; }
.users { list-style: none; margin: 0 0 22px; padding: 0; }
.users > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.users-note { color: var(--muted); font-size: 13px; }
.u-head { display: flex; align-items: center; gap: 10px; }
.u-who { flex: 1; min-width: 0; }
.u-who b { font-size: 14.5px; margin-right: 6px; }
.u-who small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.badge { display: inline-block; font-size: 10.5px; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.badge.admin { color: var(--accent-2); border-color: rgba(200, 164, 106, .45); }
.badge.warn { color: #f0b4a4; border-color: rgba(240, 180, 164, .45); }
/* Konto Delta Eternal i pliki na serwerze */
.sso-box { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.sso-box .note { margin: 0 0 12px; }
#adminSecurity { margin-top: 4px; }
.sec-block { padding: 0 0 18px; }
.sec-block + .sec-block { border-top: 1px solid var(--line); padding-top: 14px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; }
.sec-block .note { margin: 0 0 10px; }
.sec-block .note.warn { color: #f0b4a4; }
.sec-block .row { display: flex; flex-wrap: wrap; gap: 8px; }
.junk-list { list-style: none; margin: 0 0 12px; padding: 0; }
.junk-list li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.junk-list code { display: block; color: var(--text); font-size: 12.5px; word-break: break-all; }
.junk-list small { color: var(--muted); }
.u-acts { display: flex; gap: 6px; flex: none; }
.btn.ghost.small { padding: 6px 11px; font-size: 12px; }
.btn.danger { color: #f0b4a4; }
.form.inline { margin: 12px 0 4px; }
@media (max-width: 420px) { .u-head { flex-wrap: wrap; } .u-acts { width: 100%; } }

/* ---------------- wersja projektu domu (przełącznik u góry) */
.versions { display: flex; align-items: center; padding: 4px; gap: 2px; border-radius: 999px; }
.versions .lbl { padding: 0 6px 0 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.versions button { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; transition: background .2s, color .2s; }
.versions button.on { background: var(--accent); color: #17191c; }
.versions button:not(.on):hover { background: rgba(255, 255, 255, .1); }
@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .versions .lbl { display: none; }
  .versions button { padding: 7px 10px; font-size: 12.5px; }
}
/* telefon w pionie: tryby i wersja w pierwszym rzędzie, narzędzia w drugim, minimapa pod nimi */
@media (max-width: 760px) and (orientation: portrait) {
  .versions { order: 2; }
  .tools { order: 3; }
  .map { top: calc(118px + var(--sat)); }
}

/* ---------------- busola: tarcza obraca się z widokiem, w środku odchylenie widoku od północy */
.compass { position: absolute; top: calc(66px + var(--sat)); right: calc(12px + var(--sar)); width: 92px; height: 92px; border-radius: 50%; padding: 0; }
.compass svg { display: block; width: 100%; height: 100%; stroke: none; }
.compass text { text-anchor: middle; font-family: inherit; }
.cp-ticks path { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1.6; stroke-linecap: round; }
.cp-card { fill: var(--muted); font-size: 12px; font-weight: 600; }
.cp-needle { fill: #ff5a4f; }
.cp-north { fill: #ff8f86; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; }
.cp-index { fill: #fff; }
.cp-deg { fill: var(--text); font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-dir { fill: var(--muted); font-size: 11.5px; }
@media (max-width: 760px) {
  .compass { top: calc(60px + var(--sat)); right: calc(10px + var(--sar)); width: 80px; height: 80px; }
}
/* telefon w pionie: po prawej jest minimapa, busola pod narzędziami po lewej */
@media (max-width: 760px) and (orientation: portrait) {
  .compass { top: calc(118px + var(--sat)); right: auto; left: calc(12px + var(--sal)); }
}
