:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #0c0f16;
  --ink-2: #343b48;
  --muted: #687080;
  --line: #e4e7ed;
  --line-soft: #eef0f4;
  --gold: #b89146;
  --gold-text: #805a14;
  --gold-bright: #cfa962;
  --gold-tint: rgba(184, 145, 70, 0.12);
  --committed: #788291;
  --primary-bg: #0c0f16;
  --primary-fg: #ffffff;
  --green: #0d7a5f;
  --green-bg: rgba(13, 122, 95, 0.11);
  --amber: #b4690e;
  --amber-bg: rgba(180, 105, 14, 0.12);
  --blue: #1d5bd6;
  --blue-bg: rgba(29, 91, 214, 0.11);
  --red: #c9353f;
  --red-bg: rgba(201, 53, 63, 0.11);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 14, 22, 0.04), 0 12px 28px -8px rgba(10, 14, 22, 0.07);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #090b10;
  --surface: #121620;
  --surface-2: #181d2a;
  --ink: #f3f5f8;
  --ink-2: #c9d0dc;
  --muted: #8b94a5;
  --line: #232a3b;
  --line-soft: #1b2130;
  --gold: #d2ae68;
  --gold-text: #e0be7c;
  --gold-bright: #e0be7c;
  --gold-tint: rgba(210, 174, 104, 0.15);
  --committed: #8b94a5;
  --primary-bg: #d2ae68;
  --primary-fg: #0a0d14;
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.14);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.14);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.15);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.15);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 36px -10px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); transition: background .2s ease, color .2s ease; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: 0.98rem; font-weight: 700; }
small, .muted { color: var(--muted); }
.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  direction: ltr;
  unicode-bidi: isolate;
}

/* Top Obsidian Command Shell */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 11px 24px;
  background: #0b0e14;
  color: #f8fafc;
  border-bottom: 1px solid rgba(198, 161, 91, 0.22);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #f8fafc; flex: none; direction: ltr; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(145deg, #171c28, #0d1017);
  border: 1px solid rgba(198, 161, 91, 0.45);
  color: #f8fafc;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.14em; }
