/* Rent tracker UI - "Classic" look: near-black canvas with slowly drifting colour fields, rounded frosted-glass panels,
   white primary buttons, orange used only as light (glows, spotlight, focus rings). Display headings in Unbounded,
   everything else in Inter, JetBrains Mono only for codes. Hand-written, no framework; tokens on :root, use them.
   Fonts are self-hosted (static/vendor/fonts, SIL OFL 1.1), Latin + Cyrillic subsets. */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../vendor/fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../vendor/fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/jetbrains-mono-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
/* width-matched fallbacks (Arial scaled to each face's average glyph width): no reflow when the real font arrives */
@font-face { font-family: "Unbounded Fallback"; font-weight: 100 549; src: local("Arial"), local("ArialMT"); size-adjust: 130%; }
@font-face { font-family: "Unbounded Fallback"; font-weight: 550 900; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 130%; }
@font-face { font-family: "Inter Fallback"; font-weight: 100 549; src: local("Arial"), local("ArialMT"); size-adjust: 106.5%; }
@font-face { font-family: "Inter Fallback"; font-weight: 550 900; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 101.6%; }

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #07080a;
  --bg-raise: #0e0f12;
  --bg-raise-2: #15161a;
  --bg-raise-3: #1c1d22;
  --border: rgba(255, 255, 255, .06);
  --border-strong: rgba(255, 255, 255, .11);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .06);
  --glass: rgba(18, 19, 23, .62);
  --glass-strong: rgba(14, 15, 18, .82);
  --outline-active: rgba(255, 255, 255, .5);
  --text: #ffffff;
  --text-2: #a0a0a8;
  --text-3: #6b6b73;
  --accent: #ff7a1a;
  --accent-2: #ff8f3d;
  --accent-3: #ffb36b;
  --accent-ink: #1a0b00;
  --glow: rgba(255, 122, 26, .35);
  --glow-soft: rgba(255, 122, 26, .14);
  --purple-glow: rgba(140, 92, 255, .14);
  --green: #3dd68c;
  --green-bg: rgba(61, 214, 140, .12);
  --amber: #ffb224;
  --amber-bg: rgba(255, 178, 36, .12);
  --red: #ff5c5c;
  --red-bg: rgba(255, 92, 92, .12);
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .8);
  --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, .9), 0 0 0 1px var(--border-strong);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 160ms; --t: 280ms; --t-slow: 600ms;
  --font: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Unbounded Fallback", "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --glass-panel: linear-gradient(180deg, rgba(22, 23, 27, .62), rgba(11, 12, 14, .72));
  --glass-line: rgba(255, 255, 255, .09);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 30px 70px -40px rgba(0, 0, 0, .7);
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 64px;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-color: rgba(255, 255, 255, .16) transparent; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before { /* film grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(255, 122, 26, .35); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; }
p { margin: 0; }
b, strong { font-weight: 600; }
code { font-family: var(--mono); font-size: .92em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); word-break: break-all; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ok-text { color: var(--green); }
.err-text { color: var(--red); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.ic { width: 18px; height: 18px; flex: none; }

/* headings */
.display, .title-xl, .title-lg, h1 { font-family: var(--font-display); }
.display {
  font-size: clamp(34px, 6.2vw, 72px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05;
  background: linear-gradient(180deg, #fff 30%, #9a9aa0 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: .12em; margin-bottom: -.12em;
}
.title-xl { font-size: clamp(28px, 4vw, 44px); font-weight: 650; letter-spacing: -.03em; }
.title-lg { font-size: clamp(22px, 2.6vw, 30px); font-weight: 650; letter-spacing: -.025em; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.lead { font-size: clamp(16px, 1.5vw, 18px); color: var(--text-2); line-height: 1.55; margin-top: 10px; max-width: 62ch; }

/* ---------------------------------------------------------------- drifting colour background */
.look-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, #15141b, var(--bg) 70%); }
.look-bg i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: transform; }
.look-bg i:nth-child(1) { left: -14vmax; top: -18vmax; background: radial-gradient(circle, #ff7a1a 0%, rgba(255, 122, 26, 0) 65%);
  opacity: .42; animation: look-a 38s ease-in-out infinite alternate; }
.look-bg i:nth-child(2) { right: -18vmax; top: 4vmax; background: radial-gradient(circle, #5b3fd1 0%, rgba(91, 63, 209, 0) 65%);
  animation: look-b 46s ease-in-out infinite alternate; }
.look-bg i:nth-child(3) { left: 18vmax; bottom: -26vmax; background: radial-gradient(circle, #1f6f8b 0%, rgba(31, 111, 139, 0) 65%);
  opacity: .45; animation: look-c 52s ease-in-out infinite alternate; }
.look-bg i:nth-child(4) { left: 30vmax; top: 10vmax; width: 40vmax; height: 40vmax; background: radial-gradient(circle, #b8335a 0%, rgba(184, 51, 90, 0) 65%);
  opacity: .3; animation: look-d 34s ease-in-out infinite alternate; }
.look-bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 35%, rgba(0, 0, 0, .55)), linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .35)); }
@keyframes look-a { to { transform: translate(28vw, 22vh) scale(1.15); } }
@keyframes look-b { to { transform: translate(-30vw, 30vh) scale(.85); } }
@keyframes look-c { to { transform: translate(24vw, -34vh) scale(1.2); } }
@keyframes look-d { 50% { transform: translate(-22vw, 18vh) scale(1.3); } to { transform: translate(14vw, -16vh) scale(.9); } }

/* ---------------------------------------------------------------- glass panels */
.card, .filters-box, .table-wrap, .segmented {
  background: var(--glass-panel); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px) saturate(130%); -webkit-backdrop-filter: blur(12px) saturate(130%);
}
.card { --mx: 50%; --my: 50%; position: relative; border-radius: var(--r-lg);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.has-spotlight .spotlight::before { /* cursor spotlight: soft orange wash */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--t);
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 122, 26, .09), transparent 45%);
}
.has-spotlight .spotlight::after { /* cursor spotlight: lit border near the cursor */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(255, 140, 60, .75), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity var(--t);
}
.has-spotlight .spotlight:hover::before, .has-spotlight .spotlight:hover::after { opacity: 1; }

