/* UnitVO app — design system and shell (1 Nov 2026)
   Brand: Emerald #059669 · Gold #D97706 · Obsidian #090D16. Small text on white uses #047857 / #B45309.
   Layout: rail (expanded 256 px / collapsed 72 px) + top bar + content. Phone (< 768 px): bottom bar + drawer. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url(/assets/fonts/plex-arabic-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url(/assets/fonts/plex-arabic-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url(/assets/fonts/plex-arabic-700.woff2) format("woff2"); }
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/noto-nastaliq-urdu.woff2) format("woff2"); }

:root {
  /* Brand */
  --emerald: #059669;
  --emerald-text: #047857;
  --emerald-strong: #065f46;
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-300: #6ee7b7;
  --gold: #d97706;
  --gold-text: #b45309;
  --gold-50: #fffbeb;
  --gold-100: #fef3c7;
  --obsidian: #090d16;
  --obsidian-2: #111827;
  --obsidian-3: #1f2937;

  /* Neutrals (text contrast on white: --text 15.9:1, --text-2 7.6:1, --text-3 4.8:1) */
  --text: #101828;
  --text-2: #475467;
  --text-3: #667085;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-2: #d0d5dd;

  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #fecdca;
  --warn-bg: var(--gold-50);
  --warn-border: #fde68a;
  --ok-bg: var(--emerald-50);
  --ok-border: var(--emerald-200);
  --info: #175cd3;
  --info-bg: #eff8ff;
  --info-border: #b2ddff;

  /* Spacing scale (4 px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* Type scale */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --lh: 1.55;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Inter", "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-ur: "Inter", "Noto Nastaliq Urdu", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 40px rgba(9, 13, 22, .22);

  --rail-w: 256px;
  --rail-w-collapsed: 72px;
  --topbar-h: 64px;
  --bottombar-h: 64px;
  --tap: 44px;
  --focus: 0 0 0 3px rgba(5, 150, 105, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: var(--font-ar); }
html[lang="ur"] body { font-family: var(--font-ur); line-height: 2; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { line-height: 1.9; }

img, svg { max-width: 100%; }
a { color: var(--emerald-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--text); margin: 0; font-weight: 650; letter-spacing: -0.01em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; }
p { margin: 0 0 var(--s3); }
small { font-size: var(--fs-sm); }
code { background: #f2f4f7; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }

:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 4px; }
.uv-rail :focus-visible, .uv-bottombar :focus-visible { outline-color: var(--emerald-300); }

.uv-ico { flex: none; display: inline-block; vertical-align: middle; }
html[dir="rtl"] .uv-flip { transform: scaleX(-1); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Skip link ---------- */
.uv-skip { display: inline-flex; align-items: center; min-height: var(--tap); position: absolute; inset-inline-start: var(--s3); top: -60px; z-index: 1000; background: var(--obsidian); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; }
.uv-skip:focus { top: var(--s3); text-decoration: none; }

/* ---------- App frame ---------- */
.uv-app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
html.uv-rail-collapsed .uv-app { grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr); }
.uv-main-col { min-width: 0; display: flex; flex-direction: column; }
.uv-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: var(--s6) var(--s8) var(--s12); min-width: 0; }
.uv-main:focus { outline: none; }
.uv-public .uv-main { max-width: 1100px; }

/* ---------- Rail ---------- */
.uv-rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: var(--obsidian); color: #d0d5dd;
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s4) var(--s3) var(--s4);
  border-inline-end: 1px solid #1d2433;
  scrollbar-width: thin; scrollbar-color: #344054 transparent;
}
.uv-rail-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 2px var(--s1) var(--s4); }
.uv-brand { display: flex; align-items: center; min-height: 48px; border-radius: var(--r-sm); }
.uv-brand:hover { text-decoration: none; }
.uv-brand .uv-lockup { height: 46px; width: auto; display: block; }
.uv-brand .uv-mark { width: auto; height: 40px; display: none; }
.uv-rail-toggle { flex: none; }