.brand-ar { font-family: "Noto Kufi Arabic", sans-serif; color: #d2ae68; font-weight: 700; font-size: 0.85rem; }
.topnav { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: 8px 13px; border-radius: 9px;
  color: #a3adbf; font-weight: 600; font-size: 0.86rem;
  white-space: nowrap;
  transition: all .15s ease;
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.topnav a.active { color: #0b0e14; background: #d2ae68; font-weight: 700; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #d4dce8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 6px 11px;
  font: inherit; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }
a.icon-btn { display: inline-grid; place-items: center; position: relative; }
.icon-btn.active { background: rgba(198, 161, 91, 0.22); color: #fff; border-color: rgba(198, 161, 91, 0.5); }
.ico { display: block; flex: none; }
/* Notification count on the bell: small and calm, not a warning colour */
.bell .badge {
  position: absolute; top: -5px; inset-inline-end: -6px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: #c6a15b; color: #0b0e14;
  font-size: 0.66rem; font-weight: 800; line-height: 17px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.bell .badge[hidden] { display: none; }

/* Owner home */
.home-head { align-items: center; }
.home-head h1 { margin: 0; }
.icon-add { display: inline-flex; align-items: center; gap: 4px; font-size: 1.05rem; padding: 8px 14px; }
.empty-start { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.empty-start h2 { margin: 0; }
a.card.kpi { color: inherit; text-decoration: none; }

/* Notification center */
.notif .grow > b {
  font-size: 0.92rem; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif.is-action .grow > b { font-weight: 700; }
.notif > .mono { font-size: 0.9rem; }
.unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold, #d97706);
  margin-inline-end: 6px;
  vertical-align: middle;
}
.notif.is-unread {
  background: var(--surface);
}
.count {
  display: inline-block; min-width: 22px; padding: 1px 7px; margin-inline-start: 6px;
  border-radius: 99px; background: var(--line-soft); font-size: 0.78rem; font-weight: 700; text-align: center;
}

/* Settings */
.settings .card h2 { margin-bottom: 8px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row > span { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button {
  border: 0; background: transparent; color: inherit; font: inherit; font-size: 0.86rem;
  padding: 7px 14px; cursor: pointer;
}
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.active { background: var(--gold); color: #0b0e14; font-weight: 700; }

/* 1-Click Role Perspective Switcher Bar */
.persona-bar {
  background: #121722;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 24px;
}
.persona-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.persona-kicker {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em;
  color: #d2ae68; white-space: nowrap; flex: none;
}
.persona-pills { display: flex; gap: 5px; flex: 1 1 280px; min-inline-size: 0; overflow-x: auto; scrollbar-width: none; }
.persona-pills::-webkit-scrollbar { display: none; }
.p-pill {
  background: rgba(255, 255, 255, 0.04);
  color: #b7c0d1;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 99px;
  padding: 4px 10px;
  font: inherit; font-size: 0.74rem; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: all .15s ease;
}
.p-pill:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.p-pill.active {
  background: rgba(210, 174, 104, 0.18);
  color: #f3d79b;
  border-color: #d2ae68;
  font-weight: 700;
}
.persona-more {
  background: #1b2232; color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; padding: 4px 8px;
  font: inherit; font-size: 0.75rem; max-width: 195px;
}
.persona-scope {
  margin-inline-start: auto;
  font-size: 0.74rem; color: #8c96a9;
  white-space: nowrap;
}

/* Founder Demo Console Dock Styles */
.demo-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 99px;
  padding-block: 3px;
  padding-inline: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.08em;
}
.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: demoPulse 2s infinite ease-in-out;
}
@keyframes demoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}
.demo-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  flex-wrap: wrap;
}
.demo-btn {
  font-size: 0.72rem;
  padding-block: 4px;
  padding-inline: 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.demo-current-pill {
  font-size: 0.73rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  padding-block: 4px;
  padding-inline: 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 65vh;
  overflow-y: auto;
  padding-block: 4px;
}
.scenario-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding-block: 11px;
  padding-inline: 14px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s ease;
}
.scenario-card:hover {
  border-color: var(--gold);
}
.scenario-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.scenario-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.scenario-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}
.scenario-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-start: 2px;
}
.scenario-persona {
  font-size: 0.72rem;
  font-weight: 700;
  padding-block: 2px;
  padding-inline: 8px;
  border-radius: 6px;
  background: var(--gold-tint);
  color: var(--gold-text);
}

/* Main Page Container */
.page { max-width: 1240px; margin: 0 auto; padding: 26px 24px 96px; }
.bottomnav { display: none; }

/* Layout Primitives */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
/* Grid/stack children may shrink below their content width (wide tables scroll inside .scroll-x
   instead of stretching the whole page on phones). */
.stack > *, .grid > * { min-width: 0; }
.stack { display: grid; gap: 14px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2 { margin-bottom: 12px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 18px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head > div:first-child { flex: 1; min-width: 260px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.eyebrow {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--gold-text); margin-bottom: 4px;
}

/* KPI Cards */
.kpi { position: relative; padding: 16px 18px; overflow: hidden; }
.kpi::before {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent); opacity: 0.65;
}
.kpi .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.kpi .value { font-size: 1.5rem; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }
.kpi .sub { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

.empty {
  text-align: center; color: var(--muted);
  padding: 32px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font: inherit; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: all .15s ease;
}
.btn:hover { border-color: var(--gold); }
.btn.primary {
  background: var(--primary-bg);
  border-color: var(--primary-bg);
  color: var(--primary-fg);
  font-weight: 700;
}
.btn.primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn.gold {
  background: linear-gradient(135deg, #c8a258, #ae8539);
  border-color: #b89146; color: #0b0e14; font-weight: 700;
}
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-bg); }
.btn.small { padding: 5px 11px; font-size: 0.77rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Status Chips */
.chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); white-space: nowrap;
  max-inline-size: 100%;
}
/* Long chips ("Requires: …") wrap instead of pushing the page sideways on phones */
.chip.locked { white-space: normal; }
.chip.paid, .chip.approved, .chip.delivered, .chip.active, .chip.completed, .chip.accepted, .chip.hired, .chip.ready_for_payment {
  background: var(--green-bg); color: var(--green); border-color: transparent;
}
.chip.due, .chip.pending, .chip.placed, .chip.quoting, .chip.call_requested, .chip.expiring_soon, .chip.preparing {
  background: var(--amber-bg); color: var(--amber); border-color: transparent;
}
.chip.requested, .chip.confirmed, .chip.acknowledged, .chip.mobilized, .chip.out_for_delivery, .chip.quoted, .chip.in_progress, .chip.dispatched {
  background: var(--blue-bg); color: var(--blue); border-color: transparent;
}
.chip.overdue, .chip.rejected, .chip.declined, .chip.cancelled, .chip.expired, .chip.locked {
  background: var(--red-bg); color: var(--red); border-color: transparent;
}
.chip.market { background: rgba(11, 14, 20, 0.76); color: #f8fafc; border-color: rgba(255,255,255,0.18); backdrop-filter: blur(8px); }
.chip.role { background: var(--gold-tint); color: var(--gold-text); border-color: transparent; }

/* Avatars */
.avatar {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: #1e293b; color: #f8fafc;
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.04em; flex: none;
  border: 1px solid rgba(255,255,255,0.12);
}
.avatar.r-owner { background: #0b0e14; color: #d2ae68; border-color: #d2ae68; }
.avatar.r-architect { background: #312e81; }
.avatar.r-contractor { background: #7c2d12; }
.avatar.r-interior { background: #701a75; }
.avatar.r-painter { background: #854d0e; }
.avatar.r-electrician { background: #78350f; }
.avatar.r-plumber { background: #1e3a8a; }
.avatar.r-hvac { background: #134e4a; }
.avatar.r-elevator { background: #0f4c5c; }
.avatar.r-tenant { background: #3f3f46; color: #fde68a; }
.avatar.r-supplier { background: #1f2937; }

/* ============================================================================
   Arabic Typography & Right-Aligned Text (layout mirrors via dir="rtl"; opt out with ?rtl=0)
   ============================================================================ */
.ar-font, .ar-sub, html[data-lang="ar"] body {
  font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", "Plus Jakarta Sans", -apple-system, sans-serif;
}
html[data-lang="ar"] h1, html[data-lang="ar"] h2, html[data-lang="ar"] h3, html[data-lang="ar"] h4 {
  font-family: "Noto Kufi Arabic", "IBM Plex Sans Arabic", sans-serif;
  letter-spacing: 0;
}
.ar-sub {
  font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", sans-serif;
  font-size: 0.77rem;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}
/* Keep positions 100% stable when switching languages (default dir="ltr"); full mirror applies only when dir="rtl". */
html[dir="rtl"][data-lang="ar"] :is(
  h1, h2, h3, h4, p,
  .eyebrow,
  .kpi .label, .kpi .sub, .kpi .value:not(.mono),
  .prod-name, .prod-spec, .prod-brand, .ar-sub,
  .prop-hero-foot,
  .field label, .field .hint,
  .field input:not([type="number"]):not([type="date"]):not(.mono),
  .field textarea, .field select,
  .shop-top input[type="search"], .shop-top select,
  .list-item > .grow,
  .sr-card,
  .doc-clauses,
  .ar-text,
  th:not(.num),
  td:not(.num)
) {
  direction: rtl;
  text-align: start;
}
/* Bidi islands: names, codes and amounts inside <bdi> take their direction from their own first letter. */
bdi,
html[dir="rtl"][data-lang="ar"] :is(td, th, .list-item, .kpi, .chip) :is(b, small, strong, span:not(.chip)) {
  unicode-bidi: plaintext;
}
html[data-lang="ar"] .mono {
  font-family: "IBM Plex Sans Arabic", "JetBrains Mono", ui-monospace, sans-serif;
  letter-spacing: 0;
  unicode-bidi: isolate;
}

/* Multi-Unit Delegated Tenant Authorization Switches */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 7px;
}
.perm-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .15s ease;
}
.perm-toggle input[type="checkbox"] {
  accent-color: var(--green);
  cursor: pointer;
}
.perm-toggle.on {
  background: var(--green-bg);
  color: var(--green);
  border-color: transparent;
}
.perm-toggle.off {
  background: var(--surface);
  color: var(--muted);
  opacity: 0.82;
}

/* Alert Banner */
.alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-radius: var(--radius);
  background: var(--red-bg);
  border: 1px solid var(--red);
  margin-bottom: 18px;
}
.alert-banner > div:first-child { flex: 1; min-width: 240px; }

/* Luxury Property Cards */
.prop-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.prop-card:hover { transform: translateY(-2px); }
.prop-hero {
  position: relative; height: 184px; background: #11151e; overflow: hidden; display: block;
}
.prop-hero img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.prop-card:hover .prop-hero img { transform: scale(1.04); }
.prop-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,20,0.35) 0%, transparent 45%, rgba(11,14,20,0.78) 100%);
}
.prop-badges {
  position: absolute; top: 12px; inset-inline: 12px; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
}
.prop-hero-foot {
  position: absolute; bottom: 10px; inset-inline: 14px; z-index: 2;
  color: #fff;
}
.prop-hero-foot h3 { font-size: 1.06rem; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.prop-hero-foot small { color: rgba(255,255,255,0.82); font-size: 0.76rem; }
.prop-body { padding: 14px 16px 16px; display: grid; gap: 10px; flex: 1; align-content: space-between; }
.prop-body > * { min-width: 0; }
.prop-specs {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 0.77rem; color: var(--muted);
  padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}

/* Project Banner */
.proj-banner {
  position: relative; border-radius: 16px; overflow: hidden;
  min-height: 168px; margin: 10px 0 18px;
  display: flex; align-items: flex-end;
  background: #0b0e14; color: #fff;
  border: 1px solid rgba(198,161,91,0.28);
}
.proj-banner img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.42;
}
.proj-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(9,11,16,0.92) 0%, rgba(9,11,16,0.68) 55%, rgba(9,11,16,0.45) 100%);
}
.proj-banner-inner {
  position: relative; z-index: 2; width: 100%;
  padding: 22px 24px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
}
.proj-banner-inner > div:first-child { flex: 1; min-width: 260px; }
.proj-banner h1 { color: #fff; font-size: 1.6rem; }
.proj-banner p { margin: 6px 0 0; color: #cbd5e1; font-size: 0.86rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th {
  text-align: start; font-size: 0.76rem; font-weight: 600;
  color: var(--muted); padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
td.num, th.num { text-align: end; }
tr:last-child td { border-bottom: 0; }
.stage-row-click { cursor: pointer; transition: background .12s ease; }
.stage-row-click:hover { background: var(--surface-2); }
.scroll-x { overflow-x: auto; }

/* Phases & Tabs */
.phases { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.phase {
  flex: 1; min-width: 108px; text-align: center;
  padding: 9px 8px; border-radius: 9px;
  font: inherit; font-size: 0.76rem; font-weight: 700;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); transition: all .15s ease;
}
.phase.done { background: var(--green-bg); color: var(--green); border-color: transparent; }
.phase.current {
  background: #0b0e14; color: #d2ae68;
  border-color: #d2ae68;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}
html[data-theme="dark"] .phase.current { background: #d2ae68; color: #0b0e14; }
.phase[data-act] { cursor: pointer; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; }
.tabs a {
  padding: 11px 16px; font-weight: 600; font-size: 0.88rem;
  color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-color: var(--gold); font-weight: 700; }
.tabs .count { margin-inline-start: 4px; font-size: 0.72rem; min-width: 18px; padding: 0 6px; }

/* Property hub */
a.prop-card { color: inherit; text-decoration: none; }
/* Bell + count in the card corner: same calm look as the top-bar bell */
.prop-alert {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 10px; border-radius: 99px;
  background: rgba(11, 14, 20, 0.78); color: #f8fafc; backdrop-filter: blur(4px);
  border: 1px solid rgba(198, 161, 91, 0.55);
}
.prop-alert .ico { width: 15px; height: 15px; color: #c6a15b; }
.prop-alert b { font-size: 0.82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.proj-banner.compact { min-height: 112px; margin-bottom: 6px; }
.proj-banner.compact .proj-banner-inner { padding: 16px 20px; }
.proj-banner.compact h1 { font-size: 1.4rem; }
.notice-line {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px;
  color: inherit; text-decoration: none; font-weight: 600;
}
.notice-line .ico { color: var(--gold-text); }
a.project-line, a.list-item { color: inherit; text-decoration: none; }
a.project-line:hover, a.list-item:hover { background: var(--surface-2); }
a.list-item { border-radius: 8px; padding-inline: 6px; }

/* Progress Bars */
.bar { position: relative; height: 8px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 99px; overflow: hidden; min-width: 96px; }
.bar > i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: var(--committed); border-radius: 99px; }
.bar > b { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: var(--green); border-radius: 99px; }
.budget-legend { display: flex; align-items: center; gap: 10px; }
.budget-legend span { display: inline-flex; align-items: center; gap: 4px; }
.budget-legend i { inline-size: 8px; block-size: 8px; border-radius: 50%; }
.budget-legend i.paid { background: var(--green); }
.budget-legend i.committed { background: var(--committed); }
.bar.over > i { background: var(--red); }
.neg { color: var(--red); font-weight: 700; }
.pos { color: var(--green); font-weight: 700; }

/* Vault Document Rows */
.list-item { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.list-item:last-child { border-bottom: 0; }
.doc-badge {
  min-width: 76px; text-align: center;
  padding: 8px 6px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--gold-text);
}
.vis { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

/* My Muqawil, Company Browser Window, PACI Lookup & Design Studio */
.paci-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--gold-tint);
  border: 1px solid rgba(184, 145, 70, 0.35);
  margin-bottom: 14px;
}
.dual-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.choice-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: border-color .15s ease, transform .15s ease;
}
.choice-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.choice-card.featured {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-tint), var(--surface) 60%);
}
.stage-card {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3.5px solid var(--gold);
  box-shadow: var(--shadow);
}
.stage-card.done { border-inline-start-color: var(--green); }
.stage-card.locked { border-inline-start-color: var(--muted); opacity: 0.92; }
.req-pill-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}
.req-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.media-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface-2);
}
.media-card img, .media-card video {
  width: 100%;
  height: 136px;
  object-fit: cover;
  display: block;
  background: #0d1017;
}
.media-pdf {
  height: 136px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #161c2a, #0c0f16);
  color: #d2ae68;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 0.85rem;
}
.swatch-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.swatch-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.swatch-color { height: 56px; border-bottom: 1px solid var(--line); }

/* Showroom & Materials Marketplace */
.showroom-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sr-card {
  text-align: start; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; font: inherit; color: var(--ink); transition: all .15s ease;
}
.sr-card:hover { border-color: var(--gold); }
.sr-card.active { border-color: var(--gold); background: var(--gold-tint); }
.sr-card b { display: block; font-size: 0.88rem; }
.sr-card small { font-size: 0.73rem; display: block; margin-top: 2px; }

.shop-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.shop-top input, .shop-top select, .field input, .field select, .field textarea {
  font: inherit; font-size: 0.88rem;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); min-width: 0;
}
.shop-top input[type="search"] { flex: 1; min-width: 220px; }

.cat-chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.tabs { scrollbar-width: none; }
.cat-chip {
  white-space: nowrap; padding: 7px 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-weight: 600; font-size: 0.82rem; cursor: pointer;
}
.cat-chip.active { background: #0b0e14; color: #d2ae68; border-color: #d2ae68; font-weight: 700; }

.shop-layout { display: grid; grid-template-columns: 1fr 370px; gap: 18px; align-items: start; }
.products { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.product { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .16s ease; }
.product:hover { transform: translateY(-2px); border-color: var(--gold); }
.prod-img { position: relative; height: 158px; background: #141821; overflow: hidden; cursor: pointer; }
.prod-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product:hover .prod-img img { transform: scale(1.05); }
.prod-origin {
  position: absolute; top: 9px; inset-inline-start: 9px;
  background: rgba(11, 14, 20, 0.78); color: #f8fafc;
  backdrop-filter: blur(6px);
  padding: 3px 8px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 600;
}
.prod-sup {
  position: absolute; bottom: 8px; inset-inline-end: 8px;
  background: rgba(11, 14, 20, 0.82); color: #e9d29f;
  padding: 2px 8px; border-radius: 5px;
  font-size: 0.67rem; font-weight: 700;
}
.prod-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.prod-brand { font-size: 0.76rem; font-weight: 600; color: var(--gold-text); }
.prod-name { font-weight: 700; font-size: 0.89rem; line-height: 1.3; min-height: 2.3em; cursor: pointer; }
.prod-spec { font-size: 0.75rem; color: var(--muted); }
/* Relative price level ("KWD $$$" with the remaining marks faint) instead of a price */
.price-level { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 800; letter-spacing: 0.04em; unicode-bidi: isolate; direction: ltr; }
.price-level .pl-cur { font-size: 0.72rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.price-level b { color: var(--gold-text); }
.price-level i { font-style: normal; color: var(--line); }
.quote-band { font-size: 0.74rem; color: var(--muted); }

/* Discipline tags under a company name (full description lives on the company page) */
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
.tag {
  font-size: 0.72rem; font-weight: 600; padding: 2px 9px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.prod-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; border-top: 1px solid var(--line-soft); }
.prod-price { font-weight: 800; font-size: 0.98rem; }

.cart { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: auto; }
.cart-line { display: grid; gap: 7px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.cart-line select, .cart-line input {
  font: inherit; font-size: 0.78rem; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); max-width: 100%;
}
.qty { width: 66px; text-align: center; }
.total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.05rem; padding-top: 12px; }

/* Modals & Interactive CAD / Legal Document Viewers */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(7, 10, 16, 0.72); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px;
}
.modal {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px;
  width: min(560px, 100%); max-height: 92vh; overflow: auto;
  padding: 22px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.viewer-modal { width: min(1020px, 100%); padding: 20px 22px; }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }

.cad-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 10px;
  background: #0f172a; color: #e2e8f0; margin-bottom: 10px;
}
.cad-layers { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; font-weight: 600; }
.cad-layers label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.cad-viewport {
  background: #0b1220; border-radius: 12px; overflow: auto;
  max-height: 66vh; border: 1px solid #293b5c;
}
.cad-svg { display: block; width: 100%; min-width: 720px; height: auto; }

.doc-sheet {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px;
}
.legal-sheet { font-size: 0.88rem; line-height: 1.6; }
.doc-official-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 2px solid var(--gold);
}
.doc-kicker { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; color: var(--gold-text); }
.doc-seal {
  padding: 8px 14px; border-radius: 8px;
  border: 1.5px solid var(--green); color: var(--green);
  font-weight: 800; font-size: 0.75rem; text-align: center; line-height: 1.3;
}
.doc-seal.gold { border-color: var(--gold); color: var(--gold-text); }
.doc-seal span { font-family: "Noto Kufi Arabic", sans-serif; font-size: 0.72rem; }
.doc-meta-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px;
  padding: 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  margin-bottom: 16px;
}
.doc-meta-grid span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.doc-meta-grid.plain span { text-transform: none; letter-spacing: 0; font-size: 0.78rem; }
.doc-meta-grid b { font-size: 0.88rem; }
.doc-clauses h4 { margin: 0 0 8px; font-size: 0.92rem; }
.doc-clauses p, .doc-clauses li { margin: 0 0 8px; color: var(--ink-2); }
.doc-sig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.sig-box { padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.sig-box span { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; }
.sig-box b { display: block; margin: 4px 0 2px; font-size: 0.92rem; }

.boq-total td { border-top: 2px solid var(--gold); font-size: 0.95rem; }
.viewer-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.viewer-fig { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.viewer-fig img { width: 100%; height: 220px; object-fit: cover; display: block; }
.viewer-fig figcaption { padding: 10px 12px; font-size: 0.84rem; }

.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 0.75rem; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  text-transform: none; letter-spacing: 0; font-size: 0.83rem; color: var(--ink); font-weight: 600;
  display: flex; gap: 6px; align-items: center; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
}
.form-error { color: var(--red); font-size: 0.84rem; margin-bottom: 8px; min-height: 1em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ms-row { display: grid; grid-template-columns: 1fr 84px 36px; gap: 6px; margin-bottom: 6px; }

.toasts { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 70; display: grid; gap: 8px; }
.toast {
  background: #0b0e14; color: #f8fafc;
  border: 1px solid rgba(210, 174, 104, 0.45);
  padding: 11px 16px; border-radius: 10px;
  font-size: 0.86rem; font-weight: 600;
  box-shadow: var(--shadow); max-width: 360px;
}
.toast.err { background: #991b1b; border-color: #f87171; }

@media (max-width: 960px) {
  .shop-layout { grid-template-columns: 1fr; }
  .cart { position: static; max-height: none; }
  .showroom-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4, .dual-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .persona-scope { display: none; }
}
@media (max-width: 680px) {
  .topnav { display: none; }
  .topbar { padding: 10px 14px; gap: 10px; justify-content: space-between; }
  .persona-bar { padding-block: 8px; padding-inline: 12px; overflow-x: hidden; max-width: 100vw; box-sizing: border-box; }
  .page { padding: 16px 14px 96px; }
  h1 { font-size: 1.32rem; }
  .cols-2, .cols-3, .cols-4, .dual-choice, .swatch-row, .viewer-gallery, .doc-meta-grid, .doc-sig-row { grid-template-columns: 1fr; }
  .cols-4.kpis, .cols-2.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis .kpi { padding: 12px 13px; }
  .kpis .kpi .value { font-size: 1rem !important; overflow-wrap: anywhere; }
  /* Phone top bar: logo mark + name, language, bell, settings — nothing else */
  .brand-mark { width: 34px; height: 34px; }
  .brand-text { font-size: 0.95rem; letter-spacing: 0.1em; }
  .top-actions { gap: 6px; }
  /* Demo persona switcher: dropdown with all roles + responsive wrapped dock on phones */
  .persona-pills { display: none; }
  .persona-inner { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; width: 100%; max-width: 100%; box-sizing: border-box; }
  .persona-kicker { flex-shrink: 0; }
  .persona-more { flex: 1 1 150px; min-width: 0; max-width: 100%; font-size: 0.74rem; }
  .demo-actions { margin-inline-start: 0; width: 100%; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
  .demo-current-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.7rem; }
  .demo-btn { font-size: 0.7rem; padding-block: 3px; padding-inline: 7px; white-space: nowrap; }
  .bottomnav {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 35;
    display: flex; background: #0b0e14; border-top: 1px solid rgba(255,255,255,0.1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; text-align: center; padding: 10px 4px; font-size: 0.72rem; font-weight: 700; color: #94a3b8; }
  .bottomnav a.active { color: #d2ae68; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Hiring, quotes, updates feed, tasks (public/workflow.js) ---------- */
.chip.info_requested { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.chip.released, .chip.superseded { background: var(--surface-2); color: var(--muted); }
.lbl { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 6px; }
.req-need { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.req-need.missing { border-color: var(--amber); }
.req-need input[type="file"] { font-size: .8rem; }
.warn-line { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 6px 10px; font-size: .8rem; font-weight: 700; margin-top: 6px; }
.contact-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; font-size: .82rem; display: grid; gap: 2px; }
.confirm-amount { text-align: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin: 6px 0 10px; }
.big-amount { font-size: 1.7rem; font-weight: 800; margin: 4px 0; overflow-wrap: anywhere; }
.check-line { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: .88rem; cursor: pointer; }
.main-con { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.main-con.hiring { display: block; }
.feed { display: grid; gap: 8px; }
.feed-item { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: .85rem; border-inline-start: 3px solid var(--line); }
.feed-item.owner { border-inline-start-color: var(--blue); }
.feed-item.company { border-inline-start-color: var(--gold); }
.feed-item.open { background: var(--amber-bg); }
.feed-photo { display: block; width: 120px; height: 90px; object-fit: cover; border-radius: 8px; margin-top: 6px; border: 1px solid var(--line); }
.task-card .bar { height: 10px; }

/* ---------- Timeline, delivery, payments (public/commerce.js) ---------- */
.gantt { display: grid; gap: 6px; overflow-x: auto; }
.g-row { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: 10px; align-items: center; cursor: pointer; min-width: 520px; }
.g-name { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; height: 18px; background: var(--surface-2); border-radius: 6px; }
.g-bar { position: absolute; top: 3px; height: 12px; border-radius: 5px; background: var(--line); overflow: hidden; }
.g-bar b { display: block; height: 100%; background: rgba(0, 0, 0, .22); }
.g-bar.done { background: var(--green); }
.g-bar.active { background: var(--gold); }
.g-bar.planned { background: var(--blue); opacity: .75; }
.g-bar.est { background: repeating-linear-gradient(45deg, var(--line), var(--line) 4px, var(--surface) 4px, var(--surface) 8px); border: 1px solid var(--line); }
.g-bar.late, .g-bar.behind { background: var(--red); }
.g-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink, #111); opacity: .55; z-index: 1; }
.g-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .74rem; margin-top: 10px; }
.g-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 3px; margin-inline-end: 4px; vertical-align: middle; }
.g-legend i.done { background: var(--green); } .g-legend i.active { background: var(--gold); } .g-legend i.planned { background: var(--blue); }
.g-legend i.est { background: var(--line); } .g-legend i.late { background: var(--red); }
.delivery-box { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .86rem; }
.test-banner { background: var(--amber-bg); color: var(--amber); font-weight: 700; font-size: .8rem; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.pay-method { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; font-weight: 700; font-size: .86rem; }
.pay-method:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); }

/* ---------- Site guard, approvals, terms (public/site.js) ---------- */
.site-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.site-language { display: grid; gap: 4px; min-width: 126px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.site-language select { min-height: 40px; padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: .86rem; }
.site-home[dir="rtl"] .site-language { justify-items: end; }
.site-home:lang(hi), .modal:lang(hi), .auth-card:lang(hi) { font-family: "Noto Sans Devanagari", "Plus Jakarta Sans", sans-serif; }
.site-home:lang(bn), .modal:lang(bn), .auth-card:lang(bn) { font-family: "Noto Sans Bengali", "Plus Jakarta Sans", sans-serif; }
.site-btn { display: grid; gap: 4px; justify-items: center; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: .9rem; cursor: pointer; color: inherit; }
.site-btn span { font-size: 1.8rem; line-height: 1; }
.site-btn.issue, .site-btn.safety { border-color: var(--red); }
.site-btn.safety { background: var(--red-bg); color: var(--red); }
.site-btn.delivery { border-color: var(--green); }
.feed-item.urgent { border-inline-start-color: var(--red); }
.file-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.file-row audio { max-width: 100%; height: 36px; }
.file-pdf { display: inline-block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; font-size: .8rem; }
.reply-line { font-size: .82rem; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.rec-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.info-i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--blue); color: var(--blue); background: transparent; font: italic 700 .72rem/1 serif; cursor: pointer; margin-inline: 4px; vertical-align: middle; }
.delay-log { font-size: .8rem; background: var(--amber-bg); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; display: grid; gap: 3px; }
.dep-list { display: grid; gap: 4px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.dep-list .check-line { font-weight: 600; font-size: .82rem; }
.proof-row { display: flex; flex-wrap: wrap; gap: 8px; font-size: .78rem; margin-top: 3px; }

/* ---------- Sign in / sign up (public/auth.js) ---------- */
.auth-wrap { display: grid; place-items: start center; padding: 24px 0 40px; }
.auth-card { width: min(520px, 100%); }
.worker-auth-card { width: min(460px, 100%); }
.worker-lang-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
@media (min-width: 460px) { .worker-lang-pills { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.worker-lang-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: .98rem; font-weight: 800; cursor: pointer; transition: border-color .15s, background .15s; }
.worker-lang-pill.active { border-color: var(--gold); background: var(--gold-tint); color: var(--ink); }
.auth-card .seg { display: flex; width: 100%; flex-wrap: wrap; }
.phone-in { display: grid; grid-template-columns: 120px 1fr; gap: 8px; direction: ltr; }
.code-in { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-family: var(--mono, monospace); }
.acct-types { display: grid; gap: 8px; margin-bottom: 12px; }
.acct-type { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.acct-type span { display: grid; gap: 2px; }
.acct-type:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); }
.pending-banner { background: var(--amber-bg); color: var(--amber); font-weight: 700; font-size: .86rem; padding: 10px 16px; text-align: center; }
.imp-banner { background: var(--blue-bg); color: var(--blue); font-weight: 700; font-size: .86rem; padding: 8px 16px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.std-line { font-size: .8rem; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }

/* ---------- Home cards: rented tag + quick links; rentals ---------- */
.prop-card { display: flex; flex-direction: column; }
.prop-card .prop-link { display: block; color: inherit; }
.prop-links { display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap; }
.prop-links a { font-size: .8rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.tag.rented { background: var(--green-bg); color: var(--green); border-color: transparent; }
.rental-card { display: block; color: inherit; }
.topnav a.has-icon, .bottomnav a.has-icon { display: inline-flex; align-items: center; gap: 6px; }
.topnav a.has-icon svg, .bottomnav a.has-icon svg { width: 16px; height: 16px; }

/* ---------- Property file (completeness) ---------- */
.score-ring { --pct: 0; --tone: var(--gold); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--tone) calc(var(--pct) * 1%), var(--surface-2) 0); }
.score-ring b { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--surface); font-size: .86rem; }
.file-done summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--muted); margin-top: 8px; }
.tag.file-tag { background: var(--amber-bg); color: var(--amber); border-color: transparent; flex: none; white-space: nowrap; }
.inst-list { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 6px; }

/* ---------- Add property: country first; flags on cards ---------- */
.country-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (max-width: 480px) { .country-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.country-opt { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 700; }
.country-opt input { display: none; }
.country-opt span { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.country-opt small { font-weight: 600; color: var(--muted); font-size: .7rem; }
.country-opt:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); }
.country-opt.soon { opacity: .5; cursor: not-allowed; }
.prop-flag { position: absolute; top: 10px; inset-inline-start: 10px; font-size: 1.15rem; line-height: 1; background: rgba(0, 0, 0, .35); border-radius: 8px; padding: 4px 6px; }

/* ---------- Stages: compact table with alerts; timeline drawer ---------- */
.stage-alert { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; color: var(--red); vertical-align: middle; }
.stage-alert svg { width: 14px; height: 14px; }
.stage-alert b { font-size: .7rem; }
.alert-line { font-size: .72rem; color: var(--red); font-weight: 700; }
tr.row-done td { opacity: .7; }
.alert-box { display: flex; gap: 8px; align-items: center; background: var(--red-bg); color: var(--red); font-weight: 700; font-size: .84rem; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.alert-box svg { width: 16px; height: 16px; flex: none; }
.stage-actions { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 4px; }
.timeline-drawer summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.timeline-drawer summary::-webkit-details-marker { display: none; }
.timeline-drawer summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.timeline-drawer[open] summary::after { content: "▴"; }
.tl-next { flex-basis: 100%; }
.prop-flag { display: inline-flex; padding: 3px; }
.flag { display: block; border-radius: 2.5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.country-opt .flag { width: 24px; height: 16px; }

/* ---------- Property card status icons (bottom-right of the photo) ---------- */
.prop-status { position: absolute; bottom: 10px; inset-inline-end: 10px; display: flex; gap: 6px; }
.st-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(11, 14, 20, .72); color: #f8fafc; border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(6px); }
.st-ico svg { width: 16px; height: 16px; }
.st-ico.build { color: #f5c04a; }
.st-ico.ok { color: #4ade80; }
.st-ico { width: 34px; height: 34px; background: rgba(11, 14, 20, .85); }
.st-ico svg { width: 19px; height: 19px; stroke-width: 2.2; }
.st-ico.land { color: #38bdf8; }
.prop-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Equipment rentals */
.rent-info { display: grid; gap: 6px; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.rent-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rent-line.ok > :first-child, .rent-line.ok { color: inherit; }
.rent-line.bad { color: var(--red, #c0392b); }
.rent-line .btn { margin-inline-start: auto; }
.eq-item { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.eq-item:last-child { border-bottom: 0; }
.eq-bookings { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.eq-booking { color: var(--muted); }
.dg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dg-files img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
/* Stage details behind an (i) */
.stage-info { margin: 0 0 12px; }
.stage-info > summary { list-style: none; cursor: pointer; display: inline-flex; }
.stage-info > summary::-webkit-details-marker { display: none; }
.stage-info[open] { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.stage-info p { margin: 6px 0 0; line-height: 1.55; font-size: .86rem; }
/* Bottom bar: equal slots, icon above the label, nothing hugging the screen edges */
@media (max-width: 760px) {
  .bottomnav { justify-content: space-around; padding-inline: 8px; }
  .bottomnav a, .bottomnav a.has-icon { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 2px; max-width: 120px; }
  .bottomnav a svg, .bottomnav a.has-icon svg { width: 22px; height: 22px; flex: none; }
  .bottomnav a span { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Home services */
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.svc-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, #fff); color: inherit; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; }
.svc-tile:hover, .svc-tile.active { border-color: var(--gold); color: var(--gold-text); }
.svc-grid.small .svc-tile { padding: 8px 2px; font-size: .72rem; }
.svc-grid.small .svc-tile svg { width: 22px; height: 22px; }
.svc-mini { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--line-soft, #f1f5f9); }
.svc-mini svg { width: 20px; height: 20px; }
@media (min-width: 761px) { .svc-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
/* Floor plan */
.plan-empty { text-align: center; padding: 28px 16px; }
.plan-empty-ico { font-size: 2.2rem; }
.plan-stage { direction: ltr; /* a drawing never mirrors */ position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; touch-action: none; user-select: none; }
.plan-stage img { position: absolute; max-width: none; height: auto; pointer-events: none; }
.plan-stage.adding { cursor: crosshair; outline: 2px dashed var(--gold); outline-offset: -2px; }
.plan-hint { font-size: .8rem; color: var(--gold-text); margin: 0 0 6px; }
.plan-mark { position: absolute; transform: translate(-50%, -50%); cursor: grab; }
.plan-mark.pin b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 2px solid #d2ae68; font-size: 12px; font-weight: 400; }
.plan-mark.pin b { line-height: 1; }
.plan-mark.pin { transform: translate(-50%, -125%); }
.plan-mark.ring { aspect-ratio: 1; border: 2px solid #d2ae68; border-radius: 50%; background: rgba(210, 174, 104, .14); }
.plan-mark.ring.drawing { border-style: dashed; }
.plan-mark span { position: absolute; top: 100%; inset-inline-start: 50%; transform: translateX(-50%); margin-top: 3px; white-space: nowrap; font-size: .68rem; font-weight: 700; background: #0b0e14; color: #fff; padding: 2px 6px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.plan-mark:hover span, .plan-mark.hl span { opacity: 1; }
.plan-mark.hl b, .plan-mark.hl.ring { box-shadow: 0 0 0 4px rgba(210, 174, 104, .45); }
.plan-list { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.plan-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-soft, #eef1f5); border-radius: 10px; padding: 4px 6px; }
.plan-ico { width: 26px; text-align: center; }
.plan-name { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 600; padding: 6px 2px; }
.plan-name:focus { outline: 1px solid var(--gold); border-radius: 6px; }
.plan-reading { display: grid; gap: 8px; }
/* Paying by transfer / crypto: the company's details, each with a copy button */
.pay-to { display: grid; gap: 6px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pay-detail { display: flex; align-items: center; gap: 8px; }
.pay-detail small { min-width: 64px; }
.pay-detail b { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .82rem; }
/* Credit with a contracted company */
.wallet-row { display: grid; gap: 8px; margin-bottom: 14px; }
.wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 12px; }
.wallet-log { flex-basis: 100%; font-size: .8rem; }
.wallet-log summary { cursor: pointer; }
.wallet-log .row { padding: 3px 0; }
/* Star rating */
.stars { display: flex; gap: 6px; justify-content: center; margin: 4px 0 12px; }
.star { font-size: 2rem; line-height: 1; background: none; border: 0; color: var(--line); cursor: pointer; }
.star.on { color: var(--gold-text); }
/* Rent (tenant portal + owner rental page) */
.rent-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-block-end: 1px solid var(--line-soft); }
.rent-hist { display: flex; flex-direction: column; }
.rent-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; font-size: .85rem; border-block-end: 1px solid var(--line-soft); }
.rent-row:last-child { border-block-end: 0; }
.rent-mini { margin-block-start: 6px; }
/* Defects after handover */
.snag-row { flex-wrap: wrap; }
.snag-thumb { flex: 0 0 44px; inline-size: 44px; block-size: 44px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--line-soft); color: var(--muted); }
.snag-thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
/* Stage rating */
.stage-rating { display: flex; align-items: center; gap: 4px; margin-block-end: 12px; }
.stars-on { color: var(--gold-text); font-size: 1.1rem; }

/* Room planner (Design → Room) */
.rl-card { margin-block-end: 20px; }
.rl-steps { display: flex; gap: 6px; margin-block-end: 16px; overflow-x: auto; scrollbar-width: none; }
.rl-step { flex: 1 1 0; min-inline-size: 72px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.rl-step.active { border-color: var(--gold); color: var(--ink); background: var(--surface-2); }
.rl-step.done { color: var(--ink); }
.rl-step:disabled { opacity: .45; cursor: default; }
.rl-card .btn.ghost { background: transparent; border-color: transparent; }
.rl-openings { display: flex; flex-direction: column; gap: 8px; margin-block: 4px 12px; }
.rl-open-row { display: flex; align-items: center; gap: 6px; }
.rl-open-row select, .rl-open-row input { inline-size: auto; flex: 1 1 0; min-inline-size: 0; }
.rl-open-ico { color: var(--muted); }
.rl-photo { cursor: pointer; }
.rl-photo-prev { inline-size: 100%; max-block-size: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.rl-nav { margin-block-start: 14px; }
.rl-items { display: flex; flex-direction: column; gap: 6px; max-block-size: 420px; overflow-y: auto; }
.rl-item-row { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.rl-item-row.on { border-color: var(--gold); }
.rl-item-row img { inline-size: 48px; block-size: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.rl-item-txt { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; font-size: .85rem; }
.rl-item-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-qty { display: flex; align-items: center; gap: 6px; flex: none; }
.rl-nosize { margin-block-start: 10px; font-size: .8rem; }
.rl-nosize summary { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rl-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .rl-layout { grid-template-columns: 1fr; } }
.rl-svg-wrap { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; direction: ltr; }
.rl-svg-wrap svg, .rl-render-img svg, img.rl-render-img { display: block; inline-size: 100%; block-size: auto; }
.rl-svg-wrap.small { max-inline-size: 320px; margin-block-start: 10px; }
img.rl-render-img, .rl-render-img { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.rl-free { font-size: 1.1rem; margin-block-end: 8px; }
.rl-legend { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.rl-n { display: inline-grid; place-items: center; inline-size: 20px; block-size: 20px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: .7rem; font-weight: 700; margin-inline-end: 4px; }
.rl-warn { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: .8rem; margin-block-end: 8px; }
.rl-warn > div { display: flex; align-items: center; gap: 6px; }

/* Design with a showroom (public/designRequests.js) */
.dr-card { display: flex; flex-direction: column; gap: 8px; }
.dr-card.dr-attn { border-color: var(--gold); }
.dr-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; }
.dr-files { display: flex; flex-wrap: wrap; gap: 5px; }
.dr-files .tag { max-inline-size: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-proposal { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; }
.dr-items { display: flex; flex-direction: column; gap: 3px; padding-block-start: 6px; border-block-start: 1px solid var(--line-soft); }
.dr-share { display: flex; flex-direction: column; gap: 6px; }
.dr-sections .svc-tile input { display: none; }
.dr-pick summary { cursor: pointer; font-weight: 700; font-size: .88rem; padding-block: 6px; }
.dr-pick-row { gap: 8px; padding-block: 4px; border-block-end: 1px solid var(--line-soft); }
.dr-pick-row input { inline-size: 80px; }


/* ---------- Focus, touch, motion & dialogs (quick wins, 2026-11-08) ---------- */
/* Keyboard users see where they are; mouse/touch users see nothing extra. */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:focus-visible, .p-pill:focus-visible, .seg button:focus-visible, .tabs a:focus-visible { outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
h1:focus, main:focus { outline: none; }

/* Fingers: 44px targets on touch screens (small buttons stay compact with a mouse). */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding-inline: 14px; }
  .p-pill, .seg button, .tabs a, .checks label { min-height: 40px; }
}

/* Dialogs */
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { flex: 1; margin: 0; }
.modal-head-line { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.icon-btn { width: 34px; height: 34px; min-height: 34px !important; padding: 0 !important; border-radius: 50% !important; flex: none; }
.icon-btn .ico { width: 16px; height: 16px; }
.modal-confirm { width: min(440px, 100%); }
.confirm-msg { margin: 0 0 18px; font-size: 0.98rem; line-height: 1.55; color: var(--ink-2); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.btn.danger-solid:hover { opacity: 0.92; }
body.has-dialog { overflow: hidden; }

@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.overlay { animation: dlg-fade 0.16s ease-out; }
.overlay > .modal { animation: dlg-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.toast { animation: toast-in 0.2s ease-out; }

/* Phones: dialogs become bottom sheets (PLAN §3 B2). */
@media (max-width: 680px) {
  .overlay { padding: 0; place-items: end center; }
  .overlay > .modal {
    width: 100% !important; max-height: 92dvh;
    border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
}

/* Respect the OS "reduce motion" setting. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- Owner home: greeting + money at a glance */
.home-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.glance .kpi { display: block; color: inherit; text-decoration: none; }
.glance .kpi .sub { line-height: 1.45; }
.glance a.kpi:hover { border-color: var(--gold); }
.glance .glance-next::before { background: var(--green); }
.glance .glance-next.is-overdue::before { background: var(--red); }
.glance .glance-next.is-overdue .value { color: var(--red); }
.glance .glance-action::before { background: var(--gold); }
.glance .glance-action .value { color: var(--gold-text); }
.glance .label .count { margin-inline-start: 6px; }
@media (max-width: 900px) { .glance { grid-template-columns: 1fr 1fr; } .glance .glance-next { grid-column: 1 / -1; } }
@media (max-width: 480px) { .glance { grid-template-columns: 1fr; gap: 10px; } }

.prop-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line-soft); }
.prop-line b { color: var(--ink); white-space: nowrap; }
.prop-line.is-overdue, .prop-line.is-overdue b { color: var(--red); }

/* ---------------------------------------------------------------- Quote comparison */
.quote-compare { margin: 12px 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.quote-compare table { font-size: 0.84rem; }
.quote-compare .chip { margin-inline-start: 6px; font-size: 0.66rem; }
.quote-compare .warn-line { margin: 0; }
table.compact th, table.compact td { padding: 7px 8px; }

/* ---------------------------------------------------------------- Tables become cards on a phone (data-th carries the heading) */
@media (max-width: 680px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
  .table-cards tr.is-overdue { border-color: var(--red); }
  .table-cards tr.is-paid { opacity: 0.72; }
  .table-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: start; }
  .table-cards td.td-title { display: block; font-size: 0.95rem; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
  .table-cards td[data-th]::before { content: attr(data-th); color: var(--muted); font-size: 0.76rem; font-weight: 600; flex: none; font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
  .table-cards td.td-action { justify-content: stretch; padding-top: 8px; }
  .table-cards td.td-action:empty { display: none; }
  .table-cards td.td-action .btn, .table-cards td.td-action .chip { width: 100%; justify-content: center; text-align: center; }
  .scroll-x:has(> .table-cards) { overflow: visible; }
}

/* ---------------------------------------------------------------- Loading skeleton (shows only when a route takes a moment) */
.skeleton { display: grid; gap: 16px; }
.sk { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--line-soft); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: sk-shimmer 1.3s ease-in-out infinite; }
html[data-theme="dark"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); }
.sk-title { height: 30px; width: 40%; max-width: 320px; }
.sk-kpi { height: 92px; border-radius: var(--radius); }
.sk-block { height: 260px; border-radius: var(--radius); }
@keyframes sk-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

/* ---------------------------------------------------------------- Print: contracts, ledgers and property files on paper */
@media print {
  .topbar, .bottomnav, .persona-bar, .tabs, .toasts, .overlay, .cat-chips, .imp-banner, .btn, button, .skeleton { display: none !important; }
  html, body { background: #fff; color: #000; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .scroll-x { overflow: visible; }
  a { color: inherit; text-decoration: none; }
  .glance a.kpi, .prop-card { break-inside: avoid; }
}

/* ---------------------------------------------------------------- Command palette (⌘K) */
.palette-overlay { place-items: start center; padding-top: clamp(24px, 12vh, 120px); }
.palette { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.palette-head .ico { width: 18px; height: 18px; flex: none; }
.palette-head input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.02rem; min-width: 0; }
.palette-head input::-webkit-search-cancel-button { display: none; }
.palette kbd { font: 600 0.68rem "JetBrains Mono", monospace; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface-2); }
.palette-list { max-height: min(52vh, 440px); overflow-y: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.palette-item.is-active { background: var(--gold-tint); }
.palette-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.palette-ico .ico { width: 16px; height: 16px; }
.palette-text { flex: 1; min-width: 0; display: grid; }
.palette-text b { font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-text small { color: var(--muted); font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-kind { font-size: 0.7rem; font-weight: 600; color: var(--muted); flex: none; }
.palette-empty { padding: 26px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 18px; padding: 8px 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 0.74rem; }
.palette-foot span { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 680px) {
  .palette-overlay { padding: 0; place-items: start center; }
  .palette { border-radius: 0 0 var(--radius) var(--radius); max-height: 100dvh; }
  .palette-foot, .palette-head kbd { display: none; }
  .palette-list { max-height: 70dvh; }
}

/* Notifications grouped by property */
.notif-group + .notif-group { margin-top: 10px; }
.notif-group-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.86rem; padding: 6px 0 2px; color: var(--ink-2); }
.notif-group-head a { font-weight: 600; font-size: 0.76rem; margin-inline-start: auto; }

/* Every data table becomes cards on a phone (shared rules; .stages-table kept for older selectors) */
@media (max-width: 680px) {
  .table-cards td.td-step, .table-cards td.td-hide-sm { display: none; }
  .table-cards td.td-title b { display: block; }
  .table-cards td[style*="min-width"] { min-width: 0 !important; }
  .table-cards td[data-th] > .bar { flex: 1; }
  .table-cards tr.total-row { background: var(--surface-2, var(--line-soft)); font-weight: 700; }
  .table-cards tr.total-row td[data-th]::before { color: var(--ink-2); }
  .table-cards td.td-action .row { width: 100%; }
  .table-cards td.td-action .row .btn { flex: 1; }
}

/* Review: project activity and stage tasks stay compact on phones. */
.notif-link { color: inherit; text-decoration: none; cursor: pointer; }
.notif-link:hover { background: var(--surface); }
.notification-group { margin-block-end: 16px; }
.notification-section > summary, .notification-group > summary,
.task-status-group > summary, .task-stage-group > summary {
  cursor: pointer; padding-block: 12px; min-block-size: 44px; font-weight: 600;
}
.task-stage-group { margin-inline-start: 12px; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.task-progress { inline-size: 100px; max-inline-size: 100%; }
.task-status-group, .task-stage-group { min-inline-size: 0; }
.notif .grow { min-inline-size: 0; overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .task-stage-group { margin-inline-start: 4px; padding-inline-start: 8px; }
  .notif-link { flex-wrap: wrap; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs > a { flex-shrink: 0; }
}

/* AI Centre (Stage 10B) */
.aic-note { background: var(--amber-bg); color: var(--amber); border-radius: 8px; padding: 8px 12px; font-size: .8rem; margin: 8px 0; }
.aic-err { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 8px 12px; font-size: .82rem; margin-top: 8px; }
.aic-exec { margin: 8px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aic-plan { position: relative; max-inline-size: 640px; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.aic-plan img { display: block; inline-size: 100%; block-size: auto; }
.aic-box { position: absolute; border: 2px solid var(--gold); background: rgba(198, 161, 91, .12); box-sizing: border-box; }
.aic-box span { position: absolute; inset-block-start: 0; inset-inline-start: 0; background: var(--gold); color: #0b0e14; font-size: .68rem; font-weight: 700; padding: 1px 5px; }
.aic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.aic-fig { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.aic-fig img { display: block; inline-size: 100%; block-size: auto; background: #f3efe6; }
.aic-fig figcaption { padding: 8px 10px; font-size: .82rem; }
.aic-ba { display: grid; grid-template-columns: 1fr 1fr; }
.aic-label { background: var(--amber-bg); color: var(--amber); border-radius: 6px; padding: 4px 8px; font-size: .72rem; margin: 4px 0; }
.seg-scroll { max-inline-size: 100%; overflow-x: auto; }
.seg-scroll button { white-space: nowrap; }

/* ---------------------------------------------------------------- Walkthrough (tour.js)
   Adopted from Abdullah Alfarhan's onboarding tour (our-projects PR #11); logical properties only. */
.tour-layer { position: fixed; inset: 0; z-index: 65; pointer-events: none; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8, 11, 18, 0.55), 0 0 0 2px var(--gold-bright), 0 0 0 7px var(--gold-tint);
  transition: left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
}
.tour-card {
  position: fixed; pointer-events: auto; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px;
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.45); animation: dlg-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tour-card.is-centered { box-shadow: 0 0 0 9999px rgba(8, 11, 18, 0.55), 0 18px 50px -12px rgba(0, 0, 0, 0.45); }
.tour-kicker {
  font-size: 0.71rem; font-weight: 700; color: var(--gold-text);
  background: var(--gold-tint); border-radius: 6px;
  padding-block: 3px; padding-inline: 8px; margin-block-end: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tour-head { display: flex; justify-content: space-between; align-items: center; margin-block-end: 4px; }
.tour-count { color: var(--muted); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.02em; }
.tour-skip { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.78rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.tour-skip:hover { color: var(--ink); background: var(--surface-2); }
.tour-card h3 { margin: 0 0 4px; font-size: 1.02rem; letter-spacing: -0.01em; }
.tour-card p { margin: 0 0 12px; color: var(--ink-2); font-size: 0.88rem; line-height: 1.45; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background 0.2s, transform 0.2s; }
.tour-dots i.on { background: var(--gold); transform: scale(1.25); }
.tour-btns { display: flex; gap: 6px; }
.tour-card .btn.small { min-height: 34px; }
body.has-tour { overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; animation: none; } }
@media (max-width: 480px) { .tour-card { padding: 12px 14px 10px; } }

/* ---------------------------------------------------------------- Customer Project Workspace (Stage 11)
   Simplified, stage-based navigation, 5-section workspace & financial transparency. Logical properties only. */
.proj-workspace {
  margin-block-end: 24px;
}
.workspace-header-banner {
  border-radius: var(--radius);
  overflow: hidden;
}
.stage-nav-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stage-nav-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.stage-nav-strip::-webkit-scrollbar {
  height: 6px;
}
.stage-nav-strip::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.stage-pill:hover {
  background: var(--line-soft);
  border-color: var(--gold-bright);
}
.stage-pill.active {
  background: var(--ink);
  color: var(--primary-fg);
  border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.stage-pill.is-done {
  border-color: rgba(13, 122, 95, 0.3);
}
.stage-pill.is-locked {
  opacity: 0.72;
}
.stage-pill-icon {
  font-size: 0.88rem;
  line-height: 1;
}
.stage-pill-num {
  font-size: 0.76rem;
  opacity: 0.75;
  font-family: var(--mono);
}
.stage-pill-title {
  max-inline-size: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage-pill-badge {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  font-family: var(--mono);
}
.stage-pill.active .stage-pill-badge {
  background: rgba(255, 255, 255, 0.2);
}
.stage-pill-alert {
  font-size: 0.72rem;
  color: var(--red);
  background: var(--red-bg);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* 5-Tabs Navigation Strip */
.workspace-tabs-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-block-end: 2px solid var(--line);
  padding-block-end: 2px;
  -webkit-overflow-scrolling: touch;
}
.workspace-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
  position: relative;
  transition: all 0.15s ease;
}
.workspace-tab-btn:hover {
  color: var(--ink);
  background: var(--line-soft);
}
.workspace-tab-btn.active {
  color: var(--gold-text);
  font-weight: 700;
}
.workspace-tab-btn.active::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 3px;
  background: var(--gold);
  border-radius: 3px 3px 0 0;
}
.workspace-tab-btn .tab-icon {
  font-size: 1rem;
}

/* Category cards and action needed */
.fin-category-card {
  border: 1px solid var(--line);
}
.action-needed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: box-shadow 0.18s ease;
}
.action-needed-card:hover {
  box-shadow: var(--shadow);
}
.stage-summary-banner {
  background: var(--surface);
  border: 1px solid var(--line);
}
@media (max-width: 600px) {
  .stage-pill-title {
    max-inline-size: 120px;
  }
  .workspace-tab-btn {
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}


/* ---------- My Portfolio (#/portfolio) ---------- */
.pf-head { margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.pf-head select { width: auto; min-width: 88px; padding: 7px 10px; font-weight: 700; }
.pf-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.pf-kpi { min-width: 0; }
.pf-kpi .value { font-size: clamp(1.05rem, 1.35vw, 1.25rem); white-space: nowrap; }
.pf-kpi.pf-main { border-color: var(--gold); }
.pf-kpi.pf-main .value { font-size: clamp(1.12rem, 1.55vw, 1.42rem); }
.pf-list { display: grid; gap: 10px; }
.pf-row { padding: 0; overflow: hidden; }
.pf-row > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.pf-row > summary::-webkit-details-marker { display: none; }
.pf-row > summary img, .pf-thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; flex: none; background: var(--surface-2); }
.pf-name { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pf-name b, .pf-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-name small { display: flex; align-items: center; gap: 6px; }
.pf-name .flag { flex: none; }
.pf-num { display: grid; gap: 2px; text-align: end; flex: none; }
.pf-num small { font-size: 0.74rem; }
.pf-body { display: grid; gap: 16px; padding: 14px 16px 16px; border-top: 1px solid var(--line-soft); }
.pf-body h4 { font-size: 0.9rem; margin-bottom: 8px; }
.pf-body h4 small { font-weight: 500; margin-inline-start: 6px; }
.pf-figs { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pf-figs div { display: grid; gap: 2px; }
.pf-figs small { color: var(--muted); font-size: 0.76rem; }
.pf-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 0.82rem; }
.pf-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; }
.pf-right { margin-bottom: 10px; }
.pf-right > small { display: block; color: var(--muted); font-size: 0.76rem; margin-bottom: 4px; }
.pf-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 0.88rem; }
.pf-fx { font-size: 0.74rem; margin-top: 14px; }
.pf-meters { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 6px 0 4px; }
.pf-meter small { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.78rem; margin-bottom: 4px; }
.pf-meter small b { color: var(--ink); }
.pf-meter > span { display: block; height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.pf-meter i { display: block; height: 100%; border-radius: 99px; }
.pf-win { display: grid; gap: 16px; }
.pf-win h4 { font-size: 0.92rem; margin-bottom: 6px; }
.pf-paynow { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.pf-paynow .field { margin: 0; }
.pf-result { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 4px; }
.pf-result.good { border-color: var(--green); background: var(--green-bg); }
.pf-result small { display: block; color: var(--muted); font-size: 0.76rem; }
.pf-big { font-size: 1.3rem; }
.pf-risk > summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; color: var(--muted); }
.pf-inst-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 86px auto; gap: 6px; align-items: center; }
.pf-share-row { display: grid; gap: 8px; padding: 10px 12px; }
.pf-share-row[data-sh-self] { grid-template-columns: 1fr 110px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pf-share-row[data-sh-line] { grid-template-columns: minmax(0, 1fr) 96px auto; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pf-share-row[data-sh-line] select, .pf-share-row[data-sh-line] input { min-inline-size: 0; inline-size: 100%; }
.ops-portal { min-inline-size: 0; max-inline-size: 100%; }
.ops-portal > * { min-inline-size: 0; max-inline-size: 100%; }
.ops-portal select { max-inline-size: 100%; }
.ops-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.role-switch-btn { display: inline-flex; align-items: center; gap: 6px; max-inline-size: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 680px) {
  .role-switch-btn { max-inline-size: 132px; padding-inline: 8px; font-size: 0.76rem; }
}
@media (max-width: 680px) { .pf-paynow { grid-template-columns: 1fr 1fr; } .pf-paynow .btn { grid-column: 1 / -1; } }
@media (max-width: 680px) {
  .pf-kpis { grid-template-columns: 1fr 1fr; }
  .pf-kpi .value { font-size: 1.05rem; white-space: normal; overflow-wrap: anywhere; }
  .pf-kpi.pf-main { grid-column: 1 / -1; }
  .pf-kpi.pf-main .value { font-size: 1.3rem; }
  .pf-row > summary { flex-wrap: wrap; }
  .pf-num { flex-basis: 100%; text-align: start; padding-inline-start: 64px; }
  .pf-inst-row { grid-template-columns: 1fr 1fr; padding: 8px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
  .pf-inst-row > input[name="iLabel"] { grid-column: 1 / -1; }
  .phone-in { grid-template-columns: 104px minmax(0, 1fr); }
}

/* Help & support (#/support, Brick L) */
.support-page { display: flex; flex-direction: column; gap: 14px; min-inline-size: 0; max-inline-size: 760px; margin-inline: auto; inline-size: 100%; }
.support-page > * { min-inline-size: 0; max-inline-size: 100%; }
.support-contact { display: flex; flex-direction: column; gap: 12px; }
.support-markets { display: flex; flex-wrap: wrap; gap: 6px; }
.support-markets .btn { display: inline-flex; align-items: center; gap: 6px; }
.support-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.support-dot { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.support-dot.on { background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.support-dot.off { background: var(--amber, #b45309); }
.support-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.support-act { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-block: 12px; text-align: center; min-inline-size: 0; }
.support-act small { overflow-wrap: anywhere; font-size: 0.74rem; }
.support-ico { font-size: 1.25rem; line-height: 1; }
.support-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.support-topic summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.support-topic ol { margin-block: 10px; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 0.9rem; }
.support-thread { display: flex; flex-direction: column; gap: 8px; max-block-size: 52vh; overflow-y: auto; margin-block: 12px; padding-block: 4px; }
.support-msg { align-self: flex-start; max-inline-size: 86%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; overflow-wrap: anywhere; }
.support-msg.mine { align-self: flex-end; background: var(--gold-tint); border-color: transparent; }
.support-msg small { display: block; font-size: 0.72rem; margin-block-end: 2px; }
.support-reply { display: flex; gap: 8px; }
.support-reply input { flex: 1; min-inline-size: 0; }
.support-help-link { display: block; text-align: center; margin-block-start: 12px; font-size: 0.86rem; }

/* Order & contractor job step tracker + WhatsApp confirmation receipt (Brick M) */
.track-strip { display: flex; flex-direction: column; gap: 6px; margin-block: 8px; min-inline-size: 0; max-inline-size: 100%; }
.track-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-inline-size: 0; }
.track-step { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-soft); }
.track-step i { font-style: normal; font-size: 0.7rem; }
.track-step.is-done { background: var(--green-bg); color: var(--green); border-color: transparent; font-weight: 600; }
.track-step.is-current { background: var(--blue-bg); color: var(--blue); border-color: transparent; font-weight: 700; }
.track-step.is-skipped { opacity: 0.55; }
.track-meta { font-size: 0.78rem; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.wa-receipt { margin-block: 6px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--surface-2); font-size: 0.78rem; min-inline-size: 0; max-inline-size: 100%; }
.wa-receipt > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; }
.wa-receipt > summary::-webkit-details-marker { display: none; }
.wa-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; background: var(--green-bg); color: var(--green); font-weight: 700; font-size: 0.72rem; }
.wa-receipt-body { margin-block-start: 6px; padding-block-start: 6px; border-block-start: 1px dashed var(--line); display: grid; gap: 3px; font-size: 0.76rem; overflow-wrap: anywhere; }

/* Community (#/community, Brick R1): one card per community, one line per unit. Logical properties only. */
.com-page { display: flex; flex-direction: column; gap: 14px; min-inline-size: 0; max-inline-size: 760px; margin-inline: auto; inline-size: 100%; }
.com-page > * { min-inline-size: 0; max-inline-size: 100%; }
.com-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-inline-size: 0; }
.com-name { flex: 1 1 12rem; min-inline-size: 0; overflow-wrap: anywhere; }
.com-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-block-start: 4px; min-inline-size: 0; overflow-wrap: anywhere; }
.com-meta .flag, .com-flagged .flag { flex: none; }
.com-flagged { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-inline-size: 0; }
.com-sub { margin-block: 6px 0; font-size: 1rem; }
.com-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-block: 8px; border-block-start: 1px solid var(--line); min-inline-size: 0; }
.com-line .grow { flex: 1 1 8rem; min-inline-size: 0; overflow-wrap: anywhere; }
.com-claim { margin-block-start: 10px; }
.com-issues { margin-block: 0 4px; padding-inline-start: 18px; font-size: .84rem; color: var(--warn); }
.com-units { margin-block-start: 10px; }
.com-units > summary { cursor: pointer; font-weight: 700; font-size: .88rem; padding-block: 4px; }
.com-votes { font-variant-numeric: tabular-nums; white-space: nowrap; }
.com-check { margin-block: 12px; }
.com-res-wrap { margin-block-start: 12px; padding-block-start: 10px; border-block-start: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.com-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-block-end: 4px; min-inline-size: 0; }
.com-sec-head .grow { flex: 1 1 10rem; min-inline-size: 0; overflow-wrap: anywhere; }
.com-res-line { flex-direction: column; align-items: stretch; gap: 6px; }
.com-res-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-inline-size: 0; }
.com-res-top .grow { flex: 1 1 10rem; min-inline-size: 0; overflow-wrap: anywhere; }
.com-res-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; min-inline-size: 0; }
.com-res-note, .com-res-meta { display: block; margin-block-start: 2px; overflow-wrap: anywhere; }
.com-my-unit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); min-inline-size: 0; }
.com-my-unit .grow { flex: 1 1 9rem; min-inline-size: 0; overflow-wrap: anywhere; }
.com-vote-btns { display: flex; flex-wrap: wrap; gap: 6px; min-inline-size: 0; }
.com-amt { white-space: nowrap; }
.com-ballots { font-size: 0.82rem; min-inline-size: 0; }
.com-ballots > summary { cursor: pointer; color: var(--muted); padding-block: 2px; }
.com-ballot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding-block: 3px; border-block-start: 1px dashed var(--line-soft); min-inline-size: 0; }