/* macOS window chrome */
.window {
  border-radius: var(--r-lg); background: var(--glass-strong); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); overflow: hidden;
}
.window-bar { position: relative; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent); font-size: 13px; color: var(--text-2); }
.traffic { display: flex; gap: 7px; flex: none; }
.traffic i { width: 11px; height: 11px; border-radius: 50%; background: #3a3b40; display: block; transition: background var(--t); }
.window:hover .traffic i:nth-child(1) { background: #ff5f57; }
.window:hover .traffic i:nth-child(2) { background: #febc2e; }
.window:hover .traffic i:nth-child(3) { background: #28c840; }
.window-title { flex: 1; text-align: center; margin-right: 47px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-body { padding: 20px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --h: 40px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h);
  padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--bg-raise-2);
  color: var(--text); font: 550 14.5px/1 var(--font); letter-spacing: -.005em; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t);
  overflow: hidden; isolation: isolate; user-select: none;
}
.btn:hover { background: var(--bg-raise-3); border-color: rgba(255, 255, 255, .18); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn:disabled { opacity: .45; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: #fff; color: #08080a; border-color: #fff; }
.btn-primary:hover { background: #f1f1f3; border-color: #f1f1f3; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08), 0 10px 40px -10px rgba(255, 255, 255, .35); }
.btn-primary::after, .btn-accent::after { /* sheen sweep */
  content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
}
.btn-primary:hover::after, .btn-accent:hover::after { transition: transform .9s var(--ease); transform: translateX(120%); }
.btn-accent { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 8px 30px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-accent:hover { box-shadow: 0 10px 40px -6px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35); background: linear-gradient(180deg, var(--accent-3), var(--accent-2)); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--red-bg); border-color: rgba(255, 92, 92, .3); color: #ffb3b3; }
.btn-danger:hover { background: rgba(255, 92, 92, .2); border-color: rgba(255, 92, 92, .5); }
.btn.is-on { border-color: var(--outline-active); background: rgba(255, 255, 255, .08); }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { --h: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }

.spinner { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }

/* ---------------------------------------------------------------- badges, pills, notices */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font: 600 12px/1 var(--font); letter-spacing: .01em; background: rgba(255, 255, 255, .06); color: var(--text-2);
  border: 1px solid var(--border); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.badge .ic { width: 13px; height: 13px; }
.badge.green { background: var(--green-bg); color: var(--green); border-color: rgba(61, 214, 140, .25); }
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: rgba(255, 178, 36, .25); }
.badge.red { background: var(--red-bg); color: var(--red); border-color: rgba(255, 92, 92, .25); }
.badge.orange { background: rgba(255, 122, 26, .12); color: var(--accent-3); border-color: rgba(255, 122, 26, .3); }
.badge.pulse .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
a.badge { transition: border-color var(--t), background var(--t); }
a.badge:hover { border-color: var(--outline-active); }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: var(--r-pill);
  font: 650 11.5px/1 var(--font); background: rgba(255, 122, 26, .16); color: var(--accent-3); }
.pill-warn { background: var(--amber-bg); color: var(--amber); height: 24px; padding: 0 10px; gap: 6px; font-size: 12px; }
.pill-warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }

.notice { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 12px 14px; border-radius: var(--r); font-size: 14px; color: var(--text); }
.notice .ic { width: 18px; height: 18px; margin-top: 2px; }
.notice-warn { background: var(--amber-bg); border: 1px solid rgba(255, 178, 36, .3); }
.notice-warn .ic { color: var(--amber); }
.notice-ok { background: var(--green-bg); border: 1px solid rgba(61, 214, 140, .3); }
.notice-ok .ic { color: var(--green); }
.filter-errors ul { margin: 0; padding-left: 18px; }
.form-errors { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--red-bg);
  border: 1px solid rgba(255, 92, 92, .3); color: #ffc9c9; font-size: 14px; margin-bottom: 16px; }
.form-errors .ic { color: var(--red); margin-top: 1px; }
.trust-note { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; font-size: 13px; color: var(--text-2); }
.trust-note .ic { width: 16px; height: 16px; color: var(--accent-3); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 14px 2px; font-size: 14px; color: var(--text-2); }
.stats b { color: var(--text); }

/* ---------------------------------------------------------------- floating nav */
.nav { position: sticky; top: 0; z-index: 50; padding: 10px var(--gutter) 0; }
.nav-bar {
  position: relative; display: flex; align-items: center; gap: 20px; height: 60px; max-width: calc(var(--maxw) - 2 * var(--gutter) + 24px);
  margin: 0 auto; padding: 0 10px 0 12px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(22, 23, 27, .58), rgba(13, 14, 17, .58)); border: 1px solid rgba(255, 255, 255, .075);
  backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), inset 0 0 0 1px rgba(255, 255, 255, .015), 0 12px 32px -14px rgba(0, 0, 0, .85);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.nav.is-scrolled .nav-bar { background: linear-gradient(180deg, rgba(22, 23, 27, .72), rgba(13, 14, 17, .72)); border-color: var(--glass-line); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent-3);
  background: linear-gradient(180deg, rgba(255, 122, 26, .2), rgba(255, 122, 26, .05)); border: 1px solid rgba(255, 122, 26, .28);
  box-shadow: 0 0 24px -6px var(--glow); transition: transform .6s var(--ease-spring); }
