/* SaQa kit. Desktop first. Token names follow the KimigaeTech portfolio kit; design source: mockups/assets/kit.css. */
@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@500;700&family=Open+Sans:wght@400;600;700&family=Noto+Sans+Georgian:wght@400;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

/* ---------- Tokens: tone ---------- */
:root {
  --hue: 221;          /* accent hue */
  --hue2: 28;          /* community accent */
  --nh: 221;           /* hue of neutrals (backgrounds, lines, text) */
  --tint: 18%;         /* how much the neutral hue colours light neutrals */
  --tint-d: 22%;       /* the same for dark neutrals */
  --acc-s: 80%; --acc-l: 52%; --acc-l-d: 64%;
  --news: 352;         /* editorial accent (red) */

  --font-head: "Comfortaa", "Noto Sans Georgian", system-ui, sans-serif;
  --font-ui: "Open Sans", "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --t1: 12px; --t2: 13px; --t3: 14px; --t4: 15px; --t5: 17px; --t6: 20px; --t7: 24px; --t8: 30px; --t9: 40px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;
  --r1: 6px; --r2: 10px; --r3: 16px; --rp: 999px;
  --wrap: 1240px; --header-h: 64px;

  --iron: #6b7280; --copper: #b4652e; --bronze: #a1713a; --silver: #8f9bab; --gold: #c99a06;
}

/* Palette presets (src/shared/look.ts). Claude: terracotta on warm cream, near-neutral dark. */
:root[data-palette="sea"] { --hue: 221; --hue2: 28; --nh: 221; --tint: 18%; --tint-d: 22%; --acc-s: 80%; --acc-l: 52%; --acc-l-d: 64%; }
:root[data-palette="claude"] { --hue: 15; --hue2: 210; --nh: 45; --tint: 24%; --tint-d: 5%; --acc-s: 58%; --acc-l: 55%; --acc-l-d: 62%; }
:root[data-palette="adjara"] { --hue: 152; --hue2: 40; --nh: 150; --tint: 12%; --tint-d: 16%; --acc-s: 62%; --acc-l: 36%; --acc-l-d: 52%; }

/* ---------- Tokens: light ---------- */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: hsl(var(--nh) var(--tint) 97.5%);
  --surface: hsl(var(--nh) var(--tint) 99.5%);
  --surface-2: hsl(var(--nh) var(--tint) 95.5%);
  --surface-3: hsl(var(--nh) var(--tint) 91.5%);
  --line: hsl(var(--nh) var(--tint) 89%);
  --line-2: hsl(var(--nh) var(--tint) 81%);
  --text: hsl(var(--nh) 14% 17%);
  --strong: hsl(var(--nh) 20% 7%);
  --muted: hsl(var(--nh) 8% 38%);
  --faint: hsl(var(--nh) 6% 55%);
  --acc: hsl(var(--hue) var(--acc-s) var(--acc-l));
  --acc-strong: hsl(var(--hue) var(--acc-s) calc(var(--acc-l) - 8%));
  --acc-soft: hsl(var(--hue) calc(var(--acc-s) + 10%) 95%);
  --acc-ink: #ffffff;
  --acc2: hsl(var(--hue2) 80% 46%);
  --acc2-soft: hsl(var(--hue2) 85% 94%);
  --red: hsl(var(--news) 100% 38%);
  --red-soft: hsl(var(--news) 90% 95%);
  --ok: #15803d; --ok-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #dc2626; --bad-soft: #fee2e2;
  --green-text: #3f7d20;
  --shadow: 0 1px 2px hsl(var(--nh) 30% 20% / .06), 0 4px 16px hsl(var(--nh) 30% 20% / .06);
  --shadow-pop: 0 10px 40px hsl(var(--nh) 30% 10% / .18);
}

/* ---------- Tokens: dark ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: hsl(var(--nh) var(--tint-d) 8%);
  --surface: hsl(var(--nh) var(--tint-d) 11.5%);
  --surface-2: hsl(var(--nh) var(--tint-d) 14.5%);
  --surface-3: hsl(var(--nh) var(--tint-d) 19%);
  --line: hsl(var(--nh) var(--tint-d) 20%);
  --line-2: hsl(var(--nh) var(--tint-d) 28%);
  --text: hsl(var(--nh) 10% 86%);
  --strong: hsl(var(--nh) 14% 97%);
  --muted: hsl(var(--nh) 7% 66%);
  --faint: hsl(var(--nh) 6% 50%);
  --acc: hsl(var(--hue) calc(var(--acc-s) + 8%) var(--acc-l-d));
  --acc-strong: hsl(var(--hue) calc(var(--acc-s) + 8%) calc(var(--acc-l-d) + 8%));
  --acc-soft: hsl(var(--hue) 40% 18%);
  --acc-ink: hsl(var(--hue) 40% 8%);
  --acc2: hsl(var(--hue2) 85% 60%);
  --acc2-soft: hsl(var(--hue2) 45% 16%);
  --red: hsl(var(--news) 85% 62%);
  --red-soft: hsl(var(--news) 45% 17%);
  --ok: #4ade80; --ok-soft: #14321f;
  --warn: #fbbf24; --warn-soft: #3a2a0a;
  --bad: #f87171; --bad-soft: #3b1414;
  --green-text: #8fd16a;
  --shadow: 0 1px 2px #0006, 0 4px 18px #0005;
  --shadow-pop: 0 12px 44px #000a;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins over component display rules (.btn, .row… set display themselves). */
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0; min-width: 1024px;
  background: var(--bg); color: var(--text);
  font: 400 var(--t4)/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--acc-strong); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--strong); line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h1 { font-size: var(--t8); }
h2 { font-size: var(--t7); }
h3 { font-size: var(--t5); }
h4 { font-size: var(--t4); }
p { margin: 0; }
/* Photos carry width and height attributes (src/edge/picture.ts) for their ratio: height follows the width CSS gives,
   so a narrowed photo is never stretched. Boxes of a fixed shape use .cover-img or their own object-fit. */
img { max-width: 100%; height: auto; display: block; }
.cover-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lcard .media .ph-img, .lcard .media .ph-img > picture { position: absolute; inset: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--acc); color: var(--acc-ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny { font-size: var(--t1); }
.small { font-size: var(--t2); }
.strong { color: var(--strong); font-weight: 700; }
.nowrap { white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.row { display: flex; align-items: center; gap: var(--s2); }
.row.wrap-row { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: var(--s2); }
.grow { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.grid { display: grid; gap: var(--s5); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s6); align-items: start; }
.layout-filters { display: grid; grid-template-columns: 280px 1fr; gap: var(--s6); align-items: start; }
.section { padding: var(--s7) 0; }
.section-tight { padding: var(--s5) 0; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); }
.card.pad { padding: var(--s5); }
.card.pad-sm { padding: var(--s4); }
.card.shadow { box-shadow: var(--shadow); }
.well { background: var(--surface-2); border-radius: var(--r2); padding: var(--s4); }
.sticky { position: sticky; top: calc(var(--header-h) + var(--s4)); }

/* ---------- Buttons and inputs ---------- */
.btn {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 38px; padding: 0 var(--s4); border-radius: var(--r1);
  font: 600 var(--t3)/1 var(--font-ui);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--acc); color: var(--acc); }
.btn.acc { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.acc:hover { background: var(--acc-strong); border-color: var(--acc-strong); color: var(--acc-ink); }
.btn.acc2 { background: var(--acc2); border-color: var(--acc2); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 var(--s3); font-size: var(--t2); }
.btn.lg { height: 46px; padding: 0 var(--s6); font-size: var(--t4); }
.btn.block { width: 100%; }
.icon-btn {
  all: unset; cursor: pointer; box-sizing: border-box;
  width: 36px; height: 36px; border-radius: var(--r1);
  display: inline-grid; place-items: center; position: relative;
  color: var(--muted); border: 1px solid var(--line);
}
.icon-btn:hover { color: var(--acc); border-color: var(--acc); }
.icon-btn .dot {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--rp); background: var(--red); color: #fff;
  font: 700 10px/18px var(--font-ui); text-align: center;
}
.inp, .sel, textarea.inp {
  height: 38px; width: 100%; padding: 0 var(--s3);
  border: 1px solid var(--line-2); border-radius: var(--r1);
  background: var(--surface); color: var(--text); outline: none;
}
textarea.inp { height: auto; min-height: 96px; padding: var(--s3); resize: vertical; }
.inp:focus, .sel:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: var(--t2); font-weight: 600; color: var(--muted); }
.inp[aria-invalid="true"], .sel[aria-invalid="true"] { border-color: var(--bad); }
.field-err { font-size: var(--t1); font-weight: 600; color: var(--bad); }
.check { display: flex; align-items: center; gap: var(--s2); font-size: var(--t3); cursor: pointer; padding: 3px 0; }
.check input { accent-color: var(--acc); width: 16px; height: 16px; margin: 0; }
.check .cnt { margin-left: auto; color: var(--faint); font-size: var(--t1); }
.range2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.switch { position: relative; width: 36px; height: 20px; border-radius: var(--rp); background: var(--line-2); display: inline-block; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--acc); }
.switch.on::after { left: 18px; }

/* ---------- Chips, tags, badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s3);
  border-radius: var(--rp); border: 1px solid var(--line-2); background: var(--surface);
  font-size: var(--t2); font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--acc); color: var(--acc); }
.chip.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.chip.red.on { background: var(--red); border-color: var(--red); color: #fff; }
.chip .x { opacity: .7; }
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px;
  font: 700 11px/1 var(--font-ui); letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-3); color: var(--muted);
}
.tag.red { background: var(--red); color: #fff; }
.tag.orange { background: var(--acc2); color: #fff; }
.tag.acc { background: var(--acc); color: var(--acc-ink); }
.tag.soft { background: var(--acc-soft); color: var(--acc-strong); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--rp);
  font-size: var(--t1); font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.verified { color: var(--acc); font-weight: 700; }

/* Role plates and tiered achievements */
.plate {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 6px; font-size: var(--t2); font-weight: 600;
  background: var(--acc-soft); color: var(--acc-strong); border: 1px solid color-mix(in srgb, var(--acc) 25%, transparent);
}
.ach {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 4px;
  border-radius: var(--rp); font-size: var(--t2); font-weight: 700; color: var(--strong);
  background: var(--surface); border: 1.5px solid var(--tier, var(--line-2));
}
.ach .medal {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tier); color: #fff; font-size: 11px;
  box-shadow: inset 0 -2px 0 #0003, inset 0 2px 0 #fff4;
}
.ach .lvl { font-weight: 600; color: var(--muted); font-size: var(--t1); }
.t-iron { --tier: var(--iron); } .t-copper { --tier: var(--copper); } .t-bronze { --tier: var(--bronze); }
.t-silver { --tier: var(--silver); } .t-gold { --tier: var(--gold); }
.ach.excl { background: color-mix(in srgb, var(--tier) 14%, var(--surface)); }

/* ---------- Avatars and placeholders ---------- */
.ava {
  --a: var(--hue); width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font: 700 13px/1 var(--font-ui); color: #fff;
  background: hsl(var(--a) 55% 50%);
}
.ava.sm { width: 26px; height: 26px; font-size: 10px; }
.ava.lg { width: 64px; height: 64px; font-size: 22px; }
.ava.xl { width: 120px; height: 120px; font-size: 40px; border: 4px solid var(--surface); }
.ava.sq { border-radius: var(--r2); }
.ph {
  --p: 200; position: relative; overflow: hidden; border-radius: var(--r2);
  background: hsl(var(--p) 38% 62%);
}
:root[data-theme="dark"] .ph { filter: saturate(.85) brightness(.85); }
.ph::after {
  content: attr(data-l); position: absolute; left: 10px; bottom: 8px;
  font: 600 11px/1 var(--font-ui); color: #fff; opacity: .85; text-shadow: 0 1px 2px #0005;
}
.ph.sea { --p: 200; } .ph.mount { --p: 150; } .ph.sunset { --p: 20; } .ph.city { --p: 230; }
.ph.room { --p: 35; } .ph.night { --p: 250; } .ph.wine { --p: 340; } .ph.gold { --p: 45; } .ph.mint { --p: 165; }
.ratio-16x9 { aspect-ratio: 16/9; } .ratio-4x3 { aspect-ratio: 4/3; } .ratio-1 { aspect-ratio: 1; } .ratio-3x4 { aspect-ratio: 3/4; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: var(--s5); }
/* Doodles as the logo. The main doodle is the logo itself; today's (or a previewed) doodle takes the logo's place
   (put in by app.js, wide screens; narrow ones keep the logo). Pieces are not clickable, the link around them is.
   color-scheme: normal keeps the frame transparent: a frame whose scheme differs from the page's is painted opaque. */