.uv-nav { display: flex; flex-direction: column; gap: 2px; }
.uv-nav-section { font-size: var(--fs-xs); font-weight: 600; color: #98a2b3; padding: var(--s4) var(--s3) var(--s1); letter-spacing: .02em; }
html[lang="ur"] .uv-nav-section { font-size: 13px; }
.uv-nav-link {
  position: relative; display: flex; align-items: center; gap: var(--s3);
  min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-sm);
  color: #d0d5dd; font-size: 14px; font-weight: 500; text-decoration: none;
}
html[lang="ur"] .uv-nav-link { font-size: 14px; }
.uv-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.uv-nav-link.is-active { background: rgba(5, 150, 105, .18); color: #fff; }
.uv-nav-link.is-active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
html[dir="rtl"] .uv-nav-link.is-active::before { border-radius: 3px 0 0 3px; }
.uv-nav-link .uv-ico { color: #98a2b3; }
.uv-nav-link:hover .uv-ico, .uv-nav-link.is-active .uv-ico { color: var(--emerald-300); }
.uv-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uv-rail-foot { margin-top: auto; padding-top: var(--s4); border-top: 1px solid #1d2433; }
.uv-rail-foot .uv-nav-section { padding-top: var(--s2); }

/* Collapsed rail (tablet default, or chosen on desktop) */
html.uv-rail-collapsed .uv-rail { padding-inline: var(--s2); }
html.uv-rail-collapsed .uv-brand .uv-lockup { display: none; }
html.uv-rail-collapsed .uv-brand .uv-mark { display: block; }
html.uv-rail-collapsed .uv-rail-head { flex-direction: column; padding-inline: 0; }
html.uv-rail-collapsed .uv-nav-label, html.uv-rail-collapsed .uv-nav-section { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.uv-rail-collapsed .uv-nav-link { justify-content: center; padding: 0; }
html.uv-rail-collapsed .uv-nav-link.is-active::before { inset-inline-start: -8px; }
html.uv-rail-collapsed .uv-nav-sep { display: block; height: 1px; background: #1d2433; margin: var(--s2) var(--s2); }
.uv-nav-sep { display: none; }
html.uv-rail-collapsed .uv-rail-toggle .uv-ico { transform: scaleX(-1); }
html.uv-rail-collapsed[dir="rtl"] .uv-rail-toggle .uv-ico { transform: none; }
html[dir="rtl"]:not(.uv-rail-collapsed) .uv-rail-toggle .uv-ico { transform: scaleX(-1); }

/* ---------- Top bar ---------- */
.uv-topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h); display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s6); background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.uv-topbar-start { display: flex; align-items: center; gap: var(--s2); min-width: 0; flex: 0 1 auto; }
.uv-topbar-mid { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.uv-topbar-end { display: flex; align-items: center; gap: var(--s1); flex: none; }
.uv-topbar-mark { display: none; flex: none; padding: 4px; margin-inline-start: -4px; min-height: var(--tap); min-width: var(--tap); }
.uv-topbar-mark img { width: auto; height: 36px; display: block; }

.uv-search-btn {
  display: flex; align-items: center; gap: var(--s2); width: 100%; max-width: 420px; min-height: var(--tap);
  padding: 0 var(--s3); border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface-2);
  color: var(--text-3); font: inherit; font-size: 14px; cursor: pointer; text-align: start;
}
.uv-search-btn:hover { border-color: var(--emerald); text-decoration: none; color: var(--text-2); }
.uv-search-btn span.uv-search-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-kbd { font: 600 12px/1 var(--font); color: var(--text-3); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; background: #fff; direction: ltr; }

.uv-iconbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: var(--tap); height: var(--tap); padding: 0 var(--s2); border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
}
.uv-iconbtn:hover { background: #f2f4f7; color: var(--text); text-decoration: none; }
.uv-iconbtn[aria-expanded="true"] { background: #f2f4f7; color: var(--text); }
.uv-rail .uv-iconbtn { color: #98a2b3; }
.uv-rail .uv-iconbtn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.uv-dot { position: absolute; top: 4px; inset-inline-end: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.uv-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 var(--s2); border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; direction: ltr; }
.uv-chip:hover { border-color: var(--border-2); color: var(--text); }
.uv-avatar { width: 32px; height: 32px; border-radius: var(--r-full); background: var(--emerald-text); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }

.uv-prop-btn { max-width: 280px; font-weight: 600; color: var(--text); }
.uv-prop-btn { min-width: 0; overflow: hidden; }
.uv-prop-btn .uv-prop-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 768px) { .uv-topbar-mid .uv-search-btn { min-width: 160px; } }
@media (min-width: 1024px) and (max-width: 1279px) { .uv-prop-btn { max-width: 190px; } .uv-search-btn .uv-kbd { display: none; } }
.uv-new-btn { white-space: nowrap; }

/* ---------- Menus (dropdowns) ---------- */
.uv-menu-wrap { position: relative; }
.uv-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 90;
  min-width: 240px; max-width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: var(--s2); display: none;
}
.uv-menu.is-start { inset-inline-end: auto; inset-inline-start: 0; }
.uv-menu.is-open { display: block; }
.uv-menu-head { padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--border); margin-bottom: var(--s2); }
.uv-menu-head strong { display: block; font-size: 14px; }
.uv-menu-head span { display: block; color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.uv-menu-label { font-size: 12px; color: var(--text-3); font-weight: 600; padding: var(--s2) var(--s3) var(--s1); }
.uv-menu-item {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: var(--tap); padding: 0 var(--s3);
  border-radius: var(--r-sm); border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: start; cursor: pointer;
}
.uv-menu-item:hover, .uv-menu-item:focus-visible { background: #f2f4f7; text-decoration: none; }
.uv-menu-item[aria-current="true"], .uv-menu-item.is-current { color: var(--emerald-text); font-weight: 600; }
.uv-menu-item .uv-ico { color: var(--text-3); }
.uv-menu-item .uv-menu-meta { margin-inline-start: auto; color: var(--text-3); font-size: 12px; }
.uv-menu-sep { height: 1px; background: var(--border); margin: var(--s2) 0; }
.uv-menu-note { padding: var(--s2) var(--s3); color: var(--text-2); font-size: 13px; }
.uv-menu-details > summary { list-style: none; }
.uv-menu-details > summary::-webkit-details-marker { display: none; }
.uv-menu-details[open] > summary { color: var(--text); font-weight: 600; }
.uv-show-phone { display: none; }
.uv-notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border-radius: var(--r-sm); color: var(--text); font-size: 14px; }
.uv-notice:hover { background: #f2f4f7; text-decoration: none; }
.uv-notice .uv-ico { margin-top: 2px; }
.uv-notice.tone-danger .uv-ico { color: var(--danger); }
.uv-notice.tone-warn .uv-ico { color: var(--gold-text); }
.uv-notice.tone-ok .uv-ico { color: var(--emerald-text); }

/* ---------- Page header ---------- */
.uv-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.uv-page-head h1 { font-size: var(--fs-2xl); line-height: 1.25; }
.uv-page-head p { color: var(--text-2); margin: var(--s2) 0 0; max-width: 680px; }
.uv-page-head .uv-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.uv-eyebrow { font-size: var(--fs-sm); color: var(--text-3); font-weight: 500; margin-bottom: var(--s1); }

/* ---------- Cards, sections ---------- */
.uv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-sm); min-width: 0; }
.uv-card + .uv-card { margin-top: var(--s5); }
.uv-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.uv-card-head h2 { font-size: var(--fs-lg); display: flex; align-items: center; gap: var(--s2); }
.uv-card-head h2 .uv-ico { color: var(--emerald-text); }
.uv-card-head p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.uv-muted { color: var(--text-2); }
.uv-subtle { color: var(--text-3); font-size: var(--fs-sm); }
.uv-stack { display: flex; flex-direction: column; gap: var(--s5); }
.uv-row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.uv-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s5); align-items: start; }
.uv-cols.is-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.uv-section-title { font-size: var(--fs-lg); margin: var(--s8) 0 var(--s4); display: flex; align-items: center; gap: var(--s2); }
.uv-section-title .uv-ico { color: var(--emerald-text); }

/* Stats */
.uv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
/* two or three tiles share the row instead of leaving half of it empty */
.uv-stats:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.uv-stats:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.uv-stat { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4) var(--s5); color: var(--text); box-shadow: var(--shadow-sm); }
a.uv-stat:hover { border-color: var(--emerald); text-decoration: none; }
.uv-stat-label { font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: var(--s2); }
.uv-stat-value { font-size: 30px; font-weight: 700; line-height: 1.2; margin-top: var(--s1); font-variant-numeric: tabular-nums; }
.uv-stat-note { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.uv-stat.tone-danger .uv-stat-value { color: var(--danger); }
.uv-stat.tone-warn .uv-stat-value { color: var(--gold-text); }
.uv-stat.tone-ok .uv-stat-value { color: var(--emerald-text); }

/* Lists */
.uv-list { list-style: none; margin: 0; padding: 0; }
.uv-list > li { border-top: 1px solid var(--border); }
.uv-list > li:first-child { border-top: 0; }
.uv-list-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; color: var(--text); min-height: 56px; }
a.uv-list-item:hover { text-decoration: none; background: var(--surface-2); margin: 0 calc(-1 * var(--s3)); padding-inline: var(--s3); border-radius: var(--r-sm); }
.uv-list-ico { flex: none; width: 36px; height: 36px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; background: #f2f4f7; color: var(--text-2); }
.uv-list-ico.tone-danger { background: var(--danger-bg); color: var(--danger); }
.uv-list-ico.tone-warn { background: var(--gold-50); color: var(--gold-text); }
.uv-list-ico.tone-ok { background: var(--emerald-50); color: var(--emerald-text); }
.uv-list-body { flex: 1 1 180px; min-width: 0; }
.uv-list-title { font-weight: 600; font-size: 14.5px; }
.uv-list-sub { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.uv-list-end { flex: none; display: flex; align-items: center; gap: var(--s2); max-width: 100%; }
/* A long status (Urdu "urgent, duty manager alerted") must not squeeze the text into one word a line: the end drops under it. */
.uv-list-item:has(> .uv-list-body) { flex-wrap: wrap; }
.uv-list-item > .uv-list-end { margin-inline-start: auto; }
.uv-list-end .uv-badge { white-space: normal; }

/* Empty states */
.uv-empty { text-align: center; padding: var(--s8) var(--s4); }
.uv-empty .uv-empty-ico { width: 48px; height: 48px; margin: 0 auto var(--s3); border-radius: var(--r-full); background: var(--emerald-50); color: var(--emerald-text); display: flex; align-items: center; justify-content: center; }
.uv-empty h3 { font-size: var(--fs-md); margin-bottom: var(--s1); }
.uv-empty p { color: var(--text-2); max-width: 420px; margin: 0 auto var(--s4); }

/* Callouts and toasts */
.uv-callout { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--r-md); border: 1px solid var(--info-border); background: var(--info-bg); color: var(--text); margin-bottom: var(--s5); }
.uv-callout .uv-ico { margin-top: 2px; color: var(--info); }
.uv-callout.tone-ok { background: var(--ok-bg); border-color: var(--ok-border); }
.uv-callout.tone-ok .uv-ico { color: var(--emerald-text); }
.uv-callout.tone-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.uv-callout.tone-warn .uv-ico { color: var(--gold-text); }
.uv-callout.tone-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.uv-callout.tone-danger .uv-ico { color: var(--danger); }
.uv-callout-body { flex: 1; min-width: 0; }
.uv-callout-body strong { display: block; }
.uv-callout-body p { margin: 2px 0 0; color: var(--text-2); }
.uv-callout .uv-iconbtn { margin: -8px; }

.uv-toast { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); margin-bottom: var(--s5); border-radius: var(--r-md); background: var(--obsidian-2); color: #fff; box-shadow: var(--shadow-md); }
.uv-toast .uv-ico { color: var(--emerald-300); margin-top: 2px; }
.uv-toast-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.uv-toast .uv-iconbtn { color: #d0d5dd; margin: -8px; }
.uv-toast .uv-iconbtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Buttons ---------- */
.btn, .uv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-sm);
  border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover, .uv-btn:hover { text-decoration: none; }
.btn:disabled, .uv-btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary, .btn-emerald, .uv-btn-primary { background: var(--emerald-text); color: #fff; }
.btn-primary:hover, .btn-emerald:hover, .uv-btn-primary:hover { background: var(--emerald-strong); color: #fff; }
.btn-outline, .uv-btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.btn-outline:hover, .uv-btn-secondary:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.uv-btn-quiet { background: transparent; color: var(--emerald-text); padding-inline: var(--s3); }
.uv-btn-quiet:hover { background: var(--emerald-50); color: var(--emerald-strong); }
.btn-danger, .uv-btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover, .uv-btn-danger:hover { background: #912018; color: #fff; }
.uv-btn-danger-quiet { background: transparent; color: var(--danger); }
.uv-btn-danger-quiet:hover { background: var(--danger-bg); }
.btn-cyan, .uv-btn-gold { background: var(--gold-text); color: #fff; }
.btn-cyan:hover, .uv-btn-gold:hover { background: #92400e; color: #fff; }
.uv-btn-sm { min-height: 34px; padding: 0 var(--s3); font-size: 13px; }
.uv-btn-block { width: 100%; }
@media (pointer: coarse) { .btn, .uv-btn, .uv-btn-sm { min-height: var(--tap); } }

/* ---------- Forms ---------- */
.uv-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.uv-field label, .uv-label { font-size: 14px; font-weight: 600; color: var(--text); }
.uv-hint { font-size: var(--fs-sm); color: var(--text-3); }
textarea, input:not([type]), input[type="url"], input[type="time"], input[type="month"], input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], select {
  width: 100%; max-width: 100%; min-height: var(--tap); padding: 9px 12px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm); font: inherit; font-size: 16px;
  margin-bottom: 10px; background: #fff; color: var(--text); box-shadow: var(--shadow-sm);
}
textarea { min-height: 96px; resize: vertical; }
.uv-field textarea, .uv-field input, .uv-field select { margin-bottom: 0; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--emerald); box-shadow: var(--focus); }
.uv-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.uv-form-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* ---------- Badges ---------- */
.badge, .uv-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 600; line-height: 20px; white-space: nowrap; border: 1px solid transparent; }
html[lang="ur"] .badge, html[lang="ur"] .uv-badge { line-height: 26px; font-size: 13.5px; } /* Nastaliq reads small at 12.5 px on phones */
.badge-ready, .badge-emerald, .uv-badge-ok { background: var(--emerald-50); color: var(--emerald-strong); border-color: var(--emerald-200); }
.badge-risk, .badge-amber, .uv-badge-warn { background: var(--gold-50); color: #92400e; border-color: var(--warn-border); }
.badge-blocked, .badge-danger, .uv-badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-info, .uv-badge-info { background: var(--info-bg); color: #1849a9; border-color: var(--info-border); }
.badge-cyan { background: var(--gold-50); color: var(--gold-text); border-color: var(--warn-border); }
.badge-neutral, .uv-badge-neutral { background: #f2f4f7; color: #344054; border-color: var(--border); }
.uv-badge-preview { background: #f4f3ff; color: #5925dc; border-color: #d9d6fe; }

/* ---------- Tables (become cards on phone) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }
.uv-table-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--r-md); overflow-x: auto; background: var(--surface); }
.card { position: relative; }
.uv-table { margin: 0; }
.uv-table tbody tr:last-child td { border-bottom: 0; }
.uv-table tbody tr:hover td { background: #fcfcfd; }
.uv-table td.uv-num, .uv-table th.uv-num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Tools catalogue ---------- */
.uv-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s4); }
.uv-tool { display: flex; flex-direction: column; gap: var(--s3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-sm); position: relative; }
.uv-tool:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }
.uv-tool-top { display: flex; align-items: flex-start; gap: var(--s3); }
.uv-tool-ico { flex: none; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--emerald-50); color: var(--emerald-text); display: flex; align-items: center; justify-content: center; }
.uv-tool h3 { font-size: 15.5px; line-height: 1.35; }
.uv-tool h3 a { color: var(--text); }
.uv-tool h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.uv-tool p { color: var(--text-2); font-size: 14px; margin: 0; flex: 1; }
.uv-tool-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); position: relative; z-index: 1; }
.uv-tool-foot form { margin: 0; }
.uv-pin-btn[aria-pressed="true"] { color: var(--gold-text); }
.uv-pin-btn[aria-pressed="true"] .uv-ico { fill: currentColor; }
.uv-tools-filter { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.uv-tools-filter input { max-width: 360px; margin: 0; }

/* ---------- Status dots for readiness ---------- */
.uv-dim { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.uv-dim::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.uv-dim.is-ok::before { background: var(--emerald); }
.uv-dim.is-warn::before { background: var(--gold); }
.uv-dim.is-bad::before { background: var(--danger); }

/* Calendar strip (bookings) */
.uv-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s2); }
.uv-day { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); text-align: center; background: var(--surface); }
.uv-day-name { font-size: 12.5px; color: var(--text-3); }
.uv-day-date { font-weight: 650; }
.uv-day-free { font-size: 22px; font-weight: 700; margin-top: var(--s1); font-variant-numeric: tabular-nums; }
.uv-day.is-full .uv-day-free { color: var(--danger); }
.uv-day.is-low .uv-day-free { color: var(--gold-text); }
.uv-day.is-ok .uv-day-free { color: var(--emerald-text); }
.uv-day-note { font-size: 12px; color: var(--text-3); }