.brand-mark .ic { width: 18px; height: 18px; }
.brand:hover .brand-mark { transform: rotate(-10deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; font: 650 16px/1.05 var(--font-display); letter-spacing: -.02em; }
.brand-text small { font: 500 11.5px/1.3 var(--font); letter-spacing: 0; color: var(--text-3); }
.nav-links { position: relative; display: flex; gap: 2px; margin: 0 auto; }
.nav-links a { position: relative; z-index: 1; padding: 8px 13px; border-radius: var(--r-pill); color: var(--text-2); font-size: 14.5px; font-weight: 500;
  transition: color var(--t); white-space: nowrap; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-pill { position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 100%; border-radius: var(--r-pill); background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); opacity: 0; pointer-events: none;
  transition: transform var(--t) var(--ease), width var(--t) var(--ease), opacity var(--t); }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: 0; flex: none; }
.logout { margin: 0; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-bar { gap: 10px; padding: 0 8px 0 10px; }
  .nav-actions { margin-left: auto; }
  .nav-toggle { display: inline-flex; color: var(--text); }
  .nav-links { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; gap: 2px; margin: 0;
    padding: 8px; background: linear-gradient(180deg, var(--bg-raise-2), var(--bg-raise)); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: var(--shadow-pop); }
  .nav-links.is-open { display: flex; animation: drop .3s var(--ease); }
  .nav-links a { padding: 12px 14px; }
  .nav-links a.is-active { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px var(--border-strong); }
  .nav-pill { display: none; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------------------------------------------------------------- page layout */
.main { padding-top: 22px; min-height: 50vh; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin: 26px 0 22px; }
.page-head-text { min-width: 0; }
.page-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.back-link { margin: 0 0 12px -10px; }
.scan-form { margin: 0; }
.scan-status { font-size: 13.5px; max-width: 46ch; text-align: right; }
.scan-status:empty { display: none; }

/* status strip */
.statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 10px 12px 10px 12px; border-radius: var(--r-lg);
  font-size: 13.5px; color: var(--text-2); }
.sb-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-text { white-space: nowrap; }
.sb-strong { color: var(--text); font-weight: 600; }
.sb-dim { color: var(--text-3); }
.sb-next { flex: 1 1 260px; }
.scan-progress { --p: 0; position: relative; flex: 1 1 auto; min-width: 60px; max-width: 260px; height: 4px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08); overflow: hidden; }
.scan-progress > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3)); box-shadow: 0 0 12px var(--glow); transition: width 900ms linear; }
.sb-right { margin-left: auto; gap: 14px; }

