/* Revon design system. Light only. One sans family. Flat: no shadows, no borders on surfaces,
   near-square corners. Reference: Airbnb's rhythm and hierarchy, with clerical (ledger) rows for data.
   Token layers: brand values -> semantic tokens -> component tokens (see tailwind-design-system skill). */
:root {
  /* Brand values */
  --ink-900: #222222; --ink-700: #3f3f3f; --ink-500: #6a6a6a; --ink-300: #b0b0b0;
  --paper: #ffffff; --tint-50: #f7f7f7; --tint-100: #f0f0f0; --tint-200: #e6e6e6; --tint-300: #dddddd;
  --blue-600: #1c4fb0;

  /* Spacing scale (only these values) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* Type scale: size / line-height */
  --t-xs: 12px; --lh-xs: 16px;    /* meta, captions */
  --t-sm: 14px; --lh-sm: 20px;    /* UI, list rows */
  --t-md: 16px; --lh-md: 24px;    /* body */
  --t-lg: 18px; --lh-lg: 24px;    /* section heads */
  --t-xl: 22px; --lh-xl: 28px;    /* page header title = post headline */
  --t-2xl: 28px; --lh-2xl: 34px;  /* thread headline, big numbers */
  /* Radius: square by default */
  --r0: 0; --r1: 2px; --r2: 4px;

  /* Semantic tokens */
  --bg: var(--paper);          /* page */
  --surface: var(--paper);
  --raised: var(--tint-50);    /* flat tint for grouping */
  --raised2: var(--tint-100);  /* inputs, chips, zebra rows */
  --hover: var(--tint-100);
  --text: var(--ink-900); --text2: var(--ink-700); --muted: var(--ink-500);
  --line: var(--tint-100); --line2: var(--tint-200);   /* kept for tints only; never used as borders */
  --brand: var(--ink-900); --brand-ink: #fff;
  --link: var(--blue-600);
  --anon: var(--ink-300);
  --danger: #c13515; --ok: #008a05; --warn: #b35c00;

  /* Post-type tokens: solid tag colour + flat card tint */
  --problem: #f5c400;          --problem-ink: #3a2c00;          --problem-soft: #fff6d1;
  --normal: #ffffff;           --normal-ink: #222222;           --normal-soft: #f7f7f7;
  --progress: #6b3fd4;         --progress-ink: #ffffff;         --progress-soft: #f1ecfc;
  --position_change: #1f6fe0;  --position_change-ink: #ffffff;  --position_change-soft: #e9f1fd;
  --election: #138a43;         --election-ink: #ffffff;         --election-soft: #e6f5eb;

  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--sans);  /* legacy alias: there is no serif in this app */
  --r: var(--r2); --r-sm: var(--r1);
  --header-h: 64px; --nav-h: 60px; --rail: 72px;
  color-scheme: light;
}

/* ================= Base ================= */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--t-sm)/var(--lh-sm) var(--sans); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 var(--s2); }
h1, h2, h3 { text-wrap: balance; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; border-radius: var(--r1); }
input, select, textarea { font: inherit; font-size: var(--t-md); line-height: var(--lh-md); color: var(--text); background: var(--raised2); border: 0; border-radius: var(--r1); padding: var(--s3) var(--s4); width: 100%; }
input::placeholder, textarea::placeholder { color: var(--ink-500); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--tint-200); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--text); flex: none; padding: 0; }
.ic { display: block; flex: none; }
.dim, .muted { color: var(--muted); }
.small { font-size: var(--t-xs); line-height: var(--lh-xs); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--danger); }
.pad { padding: var(--s4); }
.pad-x { padding: var(--s2) var(--s4); }
.link, .link-btn { color: var(--link); font-size: var(--t-sm); font-weight: 500; }
.link-btn:hover, .link:hover { text-decoration: underline; }
.h2 { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; margin: var(--s2) 0 var(--s3); }
.h3 { font-size: var(--t-lg); line-height: var(--lh-lg); font-weight: 600; margin: var(--s5) 0 var(--s2); }
.num, .kpi b, .stats b, .profile-stats b, .budget-total, .money-grid b, .budget-line .pctv, .bids td, .kv > :last-child { font-variant-numeric: tabular-nums; }
.with-ic { display: inline-flex; align-items: center; gap: var(--s1); vertical-align: middle; }
div.with-ic { display: flex; }
.verified-by { display: inline-flex; align-items: center; gap: var(--s1); }

