/* Blackkey: black lacquer and brass, set in mosaic. Dark by default, light on request; the admin area wears garnet and gold. */

@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Noto Sans Georgian';
  src: url('/fonts/noto-sans-georgian-georgian-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31;
}

:root {
  --site-mh: #26b571; --site-ss: #2c61f2; /* myhome.ge green, ss.ge blue: each site's own colour */
  color-scheme: dark;

  --ground: #070707;
  --panel: #0e0e0f;
  --panel-2: #141415;
  --raised: #1b1b1d;
  --line: #252527;
  --line-2: #333336;
  --field: #09090a;
  --field-focus: #0b0b0c;
  --scrim: rgba(4, 6, 10, .62);

  --rail: #0a0a0a;
  --rail-2: #1a1a1c;
  --rail-line: #262628;
  --rail-ink: #e6e1d6;
  --rail-ink-2: #8f8b83;
  --rail-tile: #111112;

  --ink: #ece8df;
  --ink-2: #aeaba4;
  --ink-3: #7d7a74;

  --cobalt: #8e9099;
  --cobalt-hi: #b4b6be;
  --cobalt-deep: #3d3e43;
  --gold: #d4ac55;
  --gold-hi: #e8c77e;
  --gold-text: #e0bd6e;
  --teal: #2bb39c;
  --teal-text: #5fd3bf;
  --terra: #e0623f;
  --terra-text: #f29a80;

  /* agents: ivory primary buttons on black, brass for everything that means "this one" */
  --accent: #ece8df;
  --accent-hi: #ffffff;
  --accent-ink: #0a0a0a;
  --accent-text: #e0bd6e;
  --accent-ring: rgba(212, 172, 85, .28);
  --accent-glow: rgba(0, 0, 0, .6);
  --brass: #d4ac55;

  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 14px -8px rgba(0,0,0,.6);
  --shadow-pop: 0 12px 18px -8px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.35);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --t-fast: 160ms;
  --t: 320ms;
  --t-slow: 700ms;

  /* chart slots, validated with the dataviz checker */
  --c1: #a8832a; --c2: #6f8fd8; --c3: #1f9a86; --c4: #e0623f; --c-muted: #5b5a57;
  --r0: #1a1a1b; --r1: #6b5524; --r2: #957433; --r3: #c49a3c; --r4: #ecd29a;

  --art-bg: #050505; --art-veil: 7, 7, 7; --art-line: #1b1b1d; --art-ink: #ece8df; --art-ink-2: #aeaba4; --art-ink-3: #7d7a74;
  --font: 'Manrope', 'Noto Sans Georgian', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

:root[data-theme='light'] {
  color-scheme: light;
  --ground: #efede8;
  --panel: #ffffff;
  --panel-2: #f7f6f3;
  --raised: #efede9;
  --line: #e2dfd9;
  --line-2: #cfcbc3;
  --field: #faf9f7;
  --field-focus: #ffffff;
  --scrim: rgba(10, 10, 10, .45);

  --ink: #111111;
  --ink-2: #4a4741;
  --ink-3: #6b675f;

  --gold-text: #8a6418;
  --teal-text: #0f7466;
  --terra-text: #b23d1f;
  --accent: #111111;
  --accent-hi: #000000;
  --accent-ink: #ffffff;
  --accent-text: #8a6418;
  --accent-ring: rgba(138, 100, 24, .2);
  --accent-glow: rgba(0, 0, 0, .25);

  --c1: #9a7420; --c2: #3d63c9; --c3: #008f7c; --c4: #c94c2a; --c-muted: #a19e98;
  --r0: #efede8; --r1: #c9ad6e; --r2: #b8902f; --r3: #8a6418; --r4: #5a3f0c;
  --shadow: 0 1px 2px rgba(20, 16, 10, .06), 0 6px 14px -8px rgba(20, 16, 10, .18);
  --shadow-pop: 0 12px 18px -8px rgba(20, 16, 10, .25), 0 2px 6px rgba(20, 16, 10, .1);
}

/* the admin area: oxblood lacquer and brass, so it never reads as the agent workspace */
body[data-area='admin'] {
  --rail: #160505;
  --rail-2: #2e0b0b;
  --rail-line: #3f1212;
  --rail-ink: #efdcd5;
  --rail-ink-2: #b98a80;
  --rail-tile: #220808;
  --accent: #b3362c;
  --accent-hi: #c94436;
  --accent-ink: #ffffff;
  --accent-text: #ec9284;
  --accent-ring: rgba(179, 54, 44, .3);
  --accent-glow: rgba(0, 0, 0, .6);
}
:root[data-theme='light'] body[data-area='admin'] { --accent-text: #9b2a20; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* the public pages keep the scrollbar's room even when a page is short, so the centered bar never shifts between pages */
:root:has(> body[data-area='home']), :root:has(> body[data-area='homes']) { scrollbar-gutter: stable; }
html { background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
  transition: background var(--t) ease, color var(--t) ease;
}
:lang(ka) body, html:lang(ka) { letter-spacing: 0; }
::selection { background: rgba(212, 172, 85, .32); color: inherit; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
html:lang(ka) h1, html:lang(ka) h2, html:lang(ka) h3 { letter-spacing: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
.tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- motion vocabulary ---------- */
/* no blur here: a blurred layer over the lacquer ground draws in a different black and shows a seam until it settles */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-right { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes set-tile {
  0% { opacity: 0; transform: scale(.6) rotate(-8deg); }
  60% { opacity: 1; transform: scale(1.06) rotate(1deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }

.rise { animation: rise var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + var(--d, 0ms)); }

/* ---------- controls ---------- */
.field { display: grid; gap: 8px; min-width: 0; }
.field + .field, .field-pair + .field, .field + .field-pair { margin-top: 18px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  background: var(--field);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  transition: border-color var(--t-fast) ease, box-shadow var(--t) var(--ease), background var(--t) ease;
}
.control:hover { border-color: color-mix(in srgb, var(--line-2) 60%, var(--ink-3)); }
.control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); background: var(--field-focus); }
.control input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px;
  background: transparent; border: 0; outline: none; color: var(--ink); font-size: 15px;
}
.control input::placeholder { color: var(--ink-3); }
.control input:-webkit-autofill { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 100px var(--field-focus) inset; transition: background-color 9999s; }
.control .lead { margin-left: 14px; color: var(--ink-3); transition: color var(--t-fast); }
.control .lead + input { padding-left: 10px; }
.control:focus-within .lead { color: var(--accent-text); }
.control.invalid { border-color: var(--terra); animation: shake 420ms var(--ease); }
.control.invalid:focus-within { box-shadow: 0 0 0 4px rgba(224, 98, 63, .18); }
.control.is-static { background: transparent; border-style: dashed; }
.control.is-static input { color: var(--ink-2); cursor: default; }

select {
  appearance: none;
  width: 100%;
  height: 42px;
  padding: 0 38px 0 12px;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d7a74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t) var(--ease);
}
select:hover { border-color: color-mix(in srgb, var(--line-2) 60%, var(--ink-3)); }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
select option { background: var(--panel); color: var(--ink); }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; margin-right: 5px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--ink); background: var(--raised); }
.icon-btn:active { transform: scale(.9); }
.icon-btn:disabled { opacity: .5; cursor: progress; }

.hint { font-size: 13px; color: var(--ink-3); }
.error-text {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  font-size: 13px; color: var(--terra-text);
  transition: grid-template-rows var(--t) var(--ease), opacity var(--t) ease;
}
.error-text > span { overflow: hidden; }
.error-text.show { grid-template-rows: 1fr; opacity: 1; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r);
  font-weight: 650; font-size: 15px; text-decoration: none;
  cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: background var(--t-fast) ease, border-color var(--t-fast), color var(--t-fast),
              transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.16) inset, 0 4px 10px -4px rgba(0,0,0,.5);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 14px -6px rgba(0,0,0,.55); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--raised); }
.btn-quiet { background: transparent; color: var(--ink-3); }
.btn-quiet:hover:not(:disabled) { color: var(--terra-text); background: rgba(224,98,63,.1); }
.btn-danger { background: transparent; color: var(--terra-text); border-color: rgba(224, 98, 63, .45); }
.btn-danger:hover:not(:disabled) { background: rgba(224, 98, 63, .14); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; gap: 8px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-block { width: 100%; }

.btn .label-text, .btn .busy, .btn .done { display: inline-flex; align-items: center; gap: 10px; transition: opacity var(--t-fast), transform var(--t) var(--ease); }
.btn .busy, .btn .done { position: absolute; inset: 0; justify-content: center; opacity: 0; transform: translateY(10px); }
.btn.is-busy .label-text, .btn.is-done .label-text { opacity: 0; transform: translateY(-10px); }
.btn.is-busy .busy { opacity: 1; transform: none; }
.btn.is-done .done { opacity: 1; transform: none; }
.btn.is-done { background: var(--teal); color: #04241e; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; opacity: .8; animation: spin 700ms linear infinite; }

/* the one button everyone sees: gold smalt with a travelling glint */
.btn-add {
  height: 42px; padding: 0 18px 0 14px;
  background: var(--gold); color: #140f04; font-weight: 750;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 4px 10px -4px rgba(0,0,0,.55);
  isolation: isolate;
}
.btn-add::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg);
  animation: glint 4.2s var(--ease) infinite 1.2s;
}
@keyframes glint { 0% { left: -60%; } 28%, 100% { left: 130%; } }
.btn-add:hover:not(:disabled) { background: var(--gold-hi); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 8px 16px -6px rgba(0,0,0,.6); transform: translateY(-1px); }
.btn-add .plus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #140f04; color: var(--gold); transition: transform var(--t) var(--ease); }
.btn-add .plus .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.btn-add:hover .plus { transform: rotate(90deg); }
.btn-add.is-here { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--gold); }

/* segmented controls */
.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.seg button {
  position: relative; z-index: 1; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 16px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-3); font-weight: 650; font-size: 14px; cursor: pointer;
  transition: color var(--t-fast);
}
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); }
.seg .seg-pill {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0;
  border-radius: 999px;
  background: var(--raised);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 12px -6px rgba(0,0,0,.6);
  transition: transform 420ms var(--ease);
}
:root[data-theme='light'] .seg .seg-pill { background: #fff; box-shadow: 0 1px 3px rgba(20,30,60,.15); }
.seg-sm button { height: 28px; padding: 0 11px; font-size: 12.5px; }
.seg-sm button .icon { width: 14px; height: 14px; }

/* ---------- sign-in screens ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, 520px); min-height: 100vh; min-height: 100dvh; }
.auth-art { position: relative; overflow: hidden; background: #050505; isolation: isolate; }
.auth-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-art::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 5, 5,0) 45%, rgba(5, 5, 5,.9) 100%);
}
.auth-caption { position: absolute; left: clamp(28px, 5vw, 64px); right: clamp(28px, 5vw, 64px); bottom: clamp(28px, 6vh, 64px); z-index: 2; color: #ece8df; }
.wordmark { display: flex; align-items: center; gap: 14px; font-size: clamp(44px, 6.4vw, 88px); font-weight: 800; letter-spacing: -0.04em; line-height: .95; }
.auth-caption p { margin-top: 16px; max-width: 40ch; color: #aeaba4; font-size: 16px; }
.auth-panel {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(32px, 6vh, 72px) clamp(28px, 4vw, 64px);
  background: var(--panel); border-left: 1px solid var(--line);
}
.auth-panel .top {
  position: absolute; top: clamp(24px, 4vh, 40px); left: clamp(28px, 4vw, 64px); right: clamp(28px, 4vw, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand-mini { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.auth-form { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-form h1 { font-size: 32px; line-height: 1.15; }
.auth-form .lede { margin-top: 10px; margin-bottom: 32px; color: var(--ink-2); }
.auth-form .btn-block { margin-top: 28px; }
.auth-form .form-error { margin-top: 14px; }
.auth-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.auth-glyph:empty { display: none; }

/* admin sign-in: mirrored, garnet, gold, a shield crest */
.auth.is-admin { grid-template-columns: minmax(400px, 520px) minmax(0, 1.25fr); }
.auth.is-admin .auth-art { order: 2; }
.auth.is-admin .auth-panel {
  order: 1;
  border-left: 0;
  border-right: 1px solid #3f1212;
  border-top: 3px solid var(--gold);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(106, 26, 26, .35), transparent 60%),
    var(--panel);
}
:root[data-theme='light'] .auth.is-admin .auth-panel { background: radial-gradient(120% 60% at 0% 0%, rgba(176, 60, 50, .12), transparent 60%), var(--panel); }
.auth.is-admin .auth-caption { text-align: right; }
.auth.is-admin .wordmark { justify-content: flex-end; }
.auth.is-admin .auth-caption p { margin-left: auto; }
.auth.is-admin .auth-art::after { background: linear-gradient(180deg, rgba(5, 5, 5,0) 45%, rgba(20,6,6,.92) 100%), linear-gradient(270deg, rgba(20,6,6,0) 70%, rgba(20,6,6,.5) 100%); }
.auth-glyph {
  display: grid; place-items: center;
  width: 52px; height: 52px; margin-bottom: 22px;
  border-radius: 14px;
  background: linear-gradient(160deg, #2e0b0b, #160505);
  border: 1px solid #521616;
  color: var(--gold);
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.6);
}
.auth-glyph .icon { width: 26px; height: 26px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
}
.pill .icon { width: 13px; height: 13px; }
.pill.gold { color: var(--gold-text); border-color: rgba(212, 172, 85,.45); background: rgba(212, 172, 85,.1); }