/* ---------------------------------------------------------------- forms */
input[type="text"], input[type="search"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; max-width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, .35); color: var(--text); font: 450 15px/1.4 var(--font);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
select { -webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a0a0a8' stroke-width='2'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
select option { background: var(--bg-raise-2); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 122, 26, .7); box-shadow: 0 0 0 4px rgba(255, 122, 26, .15); background: rgba(0, 0, 0, .5); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: rgba(255, 92, 92, .7); animation: shake .35s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }
input[type="search"]::-webkit-search-cancel-button { filter: invert(.7); }
.field { display: grid; gap: 7px; font-size: 13px; font-weight: 550; color: var(--text-2); min-width: 0; }
.field .muted { color: var(--text-3); font-weight: 450; }
.hint { font-size: 12.5px; font-weight: 450; color: var(--text-3); line-height: 1.5; }
.field-error { font-size: 12.5px; font-weight: 500; color: var(--red); }
.check { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; }
.check:hover { color: var(--text); }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon input { padding-left: 40px; }

/* segmented control with a sliding white pill (radio inputs underneath) */
.segmented { position: relative; display: inline-flex; max-width: 100%; padding: 4px; gap: 2px; border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.seg { position: relative; z-index: 1; display: inline-flex; align-items: center; padding: 7px 15px; border-radius: var(--r-pill); cursor: pointer;
  color: var(--text-2); font: 550 13.5px/1.2 var(--font); white-space: nowrap; transition: color var(--t); }
.seg:hover { color: var(--text); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented.has-pill .seg.is-active { color: #08080a; }
.segmented:not(.has-pill) .seg:has(input:checked) { background: #fff; color: #08080a; }
.seg-pill { position: absolute; z-index: 0; top: 0; left: 0; width: 0; border-radius: var(--r-pill); background: #fff; opacity: 0; pointer-events: none;
  transition: transform .4s var(--ease), width .4s var(--ease), opacity var(--t); }

/* ---------------------------------------------------------------- filter bar */
.filters-box { position: relative; border-radius: var(--r-lg); margin-top: 14px; }
.filters-box > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; cursor: pointer; list-style: none; border-radius: var(--r-lg); }
.filters-box > summary::-webkit-details-marker { display: none; }
.filters-box > summary:hover .filters-chevron { color: var(--text); }
.filters-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--text-2);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border-strong); }
.filters-icon .ic { width: 16px; height: 16px; }
.filters-summary { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--text); }
.filters-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 13.5px; }
.filters-chevron { margin-left: auto; color: var(--text-2); display: grid; transition: transform var(--t) var(--ease), color var(--t); }
.filters-box[open] .filters-chevron { transform: rotate(180deg); }
.filters { padding: 18px 18px 18px; border-top: 1px solid var(--border); }
.f-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 20px 20px; }
.f-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; border: 0; margin: 0; padding: 0; }
.f-field > label, .f-label, .f-field > legend { font-size: 13px; font-weight: 550; color: var(--text-2); padding: 0; }
.f-field > legend { float: left; width: 100%; margin-bottom: 8px; }
.f-field > legend + * { clear: both; }
.f-wide { grid-column: 1 / -1; }
.filters > .f-wide { margin-bottom: 20px; }
@media (min-width: 760px) { .f-span2 { grid-column: span 2; } }
.f-range { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.f-range input { min-width: 0; }
.f-toggles, .f-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.f-inline { margin-top: 4px; }
.f-check { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong); background: var(--bg-raise-2); color: var(--text-2); font-size: 13.5px; font-weight: 550; cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t); white-space: nowrap; }
.f-check:hover { background: var(--bg-raise-3); color: var(--text); }
.f-check:has(input:checked) { border-color: var(--outline-active); color: var(--text); background: rgba(255, 255, 255, .08); }
.f-check input { width: 15px; height: 15px; }
.f-check-num { padding: 0 12px 0 10px; gap: 7px; }
.f-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; align-items: center; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 0; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--border-strong); color: var(--text); font-size: 13px; font-weight: 550;
  transition: background var(--t), border-color var(--t); }
