/* Skogvy – design tokens */
:root {
  color-scheme: dark;
  --bg: #050d09;
  --surface: #0b1912;
  --surface-2: #0f2018;
  --glass: rgba(12, 26, 19, .72);
  --text: #e8f5ee;
  --text-2: #a7bfb1;
  --muted: #6f8b7c;
  --border: rgba(148, 230, 190, .13);
  --border-2: rgba(148, 230, 190, .22);
  --brand: #10b981;
  --brand-600: #34d399;
  --brand-50: rgba(52, 211, 153, .12);
  --brand-ink: #e6fff4;
  --on-brand: #03140b;
  --gold: #facc15;
  --focus: #facc15;
  --warn: #fb7185; --warn-bg: rgba(251, 113, 133, .09); --warn-bd: rgba(251, 113, 133, .32);
  --note: #fbbf24; --note-bg: rgba(251, 191, 36, .08); --note-bd: rgba(251, 191, 36, .3);
  --info: #60a5fa; --info-bg: rgba(96, 165, 250, .08); --info-bd: rgba(96, 165, 250, .28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, .65), 0 0 0 1px rgba(148, 230, 190, .06);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mod: #34d399;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Top bar */

/* Layout */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: 0; }
.map-area { position: relative; min-height: 380px; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.leaflet-container { font-family: var(--font); }

/* Tool rail */
.toolrail { position: absolute; top: 16px; left: 16px; z-index: 800; display: flex; flex-direction: column; gap: 8px; }
.tool-group { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: visible; }
.tool { position: relative; width: 42px; height: 42px; display: grid; place-items: center; background: transparent; border: 0; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.tool + .tool { border-top: 1px solid var(--border); }
.tool:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.tool:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.tool:only-child { border-radius: var(--radius); }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool svg circle { fill: var(--surface); }
.tool:hover:not(:disabled) { background: var(--brand-50); color: var(--brand-600); }
.tool.active { background: var(--brand); color: #fff; }
.tool.active svg circle { fill: var(--brand); }
.tool:disabled { color: var(--muted); opacity: .45; cursor: not-allowed; }
.tool[data-tip]::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translate(-4px, -50%); background: #101814; color: #fff; font-size: 12.5px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; box-shadow: var(--shadow-md); }
.tool[data-key]::after { content: attr(data-tip) "  ·  " attr(data-key); }
.tool:hover::after, .tool:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.tool:disabled::after { display: none; }

/* Place search */
.search { position: absolute; top: 16px; left: 72px; z-index: 850; width: min(440px, calc(100% - 340px)); min-width: 260px; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 0 4px 0 12px; height: 42px; }
.search:focus-within { border-color: var(--brand-600); }
.search-ico { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 0 8px; height: 100%; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-go { border: 0; background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.search-go:hover { background: var(--brand-600); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); max-height: 320px; overflow-y: auto; }
.search-results li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.search-results li:hover, .search-results li[aria-selected="true"] { background: var(--brand-50); }
.search-results .typ { color: var(--muted); font-size: 12px; white-space: nowrap; }
.search-results .empty { color: var(--muted); cursor: default; }
.search-results .empty:hover { background: transparent; }

/* Base map switch */
.basemap { position: absolute; top: 16px; right: 16px; z-index: 800; display: flex; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); }
.basemap button { border: 0; background: transparent; color: var(--text-2); padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; }
.basemap button[aria-checked="true"] { background: var(--brand); color: #fff; }
.basemap button:hover[aria-checked="false"] { background: var(--brand-50); }

/* Action bar while drawing */
.actionbar { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 800; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow-md); max-width: calc(100% - 32px); }
.actionbar-text { font-size: 13.5px; color: var(--text-2); margin-right: 6px; }
.ab-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ab-btn:hover { background: var(--surface-2); }
.ab-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.ab-btn.primary:hover { background: var(--brand-600); }

.area-chip { position: absolute; left: 16px; bottom: 28px; z-index: 800; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow-md); }
.area-chip span { color: var(--muted); font-weight: 500; margin-left: 6px; }

/* Legend */
.legend { position: absolute; right: 16px; bottom: 28px; z-index: 800; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 10px 12px; font-size: 12.5px; min-width: 200px; }
.legend-title { font-weight: 600; margin-bottom: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.legend label { display: flex; align-items: center; gap: 8px; padding: 2px 0; cursor: pointer; color: var(--text-2); }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; border: 2px solid; flex-shrink: 0; }
.legend input { margin: 0 0 0 auto; accent-color: var(--brand); }

/* Leaflet overrides */
.leaflet-control-attribution { font-size: 10.5px; background: rgba(255,255,255,.8) !important; }
.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: var(--shadow-md); }
.leaflet-popup-content { font: 13px/1.45 var(--font); margin: 12px 14px; }
.leaflet-popup-content table { border-collapse: collapse; margin-top: 6px; }
.leaflet-popup-content td { padding: 2px 8px 2px 0; vertical-align: top; }
.leaflet-popup-content td:first-child { color: #667; }
.leaflet-draw-tooltip { background: #101814; border: 0; border-radius: 6px; font: 12px var(--font); padding: 4px 8px; }
.leaflet-draw-tooltip:before { border-right-color: #101814; }
.leaflet-draw-guide-dash { background-color: var(--brand) !important; }
.leaflet-editing-icon { border-radius: 50%; border: 2px solid var(--brand) !important; background: #fff !important; }

/* Panel */
.panel { background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; padding: 28px 28px 40px; }
.eyebrow { color: var(--brand-600); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
h1 { font-size: 23px; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 10px; }
h2 { font-size: 15px; margin: 28px 0 10px; letter-spacing: -.005em; }
.lead { color: var(--text-2); margin: 0 0 22px; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.step b { display: block; font-size: 14px; }
.step span { color: var(--muted); font-size: 13px; }
.step-no { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.step.done .step-no { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.current { border-color: var(--brand); background: var(--brand-50); }
.inline-ico { width: 14px; height: 14px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-primary { width: 100%; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 13px 18px; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); transition: background .15s; }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.report-actions .btn-primary, .report-actions .btn-secondary { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.report-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-secondary { width: 100%; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 11px 18px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 18px; }
.btn-secondary:hover { background: var(--surface-2); }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.includes { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.includes-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 8px; }
.includes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.includes li { padding-left: 24px; position: relative; color: var(--text-2); font-size: 13.5px; }
.includes li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px; border-left: 2px solid var(--brand-600); border-bottom: 2px solid var(--brand-600); transform: rotate(-45deg); }

#loading { text-align: center; padding: 80px 0; }
.spinner { width: 36px; height: 36px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid var(--brand-50); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Report */
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.meta { color: var(--muted); font-size: 12.5px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }
.stat.wide { grid-column: 1 / -1; }
.stat.locked .v { color: var(--muted); font-size: 14px; font-weight: 500; }
.finding { display: flex; gap: 10px; border: 1px solid; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; font-size: 13.5px; }
.finding .ico { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.finding b { display: block; margin-bottom: 2px; font-size: 14px; color: var(--text); }
.finding p { margin: 0; color: var(--text-2); }
.finding.varning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn); }
.finding.notis { background: var(--note-bg); border-color: var(--note-bd); color: var(--note); }
.finding.info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info); }
.ai { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px; font-size: 13.5px; }
.ai h1, .ai h2, .ai h3 { font-size: 14px; margin: 12px 0 4px; }
.sources { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
.sources .row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--border); padding: 3px 0; }
.sources .bad { color: var(--warn); }
.disclaimer { font-size: 12px; color: var(--muted); margin-top: 20px; }

/* Mobile */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 58vh auto; }
  .panel { border-left: 0; border-top: 1px solid var(--border); padding: 20px 16px 32px; }
  .toolrail { top: 12px; left: 12px; }
  .search { top: 12px; left: 64px; right: 12px; width: auto; min-width: 0; }
  .basemap { top: auto; bottom: 16px; right: 12px; }
  .basemap button { padding: 5px 9px; font-size: 12px; }
  .area-chip { left: 12px; bottom: 16px; }
  .legend { display: none; }
  .tool[data-tip]::after { display: none; }
  .actionbar { bottom: 16px; padding: 8px; flex-wrap: wrap; justify-content: center; }
  .actionbar-text { width: 100%; text-align: center; margin: 0 0 4px; }
}

/* ================= Platform shell ================= */
.content { min-width: 0; min-height: 0; overflow-y: auto; position: relative; }
.view-map { position: absolute; inset: 0; display: flex; }
.view-map .layout { flex: 1; }

.page { padding: 28px 32px 48px; max-width: 1240px; }
.page.narrow { max-width: 1040px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 18px 0 18px; }
.page h1 { font-size: 26px; margin-bottom: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.card h2 { margin: 0 0 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-head a { font-size: 13px; color: var(--brand-600); text-decoration: none; font-weight: 600; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--note-bg); border: 1px solid var(--note-bd); color: var(--text-2); border-radius: var(--radius); padding: 12px 16px; font-size: 13.5px; margin-bottom: 8px; }
.btn-small { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-small:hover { background: var(--brand-600); }
.btn-small.outline { background: transparent; color: var(--brand-600); border: 1px solid var(--brand-600); margin-top: 12px; }
.btn-link { background: none; border: 0; color: var(--brand-600); font-weight: 600; font-size: 13px; padding: 0; margin-top: 12px; cursor: pointer; }

.kpis, .risks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12.5px; color: var(--text-2); }
.risk { border-top: 3px solid var(--border); }
.risk.varning { border-top-color: var(--warn); }
.risk.notis { border-top-color: var(--note); }
.risk-top { display: flex; justify-content: space-between; align-items: center; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.chip.varning { background: var(--warn-bg); color: var(--warn); }
.chip.notis { background: var(--note-bg); color: var(--note); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); text-decoration: none; color: var(--text-2); font-size: 13px; }
.alert:first-of-type { border-top: 0; }
.alert b { display: block; color: var(--text); font-size: 13.5px; }
.alert-ico { flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.alert-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.alert.varning .alert-ico { background: var(--warn-bg); color: var(--warn); }
.alert.notis .alert-ico { background: var(--note-bg); color: var(--note); }
.alert-date { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.money { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.money b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.sum { border-bottom: 1px solid var(--border); font-weight: 600; }
.money.total { border: 0; margin-top: 6px; padding: 12px 14px; background: var(--brand-50); border-radius: 10px; color: var(--text); font-weight: 600; }
.money.total b { font-size: 18px; color: var(--brand-600); }
.money.total.neg b { color: var(--warn); }
.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kv td { padding: 6px 0; border-bottom: 1px dashed var(--border); color: var(--text-2); }
.kv td:first-child { color: var(--text); font-weight: 500; }
.kv td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.module-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.module-head h1 { margin: 0; }
.module-head .eyebrow { margin-bottom: 2px; }
.module-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; flex-shrink: 0; }
.module-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.status { margin-left: auto; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.s-live { background: var(--brand-50); color: var(--brand-600); }
.s-part { background: var(--info-bg); color: var(--info); }
.s-wait { background: var(--note-bg); color: var(--note); }
.s-soon { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.checks li { padding-left: 26px; position: relative; color: var(--text-2); }
.checks li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 12px; height: 7px; border-left: 2px solid var(--brand-600); border-bottom: 2px solid var(--brand-600); transform: rotate(-45deg); }
.view-modul .btn-small, #view-modul .btn-small { margin-top: 18px; }

.econ { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 12px; }
.form { display: grid; gap: 10px; }
.field span { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; }
.input-unit { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.input-unit:focus-within { border-color: var(--brand-600); }
.input-unit input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.input-unit em { font-style: normal; font-size: 12px; color: var(--muted); padding: 0 10px; background: var(--surface-2); align-self: stretch; display: flex; align-items: center; border-left: 1px solid var(--border); }
.result { align-self: start; position: sticky; top: 16px; }

@media (max-width: 1100px) {
  .kpis, .risks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pill { margin-left: auto; }
  .content { overflow: visible; }
  .view-map { position: static; display: block; }
  .page { padding: 18px 16px 40px; }
  .grid-2, .econ { grid-template-columns: 1fr; }
  .demo-banner { flex-direction: column; align-items: flex-start; }
  .result { position: static; }
}
@media (max-width: 520px) {
  .kpis, .risks { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-v { font-size: 21px; }
  .card { padding: 14px; }
}

/* Satellite box in report */
.sat-box { border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px; }
.sat-box .finding:last-of-type { margin-bottom: 4px; }
.sat-loading { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.spinner.small { width: 20px; height: 20px; border-width: 2px; margin: 0; }

/* Assistant chat */
.view-chat { height: 100%; }
.chat { display: flex; flex-direction: column; height: 100%; max-width: 860px; padding: 24px 32px 16px; }
.chat-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.chat-head h1 { margin: 0; font-size: 22px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 16px; min-height: 200px; }
.chat-empty { margin: auto 0; text-align: center; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chip-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.chip-btn:hover { border-color: var(--brand-600); color: var(--brand-600); }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.55; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.err { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-sm); }
.chat-input:focus-within { border-color: var(--brand-600); }
.chat-input textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 14.5px; padding: 6px 8px; max-height: 160px; }
.chat-note { font-size: 11.5px; color: var(--muted); text-align: center; margin: 8px 0 0; }
@media (max-width: 900px) { .chat { padding: 16px; height: calc(100vh - 64px); } .msg { max-width: 92%; } }

/* Accounts */
.user-area { margin-left: 12px; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 12px 5px 8px; font-size: 13px; font-weight: 500; cursor: pointer; max-width: 220px; }
.user-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn svg, .empty-state svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 16, 12, .45); display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; width: min(420px, 100%); background: var(--surface); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-md); }
.modal-card h2 { margin: 0 0 6px; font-size: 19px; }
.modal-card .form { margin-top: 14px; }
.modal-card .btn-primary { margin-top: 6px; }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-switch { margin-top: 14px; text-align: center; }
.modal-switch a { color: var(--brand-600); font-weight: 600; }
.form-err { color: var(--warn); font-size: 13px; margin: 0; }
.save-btn { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.save-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn-small.outline { margin-top: 0; }
.empty-state { text-align: center; padding: 36px 24px; }
.empty-state > svg { width: 36px; height: 36px; color: var(--brand-600); }
.empty-state .btn-small { margin-top: 10px; }
.prop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.prop-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.prop h2 { margin: 0 0 2px; }
.chip.ok { background: var(--brand-50); color: var(--brand-600); white-space: nowrap; }
a.chip { text-decoration: none; white-space: nowrap; }
.mini-findings { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.mini-findings li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--info); }
.mini-findings li.varning::before { background: var(--warn); }
.mini-findings li.notis::before { background: var(--note); }
.prop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.prop-actions .btn-small.outline { margin-top: 0; }
.prop-actions .btn-small:disabled { opacity: .6; }
.btn-link.danger { color: var(--warn); margin: 0 0 0 auto; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.toggle input { accent-color: var(--brand); width: 16px; height: 16px; }
.settings-row { display: flex; flex-direction: column; gap: 6px; }
.finding.read { opacity: .65; }
.finding .meta { margin-top: 4px; font-size: 12px; }
@media (max-width: 900px) { .user-btn span { display: none; } .prop-list { grid-template-columns: 1fr; } }

/* Forest plan */
.stand-label { background: rgba(255,255,255,.85); border: 0; box-shadow: none; font: 600 11px var(--font); padding: 1px 4px; border-radius: 4px; color: #17231b; }
.stand-label::before { display: none; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.plan-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.stand-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stand-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.stand-table td { padding: 6px 8px; border-bottom: 1px dashed var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }

.select { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; }

/* Checklist */
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px dashed var(--border); }
.check-row:first-of-type { border-top: 0; }
.check-row b { font-size: 13.5px; }
.check-row p { margin: 2px 0 0; }
.check-ico { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.s-fail { background: var(--warn-bg); color: var(--warn); }

/* =====================================================================
   Skogvy design layer – dark "forest control room", glass and glow
   ===================================================================== */
body {
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(16, 185, 129, .17), transparent 62%),
    radial-gradient(900px 520px at 100% -6%, rgba(250, 204, 21, .07), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, rgba(34, 211, 238, .06), transparent 60%),
    linear-gradient(rgba(52, 211, 153, .03) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, rgba(52, 211, 153, .03) 1px, transparent 1px) 0 0 / 46px 46px,
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, .kpi-v, .stat .v, .money.total b { font-family: var(--display); }
h1 { letter-spacing: -.02em; }
a { color: var(--brand-600); }
::selection { background: rgba(250, 204, 21, .35); }
* { scrollbar-width: thin; scrollbar-color: rgba(148, 230, 190, .2) transparent; }

/* ---------- Top bar ---------- */
.topbar {
  position: relative; z-index: 1500; display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 20px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(8, 20, 14, .92), rgba(6, 15, 11, .86));
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, .55) 20%, rgba(250, 204, 21, .5) 50%, rgba(52, 211, 153, .55) 80%, transparent);
  opacity: .55;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(52, 211, 153, .35)); }
.bm-sat { transform-origin: 20px 20px; animation: sk-rot 9s linear infinite; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font: 700 23px/1 var(--display); letter-spacing: -.03em; }
.b-skog { background: linear-gradient(135deg, #6ee7b7, #10b981 55%, #059669); -webkit-background-clip: text; background-clip: text; color: transparent; }
.b-vy { background: linear-gradient(135deg, #fef08a, #facc15 50%, #eab308); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 22px rgba(250, 204, 21, .25); }
.brand-tag { margin-top: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); background: rgba(250, 204, 21, .08); border: 1px solid rgba(250, 204, 21, .28); padding: 4px 10px; border-radius: 999px; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: sk-blink 1.8s ease-in-out infinite; }
.user-area { margin-left: 0; }
.user-btn { background: rgba(255, 255, 255, .03); border-color: var(--border-2); }
.user-btn:hover { border-color: var(--brand-600); }
.menu-btn { display: none; background: rgba(255, 255, 255, .04); border: 1px solid var(--border-2); border-radius: 10px; width: 40px; height: 40px; color: var(--text); cursor: pointer; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Horizontal navigation ---------- */
.mainnav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav-drop { position: relative; }
.nav-top {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); text-decoration: none; font: 500 13.5px var(--font);
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.nav-top svg { width: 17px; height: 17px; fill: none; stroke: var(--c); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--c) 55%, transparent)); }
.nav-top .chev { width: 14px; height: 14px; stroke: var(--muted); filter: none; transition: transform .2s; }
.nav-top:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav-top.active, .nav-drop.active > .nav-top { color: var(--text); background: color-mix(in srgb, var(--c) 11%, transparent); border-color: color-mix(in srgb, var(--c) 28%, transparent); }
.nav-top.active::after, .nav-drop.active > .nav-top::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 2px; border-radius: 2px;
  background: var(--c); box-shadow: 0 0 12px var(--c), 0 0 2px var(--c);
}
.nav-drop.open > .nav-top { background: rgba(255, 255, 255, .06); color: var(--text); }
.nav-drop.open .chev { transform: rotate(180deg); }
.nav-dots { display: grid; grid-template-columns: repeat(2, 6px); gap: 2px; }
.nav-dots i { width: 6px; height: 6px; border-radius: 2px; box-shadow: 0 0 6px currentColor; }
.nav-dots i:nth-child(3) { grid-column: 1 / span 2; width: 14px; }

.dropdown {
  position: absolute; top: calc(100% + 14px); left: -8px; min-width: 330px; padding: 14px;
  background: linear-gradient(180deg, rgba(12, 27, 20, .97), rgba(7, 17, 12, .97));
  border: 1px solid var(--border-2); border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(52, 211, 153, .05), 0 0 40px -10px rgba(52, 211, 153, .25);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s;
}
.dropdown::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; } /* hover bridge */
.nav-drop:last-child .dropdown { left: auto; right: -8px; }
.nav-drop.open .dropdown { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 1061px) {
  .nav-drop:hover .dropdown { opacity: 1; visibility: visible; transform: none; }
  .nav-drop:hover .chev { transform: rotate(180deg); }
}
.dd-title { margin: 2px 6px 10px; font: 600 10.5px var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.dd-grid { display: grid; gap: 6px; }
.dd-grid.two { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
.mtile {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 13px; text-decoration: none; color: var(--text);
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s;
}
.mtile:hover { background: color-mix(in srgb, var(--c) 9%, transparent); border-color: color-mix(in srgb, var(--c) 30%, transparent); transform: translateX(2px); }
.mtile.active { background: color-mix(in srgb, var(--c) 12%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.mtile-ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: var(--c);
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 32%, transparent), color-mix(in srgb, var(--c) 8%, transparent) 70%);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  box-shadow: 0 0 18px -4px color-mix(in srgb, var(--c) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.mtile-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mtile-txt { display: flex; flex-direction: column; min-width: 0; }
.mtile-txt b { font-size: 13.5px; font-weight: 600; }
.mtile-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile-soon { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--note); border: 1px solid var(--note-bd); border-radius: 999px; padding: 2px 7px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 11px; display: grid; place-items: center; box-shadow: 0 0 10px var(--warn); }

/* ---------- Layout ---------- */
.app { flex: 1; display: flex; min-height: 0; }
.page { margin: 0 auto; }
.chat { margin: 0 auto; }
.content { flex: 1; }

/* ---------- Glass surfaces ---------- */
.card, .stat, .step, .ai, .chat-input, .msg.bot {
  background: linear-gradient(180deg, rgba(17, 36, 27, .72), rgba(9, 21, 15, .72));
  border-color: var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card { border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 18px 40px -28px rgba(0, 0, 0, .9); }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(52, 211, 153, .5), transparent); }
.kpi-v { font-size: 28px; }
.panel { background: linear-gradient(180deg, rgba(10, 23, 17, .94), rgba(6, 15, 11, .96)); border-left-color: var(--border); backdrop-filter: blur(14px); }
.toolrail .tool-group, .search, .basemap, .actionbar, .area-chip, .legend, .search-results {
  background: rgba(9, 21, 15, .88); border-color: var(--border-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tool svg circle { fill: #0b1912; }
.tool.active { background: linear-gradient(135deg, #34d399, #10b981); color: var(--on-brand); box-shadow: 0 0 18px -4px rgba(52, 211, 153, .8); }
.tool.active svg circle { fill: #10b981; }
.tool[data-tip]::after { background: #020805; border: 1px solid var(--border-2); }
.basemap button[aria-checked="true"], .search-go, .ab-btn.primary, .step.done .step-no { background: linear-gradient(135deg, #34d399, #10b981); color: var(--on-brand); border-color: transparent; }
.ab-btn { background: rgba(255, 255, 255, .04); border-color: var(--border-2); }
.step.current { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .5); box-shadow: 0 0 24px -12px rgba(52, 211, 153, .9); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-small {
  background: linear-gradient(135deg, #6ee7b7 0%, #10b981 45%, #0d9488 100%); color: var(--on-brand); font-weight: 700;
  box-shadow: 0 10px 26px -12px rgba(16, 185, 129, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: filter .15s, transform .15s, box-shadow .15s;
}
.btn-primary:hover:not(:disabled), .btn-small:hover { background: linear-gradient(135deg, #6ee7b7 0%, #10b981 45%, #0d9488 100%); filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(16, 185, 129, 1), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-small.outline { background: rgba(52, 211, 153, .05); color: var(--brand-600); border: 1px solid rgba(52, 211, 153, .45); box-shadow: none; }
.btn-small.outline:hover { background: rgba(52, 211, 153, .12); }
.btn-secondary { background: rgba(255, 255, 255, .03); border-color: var(--border-2); }
.msg.me { background: linear-gradient(135deg, #34d399, #0d9488); color: var(--on-brand); }
.chip-btn { background: rgba(255, 255, 255, .03); border-color: var(--border-2); }
.money.total { background: linear-gradient(135deg, rgba(52, 211, 153, .14), rgba(250, 204, 21, .06)); border: 1px solid rgba(52, 211, 153, .25); }
.money.total b { color: var(--gold); }
.input-unit, .select { background: rgba(0, 0, 0, .25); border-color: var(--border-2); }
.input-unit em { background: rgba(255, 255, 255, .03); }
.modal { background: rgba(1, 6, 3, .7); backdrop-filter: blur(6px); }
.modal-card { background: linear-gradient(180deg, #0f2219, #08140e); border: 1px solid var(--border-2); }
.spinner { border-color: rgba(52, 211, 153, .15); border-top-color: var(--brand-600); }
.eyebrow { color: var(--c, var(--brand-600)); letter-spacing: .14em; font-size: 11.5px; }
.demo-banner { background: linear-gradient(90deg, rgba(250, 204, 21, .08), rgba(250, 204, 21, .02)); border-color: rgba(250, 204, 21, .28); }
.status { border: 1px solid transparent; letter-spacing: .02em; }
.s-live { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); color: #6ee7b7; }
.s-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; margin-right: 6px; vertical-align: 1px; animation: sk-blink 1.8s ease-in-out infinite; }

/* Leaflet in the dark theme */
.leaflet-container { background: #07120d; }
.leaflet-control-attribution { background: rgba(5, 13, 9, .75) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--brand-600); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #0c1a13; color: var(--text); border: 1px solid var(--border-2); }
.leaflet-popup-content td:first-child { color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-editing-icon { background: #0b1912 !important; border-color: var(--gold) !important; }

/* ---------- Module icon and hero ---------- */
.module-ico {
  width: 50px; height: 50px; border-radius: 15px; color: var(--c, var(--brand-600));
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c, #34d399) 34%, transparent), color-mix(in srgb, var(--c, #34d399) 8%, transparent) 70%);
  border: 1px solid color-mix(in srgb, var(--c, #34d399) 45%, transparent);
  box-shadow: 0 0 26px -6px color-mix(in srgb, var(--c, #34d399) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center; gap: 10px;
  margin: 4px 0 18px; padding: 28px 30px; border-radius: 24px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  background:
    radial-gradient(520px 300px at 82% 50%, color-mix(in srgb, var(--c) 17%, transparent), transparent 70%),
    radial-gradient(400px 200px at 0% 0%, rgba(250, 204, 21, .05), transparent 70%),
    linear-gradient(135deg, rgba(15, 33, 24, .92), rgba(6, 15, 11, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 40px 80px -48px color-mix(in srgb, var(--c) 60%, transparent);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: linear-gradient(color-mix(in srgb, var(--c) 7%, transparent) 1px, transparent 1px) 0 0 / 24px 24px,
              linear-gradient(90deg, color-mix(in srgb, var(--c) 7%, transparent) 1px, transparent 1px) 0 0 / 24px 24px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 70%); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 70%);
}
.hero::after { content: ""; position: absolute; left: 30px; right: 30px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--c), transparent); opacity: .8; }
.hero-txt { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hero-top .status { margin-left: 0; }
.hero h1 { font-size: 36px; line-height: 1.08; margin: 0 0 12px; letter-spacing: -.03em;
  background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--c) 35%, #ffffff)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .eyebrow { margin-bottom: 8px; }
.hero .lead { font-size: 15px; margin: 0 0 4px; max-width: 52ch; }
.hero-cta { margin-top: 18px; }
.hero-cta .btn-small, #view-modul .hero .btn-small { margin-top: 0; }
.hero-art { position: relative; z-index: 1; display: flex; justify-content: center; }
.hero-art .art { width: 100%; max-width: 420px; height: auto; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--c) 30%, transparent)); }
.hero-live { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-live span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-2); background: rgba(0, 0, 0, .25); }
.hero-live i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; animation: sk-blink 1.6s ease-in-out infinite; }
.hero-live span:nth-child(2) i { animation-delay: .4s; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.hero-live span:nth-child(3) i { animation-delay: .8s; }
.hero-live span:nth-child(4) i { animation-delay: 1.2s; background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }
.chat-head { position: relative; }
.chat-art { margin-left: auto; width: 150px; flex-shrink: 0; }
.chat-art .art { width: 100%; height: auto; }

/* ---------- Illustration primitives ---------- */
.art { overflow: visible; --gold: #facc15; }
.art .g0 { stop-color: var(--c); stop-opacity: .22; } .art .g1 { stop-color: var(--c); stop-opacity: 0; }
.art .b0 { stop-color: var(--c); stop-opacity: .42; } .art .b1 { stop-color: var(--c); stop-opacity: 0; }
.art .dim { fill: none; stroke: var(--c); stroke-opacity: .28; stroke-width: 1; }
.art .dash { stroke-dasharray: 3 5; }
.art .grid { fill: none; stroke: var(--c); stroke-opacity: .13; stroke-width: 1; }
.art .tr { fill: color-mix(in srgb, var(--c) 22%, #07130d); stroke: var(--c); stroke-width: 1.1; stroke-linejoin: round; }
.art .ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art .lny { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art .thin { stroke-width: 1.2; } .art .thick { stroke-width: 3; }
.art .fl { fill: var(--c); } .art .fy { fill: var(--gold); }
.art .soft { fill: var(--c); fill-opacity: .16; }
.art .body { fill: #0b1913; stroke: var(--c); stroke-width: 1.6; }
.art .panel { fill: color-mix(in srgb, var(--c) 25%, #0b1913); stroke: var(--c); stroke-width: 1.2; }
.art .node { fill: #0b1913; stroke: var(--gold); stroke-width: 1.6; }
.art .hole { fill: #0b1913; } .art .hole-ln { stroke: #0b1913; }
.art .shadow { fill: #000; opacity: .4; }
.art .pt { fill: var(--gold); opacity: .85; }
.art .txt { fill: var(--c); font: 600 9.5px var(--display); letter-spacing: .12em; }
.art .ping { fill: none; stroke: var(--c); stroke-width: 1.5; }
.art .warnbox { fill: #f87171; fill-opacity: .22; stroke: #f87171; stroke-dasharray: 3 3; }
.art .warn { fill: #f87171; }
.art .bark { fill: color-mix(in srgb, var(--c) 14%, #120d08); stroke: var(--c); stroke-opacity: .5; }
.art .lens { fill: var(--c); fill-opacity: .09; }
.art .seg { fill: none; stroke-width: 12; stroke-linecap: round; }
.art .s1 { stroke: #4ade80; } .art .s2 { stroke: #facc15; } .art .s3 { stroke: #fb923c; } .art .s4 { stroke: #ef4444; }
.art .flame { fill: #fb923c; stroke: #facc15; stroke-width: 1.5; }
.art .soil1 { fill: color-mix(in srgb, var(--c) 22%, #08120e); } .art .soil2 { fill: color-mix(in srgb, var(--c) 13%, #0b0f0a); } .art .soil3 { fill: color-mix(in srgb, var(--c) 6%, #0d0b08); }
.art .drop { fill: var(--c); }
.art .coin { fill: #a16207; stroke: var(--gold); stroke-width: 1.4; } .art .coin-t { fill: #fff7cc; font: 700 9px var(--font); }
.art .st1, .art .st2, .art .st3, .art .st4 { fill-opacity: .3; stroke-width: 1.4; }
.art .st1 { fill: #4ade80; stroke: #4ade80; } .art .st2 { fill: #facc15; stroke: #facc15; } .art .st3 { fill: #c084fc; stroke: #c084fc; } .art .st4 { fill: #38bdf8; stroke: #38bdf8; }
.art .atom { fill: #f87171; } .art .atom.c { fill: #64748b; }
.art .road { fill: #15211b; stroke: var(--c); stroke-opacity: .5; }
.art .sign { fill: var(--gold); stroke: #0b1913; stroke-width: 3; stroke-linejoin: round; }
.art .signi { fill: none; stroke: #0b1913; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.art .shield { fill: var(--c); fill-opacity: .1; stroke: var(--c); stroke-width: 2; }
.art .stone { fill: #1b2922; stroke: var(--c); stroke-width: 1.4; }
.art .badge-t { fill: #fff; font: 700 11px var(--font); }

/* ---------- Animations ---------- */
@keyframes sk-rot { to { transform: rotate(360deg); } }
@keyframes sk-blink { 50% { opacity: .25; } }
@keyframes sk-ping { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes sk-dash { to { stroke-dashoffset: -28; } }
@keyframes sk-dash2 { to { stroke-dashoffset: -44; } }
@keyframes sk-dash3 { to { stroke-dashoffset: -56; } }
@keyframes sk-bob { 50% { transform: translateY(-6px); } }
@keyframes sk-bobx { 50% { transform: translateX(6px); } }
@keyframes sk-drift { 0%, 100% { transform: translateX(-18px); } 50% { transform: translateX(18px); } }
@keyframes sk-scan { 0%, 100% { transform: translateY(-8px); } 50% { transform: translateY(52px); } }
@keyframes sk-trace { 0% { stroke-dashoffset: 600; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes sk-crawl { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-34px); } }
@keyframes sk-swing { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes sk-needle { 0%, 100% { transform: rotate(-50deg); } 50% { transform: rotate(38deg); } }
@keyframes sk-flicker { to { transform: scale(1.06, .93); } }
@keyframes sk-fade { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes sk-drop { 0% { transform: translateY(-12px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(54px); opacity: 0; } }
@keyframes sk-grow { from { transform: scaleY(.05); } }
@keyframes sk-growx { from { transform: scaleX(.05); } }
@keyframes sk-bell { 0%, 60%, 100% { transform: rotate(0); } 65% { transform: rotate(12deg); } 70% { transform: rotate(-10deg); } 75% { transform: rotate(7deg); } 80% { transform: rotate(-5deg); } 85% { transform: rotate(0); } }
@keyframes sk-type { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.a-rot { animation: sk-rot 5s linear infinite; }
.a-rot-slow { animation: sk-rot 40s linear infinite; }
.a-rot-fast { animation: sk-rot 1.1s linear infinite; }
.a-orbit { animation: sk-rot 16s linear infinite; }
.a-orbit-wide { animation: sk-swing 7s ease-in-out infinite alternate; }
.a-blink { animation: sk-blink 1.6s ease-in-out infinite; }
.a-ping { animation: sk-ping 2.4s ease-out infinite; }
.a-dash { stroke-dasharray: 7 7; animation: sk-dash 1.4s linear infinite; }
.a-dash-road { stroke-dasharray: 10 12; animation: sk-dash2 1s linear infinite; }
.a-wind { stroke-dasharray: 40 16; animation: sk-dash3 1.2s linear infinite; }
.a-bob { animation: sk-bob 3.2s ease-in-out infinite; }
.a-wave { animation: sk-bobx 3s ease-in-out infinite; }
.a-drift { animation: sk-drift 6s ease-in-out infinite; }
.a-scan { animation: sk-scan 3s ease-in-out infinite; }
.a-trace { stroke-dasharray: 600; animation: sk-trace 3.6s ease-in-out infinite; }
.a-crawl { animation: sk-crawl 5s ease-in-out infinite; }
.a-needle { animation: sk-needle 4s ease-in-out infinite; }
.a-flicker { animation: sk-flicker .9s ease-in-out infinite alternate; }
.a-fade { animation: sk-fade 2.8s ease-in-out infinite; }
.a-drop { animation: sk-drop 2.1s ease-in infinite; }
.a-grow { transform-box: fill-box; transform-origin: 50% 100%; animation: sk-grow 1.2s cubic-bezier(.2, .8, .2, 1) both; }
.a-grow-x { transform-box: fill-box; transform-origin: 0 50%; animation: sk-growx 1.2s cubic-bezier(.2, .8, .2, 1) both; }
.a-ring { transform-box: fill-box; transform-origin: 50% 0; animation: sk-bell 2.8s ease-in-out infinite; }
.a-type { animation: sk-type 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .art *, .bm-sat, .pill i, .hero-live i, .s-live::before { animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1560px) {
  .brand-tag { display: none; }
  .nav-top { padding: 0 10px; }
}
@media (max-width: 1400px) {
  .nav-top { padding: 0 9px; font-size: 13px; }
  .nav-top > svg:not(.chev) { display: none; }
}
@media (max-width: 1060px) {
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: #06100b; }
  .menu-btn { display: grid; }
  .pill { display: none; }
  .mainnav {
    display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 1600; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 16px 16px 40px; overflow-y: auto; background: linear-gradient(180deg, rgba(7, 17, 12, .98), rgba(4, 10, 7, .99)); backdrop-filter: blur(18px);
  }
  .mainnav.open { display: flex; }
  .mainnav > * { flex-shrink: 0; }
  .nav-top { height: 46px; font-size: 14.5px; }
  .nav-top > svg:not(.chev) { display: block; }
  .nav-top.active::after { display: none; }
  .nav-drop > .nav-top { display: none; }
  .dropdown, .nav-drop:last-child .dropdown { position: static; opacity: 1; visibility: visible; transform: none; min-width: 0; padding: 14px 0 4px; background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; backdrop-filter: none; }
  .dd-grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .topbar { height: 64px; padding: 0 14px; }
  .hero { grid-template-columns: 1fr; padding: 22px 18px; }
  .hero-art { order: -1; }
  .hero-art .art { max-width: 320px; }
  .hero h1 { font-size: 28px; }
  .chat-art { display: none; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 20px; }
  .brand-mark { width: 34px; height: 34px; }
  .user-btn { padding: 5px 8px; }
}

/* Picking a property from Lantmäteriet's register */
.leaflet-container.picking { cursor: crosshair; }
.search-results .hint-row { cursor: default; display: block; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.search-results .hint-row:hover { background: transparent; }
.search-results .hint-row b { color: var(--text); font-weight: 600; }
.search-results .ex { cursor: pointer; }
.search-results .ex .typ { color: var(--gold); }

/* Access: open screening vs owner data */
.access-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin: -2px 0 8px; border: 1px solid; }
.access-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.access-badge.open { color: var(--gold); border-color: rgba(250, 204, 21, .35); background: rgba(250, 204, 21, .07); }
.access-badge.own { color: #6ee7b7; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.access-badge.shared { color: #93c5fd; border-color: rgba(96, 165, 250, .35); background: rgba(96, 165, 250, .08); }
.owner-lock { display: flex; gap: 12px; align-items: flex-start; border-color: rgba(250, 204, 21, .3); background: linear-gradient(135deg, rgba(250, 204, 21, .06), rgba(52, 211, 153, .04)); }
.owner-lock > svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.stat.owner-lock .v { color: var(--text); font-size: 14.5px; font-weight: 600; }
.stat.owner-lock .btn-small { margin-top: 10px; }
.owner-note { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.owner-note svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 1.8; flex-shrink: 0; }
.declare { align-items: flex-start; line-height: 1.45; }
.declare input { margin-top: 2px; flex-shrink: 0; }
.role-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.muted { background: rgba(255, 255, 255, .05); color: var(--muted); }
.mini-h { font-size: 13px; margin: 18px 0 6px; color: var(--text-2); }
.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.share-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.share-list .btn-link { margin: 0; }
.share-list.log li span:last-child { color: var(--muted); font-size: 12px; text-align: right; }

/* ===================== Content pages, intro, account, admin ===================== */
.content { display: flex; flex-direction: column; }
.content > .view:not([hidden]) { flex: 1 0 auto; }
.doc { line-height: 1.65; }
.doc h2 { font-size: 19px; margin: 34px 0 10px; scroll-margin-top: 20px; }
.doc h3 { font-size: 15px; margin: 18px 0 6px; }
.doc p, .doc li { color: var(--text-2); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc code { font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--text); }
.doc-head { margin: 8px 0 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.doc-head h1 { font-size: 34px; margin: 4px 0 8px; }
.doc-table td:first-child { white-space: nowrap; padding-right: 18px; vertical-align: top; }
.doc .kv td { color: var(--text-2); text-align: left !important; font-variant-numeric: normal; }
.doc .kv td:first-child { color: var(--text); font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 10px 0 14px; border: 1px solid var(--border); border-radius: 12px; }
.table-wrap .stand-table td, .table-wrap .stand-table th { white-space: normal; vertical-align: top; padding: 9px 12px; }
.table-wrap .stand-table th { background: rgba(255, 255, 255, .03); }
.src-table td:first-child { white-space: nowrap; }
.toc { padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .02); margin-bottom: 8px; }
.toc b { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 8px 0 0; columns: 2; column-gap: 28px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
details { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 8px 0; background: rgba(255, 255, 255, .02); }
details summary { cursor: pointer; font-weight: 600; color: var(--text); }
details[open] summary { margin-bottom: 6px; }

.sec-h { font-size: 22px; margin: 34px 0 14px; }
.steps3, .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step3 b { display: block; font-size: 15px; margin: 10px 0 4px; }
.step3 p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.step3 .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font: 700 14px var(--display); color: var(--on-brand); background: linear-gradient(135deg, #6ee7b7, #10b981); box-shadow: 0 0 16px -4px rgba(52, 211, 153, .9); }
.grid-3 h3, .grid-2 h3 { margin: 0 0 6px; font-size: 15px; }
.grid-3 p, .grid-2 p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile-grid .mtile { border: 1px solid var(--border); background: rgba(255, 255, 255, .02); }
.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.price b { font: 600 15px var(--display); }
.price .pv { font: 700 26px var(--display); margin: 6px 0 12px; color: var(--text); }
.price .pv small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.price.hot { border-color: rgba(250, 204, 21, .45); box-shadow: 0 0 30px -14px rgba(250, 204, 21, .7); }
.price .checks { gap: 6px; font-size: 13px; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; border-color: rgba(52, 211, 153, .35); background: linear-gradient(135deg, rgba(52, 211, 153, .12), rgba(250, 204, 21, .05)); }
.cta-band b { font: 600 17px var(--display); }
.intro-hero h1 { font-size: 40px; }

.textarea { width: 100%; resize: vertical; border: 1px solid var(--border-2); border-radius: 10px; background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; padding: 10px 12px; }
.textarea:focus { outline: none; border-color: var(--brand-600); }
.select.wide { width: 100%; }
.fb-done { display: flex; gap: 16px; align-items: flex-start; }
.fb-done > svg { width: 40px; height: 40px; flex-shrink: 0; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fb-done h2 { margin: 2px 0 4px; }
.fb-done .btn-small { margin-top: 12px; }
.fb-text { white-space: pre-wrap; color: var(--text-2); margin: 10px 0 0; }
.fb-item { margin-bottom: 10px; }
.fb-item.read { opacity: .6; }
.consent { font-size: 12px; margin: 2px 0 0; }
.danger-zone { border-color: var(--warn-bd); }
.btn-small.danger { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-bd); box-shadow: none; }
.btn-small.danger:hover { background: rgba(251, 113, 133, .16); filter: none; transform: none; }
.chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; margin-right: 4px; }
.org { margin-bottom: 14px; }

/* account menu */
.user-wrap { position: relative; }
.user-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px; border-radius: 14px; border: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(12, 27, 20, .98), rgba(7, 17, 12, .98)); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .8); z-index: 1700; }
.user-menu a, .user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0; background: none;
  color: var(--text); text-decoration: none; font: 500 13.5px var(--font); cursor: pointer; text-align: left; }
.user-menu a:hover, .user-menu button:hover { background: rgba(255, 255, 255, .05); }
.user-menu svg { width: 17px; height: 17px; fill: none; stroke: var(--brand-600); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.um-who { padding: 4px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px !important; overflow: hidden; text-overflow: ellipsis; }

/* admin */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .02); width: fit-content; max-width: 100%; }
.tab { border: 0; background: none; color: var(--text-2); font: 600 13px var(--font); padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.tab.on { color: var(--on-brand); background: linear-gradient(135deg, #fda4af, #fb7185); }
.adm-tools { margin-bottom: 12px; align-items: center; }
.admin-table td { font-size: 13px; }
.admin-table .acts { white-space: nowrap; }
.admin-table .acts .btn-link { margin: 0 12px 0 0; }
.muted-row td { opacity: .55; }

/* footer */
.sitefoot { margin-top: 40px; border-top: 1px solid var(--border); background: rgba(3, 9, 6, .6); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 22px 32px 28px; display: grid; gap: 10px; }
.foot-brand { display: flex; align-items: baseline; gap: 12px; }
.foot-brand .brand-name { font-size: 18px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--text-2); text-decoration: none; font-size: 13px; }
.foot-links a:hover { color: var(--brand-600); }
.sitefoot .meta a { color: var(--muted); }

@media (max-width: 1000px) {
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .steps3, .grid-3, .price-grid, .tile-grid { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .intro-hero h1, .doc-head h1 { font-size: 28px; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .foot-in { padding: 20px 16px 26px; }
}
