:root {
  --bg: rgba(12, 18, 27, .88); --bg2: rgba(255, 255, 255, .055); --line: rgba(255, 255, 255, .09);
  --tx: #e9eff6; --mut: #93a4b7; --dim: #62738a; --acc: #56c6ff; --acc2: #1f8fd6; --ok: #58c99a;
  --r: 14px; --sh: 0 12px 40px rgba(6, 12, 22, .38), 0 1px 0 rgba(255, 255, 255, .05) inset;
  font: 14px/1.42 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { color: var(--tx); background: linear-gradient(#6e9bc4 0%, #a9c3da 30%, #c9d6e2 52%, #c9d6e2 100%); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
kbd { font: 600 10.5px/1 ui-monospace, "SF Mono", Menlo, monospace; padding: 3px 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); color: var(--mut); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lb { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 600; font-size: 11.5px; color: #1d2836; letter-spacing: .01em;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px rgba(255, 255, 255, .9); will-change: transform; }
.lb.city { font-size: 14.5px; font-weight: 700; color: #111a26; }
.lb.town { font-size: 12.5px; }
.lb.vil { font-weight: 500; color: #2c3a4b; }
.lb.riv { font-style: italic; color: #0f4f8f; font-weight: 600; font-size: 12px; letter-spacing: .06em; }
.lb.sta { font-size: 10.5px; color: #064f66; text-transform: uppercase; letter-spacing: .06em; }
#pin { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
#pin::before { content: ""; position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px rgba(10, 20, 35, .75), 0 0 18px rgba(86, 198, 255, .9); animation: pin 1.6s ease-in-out infinite; }
@keyframes pin { 50% { transform: scale(1.25); opacity: .7; } }

.panel { position: fixed; background: var(--bg); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.panel header h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
.panel header p { margin: 5px 0 0; color: var(--mut); font-size: 12.5px; }
.hint { color: var(--dim); font-size: 11.5px; margin: 6px 0 0; }

/* ---------- bara de sus */
#top { position: fixed; left: 14px; top: 14px; right: 14px; display: flex; gap: 10px; align-items: center; pointer-events: none; z-index: 5; }
#top > * { pointer-events: auto; }
#proj { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px 0 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--sh); }
#proj i { width: 9px; height: 9px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
#proj b { font-weight: 650; letter-spacing: .01em; }
#proj span { color: var(--mut); font-size: 11.5px; }
#search { position: relative; display: flex; align-items: center; gap: 8px; height: 40px; width: min(380px, 44vw); padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--sh); }
#search svg { width: 16px; height: 16px; fill: none; stroke: var(--mut); stroke-width: 1.8; stroke-linecap: round; flex: none; }
#q { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 13.5px; }
#q::placeholder { color: var(--dim); }
#q::-webkit-search-cancel-button { display: none; }
#qres { position: absolute; left: 0; right: 0; top: 46px; margin: 0; padding: 6px; list-style: none; border-radius: 12px; background: rgba(12, 18, 27, .97); border: 1px solid var(--line); box-shadow: var(--sh); }
#qres li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
#qres li.on, #qres li:hover { background: rgba(86, 198, 255, .14); }
#qres span { color: var(--mut); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mob { display: none; margin-left: auto; gap: 6px; }
#mob button { height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--sh); }

/* ---------- scenariu */
#scn { left: 14px; top: 66px; bottom: 62px; width: 318px; padding: 16px 14px 14px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 0 4px; }
.chips button { padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); font-size: 12.5px; font-weight: 600; transition: .15s; }
.chips button:hover { border-color: rgba(86, 198, 255, .5); }
.chips button.on { background: linear-gradient(180deg, #2a9fe6, #1b79c2); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(31, 143, 214, .45); }
#live { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 0; padding: 9px 12px; border-radius: 12px; background: rgba(88, 201, 154, .12); border: 1px solid rgba(88, 201, 154, .3); font-size: 12.5px; }
#live span { display: block; color: var(--mut); font-size: 11.5px; }
.tor { margin: 14px 0 6px; padding: 11px 12px 9px; border-radius: 12px; background: var(--bg2); }
.tor-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.tor-h output { color: var(--acc); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 2px 0 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .16); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .16); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 5px rgba(0, 0, 0, .5); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 5px rgba(0, 0, 0, .5); }
.rv-head { display: grid; grid-template-columns: 1fr 64px 52px; gap: 6px; margin: 16px 2px 4px; color: var(--dim); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.rv-head span + span { text-align: right; padding-right: 8px; }
.rv { padding: 9px 0 7px; border-top: 1px solid var(--line); }
.rv-h { display: flex; align-items: baseline; gap: 7px; }
.rv-name { background: none; border: 0; padding: 0; font-weight: 650; font-size: 14px; }
.rv-name:hover { color: var(--acc); }
.rv-ref { color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.rv-c { display: flex; align-items: center; gap: 6px; }
.rv-c input.h { width: 52px; }
.rv-c input[type=number] { width: 64px; flex: none; height: 28px; padding: 0 8px; text-align: right; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25);
  font: 600 12.5px/1 ui-monospace, "SF Mono", Menlo, monospace; -moz-appearance: textfield; outline: 0; }
.rv-c input[type=number]:focus { border-color: var(--acc); }
.rv-c input::-webkit-outer-spin-button, .rv-c input::-webkit-inner-spin-button { -webkit-appearance: none; }
.rv.wet input[type=range]::-webkit-slider-thumb { background: #ffd166; }
.rv-link { background: none; border: 0; padding: 0; margin-top: 1px; font-size: 11px; color: var(--dim); }
.rv-link.on { color: var(--ok); }
.rv-link:hover { color: var(--tx); }
.rv.follow .rv-c { opacity: .62; }
.adv { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mut); }
.adv summary { cursor: pointer; color: var(--tx); font-weight: 600; list-style: none; }
.adv summary::before { content: "▸ "; color: var(--dim); }
.adv[open] summary::before { content: "▾ "; }
.adv label { display: block; margin-top: 10px; }
.adv label output { float: right; color: var(--tx); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.adv .chk { display: flex; gap: 8px; align-items: flex-start; }
.adv .chk input { margin: 2px 0 0; accent-color: var(--acc2); }

.dkb .chk { display: flex; gap: 8px; align-items: flex-start; margin-top: 9px; font-size: 12.5px; color: var(--mut); }
.dkb .chk input { margin: 2px 0 0; accent-color: var(--acc2); }
.dkoff { display: block; margin-top: 9px; font-size: 12.5px; color: var(--mut); }
.dkoff output { float: right; color: var(--tx); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin-top: 8px; border-radius: 10px; background: rgba(0, 0, 0, .28); }
.seg button { padding: 6px 4px; border: 0; border-radius: 8px; background: none; font-size: 12.5px; color: var(--mut); }
.seg button.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }
.protline { display: block; width: 100%; margin: -4px 0 10px; padding: 7px 10px; border-radius: 10px; border: 1px solid rgba(88, 201, 154, .3); background: rgba(88, 201, 154, .12); color: #9fe3c4; font-size: 12px; font-weight: 600; text-align: left; }
.protline:hover { background: rgba(88, 201, 154, .2); }
.lb.dik { font-size: 10.5px; color: #3c4f1f; font-weight: 700; letter-spacing: .02em; }
.lb.km { font-size: 10px; color: #4a5a2c; font-weight: 600; }
.mk.l { width: 14px; height: 5px; border: 0; border-radius: 2px; vertical-align: middle; }
.btn.sm { padding: 2px 8px; margin-left: 6px; font-size: 11px; }
.dkp .dg { fill: rgba(190, 160, 110, .30); stroke: #cdb88c; stroke-width: 1; }
.dkp .dc { fill: none; stroke: #9bd16a; stroke-width: 1.8; }
.dkp .dw { fill: none; stroke: #6cc4ff; stroke-width: 1.6; }
.lg { display: inline-block; width: 12px; height: 3px; margin: 0 4px 2px 8px; border-radius: 2px; vertical-align: middle; }
.lg:first-child { margin-left: 0; }
.lg.c { background: #9bd16a; } .lg.w { background: #6cc4ff; } .lg.g { background: #cdb88c; }
dd > div + div { margin-top: 5px; }

/* ---------- efecte */
#fx { right: 14px; top: 14px; bottom: 62px; width: 336px; padding: 16px 14px 0 16px; display: flex; flex-direction: column; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 12px; }
.kpi { padding: 11px 12px 10px; border-radius: 12px; background: var(--bg2); border: 1px solid transparent; min-height: 84px; }
.kpi b { display: block; font: 700 27px/1.05 "SF Pro Display", -apple-system, "Inter", "Segoe UI", sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #ffd98a; }
.kpi span { display: block; margin-top: 3px; font-size: 12px; color: var(--tx); }
.kpi small { display: block; margin-top: 2px; font-size: 11px; color: var(--mut); min-height: 14px; }
.kpi.zero b { color: var(--dim); }
#kB { background: linear-gradient(160deg, rgba(240, 130, 50, .2), rgba(255, 255, 255, .05)); border-color: rgba(240, 150, 60, .25); }
#kB.zero { background: var(--bg2); border-color: transparent; }
.depthbar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, .08); gap: 1px; }
.depthbar i { min-width: 2px; }
.dlegend { display: flex; flex-wrap: wrap; gap: 4px 11px; margin: 7px 0 12px; font-size: 11px; color: var(--mut); }
.dlegend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .28); }
.tabs button { flex: 1; padding: 6px 1px; border: 0; border-radius: 8px; background: none; font-size: 11.5px; letter-spacing: -.01em; color: var(--mut); }
.tabs button.on { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.list { flex: 1; min-height: 0; overflow-y: auto; margin: 8px -6px 0; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.li { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "a c" "b c"; column-gap: 10px; width: 100%; padding: 8px 8px 9px; border: 0; border-radius: 9px; background: none; text-align: left; }
button.li:hover { background: rgba(255, 255, 255, .07); }
.li-a { grid-area: a; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-b { grid-area: b; font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-c { grid-area: c; align-self: center; font: 600 13.5px/1 ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.li-c em { font-style: normal; }
.li-bar { position: absolute; left: 8px; bottom: 3px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, #f5c542, #f0762f); max-width: calc(100% - 16px); }
.empty { color: var(--mut); padding: 18px 8px; font-size: 12.5px; }
.sub { margin: 14px 8px 4px; color: var(--dim); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
#fx footer { padding: 9px 0 11px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- fișa obiectului */
#card { right: 364px; bottom: 62px; width: 344px; max-height: min(70vh, 640px); overflow-y: auto; padding: 16px 16px 12px; z-index: 4; }
#card h3, .mo-card h3 { margin: 0 26px 2px 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.005em; }
.where { margin: 0 0 10px; color: var(--mut); font-size: 12px; }
.x { position: absolute; right: 9px; top: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--mut); }
.x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.badge { display: inline-block; margin-bottom: 10px; padding: 5px 10px; border-radius: 8px; font-weight: 650; font-size: 12.5px; color: #10151d; background: var(--c); }
.badge.dry { background: rgba(88, 201, 154, .16); color: var(--ok); }
dl { display: grid; grid-template-columns: 104px 1fr; gap: 7px 10px; margin: 0; font-size: 12.5px; }
dt { color: var(--mut); }
dd { margin: 0; min-width: 0; }
dd small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 1px; }
dd.links { display: flex; gap: 14px; }
.btn { padding: 6px 11px; border-radius: 8px; border: 1px solid rgba(86, 198, 255, .4); background: rgba(86, 198, 255, .12); font-weight: 600; font-size: 12px; }
.btn:hover { background: rgba(86, 198, 255, .24); }
.inp input { width: 82px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); outline: 0; text-align: right;
  font: 600 12.5px/1 ui-monospace, "SF Mono", Menlo, monospace; }
.rc { width: 100%; height: auto; display: block; margin-top: 2px; }
.rc .ax, .prof .gr { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1; }
.rc .cv { fill: none; stroke: var(--acc); stroke-width: 2; }
.rc .pt { fill: #ffd166; stroke: #10151d; stroke-width: 1.5; }
.tk { fill: var(--mut); font: 10px ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- unelte, stare */
#tools { position: fixed; left: 14px; bottom: 14px; display: flex; gap: 6px; align-items: center; z-index: 4; }
#tools > button, .exag { height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--sh); font-weight: 600; font-size: 12.5px; }
#tools > button:hover { border-color: rgba(86, 198, 255, .5); }
#tools > button.on { background: var(--acc2); border-color: transparent; }
.exag { display: flex; align-items: center; gap: 7px; font-weight: 500; color: var(--mut); white-space: nowrap; }
.exag output { color: var(--tx); font-family: ui-monospace, "SF Mono", Menlo, monospace; min-width: 22px; }
.exag input { width: 84px; margin: 0; }
#layers { position: absolute; left: 0; bottom: 46px; width: 270px; padding: 12px 14px; border-radius: 13px; background: rgba(12, 18, 27, .96); border: 1px solid var(--line); box-shadow: var(--sh); }
#layers label { display: flex; gap: 9px; align-items: center; padding: 4px 0; font-size: 13px; }
#layers input { accent-color: var(--acc2); margin: 0; }
.legend { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; font-size: 11.5px; color: var(--mut); }
.legend b { grid-column: 1 / -1; color: var(--dim); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.mk { display: inline-block; width: 10px; height: 10px; margin-right: 7px; background: #5a6fd6; border: 1.5px solid #fff; }
.mk.c { border-radius: 50%; }
.mk.d { transform: rotate(45deg) scale(.85); background: #38424f; }
.mk.t { clip-path: polygon(50% 100%, 0 0, 100% 0); border: 0; background: #b08e62; }
.mk.s { background: #0d99bf; }
#status { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 14px; height: 30px; align-items: center; padding: 0 14px; border-radius: 10px;
  background: rgba(12, 18, 27, .78); border: 1px solid var(--line); font: 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; color: #c7d3e0; white-space: nowrap; pointer-events: none; z-index: 3; max-width: calc(100vw - 720px); overflow: hidden; }
#status .wet { color: #8fd8ff; font-weight: 700; }
#toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); padding: 9px 16px; border-radius: 11px; background: var(--acc2); color: #fff; font-weight: 600; box-shadow: var(--sh); z-index: 6; }

/* ---------- ferestre */
#modal, #spot { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(6, 10, 16, .55); backdrop-filter: blur(3px); z-index: 20; padding: 16px; }
.mo-card { position: relative; width: min(940px, 100%); max-height: 92vh; overflow: auto; padding: 20px 22px 16px; border-radius: 16px; background: rgba(13, 19, 28, .97); border: 1px solid var(--line); box-shadow: var(--sh); }
.prof { width: 100%; height: auto; display: block; margin-top: 6px; }
.prof .pg { fill: rgba(190, 160, 110, .32); }
.prof .pl { fill: none; stroke: #e6d2a8; stroke-width: 1.8; stroke-linejoin: round; }
.prof .pw { fill: rgba(70, 170, 240, .55); stroke: #7fd0ff; stroke-width: 1; }
.sp-card { width: min(460px, 100%); padding: 14px; border-radius: 16px; background: rgba(13, 19, 28, .97); border: 1px solid var(--line); box-shadow: var(--sh); }
.sp-card h3 { margin: 4px 8px 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.sp-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 11px; align-items: center; padding: 10px; border-radius: 10px; color: var(--tx); }
.sp-row:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.sp-row.cur { background: rgba(86, 198, 255, .13); }
.sp-row i { width: 10px; height: 10px; border-radius: 50%; }
.sp-row span { color: var(--dim); font: 11.5px ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- încărcare */
#load { position: fixed; inset: 0; display: grid; place-items: center; background: #0b1119; z-index: 50; transition: opacity .6s; }
#load.done { opacity: 0; pointer-events: none; }
.ld { text-align: center; }
.ld h1 { margin: 0; font: 700 34px/1.1 "SF Pro Display", -apple-system, "Inter", "Segoe UI", sans-serif; letter-spacing: -.02em; }
.ld h1 b { color: var(--acc); font-weight: 700; }
.ld p { color: var(--mut); margin: 10px 0 18px; }
.ld i { display: block; width: 180px; height: 3px; margin: 0 auto; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; position: relative; }
.ld i::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 2px; background: var(--acc); animation: ld 1.1s ease-in-out infinite; }
#load.err .ld i { display: none; }
#load.err .ld p { color: #ff9a8a; max-width: 440px; }
@keyframes ld { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- ecrane înguste */
@media (max-width: 1180px) { #status { display: none; } #card { right: 14px; bottom: auto; top: 66px; z-index: 7; } }
@media (max-width: 860px) {
  #mob { display: flex; }
  #search { flex: 1; width: auto; }
  #search kbd, #proj kbd, #proj span { display: none; }
  #scn, #fx { left: 8px; right: 8px; width: auto; top: auto; bottom: 60px; max-height: 62vh; display: none; z-index: 8; }
  body.show-scn #scn { display: block; }
  body.show-fx #fx { display: flex; height: 62vh; }
  #card { left: 8px; right: 8px; width: auto; top: 62px; max-height: 46vh; }
  .exag { display: none; }
  #top { left: 8px; right: 8px; top: 8px; }
  #tools { left: 8px; bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