.chip-filter:hover { background: rgba(255, 255, 255, .1); border-color: var(--outline-active); }
.chip-x { color: var(--text-3); font-size: 15px; line-height: 1; }
.chip-reset { margin-left: 6px; font-size: 13px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .25); }
.chip-reset:hover { color: var(--text); }
.result-count { margin: 20px 2px 12px; font-size: 14px; color: var(--text-2); }
.result-count b { color: var(--text); }

/* ---------------------------------------------------------------- listing cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.card-cell { display: flex; min-width: 0; }
.card-cell > .card { flex: 1 1 auto; min-width: 0; }
.listing { display: flex; flex-direction: column; padding: 10px; scroll-margin-top: 90px; }
.listing:hover { border-color: rgba(255, 255, 255, .14); }
.card:target { border-color: var(--outline-active); }
.card-stub { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 18px; color: var(--text-2); font-size: 14px; }
.card-stub form { margin: 0; }
.stub-text { display: inline-flex; align-items: center; gap: 10px; }
.stub-text .ic { color: var(--text-3); }

.card-media { position: relative; z-index: 1; }
.photo-frame { position: relative; border-radius: var(--r); overflow: hidden; background: var(--bg-raise); aspect-ratio: 4 / 3; }
.photo-main { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.listing:hover .photo-main { transform: scale(1.03); }
.photo-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-3); font-size: 13px; background: radial-gradient(60% 70% at 70% 20%, rgba(255, 122, 26, .1), transparent 60%),
  radial-gradient(50% 60% at 20% 90%, rgba(140, 92, 255, .12), transparent 60%), linear-gradient(135deg, #17181d, #0a0b0d); }
.photo-placeholder .ic { width: 28px; height: 28px; }
.photo-broken { visibility: hidden; }
.labels { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.labels .badge { background-color: rgba(8, 9, 11, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.labels .badge.orange { background-image: linear-gradient(rgba(255, 122, 26, .16), rgba(255, 122, 26, .16)); }
.labels .badge.amber { background-image: linear-gradient(var(--amber-bg), var(--amber-bg)); }
.badge-saved { color: var(--text); }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 6px; margin-top: 6px; }
.thumb { position: relative; padding: 0; border: 1px solid transparent; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-raise);
  cursor: pointer; opacity: .55; transition: opacity var(--t), border-color var(--t); }
.thumb:hover { opacity: .9; }
.thumb.is-active { opacity: 1; border-color: var(--outline-active); }
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumbs-more { display: grid; place-items: center; padding: 0 8px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .04);
  color: var(--text-2); font-size: 12.5px; font-weight: 600; }

.card-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-width: 0; padding: 14px 8px 6px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.price-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.price { font: 680 30px/1.1 var(--font); letter-spacing: -.04em; color: var(--text); white-space: nowrap; }
.price-unknown { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--text-2); }
.price-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--text-3); }
.price-sub:empty { display: none; }
.price-old { color: var(--text-3); }
.price-orig { color: var(--text-2); }
.trust-ring { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; cursor: help; }
.trust-ring::after { content: "довіра"; font-size: 11px; font-weight: 550; color: var(--text-3); }
.trust-pill { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ring { --p: 0; --c: var(--text-3); position: relative; width: 48px; height: 48px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--c) 45%, transparent)); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .bar { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 150.8; stroke-dashoffset: calc(150.8 - 150.8 * var(--p));
  transition: stroke-dashoffset 1.4s var(--ease); }
.js [data-reveal]:not(.is-in) .ring .bar { stroke-dashoffset: 150.8; }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 680; font-size: 14px; letter-spacing: -.02em; }
.ring-high { --c: var(--green); }
.ring-mid { --c: var(--amber); }
.ring-low { --c: var(--red); }

.card-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; overflow-wrap: anywhere; }
.card-title a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; transition: color var(--t); }
.card-title a:hover { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.cards-single .card-title a { -webkit-line-clamp: unset; line-clamp: none; display: inline; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.facts li { display: inline-flex; align-items: baseline; gap: 4px; height: 28px; align-items: center; padding: 0 11px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.facts b { color: var(--text); font-weight: 650; }
.place { display: flex; align-items: flex-start; gap: 6px; font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.place .ic { width: 15px; height: 15px; margin-top: 3px; color: var(--text-3); }
.poster, .terms, .reasons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.poster-name, .poster-agency { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.poster-agency { color: var(--text-3); }
.reason { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500;
  line-height: 1.25; border: 1px solid var(--border); background: rgba(255, 255, 255, .04); color: var(--text-2); }
.reason b { font-weight: 650; }
.reason-pos { background: var(--green-bg); border-color: rgba(61, 214, 140, .2); }
.reason-pos b { color: var(--green); }
.reason-neg { background: var(--amber-bg); border-color: rgba(255, 178, 36, .2); }
.reason-neg b { color: var(--amber); }

.sources { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.sources li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.sources a { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; color: var(--text); }
.sources a .ic { width: 13px; height: 13px; color: var(--text-3); transition: color var(--t), transform var(--t) var(--ease); }
.sources a:hover { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.sources a:hover .ic { color: var(--text); transform: translate(1px, -1px); }
.src-price { margin-left: auto; font-weight: 650; color: var(--text); }
.sources .muted { font-size: 12.5px; }
.src-nolink { color: var(--text-3); text-decoration: line-through; }
.times { font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.times time { color: var(--text-2); }
.pub-hint { display: inline-block; padding: 0 7px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .06); color: var(--text-2); font-size: 11.5px; cursor: help; }
.desc summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 550; color: var(--text-2); transition: color var(--t); }
.desc summary::-webkit-details-marker { display: none; }
.desc summary .ic { width: 15px; height: 15px; transition: transform var(--t) var(--ease); }
.desc summary:hover { color: var(--text); }
.desc[open] summary .ic { transform: rotate(180deg); }
.desc-text { margin-top: 8px; max-height: 22em; overflow-y: auto; padding: 12px 14px; border-radius: var(--r); background: rgba(0, 0, 0, .22);
  border: 1px solid var(--border); white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.actions form { margin: 0; display: flex; }
.more-wrap { grid-column: 1 / -1; margin-top: 8px; }
.btn-wide { --h: 48px; width: 100%; font-size: 15px; }

/* empty states */
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty h2 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.empty p { color: var(--text-2); max-width: 46ch; }
.empty .btn { margin-top: 10px; }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px; color: var(--accent-3);
  background: linear-gradient(180deg, rgba(255, 122, 26, .18), rgba(255, 122, 26, .04)); border: 1px solid rgba(255, 122, 26, .25);
  box-shadow: 0 0 40px -6px var(--glow); animation: bob 3.4s ease-in-out infinite; }