.hdr-doodle { flex: none; width: 200px; height: calc(var(--header-h) - 10px); overflow: hidden; }
.hdr-doodle[hidden] { display: none; }
.logo-doodle { flex: none; display: block; width: 200px; height: calc(var(--header-h) - 10px); position: relative; }
.foot-logo { width: 220px; height: 56px; }
.hdr-doodle iframe, .logo-doodle iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; background: transparent; }
iframe[data-doodle-parts], .doodle-stage iframe, .doodle-hdr iframe { color-scheme: normal; }
@media (min-width: 901px) { .site-header.has-doodle .logo { display: none; } }
@media (max-width: 900px) { .hdr-doodle { display: none; } }
.logo { display: flex; flex-direction: column; line-height: 1; text-decoration: none; }
.logo .word { font: 700 26px/1 var(--font-head); letter-spacing: -.02em; }
.logo .word span:nth-child(1) { color: #e11d48; }
.logo .word span:nth-child(2) { color: #f59e0b; }
.logo .word span:nth-child(3) { color: #16a34a; }
.logo .word span:nth-child(4) { color: #2563eb; }
.logo .sub { font: 600 9px/1 var(--font-ui); color: var(--faint); margin-top: 4px; letter-spacing: .02em; }
.logo .dom { font: 700 11px/1 var(--font-head); color: var(--acc); margin-left: 6px; }
.logo .city { font: 700 11px/1 var(--font-ui); color: var(--acc-ink); background: var(--acc); border-radius: var(--rp); padding: 3px 7px; margin-left: 6px; vertical-align: 5px; letter-spacing: .02em; }
.foot-pin { color: var(--text); }
a.foot-pin:hover .strong { color: var(--acc); }
.main-nav { display: flex; gap: 2px; }
.main-nav a {
  padding: 8px 12px; border-radius: var(--r1); color: var(--text); font-weight: 600; font-size: var(--t3);
}
.main-nav a:hover { background: var(--surface-2); color: var(--strong); }
.main-nav a.on { color: var(--acc); background: var(--acc-soft); }
/* Menu items with sub-items: open on hover, on keyboard focus, or by the caret (touch). */
.nav-item { position: relative; display: inline-flex; align-items: center; }
.nav-caret { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 4px 2px; margin-left: -8px; font-size: 11px; }
.nav-sub { display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 190px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: 0 8px 24px rgba(0,0,0,.14); flex-direction: column; gap: 2px; }
.nav-item:hover .nav-sub, .nav-item:focus-within .nav-sub { display: flex; }
.nav-sub a { display: block; white-space: nowrap; font-weight: 500; padding: 8px 12px; border-radius: var(--r1); color: var(--text); font-size: var(--t3); }
.nav-sub a:hover { background: var(--surface-2); color: var(--strong); }
.hdr-search { flex: 1; max-width: 320px; position: relative; }
.hdr-search .inp { padding-left: 34px; height: 36px; background: var(--surface-2); border-color: transparent; }
.hdr-search::before { content: "⌕"; position: absolute; left: 12px; top: 7px; color: var(--faint); font-size: 16px; }
.hdr-tools { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }

/* Language popover (portfolio pattern: details + segments) */
.pop-wrap { position: relative; }
.pop-wrap > summary { list-style: none; }
.pop-wrap > summary::-webkit-details-marker { display: none; }
.lang-btn {
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r1); font: 600 var(--t2)/1 var(--font-mono); color: var(--text);
}
.lang-btn:hover { border-color: var(--acc); }
.pop {
  position: absolute; right: 0; top: calc(100% + 6px); width: 280px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r2);
  box-shadow: var(--shadow-pop); padding: var(--s3);
}
.pop-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 6px 0; }
.eyebrow { font: 700 11px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r1); overflow: hidden; }
.seg a, .seg button {
  all: unset; cursor: pointer; padding: 6px 10px; font: 600 var(--t1)/1 var(--font-mono); color: var(--muted);
}
.seg a + a, .seg button + button { border-left: 1px solid var(--line); }
.seg .on { background: var(--acc); color: var(--acc-ink); }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--s8); background: var(--surface); border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: var(--s6); padding: var(--s7) 0; }
.foot-grid h4 { font-size: var(--t3); margin-bottom: var(--s3); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--t3); }
.foot-grid a { color: var(--muted); }
.foot-grid a:hover { color: var(--acc); }
.foot-team { display: flex; gap: var(--s4); align-items: center; padding: var(--s4) 0; border-top: 1px solid var(--line); }
/* The viewing mode switch (visitor / investor): at the very right of the team row, desktop only. */
.foot-mode { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (max-width: 767px) { .d-only { display: none !important; } }
.foot-bottom { display: flex; gap: var(--s4); align-items: center; padding: var(--s4) 0; border-top: 1px solid var(--line); font-size: var(--t2); color: var(--faint); }
.foot-bottom a { color: var(--faint); }

/* ---------- Section headings ---------- */
.sec-h { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); }
.sec-h h2 { font-size: var(--t6); }
.sec-h .more { margin-left: auto; font-size: var(--t3); font-weight: 600; }
.band { border-top: 3px solid var(--red); padding-top: var(--s3); }
.band.orange { border-top-color: var(--acc2); }
.band.acc { border-top-color: var(--acc); }
.band-title { font: 700 var(--t3)/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; color: var(--red); margin-bottom: var(--s3); }
.band.orange .band-title { color: var(--acc2); }
.box-h { padding: 10px var(--s4); border-radius: var(--r2) var(--r2) 0 0; background: var(--acc2); color: #fff; font: 700 var(--t4)/1.2 var(--font-head); }
.box-h.red { background: var(--red); }
.box-h + .card { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }

/* ---------- Breadcrumbs, tabs, pager ---------- */
.crumbs { font-size: var(--t2); color: var(--faint); display: flex; gap: 6px; flex-wrap: wrap; padding: var(--s4) 0 var(--s2); }
.crumbs a { color: var(--muted); }
.crumbs > * + *::before { content: "›"; margin-right: 6px; color: var(--faint); }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); }
.tabs a {
  padding: 10px var(--s4); font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; gap: 8px; align-items: center;
}
.tabs a.on { color: var(--strong); border-bottom-color: var(--acc); }
.tabs .cnt { font-size: var(--t1); background: var(--surface-3); border-radius: var(--rp); padding: 1px 7px; color: var(--muted); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: var(--s6) 0; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--r1); display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: var(--t3);
}
.pager .on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.pager .gap { border: 0; background: none; color: var(--faint); }
.pager-note { text-align: center; font-size: var(--t2); color: var(--faint); margin-top: calc(-1 * var(--s4)); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t3); }
.tbl th { text-align: left; font: 700 11px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.kv { display: grid; grid-template-columns: 1fr 1fr; font-size: var(--t3); }
.kv > div { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-child(even) { color: var(--strong); font-weight: 600; }

/* ---------- Listing cards ---------- */
.lcard { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.lcard:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.lcard .media { position: relative; aspect-ratio: 4/3; border-radius: 0; }
.lcard .media .ph { position: absolute; inset: 0; border-radius: 0; }
.lcard .over { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; z-index: 2; }
.lcard .over-r { position: absolute; right: 10px; top: 10px; z-index: 2; }
.lcard .over-b { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; gap: 6px; }
.glass { background: hsl(0 0% 0% / .45); color: #fff; backdrop-filter: blur(4px); border-radius: var(--r1); padding: 3px 8px; font-size: var(--t1); font-weight: 600; }
.fav { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: hsl(0 0% 100% / .9); color: #e11d48; font-size: 15px; }
.lcard .body { padding: var(--s4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
/* The team's taskbar of a card (src/edge/estate-pages.ts cardTools): small square buttons along the lower edge of the
   photo, shown on hover (always on touch). A button opens its screen inside the card itself, in a frame of the card's
   size (app.js), so several cards can be edited or watched side by side; the bar then moves to the card's bottom. */
.lc-wrap { position: relative; display: flex; flex-direction: column; }
.lc-wrap > .lcard { flex: 1; }
.lc-wrap > .lcard:hover, .lc-wrap:hover > .lcard { transform: none; box-shadow: var(--shadow-pop); }
.lc-tools { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 4/3; z-index: 5; display: flex; align-items: flex-end; pointer-events: none;
  opacity: 0; transition: opacity .12s; }
.lc-wrap:hover .lc-tools, .lc-wrap:focus-within .lc-tools, .lc-wrap.open .lc-tools { opacity: 1; }
/* The bar is the card's own surface; its buttons share the width equally (one: the whole bar, centred). */
.lc-bar { pointer-events: auto; flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px;
  background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-2); }
/* Open, the bar is the card's bottom edge: nothing under it to keep apart. */
.lc-wrap.open .lc-bar { border-bottom: 0; }
.lc-btn { height: 30px; border-radius: 3px; display: grid; place-items: center; font-size: 15px; line-height: 1; color: var(--text);
  background: transparent; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.lc-btn:hover { background: var(--surface-2); }
.lc-btn.on { background: var(--surface-3); box-shadow: inset 0 -2px 0 var(--acc); }
.lc-btn:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.lc-wrap.open .lc-tools { top: auto; bottom: 0; aspect-ratio: auto; border-radius: 0 0 var(--r2) var(--r2); overflow: hidden; }
.lc-pane { position: absolute; inset: 0; z-index: 4; border: 1px solid var(--line-2); border-radius: var(--r2); overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow-pop); }
.lc-pane iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--surface); }
.lc-pane.busy iframe { opacity: .5; }
.lots-compact .lc-tools { aspect-ratio: 16/10; }
/* The team strip over /estate (src/edge/panel-estate-tiles.ts teamStrip). */
.tstrip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 16px; }
.tstrip .inp { width: 220px; height: 32px; }
.tstrip .kpi { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r1); font-size: 13px; color: var(--muted); }
.tstrip .kpi b { color: var(--strong); }
.team-only { font: 700 10px/1 var(--font-ui); letter-spacing: .05em; text-transform: uppercase; color: var(--warn); }
/* /estate/panel: objects as tiles (src/edge/panel-estate-tiles.ts), drafts dashed, the last tile makes a new one. */
.ptiles { gap: 16px; align-items: stretch; }
.ptile.draft { border-style: dashed; border-color: var(--line-2); }
.ptile .price { font: 800 18px/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.ptile-new { display: flex; min-height: 320px; }
.ptile-new .dz { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; font: inherit; font-size: 14px; color: var(--faint); border: 2px dashed var(--line-2); border-radius: var(--r2); background: var(--surface-2); cursor: pointer; padding: 12px; }
.ptile-new .dz:hover { border-color: var(--acc); color: var(--acc-strong); background: var(--acc-soft); }
.ptile-new b { font-size: 28px; line-height: 1; }
@media (hover: none) { .lc-tools { opacity: 1; } }
.price { font: 700 var(--t6)/1.1 var(--font-ui); color: var(--strong); }
.price small { font-size: var(--t2); font-weight: 600; color: var(--muted); }
.price .old { font-size: var(--t2); color: var(--faint); text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.price .disc { font-size: var(--t2); color: var(--bad); font-weight: 700; margin-left: 4px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: auto; }
.facts > div { padding: 8px 0; text-align: center; }
.facts > div + div { border-left: 1px solid var(--line); }
.facts b { display: block; font-size: var(--t3); color: var(--strong); }
.facts i { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.feat { display: flex; flex-wrap: wrap; gap: 4px; }
.feat span { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.avail { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t2); font-weight: 600; }
.avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.avail.free { color: var(--ok); } .avail.busy { color: var(--bad); } .avail.soon { color: var(--warn); }
.stars { color: #f59e0b; letter-spacing: 1px; font-size: var(--t2); }
.dots { display: flex; gap: 4px; justify-content: center; position: absolute; bottom: 8px; left: 0; right: 0; z-index: 2; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #fff8; }
.dots i.on { background: #fff; }
.swatches { display: flex; gap: 6px; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.swatches i.on { box-shadow: 0 0 0 2px var(--acc); }

/* Article card */
.acard { display: flex; flex-direction: column; overflow: hidden; border-top: 3px solid var(--acc2); }
.acard.red { border-top-color: var(--red); }
.acard .ph { border-radius: 0; aspect-ratio: 16/10; }
.acard .body { padding: var(--s4); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.acard h3 { font-size: var(--t5); }
.meta { display: flex; align-items: center; gap: 10px; font-size: var(--t1); color: var(--faint); flex-wrap: wrap; }
.meta .who { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }

/* ---------- Filters sidebar ---------- */
.filters { display: flex; flex-direction: column; gap: 0; }
/* One sticky column (article TOC + languages): siblings never slide under each other. */
.side-sticky { max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; overscroll-behavior: contain; }
.filters.sticky { max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; overscroll-behavior: contain; }
.facet { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.facet:first-child { padding-top: 0; }
.facet h4 { font: 700 var(--t3)/1.2 var(--font-ui); margin-bottom: var(--s2); display: flex; align-items: center; }
.facet h4 .clear { margin-left: auto; font-size: var(--t1); font-weight: 600; color: var(--faint); }
.facet .more { font-size: var(--t2); font-weight: 600; margin-top: 4px; display: inline-block; }
.hist { display: flex; align-items: flex-end; gap: 2px; height: 36px; margin-bottom: 6px; }
.hist i { flex: 1; background: var(--acc-soft); border-radius: 2px 2px 0 0; }
.hist i.in { background: color-mix(in srgb, var(--acc) 55%, transparent); }
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar .sel { width: auto; height: 34px; }
.size-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.size-grid span { height: 32px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r1); font-size: var(--t2); font-weight: 600; }
.size-grid span.on { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }
.size-grid span.off { color: var(--faint); text-decoration: line-through; background: var(--surface-2); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: var(--t2); }
.cal .dow { text-align: center; font-size: 11px; color: var(--faint); font-weight: 700; padding-bottom: 4px; }
.cal .d {
  height: 44px; border-radius: var(--r1); border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.cal .d small { font-size: 10px; color: var(--faint); }
.cal .d.busy { background: var(--bad-soft); color: var(--bad); border-color: transparent; text-decoration: line-through; }
.cal .d.block { background: var(--surface-3); color: var(--faint); }
/* The manager's calendar: colour by confirmation; click two days to pick a range. */
.cal .d.free { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.cal .d.wait { background: var(--warn-soft); color: var(--warn); border: 1px dashed var(--warn); }
.cal .d.ok { background: var(--bad); color: #fff; border-color: transparent; font-weight: 700; }
.cal .d.ical { background: #7c3aed; color: #fff; border-color: transparent; font-weight: 700; }
.cal .d.ok small, .cal .d.ical small { color: #fff; opacity: .85; }
[data-range-pick] .d:not(.out):not(.past) { cursor: pointer; }
[data-sortable] > [draggable] { cursor: grab; }
[data-sortable] > .drop-here { outline: 2px dashed var(--acc); outline-offset: 2px; }
.cal .d.sel { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.cal .d.sel small { color: var(--acc-ink); opacity: .8; }
.cal .d.range { background: var(--acc-soft); border-color: transparent; }
.cal .d.out { visibility: hidden; }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--acc2); }
.legend { display: flex; gap: var(--s4); font-size: var(--t1); color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

/* ---------- Activity heatmap (GitHub style) ---------- */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; }
.heat i { width: 11px; height: 11px; border-radius: 2px; background: var(--surface-3); }
.heat i.l1 { background: color-mix(in srgb, var(--acc) 25%, var(--surface-3)); }
.heat i.l2 { background: color-mix(in srgb, var(--acc) 50%, var(--surface-3)); }
.heat i.l3 { background: color-mix(in srgb, var(--acc) 75%, var(--surface-3)); }
.heat i.l4 { background: var(--acc); }

/* ---------- Forum ---------- */
.f-ico { width: 34px; height: 34px; border-radius: var(--r1); display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); font-size: 16px; flex: none; }
.f-ico.new { background: var(--acc); color: var(--acc-ink); }
.f-ico.lock { background: var(--surface-3); color: var(--faint); }
.f-ico.staff { background: var(--warn-soft); color: var(--warn); }
.f-title { font-weight: 700; color: var(--strong); font-size: var(--t4); }
.f-desc { font-size: var(--t2); color: var(--muted); }
.f-subs { font-size: var(--t2); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.f-subs a::before { content: "▸ "; color: var(--faint); }
.f-last { font-size: var(--t2); line-height: 1.35; }
.f-last a { font-weight: 600; }
.cat-row td { background: var(--surface-2) !important; font: 700 var(--t3)/1 var(--font-head); color: var(--strong); padding: 12px; }
.prefix { font: 700 11px/1 var(--font-ui); padding: 3px 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.prefix.q { background: var(--acc-soft); color: var(--acc-strong); }
.prefix.ok { background: var(--ok-soft); color: var(--ok); }
.prefix.sell { background: var(--acc2-soft); color: var(--acc2); }
.prefix.news { background: var(--red-soft); color: var(--red); }
.boards-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s3); }
.board-tile { padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.board-tile .code { font: 700 var(--t6)/1 var(--font-mono); color: var(--acc); }
.board-tile:hover { border-color: var(--acc); }
.post { display: grid; grid-template-columns: 200px 1fr; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); overflow: hidden; }
.post .who { padding: var(--s4); background: var(--surface-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: var(--t2); }
.post .msg { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.post .msg-h { display: flex; font-size: var(--t2); color: var(--faint); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.quote { border-left: 3px solid var(--acc); background: var(--surface-2); padding: 8px 12px; border-radius: 0 var(--r1) var(--r1) 0; font-size: var(--t3); }
.quote .src { font-size: var(--t1); color: var(--faint); margin-bottom: 4px; }
.code { font: 400 var(--t2)/1.6 var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r1); padding: 10px 12px; white-space: pre; overflow: auto; }
.best { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }

/* Imageboard */
.ib { font-size: var(--t3); }
.ib-op, .ib-reply { padding: var(--s3) var(--s4); border-radius: var(--r1); }
.ib-op { display: flex; gap: var(--s4); }
.ib-reply { background: var(--surface); border: 1px solid var(--line); display: inline-flex; gap: var(--s3); max-width: 100%; margin: 4px 0 4px var(--s5); }
.ib-h { font-size: var(--t2); color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ib-h .anon { color: var(--ok); font-weight: 700; }
.ib-h .anon-id { font-size: var(--t1); color: var(--muted); }
.ib-h .anon-who { font-size: var(--t1); font-weight: 600; }
.ib-h .no { color: var(--acc); cursor: pointer; }
.ib-h .op { color: var(--red); font-weight: 700; }
.ib .thumb { width: 160px; height: 120px; flex: none; }
.ib .thumb.sm { width: 110px; height: 82px; }
.green { color: var(--green-text); }
.reflink { color: var(--acc); font-weight: 600; }
.backlinks { font-size: var(--t1); color: var(--faint); margin-top: 6px; }
.ttl { display: inline-flex; gap: 6px; align-items: center; font-size: var(--t1); font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: var(--rp); }

/* ---------- Panel ---------- */
.panel { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--header-h)); }
.panel-nav { background: var(--surface); border-right: 1px solid var(--line); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: 2px; }
.panel-nav .eyebrow { padding: var(--s4) var(--s3) 6px; }
.panel-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r1); color: var(--text); font-size: var(--t3); font-weight: 600; }
.panel-nav a:hover { background: var(--surface-2); }
.panel-nav a.on { background: var(--acc-soft); color: var(--acc-strong); }
.panel-nav a .cnt { margin-left: auto; font-size: 11px; background: var(--red); color: #fff; border-radius: var(--rp); padding: 1px 7px; }
.panel-main { padding: var(--s6) var(--s7); min-width: 0; }
/* The /panel menu (src/edge/panel-nav.ts): the site on top, icons in one column, section panels marked as links out. */
.panel-nav .pn-head { display: flex; align-items: center; gap: 10px; padding: 4px 12px 10px; }
.panel-nav .pn-ico { width: 20px; text-align: center; flex: none; }
.panel-nav .pn-out { margin-left: auto; color: var(--faint); font-weight: 400; }
.panel-nav .cnt + .pn-out { margin-left: 6px; }
@media (max-width: 900px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .panel-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 4px; }
  .panel-nav .eyebrow, .panel-nav .pn-head, .panel-nav > .row:first-child { display: none; }
  .panel-nav a { flex: none; }
  .panel-main { padding: var(--s5) 16px; }
}
.blk {
  display: grid; grid-template-columns: 28px 44px 1fr auto; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2);
}
.blk + .blk { margin-top: 8px; }
.blk .grip { cursor: grab; color: var(--faint); font-size: 18px; text-align: center; letter-spacing: -2px; }
.blk.drag { border: 2px dashed var(--acc); background: var(--acc-soft); opacity: .9; transform: rotate(-.5deg); box-shadow: var(--shadow-pop); }
.blk.off { opacity: .55; }
.blk .bico { width: 44px; height: 44px; border-radius: var(--r1); display: grid; place-items: center; background: var(--surface-2); font-size: 20px; }
.drop-line { height: 4px; border-radius: 2px; background: var(--acc); margin: 6px 0; }
.mini-page { border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg); padding: 10px; display: grid; gap: 6px; }
.mini-page i { display: block; border-radius: 4px; background: var(--surface-3); }
.stat { padding: var(--s4); }
.stat .v { font: 700 var(--t7)/1.1 var(--font-ui); color: var(--strong); font-variant-numeric: tabular-nums; }
.stat .l { font-size: var(--t2); color: var(--muted); }
.stat .d { font-size: var(--t1); font-weight: 700; }
.up { color: var(--ok); } .down { color: var(--bad); }
.vbars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.vbars i { flex: 1; min-height: 2px; background: var(--acc); border-radius: 2px 2px 0 0; opacity: .85; }
.vbars i:hover { opacity: 1; }
/* Three kinds of traffic stacked (src/edge/panel-visits.ts): real, local development, virtual users. */
.vbars.stacked .vcol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.vbars.stacked .vcol i { flex: none; min-height: 0; border-radius: 0; }
.vbars.stacked .vcol i:first-child { border-radius: 2px 2px 0 0; }
.vbars.stacked .vcol .k-real { min-height: 2px; }
.vbars .k-real, .vlegend .k-real { background: var(--acc); }
.vbars .k-dev, .vlegend .k-dev { background: var(--faint); }
.vbars .k-virt, .vlegend .k-virt { background: var(--warn); }
.vbars .k-nojs, .vlegend .k-nojs { background: var(--acc); opacity: .35; }
.vtoggle { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: var(--rp, 999px); overflow: hidden; }
.vtoggle button { all: unset; cursor: pointer; padding: 3px 10px; font-size: var(--t1, 12px); color: var(--muted); }
.vtoggle button.on { background: var(--acc); color: #fff; }
.vlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.vlegend span { display: inline-flex; align-items: center; gap: 6px; }
.vlegend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.bar { height: 8px; border-radius: var(--rp); background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); border-radius: var(--rp); }


/* ---------- Appearance switcher: theme button widens into style and palette ---------- */
.look { position: relative; width: 36px; height: 36px; flex: none; }
.look-inner {
  position: absolute; right: 0; top: 0; z-index: 55; height: 36px;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 10px;
  border-radius: var(--r1); transition: background .15s, box-shadow .15s, padding .15s;
}
.look-theme { flex: none; font-size: 16px; }
.look-more {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  max-width: 0; overflow: hidden; opacity: 0; transition: max-width .25s ease, opacity .15s ease;
}
.look:hover .look-inner, .look:focus-within .look-inner {
  background: var(--surface); box-shadow: var(--shadow-pop); outline: 1px solid var(--line-2); padding-left: 10px;
}
.look:hover .look-more, .look:focus-within .look-more { max-width: 560px; opacity: 1; }
.look-style button { padding: 7px 10px; font: 600 12px/1 var(--font-ui); }
.look-pal { display: flex; gap: 8px; padding: 6px 4px; }
.pal {
  all: unset; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; flex: none; position: relative; overflow: hidden;
  background: var(--a); box-shadow: 0 0 0 1px var(--line-2); transition: transform .12s;
}
.pal::after { content: ""; position: absolute; inset: 0 0 0 50%; background: var(--b); }
.pal:hover { transform: scale(1.15); }
.pal.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--strong); }
.pal:focus-visible, .look-style button:focus-visible, .look-theme:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---------- Article bodies (compiled Markdown) and the editor preview ---------- */
.prose { font-size: 17px; line-height: 1.7; color: var(--text); max-width: 760px; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 24px; margin-top: 1.6em; scroll-margin-top: 80px; }
.prose h3 { font-size: 19px; margin-top: 1.3em; scroll-margin-top: 80px; }
.prose h4 { font-size: 17px; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: .25em; }
.prose li.task { list-style: none; margin-left: -1.3em; }
.prose blockquote { border-left: 3px solid var(--acc); padding: 4px 0 4px 16px; color: var(--muted); margin-left: 0; margin-right: 0; }
.prose a { text-decoration: underline; }
.prose code { font: 400 .88em/1.4 var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.prose pre.code-block { font: 400 13px/1.6 var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r1); padding: 12px 14px; overflow: auto; }
.prose pre.code-block code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose pre.mermaid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); padding: 12px; text-align: center; overflow: auto; font: 400 12px/1.4 var(--font-mono); color: var(--muted); }
.prose pre.mermaid[data-processed] { color: inherit; font: inherit; }
.prose .tbl-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; font-size: 15px; min-width: 50%; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: 6px 10px; }
.prose th { background: var(--surface-2); color: var(--strong); }
.prose img { height: auto; border-radius: var(--r1); }
.prose hr { margin: 1.6em 0; }

/* Article editor: Markdown on the left, server-compiled preview on the right */
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); align-items: stretch; }
.md-split textarea { min-height: 420px; font: 400 14px/1.6 var(--font-mono); }
.md-preview { border: 1px dashed var(--line-2); border-radius: var(--r1); padding: var(--s3) var(--s4); min-height: 420px; max-height: 70vh; overflow: auto; font-size: 15px; max-width: none; }
.md-preview:empty::before { content: attr(data-empty); color: var(--faint); font-size: var(--t2); }
.img-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.img-tile { display: flex; flex-direction: column; gap: 6px; }
.img-tile .thumb { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--r1); background: var(--surface-2); }
.img-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Profile ---------- */
.profile-cover { height: 170px; border-radius: 0 0 var(--r3) var(--r3); }
.profile-head { display: flex; gap: 24px; align-items: flex-end; margin-top: -56px; padding: 0 24px; position: relative; }

/* ---------- Style: strict (flat, square, no shadows, UI font for headings) ---------- */
:root[data-style="strict"] {
  --r1: 2px; --r2: 3px; --r3: 4px; --rp: 3px;
  --font-head: var(--font-ui);
  --shadow: none;
  --shadow-pop: 0 6px 18px hsl(var(--hue) 20% 10% / .18);
}
:root[data-style="strict"] h1, :root[data-style="strict"] h2, :root[data-style="strict"] h3 { letter-spacing: 0; font-weight: 700; }
:root[data-style="strict"] .card { border-color: var(--line-2); }
:root[data-style="strict"] .lcard:hover, :root[data-style="strict"] .lc-wrap:hover > .lcard { transform: none; box-shadow: 0 0 0 1px var(--acc); }
:root[data-style="strict"] .site-header { backdrop-filter: none; background: var(--surface); border-bottom: 2px solid var(--strong); }
:root[data-style="strict"] .main-nav a.on { background: none; box-shadow: inset 0 -2px 0 var(--acc); border-radius: 0; }
:root[data-style="strict"] .tag, :root[data-style="strict"] .plate { letter-spacing: .02em; }

/* ---------- Style: retro (early-2000s: bevels, Tahoma, solid colours; no gradients) ---------- */
:root[data-style="retro"] {
  --r1: 3px; --r2: 4px; --r3: 6px; --rp: 4px;
  --font-ui: Tahoma, Verdana, "Segoe UI", "Noto Sans Georgian", sans-serif;
  --font-head: "Trebuchet MS", Tahoma, "Noto Sans Georgian", sans-serif;
  --shadow: 2px 2px 0 hsl(var(--nh) 30% 20% / .14);
  --bevel: inset 1px 1px 0 #ffffffb0, inset -1px -1px 0 #0000002e;
}
:root[data-style="retro"] .site-header {
  background: hsl(var(--hue) 62% 40%); border-bottom: 3px solid hsl(var(--hue) 70% 26%); backdrop-filter: none;
  box-shadow: inset 0 1px 0 #ffffff40;
}
:root[data-style="retro"] .site-header .main-nav a,
:root[data-style="retro"] .site-header .logo .sub { color: #fff; text-shadow: 1px 1px 0 #0004; }
:root[data-style="retro"] .site-header .logo .dom { color: var(--acc-strong); }
:root[data-style="retro"] .site-header .main-nav a:hover,
:root[data-style="retro"] .site-header .main-nav a.on { background: #ffffff2e; color: #fff; box-shadow: inset 0 0 0 1px #ffffff55; }
:root[data-style="retro"] .site-header .logo .word { background: #fff; border-radius: 4px; padding: 0 6px 2px; box-shadow: inset 0 -2px 0 #0002; }
:root[data-style="retro"] .site-header .lang-btn,
:root[data-style="retro"] .site-header .icon-btn { color: #fff; border-color: #ffffff77; background: #ffffff1f; }
:root[data-style="retro"] .look:hover .look-theme, :root[data-style="retro"] .look:focus-within .look-theme { color: var(--text); border-color: var(--line-2); background: var(--surface); }
:root[data-style="retro"] .btn {
  background: hsl(var(--nh) 10% 93%); color: #1b1b1b;
  border: 1px solid hsl(var(--nh) 20% 42%); box-shadow: var(--bevel), 1px 1px 0 #0001;
}
:root[data-style="retro"] .btn:hover { background: hsl(45 95% 88%); border-color: hsl(38 90% 40%); color: #1b1b1b; }
:root[data-style="retro"] .btn:active { box-shadow: inset 1px 1px 0 #0000003a, inset -1px -1px 0 #ffffff80; }
:root[data-style="retro"] .btn.acc { background: hsl(var(--hue2) 85% 46%); border-color: hsl(var(--hue2) 80% 28%); color: #fff; text-shadow: 1px 1px 0 #0004; }
:root[data-style="retro"] .card { border: 1px solid hsl(var(--nh) 30% 70%); box-shadow: var(--shadow); }
:root[data-style="retro"] .sec-h h2, :root[data-style="retro"] h3 { color: hsl(var(--hue) 62% 32%); }
:root[data-style="retro"] .tabs a.on { background: var(--surface); border: 1px solid var(--line-2); border-bottom-color: var(--surface); border-radius: 4px 4px 0 0; }
:root[data-style="retro"] .inp { border-color: hsl(var(--nh) 20% 58%); box-shadow: inset 1px 1px 2px #0002; border-radius: 2px; }
/* The steps of contact are square bevelled boxes in the retro style. */
:root[data-style="retro"] .lot-step::before { border-radius: 2px; box-shadow: var(--bevel); }
:root[data-style="retro"] .lot-step.now::before { box-shadow: var(--bevel), 0 0 0 3px var(--acc-soft); }
:root[data-style="retro"] .plate { background: var(--acc-soft); border-color: hsl(var(--hue) 40% 70%); box-shadow: var(--bevel); }
:root[data-style="retro"][data-theme="dark"] { --bevel: inset 1px 1px 0 #ffffff24, inset -1px -1px 0 #00000060; }
:root[data-style="retro"][data-theme="dark"] .card { border-color: hsl(var(--nh) 20% 28%); }
:root[data-style="retro"][data-theme="dark"] .sec-h h2, :root[data-style="retro"][data-theme="dark"] h3 { color: hsl(var(--hue) 70% 72%); }
:root[data-style="retro"][data-theme="dark"] .btn { background: #3a3e46; color: #eee; border-color: #111; }
:root[data-style="retro"][data-theme="dark"] .btn.acc { background: hsl(var(--hue2) 70% 42%); color: #fff; }

/* ---------- Style: soft (default: rounder, airier, borderless cards resting on hairlines) ---------- */
:root[data-style="soft"] { --r1: 10px; --r2: 16px; --r3: 24px; }
:root[data-style="soft"] .card { border-color: transparent; box-shadow: 0 0 0 1px var(--line), 0 1px 2px hsl(var(--nh) 30% 20% / .04); }
:root[data-style="soft"] .card.shadow, :root[data-style="soft"] .lcard:hover, :root[data-style="soft"] .lc-wrap:hover > .lcard { box-shadow: 0 0 0 1px var(--line), var(--shadow-pop); }
:root[data-style="soft"] .btn { border-radius: var(--rp); padding: 0 var(--s5); }
:root[data-style="soft"] .btn.sm { padding: 0 var(--s4); }
:root[data-style="soft"] .btn:not(.acc):not(.ghost):not(.acc2) { background: var(--surface-2); border-color: transparent; }
:root[data-style="soft"] .btn:not(.acc):not(.ghost):not(.acc2):hover { background: var(--acc-soft); color: var(--acc-strong); }
:root[data-style="soft"] .inp, :root[data-style="soft"] .sel { border-color: transparent; background: var(--surface-2); }
:root[data-style="soft"] .inp:focus, :root[data-style="soft"] .sel:focus { background: var(--surface); border-color: var(--acc); }
:root[data-style="soft"] .site-header { border-bottom-color: transparent; box-shadow: 0 1px 0 var(--line); }
:root[data-style="soft"] .main-nav a { border-radius: var(--rp); padding: 8px 14px; }
:root[data-style="soft"] .tag { border-radius: var(--rp); padding: 0 10px; }
:root[data-style="soft"] .acard { border-top: 0; box-shadow: 0 0 0 1px var(--line), inset 0 3px 0 var(--acc2); }
:root[data-style="soft"] .acard.red { box-shadow: 0 0 0 1px var(--line), inset 0 3px 0 var(--red); }
:root[data-style="soft"] .tbl th { background: transparent; }
:root[data-style="soft"] .pop { border-color: transparent; box-shadow: 0 0 0 1px var(--line), var(--shadow-pop); }
:root[data-style="soft"] .seg { border-color: transparent; background: var(--surface-2); padding: 2px; border-radius: var(--rp); }
:root[data-style="soft"] .seg a, :root[data-style="soft"] .seg button { border-radius: var(--rp); }
:root[data-style="soft"] .seg a + a, :root[data-style="soft"] .seg button + button { border-left: 0; }
:root[data-style="soft"] .panel-nav a { border-radius: var(--rp); }

/* ---------- Account menu (built by app.js after /-/api/me) ---------- */
.user-menu > summary { cursor: pointer; list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu .pop { width: 220px; padding: 6px; display: flex; flex-direction: column; }
.user-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu .pop a, .user-menu .pop button {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer; padding: 8px 10px; border-radius: var(--r1);
  font: 600 var(--t3)/1.2 var(--font-ui); color: var(--text);
}
.user-menu .pop a:hover, .user-menu .pop button:hover { background: var(--surface-2); color: var(--strong); }
.user-menu .pop form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.panel-nav a { white-space: nowrap; }
.user-menu .pop { width: 320px; }
.user-menu-notes { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding: 4px 0 6px; margin-bottom: 4px; max-height: 360px; overflow: auto; }
.user-menu-notes .row { padding: 6px 10px; }
.user-menu-notes button { all: unset; cursor: pointer; color: var(--acc); font-weight: 600; }
.user-menu .pop .user-menu-notes a { display: flex; flex-direction: column; gap: 2px; font-weight: 400; font-size: var(--t2); }
.user-menu .pop .user-menu-notes a.unread { font-weight: 600; color: var(--strong); }
.user-menu .pop .user-menu-notes a.unread { box-shadow: inset 3px 0 0 var(--red); }
.user-menu-notes .ng { display: flex; flex-direction: column; padding: 2px 0 4px; }
.user-menu-notes .ng + .ng { border-top: 1px dashed var(--line); }
.user-menu-notes .ng-h { padding: 6px 10px 2px; font-size: var(--t1, 12px); color: var(--muted, inherit); }
.user-menu-notes .ng.unread .ng-h { color: var(--strong); font-weight: 600; }
.user-menu .pop .user-menu-notes a.ng-all { color: var(--acc); font-weight: 600; }
.user-menu-notes .ng-empty { padding: 6px 10px; }
.user-menu > summary { position: relative; }
.user-menu > summary .dot { position: absolute; top: -6px; right: -8px; transform: rotate(12deg); box-shadow: 0 0 0 2px var(--surface); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--rp); background: var(--red); color: #fff; font: 700 10px/18px var(--font-ui); text-align: center; }

/* Management screens over a section (#list, #edit~5): see public/app.js "UI sheet". */
.ui-sheet{position:fixed;inset:0;z-index:60;display:flex;justify-content:flex-end;background:hsl(var(--nh) 20% 10% / .35)}
.ui-sheet[hidden]{display:none}
.ui-sheet-box{width:min(1100px,100%);height:100%;overflow:auto;background:var(--bg);box-shadow:var(--shadow-pop);display:flex;flex-direction:column}
.ui-sheet-bar{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:10px;padding:10px 20px;background:var(--surface);border-bottom:1px solid var(--line)}
.ui-sheet-body{padding:20px 24px 40px;flex:1}
.ui-sheet-body.busy{opacity:.5;pointer-events:none}
html.ui-open{overflow:hidden}

/* Badges [badge:Label:Value:color], spoilers [spoiler]…[/spoiler] (articles, resumes, notes). */
.badge { display: inline-flex; border-radius: 4px; overflow: hidden; font: 600 12px/1 var(--font-mono); vertical-align: middle; margin: 0 2px; }
.badge > span { padding: 4px 7px; }
.badge > span:first-child { background: var(--surface-3, #555); color: var(--text); }
.badge .b-blue { background: #2f6fd6; color: #fff; }
.badge .b-green { background: #2e9d5b; color: #fff; }
.badge .b-red { background: #c8413b; color: #fff; }
.badge .b-orange { background: #d9771f; color: #fff; }
.badge .b-gray { background: #6b7280; color: #fff; }
.badge .b-purple { background: #7a4fd6; color: #fff; }
.badge .b-yellow { background: #d9a400; color: #222; }
.prose .spoiler, .cv-body .spoiler, .md-out .spoiler { background: var(--strong); color: var(--strong); border-radius: 3px; padding: 0 2px; cursor: pointer; }
.prose .spoiler:hover, .prose .spoiler:focus, .cv-body .spoiler:hover, .cv-body .spoiler:focus, .md-out .spoiler:hover, .md-out .spoiler:focus { color: var(--surface); }

/* Code highlighting (vendor/prism.min.js): one token palette per theme. */
:root { --tk-com: #6a737d; --tk-kw: #c0336b; --tk-str: #1a7f37; --tk-num: #b35900; --tk-fn: #6f42c1; --tk-type: #005cc5; --tk-op: #57606a; }
:root[data-theme="dark"] { --tk-com: #8b949e; --tk-kw: #ff7b9c; --tk-str: #7ee787; --tk-num: #ffa657; --tk-fn: #d2a8ff; --tk-type: #79c0ff; --tk-op: #b1bac4; }
.token.comment, .token.prolog, .token.doctype { color: var(--tk-com); font-style: italic; }
.token.keyword, .token.boolean, .token.important, .token.directive { color: var(--tk-kw); }
.token.string, .token.char, .token.template-string, .token.regex { color: var(--tk-str); }
.token.number, .token.constant, .token.symbol { color: var(--tk-num); }
.token.function, .token.method { color: var(--tk-fn); }
.token.class-name, .token.builtin, .token.type, .token.namespace { color: var(--tk-type); }
.token.operator, .token.punctuation { color: var(--tk-op); }

/* Markdown editor: the source textarea over a highlighted copy (fenced code is colored in place). */
.md-ed { position: relative; font: 14px/1.55 var(--font-mono); }
.md-ed textarea, .md-ed pre { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r2); white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; tab-size: 2; min-height: 420px; box-sizing: border-box; width: 100%; }
.md-ed pre { position: absolute; inset: 0; pointer-events: none; overflow: hidden; background: var(--surface); color: var(--text); }
.md-ed textarea { position: relative; background: transparent; color: transparent; caret-color: var(--text); resize: vertical; }
.md-ed textarea::selection { background: color-mix(in srgb, var(--acc) 30%, transparent); color: transparent; }
.md-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.md-bar button { min-width: 32px; }
.md-out { border: 1px solid var(--line); border-radius: var(--r2); padding: 12px 16px; min-height: 420px; background: var(--surface); }
.md-modes { display: none; }
@media (max-width: 900px) {
  .md-split { grid-template-columns: 1fr; }
  .md-modes { display: inline-flex; }
  [data-md-wrapper][data-mode="md"] .md-out { display: none; }
  [data-md-wrapper][data-mode="preview"] .md-ed { display: none; }
}
.heat i.l5 { background: color-mix(in srgb, var(--acc) 65%, var(--strong)); }
/* Home hero: a background picture under the text, the whole block may be a link. */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg picture, .hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: #0006; }
a.hero-link { color: inherit; text-decoration: none; }
a.hero-link:hover .hero-bg::after { background: #0004; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* README look for resumes (src/shared/readme.ts): markdown/gfm.css and highlight colours of the in-html repository (MIT). */
/* markdown/gfm.css - README files as GitHub shows them (and Codeberg with .md-codeberg), light and dark, for the
   output of markdown/gfm.js inside .md-body. Dark follows the system or [data-theme="dark"] on <html>. Code colours
   (.hl-*) and math come from highlight/ and math/.

   CONTRACT
   - Scope: every rule is under .md-body (0,1,0 + element). The rendered HTML uses bare elements (p, table, code) as
     Markdown produces them, so the scope class is the only thing keeping this sheet from restyling the host page.
     Class names follow GitHub's own markup (markdown-alert, task-list-item, footnotes) so pasted GitHub HTML matches.
   - Tokens: colours are --md-* / --hl-* custom properties defined on .md-body and redefined for dark. Values are
     GitHub's Primer palette, copied so a README looks the same as on github.com.
   - Dark mode, three states: system dark (media query) unless the page forces light ([data-theme="light"]), or forced
     dark ([data-theme="dark"]). The block is duplicated (media + attribute) because a media query cannot be combined
     with a selector by OR; :root:not([data-theme="light"]) makes an explicit light choice beat the system setting.
   - !important only where GitHub's own sheet relies on it (first / last child margins, collapsed details): those must
     beat any element margin rule regardless of specificity.
   - Font sizes in em (headings, code at 85%) so the whole body scales from one font-size (Codeberg variant). */

.md-body {
  --md-fg: #1f2328; --md-muted: #59636e; --md-border: #d1d9e0; --md-border-muted: #d1d9e0b3; --md-canvas: #ffffff;
  --md-subtle: #f6f8fa; --md-code: #818b981f; --md-link: #0969da; --md-mark: #fff8c5;
  --md-note: #0969da; --md-tip: #1a7f37; --md-important: #8250df; --md-warning: #9a6700; --md-caution: #d1242f;
  --md-kbd: #f6f8fa; --md-kbd-border: #d1d9e0;
  color: var(--md-fg); background: var(--md-canvas); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  word-wrap: break-word; overflow-wrap: break-word;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .md-body {
    --md-fg: #f0f6fc; --md-muted: #9198a1; --md-border: #3d444d; --md-border-muted: #3d444db3; --md-canvas: #0d1117;
    --md-subtle: #151b23; --md-code: #656c7633; --md-link: #4493f8; --md-mark: #bb800926;
    --md-note: #4493f8; --md-tip: #3fb950; --md-important: #ab7df8; --md-warning: #d29922; --md-caution: #f85149;
    --md-kbd: #151b23; --md-kbd-border: #3d444d;
  }
}
:root[data-theme="dark"] .md-body {
  --md-fg: #f0f6fc; --md-muted: #9198a1; --md-border: #3d444d; --md-border-muted: #3d444db3; --md-canvas: #0d1117;
  --md-subtle: #151b23; --md-code: #656c7633; --md-link: #4493f8; --md-mark: #bb800926;
  --md-note: #4493f8; --md-tip: #3fb950; --md-important: #ab7df8; --md-warning: #d29922; --md-caution: #f85149;
  --md-kbd: #151b23; --md-kbd-border: #3d444d;
}
/* Outer margins collapse into the container's padding otherwise: the first heading's 24px top margin would push the
   README down. (0,2,0) already beats the heading rules (0,1,1); !important also beats later rules of equal
   specificity such as the :is(..., .md-math-block) margin rule (0,2,0). */
.md-body > :first-child { margin-top: 0 !important; }
.md-body > :last-child { margin-bottom: 0 !important; }
/* One vertical rhythm: bottom margins only (no top), so adjacent blocks never double up via margin collapse rules.
   :is() keeps specificity at its most specific argument (a class, 0,2,0 for .md-math-block) - acceptable here. */
.md-body :is(p, blockquote, ul, ol, dl, table, pre, details, .md-math-block, .md-diagram, .markdown-alert) { margin: 0 0 16px; }
.md-body a { color: var(--md-link); text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body :is(h1, h2, h3, h4, h5, h6) { margin: 24px 0 16px; font-weight: 600; line-height: 1.25; }
.md-body h1 { font-size: 2em; padding-bottom: .3em; border-bottom: 1px solid var(--md-border-muted); }
.md-body h2 { font-size: 1.5em; padding-bottom: .3em; border-bottom: 1px solid var(--md-border-muted); }
.md-body h3 { font-size: 1.25em; }
.md-body h4 { font-size: 1em; }
.md-body h5 { font-size: .875em; }
.md-body h6 { font-size: .85em; color: var(--md-muted); }
/* hr as a filled bar (height + background, border 0): consistent thickness across browsers, which draw hr borders
   with inset 3D styles by default. */
.md-body hr { height: .25em; margin: 24px 0; padding: 0; border: 0; background: var(--md-border); }
.md-body blockquote { padding: 0 1em; color: var(--md-muted); border-left: .25em solid var(--md-border); }
.md-body :is(ul, ol) { padding-left: 2em; }
/* Nested ordered lists switch numbering style so levels are distinguishable (GitHub behaviour). */
.md-body ol ol, .md-body ul ol { list-style-type: lower-roman; }
.md-body li + li { margin-top: .25em; }
.md-body li > :is(ul, ol) { margin: 0; }
/* Task lists: bullets removed; the checkbox is pulled into the freed gutter with a negative left margin equal to the
   list padding, so checkbox and text align with ordinary list text. */
.md-body .contains-task-list { padding-left: 1.4em; list-style: none; }
.md-body .task-list-item { position: relative; }
.md-body .md-task { margin: 0 .2em .25em -1.4em; vertical-align: middle; }
/* Images never overflow the column; content-box so padding (align=left/right gutters) is added outside max-width. */
.md-body img { max-width: 100%; box-sizing: content-box; background: transparent; }
.md-body img[align=right] { padding-left: 20px; }
.md-body img[align=left] { padding-right: 20px; }
.md-body code, .md-body tt { padding: .2em .4em; margin: 0; font: 85%/1.45 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; white-space: break-spaces; background: var(--md-code); border-radius: 6px; }
/* Block code scrolls horizontally instead of wrapping (white-space: pre below): wrapped code changes meaning in
   whitespace-sensitive languages. Inline code uses break-spaces so long identifiers can wrap in prose. */
.md-body pre { padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background: var(--md-subtle); border-radius: 6px; }
.md-body pre code { padding: 0; font-size: 100%; white-space: pre; background: transparent; border: 0; word-break: normal; }
.md-body kbd { display: inline-block; padding: 3px 5px; font: 11px/10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--md-fg); vertical-align: middle; background: var(--md-kbd); border: 1px solid var(--md-kbd-border); border-bottom-color: var(--md-kbd-border); border-radius: 6px; box-shadow: inset 0 -1px 0 var(--md-kbd-border); }
.md-body mark { background: var(--md-mark); color: inherit; }
/* display:block + overflow:auto on the table itself: a wide table scrolls inside the column instead of widening the
   page; width:max-content keeps narrow tables narrow. Cost: table semantics for layout are lost (the browser builds an
   anonymous table box inside), which is why GitHub uses the same trick. */
.md-body table { display: block; width: max-content; max-width: 100%; overflow: auto; border-spacing: 0; border-collapse: collapse; font-variant: tabular-nums; }
.md-body :is(td, th) { padding: 6px 13px; border: 1px solid var(--md-border); }
.md-body th { font-weight: 600; }
.md-body tr { background: var(--md-canvas); border-top: 1px solid var(--md-border-muted); }
.md-body tr:nth-child(2n) { background: var(--md-subtle); }
.md-body details summary { cursor: pointer; }
/* Collapsed details: browsers hide non-summary children natively, but a display rule on a child (e.g. a block math
   container set to display:block) would override that; !important restores the native behaviour. */
.md-body details:not([open]) > :not(summary) { display: none !important; }
.md-body sup > a.md-fnref::before { content: "["; } .md-body sup > a.md-fnref::after { content: "]"; }
.md-body .footnotes { font-size: 12px; color: var(--md-muted); border-top: 1px solid var(--md-border); padding-top: 8px; margin-top: 32px; }
.md-body .footnotes ol { padding-left: 16px; }
/* Visually hidden but read by screen readers (footnote labels). clip, not display:none, which removes it from the
   accessibility tree. */
.md-body .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.md-body .markdown-alert { padding: .5rem 1rem; color: inherit; border-left: .25em solid var(--md-border); }
.md-body .markdown-alert > :last-child { margin-bottom: 0; }
.md-body .markdown-alert-title { display: flex; align-items: center; gap: 8px; font-weight: 500; line-height: 1; }
.md-body .markdown-alert-note { border-left-color: var(--md-note); } .md-body .markdown-alert-note .markdown-alert-title { color: var(--md-note); }
.md-body .markdown-alert-tip { border-left-color: var(--md-tip); } .md-body .markdown-alert-tip .markdown-alert-title { color: var(--md-tip); }
.md-body .markdown-alert-important { border-left-color: var(--md-important); } .md-body .markdown-alert-important .markdown-alert-title { color: var(--md-important); }
.md-body .markdown-alert-warning { border-left-color: var(--md-warning); } .md-body .markdown-alert-warning .markdown-alert-title { color: var(--md-warning); }
.md-body .markdown-alert-caution { border-left-color: var(--md-caution); } .md-body .markdown-alert-caution .markdown-alert-title { color: var(--md-caution); }
.md-body .md-math-block { overflow-x: auto; overflow-y: hidden; }
/* "display: block math" is the MathML Core two-value display (block outer, math inner); engines without it ignore
   the declaration and keep their default. */
.md-body .md-math-block math { display: block math; margin: 0; }
.md-body .md-math-display math { display: block math; }
.md-body .md-diagram { text-align: center; overflow-x: auto; }
.md-body .md-diagram svg { max-width: 100%; height: auto; }
.md-body .md-emoji { font-style: normal; }

/* Codeberg (Forgejo): a little denser, softer links, framed code. */
.md-body.md-codeberg { font-size: 14px; line-height: 1.6; --md-link: #2185d0; }
:root[data-theme="dark"] .md-body.md-codeberg { --md-link: #6aa5e8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .md-body.md-codeberg { --md-link: #6aa5e8; } }
.md-body.md-codeberg :is(h1, h2) { border-bottom-width: 1px; }
.md-body.md-codeberg :is(pre, code) { border-radius: 4px; }
.md-body.md-codeberg pre { border: 1px solid var(--md-border); }
.md-body.md-codeberg th { background: var(--md-subtle); }
.md-body.md-codeberg table { width: auto; }

/* Code colours like GitHub's (highlight/ spans). Token letters are highlight/'s classes (k keyword, s string,
   c comment, n number, f function ...); scoped to pre so inline code stays monochrome as on GitHub. */
.md-body { --hl-k: #cf222e; --hl-s: #0a3069; --hl-c: #59636e; --hl-n: #0550ae; --hl-f: #8250df; --hl-t: #116329; --hl-a: #0550ae; --hl-p: #0550ae; --hl-b: #953800; --hl-v: #953800; --hl-h: #0550ae; --hl-i: #116329; --hl-ib: #dafbe1; --hl-d: #82071e; --hl-db: #ffebe9; }
:root[data-theme="dark"] .md-body { --hl-k: #ff7b72; --hl-s: #a5d6ff; --hl-c: #9198a1; --hl-n: #79c0ff; --hl-f: #d2a8ff; --hl-t: #7ee787; --hl-a: #79c0ff; --hl-p: #79c0ff; --hl-b: #ffa657; --hl-v: #ffa657; --hl-h: #79c0ff; --hl-i: #aff5b4; --hl-ib: #033a16; --hl-d: #ffdcd7; --hl-db: #67060c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .md-body { --hl-k: #ff7b72; --hl-s: #a5d6ff; --hl-c: #9198a1; --hl-n: #79c0ff; --hl-f: #d2a8ff; --hl-t: #7ee787; --hl-a: #79c0ff; --hl-p: #79c0ff; --hl-b: #ffa657; --hl-v: #ffa657; --hl-h: #79c0ff; --hl-i: #aff5b4; --hl-ib: #033a16; --hl-d: #ffdcd7; --hl-db: #67060c; } }
.md-body pre .hl-k, .md-body pre .hl-r { color: var(--hl-k); } .md-body pre .hl-s { color: var(--hl-s); } .md-body pre .hl-c { color: var(--hl-c); font-style: normal; }
.md-body pre .hl-n { color: var(--hl-n); } .md-body pre .hl-f, .md-body pre .hl-m { color: var(--hl-f); } .md-body pre .hl-t { color: var(--hl-t); } .md-body pre .hl-a, .md-body pre .hl-p, .md-body pre .hl-h { color: var(--hl-a); }
.md-body pre .hl-b, .md-body pre .hl-v { color: var(--hl-b); } .md-body pre .hl-o { color: inherit; }
.md-body pre .hl-i { color: var(--hl-i); background: var(--hl-ib); } .md-body pre .hl-d { color: var(--hl-d); background: var(--hl-db); }

.hl-k{color:#7c3aed}.hl-s{color:#0f766e}.hl-c{color:#6b7280;font-style:italic}.hl-n{color:#b45309}.hl-f{color:#2563eb}
.hl-t{color:#be123c}.hl-a{color:#b45309}.hl-p{color:#1d4ed8}.hl-o{color:#64748b}.hl-b{color:#0e7490}.hl-v{color:#9333ea}.hl-r{color:#c2410c}
.hl-h{color:#1d4ed8;font-weight:700}.hl-m{color:#64748b}.hl-i{color:#116329;background:#dafbe1}.hl-d{color:#82071e;background:#ffebe9}
:root[data-theme="dark"] .hl-k{color:#c4b5fd}:root[data-theme="dark"] .hl-s{color:#5eead4}:root[data-theme="dark"] .hl-c{color:#9ca3af}:root[data-theme="dark"] .hl-n{color:#fbbf24}:root[data-theme="dark"] .hl-f{color:#93c5fd}:root[data-theme="dark"] .hl-t{color:#fda4af}:root[data-theme="dark"] .hl-a{color:#fcd34d}:root[data-theme="dark"] .hl-p{color:#93c5fd}:root[data-theme="dark"] .hl-o{color:#94a3b8}:root[data-theme="dark"] .hl-b{color:#67e8f9}:root[data-theme="dark"] .hl-v{color:#d8b4fe}:root[data-theme="dark"] .hl-r{color:#fdba74}:root[data-theme="dark"] .hl-h{color:#93c5fd}:root[data-theme="dark"] .hl-m{color:#94a3b8}:root[data-theme="dark"] .hl-i{color:#aff5b4;background:#033a16}:root[data-theme="dark"] .hl-d{color:#ffdcd7;background:#67060c}
.md-body .spoiler { background: currentColor; border-radius: 3px; cursor: pointer; } .md-body .spoiler:hover, .md-body .spoiler:focus { background: transparent; }
/* Pictures in a README are inline, as on GitHub (the site's base CSS makes img a block): badges in a row stay in a row. */
.md-body img, .md-body picture { display: inline; }
.md-body img.md-badge { display: inline-block; vertical-align: middle; }
.md-body pre.mermaid { background: transparent; border: 0; }

/* Resume editor laid out like readme-editor: toolbar, source | resizer | preview, status bar. */
.re { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); display: flex; flex-direction: column; overflow: visible; }
.re-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r2) var(--r2) 0 0; position: sticky; top: 0; z-index: 5; }
.re-tools .seg label { cursor: pointer; }
.re-b { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: 600 13px/1 var(--font-mono); cursor: pointer; list-style: none; display: inline-flex; align-items: center; justify-content: center; }
.re-b:hover { border-color: var(--line); background: var(--surface); }
.re-b::-webkit-details-marker { display: none; }
.re-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.re-menu { position: relative; }
.re-pop { display: flex; flex-direction: column; align-items: stretch; min-width: 160px; max-height: 320px; overflow: auto; padding: 4px; }
.re-pop .re-b { justify-content: flex-start; width: 100%; font-family: inherit; font-weight: 500; }
.re-work { display: flex; min-height: 520px; height: 70vh; }
.re-srcpane { flex: 0 0 48%; min-width: 160px; display: flex; }
.re-ta { flex: 1; resize: none; border: 0; padding: 16px; margin: 0; font: 13px/1.6 var(--font-mono); color: var(--text); background: var(--surface); tab-size: 2; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.re-resizer { flex: 0 0 5px; cursor: col-resize; background: var(--line); touch-action: none; }
.re-resizer:hover, .re-resizer:focus-visible { background: var(--acc); outline: none; }
.re-pvpane { flex: 1 1 0; min-width: 0; overflow: auto; background: var(--bg, var(--surface)); }
.re-pv { padding: 20px 28px; }
.re[data-view="visual"] :is(.re-srcpane, .re-resizer), .re[data-view="source"] :is(.re-pvpane, .re-resizer) { display: none; }
.re[data-view="source"] .re-srcpane { flex: 1 1 auto; }
.re-status { display: flex; gap: 14px; padding: 4px 10px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.re-dialog { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); color: var(--text); padding: 18px; width: min(520px, 92vw); }
.re-dialog::backdrop { background: #0006; }
@media (max-width: 900px) {
  .re[data-view="split"] .re-work { flex-direction: column; height: auto; }
  .re[data-view="split"] .re-srcpane { flex: 0 0 auto; min-height: 320px; }
  .re[data-view="split"] .re-resizer { display: none; }
  .re[data-view="split"] .re-pvpane { min-height: 320px; }
}
/* The in-place highlighted source (article editor): both layers keep the same box, so the text stays aligned. */
.md-ed textarea, .md-ed pre { overflow-y: scroll; scrollbar-gutter: stable; line-height: 1.6; font-size: 14px; letter-spacing: 0; word-spacing: 0; }
/* Catalog cards in the seller's lots block: the same card, a little more compact. */
.lots-compact .lcard .media { aspect-ratio: 16/10; }
.lots-compact .lcard .body { padding: 10px 12px; gap: 4px; }
.lots-compact .lcard .body b.strong { font-size: 14px; }
.lots-compact .lcard .feat { display: none; }
.lots-compact .lcard .facts { padding: 6px 10px; }
.lots-compact .lcard .facts b { font-size: 13px; }
/* A photo inside an avatar circle: it fills the circle and is cropped, never stretched. The photo is rounded itself,
   so the circle does not clip: the unread count of the header avatar sits over its edge. */
.ava:has(> picture), .ava:has(> img) { position: relative; }
.user-menu > summary .dot { z-index: 1; }
.ava > picture, .ava > img, .ava > picture img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ava:has(> picture), .ava:has(> img) { background: var(--surface-3); }
/* A site favicon in the panel site lists: shown whole (pixel art stays sharp), on the column background. */
.ava.fav, .ava.fav:has(> img) { background: transparent; }
.ava.fav > img { object-fit: contain; image-rendering: pixelated; }
/* Achievements in a profile: a medal coloured by level (iron … gold); not reached yet: faint. */
.ach-list { display: flex; flex-direction: column; gap: 8px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-left: 4px solid var(--ach); border-radius: var(--r1); }
.ach-medal { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ach); color: #fff; font-size: 13px; flex: none; }
.ach.ach-none { opacity: .55; }
.ach-wrap > summary { list-style: none; cursor: pointer; }
.ach-wrap > summary::-webkit-details-marker { display: none; }
.ach-wrap[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ach-more { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r1) var(--r1); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.ach-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ach-ladder li { display: flex; gap: 8px; align-items: baseline; opacity: .55; }
.ach-ladder li.on { opacity: 1; }
.ach-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ach); flex: none; }
.ach-ladder li.on .ach-dot { background: var(--ach); }

/* Bazaar lots (src/edge/bazaar.ts): every short card has one fixed size; an opened lot takes the whole row of
   the grid (the text and the way to contact on the left, the thread on the right) and comes up as a bottom
   sheet on phones. No JS needed (a checkbox and :has()); app.js adds .is-open for older browsers and keeps
   one lot open at a time. The kind's color stays bright on the stripe; labels mix it with the text color. */
.lot { --lot-h: 118px; position: relative; min-width: 0; scroll-margin-top: 88px; border: 1px solid var(--line); border-left: 4px solid var(--lc); border-radius: var(--r2); background: var(--surface); }
.lot-short { height: var(--lot-h); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; cursor: pointer; min-width: 0; border-radius: inherit; }
.lot-short:hover { background: color-mix(in srgb, var(--lc) 4%, var(--surface)); }
.lot-short .lot-title { font-size: var(--t4); line-height: 1.3; color: var(--strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lot-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lot-price { margin-left: auto; font-weight: 700; font-size: var(--t2); color: var(--strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lot-meta { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: var(--t1); color: var(--faint); min-width: 0; white-space: nowrap; overflow: hidden; }
.lot-meta .lot-tag { color: var(--acc); font-weight: 600; }
.lot-sig { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.lot-facts { gap: 6px; }
.lot-kind { display: inline-block; padding: 2px 8px; border-radius: var(--r1); background: color-mix(in srgb, var(--lc) 14%, var(--surface)); color: color-mix(in srgb, var(--lc) 72%, var(--strong)); font-weight: 700; font-size: var(--t1); white-space: nowrap; }
:root[data-theme="dark"] .lot-kind { color: color-mix(in srgb, var(--lc) 78%, #fff); }
/* An opened lot on the bazaar: the text on the left, the facts and the one step to the author on the right. */
.lot-full.two.feed { grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); }
.lot-full.feed .lot-side { border-left: 0; display: flex; flex-direction: column; justify-content: center; }
.lot-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0 0 12px; font-size: var(--t2); }
.lot-dl dt { color: var(--faint); }
.lot-dl dd { margin: 0; color: var(--strong); font-weight: 600; }
.lot-go { width: 100%; box-sizing: border-box; }
.lot-kinds .lot-dot { margin-right: 0; }
.lot-kinds .chip.on .lot-dot { background: currentColor; }
.lot-n { font-style: normal; font-weight: 400; opacity: .7; font-variant-numeric: tabular-nums; }
.lot-bar { margin-top: 12px; gap: 8px; align-items: center; }
.lot-search { flex: 1 1 260px; max-width: 420px; gap: 6px; margin: 0; }
.lot-total { margin-left: auto; font-variant-numeric: tabular-nums; }
.lot-none { margin: 0; padding: 16px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r2); color: var(--muted); font-size: var(--t2); }
.lot-foot { text-align: center; margin-top: 10px; }
.lot-pv-text { margin: 0; padding: 0 14px 12px; white-space: pre-line; overflow-wrap: anywhere; }
.lot-pv-text:empty { display: none; }
.lot-title { min-width: 0; overflow-wrap: anywhere; }
.lot-tag { color: var(--muted); font-size: var(--t1); }
.lot-lang { font: 700 10px/1 var(--font-ui); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); letter-spacing: .04em; }
.lot-cnt { font: 600 11px/1 var(--font-ui); padding: 4px 7px; border-radius: var(--rp); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.lot-cnt.hot { background: var(--acc2); color: #fff; }
.lot-cnt.warn { background: var(--warn-soft); color: var(--warn); }
.lot-full, .lot-scrim { display: none; }
.lot:has(> .lot-sw:checked), .lot.is-open { grid-column: 1 / -1; border-color: var(--lc); box-shadow: 0 0 0 1px var(--lc); }
.lot:has(> .lot-sw:checked) > .lot-short, .lot.is-open > .lot-short { display: none; }
.lot:has(> .lot-sw:checked) > .lot-full, .lot.is-open > .lot-full { display: grid; }
.lot-full { grid-template-columns: minmax(0, 1fr); }
.lot-full.two { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.lot-main, .lot-side { padding: 14px 16px; min-width: 0; }
.lot-side { border-left: 1px solid var(--line); }
.lot-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lot-no { margin-left: auto; }
.lot-close { cursor: pointer; }
.lot-h { font-size: var(--t5); margin: 6px 0 4px; overflow-wrap: anywhere; }
.lot-text { margin: 6px 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.lot-attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; margin: 0 0 10px; }
.lot-attrs dt { font-size: 11px; }
.lot-attrs dd { margin: 0; }
.lot-trust { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r2); background: var(--surface-2); margin-top: 12px; line-height: 1.45; }
.lot-eyebrow { margin: 14px 0 8px; }
/* The three steps of contact: a request, the author's answer, the contact and the thread. */
.lot-steps { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: st; }
.lot-step { position: relative; padding: 24px 6px 0 0; font-size: var(--t1); color: var(--faint); line-height: 1.35; counter-increment: st; }
.lot-step::before { content: counter(st); position: absolute; top: 0; left: 0; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--line-2);
  background: var(--surface); display: grid; place-items: center; font: 700 10px/1 var(--font-ui); z-index: 1; }
.lot-step::after { content: ""; position: absolute; top: 8px; left: 20px; right: 2px; height: 1.5px; background: var(--line-2); }
.lot-step:last-child::after { display: none; }
.lot-step b, .lot-step span { display: block; }
.lot-step b { color: var(--muted); }
.lot-step.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.lot-step.done::after { background: var(--ok); }
.lot-step.done b { color: var(--text); }
.lot-step.now::before { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.lot-step.now b { color: var(--acc-strong); }
.lot-step.off::before { content: "–"; }
.lot-cta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.lot-cta form, .inline-form { display: inline-flex; margin: 0; }
/* Beats the themed .btn rules (:root[data-style] .btn:not(…)…). */
:root:root:root .btn.lot-contact.lot-contact.lot-contact { background: var(--ok); border-color: var(--ok); color: #fff; }
:root:root:root .btn.lot-report.lot-report.lot-report { background: var(--bad); border-color: var(--bad); color: #fff; }
.lot-hint { margin-top: 10px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 var(--r1) var(--r1) 0; padding: 6px 10px; }
.lot-hint > summary { cursor: pointer; }
.lot-hint p { margin: 6px 0 2px; }
.lot-menu { position: relative; display: inline-block; }
.lot-menu > summary { list-style: none; cursor: pointer; }
.lot-menu > summary::-webkit-details-marker { display: none; }
.lot-pop { position: absolute; right: 0; top: calc(100% + 4px); width: 290px; max-width: 80vw; z-index: 20; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r2); box-shadow: var(--shadow-pop); padding: 12px; text-align: left; }
/* The pop sits inside .lot-cta, whose forms are inline rows: its own form is a column of reasons. */
.lot-cta .lot-pop form:not(.inline-form) { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.lot-pop label.row { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; cursor: pointer; }
.lot-pop label.row input { margin: 2px 0 0; flex: none; }
.lot-pop .lot-report { align-self: flex-start; margin-top: 4px; }
.lot-kinds .chip[style] { border-color: var(--lc); }
.lot-kinds .chip.on[style] { background: var(--lc); color: #fff; }
/* Three lots per row (wide cards), two on tablets, one on phones; dense: an opened lot leaves no holes. */
.lot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; grid-auto-flow: dense; }
.lot-divider { margin: 18px 0 10px; border-top: 1px solid var(--line); padding-top: 8px; }

/* The thread under a lot: one conversation per asker, the owner's replies inside the one they answer. */
.lot-thread { display: flex; flex-direction: column; gap: 8px; }
.lot-conv { border: 1px solid var(--line); border-radius: var(--r2); padding: 8px 10px; }
.lot-conv > summary { cursor: pointer; }
.lot-msgs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lot-msgs:empty { display: none; }
.lot-msg { max-width: 88%; align-self: flex-start; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); font-size: var(--t2); line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.lot-msg.au { align-self: flex-end; background: var(--acc-soft); }
.lot-msg.me { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--acc) 45%, transparent); }
.lot-who { display: block; font-size: 11px; color: var(--faint); margin-bottom: 2px; white-space: normal; }
.lot-compose { margin-top: 8px; border: 1px solid var(--line-2); border-radius: var(--r2); background: var(--surface); }
.lot-compose:focus-within { border-color: var(--acc); }
.lot-compose textarea { display: block; width: 100%; box-sizing: border-box; border: 0; min-height: 54px; padding: 8px 10px; font: inherit; font-size: var(--t2); background: transparent; color: var(--text); outline: none; }
.lot-compose .row { padding: 6px 8px; border-top: 1px solid var(--line); gap: 8px; }
.lot-compose.bad { border-color: var(--bad); }
/* Contacts in the thread: open for the conversation, a fixed-size mask for everyone else. */
.lot-open { border-bottom: 1.5px dotted var(--acc); }
.lot-hid { white-space: nowrap; letter-spacing: -1px; color: var(--text); }
.lot-hid small { letter-spacing: 0; margin-left: 3px; color: var(--muted); font-size: 0.85em; }
/* A resume is self-written: said next to its button and on top of it, with a link to the profile. */
.lot-cv-warn, .cv-warn { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 var(--r1) var(--r1) 0; line-height: 1.45; }
.cv-warn { margin-top: 12px; padding: 10px 12px; }
/* Structured resumes (src/edge/cv-view.ts, profile-cv.ts). */
.cv-doc { --cv-acc: var(--acc); }
.cv-doc .cv-hero { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.cv-doc .cv-hero h1 { margin: 0 !important; padding: 0 !important; border: 0 !important; font-size: 2em; line-height: 1.15; }
.cv-doc .cv-sub { margin: 4px 0 0 !important; color: var(--muted); font-size: 1.05em; }
.cv-doc .cv-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 !important; }
.cv-doc .cv-badges a { display: inline-flex; }
.cv-doc img.cv-b { display: block; max-width: 100%; height: auto; border-radius: 0; background: transparent; }
.cv-doc .cv-stats { padding-top: 4px; }
.cv-doc .cv-sec { margin-top: 18px; }
.cv-doc .cv-sec > h2 { font-size: 1.25em; margin: 0 0 10px !important; }
.cv-doc .cv-skg { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; align-items: start; margin: 4px 0; }
.cv-doc .cv-skg-n { font-size: .85em; color: var(--muted); padding-top: 3px; }
.cv-doc .cv-note { font-size: .8em; color: var(--muted); margin: 6px 0 0 !important; }
.cv-doc .cv-job, .cv-doc .cv-edu { margin: 0 0 14px; }
.cv-doc .cv-job h3, .cv-doc .cv-edu h3 { font-size: 1.05em; margin: 0 0 2px !important; }
.cv-doc .cv-at { color: var(--muted); font-weight: 400; }
.cv-doc .cv-when { color: var(--muted); font-size: .9em; margin: 0 !important; }
.cv-doc .cv-dur { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--rp); border: 1px solid var(--line); font-size: .85em; }
.cv-doc .cv-now { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: var(--rp); background: var(--ok); color: #fff; font-size: .8em; }
.cv-doc .cv-where { display: flex; flex-wrap: wrap; gap: 10px; font-size: .85em; margin: 2px 0; }
.cv-doc .cv-li { font-weight: 600; }
.cv-doc .cv-tl { list-style: none; padding: 0 !important; margin: 0 !important; border-left: 2px solid var(--line); }
.cv-doc .cv-tl-i { position: relative; padding: 0 0 4px 22px; margin: 0 !important; }
.cv-doc .cv-tl-i::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--cv-acc); }
.cv-doc .cv-tl-i.edu::before { border-color: var(--warn); }
.cv-doc .cv-tl-i:has(.now)::before { background: var(--cv-acc); }
.cv-doc .cv-tl-y { font-size: .8em; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.cv-doc .cv-port { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cv-doc .cv-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r2); color: inherit; text-decoration: none !important; background: var(--surface); }
.cv-doc .cv-card:hover { border-color: var(--cv-acc); }
.cv-doc .cv-card-t { font-size: 1.02em; overflow-wrap: anywhere; }
.cv-doc .cv-card-r { font-size: .8em; color: var(--muted); font-family: var(--font-mono, monospace); overflow-wrap: anywhere; }
.cv-doc .cv-card .cv-badges { margin: 0 !important; }
.cv-doc .cv-proj { padding-left: 1.1em; }
.cv-doc .cv-proj li { margin: 4px 0; display: list-item; }
.cv-doc .cv-proj li img.cv-b { display: inline-block; vertical-align: middle; }
.cv-doc .cv-langs { list-style: none; padding: 0 !important; margin: 0 !important; }
.cv-doc .cv-langs li { display: grid; grid-template-columns: minmax(90px, 1fr) auto auto; gap: 10px; align-items: center; margin: 4px 0 !important; }
.cv-doc .cv-meter { display: inline-flex; gap: 3px; }
.cv-doc .cv-meter i { width: 12px; height: 8px; border-radius: 2px; background: var(--line); }
.cv-doc .cv-meter i.on { background: var(--cv-acc); }
.cv-doc .cv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }
.cv-doc .cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cv-doc .cv-tile { border: 1px solid var(--line); border-radius: var(--r2); padding: 12px 14px; background: var(--surface); }
.cv-doc .cv-tile > .cv-sec { margin: 0; }
.cv-doc .cv-tile .cv-skg { grid-template-columns: 1fr; }
.cv-doc .cv-cols { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.cv-doc .cv-side { border-right: 1px solid var(--line); padding-right: 20px; }
.cv-doc .cv-side .cv-sec:first-child, .cv-doc .cv-main .cv-sec:first-child { margin-top: 4px; }
.cv-doc.cv-l-cards .cv-hero h1 { font-size: 2.2em; }
/* Skill cards: the second badge shows on hover or keyboard focus (the person chose which is first). */
.cv-doc .cv-flip { position: relative; display: inline-flex; cursor: help; outline-offset: 2px; }
.cv-doc .cv-flip > img + img { display: none; }
.cv-doc .cv-flip:hover > img:first-child, .cv-doc .cv-flip:focus > img:first-child { display: none; }
.cv-doc .cv-flip:hover > img + img, .cv-doc .cv-flip:focus > img + img { display: block; }
.cv-doc .cv-flip::after { content: ""; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--cv-acc); box-shadow: 0 0 0 2px var(--surface); }
/* Drafts of the resume editors (src/edge/draft-bar.ts): the bar on top, the saved version read-only while a draft waits. */
.draft-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.cv-form .draft-bar { background: var(--bg); }
.draft-bar .grow { flex: 1; }
form[data-draft-view="draft"] .draft-seg [data-draft-show="draft"] { color: var(--warn); }
form.draft-ro > :not([data-draft-bar]) { opacity: .6; }
.skc-row .draft-tag { align-self: flex-start; margin-top: 2px; }
/* The skill cards page: the editor of one card on the left, the cards on the right. */
.skc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.skc-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px 0; }
.skc-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; }
.skc-list { position: sticky; top: 12px; }
.skc-add { width: 100%; justify-content: center; }
.skc-g { margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.skc-ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.skc-row { display: flex; align-items: center; gap: 4px; border-radius: var(--r1); }
.skc-row > a { flex: 1; display: flex; flex-direction: column; padding: 6px 8px; color: inherit; text-decoration: none; border-radius: var(--r1); }
.skc-row > a:hover { background: var(--line); }
.skc-row.on > a { background: var(--acc-soft); outline: 1px solid var(--acc); }
.skc-mv { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.skc-cw { border-left: 3px solid #b1361e; }
@media (max-width: 860px) { .skc { grid-template-columns: 1fr; } .skc-list { position: static; } }
/* Projects in detail: header, role bars on the project's time axis, contributions. */
.cv-doc .cv-prj { border: 1px solid var(--line); border-radius: var(--r2); padding: 14px 16px; margin: 0 0 14px; background: var(--surface); }
.cv-doc .cv-prj-h h3 { margin: 0 0 4px !important; font-size: 1.15em; }
.cv-doc .cv-prj-h .cv-badges { margin: 0 !important; }
.cv-doc .cv-gantt { margin: 12px 0 4px; display: grid; gap: 6px; }
.cv-doc .cv-gantt-axis { position: relative; height: 16px; margin-left: 180px; margin-right: 80px; border-bottom: 1px solid var(--line); }
.cv-doc .cv-gantt-axis span { position: absolute; left: var(--l); bottom: 2px; font-size: .75em; color: var(--muted); transform: translateX(-1px); padding-left: 3px; border-left: 1px solid var(--line); }
.cv-doc .cv-gantt-row { display: grid; grid-template-columns: 172px 1fr 72px; gap: 8px; align-items: center; }
.cv-doc .cv-gantt-n { font-size: .88em; font-weight: 600; text-align: right; }
.cv-doc .cv-gantt-track { position: relative; height: 12px; border-radius: 6px; background: var(--line); }
.cv-doc .cv-bar { position: absolute; left: var(--l); width: var(--w); top: 0; bottom: 0; border-radius: 6px; background: var(--cv-acc); }
.cv-doc .cv-bar.now { box-shadow: inset -4px 0 0 var(--ok); }
.cv-doc .cv-gantt-d { font-size: .8em; color: var(--muted); }
.cv-doc .cv-acts { list-style: none; padding: 0 !important; margin: 10px 0 0 !important; display: grid; gap: 8px; }
.cv-doc .cv-act { display: grid; grid-template-columns: 120px 1fr; gap: 2px 12px; margin: 0 !important; padding-top: 8px; border-top: 1px dashed var(--line); }
.cv-doc .cv-act:first-child { border-top: 0; padding-top: 0; }
.cv-doc .cv-act-g { font-size: .75em; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 3px; }
.cv-doc .cv-act .cv-badges { grid-column: 2; margin: 2px 0 0 !important; }
.cv-doc img.cv-b.target { opacity: .85; outline: 1px dashed var(--muted); outline-offset: 1px; }
.cv-doc .cv-prj-tech { margin-top: 10px !important; padding-top: 8px; border-top: 1px solid var(--line); }
.cv-doc .cv-jp { font-size: .85em; margin: 2px 0 !important; }
.cv-doc .cv-jp a + a::before { content: " · "; color: var(--muted); }
.cv-side .cv-gantt-axis, .cv-l-cards .cv-gantt-axis { margin-left: 120px; margin-right: 0; }
.cv-side .cv-gantt-row, .cv-l-cards .cv-gantt-row { grid-template-columns: 112px 1fr; }
.cv-side .cv-gantt-d, .cv-l-cards .cv-gantt-d { display: none; }
.cv-form .cv-sub-rows { border-left: 3px solid var(--line); padding-left: 12px; }
.cv-form .cv-sub-row { margin: 6px 0; }
@media (max-width: 760px) {
  .cv-doc .cv-cols { grid-template-columns: 1fr; gap: 0; }
  .cv-doc .cv-side { border-right: 0; padding-right: 0; }
  .cv-doc .cv-skg { grid-template-columns: 1fr; }
  .cv-doc .cv-hero h1 { font-size: 1.6em; }
}
.cv-form .cv-sec { padding-top: 8px; border-top: 1px solid var(--line); }
.cv-form .cv-sec h2 { font-size: 18px; }
.cv-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.cv-row { gap: 8px; }
.cv-save { position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
.cv-legacy { white-space: pre-wrap; max-height: 360px; overflow: auto; font-size: 12px; padding: 10px; background: var(--surface-2, var(--surface)); border-radius: var(--r1); }
/* Galleries of resumes and organizations (src/edge/profile-albums.ts#photoGallery): a photo opens over the page via :target. */
.gal { margin-top: 20px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gal-item { margin: 0; }
.gal-item.held { opacity: .55; }
.gal-item a { display: block; border-radius: var(--r1); overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); }
.gal-item img, .gal-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-item figcaption { margin-top: 4px; }
.gal-open { display: none; position: fixed; inset: 0; z-index: 90; background: rgb(0 0 0 / .72); overflow: auto; padding: 24px 16px; }
.gal-open:target { display: block; }
.gal-box { max-width: 880px; margin: 0 auto; background: var(--surface); color: var(--text); border-radius: var(--r2); padding: 16px; }
.gal-big, .gal-box img { width: 100%; height: auto; display: block; border-radius: var(--r1); }
.gal-about { margin-top: 12px; }
.gal-close { position: fixed; top: 12px; right: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); text-decoration: none; font-size: 18px; }
/* Organization showcases and vacancies (src/edge/showcase.ts, jobs.ts). */
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.show-pin { padding: 10px 12px; }
.job-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.job-row:first-of-type { border-top: 0; }
a.card.job-row { flex-direction: row; padding: 12px 16px; border-top: 1px solid var(--line); }
/* Hiring: every vacancy on the side, candidates as cards, criteria as one table; the public vacancy page. */
.hire-page, .job-page { max-width: 1180px; }
.hire { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.hire-list { display: flex; flex-direction: column; gap: 8px; }
.hire-vac { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); color: inherit; text-decoration: none; }
.hire-vac.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.hire-dots { display: inline-flex; gap: 3px; }
.hire-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.hire-dots i.on { background: var(--acc); border-color: var(--acc); }
.hire-sw { font: 600 var(--t2)/1 var(--font-ui); height: 30px; padding: 0 12px; border-radius: var(--rp); border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; }
.hire-sw.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.hire-tabs { display: flex; gap: 4px; margin: 12px 0; }
.hire-tabs a { padding: 6px 12px; border-radius: var(--r1); font-size: var(--t2); font-weight: 600; color: var(--muted); text-decoration: none; }
.hire-tabs a.on { background: var(--surface-3); color: var(--strong); }
.hire-cand { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.hire-cand.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.hire.three { grid-template-columns: 240px minmax(0, 1fr) 340px; }
.hire-thread { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.hire-thread .cvt-msg { max-width: 92%; }
@media (max-width: 1180px) { .hire.three { grid-template-columns: 240px minmax(0, 1fr); } .hire.three > .hire-thread { grid-column: 1 / -1; position: static; max-height: none; } }
.job-ok { color: var(--ok); font-weight: 600; }
.job-h { font-size: var(--t5); margin-bottom: 8px; }
.job-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 16px; }
.job-fit { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); }
.job-fit p { margin: 0; }
.kvs { display: flex; flex-wrap: wrap; gap: 6px; }
.kvp { display: inline-flex; font-size: var(--t1); font-weight: 700; border: 1px solid var(--line-2); border-radius: var(--r1); overflow: hidden; }
.kvp span { padding: 3px 8px; background: var(--surface-3); color: var(--muted); }
.kvp b { padding: 3px 8px; background: var(--surface); color: var(--strong); }
.pill.acc { background: var(--acc-soft); color: var(--acc-strong); border-color: transparent; }
.pill.dash { background: none; border: 1px dashed var(--line-2); }
.job-crit-wrap { overflow-x: auto; }
.job-crits { width: 100%; border-collapse: collapse; font-size: var(--t2); }
.job-crits th, .job-crits td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.job-crits thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.job-crits tbody tr:last-child > * { border-bottom: 0; }
.job-num { width: 84px; height: 30px; }
@media (max-width: 900px) { .hire, .job-cols { grid-template-columns: minmax(0, 1fr); } }
.lot-gal { margin: 6px 0 0; }
/* Resume request threads (src/edge/cv-threads.ts). */
.cvt-row { gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.cvt-row.news { border-color: var(--acc); }
.cvt-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); }
.cvt-msg { max-width: 78%; padding: 8px 12px; border-radius: var(--r2, 12px); background: var(--surface); border: 1px solid var(--line); }
.cvt-msg.me { margin-left: auto; background: var(--acc-soft, var(--surface)); }
.cvt-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cvt-sys { text-align: center; }
.cvt-contacts { margin-top: 12px; border-left: 3px solid var(--ok); }
.lot-final { margin: 0; color: var(--muted); }
.lot-compose-hint { margin: 0; padding: 4px 10px 0; line-height: 1.4; }
.lot-preview { margin: 0; padding: 4px 10px; border-top: 1px dashed var(--line); white-space: pre-line; overflow-wrap: anywhere; }
.lot-undo { display: inline; }
.lot-undo button { font: inherit; padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; }
.err-line { margin: 0; padding: 6px 10px; font-size: var(--t1); color: var(--bad); }
mark.hl { background: var(--bad-soft); color: var(--bad); border-radius: 3px; padding: 0 2px; }
.lot-lock { margin: 0; color: var(--warn); }

/* The owner's block: meters, the inbox, the showcase and the shelf. */
.lot-meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.lot-meter { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: var(--r2); padding: 8px 12px; background: var(--surface); min-width: 0; }
.lot-meter b { font: 700 18px/1.2 var(--font-head); color: var(--strong); font-variant-numeric: tabular-nums; }
.lot-meter .lot-slots { display: flex; }
.lot-meter .lot-slots i { flex: 1; width: auto; height: 6px; border-radius: 3px; }
.lot-meter.full .lot-slots i.on { background: var(--warn); }
.lot-turn { min-width: 0; }
.lot-turn-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot-slots { display: inline-flex; gap: 3px; }
.lot-slots i { width: 12px; height: 8px; border-radius: 2px; background: var(--surface-3); }
.lot-slots i.on { background: var(--acc); }
.lot-inbox { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.lot-req { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; }
.lot-inbox > .lot-req + .lot-req { border-top: 1px solid var(--line); }
.lot-req.soft { background: var(--surface-2); }
.lot-req-who { min-width: 170px; }
.lot-req-lot { min-width: 0; color: var(--text); }
.lot-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lc); margin-right: 6px; }
.lot-sec { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.lot-sec .lot-req { padding: 4px 0; }
.lot-set { border: 1px solid var(--line); border-radius: var(--r2); padding: 10px; background: var(--surface-2); min-width: 0; }
.lot-set-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.lot-setname { display: inline-flex; align-items: center; gap: 2px; margin: 0; }
.lot-setname input { font: inherit; font-weight: 700; color: var(--strong); border: 0; border-bottom: 1px dashed var(--line-2); background: transparent; width: 16ch; padding: 2px; }
.lot-setname input:focus { outline: none; border-bottom-color: var(--acc); }
.lot-add { height: 118px; box-sizing: border-box; border: 1.5px dashed var(--line-2); border-radius: var(--r2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: var(--t2); text-decoration: none; }
.lot-add:hover { border-color: var(--acc); color: var(--acc); }
.lot-shelf { display: flex; flex-direction: column; gap: 8px; }
.lot-shelf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r2); }
.lot-minis { display: flex; gap: 6px; flex-wrap: wrap; }
.lot-mini { font-size: var(--t1); padding: 3px 8px; border-radius: var(--r1); border-left: 3px solid var(--lc, var(--line-2)); background: var(--surface-2); color: var(--text); }
.lot-mini.add { border: 1px dashed var(--line-2); background: transparent; color: var(--muted); }
.sel.sm { height: 30px; font-size: var(--t2); }
.lot-empty { margin-top: 14px; }
.lot-kpicks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lot-kpick { position: relative; border: 1.5px solid var(--line); border-radius: var(--r2); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
label.lot-kpick { cursor: pointer; }
.lot-kpick small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.lot-kpick input { position: absolute; opacity: 0; pointer-events: none; }
.lot-kpick:has(input:checked) { border-color: var(--lc); box-shadow: inset 0 0 0 1px var(--lc); background: color-mix(in srgb, var(--lc) 7%, var(--surface)); }
.lot-kpick:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 1px; }

/* The lot editor (/-/lots/edit): the form and a sticky preview with the text check. */
.lot-editor-page { max-width: 1080px; }
.lot-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-top: 14px; }
.lot-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lot-form .inp, .lot-form .sel { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.lot-fs { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
[data-lot-kind][hidden] { display: none !important; }
.lot-fl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lot-lbl { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t2); font-weight: 600; color: var(--strong); }
.lot-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lot-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.lot-opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: var(--rp); padding: 4px 12px; font-size: var(--t2); cursor: pointer; background: var(--surface); }
.lot-opt input { margin: 0; }
.lot-opt:has(input:checked) { background: var(--strong); border-color: var(--strong); color: var(--surface); }
.lot-cvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lot-cv { display: flex; gap: 8px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: var(--r2); padding: 8px 10px; font-size: var(--t2); cursor: pointer; background: var(--surface); }
.lot-cv:has(input:checked) { border-color: var(--acc); }
.lot-pv { position: sticky; top: 80px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r2); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.lot-pv .lot-short { cursor: default; }
.lot-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--t1); }
.lot-checks .ok { color: var(--ok); }
.lot-checks .no { color: var(--bad); }

@media (max-width: 900px) {
  .lot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lot-kpicks, .lot-meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lot-editor { grid-template-columns: minmax(0, 1fr); }
  .lot-pv { position: static; }
}
@media (max-width: 760px) {
  .lot-full.two, .lot-full.two.feed { grid-template-columns: minmax(0, 1fr); }
  .lot-side { border-left: 0; border-top: 1px solid var(--line); }
}
/* Phones: the short card stays in the list; the opened lot is a bottom sheet over a dimmed page. */
@media (max-width: 560px) {
  .lot-grid { grid-template-columns: minmax(0, 1fr); }
  .lot:has(> .lot-sw:checked), .lot.is-open { grid-column: auto; box-shadow: none; }
  .lot:has(> .lot-sw:checked) > .lot-short, .lot.is-open > .lot-short { display: flex; }
  .lot:has(> .lot-sw:checked) > .lot-full, .lot.is-open > .lot-full { position: fixed; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
    z-index: 61; background: var(--surface); border-radius: 16px 16px 0 0; border-top: 4px solid var(--lc); box-shadow: var(--shadow-pop); }
  .lot:has(> .lot-sw:checked) > .lot-scrim, .lot.is-open > .lot-scrim { display: block; position: fixed; inset: 0; z-index: 60; background: hsl(220 30% 5% / .45); }
  .lot-cta .lot-contact { flex: 1 1 auto; }
  .lot-row2, .lot-cvs, .lot-shelf-row { grid-template-columns: minmax(0, 1fr); }
  .lot-steps { font-size: 11px; }
}

/* Market category editor (src/edge/panel-market-cats.ts): the tree on the left, the category on the right. */
.mcat-cols { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mcat-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.mcat-tree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.mcat-tree .mcat-tree { padding-left: 14px; border-left: 1px solid var(--line); margin: 2px 0 4px 6px; }
.mcat-tree li { padding: 2px 0; }
.mcat-tree a { color: var(--text); }
.mcat-tree a.on { color: var(--acc); font-weight: 700; }
.mcat-tree li.leaf { padding-left: 16px; }
.mcat-tree summary { cursor: pointer; list-style: none; }
.mcat-tree summary::-webkit-details-marker { display: none; }
.mcat-tree summary::before { content: "▸"; display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; }
.mcat-tree details[open] > summary::before { transform: rotate(90deg); }
.req { color: var(--bad); }
@media (max-width: 900px) { .mcat-cols { grid-template-columns: minmax(0, 1fr); } .mcat-side { position: static; max-height: none; } }
/* No-JS helpers are not needed once app.js runs. */
[data-js] [data-refresh] { display: none; }
/* The listing form: the category as a short chain of selects, own characteristics in one row each. */
.mcat-levels .sel { width: auto; max-width: 100%; min-width: 0; }
/* Left: the chain of the listing; right: the chain suggested by the title. */
.mcat-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.mcat-suggested { border-left: 1px dashed var(--line); padding-left: 16px; }
@media (max-width: 760px) { .mcat-two { grid-template-columns: minmax(0, 1fr); } .mcat-suggested { border-left: 0; padding-left: 0; } }
.mcat-own { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.mcat-own > .sel, .mcat-own-find { flex: 1 1 200px; min-width: 0; }
.mcat-own-val { display: flex; gap: 6px; flex: 1 1 200px; min-width: 0; }
.mcat-own-val .sel { flex: 1 1 auto; min-width: 0; }
.mcat-own .field-err { flex-basis: 100%; }
.mcat-own-find { position: relative; }
.mcat-own-find .inp { width: 100%; }
.mcat-own-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r1); box-shadow: 0 8px 24px #0002; max-height: 260px; overflow: auto; }
.mcat-own-list button { display: block; width: 100%; text-align: left; padding: 7px 10px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; }
.mcat-own-list button:hover, .mcat-own-list button:focus { background: var(--acc-soft); }

/* Amounts in post text converted by app.js (money-text.ts); the original is in the title. */
.money[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

/* ---------- Home hero (desktop: text over the picture) ---------- */
.hero { min-height: var(--hero-min, 260px); display: flex; align-items: flex-end; padding: 32px; position: relative; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; max-width: 720px; }
.hero-title { color: #fff; font-size: 36px; text-shadow: 0 2px 8px #0005; }
.hero-lead { color: #fffe; margin-top: 10px; font-size: 17px; text-shadow: 0 1px 6px #0006; }
@media (min-width: 768px) { .m-only { display: none !important; } }


/* ---------- Profile albums (src/edge/profile-albums.ts) ---------- */
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }
.alb-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.alb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.alb-ph { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--r2); background: var(--surface-3); }
.alb-ph picture, .alb-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
a.alb-ph:hover img { transform: scale(1.03); transition: transform .2s; }
.alb-fig { margin: 0; }
.alb-st { height: auto; white-space: normal; }
.alb-del > summary { list-style: none; display: inline-flex; }
.alb-del > summary::-webkit-details-marker { display: none; }
.alb-del[open] { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 767px) { .alb-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- "Личное" (src/edge/personal.ts) ---------- */
.personal-host { margin-top: 24px; }
.personal-host.busy { opacity: .6; }
.personal { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.pers-osint { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); border-radius: var(--r2); padding: 12px 14px; font-size: var(--t3); line-height: 1.5; }
.pers-osint a { font-weight: 600; }
.pers-guest { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pers-gh { font-size: 15px; color: var(--muted); margin-bottom: 8px; text-transform: none; }
.pers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pers-item { border: 1px solid var(--line); border-left: 4px solid var(--acc); border-radius: var(--r2); background: var(--surface); padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.pers-text { font-size: var(--t4); line-height: 1.5; }
.pers-link { color: var(--acc); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--acc) 35%, transparent); text-underline-offset: 3px; }
.pers-link:hover { text-decoration-color: currentColor; }
.pers-sp { font-size: var(--t3); color: var(--muted); }
.pers-why { font-size: var(--t2); color: var(--faint); font-style: italic; }
.pers-tools { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.pers-tools form { display: inline; }
.pers-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.pers-f[hidden] { display: none !important; }
.pers-colors { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pers-colors legend { margin-bottom: 6px; }
.pers-swatch { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; cursor: pointer; text-align: center; }
.pers-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.pers-swatch span { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); box-shadow: inset 0 0 0 2px var(--surface); }
.pers-swatch input:checked + span { outline: 3px solid var(--acc); outline-offset: 1px; }
.pers-swatch input:focus-visible + span { outline: 3px solid var(--acc); }
.pers-swatch small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.pers-preview { border: 1px dashed var(--line-2); border-radius: var(--r2); padding: 10px 12px; min-height: 48px; }
.pers-preview p { margin: 4px 0 0; }
.pers-line { font-size: var(--t3); }
.pers-own { display: flex; flex-direction: column; gap: 10px; }
.pers-clear > summary { list-style: none; display: inline-flex; }
.pers-clear > summary::-webkit-details-marker { display: none; }
.pers-clear[open] { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }


/* Reviews of a lot: tabs [all / reviews / questions] without JS (radio + sibling panes). */
.rv-tabs .rv-sw { position: absolute; opacity: 0; pointer-events: none; }
.rv-tabs .rv-sw:checked + label.chip { background: var(--acc); border-color: var(--acc); color: #fff; }
.rv-tabs .rv-sw:focus-visible + label.chip { outline: 2px solid var(--acc); outline-offset: 2px; }
.rv-pane { display: none; }
.rv-tabs:has(#rv-all:checked) .rv-all, .rv-tabs:has(#rv-reviews:checked) .rv-reviews, .rv-tabs:has(#rv-questions:checked) .rv-questions { display: block; }
.rv-item { border-left: 3px solid var(--line); padding-left: 10px; scroll-margin-top: 80px; }
.rv-item:target { border-left-color: var(--acc); }
.rv-q { border-left-style: dashed; }
.rv-mark { color: var(--acc); }
.rv-answer { margin-top: 4px; padding: 6px 8px; background: var(--surface-2); border-radius: var(--r1); }
/* Site icons of external links (/-/fav/<host>). */
img.fav { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; border-radius: 3px; }

/* Activity grids by year (src/edge/activity-grid.ts): radio tabs, one pane per year. */
.heat-sw { position: absolute; opacity: 0; pointer-events: none; }
.heat-sw:checked + label.chip { background: var(--acc); border-color: var(--acc); color: #fff; }
.heat-sw:focus-visible + label.chip { outline: 2px solid var(--acc); outline-offset: 2px; }
.heat-pane { display: none; }
.heat i.out { visibility: hidden; }
.heat i.l5 { background: color-mix(in srgb, var(--acc) 80%, #000); }
.heat-years:has(.heat-sw:nth-of-type(1):checked) .heat-pane[data-y="0"],
.heat-years:has(.heat-sw:nth-of-type(2):checked) .heat-pane[data-y="1"],
.heat-years:has(.heat-sw:nth-of-type(3):checked) .heat-pane[data-y="2"],
.heat-years:has(.heat-sw:nth-of-type(4):checked) .heat-pane[data-y="3"],
.heat-years:has(.heat-sw:nth-of-type(5):checked) .heat-pane[data-y="4"],
.heat-years:has(.heat-sw:nth-of-type(6):checked) .heat-pane[data-y="5"],
.heat-years:has(.heat-sw:nth-of-type(7):checked) .heat-pane[data-y="6"],
.heat-years:has(.heat-sw:nth-of-type(8):checked) .heat-pane[data-y="7"],
.heat-years:has(.heat-sw:nth-of-type(9):checked) .heat-pane[data-y="8"],
.heat-years:has(.heat-sw:nth-of-type(10):checked) .heat-pane[data-y="9"],
.heat-years:has(.heat-sw:nth-of-type(11):checked) .heat-pane[data-y="10"],
.heat-years:has(.heat-sw:nth-of-type(12):checked) .heat-pane[data-y="11"] { display: block; }

/* ---- Notifications by section (BACKLOG+notify-messages.md): one color per section, the same in the header,
   on /-/notes and in the messenger. Badges are filled by app.js from /-/api/me. ---- */
.s-estate, [data-sec="estate"] { --sc: hsl(200 70% 42%); }
.s-market, [data-sec="market"] { --sc: hsl(28 85% 46%); }
.s-bazaar, [data-sec="bazaar"] { --sc: hsl(152 55% 34%); }
.s-blog, [data-sec="blog"] { --sc: hsl(352 70% 46%); }
.s-forum, [data-sec="forum"] { --sc: hsl(262 50% 52%); }
.s-me { --sc: var(--acc); }
.s-all { --sc: var(--strong); }
.main-nav a[data-sec] { position: relative; }
.nav-b { position: absolute; top: -3px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--sc);
  color: #fff; font: 700 11px/18px var(--font-ui); text-align: center; border: 2px solid var(--surface); cursor: pointer; z-index: 2; }
.nav-pop { position: absolute; top: calc(100% + 8px); left: 0; width: 340px; max-width: 90vw; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r2);
  box-shadow: var(--shadow-pop); z-index: 70; text-align: left; font-weight: 400; color: var(--text); }
.nav-pop .h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: var(--t2); }
.nav-pop .h b { color: var(--sc); }
.nav-pop .h button { margin-left: auto; font-size: var(--t1); color: var(--acc); background: none; border: 0; cursor: pointer; }
.nav-pop a.n { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; padding: 9px 12px; font-size: var(--t2); line-height: 1.4; color: var(--text); border-top: 1px solid var(--line); }
.nav-pop a.n:first-of-type { border-top: 0; }
.nav-pop a.n:hover { background: var(--surface-2); }
.nav-pop a.n i { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); margin-top: 6px; }
.nav-pop a.n.read { color: var(--muted); }
.nav-pop a.n.read i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.nav-pop a.n span.t { font-size: 11px; color: var(--faint); white-space: nowrap; }
.nav-pop .f { display: block; padding: 8px 12px; border-top: 1px solid var(--line); font-size: var(--t2); }
.hdr-msg { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 16px; text-decoration: none; }
.hdr-msg .dot { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: var(--ok); color: #fff;
  font: 700 11px/18px var(--font-ui); text-align: center; border: 2px solid var(--surface); }
.note-n { display: inline-block; font: 700 10px/1 var(--font-ui); padding: 3px 6px; border-radius: var(--rp); background: var(--surface-3); color: var(--muted); }

/* /-/notes */
.notes-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 0; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.notes-side { border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.notes-side a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r1); font-size: var(--t3); color: var(--text); }
.notes-side a.on { background: var(--surface-2); font-weight: 700; color: var(--strong); }
.note-sw { width: 10px; height: 10px; border-radius: 3px; background: var(--sc); flex: none; }
.note-c { margin-left: auto; font: 700 11px/1 var(--font-ui); padding: 3px 7px; border-radius: var(--rp); background: var(--sc); color: #fff; }
.note-c.z { background: var(--surface-3); color: var(--faint); }
.notes-main { padding: 14px 18px; min-width: 0; }
.note-day { font: 700 11px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 18px 0 6px; }
.note-day.note-new { color: var(--red); }
.note-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: var(--r1); color: var(--text); }
.note-row:hover { background: var(--surface-2); }
.note-bar { align-self: stretch; min-height: 22px; border-radius: 2px; background: var(--sc); }
.note-row.read .note-bar { background: var(--line); }
.note-tx { font-size: var(--t2); line-height: 1.45; }
.note-row.read .note-tx { color: var(--muted); }
.note-row.done .note-tx { text-decoration: line-through; text-decoration-color: var(--line-2); color: var(--faint); }
.note-at { font-size: 11px; color: var(--faint); text-align: right; white-space: nowrap; }

/* ---- The messenger (/-/m) ---- */
.msg-page { padding-top: 16px; }
.msg-app { display: grid; grid-template-columns: 300px minmax(0, 1fr) 260px; height: min(78vh, 760px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); overflow: hidden; }
.msg-app:not(.open) { grid-template-columns: 300px minmax(0, 1fr); }
.msg-list { border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.msg-ltop { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.msg-asw, .msg-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.msg-asw a { font-size: 12px; padding: 4px 10px; border-radius: var(--rp); border: 1px solid var(--line); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.msg-asw a.on { background: var(--strong); color: var(--surface); border-color: var(--strong); }
.msg-asw .c { font: 700 10px/1 var(--font-ui); padding: 2px 5px; border-radius: var(--rp); background: var(--ok); color: #fff; }
.msg-tabs a { font-size: 12px; padding: 4px 8px; border-radius: var(--r1); color: var(--muted); white-space: nowrap; }
.msg-tabs a.on { background: var(--surface-2); color: var(--strong); font-weight: 700; }
.z-market { --sc: hsl(28 85% 46%); } .z-estate { --sc: hsl(200 70% 42%); }
.msg-conv { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.msg-conv:hover { background: var(--surface-2); }
.msg-conv.on { background: var(--acc-soft); }
.msg-conv.new .msg-nm { color: var(--strong); }
.msg-th { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: none; display: grid; place-items: center; }
.msg-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-th.ava { width: 44px; height: 44px; font-size: 14px; }
.msg-cm { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.msg-nm { font-weight: 700; font-size: var(--t2); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-sub { font-size: 11px; font-weight: 600; color: var(--sc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-last { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-rt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.msg-u { color: var(--ok); font-size: 12px; }
.msg-st { font: 700 10px/1 var(--font-ui); padding: 3px 6px; border-radius: var(--rp); text-transform: uppercase; letter-spacing: .03em; background: var(--surface-3); color: var(--muted); }
.msg-st.new { background: var(--acc2); color: #fff; } .msg-st.work { background: var(--acc-soft); color: var(--acc-strong); } .msg-st.done { background: var(--ok-soft); color: var(--ok); }
.msg-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.msg-none { display: grid; place-items: center; }
.msg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.msg-who { display: flex; flex-direction: column; min-width: 0; }
.msg-who b { color: var(--strong); }
.msg-ctx { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 10px 14px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface-2); }
.msg-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.msg-msgs > * { flex: none; }
.msg-m { max-width: 72%; padding: 8px 11px; border-radius: 14px; background: var(--surface-2); font-size: var(--t2); line-height: 1.45; align-self: flex-start; white-space: pre-line; overflow-wrap: anywhere; }
.msg-m.me { align-self: flex-end; background: var(--acc-soft); }
.msg-m.note { align-self: stretch; max-width: none; background: var(--warn-soft); border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent); }
.msg-w { display: block; font-size: 11px; color: var(--faint); margin-bottom: 2px; white-space: normal; }
.msg-tm { font-size: 10px; color: var(--faint); margin-left: 8px; white-space: nowrap; }
.msg-sys { align-self: center; font-size: 11px; color: var(--faint); background: var(--surface-2); padding: 3px 10px; border-radius: var(--rp); }
.msg-card { align-self: flex-start; width: min(340px, 90%); border: 1px solid var(--line-2); border-radius: var(--r2); background: var(--surface); overflow: hidden; }
.msg-card.me { align-self: flex-end; }
.msg-ch { padding: 8px 12px; font: 700 11px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); color: var(--muted); }
.msg-card.ok .msg-ch { background: var(--ok-soft); color: var(--ok); }
.msg-cb { padding: 10px 12px; font-size: var(--t2); display: flex; flex-direction: column; gap: 4px; }
.msg-big { font: 700 18px var(--font-head); color: var(--strong); }
.msg-ca { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.msg-cstate { font-size: 12px; color: var(--muted); }
.msg-cstate.accepted, .msg-cstate.confirmed { color: var(--ok); font-weight: 700; }
.msg-cstate.declined, .msg-cstate.expired { color: var(--faint); }
.msg-guard { margin: 0 14px; padding: 7px 10px; border-radius: var(--r1); background: var(--warn-soft); font-size: 12px; border-left: 3px solid var(--warn); }
.msg-comp { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg-comp textarea { width: 100%; box-sizing: border-box; }
/* Message fields grow with the text (field-sizing, or app.js where it is not supported) and are never dragged. */
textarea[data-grow], textarea.inp[data-grow] { resize: none; field-sizing: content; min-height: 54px; max-height: min(40vh, 320px); overflow-y: auto; }
.msg-qr { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-tpl { font-size: 12px; padding: 4px 10px; border-radius: var(--rp); border: 1px dashed var(--line-2); color: var(--muted); background: transparent; cursor: pointer; }
.msg-tpl:hover { border-color: var(--acc); color: var(--acc); }
.msg-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r1); overflow: hidden; font-size: 12px; }
.msg-seg label { padding: 4px 10px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.msg-seg label:has(input:checked) { background: var(--strong); color: var(--surface); }
.msg-seg input { position: absolute; opacity: 0; pointer-events: none; }
.msg-tool { position: relative; }
.msg-tool > summary { list-style: none; cursor: pointer; }
.msg-tool > summary::-webkit-details-marker { display: none; }
.msg-tf { position: absolute; bottom: calc(100% + 6px); right: 0; width: 320px; max-width: 80vw; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: var(--shadow-pop); font-size: 12px; }
.msg-tf label { display: flex; flex-direction: column; gap: 3px; flex: 1 1 90px; }
.msg-tf .inp, .msg-tf .sel { width: 100%; box-sizing: border-box; }
.msg-side { border-left: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
.msg-side .eyebrow { margin-top: 6px; }
.msg-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12px; }
.msg-kv span:nth-child(odd) { color: var(--faint); }
.msg-stages { display: flex; border: 1px solid var(--line-2); border-radius: var(--r1); overflow: hidden; font-size: 11px; }
.msg-stages span { flex: 1; text-align: center; padding: 5px 2px; color: var(--muted); }
.msg-stages span.on { background: var(--strong); color: var(--surface); font-weight: 700; }
.msg-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 10px; text-align: center; }
.msg-cal i { font-style: normal; padding: 4px 0; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.msg-cal i.busy { background: var(--bad-soft); color: var(--faint); text-decoration: line-through; }
.msg-tplrow { gap: 4px; }

/* "Написать" on lot pages */
.msg-write { margin: 0; }
.msg-quick { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r1); cursor: pointer; }
.msg-quick:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.msg-write textarea, .msg-write .inp { width: 100%; box-sizing: border-box; }
.msg-dates { display: grid; grid-template-columns: 1fr 1fr 70px; gap: 6px; }
.msg-dates label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
.msg-ext > summary { cursor: pointer; margin-top: 4px; }
.msg-resp { display: flex; gap: 6px; align-items: center; }
.msg-on { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

@media (max-width: 1100px) { .msg-app.open { grid-template-columns: 260px minmax(0, 1fr); } .msg-app .msg-side { display: none; } }
@media (max-width: 760px) {
  .msg-app, .msg-app.open, .msg-app:not(.open) { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .msg-app.open .msg-list { display: none; }
  .msg-app:not(.open) .msg-none { display: none; }
  .msg-app.open .msg-thread { height: 80vh; }
  .notes-grid { grid-template-columns: minmax(0, 1fr); }
  .notes-side { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
}
.user-menu-notes a.n { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: start; }
.user-menu-notes a.n i { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); margin-top: 6px; }
.user-menu-notes a.n.read i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.user-menu-notes a.n .t { font-size: 11px; color: var(--faint); white-space: nowrap; }
.msg-compf { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.msg-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.msg-toolbar .msg-tf { left: 0; right: auto; }

/* Acting as a virtual user (staff): the bar on top of every page. */
.act-as-bar { position: sticky; top: 0; z-index: 60; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 6px 16px; background: var(--warn-soft); color: var(--warn); font-size: 13px; border-bottom: 1px solid var(--warn); }
/* "virtual · via slnknrr": seen only by staff with the right. */
.deanon { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--acc-soft, var(--warn-soft)); color: var(--acc, var(--warn)); font-size: 11px; line-height: 18px; white-space: nowrap; text-decoration: none; }
.via-tag { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 11px; line-height: 18px; white-space: nowrap; }

/* Article comments (src/edge/comments.ts). */
.comments { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.comment { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.comment-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.comment:target { border-color: var(--acc); }
.comment-form textarea { min-height: 96px; resize: vertical; }
.comments .pager { display: flex; gap: 6px; flex-wrap: wrap; }
.comments .pager a, .comments .pager span { padding: 2px 10px; border-radius: 6px; border: 1px solid var(--line); }
.comments .pager .on { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }

/* "Not found": section-aware (src/edge/pages.ts notFoundPage). */
.nf { max-width: 640px; margin: 48px auto 64px; text-align: center; }
.nf-code { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 96px; font-weight: 800; line-height: 1; color: var(--acc); letter-spacing: -2px; }
.nf-icon { display: inline-grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; background: var(--acc-soft); font-size: 56px; }
.nf h1 { margin-top: 20px; font-size: 30px; }
.nf-text { margin: 10px auto 0; font-size: 17px; max-width: 520px; }
.nf-search { margin: 24px auto 0; max-width: 440px; gap: 8px; }
.nf-search .inp { flex: 1; }
.nf-links { justify-content: center; gap: 8px; margin-top: 20px; }
@media (max-width: 600px) { .nf-code { font-size: 64px; } .nf-icon { width: 76px; height: 76px; font-size: 40px; } .nf h1 { font-size: 24px; } }

/* Inline code in forum and board posts and comments (src/shared/forum/markup.ts). */
.msg-body code, .ib-body code { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: .92em; padding: 1px 5px; border-radius: 5px; background: var(--soft, rgba(127,127,127,.12)); }

/* Home: the site's activity (src/edge/pages.ts). A cell's colour is the combination of sections (--k), its depth
   how much happened: solid colours mixed with the surface, no gradients. */
/* The colour is the exact paint mix; how much happened is the size of the dab, a share of the cell (so it scales
   with the cell). A thin edge round the dab: the paper white of blogs shows on a light page, ink on a dark one. */
.heat.combo i.l1, .heat.combo i.l2, .heat.combo i.l3, .heat.combo i.l4 { position: relative; }
.heat.combo i.l1::before, .heat.combo i.l2::before, .heat.combo i.l3::before, .heat.combo i.l4::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--k); box-shadow: inset 0 0 0 1px var(--line-2); transform: scale(var(--dab, 1));
}
.heat.combo i.l1 { --dab: .45; }
.heat.combo i.l2 { --dab: .64; }
.heat.combo i.l3 { --dab: .82; }
/* The palette of the activity block (app.js): pots of paint, the mix, the days of that mix lit, the rest faded. */
.home-activity .heat.combo i[data-m] { cursor: pointer; }
/* The whole life of the site, a column a week: weekday letters on the left, the months above (each name in the
   middle of its weeks), a year across the card's width; older weeks scroll in from the left, the scrollbar on top. */
.act { container-type: inline-size; display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 6px;
  --gap: 3px; --cw: calc((100cqw - 20px - 52 * var(--gap)) / 53); }
.act-days { display: grid; grid-template-rows: repeat(7, var(--cw)); row-gap: var(--gap); align-self: end; }
.act-days b { font-size: 9px; font-weight: 600; color: var(--muted); line-height: var(--cw); text-align: center; text-transform: uppercase; }
/* Flipped twice: the scrollbar ends up above the months, where the strip is dragged. */
.act-scroll { overflow-x: auto; overflow-y: hidden; transform: scaleY(-1); scrollbar-width: thin; overscroll-behavior-x: contain; }
.act { overscroll-behavior-x: contain; }
.act-inner { transform: scaleY(-1); width: max-content; padding: 2px 0; }
.act-months { display: grid; grid-template-columns: repeat(var(--weeks, 53), var(--cw)); column-gap: var(--gap); margin-bottom: 5px;
  font-size: 11px; line-height: 18px; color: var(--muted); cursor: grab; user-select: none; touch-action: pan-x; }
.act-months.dragging { cursor: grabbing; }
.act-months span { text-align: center; white-space: nowrap; overflow: hidden; }
.act-months span.edge { box-shadow: inset 1px 0 0 var(--line-2); }
.home-activity [data-paint-grid] {
  grid-template-columns: repeat(var(--weeks, 53), var(--cw)); grid-template-rows: repeat(7, var(--cw)); grid-auto-flow: column; gap: var(--gap);
}
.home-activity [data-paint-grid] i { width: var(--cw); height: var(--cw); border-radius: 22%; }
.home-activity [data-paint-grid].mixing i:not(.out) { opacity: .14; }
.home-activity [data-paint-grid].mixing i.hit { opacity: 1; }
/* Exactly the mix: the whole cell in its colour; the mix among others: only the edges, the middle left empty. */
.home-activity [data-paint-grid].mixing i.hit { background: var(--s); }
.home-activity [data-paint-grid].mixing i.hit::before, .home-activity [data-paint-grid].mixing i.sup::before { display: none; }
.home-activity [data-paint-grid].mixing i.sup { opacity: 1; background: transparent; }
.home-activity [data-paint-grid].mixing i.sup::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--s); }
.home-activity [data-paint-grid] i { position: relative; }
/* The picked day: a ring inside its own cell (an outline would spill over the neighbours in the small gaps). */
.home-activity [data-paint-grid] i.picked::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--text); }
.paint { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.paint-pots { display: flex; flex-wrap: wrap; gap: 8px; }
.pot { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: var(--rp); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.pot i { width: 18px; height: 18px; border-radius: 50%; background: var(--k); box-shadow: inset 0 0 0 1px var(--line-2); }
.pot[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.paint-res { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pot-mix i { display: block; width: 34px; height: 34px; border-radius: 10px; background: var(--k, transparent); border: 2px dashed var(--line); }
.pot-mix.on i { border: 1px solid var(--line-2); }
.heat i.out { visibility: hidden; }
.combo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.combo-row > .tiny:first-child { min-width: 92px; }
.heat.combo.depth { display: inline-grid; grid-template-rows: 11px; grid-auto-flow: column; }
/* A section tile: [icon][title over description] / the calendar across the tile / the numbers. */
/* Tags of an object: a pill; on hover or focus a preview like Wikipedia's (places with distances, Wi-Fi fields). */
.ttag { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--rp); background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text); cursor: default; }
.ttag .gr { font-weight: 500; color: var(--muted); }
.ttag .tprev { visibility: hidden; opacity: 0; transition: opacity .12s .25s, visibility 0s .37s; position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: 320px; max-width: 86vw;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow-pop); font-weight: 400; }
.ttag:hover .tprev, .ttag:focus-within .tprev { visibility: visible; opacity: 1; transition-delay: .25s, 0s; }
.ttag .place { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-size: 13px; }
.lock { color: var(--warn); }
.near-pick { display: flex; flex-direction: column; gap: 6px; }
.near-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 150px; gap: 8px; align-items: center; font-size: 14px; }
@media (max-width: 767px) { .near-row { grid-template-columns: 1fr; } }

/* "Nearby" on an object page: an icon, "near <place>", the distance. */
.near-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.near-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; }
.near-ico { font-size: 18px; text-align: center; }

/* The address picker of an estate object: the street list under the search field. */
.addr-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px; max-height: 260px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); box-shadow: var(--shadow-pop); padding: 4px; }
.addr-list button { all: unset; display: block; box-sizing: border-box; width: 100%; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.addr-list button:hover, .addr-list button:focus-visible { background: var(--surface-2); }

/* Section icons: built-in line icons inline (currentColor); in the menu before the name; the panel's picker. */
.sico { display: inline-block; vertical-align: -0.15em; flex: none; }
.f-ico .sico { width: 1.15em; height: 1.15em; }
.nav-ico { display: inline-flex; margin-right: 6px; font-size: 1.05em; }
.ico-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.ico-pick label { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r1); cursor: pointer; font-size: 20px; color: var(--text); }
.ico-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ico-pick label:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); color: var(--acc); }
.ico-pick label:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 2px; }

/* The numbers of a section's activity block: one card per kind of event, the trend against the 30 days before. */
.act-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.act-sum .card { padding: 10px 14px; }
.act-sum b { display: block; font: 700 22px/1.15 var(--font-head); color: var(--strong); }
.trend { white-space: nowrap; font: 600 11px/1 var(--font-mono); padding: 3px 6px; border-radius: var(--rp); }
.trend.up { background: var(--ok-soft); color: var(--ok); }
.trend.dn { background: var(--bad-soft); color: var(--bad); }
.sec-activity { margin-bottom: var(--s6); }

/* Estate carousel on the home page: radio tabs (no script needed), a scroll-snapping strip, arrows by app.js. */
.home-car .car-r { position: absolute; opacity: 0; pointer-events: none; }
.home-car .sec-h { flex-wrap: wrap; align-items: center; }
.home-car .car-tabs { margin-left: auto; }
.home-car .car-tabs label { cursor: pointer; padding: 6px 10px; font: 600 var(--t1)/1 var(--font-mono); color: var(--muted); }
.home-car .car-tabs label + label { border-left: 1px solid var(--line); }
.home-car .car-nav { display: flex; gap: 6px; }
.home-car .sec-h .more { margin-left: 0; }
.home-car .car-pane { display: none; }
.home-car:has(.car-r[data-k="new"]:checked) .car-pane[data-k="new"],
.home-car:has(.car-r[data-k="pick"]:checked) .car-pane[data-k="pick"],
.home-car:has(.car-r[data-k="soon"]:checked) .car-pane[data-k="soon"] { display: block; }
.home-car:has(.car-r[data-k="new"]:checked) .car-tabs label[data-k="new"],
.home-car:has(.car-r[data-k="pick"]:checked) .car-tabs label[data-k="pick"],
.home-car:has(.car-r[data-k="soon"]:checked) .car-tabs label[data-k="soon"] { background: var(--acc); color: var(--acc-ink); }
.home-car .car { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * var(--s4)) / 4); gap: var(--s4);
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.home-car .car > * { scroll-snap-align: start; }
@media (max-width: 767px) { .home-car .car { grid-auto-columns: 82%; } .home-car .car-nav { display: none; } .home-car .car-tabs { margin-left: 0; } }

/* Sections block: the two views (tiles as set up / every section's activity), switched on the side. */
.home-sections .sec-h .seg { margin-left: auto; }
.sec-x { display: contents; }
.sec-tile { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.sec-tile-h { display: flex; align-items: flex-start; gap: 8px; }
.sec-tile-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sec-tile-h .f-ico { width: 26px; height: 26px; font-size: 13px; }
.sec-tile-h b { font-size: 14px; line-height: 1.2; }
.sec-tile-s { line-height: 1.3; }
.sec-tile-d { font-size: 12px; line-height: 1.35; }
/* The calendar: a column a week (Monday on top), square days across the whole width, the theme's tones by amount. */
.heat.mcal-g { grid-template-columns: repeat(var(--weeks, 13), minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 2px; width: 100%; }
.heat.mcal-g i { width: auto; height: auto; aspect-ratio: 1; border-radius: 22%; position: relative; }
.heat.mcal-g i.today::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px var(--text); }
.heat.mcal-g i.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

/* A button inside a field, at its right edge: shown while the field is empty (placeholder=" "), e.g. "How to choose"
   beside an empty password, "Via Telegram" beside an empty e-mail. */
.inp-wrap { position: relative; }
.inp-wrap > .inp { width: 100%; padding-right: 130px; }
.inp-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 28px; padding: 0 10px; border-radius: var(--r1);
  display: none; align-items: center; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--acc); border: 1px solid var(--line);
  text-decoration: none; white-space: nowrap; }
.inp-wrap:has(> .inp:placeholder-shown) > .inp-btn { display: inline-flex; }

/* Photo viewer (app.js: a[data-ph]) */
.ph-view { position: fixed; inset: 0; z-index: 1000; background: rgb(0 0 0 / .9); display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; }
.ph-view[hidden] { display: none; }
.ph-fig { grid-column: 2; grid-row: 1; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; padding: 48px 0 16px; min-width: 0; }
.ph-fig picture { display: contents; }
.ph-fig img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; }
.ph-fig figcaption { display: flex; gap: 14px; color: #ddd; font-size: 14px; margin-top: 10px; }
.ph-num { color: #999; }
.ph-nav, .ph-x { background: rgb(255 255 255 / .1); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 26px; line-height: 1; cursor: pointer; justify-self: center; }
.ph-nav:hover, .ph-x:hover { background: rgb(255 255 255 / .22); }
.ph-x { position: absolute; top: 12px; right: 12px; font-size: 18px; }
.ph-view.one .ph-nav { visibility: hidden; }
body.ph-lock { overflow: hidden; }
@media (max-width: 700px) { .ph-view { grid-template-columns: 0 1fr 0; } .ph-nav { position: absolute; bottom: 14px; } .ph-prev { left: 16px; } .ph-next { right: 16px; } }

/* Lot reviews: summary, ways in, star picker */
.rv-sum { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 10px; }
.rv-avg { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.rv-avg b { font-size: 34px; line-height: 1; color: var(--strong); }
.rv-bars { flex: 1; min-width: 180px; max-width: 320px; display: flex; flex-direction: column; gap: 3px; }
.rv-bar { display: grid; grid-template-columns: 28px 1fr 24px; gap: 8px; align-items: center; }
.rv-bar i { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.rv-bar i b { display: block; height: 100%; background: var(--warn); }
.rv-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 14px; }
.rv-act > summary { list-style: none; }
.rv-act > summary::-webkit-details-marker { display: none; }
.rv-act[open] > summary { background: var(--acc); border-color: var(--acc); color: #fff; }
.rv-act[open] { flex-basis: 100%; order: 1; }
.rv-panel { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface-2); }
.rv-stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rv-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rv-stars label { font-size: 28px; line-height: 1; cursor: pointer; color: var(--line-2); padding: 0 2px; }
.rv-stars input:checked ~ label, .rv-stars label:hover, .rv-stars label:hover ~ label { color: var(--warn); }
.rv-stars input:focus-visible + label { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }

/* Booking calendar (app.js: form[data-book]) */
.bk-dlg { border: 1px solid var(--line); border-radius: var(--r3, 16px); background: var(--surface); color: var(--text); padding: 20px; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
.bk-dlg::backdrop { background: rgb(0 0 0 / .55); }
.bk-head { display: flex; align-items: center; justify-content: space-between; font-size: 18px; color: var(--strong); }
.bk-x { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; }
.bk-x:hover { background: var(--surface-2); }
.bk-sel { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.bk-f { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; min-width: 120px; border: 2px solid var(--line); border-radius: var(--r2); }
.bk-f.on { border-color: var(--acc); }
.bk-f i { font-style: normal; font-size: 11px; color: var(--faint); }
.bk-f b { color: var(--strong); }
.bk-arrow { color: var(--faint); }
.bk-sel [data-bk-clear] { margin-left: auto; }
.bk-nav { display: flex; margin-top: 12px; }
.bk-months { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: -30px; }
.bk-mt { text-align: center; font-weight: 700; color: var(--strong); height: 30px; line-height: 30px; }
.bk-mt::first-letter { text-transform: uppercase; }
.bk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 8px; }
.bk-wd { text-align: center; font-size: 11px; color: var(--faint); padding: 4px 0; }
.bk-d { height: 38px; border: 0; border-radius: var(--r1); background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.bk-d:hover:not(:disabled) { background: var(--acc-soft); }
.bk-d.today { font-weight: 700; box-shadow: inset 0 0 0 1px var(--line-2); }
.bk-d:disabled { cursor: not-allowed; }
.bk-d.past, .bk-d.out { color: var(--faint); opacity: .45; }
.bk-d.taken { background: var(--bad-soft); color: var(--muted); text-decoration: line-through; }
.bk-d.short { color: var(--faint); }
.bk-d.mid { background: var(--acc-soft); border-radius: 0; }
.bk-d.hov { background: var(--acc-soft); box-shadow: inset 0 0 0 2px var(--acc); }
.bk-d.pick, .bk-d.pick:hover:not(:disabled), .bk-d.pick:disabled { background: var(--acc); color: var(--acc-ink); font-weight: 700; }
.bk-d.nofit { color: var(--faint); opacity: .6; }
.bk-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.bk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bk-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.bk-legend i.taken { background: var(--bad-soft); }
.bk-legend i.yours { background: var(--acc); border-color: var(--acc); }
.bk-note { margin-top: 10px; min-height: 20px; font-size: 13px; color: var(--muted); }
.bk-note.bad { color: var(--bad); }
.bk-split { display: flex; flex-wrap: wrap; gap: 1px; }
.bk-split > .btn { flex: 1 1 auto; border-radius: 0; justify-content: center; }
.bk-split > .btn:first-child { border-radius: var(--r2, 10px) 0 0 var(--r2, 10px); flex-grow: 2; }
.bk-split > .btn:last-child { border-radius: 0 var(--r2, 10px) var(--r2, 10px) 0; }
.bk-split > .btn:only-child { border-radius: var(--r2, 10px); }
.bk-dlg .bk-split .btn.bk-tg { background: #229ed9 !important; border-color: #229ed9 !important; color: #fff !important; }
.bk-dlg .bk-split .btn.bk-wa { background: #25d366 !important; border-color: #25d366 !important; color: #fff !important; }
.bk-dlg .bk-split .btn.bk-tg:hover { background: #1b8bc0 !important; } .bk-dlg .bk-split .btn.bk-wa:hover { background: #1fb457 !important; }
.bk-policy > .stack-sm { margin: 4px 0 0 !important; }
.bk-sum { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.bk-sum:empty { display: none; }
.bk-total { border-top: 1px solid var(--line); padding-top: 8px; }
.bk-extra { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: end; margin: 12px 0; }
.bk-extra label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
@media (max-width: 640px) { .bk-months { grid-template-columns: 1fr; margin-top: 8px; } .bk-months .bk-month + .bk-month { display: none; } .bk-nav { margin-bottom: -38px; position: relative; } .bk-extra { grid-template-columns: 1fr; } }

/* ---------- Editing in place (src/edge/lot-edit.ts) ----------
   A block (.eb) is a small form that saves on its own: its name sits on the top edge, its state on the right. */
.eb { position: relative; box-shadow: 0 0 0 1px var(--line-2); border-radius: var(--r2); }
.eb:hover, .eb:focus-within { box-shadow: 0 0 0 1px var(--acc); }
.eb.dirty { box-shadow: 0 0 0 2px var(--warn); }
.eb.busy { opacity: .6; pointer-events: none; }
.eb-h, .eb-s {
  position: absolute; top: -9px; z-index: 3; height: 18px; display: flex; align-items: center; gap: 6px;
  padding: 0 6px; background: var(--bg); border-radius: 4px;
  font: 700 10px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.eb-h { left: 10px; }
.eb:hover > .eb-h, .eb:focus-within > .eb-h { color: var(--acc-strong); }
.eb-s { right: 10px; display: none; text-transform: none; letter-spacing: 0; font-size: 11px; }
.eb.dirty > .eb-s, .eb.saved > .eb-s { display: flex; }
.eb.dirty > .eb-s { color: var(--warn); }
.eb.saved > .eb-s { color: var(--ok); }
.eb-s button { all: unset; cursor: pointer; box-sizing: border-box; height: 18px; padding: 0 7px; border-radius: 4px; font-weight: 700; }
.eb-s .do { background: var(--acc); color: var(--acc-ink); }
.eb-s .undo { color: var(--muted); border: 1px solid var(--line-2); }
.eb.saved .eb-s button { display: none; }
.auto-v { color: var(--faint); font-size: var(--t1); font-weight: 600; }

/* ---------- Ads of organizations (src/edge/ads.ts, BACKLOG+market-ads.md): places filled by app.js ---------- */
/* The outer rail: only when the page has no side column and the screen leaves room beside the content. */
.ad-rail { display: none; }
@media (min-width: 1608px) and (hover: hover) and (pointer: fine) {
  .ad-rail:not([hidden]) { display: block; position: fixed; top: calc(var(--header-h) + 24px); right: calc((100vw - var(--wrap)) / 2 - 184px); width: 160px; z-index: 5; }
}
.ad-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); color: var(--text); font-size: 13px; text-decoration: none; min-width: 0; }
.ad-card:hover { border-color: var(--acc); }
.ad-card.hot { border-color: var(--acc); }
.ad-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.ad-card b { color: var(--strong); line-height: 1.3; }
.ad-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ad-price { color: var(--strong); font-weight: 700; }
/* After the text and on the home page: a row, the photo on the left. */
.ad-card.ad-after, .ad-card.ad-home { flex-direction: row; align-items: center; gap: 12px; margin: var(--s5) 0; max-width: 640px; }
.ad-card.ad-after img, .ad-card.ad-home img { width: 160px; flex: none; }
@media (max-width: 560px) { .ad-card.ad-after img, .ad-card.ad-home img { width: 96px; } }
/* In listings the card is a row with a thumbnail, as tall as its text neighbours (bazaar, blog, estate, jobs);
   only the market's photo grid keeps the photo on top. */
.ad-card.ad-list { flex-direction: row; align-items: center; gap: 12px; }
.ad-card.ad-list img { width: 96px; flex: none; }
.es-list > .ad-card.ad-list img, .stack-sm > .ad-card.ad-list img { width: 160px; }
.grid.g4 > .ad-card.ad-list { flex-direction: column; align-items: stretch; }
.grid.g4 > .ad-card.ad-list img { width: 100%; }
[data-ad-side] > .ad-card.ad-side { margin-top: var(--s4); }
.ad-mark { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.ad-face { color: var(--muted); font-size: 12px; }
.ad-lot { overflow: hidden; color: var(--text); }
.ad-lot picture, .ad-lot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ad-go > summary { list-style: none; cursor: pointer; }
.ad-go > summary::-webkit-details-marker { display: none; }

/* "On behalf of" picker (src/edge/via.ts, app.js) */
.as-pick-list{position:absolute;left:0;top:100%;z-index:30;min-width:240px;max-height:320px;overflow:auto;margin-top:4px;
  background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,.15)}
.as-pick-item{padding:6px 10px;cursor:pointer;line-height:1.3}
.as-pick-item:hover,.as-pick-item.on{background:var(--surface-2)}

/* Reordering on touch screens (app.js sortable): "earlier / later" buttons on every item. */
.sort-btns { position: absolute; right: 6px; bottom: 6px; z-index: 2; display: flex; gap: 4px; }
.sort-btn { all: unset; box-sizing: border-box; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgb(0 0 0 / .6); color: #fff; font: 700 16px/1 var(--font-ui); }
[data-room] { position: relative; }
[data-room] > .sort-btns { top: 50%; bottom: auto; transform: translateY(-50%); }
.pick > .sort-btns { top: 44px; bottom: auto; right: 12px; }