/* ================= Shell ================= */
.main { max-width: 640px; margin: 0 auto; padding-bottom: calc(var(--nav-h) + var(--s5) + env(safe-area-inset-bottom)); min-height: 100vh; }
.shell.bare .main { padding-bottom: var(--s6); }
.nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--raised); display: flex; justify-content: space-around; align-items: center; z-index: 50; }
.nav-logo, .nav-l, .desktop-only, .nav-item.desktop-only, .logo-full { display: none; }
.nav-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r1); text-align: left; color: var(--muted); }
.nav-item.on { color: var(--text); }
.nav-item .ic { width: 24px; height: 24px; }
.nav-ic { position: relative; }
.dot-badge { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 600 11px/18px var(--sans); text-align: center; font-style: normal; }
.icon-btn .dot-badge { top: 4px; right: 2px; }
@media (min-width: 768px) {
  .nav { top: 0; bottom: 0; right: auto; width: var(--rail); height: auto; flex-direction: column; justify-content: flex-start; align-items: center; padding: var(--s5) var(--s3); gap: var(--s2); }
  .nav-logo { display: flex; height: var(--header-h); width: 48px; align-items: center; justify-content: center; margin: calc(-1 * var(--s5)) 0 var(--s5); }
  .logo-mark { font-weight: 700; font-size: var(--t-xl); }
  .nav-item { height: 48px; width: 48px; justify-content: center; padding: 0; }
  .nav-item:hover { background: var(--tint-100); color: var(--text); }
  .nav-item.desktop-only { display: flex; }
  .nav-bottom { display: flex; flex-direction: column; margin-top: auto; width: 100%; align-items: center; gap: var(--s2); }
  .main { padding-left: var(--rail); padding-bottom: var(--s7); max-width: calc(640px + var(--rail)); }
  .mobile-only { display: none !important; }
}
@media (min-width: 1264px) {
  :root { --rail: 248px; }
  .nav { align-items: stretch; padding: var(--s5) var(--s4); }
  .nav-logo { width: auto; justify-content: flex-start; padding: 0 var(--s3); }
  .logo-mark { display: none; } .logo-full { display: inline; }
  .nav-item { width: 100%; justify-content: flex-start; padding: 0 var(--s3); }
  .nav-l { display: inline; font-size: var(--t-md); }
  .nav-item.on { background: var(--tint-100); }
  .nav-item.on .nav-l { font-weight: 600; }
  .nav-bottom { align-items: stretch; }
  .main { padding-left: 0; margin-left: max(var(--rail), calc(50% - 320px)); }
  .shell.wide .main { margin-left: var(--rail); max-width: none; }
}
.logo, .logo-full { font: 700 var(--t-xl)/var(--lh-xl) var(--sans); letter-spacing: -0.3px; color: var(--text); }
.logo span, .logo-full span { color: inherit; }
.logo.big { font-size: 40px; line-height: 44px; }

/* ================= Header (same visual scale as post headline: 22/28) ================= */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--s2); min-height: var(--header-h); padding: var(--s2) var(--s2) var(--s2) var(--s4); background: var(--bg); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title .t1 { font-weight: 600; font-size: var(--t-xl); line-height: var(--lh-xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .t2 { font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.topbar-right { display: flex; align-items: center; gap: var(--s1); }
.topbar.home { justify-content: space-between; }
@media (min-width: 768px) { .topbar.home .logo { visibility: hidden; } }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r1); }
.icon-btn:hover { background: var(--tint-100); }
.icon-btn .ic { width: 24px; height: 24px; }
.demo-banner { font-size: var(--t-xs); line-height: var(--lh-xs); text-align: center; color: var(--muted); padding: var(--s5) var(--s4); }

/* ================= Representatives strip / stories ================= */
.reps { display: flex; gap: var(--s4); overflow-x: auto; padding: var(--s3) var(--s4) var(--s4); scrollbar-width: none; }
.reps::-webkit-scrollbar { display: none; }
.rep { display: flex; flex-direction: column; align-items: center; width: 80px; flex: none; text-align: center; gap: var(--s1); }
.rep > span:not(.avatar) { font-size: var(--t-xs); line-height: var(--lh-xs); margin-top: var(--s2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rep small { font-size: 11px; line-height: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.rep.story-slot { width: auto; }
/* Story pill: overlapping authority avatars inside an outlined pill (the established story ring) */
.story-pill { position: relative; display: flex; align-items: center; padding: 3px; border: 2px solid var(--text); border-radius: 999px; height: 76px; }
.story-pill.seen { border-color: var(--tint-300); }
.story-pill .avatar + .avatar { margin-left: -16px; }
.story-count { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--danger); color: #fff; font: 600 12px/22px var(--sans); font-style: normal; text-align: center; }
.story-label { font-size: var(--t-xs); line-height: var(--lh-xs); margin-top: var(--s2); }
.story-view { position: fixed; inset: 0; z-index: 300; background: var(--paper); color: var(--text); display: flex; flex-direction: column; padding: var(--s4) var(--s4) var(--s6); }
.story-bars { display: flex; gap: var(--s1); }
.story-bars i { flex: 1; height: 3px; background: var(--tint-200); overflow: hidden; position: relative; }
.story-bars i.done { background: var(--text); }
.story-bars i.run::after { content: ""; position: absolute; inset: 0; background: var(--text); transform-origin: left; animation: storyrun 6s linear forwards; }
@keyframes storyrun { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.story-head { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); }
.story-head a { flex: 1; min-width: 0; }
.story-text { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: var(--t-2xl); line-height: var(--lh-2xl); font-weight: 600; padding: var(--s5); max-width: 640px; margin: 0 auto; text-wrap: balance; }
.new-story { display: flex; gap: var(--s2); padding: 0 var(--s4) var(--s3); }

/* ================= Post box ================= */
.postbox { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4) var(--s4); }
.postbox-input { flex: 1; background: var(--raised2); border-radius: var(--r1); padding: var(--s3) 56px var(--s3) var(--s4); color: var(--muted); font-size: var(--t-md); line-height: var(--lh-md); }
.postbox-input:hover { background: var(--tint-200); }
.postbox-cam { margin-left: -56px; margin-right: var(--s2); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--r1); color: var(--text2); }
.postbox-cam .ic { width: 24px; height: 24px; }
.postbox-cam:hover { background: var(--tint-300); }

/* ================= Tabs (underline = a 2px tint bar drawn with background, not a border) ================= */
.tabs { display: flex; gap: var(--s1); background: var(--bg); position: sticky; top: var(--header-h); z-index: 30; overflow-x: auto; scrollbar-width: none; padding: 0 var(--s2); }
.tabs button { flex: 1; min-width: max-content; padding: var(--s3) var(--s3); font-weight: 500; font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--muted); border-radius: 0; background: linear-gradient(var(--tint-100), var(--tint-100)) bottom / 100% 2px no-repeat; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); font-weight: 600; background: linear-gradient(var(--text), var(--text)) bottom / 100% 2px no-repeat; }
.badge { margin-left: var(--s1); font-size: 11px; font-weight: 600; background: var(--raised2); padding: 1px 6px; border-radius: var(--r1); }