.empty-icon .ic { width: 24px; height: 24px; }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* single card page */
.cards-single { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .cards-single .listing { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px 20px; align-items: start; padding: 14px; }
  .cards-single .card-media { position: sticky; top: 90px; }
  .cards-single .card-body { padding-top: 6px; }
  .cards-single .price { font-size: 40px; }
}

/* ---------------------------------------------------------------- searches */
.search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.search-item { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 18px; padding: 18px 20px; }
.search-item:hover { border-color: rgba(255, 255, 255, .14); }
.search-item.is-off { opacity: .78; }
.search-icon { position: relative; z-index: 1; width: 44px; height: 44px; flex: none; border-radius: var(--r); display: grid; place-items: center; color: var(--accent-3);
  background: linear-gradient(180deg, rgba(255, 122, 26, .18), rgba(255, 122, 26, .04)); border: 1px solid rgba(255, 122, 26, .25); box-shadow: 0 0 30px -6px var(--glow); }
.search-item.is-off .search-icon { color: var(--text-3); background: rgba(255, 255, 255, .04); border-color: var(--border-strong); box-shadow: none; }
.search-main { position: relative; z-index: 1; flex: 1 1 320px; min-width: 0; display: grid; gap: 6px; }
.search-main h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; overflow-wrap: anywhere; }
.search-main h2 a:hover { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.search-sum { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.search-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13.5px; margin-top: 2px; }
.search-meta b { color: var(--text); }
.search-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.search-actions form { margin: 0; display: flex; }

.search-form { max-width: 860px; display: grid; gap: 16px; }
.search-form fieldset { margin: 0; min-width: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.search-form legend { float: left; width: 100%; padding: 0; display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.search-form legend + * { clear: both; }
.legend-idx { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 650; color: var(--accent-3);
  background: rgba(255, 122, 26, .12); border: 1px solid rgba(255, 122, 26, .25); }
.checks-row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; padding: 10px; border-radius: var(--r-lg);
  background: var(--glass-strong); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }

/* ---------------------------------------------------------------- health */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 22px; }
.kpi-v { font-size: clamp(30px, 3.4vw, 42px); font-weight: 680; letter-spacing: -.04em; line-height: 1.05; }
.kpi-l { font-size: 13.5px; color: var(--text-2); }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); margin-top: 8px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 550; color: var(--text-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em;
  padding: 13px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table td .muted { display: block; font-size: 12.5px; color: var(--text-3); }
.health th { white-space: normal; min-width: 72px; vertical-align: bottom; }
.health td { white-space: nowrap; }
.health td:nth-child(2) { white-space: normal; }
.last-error { margin-top: 6px; max-width: 40ch; overflow-wrap: anywhere; font-size: 12.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- map */
.map-window { margin-top: 16px; }
.map-window .window-title { margin-right: 0; }
.map-legend { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; color: var(--text-3); }
.pin-key { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text); margin-left: 6px; }
.pin-key-new { background: var(--accent); box-shadow: 0 0 8px var(--glow); margin-left: 0; }
.map { height: 70vh; min-height: 380px; background: #0c0d10; }
.leaflet-container { background: #0c0d10; font: 400 14px/1.45 var(--font); }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.92) saturate(.4); }
.leaflet-bar, .leaflet-touch .leaflet-bar { border: 1px solid var(--border-strong) !important; border-radius: var(--r) !important; overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8) !important; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { background: var(--glass-strong); color: var(--text); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.leaflet-bar a:hover { background: var(--bg-raise-3); color: var(--text); }
.leaflet-control-attribution { background: rgba(7, 8, 10, .6) !important; color: var(--text-3); font-size: 11px; border-radius: var(--r-sm) 0 0 0; }
.leaflet-control-attribution a { color: var(--text-2); }
.leaflet-popup-content-wrapper { background: var(--glass-strong); color: var(--text); border-radius: 14px; border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }
.leaflet-popup-tip { background: var(--glass-strong); box-shadow: none; }
.leaflet-popup-content { margin: 14px 16px; font: 400 14px/1.45 var(--font); }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-2); top: 6px; right: 6px; }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--text); }
.map-popup { display: grid; gap: 6px; }
.mp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-price { font-size: 22px; font-weight: 680; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.mp-facts { color: var(--text-2); font-size: 13px; }
.mp-title { font-size: 14px; font-weight: 550; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.mp-addr { color: var(--text-3); font-size: 13px; }
.mp-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.leaflet-container a.mp-link { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--bg-raise-2);
  border: 1px solid var(--border-strong); color: var(--text); font-size: 13px; font-weight: 550; transition: background var(--t); }
.leaflet-container a.mp-link:hover { background: var(--bg-raise-3); }
.leaflet-container a.mp-link.mp-primary { background: #fff; color: #08080a; border-color: #fff; }
.pin { border-radius: 50%; background: var(--text); border: 2px solid rgba(7, 8, 10, .85); box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 2px 8px rgba(0, 0, 0, .6); }
.pin-new { background: var(--accent); box-shadow: 0 0 0 1px rgba(255, 179, 107, .6), 0 0 14px 3px var(--glow); }
.pin-drop { background: var(--bg-raise); border-color: var(--amber); box-shadow: 0 0 10px rgba(255, 178, 36, .45); }
.leaflet-marker-icon.pin:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.map-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--text-3); }
.map-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- login / errors */
.login-box { max-width: 420px; margin: 40px auto 0; }
.login-box .window-body { display: grid; gap: 12px; padding: 28px; }
.login-box h1 { margin-top: 4px; }
.login-box form { display: grid; gap: 14px; margin-top: 8px; }
.login-box .form-errors { margin: 0; }
.login-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-3);
  background: linear-gradient(180deg, rgba(255, 122, 26, .18), rgba(255, 122, 26, .04)); border: 1px solid rgba(255, 122, 26, .25); box-shadow: 0 0 30px -6px var(--glow); }
