/* =====================================================================
   Mapa do terreno — styles
   ===================================================================== */
:root {
  --bg: #f3f2ec;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --text: #1c2420;
  --muted: #69736d;
  --line: #e2e1d9;
  --line-2: #d3d2c8;
  --accent: #2f6f4f;
  --accent-2: #e6f0e9;
  --accent-text: #ffffff;
  --danger: #c0392b;
  --warn: #b7791f;
  --shadow-sm: 0 1px 2px rgba(20, 30, 25, .06), 0 1px 1px rgba(20, 30, 25, .04);
  --shadow: 0 8px 28px rgba(20, 30, 25, .14), 0 2px 6px rgba(20, 30, 25, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 56px;
  --sidebar-w: 310px;
  --panel-w: 400px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121714; --surface: #1a201c; --surface-2: #202722; --text: #e7ece8; --muted: #9aa59e;
    --line: #2b342e; --line-2: #3a453e; --accent: #5cc08b; --accent-2: #203a2b; --accent-text: #0c1a12;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121714; --surface: #1a201c; --surface-2: #202722; --text: #e7ece8; --muted: #9aa59e;
  --line: #2b342e; --line-2: #3a453e; --accent: #5cc08b; --accent-2: #203a2b; --accent-text: #0c1a12;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
kbd { font: 600 11px/1 var(--font); padding: 3px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
mark { background: #f6e27a; color: #000; border-radius: 2px; }
code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
svg.ic, .icon-btn svg, .btn svg, .menu svg { width: 18px; height: 18px; flex: none; }
svg.ic.xs { width: 13px; height: 13px; vertical-align: -2px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--accent-2); }
.btn.danger.ghost { background: transparent; color: var(--danger); }
.btn.danger.ghost:hover { background: rgba(192, 57, 43, .1); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--accent-2); color: var(--text); }
.icon-btn.float { background: var(--surface); box-shadow: var(--shadow); color: var(--text); width: 40px; height: 40px; }
.icon-btn.dark { color: #fff; }
.icon-btn.dark:hover { background: rgba(255, 255, 255, .15); color: #fff; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), input[inputmode], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select.small { padding: 5px 8px; font-size: 13px; width: auto; }
textarea { resize: vertical; min-height: 44px; }
.input-row { display: flex; gap: 6px; }
.input-row input, .input-row select { flex: 1; min-width: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 600; padding: 0 6px; }
.alert { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(192, 57, 43, .1); color: var(--danger); border: 1px solid rgba(192, 57, 43, .25); }

/* ---------------------------------------------------------------- auth pages */
body.auth { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.auth-brand b { display: block; font-size: 16px; }
.auth-brand small { color: var(--muted); }
.auth h1 { font-size: 22px; }

/* ---------------------------------------------------------------- app shell */
body.app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; white-space: nowrap; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; flex: 1; max-width: 460px; margin: 0 auto; }
.search > svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; padding-right: 36px; background: var(--surface-2); border-color: transparent; border-radius: 10px; }
.search input:focus { background: var(--surface); }
.search kbd { position: absolute; right: 9px; top: 50%; translate: 0 -50%; pointer-events: none; }
.search input:focus ~ kbd { display: none; }
.search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 50;
}
.search-results.open { display: block; }
.search-results button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.search-results button.on, .search-results button:hover { background: var(--accent-2); }
.search-results b { display: block; }
.search-results small { color: var(--muted); display: block; }
.search-results p { padding: 10px; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.save-state { font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .3s; min-width: 70px; text-align: right; }
.save-state.saving, .save-state.saved, .save-state.error { opacity: 1; }
.save-state.error { color: var(--danger); }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; }
.user-btn:hover { background: var(--accent-2); }
.user-btn .chev { width: 14px; height: 14px; color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 12px; flex: none; background: var(--accent); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }

/* edit toggle */
.edit-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px; border-radius: 999px; user-select: none; font-weight: 600; font-size: 13px; }
.edit-toggle:hover { background: var(--accent-2); }
.edit-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.edit-toggle .sw { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; }
.edit-toggle .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.edit-toggle input:checked + .sw { background: #e08a1e; }
.edit-toggle input:checked + .sw::after { transform: translateX(14px); }
.edit-toggle input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
body.editing .topbar { box-shadow: inset 0 -3px 0 #e08a1e; }

/* role-dependent visibility */
body:not([data-role="editor"]):not([data-role="admin"]) .can-edit { display: none !important; }
body:not([data-role="admin"]) .only-admin { display: none !important; }
body:not(.editing) .edit-only { display: none !important; }

/* menus */
.menu-wrap { position: relative; }
.menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.menu-wrap.open > .menu { display: block; animation: pop .14s ease-out; }
.menu-wrap.up > .menu { top: auto; bottom: calc(100% + 8px); }
.menu.right { right: 0; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.menu button:hover { background: var(--accent-2); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head b, .menu-head small { display: block; }
.menu-head small { color: var(--muted); }
.menu-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 6px 10px; }
.menu-colors button { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.menu-colors button:hover { background: var(--c); transform: scale(1.12); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------------------------------------------------------------- layout */
.layout { flex: 1; display: flex; min-height: 0; position: relative; }

.sidebar { width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 20; }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.tabs button.tab-ic { flex: 0 0 40px; display: grid; place-items: center; }
.tabs button.tab-ic svg { width: 17px; height: 17px; }
.tabs button { flex: 1; white-space: nowrap; border: 0; background: none; padding: 9px 2px 11px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; line-height: 16px; }
.tab-body { flex: 1; overflow: auto; padding: 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; }
.list li:hover { background: var(--surface-2); }
.list li.sel { background: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent); }
.list li b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list.tree li { padding-left: calc(4px + var(--d, 0) * 18px); gap: 8px; }
.list.tree li.sub b { font-weight: 500; }
.tree-tgl { width: 18px; height: 18px; flex: none; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--muted); cursor: pointer; border-radius: 4px; }
.tree-tgl:hover { background: var(--line); color: var(--text); }
.tree-tgl svg { transition: transform .15s; }
.tree-tgl.collapsed svg { transform: rotate(-90deg); }
.tree-sp { width: 18px; flex: none; }
.list li.boundary { border-bottom: 1px dashed var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; margin-bottom: 4px; }
.swatch-sm { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.list li.boundary .swatch-sm { background: transparent; border: 2px dashed var(--c); }
.stats { display: flex; gap: 8px; color: var(--muted); font-size: 12px; flex: none; }
.stats span { display: inline-flex; align-items: center; gap: 3px; }
.stats .warn { color: var(--warn); font-weight: 600; }
.thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-foot { color: var(--muted); font-size: 12px; text-align: center; margin: 10px 0; }
.add-btn { margin-top: 6px; color: var(--accent); }
.group { margin-bottom: 4px; }
.group-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 8px 6px; font-weight: 600; cursor: pointer; color: var(--text); border-radius: var(--radius-sm); }
.group-head:hover { background: var(--surface-2); }
.group-head .count { margin-left: auto; }
.group-head .chev { transition: transform .15s; color: var(--muted); }
.group.collapsed .chev { transform: rotate(-90deg); }
.group.collapsed .list { display: none; }
.empty-msg { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 28px 16px; margin: 0; }
.empty-msg svg { width: 28px; height: 28px; opacity: .6; }
.loading-row { display: grid; place-items: center; padding: 30px; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.activity li.link { cursor: pointer; }
.activity li.link:hover { background: var(--surface-2); }
.activity li.day { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 14px 8px 4px; }
.activity li.day:first-child { padding-top: 4px; }
.activity p { margin: 0; font-size: 13px; }
.activity q { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; quotes: "“" "”"; }
.activity time { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- map */
.map-wrap { flex: 1; position: relative; min-width: 0; overflow: hidden; background: #0e1310; }
.map { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; }
.map.panning { cursor: grabbing; }
.map[data-tool="point"], .map[data-tool="zone"], .map[data-tool="measure"], .map[data-tool="calibrate"] { cursor: crosshair; }
.map.on-handle { cursor: move; }
/* the photo is a transformed layer (no will-change: so the browser re-rasterises it sharp after zooming);
   zones and labels live in a screen-sized SVG with a vector transform, so they are always crisp */
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.world img { display: block; width: 100%; height: 100%; user-select: none; pointer-events: none; opacity: 0; transition: opacity .4s; }
.map.loaded .world img { opacity: 1; }
.map > svg.zones { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }

svg.zones polygon.zone { fill: var(--c); fill-opacity: var(--f); stroke: var(--c); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill-opacity .15s; }
svg.zones polygon.zone.hover { fill-opacity: calc(var(--f) + .14); stroke-width: 3; }
svg.zones polygon.zone.sel { fill-opacity: calc(var(--f) + .16); stroke: #fff; stroke-width: 3.5; filter: drop-shadow(0 0 3px var(--c)) drop-shadow(0 0 1px rgba(0,0,0,.6)); }
svg.zones polygon.zone.sub { stroke-width: 1.6; }
svg.zones polygon.zone.sub.hover { stroke-width: 2.6; }
svg.zones polygon.zone.in-sel { stroke: #fff; stroke-opacity: .7; stroke-width: 1.8; }
svg.zones text.zl.sub .n { font-weight: 650; }
svg.zones .sub-parent { fill: none; stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px rgba(0,0,0,.8)); }
svg.zones circle.vtx.shared { fill: var(--c); stroke: #fff; }
svg.zones .gcp circle { fill: rgba(255, 91, 208, .2); stroke: #ff5bd0; stroke-width: 2; vector-effect: non-scaling-stroke; }
svg.zones .gcp path { stroke: #ff5bd0; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
svg.zones .gcp text { fill: #fff; paint-order: stroke; stroke: #6b0050; stroke-width: .3em; font-weight: 700; font-family: var(--font); }
svg.zones .gcp.bad circle, svg.zones .gcp.bad path { stroke: #ff3b30; }
svg.zones polygon.boundary { fill: none; stroke: #fff; stroke-opacity: .85; stroke-width: 2; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; }
svg.zones polygon.boundary.hover, svg.zones polygon.boundary.sel { stroke: #f4c95d; stroke-opacity: 1; stroke-width: 3; }
svg.zones text.zl { text-anchor: middle; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.72); stroke-width: .28em; stroke-linejoin: round; font-family: var(--font); pointer-events: none; }
svg.zones text.zl .n { font-weight: 700; }
svg.zones text.zl .a { font-weight: 500; font-size: .85em; fill: #e9f3ec; }
svg.zones text.zl.b { font-weight: 600; opacity: .9; }
svg.zones text.zl.sel .n { fill: #ffe9a8; }
svg.zones circle.vtx { fill: #fff; stroke: var(--c); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
svg.zones circle.mid { fill: rgba(255,255,255,.65); stroke: var(--c); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
svg.zones .draft-fill { fill: #f4c95d; fill-opacity: .25; stroke: none; }
svg.zones .draft-line { fill: none; stroke: #f4c95d; stroke-width: 2.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1.5px rgba(0,0,0,.8)); }
svg.zones .draft-v { fill: #f4c95d; stroke: #1c2420; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
svg.zones .draft-v.first { fill: #fff; stroke: #f4c95d; stroke-width: 3; }
svg.zones .snap { fill: none; stroke: #00e5ff; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
svg.zones .snap.e { stroke-width: 1.5; }
svg.zones .measure-line, svg.zones .measure-fill { fill: none; stroke: #00e5ff; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
svg.zones .measure-fill { fill: #00e5ff; fill-opacity: .14; }
svg.zones .measure-v { fill: #fff; stroke: #00b8cc; stroke-width: 2; vector-effect: non-scaling-stroke; }
svg.zones text.ml, svg.zones text.mt { fill: #fff; paint-order: stroke; stroke: #004f59; stroke-width: .3em; font-weight: 600; text-anchor: middle; font-family: var(--font); }
svg.zones text.mt { text-anchor: start; font-weight: 700; }
svg.zones .cal-line { fill: none; stroke: #ff5bd0; stroke-width: 3; vector-effect: non-scaling-stroke; }
svg.zones .cal-v { fill: #ff5bd0; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }

/* point markers */
.markers { position: absolute; inset: 0; pointer-events: none; }
.pin {
  --s: var(--ps, 26px);
  position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); pointer-events: auto; cursor: pointer;
  border-radius: 50%; background: #e74c3c; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45);
  display: grid; place-items: center; color: #fff; font: 700 11px/1 var(--font); transition: width .12s, height .12s, margin .12s, background .12s, opacity .2s;
}
.markers.tiny .pin { border-width: 2px; font-size: 0; }
.markers.tiny .pin .badge { display: none; }
.pin:hover { --s: calc(var(--ps, 26px) + 6px); z-index: 2; font-size: 11px; }
.pin.empty { background: #7f8c8d; }
.pin.sel { background: #f4c95d; color: #1c2420; --s: 34px; font-size: 11px; z-index: 3; box-shadow: 0 0 0 4px rgba(244, 201, 93, .45), 0 2px 8px rgba(0,0,0,.5); }
.pin.dim { opacity: .38; }
.pin.movable { cursor: move; animation: wiggle 1.6s ease-in-out infinite; }
.map.dragging .pin.movable { animation: none; }
.pin .badge { position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #e08a1e; color: #fff; font: 700 10px/16px var(--font); font-style: normal; border: 1.5px solid #fff; }
@keyframes wiggle { 0%, 100% { box-shadow: 0 0 0 4px rgba(244,201,93,.45), 0 2px 8px rgba(0,0,0,.5); } 50% { box-shadow: 0 0 0 9px rgba(244,201,93,.15), 0 2px 8px rgba(0,0,0,.5); } }

/* GPS position */
.gps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 4; }
.gps .acc { position: absolute; border-radius: 50%; background: rgba(26, 115, 232, .16); border: 1px solid rgba(26, 115, 232, .5); }
.gps .dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(26,115,232,.6), 0 1px 4px rgba(0,0,0,.4); animation: gpspulse 2s infinite; }
@keyframes gpspulse { 70% { box-shadow: 0 0 0 14px rgba(26,115,232,0), 0 1px 4px rgba(0,0,0,.4); } 100% { box-shadow: 0 0 0 0 rgba(26,115,232,0), 0 1px 4px rgba(0,0,0,.4); } }
.gps-btn.on { color: #1a73e8; }
.gps-btn.wait svg { animation: spin 1.2s linear infinite; }
.pin.has-video { box-shadow: 0 0 0 2px #8e44ad, 0 2px 6px rgba(0,0,0,.45); }

/* floating panel (georeferencing) */
.float-panel { position: absolute; left: 14px; top: 64px; z-index: 12; width: 330px; max-width: calc(100% - 28px); max-height: calc(100% - 150px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.float-panel header { display: flex; align-items: center; justify-content: space-between; }
.float-panel header b { display: flex; gap: 8px; align-items: center; }
.float-panel p { margin: 0; }
.gcp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gcp-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.gcp-list li.bad { background: rgba(255, 59, 48, .12); }
.gcp-list li small { display: block; color: var(--muted); }
.gcp-list .n { width: 22px; height: 22px; border-radius: 50%; background: #ff5bd0; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.fit-info { font-size: 13px; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm svg { width: 15px; height: 15px; }

/* floating controls */
.toolbar {
  position: absolute; left: 50%; bottom: 18px; translate: -50% 0; z-index: 10;
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.toolbar > button { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.toolbar > button svg { width: 19px; height: 19px; }
.toolbar > button:hover:not(:disabled) { background: var(--accent-2); color: var(--text); }
.toolbar > button.on { background: var(--accent); color: var(--accent-text); }
.toolbar > button:disabled { opacity: .35; cursor: default; }
.toolbar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.hint {
  position: absolute; top: 14px; left: 50%; translate: -50% 0; z-index: 10; max-width: min(680px, calc(100% - 120px));
  background: rgba(20, 26, 22, .88); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; text-align: center; backdrop-filter: blur(6px);
  box-shadow: var(--shadow); pointer-events: none;
}
.hint kbd { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.map-ctrl { position: absolute; right: 14px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.zoom-group { display: flex; flex-direction: column; border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.zoom-group .icon-btn.float { box-shadow: none; border-radius: 0; }
.zoom-group .icon-btn.float + .icon-btn.float { border-top: 1px solid var(--line); }
.menu.layers { right: 48px; bottom: 0; top: auto; min-width: 240px; }
.menu.layers h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px; }
.layer { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.layer:hover { background: var(--surface-2); }
.layer span { flex: 1; }
.layer input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.layer .tgl { width: 30px; height: 18px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; }
.layer .tgl::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.layer input:checked ~ .tgl { background: var(--accent); }
.layer input:checked ~ .tgl::after { transform: translateX(12px); }
.layer.range { flex-direction: column; align-items: stretch; gap: 4px; cursor: default; border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; padding-top: 10px; }
.layer.range span { font-size: 12px; color: var(--muted); }
.layer.range input { accent-color: var(--accent); }
.scalebar { position: absolute; left: 14px; bottom: 18px; z-index: 10; display: flex; flex-direction: column; gap: 2px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 2px #000; pointer-events: none; }
.scalebar i { display: block; height: 7px; border: 2px solid #fff; border-top: 0; box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tooltip {
  position: absolute; left: 0; top: 0; z-index: 15; pointer-events: none; max-width: 280px;
  background: var(--surface); color: var(--text); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 11px; border: 1px solid var(--line);
}
.tooltip b { display: flex; align-items: center; gap: 6px; }
.tooltip small { color: var(--muted); display: block; }
.tooltip small.crumb { font-size: 11px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tip-thumbs { display: flex; gap: 4px; margin-top: 6px; }
.tip-thumbs img { width: 76px; height: 57px; object-fit: cover; border-radius: 6px; }

/* ---------------------------------------------------------------- detail panel */
.panel {
  width: var(--panel-w); flex: none; background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; z-index: 20; animation: slidein .18s ease-out;
}
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } }
.panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 10px 10px 16px; }
.panel-head .ttl { flex: 1; min-width: 0; }
.panel-head h2 { font-size: 18px; padding: 4px 0; }
.title-input { font-size: 18px !important; font-weight: 650; padding: 3px 6px !important; margin-left: -7px; border-color: transparent !important; background: transparent !important; }
.title-input:hover { border-color: var(--line-2) !important; }
.title-input:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; margin-bottom: 1px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs span { color: var(--muted); }
.coords { width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.coords a { color: var(--muted); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.coords a:hover { color: var(--accent); }
.meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.meta b { color: var(--text); }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; font-weight: 600; margin-right: 4px; }
.zone-link { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--text); font-weight: 600; }
.zone-link:hover { text-decoration: underline; }
.swatch { width: 34px; height: 34px; border-radius: 10px; background: var(--c); flex: none; margin-top: 3px; position: relative; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch.pin-ic { background: #e74c3c; color: #fff; display: grid; place-items: center; cursor: default; }
.ptabs { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.ptabs button { white-space: nowrap; border: 0; background: none; padding: 8px 10px 10px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 6px; }
.ptabs button:hover { color: var(--text); }
.ptabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pbody { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.sec-title .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.sec-title.link { cursor: pointer; }
.sec-title.link:hover { color: var(--text); }
.notes { display: flex; flex-direction: column; gap: 14px; }
.note-field { display: flex; flex-direction: column; gap: 6px; }
.note-field > span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.note-field > span svg { width: 15px; height: 15px; }
.note-field textarea { background: var(--surface-2); border-color: transparent; resize: none; overflow: hidden; min-height: 60px; }
.note-field textarea:hover { border-color: var(--line-2); }
.note-field textarea:focus { background: var(--surface); }
.note-field.ro p { margin: 0; white-space: normal; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); cursor: pointer; }
.plist li:hover { background: var(--surface-2); }
.plist li b, .plist li small { display: block; }
.plist li small { color: var(--muted); font-size: 12px; }
.desc-card { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s; }
.desc-card:hover { border-color: var(--accent); }
.desc-card .sec-title { margin-bottom: 6px; }
.desc-card p { margin: 0 0 6px; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.link-more { color: var(--accent); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.desc-empty { border: 1.5px dashed var(--line-2); color: var(--accent); padding: 12px; }
.small-empty { padding: 10px 6px; font-size: 13px; }
.inline-field { margin-top: 10px; }
.pbody-desc { padding: 12px; }
.desc-preview { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; }
.upload-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drop-hint {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); transition: border-color .15s, background .15s;
}
.drop-hint:hover { border-color: var(--accent); background: var(--accent-2); }
.drop-hint svg { width: 30px; height: 30px; }
.drop-hint b { color: var(--text); }
.photo-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.photo-tools .seg button { display: grid; place-items: center; padding: 4px 8px; }
h4.month { font-size: 12px; text-transform: capitalize; color: var(--muted); margin: 10px 0 6px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
h4.month::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.plist-media { display: flex; flex-direction: column; gap: 10px; }
.media-row { display: flex; gap: 10px; padding: 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.media-row.dragging { opacity: .4; }
.plist-media.sortable .media-row { cursor: grab; }
.media-row > .tile { width: 112px; flex: none; align-self: flex-start; }
.media-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.media-fields .cap-input { font-weight: 600; padding: 5px 8px; }
.media-fields textarea { min-height: 52px; resize: none; overflow: hidden; font-size: 13px; padding: 6px 8px; background: var(--surface-2); border-color: transparent; }
.media-fields textarea:focus { background: var(--surface); }
.media-fields p { margin: 0; font-size: 13px; }
.date-field { display: inline-flex; align-items: center; gap: 4px; }
.date-field input { width: auto; padding: 3px 6px; font-size: 12px; }
.tile-ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #2b2b3a, #45364d); color: #fff; font-size: 22px; }
.tile-ph svg { width: 28px; height: 28px; }
.tile.is-video::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; background: rgba(0,0,0,.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") center/20px no-repeat; pointer-events: none; }
.tile .kind.vid { background: rgba(142, 68, 173, .85); }
.tile .has-desc { position: absolute; right: 5px; bottom: 5px; width: 20px; height: 20px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.tile:hover .has-desc { opacity: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.tile { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.tile:hover img { transform: scale(1.05); }
.tile .kind { position: absolute; left: 5px; top: 5px; display: inline-flex; gap: 3px; align-items: center; background: rgba(0,0,0,.6); color: #fff; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; backdrop-filter: blur(4px); }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .del { position: absolute; right: 5px; top: 5px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.tile .del svg { width: 14px; height: 14px; }
.tile:hover .del { opacity: 1; }
.tile .del:hover { background: var(--danger); }
.tile.dragging { opacity: .4; }
.grid.sortable .tile { cursor: grab; }
.tile.uploading img { opacity: .5; filter: grayscale(.5); }
.tile .prog { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; }
.tile .prog i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.tile.failed .prog i { background: var(--danger); }
.tile.failed small { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; background: rgba(192,57,43,.6); }
.pgroup .grid { margin-top: 2px; }

/* comments */
.comments { display: flex; flex-direction: column; gap: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.small button { padding: 3px 9px; font-size: 12px; }
.seg.filter { align-self: flex-start; }
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.c-head time { color: var(--muted); font-size: 12px; }
.c-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.comment:hover .c-actions, .comment:focus-within .c-actions { opacity: 1; }
.c-actions button { border: 0; background: none; padding: 3px; border-radius: 5px; cursor: pointer; color: var(--muted); }
.c-actions button:hover { background: var(--surface-2); color: var(--text); }
.c-body { margin-top: 4px; padding: 8px 11px; background: var(--surface-2); border-radius: 4px 12px 12px 12px; overflow-wrap: anywhere; }
.comment.issue .c-body { box-shadow: inset 3px 0 0 #d35400; }
.comment.task .c-body { box-shadow: inset 3px 0 0 #2980b9; }
.comment.idea .c-body { box-shadow: inset 3px 0 0 #d4ac0d; }
.comment.done .c-body { text-decoration: line-through; color: var(--muted); }
.task-check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.task-check input { margin-top: 13px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.task-check .c-body { flex: 1; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; border: 1px solid transparent; }
.tag.note { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.tag.issue { background: rgba(211, 84, 0, .12); color: #c0510a; }
.tag.task { background: rgba(41, 128, 185, .12); color: #2475ab; }
.tag.idea { background: rgba(212, 172, 13, .16); color: #957705; }
:root[data-theme="dark"] .tag.issue { color: #f0915a; }
:root[data-theme="dark"] .tag.task { color: #6db7e8; }
:root[data-theme="dark"] .tag.idea { color: #e8c547; }
.composer { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); position: sticky; bottom: -16px; box-shadow: 0 -8px 16px var(--surface); }
.composer textarea { resize: none; overflow: hidden; min-height: 54px; border-color: transparent; background: var(--surface-2); }
.composer .row { justify-content: space-between; }
.tag-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-pick label { cursor: pointer; }
.tag-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tag-pick .tag { padding: 3px 9px; opacity: .55; transition: opacity .15s; border-color: var(--line); }
.tag-pick input:checked + .tag { opacity: 1; border-color: currentColor; }
.tag-pick input:focus-visible + .tag { outline: 2px solid var(--accent); }
.c-edit { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.c-edit .row { justify-content: flex-end; }

/* ---------------------------------------------------------------- show / hide */
.eye { border: 0; background: none; padding: 4px; border-radius: 6px; color: var(--muted); cursor: pointer; flex: none; opacity: 0; transition: opacity .12s; display: grid; place-items: center; }
.list li:hover .eye, .group-row:hover .eye, .is-hidden .eye, .eye:focus-visible { opacity: 1; }
.eye:hover { background: var(--line); color: var(--text); }
.list li.is-hidden > :not(.eye) { opacity: .45; }
.list li.is-hidden .eye { color: var(--warn); }
.group-row { display: flex; align-items: center; }
.group-row .group-head { flex: 1; }
.hidden-bar { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); background: rgba(183, 121, 31, .1); border-radius: var(--radius-sm); padding: 4px 4px 4px 10px; margin-bottom: 6px; }
.hidden-bar .btn { margin-left: auto; }
@media (pointer: coarse) { .eye { opacity: 1; } }

/* ---------------------------------------------------------------- planning */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); }
.status-pill.sm { padding: 1px 8px; font-size: 11px; margin-right: 4px; }
.status-pill.none { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip.prio-high { background: rgba(192, 57, 43, .12); color: var(--danger); border-color: transparent; }
.plan-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf > span { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.pf input, .pf select { padding: 6px 8px; font-size: 13px; background: var(--surface-2); border-color: transparent; }
.pf input:hover, .pf select:hover { border-color: var(--line-2); }
.pf b { font-weight: 600; font-size: 13.5px; }
.timeline { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); scrollbar-width: thin; }
.tl-inner { position: relative; padding-bottom: 6px; }
.tl-head { display: flex; position: sticky; top: 0; }
.tl-year { flex: none; border-left: 1px solid var(--line-2); }
.tl-year b { display: block; font-size: 11px; padding: 3px 5px 0; }
.tl-year div { display: flex; }
.tl-year i { width: 20px; text-align: center; font-size: 9.5px; font-style: normal; color: var(--muted); }
.tl-row { position: relative; height: 26px; margin-top: 4px; background-image: repeating-linear-gradient(90deg, transparent 0 239px, var(--line) 239px 240px); }
.tl-bar { position: absolute; top: 0; height: 24px; border: 0; border-radius: 6px; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 650; padding: 0 6px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.tl-bar:disabled { cursor: default; }
.tl-bar.st-planned { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 75%, #fff) 6px 12px); }
.tl-bar.st-done { opacity: .55; }
.tl-bar.st-cancelled { opacity: .35; text-decoration: line-through; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .7; pointer-events: none; }
.tl-legend, .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.tl-legend i, .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend { position: absolute; left: 14px; bottom: 52px; z-index: 10; margin: 0; flex-direction: column; gap: 3px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow); max-height: 45%; overflow: auto; }
.legend b { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task { display: flex; align-items: flex-start; gap: 9px; padding: 7px 6px; border-radius: var(--radius-sm); }
.task:hover { background: var(--surface-2); }
.task .tick { width: 20px; height: 20px; flex: none; margin-top: 1px; border-radius: 6px; border: 2px solid var(--line-2); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: #fff; padding: 0; }
.task .tick:hover:not(:disabled) { border-color: var(--accent); }
.task .tick svg { width: 13px; height: 13px; }
.task.st-done .tick { background: var(--accent); border-color: var(--accent); }
.task.st-doing .tick { border-color: #2980b9; background: linear-gradient(90deg, rgba(41,128,185,.35) 50%, transparent 50%); }
.task .t-main { flex: 1; min-width: 0; }
.task .t-main[data-task-edit] { cursor: pointer; }
.task b { display: block; font-weight: 550; font-size: 13.5px; }
.task.st-done b { text-decoration: line-through; color: var(--muted); }
.task small { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 1px; }
.task .due { display: inline-flex; gap: 3px; align-items: center; }
.task.late .due { color: var(--danger); font-weight: 650; }
.task .prio { color: var(--danger); font-weight: 800; margin-right: 4px; }
.chip.doing { background: rgba(41,128,185,.14); color: #2980b9; border-color: transparent; }
.tgroup { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 4px 4px; display: flex; gap: 6px; align-items: center; }
.tgroup.late { color: var(--danger); }
.task-filter { display: flex; width: 100%; margin-bottom: 4px; }
.task-filter button { flex: 1; padding: 4px 2px; }
.plan-table-wrap { overflow: auto; max-height: 55vh; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.plan-table { margin: 0; font-size: 13px; }
.plan-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.plan-table td { padding: 7px 8px; }
.plan-table tbody tr { cursor: pointer; }
.plan-table tbody tr:hover { background: var(--surface-2); }
.plan-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.use-bars { display: flex; flex-direction: column; gap: 5px; }
.use-bars div { display: grid; grid-template-columns: 150px 1fr 90px; gap: 8px; align-items: center; font-size: 13px; }
.use-bars i { display: block; height: 14px; border-radius: 4px; }
.use-bars b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- rich text */
.rich { font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich p { margin: 0 0 .7em; }
.rich h2 { font-size: 1.3em; margin: 1.1em 0 .45em; }
.rich h3 { font-size: 1.1em; margin: 1em 0 .4em; color: var(--accent); }
.rich ul, .rich ol { margin: 0 0 .8em; padding-left: 1.4em; }
.rich li { margin: .15em 0; }
.rich blockquote { margin: .8em 0; padding: .6em 1em; border-left: 4px solid var(--accent); background: var(--accent-2); border-radius: 0 8px 8px 0; }
.rich hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.2em 0; }
.rich a { color: var(--accent); }
.rte { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.rte-bar button { min-width: 30px; height: 30px; padding: 0 6px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.rte-bar button:hover { background: var(--line); }
.rte-bar button.on { background: var(--accent); color: var(--accent-text); }
.rte-bar .t-b { font-weight: 800; } .rte-bar .t-i { font-style: italic; font-family: Georgia, serif; } .rte-bar .t-u { text-decoration: underline; } .rte-bar .t-s { text-decoration: line-through; }
.rte-bar .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 3px; }
.rte-bar .grow { flex: 1; }
.rte-count { margin-right: 6px; }
.rte-title { display: none; }
.rte-body { min-height: max(320px, calc(100dvh - 380px)); padding: 16px 18px; outline: none; }
.rte-body.empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.rte.full { position: fixed; inset: 0; z-index: 150; border-radius: 0; border: 0; background: var(--bg); }
.rte.full .rte-bar { justify-content: center; padding: 8px max(12px, calc(50% - 420px)); }
.rte.full .rte-title { display: block; max-width: 840px; width: 100%; margin: 26px auto 0; padding: 0 24px; font-size: 26px; font-weight: 700; }
.rte.full .rte-body { flex: 1; overflow: auto; max-width: 840px; width: 100%; margin: 0 auto; padding: 14px 24px 80px; font-size: 16px; min-height: 0; }
.rte.full .rte-full { color: var(--accent); }
body.rte-fullscreen { overflow: hidden; }
body.rte-fullscreen .panel { z-index: 200; animation: none; transform: none; }
.rte.full .rte-bar { position: relative; }
.pbody-desc .muted.small { margin: 8px 2px 0; }

/* field mode */
.offline-badge { display: none; padding: 3px 9px; border-radius: 999px; background: #b7791f; color: #fff; font-size: 12px; font-weight: 700; }
body.offline .offline-badge { display: inline-block; }
.outbox { display: inline-flex; align-items: center; gap: 4px; border: 0; padding: 4px 10px; border-radius: 999px; background: #e08a1e; color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; }
.outbox svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- viewer */
.viewer { position: fixed; inset: 0; z-index: 100; background: #050706; color: #fff; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.v-top { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; background: linear-gradient(rgba(0,0,0,.6), transparent); position: absolute; left: 0; right: 0; top: 0; z-index: 3; }
.v-title { flex: 1; min-width: 0; }
.v-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.v-path a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; padding: 2px 8px 2px 4px; border-radius: 8px; }
.v-path a:hover { background: rgba(255,255,255,.14); }
.v-path a .dot { width: 13px; height: 13px; border-radius: 4px; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.v-path a.pt { background: rgba(244, 201, 93, .22); color: #ffe39a; padding-left: 8px; }
.v-path a.pt svg { width: 15px; height: 15px; }
.v-path .arr { color: rgba(255,255,255,.55); font-weight: 400; }
.v-title small { display: block; margin-top: 3px; }
.v-title small { color: rgba(255,255,255,.65); }
.v-actions { display: flex; gap: 6px; align-items: center; }
.viewer .seg { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }
.viewer .seg button { color: rgba(255,255,255,.7); }
.viewer .seg button.on { background: rgba(255,255,255,.9); color: #000; }
.v-stage { flex: 1; position: relative; overflow: hidden; touch-action: none; min-height: 0; }
.v-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 50%; user-select: none; -webkit-user-drag: none; }
.v-gl { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.v-gl:active { cursor: grabbing; }
.v-nav { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; display: grid; place-items: center; z-index: 2; backdrop-filter: blur(6px); }
.v-nav:hover { background: rgba(0,0,0,.7); }
.v-nav svg { width: 26px; height: 26px; }
.v-nav.prev { left: 14px; }
.v-nav.next { right: 14px; }
.v-help { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; font-size: 12px; background: rgba(0,0,0,.5); padding: 5px 12px; border-radius: 999px; pointer-events: none; }
.v-help:empty { display: none; }
.v-spin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; display: none; }
.viewer.loading .v-spin { display: block; }
.v-minimap { position: absolute; left: 14px; bottom: 14px; z-index: 3; width: 240px; height: 160px; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 6px 20px rgba(0,0,0,.6); background: #111; transition: width .2s, height .2s; }
.v-minimap.big { width: 420px; height: 280px; }
.v-minimap.off { width: 34px; height: 34px; border-width: 1px; }
.v-minimap.off svg, .v-minimap.off .mm-label, .v-minimap.off [data-mm="big"] { display: none; }
.v-minimap svg { width: 100%; height: 100%; display: block; cursor: pointer; }
.v-minimap polygon { fill: none; stroke: var(--c); stroke-width: 1.2; stroke-opacity: .7; vector-effect: non-scaling-stroke; }
.v-minimap polygon.anc { stroke: #fff; stroke-opacity: .8; stroke-width: 1.6; }
.v-minimap polygon.cur { fill: var(--c); fill-opacity: .28; stroke: #fff; stroke-opacity: 1; stroke-width: 2.5; }
.v-minimap .mm-pin { fill: #f4c95d; stroke: #000; stroke-width: 2; vector-effect: non-scaling-stroke; }
.v-minimap .mm-label { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; display: inline-flex; gap: 5px; align-items: center; pointer-events: none; }
.v-minimap .mm-btns { position: absolute; right: 4px; top: 4px; display: flex; gap: 3px; }
.v-minimap.off .mm-btns { inset: 0; }
.v-minimap .mm-btns button { width: 24px; height: 24px; border: 0; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.v-minimap.off .mm-btns button { width: 100%; height: 100%; background: transparent; }
.v-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.v-capbar { position: absolute; left: 50%; translate: -50% 0; bottom: 92px; z-index: 2; max-width: min(760px, calc(100% - 140px)); background: rgba(10, 12, 11, .78); backdrop-filter: blur(8px);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; max-height: 28vh; overflow: auto; }
.v-capbar b { display: block; }
.v-capbar .v-desc { color: rgba(255,255,255,.85); margin-top: 2px; }
.viewer:has(.v-strip[hidden]) .v-capbar { bottom: 20px; }
.viewer.is-video .v-capbar { bottom: auto; top: 64px; }
.viewer .v-strip .tile-ph { font-size: 16px; }
.v-info input, .v-info textarea { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #fff; }
.v-info .field + .field { margin-top: 10px; }
.v-info { position: absolute; right: 14px; top: 70px; width: 320px; max-height: calc(100% - 180px); overflow: auto; max-width: calc(100% - 28px); z-index: 3; background: rgba(20, 24, 22, .92); backdrop-filter: blur(10px); border-radius: var(--radius); padding: 14px; border: 1px solid rgba(255,255,255,.1); }
.v-info textarea { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #fff; }
.v-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 12px 0 0; }
.v-info dt { color: rgba(255,255,255,.55); }
.v-info dd { margin: 0; }
.field.dark > span { color: rgba(255,255,255,.6); }
.v-strip { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; flex: none; background: #000; scrollbar-width: thin; }
.v-strip button { position: relative; flex: none; width: 76px; height: 57px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #222; opacity: .55; transition: opacity .15s; }
.v-strip button.on { opacity: 1; border-color: #fff; }
.v-strip button:hover { opacity: .9; }
.v-strip img { width: 100%; height: 100%; object-fit: cover; }
.v-strip i { position: absolute; left: 3px; bottom: 3px; font-size: 9px; font-style: normal; font-weight: 700; background: rgba(0,0,0,.65); padding: 0 4px; border-radius: 4px; }
body.viewer-open { overflow: hidden; }

/* ---------------------------------------------------------------- modals, toasts, dropzone */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(10, 14, 12, .5); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .15s; backdrop-filter: blur(2px); }
.modal-backdrop.in { opacity: 1; }
.modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); transform: translateY(8px) scale(.99); transition: transform .18s; }
.modal-backdrop.in .modal { transform: none; }
.modal.wide { max-width: 760px; }
.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; }
.modal > header h2 { font-size: 17px; }
.modal-body { padding: 10px 20px 20px; overflow: auto; }
.modal-body p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; margin-top: 6px; }
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-head b, .profile-head small { display: block; }
.table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.inactive { opacity: .55; }
.user-cell { display: flex; gap: 10px; align-items: center; }
.user-cell b, .user-cell small { display: block; }
.user-cell small { color: var(--muted); }
.role { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.role.admin { background: rgba(142, 68, 173, .14); color: #8e44ad; border-color: transparent; }
.role.editor { background: var(--accent-2); color: var(--accent); border-color: transparent; }
.role.commenter { background: rgba(41, 128, 185, .12); color: #2980b9; border-color: transparent; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-pick label { cursor: pointer; }
.role-pick input { position: absolute; opacity: 0; pointer-events: none; }
.role-pick span { display: block; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); height: 100%; transition: border-color .15s, background .15s; }
.role-pick b { display: block; font-size: 13px; }
.role-pick small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; font-weight: 400; }
.role-pick input:checked + span { border-color: var(--accent); background: var(--accent-2); }
.role-pick input:focus-visible + span { outline: 2px solid var(--accent); }
.trash { list-style: none; margin: 0; padding: 0; }
.trash li { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.trash li small { display: block; color: var(--muted); }
.help .keys { width: 100%; border-collapse: collapse; }
.help .keys td { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.help .keys td:first-child { width: 160px; white-space: nowrap; }
.help .tips { padding-left: 18px; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }

.toasts { position: fixed; left: 50%; bottom: 84px; translate: -50% 0; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 10px; background: #1c2420; color: #fff; box-shadow: var(--shadow); font-size: 13.5px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: min(560px, 90vw); pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast svg { width: 16px; height: 16px; color: #7fd6a4; }
.toast.error { background: #8c2a1f; }
.toast.error svg { color: #ffb4a8; }
.dropzone { position: fixed; inset: 10px; z-index: 250; border: 3px dashed var(--accent); border-radius: 20px; background: color-mix(in srgb, var(--accent) 16%, transparent); backdrop-filter: blur(2px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none; font-size: 18px; color: var(--text); }
.dropzone svg { width: 40px; height: 40px; color: var(--accent); }
.dropzone.bad { border-color: var(--warn); background: rgba(183, 121, 31, .14); }
.dropzone b { background: var(--surface); padding: 8px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.dropzone small { font-size: 13px; background: var(--surface); padding: 4px 10px; border-radius: 8px; }

/* ---------------------------------------------------------------- responsive */
.only-mobile { display: none; }
@media (max-width: 1100px) {
  :root { --sidebar-w: 270px; --panel-w: 360px; }
  .toolbar > button span, .toolbar #btn-infra span, .toolbar #btn-objects span { display: none; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  .only-mobile { display: inline-grid; }
  .hide-mobile, .brand span, .save-state, .search kbd, .edit-toggle .lbl { display: none; }
  .topbar { gap: 6px; padding: 0 6px; }
  .search { max-width: none; }
  .sidebar { position: absolute; left: 0; top: 0; bottom: 0; width: min(86vw, 340px); transform: translateX(-102%); transition: transform .22s; box-shadow: var(--shadow); }
  body.sidebar-open .sidebar { transform: none; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 58%; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.25); animation: sheet .22s ease-out;
  }
  .panel::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-2); }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  body.panel-open .toolbar, body.panel-open .map-ctrl, body.panel-open .scalebar { bottom: calc(58% + 12px); }
  .toolbar { bottom: 12px; }
  .hint { top: 8px; max-width: calc(100% - 20px); font-size: 12px; }
  .menu.layers { right: 0; bottom: 48px; }
  .v-info { top: auto; bottom: 80px; }
  .v-minimap { width: 150px; height: 100px; bottom: 8px; left: 8px; }
  .v-minimap.big { width: 240px; height: 160px; }
  .v-path { font-size: 15px; }
  .pf-grid { grid-template-columns: 1fr; }
  .role-pick { grid-template-columns: 1fr; }
  .tile .del { opacity: 1; }
  .c-actions { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.viewer.is-video .v-minimap { bottom: 64px; }
.count:empty { display: none; }
.plan-table td:first-child, .plan-table .status-pill { white-space: nowrap; }

/* panel tabs as icons: label on the active tab, tooltip on the others */
.ptabs.icons { gap: 2px; padding: 0 8px; overflow: visible; }
.ptabs.icons button { position: relative; padding: 9px 10px 10px; gap: 6px; }
.ptabs.icons button svg { width: 19px; height: 19px; }
.ptabs.icons button .lbl { display: none; }
.ptabs.icons button.on { flex: 0 1 auto; }
.ptabs.icons button.on .lbl { display: inline; }
.ptabs.icons .badge-n { position: absolute; top: 3px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.ptabs.icons button.on .badge-n { position: static; }
.ptabs.icons .dot-n { position: absolute; top: 7px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ptabs.icons button.on .dot-n { display: none; }
.ptabs.icons button:not(.on):hover::after, .ptabs.icons button:not(.on):focus-visible::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 4px); left: 50%; translate: -50% 0; z-index: 30; white-space: nowrap;
  background: #1c2420; color: #fff; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 6px; box-shadow: var(--shadow); pointer-events: none; }

/* undo / redo in the top bar */
.undo-group { display: flex; gap: 0; }
.undo-group .icon-btn:disabled { opacity: .3; cursor: default; background: none; }

/* plan versions */
.ver-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.ver-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ver-list li { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.ver-main { flex: 1; min-width: 0; }
.ver-main > b { display: block; }
.ver-main small { color: var(--muted); }
.ver-main p { margin: 4px 0 0; font-size: 13px; }
.ver-btns { display: flex; gap: 4px; align-items: center; flex: none; }
.ver-diff { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ver-diff .row { margin-top: 4px; }
.diff { display: flex; flex-direction: column; gap: 4px; }
.diff > div { padding-left: 10px; border-left: 3px solid; }
.d-add { border-color: #27ae60 !important; }
.d-rem { border-color: var(--danger) !important; }
.d-chg { border-color: #e08a1e !important; }

/* ---------------------------------------------------------------- infrastructure */
svg.zones .infra-line polyline { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: butt; }
svg.zones .infra-line .casing { stroke: rgba(0, 0, 0, .55); }
svg.zones .infra-line .halo { stroke: #f4c95d; stroke-opacity: .55; stroke-linecap: round; }
svg.zones .infra-line.st-planned .main { opacity: .6; }
svg.zones .infra-line.st-planned .casing { stroke: rgba(255, 255, 255, .6); stroke-dasharray: 2 4; }
svg.zones .infra-line.st-repair .casing { stroke: #e53935; }
svg.zones .infra-line.st-remove { opacity: .7; }
svg.zones .infra-line .strike { stroke: #e53935; stroke-width: 1.5; stroke-dasharray: 3 6; }
.map.on-infra { cursor: pointer; }
.sym { position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -14px 0 0 -14px; display: grid; place-items: center; pointer-events: auto; cursor: pointer;
  background: rgba(255, 255, 255, .92); border: 2px solid #37474f; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,.45); font-size: 16px; line-height: 1; transition: transform .1s; }
.sym:hover { transform: scale(1.15); z-index: 2; }
.sym.sel { border-color: #f4c95d; box-shadow: 0 0 0 4px rgba(244, 201, 93, .5), 0 2px 6px rgba(0,0,0,.5); z-index: 3; }
.sym.st-planned { border-style: dashed; background: rgba(255,255,255,.7); }
.sym.st-repair { border-color: #e53935; }
.sym.st-remove { opacity: .55; filter: grayscale(1); }
.sym.movable { cursor: move; }
.markers.tiny .sym { width: 20px; height: 20px; margin: -10px 0 0 -10px; font-size: 11px; border-width: 1.5px; border-radius: 6px; }
.chip.st-planned { background: rgba(41,128,185,.12); color: #2980b9; border-color: transparent; }
.chip.st-repair { background: rgba(229,57,53,.12); color: #e53935; border-color: transparent; }
.chip.st-remove { background: rgba(120,120,120,.15); color: var(--muted); border-color: transparent; text-decoration: line-through; }
.swatch.sym-sw { background: var(--surface-2); display: grid; place-items: center; font-size: 19px; box-shadow: inset 0 0 0 1px var(--line-2); }
.swatch.line-sw { background: #4b5a52; display: grid; place-items: center; }
.swatch.line-sw svg { width: 30px; height: 30px; }
.infra-measure { margin: 0 0 8px; }

/* toolbar picker */
.infra-wrap { position: relative; }
.toolbar #btn-infra, .toolbar #btn-objects { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.toolbar #btn-infra:hover, .toolbar #btn-objects:hover { background: var(--accent-2); color: var(--text); }
.toolbar #btn-infra.on, .toolbar #btn-objects.on { background: var(--accent); color: var(--accent-text); }
.menu.infra-picker { left: 50%; right: auto; translate: -50% 0; width: min(520px, 92vw); max-height: 60vh; overflow: auto; }
.menu.infra-picker h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px 2px; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.pick-grid button { font-size: 13px; padding: 7px 8px; gap: 8px; white-space: normal; text-align: left; }
.pick-grid button.on { background: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent); }
.lsample { width: 40px; height: 12px; flex: none; background: #4b5a52; border-radius: 3px; }
.emo { width: 24px; text-align: center; font-size: 17px; line-height: 1; flex: none; }

/* sidebar section */
.infra-section { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.infra-section .group-head svg.ic:not(.chev) { color: var(--muted); }
.infra-list > li.infra-group { display: block; padding: 0; cursor: default; }
.infra-list > li.infra-group:hover { background: none; }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.ig-head b { display: block; font-size: 13px; }
.ig-head small { color: var(--muted); font-size: 12px; }
.ig-items { list-style: none; margin: 0 0 4px; padding: 0 0 0 34px; }
.ig-items li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ig-items li:hover { background: var(--surface-2); }
.ig-items li.sel { background: var(--accent-2); }
.ig-items li small { color: var(--muted); font-variant-numeric: tabular-nums; }
.ig-items li.is-hidden > :not(.eye) { opacity: .45; }
.ig-head:hover .eye, .ig-items li:hover .eye, .ig-items li.is-hidden .eye { opacity: 1; }
.toolbar #btn-infra svg, .toolbar #btn-objects svg { width: 19px; height: 19px; }
.menu svg.lsample { width: 40px; height: 12px; }

/* print preview overlay */
.print-overlay { position: fixed; inset: 0; z-index: 260; display: flex; flex-direction: column; background: #3b403d; }
.print-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.print-bar b { display: flex; gap: 8px; align-items: center; }
.print-frame { flex: 1; min-height: 0; }
.print-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #e9e9e4; }

/* backups dialog */
.bk-status { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-2); margin-bottom: 12px; }
.bk-status b, .bk-status small { display: block; }
.bk-status small { color: var(--muted); max-width: 380px; margin-top: 3px; }
.bk-status small.warn { color: #b86d0e; font-weight: 600; }
.bk-freq { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-freq select { width: auto; padding: 4px 8px; font-size: 13px; background: var(--surface); }
.bk-status small.err { color: var(--danger); }
.bk-usage { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.bk-usage b { display: block; font-size: 15px; color: var(--text); }
.bk-dl { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-dl small { font-weight: 400; opacity: .8; }
.bk-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 260px; overflow: auto; }
.bk-list li { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bk-list .chip.manual { background: var(--accent-2); color: var(--accent); border-color: transparent; }
.bk-list .chip.pre { background: rgba(224,138,30,.14); color: #b86d0e; border-color: transparent; }
.bk-script pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; font-size: 11.5px; overflow: auto; max-height: 220px; white-space: pre; }
.bk-script summary { cursor: pointer; font-weight: 600; font-size: 13px; margin: 8px 0; }
#bk-body .sec-title { margin-top: 18px; }
#bk-body > p, #bk-body .row { margin: 6px 0; }

/* ---------------------------------------------------------------- whole-farm calendar */
.cal-overlay { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; background: var(--bg); --name-w: 220px; }
.cal-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-bar > b { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.cal-bar .seg button { display: inline-flex; align-items: center; }
.cal-q { width: 180px !important; padding: 5px 9px !important; }
.cal-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.cal-filters .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.cal-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; opacity: .5; user-select: none; }
.cal-chip.on { opacity: 1; background: var(--surface-2); }
.cal-chip input { display: none; }
.cal-chip i { width: 10px; height: 10px; border-radius: 3px; }
.hint-ed { margin-left: auto; }
.cal-summary { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 8px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.cal-summary > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cal-summary b { margin-right: 4px; }
.cal-pill { display: inline-flex; gap: 4px; align-items: baseline; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.cal-pill small { color: var(--muted); }
.cal-scroll { flex: 1; overflow: auto; }
.cal-grid { position: relative; min-width: max-content; }
.cal-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.cal-row { display: flex; border-bottom: 1px solid var(--line); }
.cal-row:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.cal-name { width: var(--name-w); flex: none; position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.cal-name.head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: default; }
.cal-name:not(.head):hover b { text-decoration: underline; }
.cal-name span { min-width: 0; }
.cal-name b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-name small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-name small em { font-style: normal; }
.cal-name .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cal-months { display: flex; }
.cal-year { border-left: 1px solid var(--line-2); }
.cal-year b { display: block; font-size: 12px; padding: 4px 6px 0; }
.cal-year div { display: flex; }
.cal-year i { font-style: normal; text-align: center; font-size: 10.5px; color: var(--muted); padding: 2px 0 4px; }
.cal-year i.now { color: var(--danger); font-weight: 700; }
.cal-track { position: relative; flex: none;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--mw) - 1px), color-mix(in srgb, var(--line) 60%, transparent) calc(var(--mw) - 1px) var(--mw)),
                    repeating-linear-gradient(90deg, transparent 0 calc(var(--mw) * 12 - 1px), var(--line-2) calc(var(--mw) * 12 - 1px) calc(var(--mw) * 12)); }
body:not([data-role="viewer"]):not([data-role="commenter"]) .cal-track { cursor: copy; }
.cal-bar-item { position: absolute; height: 21px; border-radius: 6px; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 650; display: flex; align-items: center; overflow: hidden; cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); user-select: none; touch-action: none; }
.cal-bar-item span { padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; pointer-events: none; }
.cal-bar-item.st-planned { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 75%, #fff) 6px 12px); }
.cal-bar-item.st-done { opacity: .55; }
.cal-bar-item.st-cancelled { opacity: .3; text-decoration: line-through; }
.cal-bar-item.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar-item.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar-item .h { width: 7px; align-self: stretch; flex: none; cursor: ew-resize; }
.cal-bar-item .h:hover { background: rgba(255,255,255,.35); }
.cal-bar-item:hover { filter: brightness(1.08); z-index: 2; }
.cal-bar-item.dragging { z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.35); cursor: grabbing; }
.cal-bar-item.dragging::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 4px); translate: -50% 0; background: #1c2420; color: #fff; padding: 3px 8px; border-radius: 6px; white-space: nowrap; font-size: 11px; }
.cal-bar-item.dragging { overflow: visible; }
.cal-task { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; transform: rotate(45deg); background: #2980b9; border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); z-index: 3; }
.cal-task.late { background: var(--danger); }
.cal-task.done { background: #7f8c8d; }
.cal-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .6; pointer-events: none; z-index: 1; }
.cal-links { margin: -2px 0 8px; gap: 6px; }

/* templates */
.tpl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tpl-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.tpl-list li b { display: block; }
.tpl-list li p { margin: 4px 0; }
.tpl-btns { display: flex; gap: 4px; align-items: center; flex: none; }
.tpl-prev { position: relative; height: 12px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 6px; overflow: hidden; }
.tpl-prev i { position: absolute; top: 1px; bottom: 1px; border-radius: 3px; }
.tpl-steps { width: 100%; border-collapse: collapse; font-size: 13px; }
.tpl-steps th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 4px; }
.tpl-steps td { padding: 3px; }
.tpl-steps input, .tpl-steps select { padding: 5px 7px; font-size: 13px; }
.tpl-steps input[type=number] { width: 80px; }
.zone-checks { max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.zone-checks .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 2px; }
.apply-summary .alert { display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------- before / after */
.cmp-overlay { position: fixed; inset: 0; z-index: 140; background: #060807; color: #fff; display: flex; flex-direction: column; }
.cmp-top { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: rgba(0,0,0,.6); flex-wrap: wrap; }
.cmp-title { flex: 1; min-width: 200px; }
.cmp-title .v-path { font-size: 16px; }
.cmp-title .v-path span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-title .pt { color: #ffe39a; }
.cmp-sub { color: rgba(255,255,255,.7); }
.cmp-overlay .seg { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }
.cmp-overlay .seg button { color: rgba(255,255,255,.75); display: inline-flex; gap: 5px; align-items: center; }
.cmp-overlay .seg button.on { background: rgba(255,255,255,.92); color: #000; }
.cmp-actions { display: flex; gap: 4px; align-items: center; }
.cmp-actions .icon-btn.on { background: rgba(244, 201, 93, .3); color: #ffe39a; }
.cmp-stage { flex: 1; position: relative; overflow: hidden; touch-action: none; cursor: grab; min-height: 0; }
.cmp-stage:active { cursor: grabbing; }
.cmp-pane { position: absolute; top: 0; bottom: 0; overflow: hidden; }
.cmp-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.cmp-world img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.cmp-adj { width: 100%; height: 100%; transform-origin: 50% 50%; }
.cmp-label { position: absolute; top: 10px; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.65); font-size: 13px; pointer-events: none; }
.cmp-label.l { left: 10px; } .cmp-label.r { right: 10px; }
.cmp-divider { position: absolute; top: 0; bottom: 0; width: 0; z-index: 3; cursor: ew-resize; }
.cmp-divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 3px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.7); }
.cmp-divider::after { content: ""; position: absolute; top: 0; bottom: 0; left: -16px; width: 32px; }
.cmp-divider i { position: absolute; top: 50%; left: -19px; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E"); background-size: 22px; background-position: center; background-repeat: no-repeat; }
.cmp-fade { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; z-index: 3; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.65); padding: 8px 14px; border-radius: 999px; font-size: 13px; }
.cmp-fade input { width: 220px; accent-color: #fff; }
.cmp-overlay.aligning .cmp-stage { cursor: move; }
.cmp-alignbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; background: #1d2420; font-size: 13px; }
.cmp-alignbar label { display: flex; align-items: center; gap: 6px; }
.cmp-alignbar .muted { color: rgba(255,255,255,.6); }
.cmp-notes { display: flex; gap: 8px; padding: 8px 12px; background: #111614; }
.cmp-notes input { max-width: 340px; }
.cmp-notes input, .cmp-notes textarea { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.15); color: #fff; resize: vertical; min-height: 0; }
.cmp-notes p { margin: 0; color: rgba(255,255,255,.85); }
.dark-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.dark-btn:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.3); }
.cmp-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; }
.cmp-tile { position: relative; border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--surface-2); cursor: pointer; text-align: left; overflow: hidden; }
.cmp-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.cmp-tile span { display: block; padding: 4px 7px; font-size: 12px; }
.cmp-tile.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); }
.cmp-badge { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 13px; }
.cmp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cmp-list li { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: var(--radius-sm); cursor: pointer; }
.cmp-list li:hover { background: var(--surface-2); }
.cmp-list b, .cmp-list small { display: block; }
.cmp-list small { color: var(--muted); font-size: 12px; }
.cmp-thumb { display: flex; width: 76px; height: 40px; border-radius: 6px; overflow: hidden; flex: none; }
.cmp-thumb img { width: 50%; height: 100%; object-fit: cover; }
.cmp-thumb img + img { border-left: 2px solid #fff; }
.cmp-section { margin-bottom: 4px; }

/* ---------------------------------------------------------------- projects */
.tabs button { padding-left: 1px; padding-right: 1px; font-size: 12.5px; }
.ptype-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.ptype-ic svg { width: 17px; height: 17px; }
.ptype-ic.sm { width: 22px; height: 22px; border-radius: 6px; }
.ptype-ic.sm svg { width: 13px; height: 13px; }
.plist-proj li { align-items: flex-start; }
.plist-proj li .grow { min-width: 0; }
.plist-proj small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); font-size: 12px; margin-top: 2px; }
.plist-proj .pmeta .warn { color: var(--danger); font-weight: 700; }
.plist-proj .prog { display: inline-block; width: 54px; height: 5px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.plist-proj .prog i { display: block; height: 100%; background: var(--accent); }
.status-pill.sm { padding: 1px 8px; font-size: 11px; }
.ptype-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ptype-pick label { cursor: pointer; }
.ptype-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ptype-pick label > span { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); height: 100%; }
.ptype-pick label > span svg { width: 20px; height: 20px; grid-row: span 2; color: var(--muted); margin-top: 1px; }
.ptype-pick small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.ptype-pick input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); }
.ptype-pick input:checked + span svg { color: var(--accent); }
.ptype-pick input:focus-visible + span { outline: 2px solid var(--accent); }
.phase-steps { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.phase-steps button { flex: 1 1 0; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); font-size: 11px; line-height: 1.15; color: var(--muted); cursor: pointer; text-align: center; }
.phase-steps button:disabled { cursor: default; }
.phase-steps button i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.phase-steps button.past i { background: color-mix(in srgb, var(--c) 30%, transparent); color: var(--text); }
.phase-steps button.on { border-color: var(--c); color: var(--text); font-weight: 700; background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.phase-steps button.on i { background: var(--c); color: #fff; }
.phase-steps button:not(:disabled):hover { border-color: var(--c); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; margin: 10px 0; }
.kpi-row > div { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 7px; background: var(--surface); }
.kpi-row > div[role=button] { cursor: pointer; }
.kpi-row > div[role=button]:hover { background: var(--surface-2); }
.kpi-row b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-row span { color: var(--muted); font-size: 11.5px; }
.kpi-row .over b { color: var(--danger); }
.kpi-row .ok b { color: var(--accent); }
.budget-bar { display: flex; height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: -2px 0 12px; }
.budget-bar .paid { background: var(--accent); } .budget-bar .rest { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.link-row { gap: 6px; margin-top: 6px; }
.link-row select { flex: 1; min-width: 140px; }
.pick-hint { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.pick-bar { position: absolute; left: 50%; top: 12px; translate: -50% 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 4px 18px rgba(0,0,0,.25); border: 2px solid var(--accent); font-size: 13px; max-width: calc(100% - 24px); }
.pick-bar svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
body.picking-project .map { cursor: crosshair; }
svg.zones.proj-mode polygon.zone:not(.proj) { fill-opacity: calc(var(--f) * .35); stroke-opacity: .45; }
svg.zones polygon.zone.proj { fill: var(--pc); fill-opacity: calc(var(--f) + .22); stroke: #fff; stroke-width: 3; filter: drop-shadow(0 0 3px var(--pc)) drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.panel[data-type="project"] .swatch { cursor: pointer; }
/* calendar: projects */
.cal-section { position: sticky; left: 0; padding: 6px 10px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }
.cal-section svg { width: 14px; height: 14px; }
.cal-proj-bar { position: absolute; height: 20px; border-radius: 5px; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 20px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cal-proj-bar.ph-idea, .cal-proj-bar.ph-study { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 70%, #fff) 6px 12px); }
.cal-proj-bar.ph-cancelled { opacity: .35; text-decoration: line-through; }
.cal-proj-bar.ph-done { opacity: .6; }
.cal-proj-extra { position: absolute; height: 10px; margin-top: 5px; border-radius: 3px; background: color-mix(in srgb, var(--c) 40%, transparent); border: 1px dashed var(--c); pointer-events: none; }
.cal-name .ptype-ic { width: 20px; height: 20px; border-radius: 5px; margin-right: 6px; }
.cal-name .ptype-ic svg { width: 12px; height: 12px; }
.cal-pill[data-goto-project] { cursor: pointer; }
.cost-list { display: flex; flex-direction: column; gap: 6px; }
.cost-line { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-left: 3px solid #b0b0b0; border-radius: var(--radius-sm); background: var(--surface); }
.cost-line.st-quote { border-left-color: #e67e22; } .cost-line.st-paid { border-left-color: var(--accent); }
.cost-line input, .cost-line select { min-width: 0; padding: 4px 6px; font-size: 12.5px; }
.cost-line .cl-label { font-weight: 600; }
.cost-line .cl-total { font-size: 13px; white-space: nowrap; padding: 0 2px; }
.cost-line .cl-sub { grid-column: 1 / -1; display: flex; gap: 4px; align-items: center; font-size: 12px; }
.cost-line .cl-sub input[data-c=supplier] { flex: 1; }
.cost-line .cl-sub .cl-n { width: 46px; text-align: right; } .cost-line .cl-sub .cl-p { width: 78px; text-align: right; }
.cost-line .cl-sub select { width: 112px; }
.cost-line.ro .cl-sub { display: block; }
.cost-sum { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: space-between; margin: 8px 2px; }
.kpi-input { width: 100%; font-size: 15px; font-weight: 700; padding: 0 4px; border: 1px dashed var(--line); background: transparent; }
.sidebar { container-type: inline-size; }
.tabs button { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 330px) { .tabs [data-tab=zones] .count, .tabs [data-tab=points] .count { display: none; } }
@container (max-width: 250px) { .tabs .count { display: none; } }
.cal-proj-lbl { position: absolute; top: 7px; font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: pointer; z-index: 1; text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface); }
.cal-proj-lbl small { color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------------- objects at real size */
svg.zones polygon.obj { fill: var(--oc); fill-opacity: .62; stroke: #fff; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg.zones polygon.obj.st-planned { fill-opacity: .48; stroke-dasharray: 5 3; }
svg.zones polygon.obj.st-repair { stroke: #e53935; }
svg.zones polygon.obj.st-remove { fill: #8a8a8a; fill-opacity: .3; stroke-opacity: .6; }
svg.zones polygon.obj.dim { fill-opacity: .18; stroke-opacity: .35; }
svg.zones polygon.obj.hl { stroke: var(--pc, #f4c95d); stroke-width: 2.6; stroke-dasharray: none; fill-opacity: .72; }
svg.zones polygon.obj.clash { stroke: #ff3b30; stroke-width: 2.4; stroke-dasharray: 4 2; }
svg.zones polygon.obj.sel { stroke: #f4c95d; stroke-width: 2.8; stroke-dasharray: none; fill-opacity: .72; filter: drop-shadow(0 0 4px rgba(0,0,0,.75)); }
svg.zones polygon.obj.ghost { fill-opacity: .35; stroke: #f4c95d; stroke-width: 2; stroke-dasharray: 6 3; }
svg.zones text.obj-l .a { font-size: .82em; }
svg.zones text.obj-ml { stroke: #5a3c00; }
svg.zones .obj-size { fill: #fff; stroke: #1c2420; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
svg.zones .obj-rot { fill: #f4c95d; stroke: #1c2420; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
svg.zones .obj-rot-line { stroke: #f4c95d; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map.on-obj { cursor: move; }
.map.on-rot { cursor: grab; }
.map[data-tool="object"] { cursor: copy; }
.pf.wide { grid-column: 1 / -1; }
.unit-in { display: flex; align-items: center; gap: 4px; min-width: 0; }
.unit-in input { width: 100%; min-width: 0; }
.unit-in i { font-style: normal; color: var(--muted); font-size: 12px; }
.rot-row { display: flex; align-items: center; gap: 2px; }
.rot-row .icon-btn { font-size: 15px; line-height: 1; }
.obj-facts { font-size: 13px; margin: 8px 0; }
.obj-clash { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.obj-row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin-top: 8px; }
.obj-row-form input { width: 58px; }
.obj-row-form label { display: inline-flex; align-items: center; gap: 4px; }
.obj-count { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.obj-count .emo { width: 22px; display: inline-block; text-align: center; }
.proj-objs { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px 10px; margin: 10px 0; }
.proj-objs .sec-title { margin-top: 0; }
.obj-cap { margin: 0; padding: 0 10px 6px 30px; }
.pick-note { padding: 6px 8px 2px; margin: 0; }
.menu.infra-picker h4 .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ---------------------------------------------------------------- scenarios (alternative layouts) */
.scen-now { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px 10px; margin: 8px 0 12px; }
.scen-now .sec-title { margin-top: 0; }
.scen-now p { margin: 4px 0; }
.danger-t { color: var(--danger); font-weight: 600; }
.warn-t { color: #b26a00; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.scen-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.scen { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.scen.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.scen-head { display: flex; align-items: flex-start; gap: 8px; }
.scen-head small { display: block; color: var(--muted); font-size: 12px; }
.scen-head .chip.on { background: var(--accent); color: var(--accent-text); }
.scen-pick { padding-top: 2px; }
.scen-thumb { margin: 6px 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); min-height: 40px; }
.scen-thumb svg.pmap, .scen-cmp-maps svg.pmap { display: block; width: 100%; height: auto !important; }
.scen p { margin: 4px 0; }
.scen-notes { white-space: pre-wrap; color: var(--muted); }
.scen-act { margin-top: 6px; align-items: center; }
.scen-foot { margin-top: 12px; }
.scen-hint { cursor: pointer; display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; color: var(--muted); }
.scen-hint:hover { color: var(--text); }
.modal.wide.xwide { max-width: min(1200px, 96vw); }
.scen-cmp-maps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; }
.scen-cmp-maps figure { margin: 0; }
.scen-cmp-maps figcaption { font-size: 14px; margin-bottom: 4px; }
.scen-cmp-maps figcaption small { display: block; color: var(--muted); font-size: 12px; }
.scen-cmp-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin: 14px 0 6px; }
.scen-cmp-tbl th, .scen-cmp-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.scen-cmp-tbl th:first-child { text-align: left; font-weight: 500; color: var(--muted); }
.scen-cmp-tbl thead th { border-bottom: 2px solid var(--line-2); color: var(--text); }
.scen-cmp-tbl td.best { color: #1f9d55; font-weight: 700; }
.scen-cmp-tbl tr.sub th { text-align: left; padding-top: 12px; color: var(--text); font-weight: 650; }
@media (max-width: 760px) { .scen-cmp-maps { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- map on a date */
.date-bar { position: absolute; top: 12px; left: 50%; translate: -50% 0; z-index: 25; width: min(760px, calc(100% - 110px)); background: var(--surface); color: var(--text);
  border-radius: 14px; box-shadow: var(--shadow); padding: 8px 12px 8px; display: grid; gap: 4px; }
.date-bar .db-row { display: flex; align-items: center; gap: 8px; }
.date-bar .db-row > svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.date-bar .db-title { font-size: 14px; }
.date-bar .db-date { width: auto; padding: 4px 8px; font-size: 14px; }
.date-bar .db-steps { display: flex; align-items: center; gap: 2px; }
.date-bar .db-steps .icon-btn { font-size: 16px; line-height: 1; }
.db-slider { position: relative; padding: 2px 0 14px; }
.db-slider input[type=range] { width: 100%; margin: 0; position: relative; z-index: 2; accent-color: var(--accent); }
.db-marks { position: absolute; left: 0; right: 0; top: 22px; height: 12px; }
.db-marks i { position: absolute; top: 0; height: 6px; border-radius: 3px; }
.db-marks i.pj { opacity: .85; cursor: pointer; }
.db-marks i.yr { width: 1px; height: 12px; top: -2px; background: var(--line-2); }
.db-marks i.yr span { position: absolute; left: 3px; top: 1px; font-size: 9.5px; color: var(--muted); font-style: normal; }
.db-marks i.now { width: 2px; height: 12px; top: -3px; background: #e53935; }
.db-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.db-day { font-weight: 650; }
.db-pj { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.db-pj i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.db-pj small { color: var(--muted); }
.db-next { margin-left: auto; }
body.date-mode .hint { top: 150px; }
body.date-mode .pick-bar { top: 150px; }
#btn-datemap.on { background: var(--accent); color: var(--accent-text); }
svg.zones polygon.date-proj { fill: none; stroke-width: 3.2; stroke-dasharray: 9 4; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 2px rgba(0,0,0,.7)); pointer-events: none; }
@media (max-width: 760px) {
  .date-bar { top: 8px; width: calc(100% - 16px); padding: 6px 8px; }
  .date-bar .db-title, .date-bar .db-steps [data-step="-30"], .date-bar .db-steps [data-step="30"] { display: none; }
  .date-bar .db-row { gap: 4px; }
  .date-bar .db-date { min-width: 0; flex: 1 1 auto; }
  body.date-mode .hint { top: 170px; }
}

/* ---------------------------------------------------------------- checks and constraint layers */
.chk-sum { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.chk-pill { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; }
.chk-pill.fail { background: rgba(192, 57, 43, .12); color: #c0392b; }
.chk-pill.warn { background: rgba(230, 126, 34, .14); color: #b35c00; }
.chk-pill.ok { background: rgba(39, 174, 96, .13); color: #1e8449; }
.chk-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.chk { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.chk[data-goto-infra], .chk[data-goto-zone] { cursor: pointer; }
.chk[data-goto-infra]:hover, .chk[data-goto-zone]:hover { background: var(--surface-2); }
.chk > svg { flex: none; margin-top: 2px; width: 14px; height: 14px; }
.chk.fail > svg { color: #c0392b; } .chk.warn > svg { color: #e67e22; } .chk.ok > svg { color: #27ae60; } .chk.info > svg { color: var(--muted); }
.chk.ok, .chk.info { color: var(--muted); }
.chk-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0; }
.chk-tbl th, .chk-tbl td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.chk-tbl th:first-child, .chk-tbl td:first-child { text-align: left; }
.chk-tbl tbody tr { cursor: pointer; } .chk-tbl tbody tr:hover { background: var(--surface-2); }
.chk-tbl tfoot th { font-weight: 650; }
.chk-hint { cursor: pointer; display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; font-weight: 600; }
.chk-hint.fail { color: #c0392b; } .chk-hint.warn { color: #b35c00; }
.rules-grid { display: grid; gap: 8px; }
.rules-grid label { display: grid; grid-template-columns: 1fr 130px; align-items: center; gap: 10px; font-size: 13px; }
svg.zones .chk-line { stroke-width: 2.4; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1.5px rgba(0,0,0,.9)); }
svg.zones .chk-line.water { stroke: #4fc3f7; } svg.zones .chk-line.power { stroke: #fdd835; }
svg.zones .chk-end { stroke: #1c2420; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
svg.zones .chk-end.water { fill: #4fc3f7; } svg.zones .chk-end.power { fill: #fdd835; }
svg.zones text.chk-ml.water { stroke: #01579b; } svg.zones text.chk-ml.power { stroke: #6d5a00; }
svg.zones polygon.cons { stroke-width: 1.6; stroke-dasharray: 7 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.tip-cons { display: block; margin-top: 3px; color: #ffd28a; }
.tip-cons i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.cons-list { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 6px; }
.cons-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cons-list li input:not([type=color]) { min-width: 140px; }
.cons-list li select { max-width: 230px; }
.cons-list input[type=color] { width: 34px; height: 28px; padding: 0; border: 0; background: none; }
.cons-import { border-top: 1px solid var(--line); padding-top: 10px; }
.cons-form { display: grid; gap: 8px; }
.nowrap { white-space: nowrap; }
.bk-list .chip.full { background: rgba(41, 128, 185, .13); color: #1f6fa3; border-color: transparent; }
.bk-norestore { white-space: nowrap; cursor: help; }
.bk-auto .warn { color: #b86d0e; }