/* ================= Posts ================= */
.feed { padding: var(--s3) var(--s4) var(--s1); display: flex; flex-direction: column; gap: var(--s3); }
/* Every post sits on the same neutral tint; the post type is carried by its coloured tag only */
.post { background: var(--raised); border-radius: var(--r2); padding: var(--s4) var(--s4) var(--s2); }
.post-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.post-head .author { flex: 1; min-width: 0; }
.post-title { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; letter-spacing: -0.2px; margin: 0 0 var(--s1); color: var(--text); cursor: pointer; }
.post.full .post-title { font-size: var(--t-2xl); line-height: var(--lh-2xl); }
.post-body { white-space: pre-wrap; word-wrap: break-word; cursor: pointer; font-size: var(--t-md); line-height: var(--lh-md); color: var(--text2); margin: 0 0 var(--s3); text-wrap: pretty; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); align-items: center; }
.post-figure { margin: 0 0 var(--s2); }
.post-images { display: grid; gap: 2px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tint-100); border-radius: var(--r1); }
.post-images.n2 { grid-template-columns: 1fr 1fr; } .post-images.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-images.n3 img:first-child { grid-row: span 2; }
.post-images img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-holder { position: relative; aspect-ratio: 16 / 9; background: rgba(0,0,0,.045); border-radius: var(--r1); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1); color: var(--muted); text-align: center; padding: var(--s4) var(--s5); }
.media-holder .ic { width: 28px; height: 28px; opacity: .7; }
.media-holder b { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--text2); }
.media-holder span { font-size: var(--t-xs); line-height: var(--lh-xs); max-width: 40ch; }
.media-holder .ratio { position: absolute; top: var(--s2); right: var(--s3); font-size: 11px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.post-figure figcaption { font-size: var(--t-xs); color: var(--muted); padding: var(--s2) 0 0; }
.post-meta { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2) 0; }
.post-meta:empty { display: none; }
.post-media { display: contents; }
.photo-note, .road-link { display: flex; gap: var(--s2); align-items: center; font-size: var(--t-sm); color: var(--muted); }
.road-link { color: var(--link); font-weight: 500; }
.author { display: flex; gap: var(--s3); align-items: center; min-width: 0; }
.author-meta { min-width: 0; }
.author-name { font-weight: 600; font-size: var(--t-sm); line-height: var(--lh-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: var(--s1); }
.author-name .dim { font-weight: 400; }
.author-sub { font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.author-sub a:hover, .author-name a:hover { text-decoration: underline; }
.reason { color: var(--link); }
.verified { display: inline-flex; width: 15px; height: 15px; border-radius: 50%; background: var(--link); color: #fff; align-items: center; justify-content: center; flex: none; }
.verified .ic { width: 10px; height: 10px; }

/* Tags: solid colour block, square corners */
.tag { display: inline-flex; align-items: center; font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; padding: var(--s1) var(--s2); border-radius: var(--r1); }
.tag-problem { background: var(--problem); color: var(--problem-ink); }
.tag-normal { background: var(--paper); color: var(--normal-ink); }
.post-normal .tag-normal { background: var(--paper); }
.tag-progress { background: var(--progress); color: var(--progress-ink); }
.tag-position_change { background: var(--position_change); color: var(--position_change-ink); }
.tag-election { background: var(--election); color: var(--election-ink); }
.chip { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 500; padding: var(--s1) var(--s2); border-radius: var(--r1); background: rgba(0,0,0,.06); color: var(--text2); }
.chip.dim { background: transparent; color: var(--muted); padding-left: 0; padding-right: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin: var(--s2) 0; }
.status { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; padding: var(--s1) var(--s2); border-radius: var(--r1); }
.st-open { background: #fde8e3; color: #8a2008; } .st-acknowledged { background: #e6eefb; color: #183e85; }
.st-in_progress, .st-bidding { background: #fdf0dc; color: #7a4300; } .st-resolved, .st-completed { background: #e3f4e6; color: #0b5e1a; }
.st-duplicate, .st-rejected, .st-forwarded { background: var(--raised2); color: var(--muted); }
.party { font-size: 11px; line-height: 14px; color: var(--muted); background: var(--raised2); padding: 1px var(--s1); border-radius: var(--r1); white-space: nowrap; }
.head-badge { font-size: 11px; line-height: 14px; font-weight: 600; color: var(--text2); background: var(--raised2); padding: 1px 6px; border-radius: var(--r1); vertical-align: 1px; }
.flag { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--danger); background: #fdebe6; padding: 1px var(--s2); border-radius: var(--r1); }
.flag-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0; }
.flag-box { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r1); background: #fdefeb; font-size: var(--t-sm); margin: var(--s2) 0; color: #5c1a0a; }
.flag-box.note { background: #fdf3e2; color: #5a3500; }
.flag-box .ic { color: var(--danger); margin-top: 2px; }
.flag-box.note .ic { color: var(--warn); }
.mentions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.mention { color: var(--link); font-size: var(--t-sm); font-weight: 500; }
.linked { padding-top: var(--s2); }
.linked-h { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--muted); margin-bottom: var(--s1); }
.linked-row { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; font-size: var(--t-sm); }
.linked-row:hover .grow { text-decoration: underline; }
.responsible { font-size: var(--t-sm); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.resp { color: var(--link); font-weight: 500; }
.repair { display: block; padding-top: var(--s2); font-size: var(--t-sm); }
.repair-top { display: flex; gap: var(--s2); align-items: center; }
.repair-facts { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-top: var(--s1); }
.repair-facts i { font-style: normal; color: var(--muted); }
.repair-facts i.bad { color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: var(--r1); flex: none; display: inline-block; }
.dot-problem { background: var(--problem); } .dot-normal { background: var(--ink-300); } .dot-progress { background: var(--progress); } .dot-position_change { background: var(--position_change); } .dot-election { background: var(--election); }
.actions { display: flex; align-items: center; gap: var(--s2); margin: 0 calc(-1 * var(--s2)); }
.act { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: var(--s2); border-radius: var(--r1); font-weight: 600; font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--text2); font-variant-numeric: tabular-nums; }
.act .ic { width: 22px; height: 22px; }
.act:hover { background: rgba(0,0,0,.05); color: var(--text); }
.act.on { color: var(--text); }
.act.save { margin-left: auto; }
.original { font-size: var(--t-xs); line-height: var(--lh-xs); margin: calc(-1 * var(--s2)) 0 var(--s3); color: var(--muted); }
.post:not(.full) { cursor: pointer; }
.post:not(.full):hover .post-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ================= Avatars ================= */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; line-height: 1; }
.avatar.ring { box-shadow: none; }
.avatar { overflow: hidden; }
.avatar > img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }

/* ================= Buttons (flat, no borders) ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); border-radius: var(--r1); height: 40px; padding: 0 var(--s4); font-weight: 600; font-size: var(--t-sm); white-space: nowrap; text-align: center; border: 0; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover:not(:disabled) { background: #000; }
.btn-ghost { background: var(--raised2); color: var(--text); }
.btn-ghost:hover { background: var(--tint-200); }
.btn-progress { background: var(--progress); color: var(--progress-ink); }
.btn-sm { height: 32px; padding: 0 var(--s3); font-size: var(--t-xs); }
.btn-block { display: flex; width: 100%; margin: var(--s3) 0; height: 44px; }
.feed + .btn-block, .main > .btn-block { width: calc(100% - 2 * var(--s4)); margin: var(--s3) var(--s4); }
.btn-soon { background: transparent; color: var(--muted); font-size: var(--t-xs); font-weight: 500; background: repeating-linear-gradient(135deg, var(--tint-50) 0 6px, var(--tint-100) 6px 12px); }
.btn-soon:hover { color: var(--text2); }
.soon { font-size: 11px; font-weight: 600; background: var(--paper); color: var(--text2); padding: 1px 6px; border-radius: var(--r1); }
.btn-digi { background: #1d3f8f; color: #fff; height: 48px; font-size: var(--t-md); }
.digi-mark { display: inline-flex; width: 28px; height: 28px; border-radius: var(--r1); background: #fff; color: #1d3f8f; font-weight: 700; font-size: var(--t-xs); align-items: center; justify-content: center; }
.btn-row { display: flex; gap: var(--s2); margin: var(--s3) 0 var(--s1); }
.btn-row.wrap { flex-wrap: wrap; }
.btn-col { display: flex; flex-direction: column; gap: var(--s2); }
.chip-btn { background: var(--raised2); padding: var(--s2) var(--s3); border-radius: var(--r1); font-size: var(--t-sm); line-height: var(--lh-sm); font-weight: 500; }
.chip-btn:hover { background: var(--tint-200); }
.chip-btn.on { background: var(--text); color: #fff; }

/* ================= Sections & clerical rows ================= */
.card { background: var(--raised); border-radius: var(--r2); margin: var(--s4); }
.card.pad { padding: var(--s4); }
.list { padding: var(--s1) 0; }
.list > .row, .list > .pos-block, .list > .btn-block, .list > div > .row { margin-left: var(--s4); margin-right: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; min-width: 0; }
.row.as-btn { width: 100%; text-align: left; padding: var(--s3) var(--s2); }
.row.as-btn:hover, a.row:hover { background: var(--tint-100); }
.danger { color: var(--danger); }
.row-main { flex: 1; min-width: 0; }
.row-t { font-weight: 600; font-size: var(--t-sm); line-height: var(--lh-sm); }
.row-s { font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.region-ic, .proj-ic { width: 40px; height: 40px; border-radius: var(--r1); background: var(--raised2); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text2); }
.proj-ic.bad { color: var(--danger); background: #fdebe6; }
.pos-block { padding-bottom: var(--s2); }
.resp-list { display: flex; flex-wrap: wrap; gap: var(--s1); padding-left: 52px; }
.resp-list span { font-size: var(--t-xs); color: var(--text2); background: var(--raised2); padding: 2px var(--s2); border-radius: var(--r1); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin-bottom: var(--s3); }
.sec-h b { font-size: var(--t-lg); line-height: var(--lh-lg); font-weight: 600; }
/* Clerical key/value rows: zebra tint, label left, value right, tabular numbers */
.kv { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s3); font-size: var(--t-sm); line-height: var(--lh-sm); }
.kv:nth-child(odd) { background: rgba(0,0,0,.035); }
.kv > span:first-child { color: var(--muted); flex: none; max-width: 45%; }
.kv > :last-child { text-align: right; }
.kv a { color: var(--link); }
.bullets { margin: 0 0 var(--s2); padding-left: var(--s5); }
.bullets li { margin: var(--s1) 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) var(--s4); font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.crumbs a:hover { color: var(--link); }
.wo-detail { display: block; padding: var(--s3) 0; }
.wo-detail + .wo-detail { margin-top: var(--s3); }

/* ================= Budget & money (clerical) ================= */
.budget-row { margin: var(--s3) 0; }
.budget-l { display: flex; justify-content: space-between; font-size: var(--t-sm); margin: var(--s2) 0; gap: var(--s3); }
.budget-l b { font-weight: 600; font-variant-numeric: tabular-nums; }
.budget-l.big { font-size: var(--t-md); }
.bar { height: 6px; background: var(--tint-200); overflow: hidden; }
.bar.thin { height: 4px; margin-top: var(--s2); }
.bar i { display: block; height: 100%; background: var(--text); }
.bar.over i { background: var(--danger); }
.budget-total { font-size: var(--t-2xl); line-height: var(--lh-2xl); font-weight: 600; letter-spacing: -0.3px; display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.budget-total span { font-size: var(--t-sm); font-weight: 400; color: var(--muted); }
.stack { display: flex; height: 12px; overflow: hidden; margin: var(--s3) 0 var(--s2); gap: 2px; }
.stack i { display: block; height: 100%; min-width: 3px; }
.budget-line { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s2) var(--s3); text-align: left; font-size: var(--t-sm); }
.budget-line:nth-child(odd) { background: rgba(0,0,0,.035); }
.budget-line:hover:not(.static), .budget-line.on { background: var(--tint-200); }
.budget-line .pctv { width: 52px; text-align: right; color: var(--muted); }
.sw { width: 10px; height: 10px; border-radius: var(--r1); flex: none; }
.chart-wrap { position: relative; display: flex; justify-content: center; margin: var(--s2) 0 var(--s4); }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; display: flex; flex-direction: column; }
.donut-center b { font-size: var(--t-xl); } .donut-center span { font-size: var(--t-xs); color: var(--muted); }
.money-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s1); margin-top: var(--s4); }
.money-grid div { padding: var(--s3); display: flex; flex-direction: column; background: rgba(0,0,0,.035); }
.money-grid b { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; } .money-grid span { font-size: var(--t-xs); color: var(--muted); }
.audit-row { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s2); }
.audit-row:nth-child(odd) { background: rgba(0,0,0,.035); }
.audit-row:hover { background: var(--tint-200); }
.ward-row { display: block; padding: var(--s2) 0; }
.summary p { font-size: var(--t-md); line-height: var(--lh-md); color: var(--text2); }
.plan .plan-top { display: flex; gap: var(--s3); align-items: center; }
.rank-big { font-size: var(--t-2xl); font-weight: 600; color: var(--muted); width: 32px; font-variant-numeric: tabular-nums; }
.risk, .score { display: flex; flex-direction: column; align-items: center; font-size: var(--t-xl); line-height: 1; font-weight: 600; padding: var(--s2) var(--s3); border-radius: var(--r1); background: var(--raised2); }
.risk small, .score small { font-size: 10px; font-weight: 600; color: var(--muted); margin-top: var(--s1); }
.risk.r4, .risk.r3 { color: var(--danger); } .risk.r2 { color: var(--warn); }
.score { flex-direction: row; align-items: baseline; gap: 2px; }
.score.s4, .score.s3 { color: var(--ok); } .score.s2 { color: var(--warn); } .score.s1, .score.s0 { color: var(--danger); }
.factors { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2) var(--s4); margin: var(--s3) 0; font-size: var(--t-xs); color: var(--muted); }
.why { font-size: var(--t-sm); margin-bottom: var(--s3); }
.rec { display: flex; gap: var(--s3); align-items: center; background: var(--raised2); padding: var(--s3); border-radius: var(--r1); margin-bottom: var(--s2); }

