/* =====================================================================================================
   urban:SCAN — one stylesheet for the landing page (index.html) and the app (app.html).
   Tokens first: colours for the light and the dark theme, one scale of spacing, radii and type.
   Spacing 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64. Radii 6 (small marks) · 8 (controls) · 12 (cards, floating panels)
   · 16 (dialogs) · 999 (pills). Type 11 (labels) · 12 (secondary) · 13 (body of the app) · 15 (section titles)
   · 18 (pane titles); the landing page scales up from 15.
   ===================================================================================================== */
:root {
  --accent: #baccd0;          /* primary: actions, the chosen analysis, the current step */
  --accent-hi: #cbd9dc;
  --accent-2: #b4b9ba;        /* secondary: done steps, switches, sliders */
  --on-accent: #101415;       /* text on the accent */
  --danger: #e5484d;
  --warn: #d9822b;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
  --h-ctl: 32px; --h-ctl-sm: 28px;
  --side: 328px;              /* the app's sidebar */
  --bar: 52px;                /* the app's top and bottom bars */
  --nav: 56px;                /* the landing page's navigation */
  --gutter: 24px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Helvetica Neue', Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* light (default) */
:root, :root[data-theme="light"] {
  --bg: #f3f4f4;
  --surface: #ffffff;
  --surface-2: #f0f2f2;
  --surface-3: #e4e8e9;
  --line: #e5e8e8;
  --line-2: #d3d8d9;
  --ink: #14191b;
  --ink-2: #4b5558;
  --muted: #828a8c;
  --accent-ink: #4b6970;      /* accent as text or a thin line on a light ground */
  --stage: #e8ebeb;
  --map-bg: #e8e6e1;
  --overlay: rgba(255, 255, 255, 0.9);
  --overlay-line: rgba(20, 25, 27, 0.08);
  --scrim: rgba(20, 25, 27, 0.32);
  --frame: #1c2528;
  --frame-ink: #ffffff;
  --frame-mask: rgba(255, 255, 255, 0.4);
  --shadow-1: 0 1px 2px rgba(20, 25, 27, 0.06), 0 2px 8px rgba(20, 25, 27, 0.06);
  --shadow-2: 0 12px 40px rgba(20, 25, 27, 0.16);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1011;
  --surface: #16191a;
  --surface-2: #1f2324;
  --surface-3: #2a2f31;
  --line: #24292a;
  --line-2: #343a3c;
  --ink: #edf0f0;
  --ink-2: #b4b9ba;
  --muted: #7b8385;
  --accent-ink: #baccd0;
  --stage: #0b0d0e;
  --map-bg: #111314;
  --overlay: rgba(22, 25, 26, 0.88);
  --overlay-line: rgba(255, 255, 255, 0.07);
  --scrim: rgba(0, 0, 0, 0.55);
  --frame: #baccd0;
  --frame-ink: #101415;
  --frame-mask: rgba(0, 0, 0, 0.42);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 16px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--nav) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body, button, a, label { -webkit-tap-highlight-color: transparent; }
button, label, .seg, .chips, .site-nav { -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

.logo { text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.logo span { color: var(--muted); font-weight: 400; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: var(--h-ctl); padding: 0 var(--s4); border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); }
.btn-primary:disabled { background: var(--surface-3); color: var(--muted); cursor: default; }
.btn-line { background: var(--surface-2); color: var(--ink); }
.btn-line:hover:not(:disabled) { background: var(--surface-3); }
.btn-line[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.btn-line:disabled { opacity: .45; cursor: default; }
.btn-ghost { background: none; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-sm { height: var(--h-ctl-sm); padding: 0 var(--s3); font-size: 12px; }
.btn-lg { height: 44px; padding: 0 var(--s5); font-size: 15px; border-radius: var(--r-pill); }
.btn-lg.btn-line, .sec .btn-line { background: var(--surface); border-color: var(--line-2); }
.btn-lg.btn-line:hover, .sec .btn-line:hover { border-color: var(--ink-2); background: var(--surface); }
.btn-block { width: 100%; }
.icon-btn {
  width: var(--h-ctl-sm); height: var(--h-ctl-sm); flex: none; display: inline-grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); cursor: pointer; font-size: 14px; line-height: 1;
  transition: background .15s, color .15s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.icon-btn.lg { width: var(--h-ctl); height: var(--h-ctl); }

/* ---------- form controls ---------- */
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--surface-2); }
.seg button {
  height: calc(var(--h-ctl) - 4px); padding: 0 var(--s3); border: 0; border-radius: var(--r-xs); background: none;
  font-size: 12px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--surface-3); }
.seg-block { display: flex; width: 100%; }
.seg-block button { flex: 1; min-width: 0; }
.seg.small button { height: calc(var(--h-ctl-sm) - 4px); padding: 0 var(--s2); }

.mini, input[type="number"], input.cap, .mk-row input, .search input, select.mini {
  height: var(--h-ctl-sm); border: 1px solid transparent; border-radius: var(--r-xs); background: var(--surface-2);
  padding: 0 var(--s2); font-size: 12px; color: var(--ink); outline: none; min-width: 0;
}
.mini:focus, input[type="number"]:focus, input.cap:focus, .mk-row input:focus, .search input:focus { border-color: var(--accent-ink); }
input[type="number"] { width: 72px; }
input.cap, .mk-row input { width: 100%; }

input[type="range"] { width: 100%; height: 20px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; border: 0; background: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; border: 0; background: var(--ink); }
input[type="range"]:disabled { opacity: .4; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 36px; padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { position: relative; flex: none; width: 32px; height: 18px; border-radius: 9px; background: var(--surface-3); transition: background .2s; }
.toggle i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.toggle input:checked + i { background: var(--accent-ink); }
:root[data-theme="dark"] .toggle input:checked + i { background: var(--accent-2); }
.toggle input:checked + i::after { transform: translateX(14px); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.toggle input:disabled + i { opacity: .5; }
.toggle.small { min-height: 28px; padding: var(--s1) 0; border-bottom: 0; font-size: 12px; }
.toggle.sub { padding-left: var(--s3); font-size: 12px; color: var(--ink-2); }
.toggle.sub:has(input:disabled) { opacity: .45; }
.toggle-note { display: block; margin-top: 2px; font-size: 11px; line-height: 1.35; color: var(--muted); }
.toggle-note:empty { display: none; }

.field-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-bottom: var(--s2); font-size: 13px; font-weight: 500; }
.field-head b { font-weight: 500; white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.field-head.tight { margin: var(--s3) 0 var(--s1); font-size: 12px; font-weight: 400; color: var(--ink-2); }
.field-head.row { margin: var(--s2) 0; }
.hint { margin-top: var(--s2); font-size: 12px; line-height: 1.45; color: var(--muted); }
.hint.tight { margin-top: var(--s1); font-size: 11px; }
.hint.error, .status.error { color: var(--danger); }
.hint.warn, .ol-note.warn { color: var(--warn); }
.status { margin-top: var(--s2); min-height: 18px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.progress { display: block; height: 3px; margin-top: var(--s2); border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress::after { content: ''; display: block; width: 35%; height: 100%; background: var(--accent-ink); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.remote-status { color: var(--ink-2); }
.remote-status::after { content: ''; display: block; height: 2px; margin-top: var(--s2); background: linear-gradient(90deg, var(--accent-ink) 35%, transparent 35%); background-size: 200% 100%; animation: slide2 1.1s linear infinite; }
@keyframes slide2 { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.group { display: flex; flex-direction: column; }
.group-title { margin-bottom: var(--s2); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fold { border-top: 1px solid var(--line); padding-top: var(--s3); }
.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; margin: 0; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ''; width: 6px; height: 6px; margin: -3px 4px 0 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.fold[open] > summary { margin-bottom: var(--s2); }
.fold[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.fold > summary:hover { color: var(--ink); }

/* chips: analyses */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.chips button {
  min-height: var(--h-ctl); padding: 6px var(--s2) 6px 10px; border: 0; border-radius: var(--r-sm); background: var(--surface-2);
  font-size: 12px; font-weight: 500; line-height: 1.25; text-align: left; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.chips button:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.chips button[aria-pressed="true"], .chips button[aria-pressed="true"]:hover { background: var(--accent); color: var(--on-accent); }
.chips button:disabled { opacity: .38; cursor: default; }
.chips button[data-note]:not([data-note=''])::after { content: ' · ' attr(data-note); font-size: .9em; opacity: .75; }
.params:empty { display: none; }
.params { gap: 2px; padding: var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); }
.params .field-head:first-child { margin-top: 0; }
.params .illu-row { margin-top: var(--s2); }
.params .taxa + .field-head.tight { margin-top: var(--s3); }
.chips > .params { position: relative; grid-column: 1 / -1; margin: 2px 0 var(--s2); }
.chips > [aria-pressed="true"] + .params::before { content: ''; position: absolute; left: 20px; top: -6px; width: 10px; height: 10px; background: var(--surface); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
.chips > [aria-pressed="true"]:nth-child(even of button) + .params::before { left: calc(50% + 20px); }
.about-link { display: flex; align-items: center; gap: 6px; align-self: flex-start; margin: 0 0 var(--s2); padding: 0; border: 0; background: none; font-size: 12px; font-weight: 500; color: var(--accent-ink); cursor: pointer; }
.about-link svg { width: 14px; height: 14px; flex: none; }
.about-link:hover span { text-decoration: underline; }

/* pills inside the analysis settings */
.taxa { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); }
.taxa button { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); font-size: 11px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.taxa button:hover { color: var(--ink); background: var(--surface-3); }
.taxa button i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.taxa button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.illu-row { display: flex; gap: 6px; }
.illu-row .btn { flex: 1; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* downloads */
.downloads { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s1); }
.dl {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; min-width: 0; height: 44px;
  padding: 0 var(--s3); border: 0; border-radius: var(--r-sm); background: var(--surface-2); text-align: left; cursor: pointer; transition: background .15s, color .15s;
}
.dl b { max-width: 100%; font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl span { font-size: 11px; line-height: 1.2; color: var(--muted); }
.dl:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.dl:hover:not(:disabled) span { color: var(--on-accent); opacity: .7; }
.dl:disabled { opacity: .38; cursor: default; }
.dl-price { margin-top: var(--s2); font-size: 11px; line-height: 1.45; color: var(--ink-2); }
.rec-btn { width: 100%; font-variant-numeric: tabular-nums; }
.rec-btn[aria-pressed="true"] { background: var(--danger); color: #fff; }

/* ---------- floating things over a map or a 3D view ---------- */
.float { background: var(--overlay); border: 1px solid var(--overlay-line); border-radius: var(--r); box-shadow: var(--shadow-1); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); }
.legend {
  position: absolute; left: var(--s3); top: var(--s3); z-index: 2; width: 248px; max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s3); font-size: 11px; line-height: 1.45;
  background: var(--overlay); border: 1px solid var(--overlay-line); border-radius: var(--r); box-shadow: var(--shadow-1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.legend-title { margin-bottom: var(--s2); font-size: 12px; font-weight: 600; }
.legend-bar, .grad-bar { height: 8px; border-radius: 4px; }
.legend-scale { display: flex; justify-content: space-between; margin-top: var(--s1); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend-stats { margin-top: var(--s2); color: var(--ink-2); line-height: 1.55; }
.legend-stats:empty { display: none; }
.legend-stats b { color: var(--ink); font-weight: 500; }
.swatch-row { display: flex; flex-wrap: wrap; gap: var(--s1) 10px; }
.swatch-row span { display: inline-flex; align-items: center; gap: 5px; }
.swatch-row i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-rows { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.lg-rows div { display: grid; grid-template-columns: 12px 1fr auto; gap: var(--s2); align-items: center; }
.lg-rows div.plain { grid-template-columns: 1fr auto; }
.lg-rows i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg-rows b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.lg-meta { margin-top: 6px; color: var(--muted); }
.lg-widget { margin-top: var(--s2); }
.lg-widget svg { display: block; max-width: 100%; height: auto; }
.lg-chip { display: inline-block; width: 8px; height: 8px; margin: 0 3px 0 6px; border-radius: 2px; vertical-align: baseline; }
.lg-stats { margin-top: var(--s2); }
.rose { display: block; width: 100%; height: auto; margin-top: var(--s1); }

.card {
  position: absolute; right: var(--s3); top: 56px; z-index: 3; width: 264px; padding: var(--s3); font-size: 11px; line-height: 1.45; color: var(--ink-2);
  background: var(--overlay); border: 1px solid var(--overlay-line); border-radius: var(--r); box-shadow: var(--shadow-1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.card h4, .eco-card h4 { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.card dl, .eco-card dl { display: grid; grid-template-columns: 72px 1fr; gap: 3px var(--s2); margin: var(--s2) 0 0; }
.card dt, .eco-card dt { color: var(--muted); }
.card dd, .eco-card dd { margin: 0; color: var(--ink); }
.card p, .eco-card p { margin-top: 6px; }
.card a { color: var(--accent-ink); text-decoration: none; }
.eco-card { margin-top: var(--s2); padding: 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 11px; line-height: 1.45; color: var(--ink-2); }
.eco-card .rel { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.eco-card .rel i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.spark { display: block; width: 100%; height: 46px; margin-top: 6px; }

.playbar {
  position: absolute; left: 50%; bottom: var(--s3); z-index: 3; transform: translateX(-50%); width: min(680px, calc(100% - 24px));
  display: flex; align-items: center; gap: var(--s3); padding: 6px var(--s3);
  background: var(--overlay); border: 1px solid var(--overlay-line); border-radius: var(--r); box-shadow: var(--shadow-1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.playbar b { font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.playbar input { flex: 1; min-width: 100px; }
.viewer-hint, .grid-tag {
  position: absolute; bottom: var(--s3); z-index: 2; pointer-events: none; padding: 5px 9px; border-radius: var(--r-xs);
  font-size: 11px; color: var(--ink-2); background: var(--overlay); border: 1px solid var(--overlay-line);
}
.viewer-hint { left: var(--s3); }
.grid-tag { right: var(--s3); display: flex; align-items: center; gap: var(--s2); color: var(--ink); }
.grid-tag::before { content: ''; width: 18px; border-top: 1px dashed currentColor; }

/* ---------- map ---------- */
.map-box { position: relative; isolation: isolate; overflow: hidden; background: var(--map-bg); }
.map-box.drawing { cursor: crosshair; }
#map { position: absolute; inset: 0; }
.leaflet-container { background: var(--map-bg); font-family: inherit; }
.leaflet-control-attribution { font-size: 10px; background: var(--overlay) !important; color: var(--muted); border-top-left-radius: var(--r-xs); }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-bar { border: 1px solid var(--overlay-line) !important; border-radius: var(--r-sm) !important; overflow: hidden; box-shadow: var(--shadow-1) !important; }
.leaflet-bar a { background: var(--overlay); color: var(--ink); border-bottom-color: var(--overlay-line); backdrop-filter: blur(12px); }
.leaflet-bar a:hover { background: var(--surface-2); color: var(--ink); }
.frame {
  position: absolute; left: 50%; top: 50%; z-index: 500; width: 300px; height: 300px; transform: translate(-50%, -50%); pointer-events: none;
  border: 1.5px solid var(--frame); box-shadow: 0 0 0 9999px var(--frame-mask);
}
.frame.circle { border-radius: 50%; }
.frame span { position: absolute; left: -1.5px; top: -26px; padding: 3px var(--s2); border-radius: var(--r-xs); background: var(--frame); color: var(--frame-ink); font-size: 11px; font-weight: 600; white-space: nowrap; }
.maptype { position: absolute; left: var(--s3); top: var(--s3); z-index: 700; background: var(--overlay); border: 1px solid var(--overlay-line); box-shadow: var(--shadow-1); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.search { position: relative; }
.search input { width: 100%; height: 36px; padding: 0 var(--s3); font-size: 13px; border-radius: var(--r-sm); }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 280px; overflow: auto; margin: 0; padding: var(--s1); list-style: none;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow-2);
}
.results li { padding: var(--s2); border-radius: var(--r-xs); font-size: 13px; line-height: 1.3; cursor: pointer; }
.results li:hover, .results li[aria-selected="true"] { background: var(--surface-2); }

/* ---------- 3D view ---------- */
.stage { position: absolute; inset: 0; background: var(--stage); }
.viewer { position: absolute; inset: 0; }
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer.picking canvas { cursor: crosshair; }
.result-main { position: absolute; inset: 0; min-width: 0; }

/* labels over WebGL canvases (colours set by the views) */
.labels { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; --lt: #fff; --lh: #000; --la: #d9ff3d; --lw: #7fc8ff; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; color: var(--lt); font-family: var(--font); text-shadow: 0 0 2px var(--lh), 0 0 2px var(--lh), 0 0 3px var(--lh), 0 0 4px var(--lh); will-change: transform; }
.lbl-city { font-size: 17px; font-weight: 700; }
.lbl-town { font-size: 14px; font-weight: 600; }
.lbl-village { font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.lbl-district { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.lbl-street { font-size: 10px; font-weight: 500; letter-spacing: .02em; }
.lbl-water { font-size: 11px; font-weight: 500; font-style: italic; letter-spacing: .04em; color: var(--lw); }
.lbl-note, .lbl-marker { font-size: 11px; font-weight: 600; color: var(--la); }
.lbl-marker { font-size: 12px; }
.lbl-click { pointer-events: auto; cursor: pointer; }
.lbl-click:hover { text-decoration: line-through; opacity: .8; }
.lbl-note::after { content: ''; position: absolute; left: 50%; top: calc(100% + 4.4px); width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: currentColor; }

/* ---------- graphics editor (plan and 3D scheme) ---------- */
html.editor-open, html.editor-open body { overflow: hidden; }
.editor-fs { position: fixed; inset: 0; z-index: 3000; background: var(--stage); }
.editor-fs.embedded { position: absolute; z-index: 1; }
.editor-fs.embedded .ed-close { display: none; }
.ed-stage { position: absolute; inset: 0; }
.scheme-canvas { position: absolute; inset: 0; min-width: 0; min-height: 0; }
.scheme-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.scheme-canvas.picking canvas, .editor-fs.placing .scheme-canvas canvas, .editor-fs.placing .plan-view { cursor: crosshair; }
.plan-view { position: absolute; inset: 0; overflow: hidden; background: var(--stage); cursor: grab; touch-action: none; }
.plan-view canvas { position: absolute; transform-origin: 0 0; box-shadow: var(--shadow-2); }
.ed-top { position: absolute; left: var(--s3); right: var(--s3); top: var(--s3); z-index: 3; display: flex; align-items: center; gap: var(--s2); pointer-events: none; }
.ed-top > * { pointer-events: auto; }
.ed-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px var(--s3); background: var(--overlay); border: 1px solid var(--overlay-line); border-radius: var(--r-sm); box-shadow: var(--shadow-1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.ed-title b { font-size: 13px; font-weight: 600; }
.ed-title span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-title span:empty { display: none; }
.editor-fs.embedded .ed-title { display: none; }
.ed-tabs { background: var(--overlay); border: 1px solid var(--overlay-line); box-shadow: var(--shadow-1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.ed-close { margin-left: auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--overlay-line); background: var(--overlay); color: var(--ink); cursor: pointer; }
.ed-hint { left: var(--s3); bottom: var(--s3); z-index: 3; }
.ed-legend {
  position: absolute; left: var(--s3); bottom: var(--s3); z-index: 3; width: 232px; max-height: calc(100% - 72px); overflow: hidden; pointer-events: none;
  padding: var(--s3); border-radius: var(--r); font-size: 11px; line-height: 1.5;
  background: color-mix(in srgb, var(--lg-bg, #000) 86%, transparent); color: var(--lg-ink, #fff); backdrop-filter: blur(10px);
}
.ed-legend-block + .ed-legend-block { margin-top: var(--s3); }
.ed-legend-block > b { display: block; margin-bottom: 6px; font-size: 12px; }
.ed-legend .legend-scale, .ed-legend .lg-meta, .ed-legend .lg-stats { color: var(--lg-muted, #aaa); }
.ed-legend .lg-rows b { color: var(--lg-ink, #fff); }
.ed-legend .lg-widget svg { max-height: 132px; width: auto; margin: 0 auto; }

/* the editor's panel: inside the app's sidebar, or floating over the full-screen editor */
.illu-panel { display: flex; flex-direction: column; gap: var(--s4); }
.ed-panel.illu-panel:not(.in-side) {
  position: absolute; right: var(--s3); top: 60px; bottom: var(--s3); z-index: 3; width: 272px; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s3) var(--s3) 0; background: var(--overlay); border: 1px solid var(--overlay-line); border-radius: var(--r); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.illu-group { display: flex; flex-direction: column; gap: 6px; }
.illu-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.illu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.illu-grid.three { grid-template-columns: repeat(3, 1fr); }
.illu-grid.four { grid-template-columns: repeat(4, 1fr); }
.illu-grid.five { grid-template-columns: repeat(5, 1fr); }
.illu-grid button { min-height: var(--h-ctl-sm); padding: 4px 6px; border: 0; border-radius: var(--r-xs); background: var(--surface-2); font-size: 12px; text-align: center; color: var(--ink-2); cursor: pointer; }
.illu-grid button:hover { color: var(--ink); background: var(--surface-3); }
.illu-grid button[aria-pressed="true"], .illu-grid button[aria-pressed="true"]:hover { background: var(--ink); color: var(--surface); }
.illu-export { position: sticky; bottom: 0; margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: var(--s3) 0; border-top: 1px solid var(--line); background: var(--surface); }
.plan-title { margin-top: 6px; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--s2); }
.swatch { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--ink-2); cursor: pointer; }
.swatch input, .stops input { width: 22px; height: 22px; flex: none; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-xs); background: none; cursor: pointer; }
.swatch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bright-row { display: grid; grid-template-columns: 72px 1fr 36px; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); }
.bright-row b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.layers { display: flex; flex-direction: column; gap: var(--s1); }
.layer { border-radius: var(--r-sm); background: var(--surface-2); }
.layer-head { display: flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s1) var(--s1) var(--s2); }
.layer-head input[type="checkbox"], .ol-row input[type="checkbox"] { width: 14px; height: 14px; margin: 0 var(--s1) 0 0; flex: none; accent-color: var(--accent-ink); }
.layer-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-sw { width: 16px; height: 8px; flex: none; display: inline-block; border-radius: 3px; }
.layer-body { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s1) var(--s2) var(--s2); border-top: 1px solid var(--line); }
.layer-body .toggle.small { padding: 2px 0; }
.layer-body .field-head.row { margin: var(--s1) 0 2px; }
.stops { display: flex; align-items: center; gap: var(--s1); }
.layer-add { display: flex; gap: 6px; margin-top: 6px; }
.layer-add select { flex: 1; min-width: 0; }
.shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s1); }
.shapes button { height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--r-xs); background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.shapes button:hover { color: var(--ink); }
.shapes button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.mk-list { display: flex; flex-direction: column; gap: 3px; }
.mk-row { display: grid; grid-template-columns: 24px 1fr 24px; gap: var(--s1); align-items: center; }

/* project volumes and own layers */
.project, .layers-own { gap: 6px; }
.project .illu-row { margin-top: 2px; }
.layers-own .file-btn { justify-content: center; }
.pr-form { display: flex; flex-direction: column; }
.pr-form .field-head.row { margin: var(--s1) 0; }
.pr-form select { max-width: 150px; }
.pr-sw { width: 14px; height: 14px; display: inline-block; justify-self: center; border-radius: 4px; }
.pr-sw.wide { width: 28px; }
.pr-name { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-row { display: grid; grid-template-columns: 16px 14px 1fr auto 24px; gap: 6px; align-items: center; }
.ol-row .btn-sm { height: 22px; padding: 0 var(--s2); font-size: 11px; }
.ol-raster { display: flex; flex-direction: column; gap: 3px; }
.ol-raster .ol-row { grid-template-columns: 16px 28px 1fr 0 24px; }
.ol-sub { display: flex; align-items: center; gap: 6px; padding-left: 36px; }
.ol-sub label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.ol-sub label input { flex: 1; min-width: 0; accent-color: var(--ink); }
.ol-note { padding-left: 36px; word-break: break-word; }

/* species list (trees) */
.species { display: flex; flex-direction: column; gap: var(--s1); max-height: 320px; margin: var(--s2) 0 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.species li a { display: grid; grid-template-columns: 34px 1fr auto; gap: var(--s2); align-items: center; padding: 3px; border-radius: var(--r-xs); text-decoration: none; }
.species li a:hover { background: var(--surface-2); }
.species img, .species .ph { display: block; width: 34px; height: 34px; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-3); }
.species .nm { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.species .nm b { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.species .nm span { font-size: 11px; font-style: italic; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.species .ct { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.city-only.off, .site-only.off, .region-only.off, .field.hide { display: none; }
#relief-field.off, .field.sub.off { opacity: .4; pointer-events: none; }
.toggles { display: flex; flex-direction: column; }
.toggles .field.sub { margin: 0; padding: var(--s2) 0 10px var(--s3); border-bottom: 1px solid var(--line); }
.field.sub .field-head { font-size: 12px; color: var(--ink-2); }
#kml-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- dialogs: the account, settings and guide ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.acct {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100svh - 48px); overflow: auto; padding: var(--s5); font-size: 13px; line-height: 1.5;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2);
}
dialog.acct h3 { margin: 0 0 var(--s2); font-size: 18px; }
dialog.acct h4 { margin: var(--s4) 0 var(--s2); font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
dialog.acct p { margin: 0 0 10px; }
.acct-x { position: absolute; right: var(--s3); top: var(--s3); width: 28px; height: 28px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.acct-x:hover { background: var(--surface-2); color: var(--ink); }
.acct-form { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s2) 0; }
.acct-form input, .acct-row input { height: 40px; padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font-size: 14px; }
.acct-form input:focus, .acct-row input:focus { outline: none; border-color: var(--accent-ink); }
.acct-row { display: flex; align-items: center; gap: var(--s2); margin-top: 10px; }
.acct-row input { flex: 1; }
.acct-note { min-height: 18px; color: var(--ink-2); }
.acct-small { font-size: 12px; color: var(--muted); }
.acct-email { color: var(--ink-2); }
.acct-balance { display: flex; align-items: baseline; gap: var(--s2); margin: var(--s1) 0 var(--s2); }
.acct-balance b { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; }
.acct-packs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.acct-pack { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px var(--s3); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; }
.acct-pack:hover { border-color: var(--accent-ink); }
.acct-pack b { font-size: 15px; }
.acct-pack span { font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.acct-pack i { font-style: normal; font-size: 11px; color: var(--muted); }
/* credit packs as in urban:EXPORT: four cards, credits large, stickers on the top edge */
.packs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin: var(--s5) 0 var(--s4); }
.pack {
  position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 22px 6px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font: inherit; text-align: center; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.pack.is-static { cursor: default; }
.pack-n { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pack-unit { margin-top: 4px; font-size: 12px; color: var(--muted); }
.pack-price { margin-top: 14px; font-size: 17px; font-weight: 600; }
.pack-per { margin-top: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pack-tag {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis;
  padding: 3px 8px; border-radius: var(--r-pill); background: var(--ink); color: var(--surface);
  font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.pack.is-popular { border-color: #d04333; box-shadow: inset 0 0 0 1px #d04333; }
.pack.is-popular .pack-tag { background: #d04333; color: #fff; }
.pack-tag.is-save { background: #e3f4e8; color: #17633a; box-shadow: 0 0 0 1px #bfe3cb; }
:root[data-theme="dark"] .pack-tag.is-save { background: #16351f; color: #8fe0a8; box-shadow: 0 0 0 1px #24523a; }
button.pack:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); box-shadow: none; color: var(--surface); transform: translateY(-1px); }
button.pack:hover:not(:disabled) .pack-unit, button.pack:hover:not(:disabled) .pack-per { color: var(--muted); }
button.pack:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) { .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s4); } }
/* "credits work in": a running line of the ildar.space services, paused under the pointer */
.where { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s4); min-width: 0; }
.where-label { flex: none; font-size: 12px; color: var(--muted); }
.where-track { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
.where-row { display: flex; width: max-content; animation: where-run 18s linear infinite; }
.where-track:hover .where-row, .where-row:focus-within { animation-play-state: paused; }
.where-pill { display: inline-flex; align-items: center; height: 26px; margin-right: var(--s2); padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.where-pill span { color: var(--muted); font-weight: 400; }
a.where-pill:hover { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.where-pill.is-here { background: var(--surface-2); border-color: transparent; }
@keyframes where-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .where-row { animation: none; width: auto; flex-wrap: wrap; row-gap: 6px; }
  .where-track { -webkit-mask-image: none; mask-image: none; }
  .where-pill[aria-hidden="true"] { display: none; }
}
dialog.acct { width: min(560px, calc(100vw - 32px)); }
.acct-bal { font-size: 13px; color: var(--muted); }
.acct-need { padding: 10px var(--s3); border-radius: var(--r-sm); background: var(--surface-2); font-weight: 500; }
.acct-promo { margin: var(--s2) 0 var(--s1); font-size: 13px; }
.acct-promo summary { width: max-content; list-style: none; cursor: pointer; font-weight: 500; text-decoration: underline; }
.acct-promo summary::-webkit-details-marker { display: none; }
.acct-rules { margin: var(--s3) 0 var(--s3); padding-left: 18px; font-size: 12px; line-height: 1.55; color: var(--muted); }
dialog.acct p.acct-legal { font-size: 12px; color: var(--muted); margin-bottom: var(--s2); }
.acct-foot { display: flex; flex-wrap: wrap; gap: var(--s1) 18px; margin: var(--s1) 0 0; }
.acct-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.acct-link:hover { color: var(--ink); }
.acct-danger-link { color: var(--danger); }
.acct-hist { width: 100%; margin: 6px 0 10px; border-collapse: collapse; }
.acct-hist td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.acct-hist td.n { text-align: right; font-variant-numeric: tabular-nums; }
.acct-check { display: flex; align-items: center; gap: var(--s2); margin: 6px 0; font-size: 12px; color: var(--ink-2); }
.acct-consent { display: flex; align-items: flex-start; gap: var(--s2); font-size: 12px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.acct-consent input { flex: none; width: 15px; height: 15px; margin: 2px 0 0; }
.acct-consent a { color: inherit; text-decoration: underline; }
.acct-danger { color: var(--danger) !important; }

/* settings: a navigation column and a page, as in Planimetric */
dialog.sheet {
  width: min(880px, calc(100vw - 32px)); height: min(620px, calc(100svh - 48px)); padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2);
}
dialog.sheet[open] { display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sheet-nav { display: flex; flex-direction: column; gap: 2px; padding: var(--s3); border-right: 1px solid var(--line); background: var(--surface-2); }
:root[data-theme="dark"] .sheet-nav { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.sheet-nav button { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; font-size: 13px; color: var(--ink-2); text-align: left; cursor: pointer; }
.sheet-nav button svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.sheet-nav button:hover { color: var(--ink); background: var(--surface-3); }
.sheet-nav button:focus-visible { outline-offset: -2px; }
.sheet-body:focus { outline: none; }
.sheet-nav button[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .sheet-nav button[aria-current="true"] { background: var(--surface-3); }
.sheet-nav .sp { flex: 1; }
.sheet-main { display: flex; flex-direction: column; min-height: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5) var(--s3); }
.sheet-head h3 { font-size: 18px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--s5) var(--s5); font-size: 13px; line-height: 1.5; }
.sheet-sec { margin-top: var(--s4); }
.sheet-sec:first-child { margin-top: 0; }
.sheet-sec > h4 { margin-bottom: var(--s2); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sheet-sec > p { color: var(--ink-2); }
.sheet-sec > p + p { margin-top: var(--s2); }
.sheet-rows { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.sheet-rows a, .sheet-rows > div { display: block; padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; text-decoration: none; color: var(--ink); }
.sheet-rows a:hover { background: var(--surface-3); }
.sheet-list { margin: 0; padding: 0; list-style: none; }
.sheet-list li { display: grid; grid-template-columns: 180px 1fr; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.sheet-list li b { font-weight: 500; }
.sheet-list li span { color: var(--ink-2); }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.theme-pick button { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; }
.theme-pick button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme-pick .pv { height: 72px; border-radius: var(--r-sm); display: grid; grid-template-columns: 30% 1fr; overflow: hidden; border: 1px solid var(--line); }
.theme-pick .pv i { display: block; }
.pv-light i:first-child { background: #fff; } .pv-light i:last-child { background: #e8e6e1; }
.pv-dark i:first-child { background: #16191a; } .pv-dark i:last-child { background: #0b0d0e; }
.theme-pick .pv-system { grid-template-columns: 1fr; }
.pv-system i:first-child { background: linear-gradient(90deg, #fff 15%, #e8e6e1 15% 50%, #16191a 50% 65%, #0b0d0e 65%); } .pv-system i:last-child { display: none; }
.acct-sum { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r); background: var(--surface-2); }
.acct-sum .avatar { width: 40px; height: 40px; font-size: 15px; }
.acct-sum div { flex: 1; min-width: 0; }
.acct-sum b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sum span { font-size: 12px; color: var(--muted); }

/* the guide: every analysis with what it shows, how it is computed and from which data */
.guide-search { width: 100%; height: 36px; margin-bottom: var(--s3); padding: 0 var(--s3); border: 1px solid transparent; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; outline: none; }
.guide-search:focus { border-color: var(--accent-ink); }
.guide-group + .guide-group { margin-top: var(--s4); }
.guide-group > h4 { margin-bottom: var(--s1); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guide-item { border-bottom: 1px solid var(--line); }
.guide-item > summary { display: flex; align-items: center; gap: var(--s2); min-height: 40px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.guide-item > summary::-webkit-details-marker { display: none; }
.guide-item > summary::after { content: ''; margin-left: var(--s1); width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.guide-item[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.guide-item > summary .sp { flex: 1; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s2); border-radius: var(--r-pill); background: var(--surface-2); font-size: 11px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.guide-item[open] { padding-bottom: var(--s3); }
.guide-item .lead-line { color: var(--ink); }
.guide-item dl { display: grid; grid-template-columns: 64px 1fr; gap: 6px var(--s3); margin: var(--s2) 0 0; font-size: 12px; }
.guide-item dt { color: var(--muted); }
.guide-item dd { margin: 0; color: var(--ink-2); }
.guide-item .btn { margin-top: var(--s3); }
.guide-hit { animation: hit 1.6s var(--ease); }
@keyframes hit { 0%, 40% { background: color-mix(in srgb, var(--accent) 45%, transparent); } 100% { background: transparent; } }

.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.avatar.off { background: var(--surface-3); color: var(--ink-2); }

/* =====================================================================================================
   The app: a grid of a top bar (logo, steps), a sidebar and a stage, a bottom bar (account, the site's numbers).
   ===================================================================================================== */
body.app-page { height: 100svh; overflow: hidden; font-size: 13px; }
.ws {
  height: 100svh; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: var(--bar) minmax(0, 1fr) var(--bar);
  grid-template-areas: 'brand top' 'side stage' 'user status'; background: var(--bg); color: var(--ink); font-size: 13px;
}
.ws-brand { grid-area: brand; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3) 0 var(--s4); background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.ws-brand .tag { padding: 2px 6px; border-radius: var(--r-xs); background: var(--surface-2); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ws-brand .sp { flex: 1; }
.ws-top { grid-area: top; display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s3); background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.ws-top .sp { flex: 1; }

/* steps */
.ws-steps { position: relative; display: flex; align-items: center; gap: var(--s1); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ws-steps::-webkit-scrollbar { display: none; }
.ws-step { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 var(--s3) 0 6px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); text-align: left; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.ws-step i {
  position: relative; width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2); font-style: normal; font-size: 11px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}
.ws-step span { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.ws-step b { font-size: 13px; font-weight: 600; color: inherit; }
.ws-step small { font-size: 11px; color: var(--muted); }
.ws-step:not(:disabled):hover { color: var(--ink); background: var(--surface-2); }
.ws-step:disabled { opacity: .45; cursor: default; }
.ws-step[aria-selected="true"] { color: var(--ink); background: var(--surface-2); }
.ws-step[aria-selected="true"] i { background: var(--accent); color: var(--on-accent); }
/* a done step: a check drawn by a mask, centred in the circle whatever the font */
.ws-step.done i { color: transparent; background: var(--accent-2); }
.ws-step.done i::after {
  content: ''; position: absolute; inset: 0; background: var(--on-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.4l3 3 6-6.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.4l3 3 6-6.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.ws-step-sep { width: 16px; height: 1px; flex: none; background: var(--line-2); }

/* sidebar */
.ws-side { grid-area: side; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); }
.ws-pane { display: none; flex: 1; min-height: 0; flex-direction: column; gap: var(--s4); padding: var(--s4); overflow-y: auto; overscroll-behavior: contain; }
.ws[data-step="1"] .ws-pane[data-pane="1"], .ws[data-step="2"] .ws-pane[data-pane="2"], .ws[data-step="3"] .ws-pane[data-pane="3"], .ws[data-step="4"] .ws-pane[data-pane="4"] { display: flex; }
.ws-pane > * { flex-shrink: 0; }
.ws-head { display: flex; flex-direction: column; gap: var(--s1); }
.ws-kicker { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.ws-head h2 { font-size: 18px; line-height: 1.25; }
.ws-head p { font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.ws-head .head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.ws-pane .side-scroll { display: flex; flex-direction: column; gap: var(--s4); }
.ws .panel { display: flex; flex-direction: column; gap: var(--s4); }
.ws .panel-footer { position: sticky; bottom: calc(-1 * var(--s4)); z-index: 3; margin-top: auto; padding: var(--s3) 0 var(--s4); background: var(--surface); border-top: 1px solid var(--line); }
.ws .ed-panel .illu-export { bottom: calc(-1 * var(--s4)); }
.ws .illu-group { padding-top: var(--s3); border-top: 1px solid var(--line); }
.ws .illu-group:first-child { padding-top: 0; border-top: 0; }

/* stage */
.ws-stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--stage); }
@media (min-width: 961px) {
  html:has(body.app-page) { overflow: hidden; height: 100%; }
  .ws { position: fixed; inset: 0; }
}
.ws-view { position: absolute; inset: 0; display: none; }
.ws[data-step="1"] .ws-view[data-pane="1"], .ws[data-step="2"] .ws-view[data-pane="2 4"], .ws[data-step="4"] .ws-view[data-pane="2 4"], .ws[data-step="3"] .ws-view[data-pane="3"] { display: block; }
.ws .map-box { position: absolute; inset: 0; }

/* bottom bar: the account on the left, the site's numbers and the step buttons on the right */
.ws-user { grid-area: user; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3); background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 0; }
.ws-acct { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 var(--s2) 0 var(--s1); border: 0; border-radius: var(--r-sm); background: none; text-align: left; cursor: pointer; color: var(--ink); }
.ws-acct:hover { background: var(--surface-2); }
.ws-acct span { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ws-acct b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-acct small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-status { grid-area: status; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-width: 0; padding: 0 var(--s3) 0 var(--s4); background: var(--surface); border-top: 1px solid var(--line); }
.ws-metrics { display: flex; align-items: center; gap: var(--s5); min-width: 0; overflow: hidden; }
.stats { display: flex; gap: var(--s5); margin: 0; }
.stats div { display: flex; flex-direction: column; gap: 1px; }
.stats dd { order: 1; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats dt { order: 2; font-size: 11px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.ws-meta { min-width: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-nav { display: flex; gap: var(--s2); flex: none; }

@media (max-width: 1480px) { .ws-step small { display: none; } .ws-step { height: 32px; } }
@media (max-width: 1180px) {
  :root { --side: 300px; }
  .ws-step small { display: none; }
  .ws-meta { display: none; }
}
@media (max-width: 960px) {
  body.app-page { height: auto; overflow: auto; }
  .ws {
    height: auto; min-height: 100svh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 62svh auto auto;
    grid-template-areas: 'brand' 'top' 'side' 'stage' 'status' 'user';
  }
  .ws-brand { height: var(--bar); border-right: 0; }
  .ws-top { height: 48px; padding: 0 var(--s2); }
  .ws-side { max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-pane { overflow: visible; }
  .ws .panel-footer { position: static; }
  .ws-status { flex-wrap: wrap; gap: var(--s2); padding: var(--s2) var(--s3); }
  .ws-metrics { width: 100%; overflow-x: auto; }
  .ws-user { min-height: var(--bar); border-right: 0; }
  .ws-step { padding-right: var(--s2); }
  .ws-step-sep { width: 8px; }
}
@media (max-width: 760px) {
  .legend { width: auto; right: var(--s3); max-height: 42%; }
  .card { left: var(--s3); right: var(--s3); top: auto; bottom: 56px; width: auto; }
  .ed-panel.illu-panel:not(.in-side) { left: var(--s2); right: var(--s2); top: auto; bottom: var(--s2); width: auto; height: 46vh; }
  .ed-top { left: var(--s2); right: var(--s2); top: var(--s2); flex-wrap: wrap; }
  .ed-title, .ed-hint, .viewer-hint { display: none; }
  dialog.sheet[open] { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100svh - 32px); }
  .sheet-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sheet-nav button { flex: none; }
  .sheet-nav .sp { display: none; }
  .sheet-list li { grid-template-columns: 1fr; gap: 2px; }
  .sheet-rows { grid-template-columns: 1fr; }
  .theme-pick .pv { height: 48px; }
}

/* =====================================================================================================
   The landing page
   ===================================================================================================== */
.site-nav { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.site-nav-in { max-width: 1200px; height: var(--nav); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: var(--s5); }
.site-nav .links { display: flex; align-items: center; gap: var(--s5); margin-left: var(--s4); font-size: 13px; }
.site-nav .links a { color: var(--ink-2); text-decoration: none; }
.site-nav .links a:hover { color: var(--ink); }
.site-nav .sp { flex: 1; }
.site-nav .end { display: flex; align-items: center; gap: var(--s2); }
.theme-btn .sun, :root[data-theme="dark"] .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.hero { padding: clamp(56px, 10vh, 112px) var(--gutter) var(--s5); text-align: center; display: flex; flex-direction: column; align-items: center; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.hero h1 { margin-top: var(--s3); font-size: clamp(52px, 9vw, 120px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.hero h1 span { color: var(--muted); font-weight: 400; }
.hero .lead { max-width: 720px; margin-top: var(--s5); font-size: clamp(19px, 2.2vw, 26px); line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); margin-top: var(--s6); }
.fineprint { margin-top: var(--s4); font-size: 12px; color: var(--muted); }
.hero-stage { position: relative; width: min(1152px, 100%); aspect-ratio: 16 / 9; max-height: 72vh; margin-top: var(--s7); border-radius: 24px; overflow: hidden; background: #0b0d0e; }
.hero-stage canvas { display: block; width: 100%; height: 100%; }

.sec { padding: var(--s8) 0; border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s6); align-items: end; margin-bottom: var(--s6); }
.sec-head h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.035em; }
.sec-head p { font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.prose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s6); }
.prose h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.035em; }
.prose .txt p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.prose .txt p + p { margin-top: var(--s4); }
.prose .txt strong { color: var(--ink); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-top: var(--s6); }
.fact { padding: var(--s4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.fact b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.fact span { display: block; margin-top: var(--s1); font-size: 13px; color: var(--ink-2); }

.steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); counter-reset: st; }
.step4 { padding: var(--s5); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.step4 i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-style: normal; font-size: 13px; font-weight: 600; }
.step4 h3 { margin-top: var(--s4); font-size: 18px; }
.step4 p { margin-top: var(--s2); font-size: 14px; line-height: 1.5; color: var(--ink-2); }

.cat-group + .cat-group { margin-top: var(--s7); }
.cat-group > h3 { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); font-size: 22px; }
.cat-group > h3 span { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.cat { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.an { display: flex; flex-direction: column; padding: var(--s5); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.an header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.an h4 { font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.an > p { margin-top: var(--s2); font-size: 14px; line-height: 1.5; color: var(--ink); }
.an dl { margin: var(--s4) 0 0; display: grid; gap: var(--s2); font-size: 13px; line-height: 1.5; }
.an dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.an dd { margin: 0; color: var(--ink-2); }

.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.box { padding: var(--s5); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.box h3 { font-size: 18px; }
.box p, .box li { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.box p { margin-top: var(--s2); }
.box ul { margin: var(--s2) 0 0; padding-left: 18px; }
.src-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.src-table th, .src-table td { padding: var(--s3) 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.src-table th { width: 32%; padding-right: var(--s4); font-weight: 500; }
.src-table td { color: var(--ink-2); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s4) 0; list-style: none; cursor: pointer; font-size: 17px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; font-weight: 300; color: var(--muted); }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 0 var(--s4); max-width: 820px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.cta-band { padding: var(--s7) var(--s5); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.cta-band h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.035em; }
.cta-band p { margin-top: var(--s3); font-size: 17px; color: var(--ink-2); }
.site-foot { padding: var(--s6) 0 var(--s7); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.site-foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3) var(--s5); }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
.site-foot .credits { margin-top: var(--s4); line-height: 1.6; }
.site-foot .credits a { color: inherit; text-decoration: underline; }
.made a { font-weight: 700; color: var(--ink); }

@media (max-width: 1080px) {
  .cat, .cols3 { grid-template-columns: 1fr 1fr; }
  .steps4, .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .site-nav .links { display: none; }
  .site-nav-in { gap: var(--s3); }
  .sec { padding: var(--s7) 0; }
  .sec-head, .prose { grid-template-columns: 1fr; gap: var(--s3); }
  .cat, .cols3, .steps4, .facts { grid-template-columns: 1fr; }
  .hero-stage { aspect-ratio: 4 / 5; border-radius: 18px; }
  .src-table th { width: 40%; }
}

/* the inspector card and my points */
.card { max-height: calc(100% - 80px); overflow-y: auto; overscroll-behavior: contain; }
.card dl.attr { grid-template-columns: minmax(0, 110px) 1fr; margin-top: 6px; }
.card dl.attr dt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card dl.attr dd { word-break: break-word; }
.attr-box { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--overlay-line); }
.attr-box > summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); }
.pins { gap: 6px; }
.pin-row { grid-template-columns: 22px minmax(0, 1fr) auto 24px; }
.pin-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; }
.pin-val { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }

.ol-wfs { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.ol-wfs[open] { padding: var(--s2); border-radius: var(--r-sm); background: var(--surface-2); }
.ol-wfs > summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }
.ol-wfs[open] > summary { margin-bottom: 2px; }
.ol-wfs input.cap, .ol-wfs select { width: 100%; background: var(--surface); }

/* the site passport */
.passport { gap: var(--s2); }
.passport > summary .pp-sum { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--accent-ink); }
.pp-table table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pp-table th { padding: 4px 0; font-weight: 600; color: var(--muted); text-align: right; }
.pp-table td { padding: 4px 0; border-top: 1px solid var(--line); vertical-align: top; }
.pp-table td + td, .pp-table th + th { padding-left: var(--s2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-table td:first-child { color: var(--ink-2); }
.pp-notes { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.4; }
.pp-notes li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.pp-notes i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.pp-strength i { background: #d8f0df; color: #17633a; }
.pp-opportunity i { background: #dde9f6; color: #24538a; }
.pp-constraint i { background: #f6ecd3; color: #8a5a00; }
.pp-risk i { background: #f8dcda; color: #b4341f; }
:root[data-theme="dark"] .pp-strength i { background: #16351f; color: #8fe0a8; }
:root[data-theme="dark"] .pp-opportunity i { background: #172a40; color: #9cc3f0; }
:root[data-theme="dark"] .pp-constraint i { background: #3a2c0c; color: #f0c36a; }
:root[data-theme="dark"] .pp-risk i { background: #401814; color: #ff9a8f; }

/* projects: the top bar, comments, the list and the comparison */
.pj-btn { gap: 6px; height: 30px; padding: 0 10px; font-weight: 500; color: var(--ink-2); }
.pj-btn svg { width: 15px; height: 15px; }
.pj-btn b { min-width: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 10px; line-height: 16px; }
.pj-btn b:empty { display: none; }
.pj-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.pj-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.card.comments { top: 56px; right: var(--s3); }
.card.comments:not([hidden]) ~ .card, .card:not([hidden]) + .card.comments { top: 56px; }
.cm-list { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s2) 0; padding: 0; list-style: none; }
.cm-list li { display: grid; grid-template-columns: 20px 1fr 24px; gap: var(--s2); align-items: start; }
.cm-list li > b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 10px; }
.cm-list p { margin: 2px 0 0; font-size: 12px; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.cm-meta { font-size: 11px; color: var(--muted); }
.cm-form { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s2); }
.cm-form textarea { width: 100%; padding: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); font: inherit; font-size: 12px; resize: vertical; }
.toast { position: absolute; left: 50%; bottom: 64px; z-index: 6; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 8px 14px; border-radius: var(--r-pill); background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 500; box-shadow: var(--shadow-2); }
.pj-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.pj-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 28px; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.pj-row div { min-width: 0; display: flex; flex-direction: column; }
.pj-row b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-row span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-table { overflow-x: auto; }
.cmp-table th { text-align: left; color: var(--ink); white-space: nowrap; padding-right: var(--s3); }
.cmp-table tr:first-child th { text-align: right; }
@media (max-width: 1180px) { .pj-btn span { display: none; } .pj-name { display: none !important; } }