/* Conversation */
.uv-thread { display: flex; flex-direction: column; gap: var(--s3); }
.uv-msg { max-width: 88%; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: #f2f4f7; font-size: 14.5px; }
.uv-msg.from-resident { align-self: flex-start; background: var(--emerald-50); }
.uv-msg.from-assistant { align-self: flex-end; background: var(--gold-50); }
.uv-msg.from-staff { align-self: flex-end; background: var(--info-bg); }
.uv-msg-meta { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }

details.uv-more { position: relative; }
details.uv-more > summary { list-style: none; }
details.uv-more > summary::-webkit-details-marker { display: none; }
details.uv-more[open] > .uv-menu { display: block; }

/* ---------- Legacy classes used by module pages (kept, calmer) ---------- */
.shell { max-width: 100%; }
.hero-banner {
  background: var(--obsidian); background-image: linear-gradient(120deg, #090d16 0%, #0b2b23 70%, #064e3b 100%);
  color: #fff; border-radius: var(--r-lg); padding: var(--s6); margin-bottom: var(--s6);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5); align-items: center;
}
.hero-banner h1 { margin: 4px 0 var(--s2); font-size: var(--fs-xl); line-height: 1.3; color: #fff; }
.hero-banner p { margin: 0; color: #d0d5dd; max-width: 820px; }
.eyebrow { font-size: 12.5px; color: #fcd34d; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: var(--s5); margin-bottom: var(--s6); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
.grid-4, .kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s4); box-shadow: var(--shadow-sm); }
.kpi-tile .label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi-tile .value { font-size: 22px; font-weight: 700; color: var(--text); margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-sm); min-width: 0; max-width: 100%; overflow-x: auto; }
.card h2 { margin: 0 0 var(--s3); font-size: var(--fs-lg); display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.card h3 { margin: var(--s4) 0 var(--s2); font-size: 15.5px; }
.msg-bubble { padding: var(--s3) var(--s4); border-radius: var(--r-md); margin-bottom: var(--s2); font-size: 14px; }
.msg-resident { background: var(--emerald-50); border-inline-start: 3px solid var(--emerald); }
.msg-assistant { background: var(--gold-50); border-inline-start: 3px solid var(--gold); }
.msg-system { background: var(--surface-2); border-inline-start: 3px solid var(--text-3); }
.sticker-thumb { width: 84px; height: 84px; object-fit: contain; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: #fff; color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.social-btn:hover { border-color: var(--emerald); background: var(--surface-2); text-decoration: none; }

/* ---------- Footer ---------- */
.uv-footer { padding: var(--s5) var(--s8); color: var(--text-3); font-size: 13px; border-top: 1px solid var(--border); display: flex; gap: var(--s4); flex-wrap: wrap; justify-content: space-between; }
.uv-footer a { color: var(--text-2); }

/* ---------- Bottom bar + drawer (phone) ---------- */
.uv-bottombar { display: none; }
.uv-scrim { display: none; }

/* ---------- Command palette ---------- */
.uv-palette { position: fixed; inset: 0; z-index: 990; display: none; align-items: flex-start; justify-content: center; padding: 10vh var(--s4) var(--s4); background: rgba(9, 13, 22, .55); }
.uv-palette.is-open { display: flex; }
.uv-palette-box { width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.uv-palette-input { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); border-bottom: 1px solid var(--border); }
.uv-palette-input .uv-ico { color: var(--text-3); }
.uv-palette-input input { border: 0; box-shadow: none; margin: 0; min-height: 56px; font-size: 16px; padding: 0; }
.uv-palette-input input:focus { box-shadow: none; }
.uv-palette-list { overflow-y: auto; padding: var(--s2); }
.uv-palette-group { font-size: 12px; font-weight: 600; color: var(--text-3); padding: var(--s3) var(--s3) var(--s1); }
.uv-palette-opt { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: 6px var(--s3); border-radius: var(--r-sm); color: var(--text); cursor: pointer; }
.uv-palette-opt .uv-ico { color: var(--text-3); }
.uv-palette-opt .uv-opt-sub { color: var(--text-3); font-size: 12.5px; margin-inline-start: auto; text-align: end; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uv-palette-opt[aria-selected="true"] { background: var(--emerald-50); }
.uv-palette-opt[aria-selected="true"] .uv-ico { color: var(--emerald-text); }
.uv-palette-opt:hover { text-decoration: none; background: #f2f4f7; }
.uv-palette-empty { padding: var(--s6); text-align: center; color: var(--text-2); }
.uv-palette-foot { border-top: 1px solid var(--border); padding: var(--s2) var(--s4); font-size: 12px; color: var(--text-3); }

/* ---------- Public (signed-out) top bar ---------- */
.uv-public-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s6); background: var(--obsidian); }
.uv-public-bar .uv-lockup { height: 40px; width: auto; display: block; }
.uv-public-bar .uv-iconbtn, .uv-public-bar .uv-chip { color: #d0d5dd; }
.uv-public-bar .uv-iconbtn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.uv-public-bar .uv-chip { background: transparent; border-color: #344054; }

/* ============ Responsive ============ */
@media (max-width: 1279px) {
  .uv-main { padding: var(--s6) var(--s6) var(--s12); }
  .uv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .uv-cols, .uv-cols.is-even { grid-template-columns: minmax(0, 1fr); }
  .uv-topbar { padding: 0 var(--s4); }
  .uv-new-btn .uv-btn-text { display: none; }
  .uv-new-btn { padding: 0; width: var(--tap); min-width: var(--tap); }
  .uv-search-btn .uv-kbd { display: none; }
  .uv-prop-btn { max-width: 200px; }
  .uv-hide-tablet { display: none !important; }
}
@media (max-width: 1279px) {
  /* Tables become stacked cards below 1280 px: with the rail open there is not room for 6+ columns */
  .uv-table-wrap { border: 0; background: transparent; overflow: visible; }
  .uv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .uv-table, .uv-table tbody, .uv-table tr, .uv-table td { display: block; width: 100%; }
  .uv-table tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s2) var(--s4); margin-bottom: var(--s3); }
  .uv-table td { border: 0; padding: 6px 0; display: flex; gap: var(--s3); justify-content: space-between; align-items: flex-start; }
  .uv-table td::before { content: attr(data-label); color: var(--text-3); font-size: 13px; font-weight: 600; flex: none; max-width: 45%; }
  .uv-table td[data-label=""]::before { display: none; }
  .uv-table td > * { text-align: end; }
  .uv-table td.uv-td-main { display: block; font-size: 15px; }
  .uv-table td.uv-td-main::before { display: none; }
  .uv-table td.uv-td-main > * { text-align: start; }
  .uv-table td.uv-td-actions { display: block; padding-top: var(--s2); }
  .uv-table td.uv-td-actions::before { display: none; }
  .uv-table td.uv-td-actions > * { text-align: start; }
  .uv-table tbody tr:hover td { background: transparent; }
  .uv-table td.uv-num { text-align: start; }

}
@media (min-width: 768px) and (max-width: 1279px) {
  .uv-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s6); }
  .uv-table td.uv-td-main, .uv-table td.uv-td-actions { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  :root { --fs-2xl: 24px; }
  .uv-app, html.uv-rail-collapsed .uv-app { grid-template-columns: minmax(0, 1fr); }
  .uv-rail {
    position: fixed; z-index: 120; top: 0; bottom: 0; inset-inline-start: 0; width: min(86vw, 320px); height: 100%;
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  html[dir="rtl"] .uv-rail { transform: translateX(105%); }
  html.uv-drawer-open .uv-rail { transform: none; }
  html.uv-rail-collapsed .uv-rail { padding-inline: var(--s3); }
  html.uv-rail-collapsed .uv-brand .uv-lockup { display: block; }
  html.uv-rail-collapsed .uv-brand .uv-mark { display: none; }
  html.uv-rail-collapsed .uv-rail-head { flex-direction: row; }
  html.uv-rail-collapsed .uv-nav-label, html.uv-rail-collapsed .uv-nav-section { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  html.uv-rail-collapsed .uv-nav-link { justify-content: flex-start; padding: 0 var(--s3); }
  html.uv-rail-collapsed .uv-nav-sep { display: none; }
  .uv-scrim { position: fixed; inset: 0; z-index: 110; background: rgba(9, 13, 22, .5); }
  html.uv-drawer-open .uv-scrim { display: block; }
  html.uv-drawer-open body { overflow: hidden; }
  .uv-rail-toggle { display: none; }
  .uv-drawer-close { display: inline-flex !important; }

  .uv-topbar { padding: 0 var(--s2); gap: 4px; }
  .uv-topbar-start { flex: 1 1 auto; min-width: 0; gap: 4px; }
  .uv-topbar-start .uv-menu-wrap { min-width: 0; flex: 1 1 auto; }
  .uv-topbar-mark { display: block; }
  .uv-topbar-mark img { height: 32px; }
  .uv-topbar-mid { justify-content: center; flex: 0 0 auto; }
  .uv-search-btn { width: var(--tap); min-width: var(--tap); padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .uv-search-btn .uv-search-text, .uv-search-btn .uv-kbd { display: none; }
  .uv-topbar-end { gap: 2px; }
  .uv-prop-btn { max-width: 100%; min-width: 0 !important; padding: 0 4px; overflow: hidden; }
  .uv-prop-btn .uv-prop-name { min-width: 0; }
  .uv-prop-btn > .uv-ico:first-child { display: none; }
  .uv-footer a { display: inline-flex; align-items: center; min-height: var(--tap); }
  .uv-footer { gap: 0 var(--s4); }
  .uv-hide-phone { display: none !important; }
  .uv-show-phone { display: block; }
  .uv-main { padding: var(--s4) var(--s4) calc(var(--bottombar-h) + var(--s8)); }
  .uv-footer { padding: var(--s4) var(--s4) calc(var(--bottombar-h) + var(--s4)); }
  .uv-page-head { margin-bottom: var(--s4); }
  .uv-page-head .uv-actions { width: 100%; }
  .uv-card { padding: var(--s4); border-radius: var(--r-md); }
  .uv-stats { gap: var(--s3); }
  .uv-stat { padding: var(--s3) var(--s4); }
  .uv-stat-value { font-size: 24px; }
  .uv-form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .uv-days { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(92px, 1fr); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: var(--s1); }
  .uv-day { scroll-snap-align: start; padding: var(--s3) var(--s2); }
  .uv-day-date { white-space: nowrap; }
  .uv-menu { position: fixed; top: calc(var(--topbar-h) - 4px); inset-inline: var(--s3) var(--s3); min-width: 0; max-width: none; }
  .uv-palette { padding: var(--s3); }
  .uv-palette-box { max-height: 88vh; }
  .btn, .uv-btn, .uv-btn-sm { min-height: var(--tap); }
  .uv-iconbtn { min-width: var(--tap); height: var(--tap); }
  a.uv-dim { min-height: var(--tap); }

  .uv-bottombar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; z-index: 100; inset-inline: 0; bottom: 0; height: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--obsidian); border-top: 1px solid #1d2433;
  }
  .uv-bottombar a, .uv-bottombar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: #98a2b3; font: inherit; font-size: var(--fs-xs); font-weight: 600; background: none; border: 0; cursor: pointer; min-height: var(--tap); padding: 4px 2px;
  }
  html[lang="ur"] .uv-bottombar a, html[lang="ur"] .uv-bottombar button { font-size: var(--fs-xs); line-height: 1.6; }
  .uv-bottombar a:hover { text-decoration: none; color: #fff; }
  .uv-bottombar .is-active { color: #fff; }
  .uv-bottombar .is-active .uv-ico { color: var(--emerald-300); }
  .uv-bottombar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Legacy */
  .hero-banner { grid-template-columns: minmax(0, 1fr); padding: var(--s4); }
  .hero-banner .sticker-thumb { display: none; }
  .hero-banner h1 { font-size: 20px; overflow-wrap: anywhere; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr) !important; }
  .card { padding: var(--s4); }
  form div[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .badge { white-space: normal; }
}
@media (min-width: 768px) {
  .uv-drawer-close { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .uv-rail, .uv-topbar, .uv-bottombar, .uv-footer, .uv-palette { display: none !important; }
  .uv-app { display: block; }
  body { background: #fff; }
}

/* One clear/close control in the palette and filters (hide the browser's own search "x") */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }

/* Data typed by people (often English inside an ar/ur page): each line takes the direction of its own first letter */
.uv-list-title, .uv-list-sub, .uv-td-main, .uv-msg > div[dir], .uv-callout-body p, .uv-toast-body { unicode-bidi: plaintext; }

/* ---------- UI pass 10 Nov 2026 ----------
   Type scale: 12 / 13 / 15 / 16 / 18 / 22 / 28 px (--fs-xs … --fs-2xl); nothing on screen under 12 px.
   Spacing: 4 / 8 / 12 / 16 / 20 / 24 / 32 / 40 / 48 px (--s1 … --s12). Breakpoints: phone < 768 (bottom bar,
   stacked table cards), tablet 768-1023 (collapsed rail, tables in their own scroll box), desktop >= 1024.
   Tap targets: 44 px on phones and on any coarse pointer. */
input[type="checkbox"], input[type="radio"] { width: 20px !important; height: 20px !important; margin: 2px 0 0; accent-color: var(--emerald-text); flex: none; vertical-align: -4px; }
.uv-check { display: flex; align-items: flex-start; gap: var(--s2); min-height: var(--tap); padding-block: 10px; margin: 0; font-weight: 500; cursor: pointer; line-height: 1.45; }
.uv-check > span { min-width: 0; }
input[type="file"] { max-width: 100%; min-height: var(--tap); font: inherit; font-size: 14px; color: var(--text-2); }
input[type="file"]::file-selector-button { min-height: 40px; margin-inline-end: var(--s3); padding: 0 var(--s4); border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }

/* User test r2 (UV-39): on touch screens, ticks and radio choices are easy to hit (44 px rows), and so are fold-outs. */
@media (pointer: coarse) {
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; flex: none; }
  label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
  details > summary { min-height: 44px; padding-block: 10px; box-sizing: border-box; }
  button[aria-busy="true"] { opacity: .6; }
}