/* ================= Profile (header + content on the same scale) ================= */
.profile { padding: var(--s5) var(--s4); }
.profile-top { display: flex; align-items: center; gap: var(--s5); margin-bottom: var(--s4); }
.profile-stats { display: flex; flex: 1; justify-content: space-around; text-align: center; gap: var(--s2); }
.profile-stats div, .stats div { display: flex; flex-direction: column; }
.profile-stats b { font-size: var(--t-lg); line-height: var(--lh-lg); font-weight: 600; } .profile-stats span { font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.profile-name { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; }
.profile-sub { font-size: var(--t-sm); line-height: var(--lh-sm); margin-top: var(--s1); display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; color: var(--text2); }
.profile-sub a { color: var(--link); }
.profile .btn-row { margin-top: var(--s4); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); text-align: center; padding: 0 var(--s4) var(--s4); }
.stats div { background: var(--raised); padding: var(--s3) var(--s1); }
.stats b { font-size: var(--t-lg); line-height: var(--lh-lg); font-weight: 600; } .stats span { font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); margin: var(--s4); }
.card .kpis { margin: var(--s1) 0 var(--s2); }
.kpi { padding: var(--s3) var(--s2); text-align: center; display: flex; flex-direction: column; background: var(--raised); }
.card .kpi { background: var(--paper); }
.kpi b { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; } .kpi span { font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.kpi.on { background: var(--text); color: #fff; } .kpi.on span { color: rgba(255,255,255,.75); }
.kpi.warn b { color: var(--warn); } .kpi.danger b, .kpi.bad b { color: var(--danger); } .kpi.ok b { color: var(--ok); }
.kpi.on b { color: #fff !important; }
@media (max-width: 480px) { .kpis { grid-template-columns: repeat(2, 1fr); } .factors { grid-template-columns: repeat(2, 1fr); } }

/* ================= Map ================= */
.map { width: calc(100% - 2 * var(--s4)); margin: var(--s2) var(--s4); background: var(--raised2); z-index: 0; border-radius: var(--r1); }
.card .map { width: 100%; margin: var(--s2) 0 0; }
.leaflet-container { font: inherit; }

/* ================= Tree ================= */
.tree-node { margin-left: calc(min(var(--d), 1) * var(--s4)); padding-left: var(--s1); background: linear-gradient(var(--tint-200), var(--tint-200)) left / 2px 100% no-repeat; }
.tree-node[style*="--d:0"] { background: none; margin-left: 0; }
.tree-row { display: flex; align-items: flex-start; gap: var(--s1); padding: var(--s2) 0; }
.tree-toggle { width: 28px; height: 28px; color: var(--muted); flex: none; }
.tree-main { flex: 1; min-width: 0; }
.tree-t { font-weight: 600; font-size: var(--t-sm); }
.lvl { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: var(--s1); }
.tree-s { font-size: var(--t-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.structure .st-row { display: flex; gap: var(--s3); padding: var(--s3) 0; }
.st-n { width: 24px; height: 24px; border-radius: var(--r1); background: var(--raised2); font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; font-size: var(--t-xs); }

/* ================= Search ================= */
.search { flex: 1; display: flex; align-items: center; gap: var(--s3); background: var(--raised2); border-radius: var(--r1); padding: 0 var(--s3); color: var(--muted); }
.search:focus-within { background: var(--tint-200); }
.search input { background: none; padding: var(--s3) 0; font-size: var(--t-md); }
.search input:focus { background: none; }

/* ================= Compose (base; compose.css refines) ================= */
.compose, .pick-step { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.type-opt { display: flex; align-items: center; gap: var(--s4); width: 100%; text-align: left; padding: var(--s4); border-radius: var(--r1); background: var(--raised); }
.type-opt:hover { background: var(--tint-100); }
.type-opt b { font-weight: 600; }
.type-swatch { width: 40px; height: 40px; border-radius: var(--r1); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.sw-problem { background: var(--problem); color: var(--problem-ink); } .sw-normal { background: var(--paper); color: var(--text); } .sw-progress { background: var(--progress); } .sw-position_change { background: var(--position_change); } .sw-election { background: var(--election); }
.tag-pick { display: flex; gap: var(--s3); align-items: center; }
.rule-note { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--text2); background: var(--raised); padding: var(--s3); border-radius: var(--r1); }
.title-input { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; background: none; padding: var(--s3) 0; }
.body-input { background: none; padding: var(--s2) 0; resize: vertical; font-size: var(--t-md); line-height: var(--lh-md); }
.title-input:focus, .body-input:focus { background: none; }
.field { display: flex; flex-direction: column; gap: var(--s2); font-size: var(--t-xs); color: var(--muted); margin: var(--s2) 0; }
.field > span { font-weight: 600; color: var(--text2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.check-row { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s2); font-size: var(--t-sm); }
.check-row:nth-child(odd) { background: rgba(0,0,0,.035); }
.attach-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.thumbs { display: flex; gap: var(--s2); flex-wrap: wrap; }
.thumb { position: relative; width: 88px; height: 88px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r1); }
.thumb button { position: absolute; top: var(--s1); right: var(--s1); width: 24px; height: 24px; background: var(--text); color: #fff; }
.picker { padding: var(--s3); display: flex; flex-direction: column; gap: 2px; }
.pick { text-align: left; padding: var(--s2); font-size: var(--t-sm); color: var(--link); }
.pick:hover { background: var(--tint-100); }
.form { display: flex; flex-direction: column; gap: var(--s1); }
.input { margin-bottom: var(--s2); }
.card.inset { margin: var(--s2) 0; }
.camera { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.cam-shutter { aspect-ratio: 4 / 3; border-radius: var(--r1); background: var(--raised); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); }
.cam-preview { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r1); }

/* ================= Post page (base; thread.css refines) ================= */
.official-panel { background: var(--raised); }
.status-pick { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s3) 0; }
.assign-src { display: inline-block; margin-right: var(--s2); }
.comments { padding: var(--s2) 0; }
.comments > .sec-h { padding: var(--s3) var(--s4) var(--s1); }
.comment { padding: var(--s3) var(--s4); }
.comment p { margin: var(--s2) 0 0 44px; white-space: pre-wrap; color: var(--text2); font-size: var(--t-md); line-height: var(--lh-md); }
.comment.official { background: none; }
.comment-box { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); display: flex; gap: var(--s2); padding: var(--s3) var(--s4); background: var(--raised); }
@media (min-width: 768px) { .comment-box { bottom: 0; } }

/* ================= Dashboard ================= */
.dash-item { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); }
.dash-item:nth-child(odd) { background: rgba(0,0,0,.025); }
.dash-item.unviewed .row-t, .dash-item.unviewed b { font-weight: 600; }
.dash-check { display: flex; flex-direction: column; align-items: center; gap: var(--s1); }
.rank { font-size: var(--t-xs); color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-main { flex: 1; min-width: 0; }
.flag-new { font-size: 11px; font-weight: 600; color: var(--problem-ink); background: var(--problem); padding: 1px 6px; border-radius: var(--r1); }
.flag-due { font-size: 11px; font-weight: 600; color: var(--danger); background: #fdebe6; padding: 1px 6px; border-radius: var(--r1); }
.bulk-bar { position: sticky; bottom: calc(var(--nav-h) + var(--s2) + env(safe-area-inset-bottom)); margin: var(--s3) var(--s4); padding: var(--s3) var(--s4); background: var(--text); color: #fff; border-radius: var(--r1); display: flex; gap: var(--s2); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bulk-bar .btn-ghost { background: rgba(255,255,255,.14); color: #fff; }
@media (min-width: 768px) { .bulk-bar { bottom: var(--s3); } }
.mode-opt { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; background: var(--raised); border-radius: var(--r1); padding: var(--s3) var(--s4); margin: var(--s2) 0; }
.mode-opt.on { background: var(--text); color: #fff; }
.mode-opt.on .dim { color: rgba(255,255,255,.75); }
.src { font-size: var(--t-xs); } .src-rules { color: var(--muted); } .src-person { color: var(--progress); } .src-user { color: var(--warn); }

/* ================= Project bids table (clerical) ================= */
.table-wrap { overflow-x: auto; }
.bids { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.bids th { text-align: left; font-size: var(--t-xs); color: var(--muted); font-weight: 600; padding: var(--s2); background: var(--tint-100); }
.bids td { padding: var(--s2); vertical-align: top; }
.bids tr:nth-child(even) td { background: rgba(0,0,0,.035); }
.bids td a { color: var(--link); font-weight: 600; }
.bids tr.won td { background: #e3f4e6; }
.best { font-size: 11px; color: var(--ok); font-weight: 600; }

/* ================= Settings ================= */
.settings { display: flex; min-height: 100vh; }
.set-nav { width: 100%; padding: var(--s5) var(--s4) var(--s6); }
.set-h { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; padding: 0 var(--s3) var(--s4); display: flex; justify-content: space-between; align-items: center; min-height: var(--header-h); }
.set-group { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--muted); padding: var(--s5) var(--s3) var(--s2); }
.set-item { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: var(--s3); border-radius: var(--r1); width: 100%; text-align: left; font-size: var(--t-md); line-height: var(--lh-md); }
.set-item:hover { background: var(--tint-100); }
.set-item.on { background: var(--tint-100); font-weight: 600; }
.set-pane { flex: 1; padding: var(--s5) var(--s4) var(--s7); max-width: 680px; }
.set-pane-h { display: flex; align-items: center; gap: var(--s2); min-height: var(--header-h); margin: calc(-1 * var(--s5)) 0 var(--s4); }
.set-pane-h h2 { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 600; margin: 0; }
.set-card { background: var(--raised); border-radius: var(--r1); padding: var(--s4); margin-bottom: var(--s4); }
.set-card > p:last-child { margin-bottom: 0; }
.set-card .kv:nth-child(odd) { background: rgba(0,0,0,.035); }
.set-toggle { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); min-height: 56px; background: var(--raised); border-radius: var(--r1); padding: var(--s3) var(--s4); margin-bottom: var(--s2); font-size: var(--t-md); line-height: var(--lh-md); }
input.switch { appearance: none; width: 40px; height: 24px; border-radius: 12px; background: var(--ink-300); position: relative; cursor: pointer; padding: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
input.switch:checked { background: var(--text); } input.switch:checked::after { left: 19px; }
.settings.has-pane .set-nav { display: none; }
@media (min-width: 900px) {
  .set-nav { width: 340px; flex: none; height: 100vh; overflow-y: auto; position: sticky; top: 0; background: var(--raised); }
  .set-pane { padding: var(--s5) var(--s6) var(--s7); }
  .settings.has-pane .set-nav { display: block; }
  .set-back { display: none; }
}

/* ================= Sheet ================= */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; max-height: 88vh; border-radius: var(--r2) var(--r2) 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 768px) { .sheet-wrap { align-items: center; } .sheet { border-radius: var(--r2); } .sheet-handle { display: none; } }
.sheet-handle { width: 36px; height: 4px; background: var(--tint-300); margin: var(--s2) auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s2) var(--s2) var(--s2) var(--s4); background: var(--raised); }
.sheet-head b { font-size: var(--t-lg); font-weight: 600; }
.sheet-body { overflow-y: auto; padding: var(--s4); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= Login / onboarding ================= */
.login, .onboard { max-width: 440px; margin: 0 auto; padding: var(--s5) var(--s4); }
.login .topbar { margin: calc(-1 * var(--s5)) calc(-1 * var(--s4)) var(--s3); }
.login-hero { padding: var(--s6) 0 var(--s5); text-align: center; }
.login-hero p { color: var(--text2); font-size: var(--t-md); line-height: var(--lh-md); }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--t-xs); margin: var(--s5) 0 var(--s2); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--tint-200); }
.demo-list { background: var(--raised); border-radius: var(--r1); padding: var(--s1); }
.demo-list .row .ic:last-child { transform: rotate(180deg); color: var(--muted); }
.digi-card { border-radius: var(--r1); padding: var(--s4); background: var(--raised); }
.digi-head { display: flex; gap: var(--s3); align-items: center; background: #1d3f8f; color: #fff; margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r1) var(--r1) 0 0; }
.steps { display: flex; gap: var(--s1); margin-bottom: var(--s4); }
.steps i { flex: 1; height: 3px; background: var(--tint-200); }
.steps i.on { background: var(--text); }
.onboard .card { margin: var(--s3) 0; }
.sticky-cta { position: sticky; bottom: var(--s3); }
.login-lang { display: flex; justify-content: flex-end; }

/* ================= Misc ================= */
.notif { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); font-size: var(--t-sm); line-height: var(--lh-sm); }
.notif .dot { margin-top: 6px; }
.notif.unread { background: var(--raised); }
.road-row { display: flex; gap: var(--s3); padding: var(--s3) 0; }
.road-ic { width: 40px; height: 40px; border-radius: var(--r1); background: var(--raised2); display: flex; align-items: center; justify-content: center; flex: none; }
.empty { text-align: center; color: var(--muted); padding: var(--s6) var(--s5); font-size: var(--t-sm); }
.empty a { color: var(--link); }
.empty.error { color: var(--danger); }
.loading { display: flex; gap: var(--s2); justify-content: center; padding: var(--s7); }
.loading span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite alternate; }
.loading span:nth-child(2) { animation-delay: .2s; } .loading span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { to { opacity: .2; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--s5) + env(safe-area-inset-bottom)); background: var(--text); color: #fff; padding: var(--s3) var(--s4); border-radius: var(--r1); font-size: var(--t-sm); z-index: 400; max-width: calc(100% - 2 * var(--s4)); }
.nav-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= Language picker (UI only) ================= */
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: var(--s1); height: 40px; padding: 0 var(--s3); border-radius: var(--r1); background: var(--raised2); font-weight: 600; font-size: var(--t-xs); color: var(--text2); }
.lang-btn .ic { width: 18px; height: 18px; }
.lang-btn:hover { background: var(--tint-200); }
.lang-menu { position: absolute; right: 0; top: 44px; width: 240px; max-height: 70vh; overflow-y: auto; background: var(--paper); border-radius: var(--r1); padding: var(--s2); z-index: 120; outline: 1px solid var(--tint-200); }
.lang-h { font-weight: 600; padding: var(--s2) var(--s3); }
.lang-sep { font-size: var(--t-xs); font-weight: 600; color: var(--muted); padding: var(--s3) var(--s3) var(--s1); margin-top: var(--s2); }
.lang-item { display: flex; align-items: center; gap: var(--s2); width: 100%; padding: var(--s2) var(--s3); text-align: left; font-size: var(--t-sm); }
.lang-item:hover { background: var(--tint-100); }
.lang-item .ic { margin-left: auto; color: var(--text); }
.lang-item.on span { font-weight: 600; }
.section-h { padding: var(--s5) var(--s4) 0; margin-bottom: 0; }
.profile-actions { padding: var(--s2) var(--s4); }
.profile-actions .row { padding: var(--s3) var(--s2); }
.card .row-main { font-size: var(--t-md); line-height: var(--lh-md); }
.card .row-main .row-t { font-size: var(--t-sm); }
/* Settings alignment: both column titles sit on the same 64px header line */
.set-nav { padding-top: 0; }
.set-h { padding: 0 var(--s3); margin-bottom: var(--s2); }
.set-pane { padding-top: 0; }
.set-pane-h { margin-top: 0; }
@media (min-width: 900px) { .set-nav { background: var(--paper); padding-top: 0; } .set-pane { padding-top: 0; } }
.set-card:has(> .kv) { padding: 0; background: none; }
/* Profile: one container rhythm */
.profile-actions { padding: var(--s1) var(--s2); }
.profile-actions .row { padding: var(--s3); }
.award-reason { border-left: 4px solid var(--progress); }

/* Illustrative photos (Wikimedia Commons) in posts and stories */
.post-figure-ill figcaption { font-size: 11px; line-height: 14px; color: var(--muted); padding: var(--s1) 0 0; }
.story-photo { margin: var(--s4) auto 0; width: 100%; max-width: 640px; }
.story-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r1); }
.story-photo figcaption { font-size: 11px; line-height: 14px; color: var(--muted); padding-top: var(--s1); }
.story-view .story-text { flex: 0 0 auto; padding-top: var(--s5); }