/* the brand mark: a black key set in brass tiles. A round bow with a hole, the shaft, one tooth */
.mark { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1.5px; width: 26px; height: 15px; flex: none; }
.mark i { border-radius: 1.5px; background: var(--brass); animation: set-tile var(--t-slow) var(--ease) both; }
.mark i:nth-child(4), .mark i:nth-child(5), .mark i:nth-child(7), .mark i:nth-child(14) { visibility: hidden; }
.mark i:nth-child(1) { border-top-left-radius: 70%; }
.mark i:nth-child(3) { border-top-right-radius: 70%; }
.mark i:nth-child(11) { border-bottom-left-radius: 70%; }
.mark i:nth-child(13) { border-bottom-right-radius: 70%; }
.mark i:nth-child(9), .mark i:nth-child(10) { background: #ecd29a; animation-delay: 220ms; }
.mark i:nth-child(15) { background: #9a7630; animation-delay: 320ms; }
.mark i:nth-child(2), .mark i:nth-child(6), .mark i:nth-child(12) { animation-delay: 60ms; }
.mark i:nth-child(3), .mark i:nth-child(8), .mark i:nth-child(13) { animation-delay: 120ms; }
body[data-area='admin'] .mark i, .auth.is-admin .mark i { background: #b3362c; }
body[data-area='admin'] .mark i:nth-child(9), body[data-area='admin'] .mark i:nth-child(10), .auth.is-admin .mark i:nth-child(9), .auth.is-admin .mark i:nth-child(10) { background: var(--brass); }
body[data-area='admin'] .mark i:nth-child(15), .auth.is-admin .mark i:nth-child(15) { background: #9a7630; }
.wordmark .mark { width: .78em; height: .45em; gap: .04em; }
.wordmark .mark i { border-radius: .03em; }
.wordmark .mark i:nth-child(1) { border-top-left-radius: 70%; }
.wordmark .mark i:nth-child(3) { border-top-right-radius: 70%; }
.wordmark .mark i:nth-child(11) { border-bottom-left-radius: 70%; }
.wordmark .mark i:nth-child(13) { border-bottom-right-radius: 70%; }
.wm-text { display: inline-flex; align-items: baseline; gap: .22em; }
.wm-text em { font-style: normal; font-weight: inherit; color: var(--brass); font-size: inherit; letter-spacing: inherit; }
.wm-text { gap: 0; }
.brand-mini em { font-style: normal; color: var(--brass); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.rail {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--rail); border-right: 1px solid var(--rail-line); color: var(--rail-ink);
  animation: slide-in-left var(--t-slow) var(--ease) both;
  transition: background var(--t) ease;
}
.rail > * { position: relative; }
.rail-brand { display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 22px; border-bottom: 1px solid var(--rail-line); }
.rail-brand strong { font-size: 17px; letter-spacing: -0.02em; color: var(--rail-strong, #fff); }
.rail-brand strong em { font-style: normal; color: var(--brass); }
.wm-admin { margin-left: .28em; font-weight: 500; font-size: .42em; color: #ec9284; letter-spacing: 0; align-self: center; }
.rail-brand small { display: block; font-size: 12px; color: var(--rail-ink-2); font-weight: 650; margin-top: 1px; }
body[data-area='admin'] .rail-brand small { color: var(--gold); }
.nav { position: relative; display: grid; gap: 4px; padding: 18px 12px; }
.nav-group { padding: 0 12px 8px; font-size: 12px; font-weight: 650; color: var(--rail-ink-2); }
.nav a + .nav-group { margin-top: 22px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 14px 0 16px; border-radius: var(--r);
  color: var(--rail-ink-2); text-decoration: none; font-weight: 600;
  transition: color var(--t-fast), background var(--t) var(--ease);
  animation: slide-in-left var(--t-slow) var(--ease) both;
  animation-delay: calc(140ms + var(--i, 0) * 60ms);
}
.nav a:hover { color: var(--rail-strong, #fff); background: var(--rail-hover, rgba(255,255,255,.06)); }
.nav a .icon { transition: transform var(--t) var(--ease); }
.nav a:hover .icon { transform: translateX(2px); }
.nav a[aria-current='page'] { color: var(--rail-strong, #fff); background: var(--rail-2); }
.nav-tessera {
  position: absolute; left: 12px; top: 0; width: 4px; height: 18px; border-radius: 2px;
  background: var(--gold);
  transition: transform 520ms var(--ease), opacity var(--t); opacity: 0; pointer-events: none;
}
.rail-note { margin-top: auto; padding: 16px 18px 18px; border-top: 1px solid var(--rail-line); font-size: 12.5px; color: var(--rail-ink-2); animation: fade var(--t-slow) var(--ease) both 400ms; }
.rail-note:empty { display: none; }
.rail-note .ext { display: flex; align-items: center; gap: 10px; }
.rail-note .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--rail-ink-2); flex: none; transition: background var(--t), box-shadow var(--t); }
.rail-note .ext.on .dot { background: var(--teal); }
.rail-note .ext strong { display: block; color: var(--rail-ink); font-weight: 650; }
.rail-note .lock { display: flex; gap: 10px; align-items: flex-start; color: var(--rail-ink); }
.rail-note .lock .icon { color: var(--gold); margin-top: 1px; }
.rail-note .lock small { display: block; color: var(--rail-ink-2); margin-top: 2px; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.admin-band {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 0 clamp(20px, 3vw, 40px);
  font-size: 13px;
  color: var(--band-ink, #efe2c2);
  background: linear-gradient(90deg, var(--band-a, #220808), var(--band-b, #160505));
  border-bottom: 1px solid var(--band-line, #3f1212);
  animation: drop-in var(--t-slow) var(--ease) both;
}
.admin-band .icon { width: 16px; height: 16px; color: var(--gold); }
.admin-band strong { color: var(--gold); font-weight: 750; }
.admin-band span { color: var(--band-ink-2, #cfb3a8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 72px; padding: 0 clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--line); background: var(--panel);
  transition: background var(--t) ease;
}
body[data-area='admin'] .topbar { box-shadow: inset 0 -2px 0 rgba(212, 172, 85,.35); }
.topbar h1 { font-size: 20px; }
.topbar .crumbs { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex: none; }
.view-title.swap { animation: rise 420ms var(--ease) both; display: inline-block; }

/* avatar */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; overflow: hidden;
  background: var(--raised);
  box-shadow: 0 0 0 1px var(--line-2);
}
.avatar img, .avatar canvas { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* profile button + menu */
.profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 10px 0 5px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t) var(--ease);
}
.profile-btn:hover { background: var(--raised); border-color: var(--line-2); }
.profile-btn[aria-expanded='true'] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.profile-name { display: grid; text-align: left; line-height: 1.2; max-width: 160px; }
.profile-name strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name small { font-size: 11.5px; color: var(--ink-3); }
.profile-btn .chev { color: var(--ink-3); transition: transform var(--t) var(--ease); }
.profile-btn[aria-expanded='true'] .chev { transform: rotate(180deg); color: var(--ink); }

.menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40;
  width: 300px; padding: 8px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  transform-origin: top right;
  animation: menu-in 300ms var(--ease) both;
}
.menu.closing { animation: menu-out 160ms var(--ease-in) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes menu-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu > * { animation: drop-in 380ms var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms + 40ms); }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu-head strong { display: block; font-size: 14.5px; }
.menu-head small { display: block; font-size: 12.5px; color: var(--ink-3); }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 42px; padding: 0 10px;
  border: 0; border-radius: var(--r); background: transparent;
  color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--raised); color: var(--ink); outline: none; }
.menu-item.danger { color: var(--terra-text); }
.menu-item.danger:hover { background: rgba(224, 98, 63, .12); }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 0 4px 0 10px; }
.menu-label { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* the scroller is composited on its own layer; on macOS Chrome draws a layer's darks a shade apart from the page
   under it, so the main area and the scroller paint the ground themselves instead of showing the body through */
.main { background: var(--ground); }
.content { flex: 1; min-height: 0; overflow: auto; padding: clamp(20px, 3vw, 40px); scroll-behavior: smooth; background: var(--ground); }
.view { min-height: 100%; }
.view.leaving { animation: view-out 180ms var(--ease-in) both; }
@keyframes view-out { to { opacity: 0; transform: translateY(-6px); } }

/* panels */
.split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; align-items: stretch; min-height: 100%; }
.panel {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transition: background var(--t) ease, border-color var(--t) ease;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.panel-head p { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.panel-body { padding: 22px; }
.panel-body.flush { padding: 0; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.panel-foot { padding: 18px 22px; border-top: 1px solid var(--line); margin-top: auto; }
.form-panel { align-self: start; position: sticky; top: 0; }
.stack { display: grid; gap: 20px; grid-template-rows: auto minmax(220px, 1fr); }
.stack-start { display: grid; gap: 20px; align-content: start; }

/* password strength: four tesserae */
.strength { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.strength-tiles { display: flex; gap: 3px; }
.strength-tiles i { width: 18px; height: 6px; border-radius: 2px; background: var(--line-2); transition: background var(--t) var(--ease), transform var(--t) var(--ease); }
.strength-tiles i.on { transform: scaleY(1.35); }
.strength[data-level='1'] i.on { background: var(--terra); }
.strength[data-level='2'] i.on { background: var(--gold); }
.strength[data-level='3'] i.on, .strength[data-level='4'] i.on { background: var(--teal); }

/* admin account list */
.list-tools { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.list-tools .control { flex: 1; max-width: 340px; }
.list-tools .control input { height: 38px; font-size: 14px; }
.count { font-size: 13px; color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.rows { list-style: none; margin: 0; padding: 6px 0; }
.row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 16px;
  min-height: 68px; padding: 10px 22px; border-bottom: 1px solid var(--line);
  transition: background var(--t-fast);
  animation: rise 560ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel-2); }
.row .avatar { animation: set-tile 620ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
.row .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name small { font-weight: 600; color: var(--ink-3); margin-left: 8px; font-size: 13px; }
.row .meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 12px; min-width: 0; }
.row .when { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.row.is-new { background: rgba(212, 172, 85, .07); }
.row.removing { animation: row-out 380ms var(--ease-in) both; }
@keyframes row-out { to { opacity: 0; transform: translateX(24px); filter: blur(4px); } }
.row-actions { display: flex; align-items: center; gap: 2px; }
.row-actions .icon-btn { margin: 0; }
.row-actions .icon-btn.ok { color: var(--teal-text); }
.row-actions .icon-btn.danger:hover { color: var(--terra-text); background: rgba(224,98,63,.12); }
.who-cell { min-width: 0; }
.secret { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; letter-spacing: .12em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.secret.shown { letter-spacing: .01em; color: var(--gold-text); font-weight: 650; user-select: all; }
.secret.flip { animation: secret-in 420ms var(--ease) both; }
@keyframes secret-in { from { opacity: 0; filter: blur(5px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }
.confirm { display: flex; align-items: center; gap: 8px; animation: rise 300ms var(--ease) both; }
.confirm span { font-size: 13px; color: var(--ink-2); }

.empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 14px; padding: 56px 24px; text-align: center; }
.empty canvas { width: 96px; height: 96px; border-radius: 12px; animation: set-tile 900ms var(--ease) both; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--ink-3); max-width: 42ch; }
.skeleton { height: 64px; margin: 0 22px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.skeleton::after {
  content: ''; position: absolute; inset: 18px auto 18px 0; width: 55%; border-radius: 6px;
  background: linear-gradient(90deg, var(--panel-2), var(--raised), var(--panel-2)); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

/* settings facts */
.facts { display: grid; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-3); font-size: 14px; }
.facts dd { margin: 0; font-weight: 650; text-align: right; }
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 8px; border-radius: var(--r); font-size: 14px;
  background: rgba(212, 172, 85,.1); border: 1px solid rgba(212, 172, 85,.35); color: var(--ink);
  animation: rise 520ms var(--ease) both;
}
.notice .icon { color: var(--gold-text); margin-top: 1px; }
.notice.ok { background: rgba(43,179,156,.1); border-color: rgba(43,179,156,.35); }
.notice.ok .icon { color: var(--teal-text); }

/* workspace home */
.welcome { display: grid; grid-template-rows: auto 1fr; gap: 20px; min-height: 100%; }
.hello { flex-direction: row; align-items: center; gap: 22px; padding: 28px; }
.hello h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.03em; }
.hello p { color: var(--ink-2); margin-top: 6px; }
.mural { position: relative; overflow: hidden; min-height: 280px; padding: 0; background: #050505; }
.mural canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mural-note {
  position: absolute; left: 28px; bottom: 28px; right: 28px; max-width: 460px;
  padding: 20px 22px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--ink);
  border: 1px solid var(--line-2); backdrop-filter: blur(10px);
  animation: rise var(--t-slow) var(--ease) both 600ms;
}
.mural-note h3 { font-size: 16px; }
.mural-note p { margin-top: 6px; color: var(--ink-2); font-size: 14px; }

/* ---------- listings ---------- */
.listings { display: flex; flex-direction: column; gap: 16px; min-height: 100%; }
.listings > * { flex: none; }
.listings > .lx-list { flex: 1 0 auto; min-height: 320px; }
.lx-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg-deal button { height: 38px; padding: 0 18px; }
.search {
  flex: 1; min-width: 280px;
  display: flex; align-items: center;
  height: 46px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px;
  transition: border-color var(--t-fast), box-shadow var(--t) var(--ease);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.search .lead { margin-left: 16px; color: var(--ink-3); }
.search input { flex: 1; min-width: 60px; height: 100%; padding: 0 12px; background: none; border: 0; outline: none; font-size: 14.5px; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .6; }
.scope { display: flex; gap: 2px; padding: 4px; margin-right: 4px; }
.scope button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-3); font-size: 13px; font-weight: 650; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.scope button .icon { width: 15px; height: 15px; }
.scope button:hover { color: var(--ink); background: var(--panel-2); }
.scope button.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.filter-toggle { height: 46px; border-radius: 999px; }
.filter-toggle[aria-expanded='true'] { border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.filter-toggle .icon { transition: transform var(--t) var(--ease); }
.filter-toggle[aria-expanded='true'] .icon { transform: rotate(90deg); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--gold); color: #140f04; font-size: 11.5px; font-weight: 800; animation: pop 360ms var(--ease); }

.filters {
  display: grid; gap: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: filters-in 460ms var(--ease) both;
}
.filters.closing { animation: filters-out 220ms var(--ease-in) both; }
@keyframes filters-in { from { opacity: 0; transform: translateY(-8px); clip-path: inset(0 0 100% 0 round 14px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 14px); } }
@keyframes filters-out { to { opacity: 0; transform: translateY(-6px); clip-path: inset(0 0 100% 0 round 14px); } }
.filters-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; padding: 20px 22px; }
.filters-grid > * { animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms + 80ms); }
.f { display: grid; gap: 8px; min-width: 0; }
.f > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips button {
  min-width: 40px; height: 42px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--field); color: var(--ink-2); font-weight: 650; font-size: 14px; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease);
}
.chips button:hover { color: var(--ink); border-color: var(--ink-3); }
.chips button:active { transform: scale(.94); }
.chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.range-box {
  display: flex; align-items: center; height: 42px;
  background: var(--field); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color var(--t-fast), box-shadow var(--t) var(--ease);
}
.range-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.range-box input { flex: 1; min-width: 0; height: 100%; padding: 0 12px; background: none; border: 0; outline: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.range-box input::placeholder { color: var(--ink-3); }
.range-box i { width: 10px; height: 2px; border-radius: 1px; background: var(--line-2); flex: none; }
.filters-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; background: var(--panel-2); border-top: 1px solid var(--line); }
.filters-foot .hint { margin-right: auto; }
.filters-foot .btn { height: 42px; }

.lx-status { display: flex; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--line); }
.status-tabs { position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.status-tabs::-webkit-scrollbar { display: none; }
.status-tabs button {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px; border: 0; background: none;
  color: var(--ink-3); font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  transition: color var(--t-fast);
}
.status-tabs button:hover { color: var(--ink); }
.status-tabs button.on { color: var(--ink); }
.status-tabs .n {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px;
  border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 750; color: var(--ink-3); font-variant-numeric: tabular-nums;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.status-tabs button.on .n { background: var(--gold); border-color: var(--gold); color: #140f04; }
.status-tabs .bar { position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); transition: transform 460ms var(--ease); pointer-events: none; }
.status-tabs .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; margin-bottom: 5px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px; background: transparent;
  color: var(--ink-2); font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.fav-toggle:hover { color: var(--ink); background: var(--raised); }
.fav-toggle[aria-pressed='true'] { color: var(--gold-text); border-color: rgba(212, 172, 85,.5); background: rgba(212, 172, 85,.1); }
.fav-toggle[aria-pressed='true'] .icon { fill: currentColor; animation: pop 360ms var(--ease); }

.lx-dates { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.date-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.date-chips button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); font-weight: 650; font-size: 13px; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
.date-chips button .icon { width: 15px; height: 15px; }
.date-chips button:hover { color: var(--ink); border-color: var(--line-2); }
.date-chips button:active { transform: scale(.96); }
.date-chips button.on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.custom-range { display: flex; align-items: center; gap: 8px; animation: slide-in-left 360ms var(--ease) both; }
.custom-range input { height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--field); font-size: 13px; }
.custom-range input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.custom-range i { width: 10px; height: 2px; background: var(--line-2); }
.sources { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sources .src {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 4px 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  font-size: 12.5px; font-weight: 650; color: var(--ink-2); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.sources .src b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--panel-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.sources .src:hover { color: var(--ink); border-color: var(--line-2); }
.sources .src.on { border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sources .src i { width: 8px; height: 8px; border-radius: 2px; }
.src-myhome { background: var(--site-mh); }
.src-ss { background: var(--site-ss); }
.src-other { background: var(--ink-3); }

.lx-list { overflow: hidden; }
.lx-list .empty { min-height: 320px; }
.lr {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 18px 14px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast);
  animation: rise 520ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.lr:last-child { border-bottom: 0; }
.lr:hover { background: var(--panel-2); }
.lr:hover .thumb img { transform: scale(1.05); }
.thumb { position: relative; width: 132px; height: 96px; border-radius: var(--r); overflow: hidden; background: var(--raised); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 600ms var(--ease); }
.thumb canvas { width: 100%; height: 100%; display: block; }
.thumb .count { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; background: rgba(5, 5, 5,.75); color: #fff; font-size: 11.5px; font-weight: 700; }
.thumb .count .icon { width: 12px; height: 12px; }
.lr-main { min-width: 0; display: grid; gap: 6px; }
.lr-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.code { font-weight: 750; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); font-weight: 650; font-size: 12px; white-space: nowrap; }
.tag i { width: 7px; height: 7px; border-radius: 2px; }
.tag.st-added { color: var(--accent-text); }
.tag.st-uploaded { color: var(--teal-text); }
.tag.st-finished { color: var(--ink-3); }
.lr-title { font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-addr { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; min-width: 0; }
.lr-addr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-addr .icon { width: 14px; height: 14px; }
.specs { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; }
.specs span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.specs .icon { width: 15px; height: 15px; color: var(--ink-3); }
.lr-side { display: grid; justify-items: end; gap: 8px; text-align: right; }
.price { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price.none { font-size: 14px; font-weight: 650; color: var(--ink-3); }
.lr-side small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.star { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; transition: color var(--t-fast), background var(--t-fast); }
.star:hover { background: var(--raised); color: var(--ink); }
.star.on { color: var(--gold); }
.star.on .icon { fill: currentColor; animation: pop 360ms var(--ease); }
.lx-foot { display: flex; justify-content: space-between; padding: 12px 18px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--panel-2); }

/* ---------- add listing ---------- */
.new-listing { display: grid; align-content: center; justify-items: center; gap: 28px; min-height: 100%; padding: 12px 0 40px; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 650; font-size: 14px; text-decoration: none; padding: 6px 10px 6px 4px; border-radius: 8px; transition: color var(--t-fast), background var(--t-fast); }
.back:hover { color: var(--ink); background: var(--raised); }
.back .icon { transition: transform var(--t) var(--ease); }
.back:hover .icon { transform: translateX(-3px); }
.new-head { text-align: center; }
.new-head h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.03em; }
.new-head p { margin-top: 8px; color: var(--ink-2); font-size: 16px; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 20px; width: 100%; justify-content: center; }
.option {
  position: relative;
  display: grid; grid-template-rows: auto 1fr auto; gap: 0;
  padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 420ms var(--ease), border-color var(--t), box-shadow var(--t) var(--ease);
}
.option:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 16px 24px -12px rgba(0,0,0,.6); }
.option:active { transform: translateY(-2px) scale(.99); }
.option.nope { animation: shake 420ms var(--ease); }
.option-art { position: relative; height: 180px; background: #050505; display: grid; place-items: center; overflow: hidden; }
.option-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.option-art .icon {
  position: relative; width: 56px; height: 56px; padding: 14px;
  border-radius: 16px; background: rgba(14, 14, 15,.85); border: 1px solid #333336; color: var(--gold);
  stroke-width: 1.6; backdrop-filter: blur(6px);
  transition: transform 520ms var(--ease);
}
.option:hover .option-art .icon { transform: scale(1.1) rotate(-6deg); }
.option-text { display: grid; gap: 6px; padding: 22px 24px 8px; }
.option-text strong { font-size: 20px; letter-spacing: -0.02em; }
.option-text span { color: var(--ink-2); font-size: 14.5px; }
.option-go { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px 22px; color: var(--ink-3); }
.option-go em { font-style: normal; font-size: 12px; font-weight: 750; color: var(--gold-text); border: 1px solid rgba(212, 172, 85,.45); border-radius: 999px; padding: 2px 10px; }
.option-go .icon { transition: transform var(--t) var(--ease), color var(--t); }
.option:hover .option-go .icon { transform: translateX(4px); color: var(--gold-text); }

/* ---------- listing detail ---------- */
.detail { display: grid; gap: 22px; align-content: start; }
.detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: end; }
.detail-head .back { grid-column: 1 / -1; }
.detail-head h2 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.02em; margin-top: 8px; }
.detail-head .lr-addr { font-size: 14.5px; margin-top: 6px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 200px 200px; gap: 6px; border-radius: var(--r-lg); overflow: hidden; }
.gallery button { position: relative; padding: 0; border: 0; background: var(--raised); cursor: zoom-in; overflow: hidden; }
.gallery button:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 700ms var(--ease), filter var(--t); }
.gallery button:hover img { transform: scale(1.04); }
.gallery .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 5, 5,.6); color: #fff; font-weight: 750; font-size: 18px; backdrop-filter: blur(2px); }
.gallery.g1 { grid-template-columns: 1fr; grid-template-rows: 360px; }
.gallery.g2 { grid-template-columns: 2fr 1fr; grid-template-rows: 200px 200px; }
.gallery.g2 button:nth-child(2) { grid-row: span 2; }
.gallery.g3 { grid-template-columns: 2fr 1fr; }
.gallery-empty { display: grid; place-items: center; align-content: center; gap: 10px; height: 132px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--ink-3); }

.factbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.factbar div { display: grid; gap: 4px; padding: 16px 18px; border-right: 1px solid var(--line); animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.factbar div:last-child { border-right: 0; }
.factbar dt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 650; }
.factbar dt .icon { width: 15px; height: 15px; }
.factbar dd { margin: 0; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.detail-main { display: grid; gap: 20px; min-width: 0; }
.detail-side { display: grid; gap: 20px; position: sticky; top: 0; }
.desc { white-space: pre-wrap; color: var(--ink-2); line-height: 1.65; max-width: 72ch; }
.lang-tabs { margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 0; margin: 0; }
.kv dt, .kv dd { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv dt { color: var(--ink-3); padding-right: 16px; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.kv a { color: var(--accent-text); }
.feature-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.feature-chips span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.feature-chips span::before { content: ''; width: 6px; height: 6px; border-radius: 1.5px; background: var(--teal); }
.warn-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 4px; }
.warn-panel { border-color: rgba(212, 172, 85,.4); }
.warn-panel .panel-head h2 { display: flex; align-items: center; gap: 8px; color: var(--gold-text); }

.price-card { padding: 22px; display: grid; gap: 16px; }
.price-card .price { font-size: 30px; }
.price-card .alt { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.status-pick { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.status-pick button { justify-content: center; padding: 0 4px; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.upload-btn { width: 100%; }
/* each site's own brand colour: myhome.ge green, ss.ge blue */
.upload-btn[data-upload='myhome'] { background: var(--site-mh); border-color: var(--site-mh); color: #fff; }
.upload-btn[data-upload='myhome']:hover:not(:disabled) { background: #1e915a; border-color: #1e915a; color: #fff; }
.upload-btn[data-upload='ss'] { background: var(--site-ss); border-color: var(--site-ss); color: #fff; }
.upload-btn[data-upload='ss']:hover:not(:disabled) { background: #234dbf; border-color: #234dbf; color: #fff; }
.upload-btn[data-upload]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.upload-btn[data-upload]:disabled { opacity: .55; }
.upload-pair { display: grid; gap: 8px; }
.upload-note { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: flex-start; }
.upload-note .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.upload-note.live { color: var(--ink-2); padding: 12px 14px; border-radius: var(--r); background: rgba(43,179,156,.1); border: 1px solid rgba(43,179,156,.35); animation: rise 420ms var(--ease) both; }
.upload-note.live .icon { color: var(--teal-text); }
.upload-note .btn { margin-top: 8px; }
.client-form { display: grid; gap: 12px; }
.client-form .control input { height: 40px; font-size: 14px; }
.all-fields .control { max-width: 320px; margin-bottom: 12px; }
.all-fields .control input { height: 38px; font-size: 14px; }
.fields-table { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.fields-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fields-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.fields-table td:first-child { color: var(--ink-3); width: 40%; font-variant-numeric: tabular-nums; }
.fields-table tr:last-child td { border-bottom: 0; }
details.collapse > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary .icon { transition: transform var(--t) var(--ease); color: var(--ink-3); }
details.collapse[open] > summary .icon { transform: rotate(180deg); }
details.collapse[open] > .panel-body { animation: rise 420ms var(--ease) both; }

/* ---------- profile ---------- */
.photo-row { display: flex; align-items: center; gap: 20px; padding-bottom: 22px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.photo { position: relative; display: block; }
.photo .avatar { box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px var(--line-2); }
.photo.updated .avatar { animation: set-tile 700ms var(--ease) both; }
.photo-actions { display: grid; gap: 10px; }
.photo-actions strong { font-size: 14px; }
.photo-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- modals ---------- */
dialog { color: var(--ink); }
.modal { padding: 0; border: 0; background: transparent; max-width: calc(100vw - 32px); }
.modal::backdrop { background: var(--scrim); backdrop-filter: blur(6px); animation: fade 300ms ease both; }
.modal[open] .modal-card { animation: modal-in 460ms var(--ease) both; }
.modal.closing .modal-card { animation: modal-out 200ms var(--ease-in) both; }
.modal.closing::backdrop { animation: fade 200ms ease reverse both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-card { width: 440px; max-width: 100%; display: grid; gap: 16px; padding: 20px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-pop); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-size: 18px; }
.modal-head .icon-btn { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot .btn { height: 42px; }
.crop-stage {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden;
  background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--raised) 0 50%) 0 0 / 20px 20px;
  cursor: grab; touch-action: none; user-select: none;
}
.crop-stage.dragging { cursor: grabbing; }
.crop-stage canvas { width: 100%; height: 100%; display: block; }
.crop-ring {
  position: absolute; inset: 7%; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(5, 5, 5,.62), inset 0 0 0 2px rgba(255,255,255,.85);
  transition: box-shadow var(--t);
}
.crop-stage.dragging .crop-ring { box-shadow: 0 0 0 9999px rgba(5, 5, 5,.45), inset 0 0 0 2px var(--gold); }
.crop-hint { text-align: center; margin-top: -4px; }
.zoom { display: flex; align-items: center; gap: 12px; color: var(--ink-3); }
.zoom .icon { width: 16px; height: 16px; }
.zoom .icon.big { width: 22px; height: 22px; }
input[type='range'] { flex: 1; appearance: none; height: 6px; border-radius: 3px; background: var(--line-2); outline: none; cursor: pointer; }
input[type='range']::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: 3px solid var(--panel); box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform var(--t-fast) var(--ease); }
input[type='range']::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 3px solid var(--panel); }
input[type='range']:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.camera-stage { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: #050505; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #aeaba4; }
.camera-stage.flash::after { content: ''; position: absolute; inset: 0; background: #fff; animation: flash 400ms ease-out both; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }

.lightbox { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(4,6,10,.94); }
.lightbox[open] { display: grid; place-items: center; animation: fade 260ms ease both; }
.lightbox img { max-width: calc(100vw - 160px); max-height: calc(100vh - 100px); border-radius: var(--r); box-shadow: 0 16px 28px -8px rgba(0,0,0,.6); animation: modal-in 420ms var(--ease) both; }
.lightbox .icon-btn { position: absolute; width: 48px; height: 48px; margin: 0; color: #fff; background: rgba(255,255,255,.08); border-radius: 50%; }
.lightbox .icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; }
.lb-next { right: 20px; top: 50%; }
.lb-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: #aeaba4; font-size: 14px; }

/* toast */
.toasts { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 10px; z-index: 100; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 400px;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--raised); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  font-size: 14px; animation: toast-in 460ms var(--ease) both;
}
.toast .icon { color: var(--teal-text); }
.toast.err .icon { color: var(--terra-text); }
.toast.out { animation: toast-out 260ms var(--ease-in) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

body.exiting .shell, body.exiting .auth { animation: page-out 360ms var(--ease-in) both; }
@keyframes page-out { to { opacity: 0; transform: scale(.99); } }
html.theme-fade * { transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease !important; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1180px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .rail-brand { justify-content: center; padding: 0; }
  .rail-brand div, .nav-group, .nav a span, .rail-note { display: none; }
  .nav a + .nav-group { display: block; height: 0; padding: 0; margin: 8px 0; font-size: 0; }
  .nav { padding: 18px 10px; }
  .nav a { justify-content: center; padding: 0; }
  .nav-tessera { left: 4px; }
  .nav-badge { position: absolute; top: 9px; right: 11px; min-width: 9px; width: 9px; height: 9px; padding: 0; border-radius: 50%; font-size: 0; margin: 0; box-shadow: 0 0 0 2px var(--rail); }
  .nav a { position: relative; }
}
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .form-panel { position: static; }
  .profile-name { display: none; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; grid-row: 1; }
  .scope button span { display: none; }
  .scope button[data-v='all'] span, .scope button[data-v='all'] { display: none; }
}
@media (max-width: 900px) {
  .auth, .auth.is-admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: 34vh auto; }
  .auth.is-admin .auth-art { order: 0; }
  .auth.is-admin .auth-panel { order: 1; border-right: 0; }
  .auth.is-admin .auth-caption { text-align: left; }
  .auth.is-admin .wordmark { justify-content: flex-start; }
  .auth-panel { border-left: 0; border-top: 1px solid var(--line); justify-content: flex-start; }
  .auth-panel .top { position: static; margin-bottom: 32px; }
  .auth-caption p { display: none; }
  .wordmark { font-size: 48px; }
}
/* phones: the art shrinks to a slim band so the form, not a picture, sits above the keyboard */
@media (max-width: 760px) {
  .auth, .auth.is-admin { grid-template-rows: 72px auto; }
  .auth-caption { display: none; }
  .auth-panel { padding: 20px 20px 32px; }
  .auth-panel .top { margin-bottom: 24px; }
  .auth-form h1 { font-size: 28px; }
  .auth-form .lede { margin-bottom: 22px; }
  .auth-form .btn-block { margin-top: 20px; }
  .auth-glyph { width: 44px; height: 44px; margin-bottom: 16px; }
  .auth .control input { font-size: 16px; }

  .admin-band span { display: none; }
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .options { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 120px; }
  .gallery button:first-child { grid-column: span 2; grid-row: auto; }
  .gallery button:nth-child(n+4) { display: none; }
  .sources { margin-left: 0; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .shell { grid-template-columns: 58px minmax(0, 1fr); }
  .nav { padding: 14px 7px; }
  .nav-tessera { left: 2px; }
  .topbar { min-height: 64px; padding: 0 12px; gap: 10px; }
  .topbar .crumbs { display: none; }
  .topbar h1 { font-size: 18px; }
  .topbar-right { gap: 8px; }
  .btn-add { width: 42px; padding: 0; justify-content: center; }
  .btn-add .txt { display: none; }
  .profile-btn { padding: 0 6px 0 4px; height: 44px; }
  .menu { width: min(300px, calc(100vw - 80px)); }
  .content { padding: 14px; }
  .row { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 10px 14px; gap: 12px; }
  .row .when { display: none; }
  .list-tools, .panel-head, .panel-body, .panel-foot { padding-left: 16px; padding-right: 16px; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }
  .field-pair .field + .field { margin-top: 18px; }
  .hello { padding: 20px; gap: 16px; }
  .mural-note { left: 14px; right: 14px; bottom: 14px; }
  .toasts { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: none; }
  .search { min-width: 100%; order: 3; }
  .lx-head { justify-content: space-between; }
  .filter-toggle { width: 46px; padding: 0; gap: 0; }
  .filter-toggle > span { display: none; }
  .filter-toggle .badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .fav-toggle { width: 38px; padding: 0; justify-content: center; }
  .fav-toggle span { display: none; }
  .status-tabs button { padding: 0 10px; gap: 7px; }
  .lr-top .tag:nth-of-type(n+3) { display: none; }
  .filters-grid { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .filters-foot { flex-wrap: wrap; padding: 12px 16px; }
  .filters-foot .hint { width: 100%; }
  .lr { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .thumb { width: 92px; height: 80px; }
  .lr-side { grid-column: 2; justify-items: start; text-align: left; grid-template-columns: auto auto; align-items: center; justify-content: space-between; }
  .lr-side small { display: none; }
  .price { font-size: 16px; }
  .detail-head { grid-template-columns: minmax(0, 1fr); }
  .detail-actions { justify-content: flex-start; }
  .lightbox img { max-width: calc(100vw - 24px); }
  .lb-prev, .lb-next { top: auto !important; bottom: 14px; }
  .photo-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; animation-iteration-count: 1 !important; }
}


/* ---------- listing detail: data tiles, contact, map ---------- */
.dtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.dtile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center;
  padding: 14px 16px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line);
  animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms);
  transition: border-color var(--t-fast), transform var(--t) var(--ease);
}
.dtile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.dtile-ico { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.dtile-k { font-size: 12.5px; color: var(--ink-3); font-weight: 650; }
.dtile-v { font-size: 15.5px; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }

.contact { display: grid; gap: 16px; }
.phones { display: flex; flex-wrap: wrap; gap: 10px; }
.phone { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 4px; border-radius: 12px; background: rgba(43,179,156,.12); border: 1px solid rgba(43,179,156,.35); animation: rise 480ms var(--ease) both; }
.phone a { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 9px; text-decoration: none; color: var(--teal-text); font-size: 18px; font-weight: 800; letter-spacing: .01em; transition: background var(--t-fast); }
.phone a:hover { background: rgba(43,179,156,.14); }
.phone-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--teal); color: #04241e; }
.phone-ico .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.phone .icon-btn { margin: 0; color: var(--teal-text); }
.phone .icon-btn:hover { background: rgba(43,179,156,.18); color: var(--teal-text); }
.phone .icon-btn.ok { color: var(--teal-text); }
.phones-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.phones-extra .tag { color: var(--teal-text); text-decoration: none; }
.phones-extra .tag .icon { width: 13px; height: 13px; }
.poster { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.poster > div { display: grid; min-width: 0; flex: 1; }
.poster-k { font-size: 12px; color: var(--ink-3); font-weight: 650; }
.poster strong { font-size: 15px; }
.poster small { color: var(--ink-3); font-size: 12.5px; }

.location { display: grid; gap: 16px; }
.map { position: relative; height: 300px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); animation: rise 600ms var(--ease) both; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
:root[data-theme='dark'] .map iframe { filter: invert(.92) hue-rotate(180deg) saturate(.75) brightness(.95) contrast(.95); }
.map::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); border-radius: inherit; }
.loc-meta { display: grid; gap: 10px; }
.loc-addr { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.loc-addr .icon { color: var(--terra-text); margin-top: 2px; }
.loc-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--ink-3); }
.loc-crumbs span { padding: 2px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); }
.loc-crumbs .icon { width: 13px; height: 13px; }
.loc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loc-row .tag .icon { width: 13px; height: 13px; }

/* ---------- analytics ---------- */
.an { display: grid; gap: 18px; align-content: start; }
.an-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.an-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.an-grid > .chart-card { grid-column: span var(--span, 6); }
.hero-card { grid-column: span 4; position: relative; overflow: hidden; min-height: 250px; background: var(--art-bg); border-color: var(--art-line); color: var(--art-ink); }
.hero-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.hero-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(var(--art-veil),.96) 0%, rgba(var(--art-veil),.88) 45%, rgba(var(--art-veil),.35) 100%), linear-gradient(0deg, rgba(var(--art-veil),.9), transparent 60%); pointer-events: none; }
.hero-in { position: relative; z-index: 1; display: grid; align-content: end; gap: 4px; height: 100%; padding: 24px; }
.hero-k { font-size: 13.5px; font-weight: 700; color: var(--art-ink-2); }
.hero-v { font-size: clamp(56px, 6vw, 84px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.hero-sub { font-size: 13px; color: var(--art-ink-3); }
.hero-split { display: flex; gap: 16px; margin-top: 14px; font-size: 13px; color: var(--art-ink-2); }
.hero-split i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hero-split b { color: var(--art-ink); margin-left: 4px; }
.stat-grid { grid-column: span 8; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px; gap: 6px; justify-content: space-between; min-height: 117px; }
.stat-k { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.stat-k .icon { width: 16px; height: 16px; color: var(--ink-3); }
.stat-v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.delta .icon { width: 15px; height: 15px; }
.delta.up b, .delta.up .icon { color: var(--teal-text); }
.delta.down b, .delta.down .icon { color: var(--terra-text); }
.meter { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--c3) 20%, transparent); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--c3); transform-origin: left; transform: scaleX(var(--w)); animation: grow-x 900ms var(--ease) both 300ms; }
@keyframes grow-x { from { transform: scaleX(0); } }

.chart-card { padding: 0; min-width: 0; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.chart-head h2 { font-size: 15.5px; }
.chart-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 650; cursor: pointer; flex: none; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
.chip-btn .icon { width: 14px; height: 14px; }
.chip-btn:hover { color: var(--ink); background: var(--raised); }
.chip-btn[aria-pressed='true'] { color: var(--ink); border-color: var(--line-2); background: var(--raised); }
.chart-body { padding: 10px 20px 20px; min-width: 0; animation: fade 400ms ease both; }
.chart-table { padding: 6px 20px 20px; max-height: 320px; overflow: auto; animation: fade 300ms ease both; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.chart-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 650; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chart-table td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.chart-table .num { text-align: right; }
.chart-empty { display: grid; place-items: center; min-height: 160px; color: var(--ink-3); font-size: 14px; }

.line-chart svg { display: block; overflow: visible; }
.line-chart .grid { stroke: var(--line); stroke-width: 1; }
.line-chart .axis { fill: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.line-chart .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1200ms var(--ease) forwards 200ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.line-chart .area { opacity: .12; animation: area-in 900ms ease both 600ms; }
@keyframes area-in { from { opacity: 0; } to { opacity: .12; } }
.line-chart .end-dot { animation: set-tile 600ms var(--ease) both 1200ms; transform-box: fill-box; transform-origin: center; }
.line-chart .cross { stroke: var(--ink-3); stroke-width: 1; transition: opacity var(--t-fast); }
.line-chart .hover-dot { transition: opacity var(--t-fast); pointer-events: none; }
.line-chart .hit { cursor: crosshair; }
.line-chart.static .line, .line-chart.static .area, .line-chart.static .end-dot { animation: none; stroke-dashoffset: 0; }

.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 2px 0; cursor: default; animation: rise 500ms var(--ease) both; animation-delay: calc(var(--i) * 50ms); }
.hbar-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.hbar-track { height: 12px; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; transform-origin: left; transform: scaleX(var(--w)); animation: grow-x 900ms var(--ease) both; animation-delay: calc(var(--i) * 60ms + 150ms); transition: filter var(--t-fast); }
.hbar:hover .hbar-fill { filter: brightness(1.15); }
.hbar-value { font-size: 13.5px; font-weight: 750; min-width: 28px; text-align: right; }
.hbar-extra { font-size: 12.5px; color: var(--ink-3); min-width: 76px; text-align: right; }

.part { display: flex; gap: 2px; height: 14px; margin: 8px 0 20px; }
.part-seg { min-width: 6px; border-radius: 2px; transform-origin: left; animation: grow-x 900ms var(--ease) both; animation-delay: calc(var(--i) * 120ms + 150ms); transition: filter var(--t-fast); }
.part-seg:first-child { border-radius: 4px 2px 2px 4px; }
.part-seg:last-child { border-radius: 2px 4px 4px 2px; }
.part-seg:hover { filter: brightness(1.15); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legend li { display: grid; grid-template-columns: auto 1fr auto 48px; align-items: center; gap: 10px; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); animation: rise 500ms var(--ease) both; }
.legend li:last-child { border-bottom: 0; padding-bottom: 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend span { color: var(--ink-2); }
.legend b { font-weight: 750; }
.legend em { font-style: normal; color: var(--ink-3); text-align: right; font-size: 13px; }

.cols { position: relative; display: grid; grid-template-rows: 180px auto; padding-left: 30px; }
.cols-grid { position: absolute; left: 30px; right: 0; top: 0; height: 180px; }
.cols-grid span { position: absolute; left: 0; right: 0; bottom: calc(var(--f) * 100%); border-top: 1px solid var(--line); }
.cols-grid em { position: absolute; right: calc(100% + 8px); top: -8px; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.cols-bars { position: relative; display: flex; align-items: flex-end; justify-content: space-around; gap: 2px; height: 180px; }
.col { flex: 1; display: flex; justify-content: center; align-items: flex-end; height: 100%; cursor: default; }
.col-bar { width: min(24px, 80%); height: calc(var(--h) * 100%); border-radius: 4px 4px 0 0; background: var(--c1); transform-origin: bottom; animation: grow-y 900ms var(--ease) both; animation-delay: calc(var(--i) * 50ms + 150ms); transition: filter var(--t-fast); }
.col:hover .col-bar { filter: brightness(1.2); }
@keyframes grow-y { from { transform: scaleY(0); } }
.cols-x { display: flex; justify-content: space-around; padding-top: 8px; }
.cols-x span { flex: 1; text-align: center; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

.mosaic-grid { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.mosaic-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; flex: 1; min-width: 14px; }
.mosaic-grid .tile { aspect-ratio: 1; border-radius: 3px; animation: set-tile 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms); }
.mosaic-col .tile { animation-delay: inherit; }
.mosaic-col { animation-delay: calc(var(--i) * 30ms); }
.tile.l0 { background: var(--r0); }
.tile.l1 { background: var(--r1); }
.tile.l2 { background: var(--r2); }
.tile.l3 { background: var(--r3); }
.tile.l4 { background: var(--r4); }
.tile.future { background: transparent; border: 1px dashed transparent; }
.mosaic-grid .tile[data-d]:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.mosaic-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.mosaic-legend .tile { width: 12px; height: 12px; border-radius: 3px; }
.mosaic-legend span:first-child { margin-right: 4px; }
.mosaic-legend span:last-child { margin-left: 4px; }

.chart-tip {
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none;
  min-width: 140px; padding: 10px 12px; border-radius: var(--r);
  background: var(--raised); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  font-size: 13px; opacity: 0; transition: opacity 120ms ease;
}
.chart-tip.on { opacity: 1; }
.tip-h { font-weight: 750; margin-bottom: 6px; }
.tip-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; color: var(--ink-2); }
.tip-row i { width: 8px; height: 8px; border-radius: 2px; }
.tip-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tip-row:not(:has(i)) { grid-template-columns: 1fr auto; }

@media (max-width: 1280px) {
  .hero-card { grid-column: span 12; min-height: 200px; }
  .stat-grid { grid-column: span 12; }
}
@media (max-width: 1100px) {
  .an-grid > .chart-card { grid-column: span 12; }
}
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-filters .seg { width: 100%; }
  .an-filters .seg button { flex: 1; justify-content: center; padding: 0 6px; }
}
@media (max-width: 640px) {
  .hbar { grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) auto; }
  .hbar-extra { display: none; }
  .map { height: 220px; }
  .phone a { font-size: 16px; }
  .dtiles { grid-template-columns: 1fr 1fr; }
  .dtile { grid-template-columns: 1fr; padding: 12px; }
  .dtile-ico { grid-row: auto; width: 32px; height: 32px; margin-bottom: 6px; }
}

/* ---------- photo slider ---------- */
.slider { position: relative; overflow: hidden; border-radius: var(--r); background: var(--raised); touch-action: pan-y; user-select: none; isolation: isolate; }
.slider.empty canvas { width: 100%; height: 100%; display: block; }
.slider-track { display: flex; height: 100%; transition: transform 420ms var(--ease); will-change: transform; }
.slider-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.slider-btn {
  position: absolute; top: 50%; z-index: 2; display: grid; place-items: center;
  width: 30px; height: 30px; margin-top: -15px; border: 0; border-radius: 50%;
  background: rgba(5, 5, 5,.72); color: #fff; cursor: pointer; opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease), background var(--t-fast);
}
.slider-btn .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.slider-btn.prev { left: 6px; }
.slider-btn.next { right: 6px; }
.slider:hover .slider-btn, .slider:focus-within .slider-btn { opacity: 1; }
.slider-btn:hover { background: rgba(5, 5, 5,.9); transform: scale(1.08); }
.slider-btn:active { transform: scale(.92); }
.slider-dots { position: absolute; left: 0; right: 0; bottom: 7px; z-index: 2; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.slider-dots i { width: 5px; height: 5px; border-radius: 2px; background: rgba(255,255,255,.5); transition: transform var(--t) var(--ease), background var(--t); }
.slider-dots i.on { transform: scaleX(2.2); background: #fff; }
@media (hover: none) { .slider-btn { opacity: .9; } }
.lr .slider.thumb { width: 132px; height: 96px; }
.lr .slider.thumb .slider-btn { width: 24px; height: 24px; margin-top: -12px; }
.lr .slider.thumb .count { z-index: 3; }

/* ---------- radar ---------- */
.nav-badge { margin-left: auto; display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--gold); color: #140f04; font-size: 11.5px; font-weight: 800; animation: pop 400ms var(--ease); }
.radar { display: grid; gap: 16px; align-content: start; }
.rd-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rd-status { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rd-status strong { display: block; font-size: 15px; }
.rd-status small { display: block; font-size: 13px; color: var(--ink-3); }
.rd-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--teal); flex: none; position: relative; }
.rd-dot::after { content: ''; position: absolute; inset: -5px; border-radius: 6px; border: 2px solid var(--teal); opacity: 0; animation: rd-ping 2.4s var(--ease) infinite; }
.rd-dot.on { background: var(--gold); }
.rd-dot.on::after { border-color: var(--gold); animation-duration: 1s; }
@keyframes rd-ping { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.6); } }
.rd-actions { display: flex; gap: 10px; }
.rd-actions .btn { height: 46px; }
.rd-scan { padding: 0 20px 0 14px; }
.rd-scan.is-scanning .plus .icon { animation: spin 1s linear infinite; }
.rd-scan:disabled { opacity: .6; }
.rd-notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-lg); background: rgba(212, 172, 85,.1); border: 1px solid rgba(212, 172, 85,.35); animation: rise 500ms var(--ease) both; }
.rd-notice .icon { color: var(--gold-text); margin-top: 2px; }
.rd-notice strong { display: block; }
.rd-notice p { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.rd-filters .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rd-filters .f.wide { grid-column: span 2; }
.rd-filters .f small { font-size: 12px; }

.rd-main { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.rd-scope { position: sticky; top: 0; padding: 20px; gap: 14px; background: var(--art-bg); border-color: var(--art-line); color: var(--art-ink); }
.rd-scope .hint { color: var(--art-ink-3); }
.scope-wrap { position: relative; }
.scope-wrap canvas { width: 100%; display: block; }
.scope-tip {
  position: absolute; left: 0; top: 0; z-index: 3; display: flex; gap: 10px; align-items: center;
  width: 220px; padding: 8px; border-radius: var(--r); background: color-mix(in srgb, var(--panel) 96%, transparent); border: 1px solid var(--line-2);
  box-shadow: 0 12px 18px -8px rgba(0,0,0,.7); pointer-events: none; animation: fade 150ms ease both;
}
.scope-tip img { width: 64px; height: 52px; border-radius: 6px; object-fit: cover; flex: none; }
.scope-tip strong { display: block; font-size: 14px; }
.scope-tip span, .scope-tip small { display: block; font-size: 12px; color: var(--ink-2); }
.scope-tip small { color: var(--ink-3); }
.rd-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--art-ink-2); }
.rd-legend li { display: flex; align-items: center; gap: 7px; }
.rd-legend i { width: 9px; height: 9px; border-radius: 50%; }
.rd-ring { font-size: 12.5px; }
.rd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; border-top: 1px solid var(--art-line); }
.rd-stats span { display: grid; font-size: 12px; color: var(--art-ink-3); }
.rd-stats b { font-size: 22px; color: var(--art-ink); font-weight: 800; letter-spacing: -0.02em; }

.rd-feed { display: grid; gap: 12px; min-width: 0; }
.rd-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rd-list { display: grid; gap: 12px; }
.rd-list .empty { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 360px; }
.rd-card {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
  transition: border-color var(--t-fast), transform var(--t) var(--ease);
}
.rd-card:hover { border-color: var(--line-2); }
.rd-card.is-new { border-color: rgba(212, 172, 85,.45); }
.rd-card.is-imported { border-color: rgba(43,179,156,.4); }
.rd-card.flash { animation: rd-flash 1.2s var(--ease); }
@keyframes rd-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: var(--shadow); } }
.rd-card.removing { animation: row-out 380ms var(--ease-in) both; }
.rd-card .slider { height: 156px; }
.rd-body { display: grid; gap: 7px; min-width: 0; align-content: start; }
.tag-new { background: var(--gold); border-color: var(--gold); color: #140f04; }
.rd-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.rd-foot small { color: var(--ink-3); font-size: 12px; }
.rd-btns { display: flex; align-items: center; gap: 2px; }
.rd-btns .icon-btn { margin: 0; }
.rd-btns .btn { margin-left: 6px; }
.rd-btns .btn .label-text .icon { width: 15px; height: 15px; }
.rd-done { color: var(--teal-text); border-color: rgba(43,179,156,.45); text-decoration: none; }

/* shared radar: sources, sellers, detector */
.src-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: none; }
.src-dot.mh { background: var(--site-mh); }
.src-dot.ss { background: var(--site-ss); }
.rd-src button { display: inline-flex; align-items: center; gap: 7px; }
.rd-actions { align-items: center; flex-wrap: wrap; }
.rd-status small { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.src-line { display: inline-flex; align-items: center; gap: 7px; }
.rd-dot.off { background: var(--ink-3); }
.rd-dot.off::after { display: none; }
.src-tag { color: var(--ink); }
.rd-seller { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.rd-seller > .icon { width: 15px; height: 15px; color: var(--ink-3); }
.rd-seller > span:not(.tag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.tag.seller-owner { color: var(--teal-text); }
.tag.seller-agent, .tag.seller-developer { color: var(--ink-2); }
.rd-flag { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  background: rgba(224, 98, 63, .1); border: 1px solid rgba(224, 98, 63, .4); animation: rise 420ms var(--ease) both; }
.rd-flag .icon { width: 16px; height: 16px; color: var(--terra-text); flex: none; margin-top: 1px; }
.rd-flag b { display: block; color: var(--terra-text); font-size: 13px; }
.rd-flag span { color: var(--ink-2); }
.rd-flag.maybe, .rd-flag.copy { background: rgba(212, 172, 85, .1); border-color: rgba(212, 172, 85, .4); }
.rd-flag.maybe .icon, .rd-flag.copy .icon, .rd-flag.maybe b, .rd-flag.copy b { color: var(--gold-text); }
.rd-flag a { color: var(--ink); font-weight: 650; }
.rd-card.is-flagged { border-color: rgba(224, 98, 63, .35); }
.rd-btns { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.rd-btns .btn { margin-left: 0; height: 42px; }
.rd-btns .rd-open { flex: 1; justify-content: center; font-weight: 750; text-decoration: none; }
.rd-btns .rd-open .icon { width: 16px; height: 16px; }
.rd-btns .icon-btn { width: 42px; height: 42px; flex: none; }

@media (max-width: 1180px) {
  .rd-main { grid-template-columns: minmax(0, 1fr); }
  .rd-scope { position: static; max-width: 560px; justify-self: center; width: 100%; }
}
@media (max-width: 640px) {
  .rd-card { grid-template-columns: minmax(0, 1fr); }
  .rd-card .slider { height: 190px; }
  .rd-filters .filters-grid { grid-template-columns: minmax(0, 1fr); }
  .rd-filters .f.wide { grid-column: auto; }
  .rd-actions { width: 100%; }
  .rd-actions .btn { flex: 1; }
  .rd-actions .btn-add { width: auto; padding: 0 16px 0 12px; }
  .rd-actions .btn-add .txt { display: inline; }
  .rd-foot { flex-direction: column; align-items: stretch; }
  .rd-btns { justify-content: flex-end; }
  .rd-scope { padding: 14px; }
  .lr .slider.thumb { width: 92px; height: 80px; }
}

/* =====================================================================
   public homepage: the dashboard, set in black and brass tiles
   ===================================================================== */
body[data-area='home'] { background: var(--ground); }
.hp { position: relative; }
.hp-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: 68px; padding: 0 clamp(16px, 4vw, 48px);
  color: #ece8df;
  transition: background var(--t) ease, border-color var(--t) ease, backdrop-filter var(--t);
  border-bottom: 1px solid transparent;
  animation: drop-in var(--t-slow) var(--ease) both 200ms;
}
.hp-nav.solid { background: rgba(7, 7, 7,.82); border-bottom-color: #252527; backdrop-filter: blur(12px); }
:root[data-theme='light'] .hp-nav.solid { background: rgba(255,255,255,.86); border-bottom-color: var(--line); color: var(--ink); }
.hp-nav .brand-mini { font-size: 16px; color: inherit; }
.hp-nav nav { display: flex; gap: 4px; }
.hp-nav nav a { padding: 8px 14px; border-radius: 999px; color: inherit; opacity: .78; text-decoration: none; font-weight: 650; font-size: 14px; transition: opacity var(--t-fast), background var(--t-fast); }
.hp-nav nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.hp-nav .seg { background: rgba(14, 14, 15,.6); border-color: #333336; }
.hp-nav .seg button { color: #aeaba4; }
.hp-nav .seg button.on { color: #fff; }
.hp-nav .seg .seg-pill { background: #2a2a2d; }

.hp-hero { position: relative; height: 210vh; background: #050505; }
.hp-tiles { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
/* a dark veil over the dashboard where the copy sits, so the words stay readable */
.hp-stage::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background:
  radial-gradient(58% 40% at 50% 33%, rgba(5, 5, 5,.93), rgba(5, 5, 5,.8) 50%, rgba(5, 5, 5,0) 85%),
  linear-gradient(180deg, rgba(5, 5, 5,.75) 0, rgba(5, 5, 5,0) 22%, rgba(5, 5, 5,0) 78%, rgba(5, 5, 5,.85) 100%); }
.hp-stage { background:
  radial-gradient(55% 45% at 50% 68%, rgba(212, 172, 85, .22), transparent 70%),
  radial-gradient(40% 30% at 50% 100%, rgba(212, 172, 85, .10), transparent 70%),
  #050505; }
.hp-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.hp-copy { position: absolute; left: 0; right: 0; top: clamp(120px, 20vh, 210px); z-index: 3; padding: 0 20px; text-align: center; color: #ece8df; will-change: transform, opacity; pointer-events: none; }
.hp-copy h1 { font-size: clamp(44px, 6.6vw, 104px); text-shadow: 0 4px 30px rgba(5, 5, 5,.8); line-height: .98; letter-spacing: -0.04em; font-weight: 800; max-width: 14ch; margin: 0 auto; animation: rise 900ms var(--ease) both 150ms; }
html:lang(ka) .hp-copy h1 { font-size: clamp(34px, 5vw, 76px); letter-spacing: 0; line-height: 1.08; max-width: 18ch; }
.hp-copy p { max-width: 58ch; margin: 22px auto 0; font-size: clamp(15px, 1.35vw, 19px); color: #d9dbe2; text-shadow: 0 2px 16px rgba(5, 5, 5,.9); animation: rise 900ms var(--ease) both 320ms; }
.hp-cue { position: absolute; left: 50%; bottom: 22px; z-index: 4; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(14, 14, 15,.72); border: 1px solid #333336; color: #ece8df; font-weight: 650; font-size: 14px; text-decoration: none; backdrop-filter: blur(8px); animation: rise 900ms var(--ease) backwards 900ms; }
.hp-cue .icon { animation: bob 1.8s var(--ease) infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }
.hp-note { position: absolute; right: 20px; bottom: 16px; z-index: 4; font-size: 12px; color: #aeaba4; animation: fade 700ms ease 2.6s backwards; }

.hp-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px; padding: 34px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.hp-facts span { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.hp-facts .mark { width: 18px; height: 11px; gap: 1px; }

.reveal { opacity: 0; transform: translateY(26px); filter: blur(6px); transition: opacity 800ms var(--ease), transform 900ms var(--ease), filter 800ms var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }

.hp-row, .hp-radar, .hp-wide, .hp-team, .hp-how { padding: clamp(56px, 8vw, 104px) clamp(20px, 6vw, 96px); max-width: 1440px; margin: 0 auto; }
.hp-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.hp-row.flip .hp-text { order: 2; }
.hp-text h2, .hp-team h2, .hp-how h2 { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.05; letter-spacing: -0.035em; max-width: 16ch; }
html:lang(ka) .hp-text h2, html:lang(ka) .hp-team h2, html:lang(ka) .hp-how h2 { letter-spacing: 0; line-height: 1.18; font-size: clamp(26px, 3vw, 42px); }
.hp-text p { margin-top: 18px; font-size: 17px; color: var(--ink-2); max-width: 52ch; line-height: 1.65; }
.hp-demo { display: grid; place-items: center; }

/* import popup mock */
.mock-pop { width: min(380px, 100%); border-radius: 18px; overflow: hidden; background: #070707; border: 1px solid #252527; box-shadow: 0 30px 50px -24px rgba(0,0,0,.6); color: #ece8df; }
.mock-band { position: relative; height: 70px; background: #050505; }
.mock-band canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.mock-band::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 5, 5,.1), rgba(7, 7, 7,.85)); }
.mock-band .brand-mini { position: absolute; left: 16px; bottom: 14px; z-index: 1; color: #fff; }
.mock-body { display: grid; gap: 14px; padding: 16px; }
.mock-site { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: #0e0e0f; border: 1px solid #252527; }
.mock-site i { width: 12px; height: 12px; border-radius: 3px; background: var(--terra); }
.mock-site strong { display: block; font-size: 14px; }
.mock-site small { color: #7d7a74; font-size: 12.5px; }
.mock-gold { display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border: 0; border-radius: 10px; background: var(--gold); color: #140f04; font-weight: 800; font-size: 15px; transition: transform 160ms var(--ease), background 160ms; }
.mock-pop.pressed .mock-gold { transform: scale(.97); background: var(--gold-hi); }
.mock-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mock-steps li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #7d7a74; transition: color 300ms; }
.mock-steps b { position: relative; width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid #333336; flex: none; transition: background 300ms, border-color 300ms; }
.mock-steps li.run { color: #ece8df; }
.mock-steps li.run b { border-color: var(--gold); }
.mock-steps li.run b::after { content: ''; position: absolute; inset: 3px; border-radius: 2px; background: var(--gold); animation: pulse 900ms ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.mock-steps li.ok { color: #aeaba4; }
.mock-steps li.ok b { background: var(--teal); border-color: var(--teal); animation: set-tile 500ms var(--ease) both; }
.mock-done { display: none; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(43,179,156,.12); border: 1px solid rgba(43,179,156,.35); animation: rise 500ms var(--ease) both; }
.mock-pop.done .mock-done { display: flex; }
.mock-done .seal { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--teal); color: #04241e; }
.mock-done .code { margin-left: auto; padding: 3px 10px; border-radius: 7px; background: #141415; border: 1px solid #333336; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* myhome fill panel mock */
.mock-fill { width: min(400px, 100%); min-height: 430px; border-radius: 16px; background: #0e0e0f; border: 1px solid #333336; box-shadow: 0 30px 50px -24px rgba(0,0,0,.6); color: #ece8df; overflow: hidden; }
.mock-fill-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #252527; font-size: 14px; }
.mock-fill-h .mark { width: 20px; height: 12px; gap: 1px; }
.mock-fill ul { list-style: none; margin: 0; padding: 8px 16px; }
.mock-fill li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #1b1b1d; font-size: 13.5px; color: #aeaba4; animation: slide-in-left 380ms var(--ease) both; }
.mock-fill li b { color: #ece8df; font-weight: 650; }
.mock-fill li i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--teal); color: #04241e; flex: none; animation: set-tile 420ms var(--ease) both; }
.mock-fill li i .icon { width: 12px; height: 12px; stroke-width: 3; }
.mock-fill-end { margin: 6px 16px 16px; padding: 12px; border-radius: 10px; background: rgba(212, 172, 85,.1); border: 1px solid rgba(212, 172, 85,.4); color: #efe2c2; font-size: 13px; opacity: 0; transform: translateY(8px); transition: opacity 400ms var(--ease), transform 500ms var(--ease); }
.mock-fill.done .mock-fill-end { opacity: 1; transform: none; }

/* radar */
.hp-radar { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 6vw, 96px); align-items: center; max-width: none; background: #050505; color: #ece8df; }
.hp-radar .hp-text p { color: #aeaba4; }
.hp-radar-scope { max-width: 620px; width: 100%; justify-self: end; }
.hp-radar-scope canvas { width: 100%; display: block; }
.hp-points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; }
.hp-points li { display: flex; gap: 12px; align-items: flex-start; color: #aeaba4; font-size: 15.5px; }
.hp-points .icon { color: var(--gold); margin-top: 3px; }

/* listings screenshot */
.hp-wide { display: grid; gap: 40px; justify-items: center; text-align: center; }
.hp-wide .hp-text h2, .hp-wide .hp-text p { margin-left: auto; margin-right: auto; }
.hp-shot { margin: 0; width: 100%; max-width: 1200px; }
.hp-shot img { width: 100%; height: auto; display: block; border-radius: 16px; border: 1px solid var(--line-2); box-shadow: 0 40px 60px -30px rgba(0,0,0,.65); }
.hp-shot figcaption { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

/* analytics */
.hp-stats { display: flex; gap: 32px; margin: 30px 0 10px; }
.hp-stats div { display: grid; gap: 2px; }
.hp-stats dt { order: 2; font-size: 13px; color: var(--ink-3); }
.hp-stats dd { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.hp-mosaic { width: 100%; max-width: 620px; padding: 0; }

/* team */
.hp-team { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; border-top: 1px solid var(--line); }
.hp-team ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.hp-team li { display: grid; gap: 14px; padding: 26px 24px 26px 0; border-bottom: 1px solid var(--line); font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.hp-team li:nth-child(odd) { padding-right: 32px; border-right: 1px solid var(--line); }
.hp-team li:nth-child(even) { padding-left: 32px; }
.hp-team li .icon { width: 26px; height: 26px; color: var(--accent-text); stroke-width: 1.6; }

/* how it works */
.hp-how { border-top: 1px solid var(--line); }
.hp-how ol { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; position: relative; }
.hp-how ol::before { content: ''; position: absolute; top: 28px; left: 28px; right: 16%; height: 2px; background: linear-gradient(90deg, var(--gold), var(--cobalt) 60%, transparent); opacity: .5; }
.hp-how li { position: relative; display: grid; gap: 10px; }
.hp-step-mark { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); }
.hp-step-mark .mark { width: 26px; height: 15px; }
.hp-step-mark b { position: absolute; right: -8px; top: -8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--gold); color: #140f04; font-size: 12px; font-weight: 800; }
.hp-how strong { font-size: 20px; margin-top: 8px; }
.hp-how li p { color: var(--ink-2); font-size: 15.5px; }

/* close */
.hp-close { position: relative; min-height: 64vh; display: grid; place-items: center; overflow: hidden; background: #050505; color: #ece8df; text-align: center; }
.hp-close canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hp-close::after { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 50%, rgba(5, 5, 5,.92), rgba(5, 5, 5,.45) 70%, rgba(5, 5, 5,.15)); pointer-events: none; }
.hp-close-in { position: relative; z-index: 1; display: grid; justify-items: center; gap: 16px; padding: 40px 20px; }
.hp-close .wordmark { font-size: clamp(48px, 7vw, 104px); }
.hp-close p { color: #aeaba4; font-size: 17px; }
.hp-close small { color: #7d7a74; font-size: 13px; }

@media (max-width: 960px) {
  .hp-nav nav { display: none; }
  .hp-row, .hp-radar, .hp-team { grid-template-columns: minmax(0, 1fr); }
  .hp-row.flip .hp-text { order: 0; }
  .hp-radar-scope { justify-self: center; }
  .hp-how ol { grid-template-columns: minmax(0, 1fr); }
  .hp-how ol::before { top: 28px; bottom: 28px; left: 27px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--gold), var(--cobalt) 60%, transparent); }
  .hp-how li { grid-template-columns: 56px 1fr; column-gap: 20px; }
  .hp-how li strong, .hp-how li p { grid-column: 2; }
  .hp-how li .hp-step-mark { grid-row: span 2; }
  .hp-how strong { margin-top: 2px; }
}
@media (max-width: 640px) {
  .hp-hero { height: 190vh; }
  .hp-copy p { font-size: 15px; }
  .hp-team ul { grid-template-columns: minmax(0, 1fr); }
  .hp-team li, .hp-team li:nth-child(odd), .hp-team li:nth-child(even) { padding: 20px 0; border-right: 0; }
  .hp-stats { gap: 22px; }
  .hp-stats dd { font-size: 26px; }
  .hp-facts { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-hero { height: 100vh; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
@media (max-width: 700px) {
  .hp-stage::after { background:
    radial-gradient(95% 34% at 50% 30%, rgba(5, 5, 5,.94), rgba(5, 5, 5,.82) 55%, rgba(5, 5, 5,0) 92%),
    linear-gradient(180deg, rgba(5, 5, 5,.8) 0, rgba(5, 5, 5,0) 18%, rgba(5, 5, 5,0) 80%, rgba(5, 5, 5,.9) 100%); }
}

/* =====================================================================
   admin: the control room. Dense tables, tabular numbers, oxblood for action.
   ===================================================================== */
.adm { display: grid; gap: 20px; align-content: start; }
.ad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.ad-span2 { grid-column: span 2; }
.ad-scroll { overflow-x: auto; }
.ad-none { padding: 22px; color: var(--ink-3); font-size: 14px; list-style: none; }
.muted { color: var(--ink-3); }
.ad-hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.ad-hint .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.ad-hint:first-child { margin-top: 0; }
.panel > .ad-hint { padding: 0 22px 18px; margin: 0; }
.ad-foot { display: flex; justify-content: flex-end; }

/* status dots */
.ad-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--ink-3); vertical-align: 1px; }
.ad-dot.on { background: var(--teal); box-shadow: 0 0 0 3px rgba(43, 179, 156, .16); }
.ad-dot.warn { background: var(--gold); box-shadow: 0 0 0 3px rgba(212, 172, 85, .16); }
.ad-dot.bad { background: var(--terra); box-shadow: 0 0 0 3px rgba(224, 98, 63, .18); }
.ad-dot.idle { background: var(--line-2); }

/* health strip: one line per check, each a door to the page that fixes it */
.ad-health ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ad-health li { animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); min-width: 0; }
.ad-health li + li a { border-left: 1px solid var(--line); }
.ad-health a {
  display: flex; align-items: center; gap: 10px; height: 100%; min-height: 64px; padding: 14px 18px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; line-height: 1.35;
  transition: background var(--t-fast), color var(--t-fast);
}
.ad-health a:hover { background: var(--panel-2); color: var(--ink); }
.ad-health a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ad-health a span:not(.ad-dot) { flex: 1; min-width: 0; }
.ad-health a > .icon { width: 15px; height: 15px; color: var(--ink-3); opacity: 0; transform: translateX(-4px); transition: opacity var(--t-fast), transform var(--t) var(--ease); }
.ad-health a:hover > .icon { opacity: 1; transform: none; }
.ad-health li:first-child a { border-radius: var(--r-lg) 0 0 var(--r-lg); }
.ad-health li:last-child a { border-radius: 0 var(--r-lg) var(--r-lg) 0; }

/* tables */
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th, .ad-table td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-table thead th { font-size: 12px; font-weight: 650; color: var(--ink-3); background: var(--panel); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.ad-table tbody tr { transition: background var(--t-fast); }
.ad-table tbody tr:hover { background: var(--panel-2); }
.ad-table tbody tr:last-child td, .ad-table tbody tr:last-child th { border-bottom: 0; }
.ad-table th:first-child, .ad-table td:first-child { padding-left: 22px; }
.ad-table th:last-child, .ad-table td:last-child { padding-right: 22px; }
.ad-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ad-table td.muted { white-space: nowrap; font-size: 13px; }
.ad-ledger tbody th { font-weight: 600; color: var(--ink-2); }
.ad-ledger td.num { font-size: 15px; font-weight: 700; color: var(--ink); }
.ad-who { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.ad-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tags in the admin */
.tag-bad { color: var(--terra-text); border-color: rgba(224, 98, 63, .4); background: rgba(224, 98, 63, .1); }
.tag-warn { color: var(--gold-text); border-color: rgba(212, 172, 85, .4); background: rgba(212, 172, 85, .08); }
.tag-ok { color: var(--teal-text); border-color: rgba(43, 179, 156, .35); background: rgba(43, 179, 156, .08); }
.tag.role-owner { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag.role-manager { color: var(--gold-text); }

/* switch */
.ad-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); user-select: none; }
.ad-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ad-switch i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); flex: none; transition: background var(--t) var(--ease); }
.ad-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform var(--t) var(--ease); }
.ad-switch input:checked + i { background: var(--accent); }
.ad-switch input:checked + i::after { transform: translateX(16px); background: #fff; }
.ad-switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px; }
.ad-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0 14px; font-size: 14px; }
.ad-line small { color: var(--ink-3); font-size: 12.5px; flex-basis: 100%; margin-top: -6px; padding-left: 48px; }
.ad-line .label { min-width: 90px; }

/* activity */
.ev-list { list-style: none; margin: 0; padding: 4px 0; }
.ev {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: baseline; gap: 12px;
  padding: 10px 22px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2);
  animation: rise 460ms var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms);
}
.ev:last-child { border-bottom: 0; }
.ev b { color: var(--ink); font-weight: 650; }
.ev-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--line-2); transform: translateY(-1px); }
.ev-k-auth .ev-dot { background: var(--c2); }
.ev-dot { align-self: center; }
.ev-k-list .ev-dot { background: var(--c1); }
.ev-k-sys .ev-dot { background: var(--c-muted); }
.ev-k-warn .ev-dot { background: var(--gold); }
.ev-k-bad .ev-dot { background: var(--terra); }
.ev-k-bad .ev-text { color: var(--terra-text); }
.ev-meta { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.ev-time { display: none; }
.ev-day .ev { grid-template-columns: 10px 52px minmax(0, 1fr) auto; }
.ev-day .ev-time { display: block; order: -1; grid-column: 2; grid-row: 1; font-size: 13px; color: var(--ink-3); }
.ev-day .ev-dot { grid-column: 1; grid-row: 1; }
.ev-day .ev-text { grid-column: 3; grid-row: 1; }
.ev-day .ev-meta { grid-column: 4; grid-row: 1; }
.ev-day h3 { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 22px 8px; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); background: var(--panel-2); position: sticky; top: 0; z-index: 1; }
.ev-day:first-child h3 { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ev-day h3 span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.ev-compact .ev { padding: 8px 0; font-size: 13px; }

/* users */
.ad-rows .row { grid-template-columns: 42px minmax(0, 1fr) auto auto auto; }
.ad-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row.is-off .who-cell, .row.is-off .avatar { opacity: .55; }
.row .when { display: inline-flex; align-items: center; gap: 7px; }
.panel-head .seg { flex: none; }
.ad-editor {
  list-style: none; padding: 4px 22px 22px; border-bottom: 1px solid var(--line);
  background: var(--panel-2); animation: editor-in 420ms var(--ease) both;
}
@keyframes editor-in { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.ad-ed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.ad-ed-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.ad-ed-col > .field-pair, .ad-ed-col > .field + .field { margin-top: 0; }
.ad-ed-col h3 { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.ad-ed-col select { width: 100%; }
.ad-ed-col .facts div { padding: 9px 0; font-size: 13.5px; }
.ad-ed-col .facts dt { font-size: 13px; }
.ad-ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-ed-col .ad-line small { padding-left: 0; }
.ad-ed-col .error-text { margin: -6px 0 0; }

/* teams */
.ad-teams { display: grid; }
.ad-team-new { display: flex; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.ad-team-new .control { flex: 1; max-width: 360px; }
.ad-team-new .control input { height: 38px; }
.ad-team-row { grid-template-columns: 42px minmax(0, 1fr) auto auto; }
.ad-team-tile { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, var(--panel-2)); color: var(--accent-text); font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.ad-inline { max-width: 280px; border-color: transparent; background: transparent; }
.ad-inline:hover { border-color: var(--line-2); }
.ad-inline input { height: 34px; font-weight: 650; padding-left: 8px; }
.ad-mgr { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.ad-mgr select { min-width: 180px; height: 36px; }

/* toolbars */
.ad-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ad-toolbar .search { min-width: 260px; height: 42px; }
.ad-toolbar select { height: 42px; min-width: 170px; }
.ad-bulk {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px 10px 18px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-pop); animation: rise 320ms var(--ease) both;
}
.ad-bulk strong { margin-right: auto; font-size: 14px; }
.ad-bulk select { height: 34px; min-width: 150px; font-size: 13.5px; }

/* the listings table */
.ad-list .ck { width: 44px; }
.ad-list input[type=checkbox], .ad-table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ad-list tr.on { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ad-lst { display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 460px; }
.ad-lst img, .ad-noimg { width: 52px; height: 40px; border-radius: 7px; object-fit: cover; flex: none; background: var(--raised); }
.ad-lst div { min-width: 0; }
.ad-lst b { font-variant-numeric: tabular-nums; }
.ad-lst .muted { font-size: 12.5px; margin-left: 4px; }
.ad-lst small { display: block; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line); }

/* radar sources */
.ad-srcs { display: grid; }
.ad-src { display: grid; grid-template-columns: 130px minmax(0, 1fr) 90px auto auto; align-items: center; gap: 18px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.ad-src:last-child { border-bottom: 0; }
.ad-src-name { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.ad-src-state { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; font-size: 14px; color: var(--ink-2); min-width: 0; }
.ad-src-state small { grid-column: 2; font-size: 12.5px; color: var(--ink-3); }
.ad-src-count { text-align: right; font-weight: 750; font-size: 16px; display: grid; }
.ad-src-count small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.ad-rules { display: grid; gap: 4px; }
.ad-num { display: grid; grid-template-columns: minmax(0, 1fr) 88px 90px; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.ad-num .control input { height: 38px; text-align: right; font-variant-numeric: tabular-nums; padding-right: 12px; }
.ad-num small { color: var(--ink-3); font-size: 13px; }
.ad-danger { border-color: rgba(224, 98, 63, .3); }
.ad-danger .panel-head h2 { color: var(--terra-text); }

/* agency */
.ad-logo { display: flex; align-items: center; gap: 16px; }
.ad-logo > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-logo small { flex-basis: 100%; color: var(--ink-3); font-size: 12.5px; }
.ad-logo-box { display: grid; place-items: center; width: 84px; height: 84px; flex: none; border-radius: 14px; border: 1px dashed var(--line-2); background: var(--panel-2); overflow: hidden; font-size: 12px; text-align: center; padding: 6px; }
.ad-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ad-prefix { padding: 0 10px 0 14px; color: var(--ink-2); font-weight: 700; font-size: 14px; border-right: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.ad-prefix + input { padding-left: 10px; }

/* security */
.ad-pw { position: static; grid-row: span 2; }
.ad-pw > .panel { height: 100%; }
.ad-pin-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.ad-pin-form .control { flex: 1; min-width: 160px; max-width: 220px; }
.ad-pin-form input { height: 38px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.ad-guards { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ad-guards li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.ad-guards .icon { width: 15px; height: 15px; color: var(--accent-text); }
[data-sessions] .panel-body { display: grid; gap: 12px; justify-items: start; }
[data-sessions] .facts { width: 100%; }

/* extension */
.ad-steps { margin: 0; padding: 18px 22px 22px 44px; display: grid; gap: 10px; color: var(--ink-2); font-size: 14px; }
.ad-steps li::marker { color: var(--accent-text); font-weight: 800; }
.ad-restore-ask { margin-top: 14px; }
.ad-restore-ask p { margin-bottom: 10px; }

/* the PIN prompt: protected focus, so a real dialog */
.pin-dialog {
  width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--panel); color: var(--ink); box-shadow: 0 30px 50px -20px rgba(0,0,0,.75), 0 2px 8px rgba(0,0,0,.4);
  animation: pin-in 360ms var(--ease) both;
}
.pin-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); animation: fade-in 240ms ease both; }
@keyframes pin-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
.pin-dialog form { display: grid; justify-items: center; gap: 10px; padding: 28px 26px 22px; text-align: center; }
.pin-seal { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); color: var(--accent-text); }
.pin-dialog h2 { font-size: 18px; }
.pin-dialog p { color: var(--ink-3); font-size: 13.5px; max-width: 32ch; }
.pin-boxes { display: flex; gap: 8px; margin: 10px 0 2px; }
.pin-boxes input {
  width: 44px; height: 54px; text-align: center; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); color: var(--ink); caret-color: var(--accent);
  transition: border-color var(--t-fast), box-shadow var(--t) var(--ease);
}
.pin-boxes input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.pin-err { color: var(--terra-text) !important; min-height: 18px; }
.pin-actions { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.pin-actions .btn { flex: 1; }

@media (max-width: 1180px) {
  .ad-health ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ad-health li:nth-child(4) a { border-left: 0; }
  .ad-health li:nth-child(n+4) a { border-top: 1px solid var(--line); }
  .ad-health a { border-radius: 0 !important; }
  .ad-ed-grid { grid-template-columns: 1fr 1fr; }
  .ad-ed-facts { grid-column: span 2; }
  .ad-src { grid-template-columns: 110px minmax(0, 1fr) auto auto; }
  .ad-src-count { display: none; }
}
@media (max-width: 900px) {
  .ad-grid { grid-template-columns: minmax(0, 1fr); }
  .ad-span2 { grid-column: auto; }
  .ad-pw { grid-row: auto; }
  .ad-rows .row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .ad-rows .ad-tags { grid-column: 2; justify-content: flex-start; }
  .ad-rows .when { display: none; }
  .ad-rows .row-actions { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 640px) {
  .ad-health ul { grid-template-columns: minmax(0, 1fr); }
  .ad-health li + li a { border-left: 0; border-top: 1px solid var(--line); }
  .ad-ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ad-ed-facts { grid-column: auto; }
  .ad-src { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; }
  .ad-src-state { grid-column: 1 / -1; grid-row: 2; }
  .ad-src .btn { grid-column: 1 / -1; }
  .ad-toolbar .search, .ad-toolbar select { flex: 1 1 100%; min-width: 0; }
  .ad-team-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .ad-mgr { grid-column: 2 / -1; }
  .ad-num { grid-template-columns: minmax(0, 1fr) 80px; }
  .ad-num small { display: none; }
  .ad-table th, .ad-table td { padding: 10px 12px; }
}
/* the account editor reflows to the width of the list */
.ad-ed-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px 28px; }
.ad-ed-col .field-pair { margin-top: 0; }
.ad-ed-col .field-pair > .field { margin-top: 0; }
.ad-ed-facts { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.ad-ed-facts h3 { grid-column: 1 / -1; }
.ad-ed-facts .ev-list { padding: 0; }
@media (max-width: 1180px) { .ad-ed-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } .ad-ed-facts { grid-column: 1 / -1; } }
@media (max-width: 640px) { .ad-ed-facts { grid-template-columns: minmax(0, 1fr); } }
.ad-toolbar select, .ad-bulk select, .ad-mgr select { width: auto; }
.ad-toolbar .search { flex: 1; }
.adm .tag.st-added { color: var(--gold-text); }

/* one colour per site everywhere: myhome terracotta, ss teal */
.src-dot.ss { background: var(--site-ss); }
.src-dot.mh { background: var(--site-mh); }
.chips button small { margin-left: 6px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.chips button.on small { color: inherit; opacity: .7; }
.chips button i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.tag-up { color: var(--teal-text); }
.tag-up .icon { width: 13px; height: 13px; }

/* ---------- import by link ---------- */
.option.is-open { border-color: var(--gold); box-shadow: 0 0 0 4px var(--accent-ring); }
.imp { width: min(760px, 100%); padding: 18px; gap: 12px; }
.imp[hidden] { display: none; }
.imp-row { display: flex; gap: 10px; }
.imp-input { flex: 1; min-width: 0; height: 50px; }
.imp-input input { font-size: 15px; }
.imp-row .btn { height: 50px; padding: 0 22px; }
.imp-site { display: flex; align-items: center; gap: 8px; min-height: 20px; font-size: 13.5px; color: var(--ink-3); padding-left: 4px; }
.imp-site i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.imp-site b { color: var(--ink); }
.imp-site.bad { color: var(--terra-text); }
.imp-site .icon { width: 15px; height: 15px; }
.imp-steps { list-style: none; margin: 0; padding: 4px; display: flex; gap: 22px; flex-wrap: wrap; }
.imp-steps[hidden] { display: none; }
.imp-steps li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-3); transition: color var(--t-fast); }
.imp-steps b { position: relative; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-2); flex: none; }
.imp-steps .run { color: var(--ink); }
.imp-steps .run b { border-color: var(--gold); }
.imp-steps .run b::after { content: ''; position: absolute; inset: 3px; border-radius: 2px; background: var(--gold); animation: pulse 900ms ease-in-out infinite; }
.imp-steps .ok { color: var(--ink-2); }
.imp-steps .ok b { background: var(--teal); border-color: var(--teal); animation: set-tile 500ms var(--ease) both; }
.imp-steps .no { color: var(--terra-text); }
.imp-steps .no b { background: var(--terra); border-color: var(--terra); }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.imp-fail { background: rgba(224, 98, 63, .1); border-color: rgba(224, 98, 63, .35); }
.imp-fail .icon { color: var(--terra-text); }

/* ---------- home ---------- */
.hm { display: grid; gap: 20px; align-content: start; width: 100%; max-width: 1640px; margin-inline: auto; container-type: inline-size; }
.hm-hello { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hm-hello h2 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.025em; }
.hm-hello p { color: var(--ink-2); margin-top: 4px; font-size: 14.5px; }
.hm-hello > div:nth-child(2) { flex: 1; min-width: 220px; }
.hm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hm-grid { display: grid; gap: 20px; align-items: start; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'attn' 'today' 'pipe' 'recent' 'radar'; }
.hm-attn { grid-area: attn; } .hm-today { grid-area: today; } .hm-pipe { grid-area: pipe; } .hm-recent { grid-area: recent; } .hm-radar { grid-area: radar; }
/* the panels are laid out by the room the page actually has, not the window, so zoom and side panels never pull them apart */
@container (min-width: 700px) {
  .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: 'attn attn' 'today pipe' 'recent pipe' 'radar radar'; }
}
@container (min-width: 1080px) {
  .hm-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'attn today pipe' 'recent radar pipe'; }
}
.hm-count { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; background: rgba(212, 172, 85, .14); color: var(--gold-text); font-weight: 800; font-size: 14px; }
.hm-list { list-style: none; margin: 0; padding: 6px 0; }
.hm-list li { animation: rise 460ms var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.hm-list a { display: flex; align-items: center; gap: 14px; padding: 11px 22px; color: inherit; text-decoration: none; transition: background var(--t-fast); }
.hm-list a:hover { background: var(--panel-2); }
.hm-list a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hm-list a > .icon { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.hm-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none; background: var(--panel-2); color: var(--ink-2); }
.hm-ico .icon { width: 16px; height: 16px; }
.att-no_outcome .hm-ico, .att-not_uploaded .hm-ico { background: rgba(212, 172, 85, .12); color: var(--gold-text); }
.att-stale .hm-ico { background: color-mix(in srgb, var(--c2) 14%, transparent); color: var(--c2); }
.hm-txt { display: grid; min-width: 0; flex: 1; gap: 2px; }
.hm-txt b { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-txt small { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-txt .tag { height: 19px; font-size: 11px; margin-left: 4px; vertical-align: 1px; }
.hm-clear { display: flex; gap: 14px; align-items: flex-start; padding: 22px; }
.hm-clear > .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(43, 179, 156, .12); color: var(--teal-text); flex: none; }
.hm-clear strong { display: block; }
.hm-clear p { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; max-width: 52ch; }
.hm-sub { padding: 14px 22px 4px; font-size: 12.5px; color: var(--ink-3); font-weight: 650; }
.hm-agenda { list-style: none; margin: 0; padding: 4px 0 8px; }
.hm-agenda a, .hm-agenda button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 22px; border: 0; background: none; color: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background var(--t-fast); font: inherit; }
.hm-agenda a:hover, .hm-agenda button:hover { background: var(--panel-2); }
.hm-agenda .is-done .hm-txt b { color: var(--ink-3); }
.hm-time { display: grid; min-width: 52px; font-weight: 700; font-size: 14px; }
.hm-time small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.hm-kind { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.hm-empty { padding: 14px 22px; color: var(--ink-3); font-size: 14px; list-style: none; }
.hm-bar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; background: var(--panel-2); }
.hm-bar i { display: block; min-width: 4px; transition: flex var(--t-slow) var(--ease); }
.hm-bar .hm-bar-empty { flex: 1; background: var(--raised); }
.hm-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.hm-legend li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); }
.hm-legend i { width: 9px; height: 9px; border-radius: 2px; }
.hm-legend b { margin-left: auto; color: var(--ink); }
.hm-week { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 14px; }
.hm-week caption { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 650; padding-bottom: 6px; }
.hm-week th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 7px 0; border-top: 1px solid var(--line); }
.hm-week td { text-align: right; font-weight: 750; padding: 7px 0; border-top: 1px solid var(--line); }
.hm-thumbs img, .hm-noimg { width: 52px; height: 40px; border-radius: 7px; object-fit: cover; flex: none; background: var(--raised); }
.hm-price { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.hm-watches { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 22px 4px; }
.hm-watch { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; transition: border-color var(--t-fast), color var(--t-fast); }
.hm-watch:hover { color: var(--ink); border-color: var(--ink-3); }
.hm-watch .icon { width: 14px; height: 14px; }
.hm-watch small { color: var(--ink-3); }
.hm-watch .badge { height: 18px; min-width: 18px; font-size: 11px; }

/* ---------- meetings ---------- */
.mt { display: grid; gap: 16px; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 560px; }
.mt-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mt-nav { display: flex; align-items: center; gap: 6px; margin-right: auto; min-width: 0; }
.mt-range { font-size: 18px; letter-spacing: -0.015em; margin-left: 8px; white-space: nowrap; }
.mt-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; min-height: 0; }
.mt-cal { overflow: hidden; min-height: 0; }
.mt-week { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; }
.mt-whead, .mt-wbody { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); }
.mt-whead { border-bottom: 1px solid var(--line); }
.mt-whead span { display: grid; justify-items: center; padding: 10px 4px; font-size: 12px; color: var(--ink-3); }
.mt-whead b { font-size: 18px; color: var(--ink); font-weight: 750; }
.mt-whead .is-today b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.mt-wbody { overflow-y: auto; max-height: calc(100vh - 260px); min-height: 380px; position: relative; }
.mt-hours { display: grid; grid-auto-rows: 52px; }
.mt-hours span { font-size: 11.5px; color: var(--ink-3); text-align: right; padding: 0 8px 0 0; transform: translateY(-7px); }
.mt-hours span:first-child { visibility: hidden; }
.mt-day { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 52px; }
.mt-day.is-today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.mt-ev {
  position: absolute; left: 3px; right: 3px; display: grid; align-content: start; gap: 1px; overflow: hidden;
  padding: 5px 7px 5px 9px; border: 0; border-radius: 7px; text-align: left; cursor: pointer; font: inherit;
  background: color-mix(in srgb, var(--k) 22%, var(--panel)); color: var(--ink);
  box-shadow: inset 3px 0 0 var(--k), 0 2px 6px -3px rgba(0,0,0,.4);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); animation: rise 360ms var(--ease) both;
}
.mt-ev:hover { transform: translateY(-1px); }
.mt-ev:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mt-ev b { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-ev small { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-ev.is-sel { box-shadow: inset 3px 0 0 var(--k), 0 0 0 2px var(--accent); }
.mt-ev.is-done { opacity: .8; }
.mt-ev.is-failed b, .mt-ev.is-cancelled b { text-decoration: line-through; color: var(--ink-3); }
.mt-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--terra); z-index: 2; pointer-events: none; transition: top var(--t-slow) var(--ease); }
.mt-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--terra); }
.mt-month { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.mt-mhead, .mt-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mt-mhead span { padding: 10px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.mt-mgrid { grid-auto-rows: minmax(104px, 1fr); }
.mt-cell { display: grid; align-content: start; gap: 3px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: copy; min-width: 0; transition: background var(--t-fast); }
.mt-cell:hover { background: var(--panel-2); }
.mt-cell:nth-child(7n) { border-right: 0; }
.mt-cell.is-out { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.mt-cell.is-out .mt-date { color: var(--ink-3); opacity: .6; }
.mt-date { font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 2px 4px; justify-self: start; border-radius: 6px; }
.mt-cell.is-today .mt-date { background: var(--accent); color: var(--accent-ink); }
.mt-chip { position: static; padding: 3px 6px 3px 8px; font-size: 12px; display: block; white-space: nowrap; text-overflow: ellipsis; }
.mt-more { border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12px; text-align: left; padding: 0 6px; cursor: pointer; }
.mt-more:hover { color: var(--ink); }
.mt-side { overflow-y: auto; max-height: calc(100vh - 180px); }
.mt-form { display: grid; gap: 14px; padding: 18px 20px 20px; }
.mt-form .field + .field, .mt-form .field-pair { margin-top: 0; }
.mt-form-head { display: flex; align-items: center; justify-content: space-between; }
.mt-form-head h3 { font-size: 16px; }
.mt-when { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.mt-when .field { margin-top: 0; }
.mt-form textarea { width: 100%; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--field); color: var(--ink); font: inherit; font-size: 14px; resize: vertical; }
.mt-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.mt-form input[type=date], .mt-form input[type=time] { color-scheme: dark; }
:root[data-theme='light'] .mt-form input[type=date], :root[data-theme='light'] .mt-form input[type=time] { color-scheme: light; }
.mt-outcome { flex-wrap: wrap; }
.mt-form-foot { display: flex; justify-content: flex-end; gap: 8px; }
.mt-form-foot .btn-quiet { margin-right: auto; }
.mt-next { display: grid; gap: 2px; margin: 16px 16px 4px; padding: 14px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--accent) 10%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.mt-next small { font-size: 12px; color: var(--ink-3); font-weight: 650; }
.mt-next b { font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mt-next span { color: var(--ink-2); font-size: 14px; }
.mt-open { display: flex; gap: 8px; align-items: center; margin: 12px 16px 0; color: var(--gold-text); font-size: 13.5px; font-weight: 600; }
.mt-open .icon { width: 16px; height: 16px; }

/* ---------- Radar watches + scout filters ---------- */
.rd-watches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rd-watches:empty { display: none; }
.rd-watches-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); font-weight: 650; margin-right: 4px; }
.rd-watches-label .icon { width: 15px; height: 15px; }
.rd-watch { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); overflow: hidden; animation: rise 360ms var(--ease) both; }
.rd-watch button { border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.rd-watch [data-watch-open] { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px; font-size: 13.5px; font-weight: 650; }
.rd-watch [data-watch-open] small { color: var(--ink-3); font-size: 12px; }
.rd-watch .badge { height: 20px; font-size: 11px; }
.rd-watch-x { display: grid; place-items: center; width: 30px; height: 34px; color: var(--ink-3) !important; border-left: 1px solid var(--line) !important; }
.rd-watch-x:hover { color: var(--terra-text) !important; background: rgba(224, 98, 63, .1) !important; }
.rd-watch-x .icon { width: 13px; height: 13px; }
.rd-watch:hover { border-color: var(--ink-3); }
.rd-watch-new { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.rd-watch-new .control { width: 200px; }
.rd-watch-new .control[hidden], .rd-watch-new [hidden] { display: none; }
.rd-watch-new .control input { height: 40px; }
.filters-foot { gap: 12px; flex-wrap: wrap; }

/* ---------- where it was uploaded ---------- */
.up-where { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); min-height: 0; }
.up-where:empty { display: none; }
.up-where em { font-style: normal; color: var(--gold-text); }
.up-where .btn { margin-left: auto; }
.up-where .tag i { width: 7px; height: 7px; border-radius: 2px; }
.up-pick { flex-basis: 100%; display: grid; gap: 10px; padding: 14px; margin-bottom: 6px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); animation: rise 320ms var(--ease) both; }
.up-pick strong { font-size: 14px; }
.up-pick .chips button { display: inline-flex; align-items: center; }
.up-pick .chips button i { width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
.up-pick .chips .icon { width: 13px; height: 13px; margin-right: 6px; }
.up-pick .error-text { margin: 0; }
.up-pick-foot { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1180px) {
  .mt-main { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .mt { height: auto; }
  .mt-main { grid-template-columns: minmax(0, 1fr); }
  .mt-side { max-height: none; }
  .mt-wbody { max-height: 60vh; }
}
@media (max-width: 640px) {
  .imp-row { flex-direction: column; }
  .mt-range { font-size: 15px; }
  .mt-whead, .mt-wbody { grid-template-columns: 40px repeat(7, minmax(44px, 1fr)); }
  .mt-week { overflow-x: auto; }
  .mt-mgrid { grid-auto-rows: minmax(64px, 1fr); }
  .mt-chip span { display: none; }
  .mt-when { grid-template-columns: 1fr 1fr; }
  .mt-when .field:first-child { grid-column: span 2; }
  .rd-watch-new { margin-left: 0; width: 100%; }
}
.mt-when { grid-template-columns: 1fr 1fr; }
.mt-when .field:first-child { grid-column: span 2; }
.mt-main { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1180px) { .mt-main { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 900px) { .mt-main { grid-template-columns: minmax(0, 1fr); } }

/* light theme: every surface follows it, the sidebar and admin band too */
:root[data-theme='light'] {
  --rail: #f7f6f3; --rail-2: #e9e6df; --rail-line: #e2dfd9; --rail-ink: #1d1c1a; --rail-ink-2: #6b675f; --rail-tile: #efede8; --rail-strong: #111111; --rail-hover: rgba(0,0,0,.045);
  --art-bg: #f4f2ee; --art-veil: 247, 246, 243; --art-line: var(--line); --art-ink: #111111; --art-ink-2: #4a4741; --art-ink-3: #6b675f;
}
:root[data-theme='light'] body[data-area='admin'] {
  --rail: #fbf3f1; --rail-2: #f1dcd7; --rail-line: #ecd3cd; --rail-ink: #3a1410; --rail-ink-2: #8a5a52; --rail-tile: #f6e6e2; --rail-strong: #3a0d08; --rail-hover: rgba(120,20,10,.06);
  --band-ink: #6b2a1f; --band-ink-2: #8a5a52; --band-a: #f8e7e3; --band-b: #fbf0ed; --band-line: #ecd3cd;
}
:root[data-theme='light'] .rail-brand small { color: var(--rail-ink-2); }
:root[data-theme='light'] body[data-area='admin'] .rail-brand small, :root[data-theme='light'] .admin-band strong, :root[data-theme='light'] .admin-band .icon, :root[data-theme='light'] .rail-note .lock .icon { color: var(--accent-text); }
:root[data-theme='light'] .nav a:hover { color: var(--rail-strong); }
:root[data-theme='light'] .hp-nav.solid .seg { background: var(--panel-2); border-color: var(--line-2); }
:root[data-theme='light'] .hp-nav.solid .seg button { color: var(--ink-3); }
:root[data-theme='light'] .hp-nav.solid .seg button.on { color: var(--ink); }
:root[data-theme='light'] .hp-nav.solid .seg .seg-pill { background: var(--raised); }
:root[data-theme='light'] .hp-nav.solid nav a:hover { background: rgba(0,0,0,.05); }
:root[data-theme='light'] .rd-scope canvas { filter: saturate(1.15) contrast(1.05); }
:root[data-theme='light'] ::selection { background: rgba(138, 100, 24, .22); }

.rd-filters .f.full { grid-column: 1 / -1; }
.rd-filters [data-urbans] { max-height: 132px; overflow-y: auto; padding-right: 4px; }

/* calendar: below laptop-half width the agenda goes under the calendar */
@media (max-width: 1080px) {
  .mt-main { grid-template-columns: minmax(0, 1fr); }
  .mt { height: auto; }
  .mt-side { max-height: none; }
  .mt-wbody { max-height: 62vh; }
}

/* radar feed: its rows may never be wider than the column */
.rd-feed > *, .rd-list > *, .rd-card > *, .rd-body > * { min-width: 0; }
.rd-feed-head { flex-wrap: wrap; row-gap: 8px; }
.rd-feed-head .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.rd-btns { flex-wrap: wrap; }
.rd-btns .rd-open { min-width: 180px; }
.rd-seller { flex-wrap: wrap; }
.rd-main { grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); }
@media (max-width: 1360px) {
  .scope button span { display: none; }
}
@media (max-width: 1280px) {
  .rd-main { grid-template-columns: minmax(0, 1fr); }
  .rd-scope { position: static; display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); align-items: center; column-gap: 24px; }
  .rd-scope .scope-wrap { grid-row: span 4; }
}
@media (max-width: 760px) {
  .rd-scope { grid-template-columns: minmax(0, 1fr); }
  .rd-scope .scope-wrap { grid-row: auto; max-width: 360px; justify-self: center; width: 100%; }
}
/* the status tabs scroll sideways instead of running off the screen */
.status-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.rd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rd-stats b { font-size: clamp(17px, 2vw, 22px); }
.rd-stats span { min-width: 0; overflow-wrap: anywhere; }
.topbar h1 { white-space: nowrap; }
@media (max-width: 900px) {
  .btn-add { width: 44px; padding: 0; justify-content: center; }
  .btn-add .txt { display: none; }
  .topbar .crumbs { display: none; }
  .detail-head { grid-template-columns: minmax(0, 1fr); }
  .detail-actions { justify-content: flex-start; }
  .hm-actions { width: 100%; }
  .hm-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- phones: the rail becomes a bottom tab bar ---------- */
.topbar h1 { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-left { min-width: 0; overflow: hidden; }
@media (max-width: 640px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; height: calc(62px + env(safe-area-inset-bottom));
    flex-direction: row; border-right: 0; border-top: 1px solid var(--rail-line);
    padding-bottom: env(safe-area-inset-bottom); animation: none;
  }
  .rail-brand, .rail-note, .nav-tessera { display: none !important; }
  .nav { display: flex; flex-direction: row; justify-content: space-around; align-items: center; width: 100%; padding: 6px 8px; gap: 2px; }
  .nav a + .nav-group, .nav-group { display: none !important; }
  .nav a { flex: 1; height: 50px; max-width: 76px; border-radius: 12px; }
  .nav a[aria-current='page'] { background: var(--rail-2); }
  .nav a[aria-current='page'] .icon { color: var(--accent-text); }
  body[data-area='agent'] .nav a[aria-current='page'] .icon { color: var(--gold-text); }
  .nav-badge { top: 8px; right: calc(50% - 16px); }
  .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .admin-band { padding: 0 14px; }

  /* listings toolbar: deal switch on its own row, search + filters below */
  .lx-head { gap: 10px; }
  .lx-head .seg-deal { flex: 1 1 100%; display: flex; }
  .lx-head .seg-deal button { flex: 1; }
  .lx-head .search { order: 2; flex: 1 1 0; min-width: 0; }
  .lx-head .filter-toggle { order: 3; flex: none; }

  /* meetings bar on two rows */
  .mt-bar { gap: 10px; }
  .mt-nav { width: 100%; }
  .mt-range { font-size: 15px; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; }
  .mt-bar [data-new] { margin-left: auto; }
  .mt-week { overflow-x: auto; }
  .mt-whead, .mt-wbody { min-width: 520px; }

  /* analytics */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-k { flex-wrap: wrap; }
  .stat { min-width: 0; }
}
@media (max-width: 760px) {
  .rd-bar { flex-direction: column; align-items: stretch; }
  .rd-actions { width: 100%; flex-wrap: wrap; }
  .rd-actions .rd-src { flex: 1 1 auto; display: flex; overflow-x: auto; scrollbar-width: none; }
  .rd-actions .rd-src button { flex: 1; white-space: nowrap; }
  .rd-actions [data-filters-toggle] { flex: none; }
}
@media (max-width: 420px) {
  .rd-actions [data-filters-toggle] { flex: 1 1 100%; justify-content: center; }
}
.ad-num { grid-template-columns: minmax(0, 1fr) 88px auto; }
.ad-num small { white-space: nowrap; }
.ad-src > * { min-width: 0; }
@media (max-width: 640px) {
  .ad-toolbar > * { flex: 1 1 100% !important; min-width: 0 !important; }
  .ad-toolbar .seg { display: flex; overflow-x: auto; scrollbar-width: none; }
  .ad-toolbar .seg button { flex: 1; white-space: nowrap; }
  .ad-toolbar .btn { justify-content: center; }
  .ad-bulk select { flex: 1 1 140px; min-width: 0; }
  .ad-src { grid-template-columns: minmax(0, 1fr) auto; }
  .ad-src-name { grid-column: 1; }
  .ad-src .ad-switch { grid-column: 2; grid-row: 1; }
  .ad-src-state { grid-column: 1 / -1; grid-row: 2; }
  .ad-src .btn { grid-column: 1 / -1; grid-row: 3; justify-content: center; }
  .ad-num { grid-template-columns: minmax(0, 1fr) 80px; }
}
/* grid children may shrink to the screen; wide things scroll inside themselves */
.adm > *, .ad-grid > *, .hm > *, .hm-grid > *, .mt > *, .mt-main > *, .an > *, .an-grid > *, .radar > *, .listings > *, .detail > * { min-width: 0; }
@media (max-width: 640px) {
  .ad-toolbar .search { order: -1; }
}
.ad-danger .btn, .panel-body > .btn { white-space: normal; height: auto; min-height: 42px; padding-top: 9px; padding-bottom: 9px; text-align: left; max-width: 100%; }

/* ---------- bell + notifications ---------- */
.top-actions { display: flex; align-items: center; gap: 10px; }
.bell {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.bell:hover, .bell[aria-expanded='true'] { color: var(--ink); background: var(--raised); border-color: var(--ink-3); }
.bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bell .icon { width: 19px; height: 19px; }
.bell-n {
  position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 7px; background: var(--terra); color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 0 0 2px var(--panel);
  animation: pop 360ms var(--ease);
}
.bell-n[hidden] { display: none; }
.notes-pop {
  position: fixed; z-index: 60; width: min(380px, calc(100vw - 24px)); max-height: min(520px, calc(100vh - 100px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop);
  animation: menu-in 240ms var(--ease) both; transform-origin: top right;
}
.notes-pop.closing { animation: menu-out 160ms var(--ease-in) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes menu-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.notes-head strong { font-size: 15px; }
.notes-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.notes-list li { animation: rise 340ms var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.note-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 11px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background var(--t-fast);
}
.note-row:hover, .note-row:focus-visible { background: var(--panel-2); outline: none; }
.note-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; background: var(--panel-2); color: var(--ink-2); }
.note-ico .icon { width: 16px; height: 16px; }
.note-tutorial .note-ico { background: rgba(212, 172, 85, .14); color: var(--gold-text); }
.note-watch .note-ico { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal-text); }
.note-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.note-txt b { font-size: 14px; font-weight: 650; }
.note-txt small { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.note-txt em { font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.note-row.is-unread .note-txt b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 2px; background: var(--terra); vertical-align: 2px; }
.note-go { align-self: center; font-size: 12.5px; font-weight: 700; color: var(--gold-text); padding: 5px 9px; border-radius: 8px; background: rgba(212, 172, 85, .12); }
.note-empty { padding: 26px; text-align: center; color: var(--ink-3); list-style: none; }
.notes-foot { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border: 0; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; text-align: left; transition: color var(--t-fast); }
.notes-foot:hover { color: var(--ink); }
.notes-foot .icon { width: 16px; height: 16px; color: var(--gold-text); }

/* ---------- welcome tour ---------- */
.tut {
  width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 22px; background: var(--panel); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 2px 10px rgba(0,0,0,.3);
  animation: tut-in 520ms var(--ease) both;
}
.tut.closing { animation: tut-out 220ms var(--ease-in) both; }
.tut::backdrop { background: var(--scrim); backdrop-filter: blur(4px); animation: fade-in 300ms ease both; }
@keyframes tut-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes tut-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.tut-stage { position: relative; overflow: hidden; }
.tut-track { display: flex; transition: transform 560ms var(--ease); touch-action: pan-y; }
.tut-slide { flex: 0 0 100%; margin: 0; display: grid; }
.tut-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #050505; border-bottom: 1px solid var(--line); }
.tut-img img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.035); transition: transform 1200ms var(--ease), opacity 500ms ease; opacity: .6; }
.tut-slide.on .tut-img img { transform: none; opacity: 1; }
.tut-slide figcaption { padding: 22px 28px 6px; display: grid; gap: 6px; }
.tut-step { font-size: 12.5px; font-weight: 700; color: var(--gold-text); }
.tut-slide h2 { font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.02em; }
.tut-slide p { color: var(--ink-2); font-size: 15px; line-height: 1.55; max-width: 62ch; }
.tut-slide figcaption > * { opacity: 0; transform: translateY(8px); transition: opacity 420ms ease 120ms, transform 520ms var(--ease) 120ms; }
.tut-slide.on figcaption > * { opacity: 1; transform: none; }
.tut-slide.on figcaption p { transition-delay: 200ms; }
.tut-x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 11px; background: rgba(10, 10, 10, .65); color: #ece8df; backdrop-filter: blur(6px); }
.tut-x:hover { background: rgba(10, 10, 10, .85); color: #fff; }
.tut-foot { display: flex; align-items: center; gap: 14px; padding: 16px 20px 20px 28px; }
.tut-dots { display: flex; gap: 2px; margin: 0 auto; }
.tut-dots button { display: grid; place-items: center; width: 22px; height: 28px; border: 0; background: none; cursor: pointer; padding: 0; }
.tut-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--line-2); transition: width var(--t) var(--ease), background var(--t); }
.tut-dots button.on i { width: 18px; background: var(--gold); }
.tut-dots button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.tut-nav { display: flex; gap: 8px; }
.tut-nav .btn:disabled { visibility: hidden; }
.tut-nav .btn-primary.is-last { background: var(--gold); border-color: var(--gold); color: #140f04; }
.tut-foot > .btn-quiet { padding-left: 0; }
@media (max-width: 640px) {
  .tut { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .tut-slide figcaption { padding: 18px 18px 4px; }
  .tut-slide p { font-size: 14.5px; }
  .tut-foot { flex-wrap: wrap; padding: 12px 16px 18px; gap: 10px; }
  .tut-dots { order: -1; width: 100%; justify-content: center; }
  .tut-foot > .btn-quiet { margin-right: auto; }
  .bell { width: 42px; height: 42px; }
}
/* the tour always fits the window, and its pictures read as pictures, not as the page behind */
.tut { width: min(980px, calc(100vw - 32px), calc((100vh - 270px) * 1.6)); }
.tut-img { padding: 20px 22px 0; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--gold) 22%, var(--panel-2)), var(--panel-2) 70%); border-bottom: 1px solid var(--line); }
.tut-img img { border-radius: 12px 12px 0 0; box-shadow: 0 -1px 0 rgba(255,255,255,.06), 0 24px 40px -18px rgba(0,0,0,.8); object-fit: cover; object-position: top center; }
@media (max-width: 640px) {
  .tut { width: 100vw; }
  .tut-img { padding: 14px 14px 0; }
}
.tut-track { width: 100%; }
.tut-slide { min-width: 0; width: 100%; overflow: hidden; }
.tut-img { min-width: 0; }
.tut-img img { min-width: 0; max-width: 100%; }

@media (max-width: 640px) {
  .tut-img { aspect-ratio: 1 / 1; }
  .tut-img img { object-position: var(--focus, center); height: 100%; }
}

/* views on the sites */
.lr-views { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.lr-views .icon { width: 14px; height: 14px; color: var(--ink-3); }
.vw-card .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.vw-card .panel-head h2 .icon { width: 17px; height: 17px; color: var(--gold-text); }
.vw-total { display: grid; justify-items: end; }
.vw-total b { font-size: 24px; font-weight: 800; line-height: 1; }
.vw-total small { color: var(--ink-3); font-size: 12px; }
.vw-sites { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 2px; }
.vw-sites li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vw-sites li > span b { display: block; font-size: 14px; }
.vw-sites li small { display: block; font-size: 12px; color: var(--ink-3); }
.vw-sites li > b { font-size: 18px; font-weight: 800; }
.vw-sites li em { grid-column: 3; justify-self: end; font-style: normal; font-size: 12px; color: var(--teal-text); font-weight: 700; }
.vw-links { display: grid; gap: 10px; }
.vw-links .field { margin: 0; }
.vw-links .btn { justify-self: start; }

/* phones: iOS zooms the whole page into any field typed in under 16px, and never zooms back out */
@media (pointer: coarse) and (max-width: 900px) {
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='file']), select, textarea { font-size: 16px !important; }
}

/* the on-screen keyboard is open (html.kb-up, set from the visual viewport): bottom bars step aside */
html.kb-up .rail, html.kb-up .toasts, html.kb-up .sr-dock { display: none !important; }
@media (max-width: 640px) { html.kb-up .main { padding-bottom: 0; } html.kb-up .mf-side { bottom: 0; } }

/* ---------- phones: four labelled tabs + "More" (replaces the sideways-scrolling icon strip) ---------- */
.nav-more, .nav-sheet { display: none; }
@media (max-width: 640px) {
  .nav, body[data-area='admin'] .nav { justify-content: space-around; overflow: visible; padding: 4px 6px; gap: 0; }
  .nav a:not(.nav-main), body[data-area='admin'] .nav a:not(.nav-main) { display: none; }
  .nav a, .nav-more, body[data-area='admin'] .nav a { flex: 1 1 0; min-width: 0; max-width: none; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 2px; border-radius: 12px; }
  .nav a span, .nav-more span { display: block !important; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 650; line-height: 1.1; }
  html[lang='ka'] .nav a span, html[lang='ka'] .nav-more span { font-size: 10px; letter-spacing: -.01em; }
  .nav a .icon, .nav-more .icon { width: 21px; height: 21px; }
  .nav a:hover .icon { transform: none; }
  .nav-more { border: 0; background: none; color: var(--rail-ink, var(--ink-3)); font: inherit; cursor: pointer; }
  .nav-more[aria-expanded='true'], .nav-more.is-here { background: var(--rail-2); color: var(--rail-strong, #fff); }
  .nav-more.is-here .icon { color: var(--accent-text); }
  body[data-area='agent'] .nav-more.is-here .icon { color: var(--gold-text); }
  .nav-sheet:not([hidden]) { display: block; position: fixed; inset: 0 0 calc(62px + env(safe-area-inset-bottom)); z-index: 39; background: rgba(0, 0, 0, .5); animation: fade-in 160ms var(--ease) both; }
  .nav-sheet-in { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - 56px); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px; padding: 16px 14px 14px; border-radius: 20px 20px 0 0; background: var(--panel); border-top: 1px solid var(--line-2); box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .6); animation: sheet-up 220ms var(--ease) both; }
  .nav-sheet h3 { margin: 0 4px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
  html[lang='ka'] .nav-sheet h3 { text-transform: none; letter-spacing: 0; }
  .nav-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .nav-sheet-grid a { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 70px; padding: 8px 6px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; text-align: center; font-size: 12.5px; font-weight: 650; line-height: 1.25; }
  .nav-sheet-grid a .icon { width: 22px; height: 22px; color: var(--ink-3); }
  .nav-sheet-grid a[aria-current] { border-color: var(--gold); color: var(--ink); }
  .nav-sheet-grid a[aria-current] .icon { color: var(--gold-text); }
  body[data-area='admin'] .nav-sheet-grid a[aria-current] { border-color: #b3362c; }
  html.kb-up .nav-sheet { display: none !important; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
/* phones: the two ways to add a listing both fit on one screen */
@media (max-width: 640px) {
  .option-art { height: 92px; }
  .option-text { padding: 16px 18px 4px; }
  .option-text strong { font-size: 18px; }
  .option-go { padding: 8px 18px 16px; }
}

/* side menu on shorter screens: the page list scrolls on its own and never runs under the Connect note */
@media (min-width: 641px) {
  .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .rail-note, .rail-brand { flex: none; }
}
/* a card's heading and its button share a row only when both fit; otherwise the button drops below */
.panel-head { flex-wrap: wrap; }
.panel-head > div:first-child { flex: 1 1 160px; min-width: 0; }
.panel-head > .btn { flex: none; }