.error-box { max-width: 560px; margin: 40px auto 0; padding: 40px 28px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.error-code { font-size: clamp(72px, 14vw, 140px); line-height: 1; }
.error-msg { color: var(--text-2); max-width: 46ch; }
.config-error { max-width: 820px; margin: 40px auto; }
.config-error .window-body { display: grid; gap: 12px; padding: 24px 28px; }
.config-error .badge { justify-self: start; }
.config-error p, .config-error li { color: var(--text-2); line-height: 1.65; }
.config-error ul, .config-error ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---------------------------------------------------------------- footer */
.foot { margin-top: 72px; padding-bottom: 40px; }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-top: 24px; border-top: 1px solid var(--border); }
.foot-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.foot-label { font-size: 12px; font-weight: 550; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.foot-value { font-size: 14.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.foot-note { font-size: 13px; color: var(--text-2); }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 2000; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; font-size: 14px; color: var(--text);
  background: var(--glass-strong); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); animation: toast-in .45s var(--ease-spring); }
.toast::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px) scale(.96); } }

/* ---------------------------------------------------------------- reveal on scroll (JS adds .is-in; no JS = all visible) */
.js [data-reveal] { opacity: 0; transform: translateY(24px); }
.js [data-reveal].is-in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js [data-reveal]:not(.is-in) { animation: reveal-failsafe .01s 2.5s forwards; }  /* if app.js never runs */
@keyframes reveal-failsafe { to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- responsive */
.hide-sm, .hide-xs { }
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-actions { align-items: flex-start; }
  .scan-status { text-align: left; }
}
@media (max-width: 720px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 0; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .table td:nth-child(-n+2) { grid-column: span 1; }
  .health td { white-space: normal; }
  .table tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 4px 16px; }
  .table td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 550; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
  .foot-grid { grid-template-columns: 1fr; gap: 16px; }
  .filters-hint { display: none; }
  .search-form fieldset { padding: 18px 16px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .statusbar { gap: 10px 14px; }
  .sb-next { flex-basis: 100%; order: 3; }
  .sb-right { margin-left: 0; }
  .price { font-size: 28px; }
  .page-head { margin-top: 18px; }
  .brand-text small { display: none; }
}
@media (max-width: 480px) {
  .segmented { flex-wrap: wrap; border-radius: var(--r-lg); overflow: visible; }
}
@media (max-width: 400px) {
  .hide-xs { display: none; }
  .kpi { padding: 16px; }
  .listing { padding: 8px; }
  .seg { padding: 7px 12px; }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .look-bg i { animation: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .listing:hover .photo-main { transform: none; }
}
