:root {

  /* Per-portal accents. Each role's sign-in screen and avatar colour is a brand
     decision, so it lives here with every other token rather than as a hex
     literal inside login.js and chat.js. */
  --role-manager: #1a73e8;
  --role-manager-2: #4285f4;
  --role-owner: #1e8e3e;
  --role-owner-2: #34a853;
  --role-trades: #d93025;
  --role-trades-2: #ea4335;
  --role-office: #6a3ea1;
  --role-office-2: #8a5cd1;
  --role-pm: #b06000;
  --role-pm-2: #e8890c;
  --role-admin: #0b7285;
  --role-admin-2: #1098ad;
  --avatar-1: linear-gradient(135deg, var(--role-manager), var(--role-manager-2));
  --avatar-2: linear-gradient(135deg, var(--role-owner), var(--role-owner-2));
  --avatar-3: linear-gradient(135deg, var(--role-trades), var(--role-trades-2));
  --avatar-4: linear-gradient(135deg, #8430ce, #a436f0);
  /* Readable amber for text and borders — the raw #b06000 was repeated at 8
     sites because the token did not exist. */
  --amber-strong: #b06000;
  --bg: #ffffff;
  --bg-soft: #f7f8f9;
  --bg-card: #ffffff;
  --bg-hover: #f3f4f6;
  --bg-elevated: #ffffff;
  --border: #e8eaed;
  --border-strong: #d1d5db;
  --text: #1a1a1a;
  --text-soft: #5f6368;
  --text-muted: #80868b;
  --brand: #1a73e8;
  --brand-soft: #e8f0fe;
  --brand-strong: #1557b0;
  --green: #1e8e3e;
  --green-soft: #e6f4ea;
  --amber: #f9ab00;
  --amber-soft: #fef7e0;
  --red: #d93025;
  --red-soft: #fce8e6;
  --shadow-sm: 0 1px 2px rgba(60,64,67,0.08);
  --shadow-md: 0 1px 3px rgba(60,64,67,0.12), 0 4px 12px rgba(60,64,67,0.06);
  --shadow-lg: 0 2px 6px rgba(60,64,67,0.14), 0 10px 28px rgba(60,64,67,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
  --sidebar-w: 248px;
  --max: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

::selection { background: var(--brand-soft); }

/* ---- App shell --------------------------------------------------------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 20px 22px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.sidebar-brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand) 0%, #4285f4 100%);
  display: grid;
  place-items: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-section { margin-bottom: 16px; }
.nav-section-bottom { margin-bottom: 0; padding-top: 8px; border-top: 1px solid var(--border); }

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  margin: 2px 0;
}

.nav-item:hover { background: var(--bg-hover); text-decoration: none; color: var(--text); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.nav-item .icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: grid; place-items: center;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  line-height: 18px;
}

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar-user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #4285f4);
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user .info { min-width: 0; flex: 1; }
.sidebar-user .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { font-size: 11px; color: var(--text-muted); }
.sidebar-user .logout {
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-user .logout:hover { background: var(--bg-hover); color: var(--text); }

/* ---- Main content ----------------------------------------------------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar .actions { display: flex; gap: 10px; align-items: center; }

/* ---- Global search bar ------------------------------------------------ */
.topbar-search {
  flex: 1;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}

.topbar-search .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  padding: 10px 42px 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: var(--bg-soft);
  font-size: 14px;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.topbar-search input:focus {
  outline: none;
  background: var(--bg);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 100;
}

.sr-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s;
}
.sr-item:hover { background: var(--bg-hover); }
.sr-item.sr-selected { background: var(--brand-soft); }

.sr-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  flex-shrink: 0;
}

.sr-main { font-weight: 600; font-size: 14px; }
.sr-sub { font-size: 12px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

.sr-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

.content {
  padding: 28px 32px 60px;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}

.content-narrow { max-width: 880px; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }

.btn-danger { background: var(--red); border-color: var(--red); color: white; }
.btn-danger:hover { background: #b3261e; border-color: #b3261e; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
/* Icons ship at their own intrinsic size (16–20px). Left uncapped, an icon in a
   small button makes it taller than a text-only one, which breaks the
   .card-header 67px grid. Cap them to the text line box instead. */
.btn-sm svg { width: 16px; height: 16px; flex: none; }

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }

/* ---- Cards ------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* Single-line headers must be the same height whether or not they carry an
     action button, so side-by-side cards line their titles and rules up.
     18 + 18 padding + 30px (the tallest single-line child, .btn-sm) + 1px rule. */
  min-height: 67px;
}

.card-title { font-weight: 600; font-size: 15px; }
.card-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.card-body { padding: 22px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Stat tiles -------------------------------------------------------- */
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.stat-delta { font-size: 12px; margin-top: 6px; color: var(--text-soft); }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* ---- Traffic-light dashboard ----------------------------------------- */
.tl-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.tl-row:last-child { border-bottom: none; }
.tl-row:hover { background: var(--bg-hover); margin: 0 -22px; padding-left: 22px; padding-right: 22px; }

.tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tl-dot.red { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.tl-dot.amber { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.tl-dot.green { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.tl-content { flex: 1; min-width: 0; }
.tl-title { font-weight: 500; font-size: 14px; }
.tl-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.tl-due { font-size: 12px; color: var(--text-soft); white-space: nowrap; }

/* ---- Tables ----------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr.row-hover:hover td { background: var(--bg-hover); }

/* ---- Badges / pills --------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-soft);
  white-space: nowrap;
}

.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: #b06000; }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--brand-soft); color: var(--brand-strong); }

/* A badge that doubles as a filter toggle. Keeps the badge's own colour but
   reads as pressable, and shows a ring when it is the active filter. */
.badge-filter {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: box-shadow 0.12s, border-color 0.12s, opacity 0.12s;
}
.badge-filter:hover { opacity: 0.82; }
.badge-filter.active { border-color: currentColor; box-shadow: 0 0 0 3px var(--bg-hover); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; background: var(--bg-hover); color: var(--text-soft); }

/* ---- Document filter chips -------------------------------------------- */
.doc-filter {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  font-weight: 500;
}
.doc-filter:hover { background: var(--bg-hover); color: var(--text); }
.doc-filter.active { background: var(--brand); border-color: var(--brand); color: white; font-weight: 600; }

/* ---- Forms ------------------------------------------------------------ */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

/* `input:not([type])` matters: a bare <input> defaults to type=text but does
   NOT match input[type=text], so omitting the attribute silently fell back to
   default browser chrome (this hit every modal in the compliance hub). */
input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=tel], input[type=search],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea { min-height: 100px; resize: vertical; font-family: inherit; }

.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* Strata-plan duplicate warning (Add property modal) */
.pr-plan-warn {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--red, #d93025);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pr-plan-warn::before {
  content: '⚠';
  font-size: 13px;
}
.input-warn {
  border-color: var(--red, #d93025) !important;
  background: rgba(217,48,37,0.04);
}
.btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Landing page ----------------------------------------------------- */
/* Light "studio" aesthetic: soft off-white stage, warm amber god-ray
   lighting columns, editorial serif headline, minimal chrome. */
.landing {
  position: relative;
  min-height: 100vh;
  background: #F4F5F7;
  color: #1A1A2E;
  overflow-x: hidden;
}

/* God-ray columns fanning from bottom-center (soft amber on light) */
.stage-rays {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.stage-rays .ray {
  position: absolute; bottom: 0;
  left: 50%;
  width: 90px; height: 78%;
  background: linear-gradient(to top, rgba(232,112,48,0.42), transparent 88%);
  transform-origin: bottom center;
  filter: blur(4px);
  opacity: 0.5;
}
.stage-rays .ray:nth-child(1) { transform: translateX(-50%) rotate(-22deg); height: 70%; opacity: 0.30; }
.stage-rays .ray:nth-child(2) { transform: translateX(-50%) rotate(-14deg); height: 80%; opacity: 0.38; }
.stage-rays .ray:nth-child(3) { transform: translateX(-50%) rotate(-6deg);  height: 90%; opacity: 0.46; }
.stage-rays .ray:nth-child(4) { transform: translateX(-50%) rotate(0deg);   height: 96%; opacity: 0.54; }
.stage-rays .ray:nth-child(5) { transform: translateX(-50%) rotate(6deg);   height: 90%; opacity: 0.46; }
.stage-rays .ray:nth-child(6) { transform: translateX(-50%) rotate(14deg);  height: 80%; opacity: 0.38; }
.stage-rays .ray:nth-child(7) { transform: translateX(-50%) rotate(22deg);  height: 70%; opacity: 0.30; }
.stage-rays::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -10%;
  transform: translateX(-50%);
  width: 60vw; height: 36vh;
  background: radial-gradient(ellipse at center, rgba(232,112,48,0.28), transparent 70%);
}

/* Subtle film grain over the rays (lighter on light bg) */
.stage-grain {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.landing-nav {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 48px;
  background: none; border: none;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px;
  color: #1A1A2E;
  letter-spacing: -0.01em;
}
.nav-brand .logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: #1A1A2E;
  color: #ffffff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: #1A1A2E; font-size: 14px; font-weight: 500; opacity: 0.7;
}
.nav-links a:hover { opacity: 1; }

.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Light-theme login trigger — dark ink pill button */
.login-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  color: #ffffff;
  font-size: 14px; font-weight: 600;
  background: #1A1A2E;
  border: none;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 28px;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.login-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232,112,48,0.28);
  opacity: 0.95;
}
.login-trigger svg { transition: transform 0.18s; }
.dropdown.open .login-trigger svg { transform: rotate(180deg); }

/* ---- Dropdown (login selector) --------------------------------------- */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(26,26,46,0.14), 0 4px 14px rgba(26,26,46,0.08);
  padding: 6px;
  z-index: 100;
  animation: menuIn 0.16s ease;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none; cursor: pointer; text-align: left;
  transition: background 0.12s;
}
.dropdown-item:hover { background: #F3F4F6; }

.di-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.di-info { flex: 1; min-width: 0; }
.di-title { font-weight: 600; font-size: 14px; color: #1A1A2E; }
.di-sub { font-size: 12px; color: #6B7280; }

.dropdown-cta .dropdown-menu { min-width: 280px; }

/* ---- Hero ------------------------------------------------------------- */
.hero {
  position: relative; z-index: 5;
  padding: 70px 40px 80px;
  background: none;
}

.hero-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 5px 13px;
  background: #ffffff;
  color: #1A1A2E;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(26,26,46,0.05);
}

.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 64px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: #1A1A2E;
  margin-bottom: 24px;
}
.hero-title .thin { font-weight: 300; opacity: 0.72; }

.hero-sub {
  font-size: 17px;
  line-height: 1.6;
  color: #5f6368;
  max-width: 620px;
  margin: 0 auto 36px;
  font-weight: 400;
}

.hero-cta {
  display: flex; gap: 14px;
  justify-content: center; align-items: center;
  margin-bottom: 56px;
}

/* Dark ink pill primary CTA (inverse of the dark theme's white pill) */
.btn-pill {
  background: #1A1A2E;
  color: #ffffff;
  border: none;
  padding: 14px 30px;
  font-size: 15px; font-weight: 600;
  border-radius: 28px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(232,112,48,0.3);
}

/* Ghost button (secondary) */
.btn-ghost-lg {
  color: #1A1A2E;
  border: 1px solid #D1D5DB;
  background: #ffffff;
  padding: 12px 24px;
  font-size: 15px; font-weight: 600;
  border-radius: 28px;
  display: inline-flex; align-items: center;
  transition: background 0.18s, border-color 0.18s;
}
.btn-ghost-lg:hover { background: #F3F4F6; border-color: #9CA3AF; }

.hero-stats {
  display: flex;
  gap: 56px;
  justify-content: center;
}
.hero-stat .hs-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #1A1A2E;
}
.hero-stat .hs-label {
  font-size: 13px;
  color: #6B7280;
  margin-top: 4px;
}

/* ---- Features section ------------------------------------------------ */
.features {
  position: relative; z-index: 5;
  padding: 72px 40px 80px;
  background: #ECEDEE;
  border-top: 1px solid #E5E7EB;
}

.features-inner { max-width: 1100px; margin: 0 auto; }

.features-head { text-align: center; margin-bottom: 48px; }
.features-eyebrow {
  font-size: 13px; font-weight: 700;
  color: #C05410;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.features-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 38px; font-weight: 500;
  letter-spacing: -0.01em;
  color: #1A1A2E;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: #ffffff;
  color: #1A1A2E;
  border: 1px solid #E5E7EB;
  border-radius: 18px;
  padding: 22px 22px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(26,26,46,0.05);
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.feature-card:hover {
  box-shadow: 0 14px 36px rgba(26,26,46,0.10), 0 3px 8px rgba(26,26,46,0.06);
  transform: translateY(-3px);
  border-color: #D1D5DB;
}

.fc-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-bottom: 0;
}
.fc-icon svg { width: 22px; height: 22px; }

.fc-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 4px;
  color: #1A1A2E;
}
.fc-body {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.5;
}
.fc-text { flex: 1; min-width: 0; }

/* ---- Roles section ---------------------------------------------------- */
.roles {
  position: relative; z-index: 5;
  padding: 80px 40px;
  background: #F4F5F7;
}

.roles-inner { max-width: 1100px; margin: 0 auto; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.role-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 18px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(26,26,46,0.05);
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.role-card:hover {
  box-shadow: 0 18px 44px rgba(26,26,46,0.10), 0 4px 10px rgba(26,26,46,0.06);
  transform: translateY(-2px);
  border-color: #D1D5DB;
}

.rc-badge {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 22px;
  margin: 0 auto 18px;
}

.rc-title {
  font-size: 20px; font-weight: 700;
  color: #1A1A2E;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.rc-sub {
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 20px;
}

.rc-list {
  list-style: none;
  text-align: left;
  margin-bottom: 26px;
}
.rc-list li {
  padding: 7px 0;
  font-size: 14px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rc-list li::before {
  content: '';
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(232,112,48,0.14) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23C05410'><path d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/></svg>") center/11px no-repeat;
  flex-shrink: 0;
}

/* Role login button — amber accent by default, --accent overrides per role */
.btn-role {
  width: 100%;
  justify-content: center;
  display: inline-flex; align-items: center;
  background: var(--accent, #E87030);
  color: #ffffff;
  border: 1px solid var(--accent, #E87030);
  border-radius: 28px;
  padding: 11px 22px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn-role:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(232,112,48,0.3);
  opacity: 0.95;
}

/* ---- Landing footer -------------------------------------------------- */
.landing-footer {
  position: relative; z-index: 5;
  padding: 32px 40px;
  border-top: 1px solid #E5E7EB;
  background: #ECEDEE;
}

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.footer-note { font-size: 13px; color: #6B7280; }
.footer-note code {
  background: #F3F4F6;
  padding: 1px 6px; border-radius: 4px;
  font-family: var(--mono); font-size: 12px;
  color: #374151;
}

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 900px) {
  .landing-nav { padding: 18px 20px; }
  .nav-links { display: none; }
  .hero { padding: 48px 20px 56px; }
  .hero-title { font-size: 40px; }
  .hero-sub { font-size: 16px; }
  .hero-stats { gap: 32px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn-pill, .hero-cta .btn-ghost-lg { width: 100%; justify-content: center; }
  .features, .roles { padding: 56px 20px; }
  .features-title { font-size: 28px; }
  .feature-grid, .role-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .dropdown-menu { right: 0; left: 0; min-width: 0; width: max-content; max-width: calc(100vw - 36px); }
  .stage-rays .ray { width: 60px; }
}

/* ---- Meeting wizard --------------------------------------------------- */
.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
}

.wizard-step {
  flex: 1;
  padding: 11px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 0.12s, color 0.12s;
}

.wizard-step.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.wizard-step.done { color: var(--green); font-weight: 600; }
.wizard-step .num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-hover); color: var(--text-soft);
  font-size: 12px; margin-right: 6px;
}
.wizard-step.active .num { background: var(--brand); color: white; }
.wizard-step.done .num { background: var(--green); color: white; }

/* ---- Voting ----------------------------------------------------------- */
.vote-bar {
  height: 28px;
  border-radius: 6px;
  background: var(--bg-hover);
  display: flex;
  overflow: hidden;
  margin: 8px 0 4px;
}
.vote-for { background: var(--green-soft); color: var(--green); }
.vote-against { background: var(--red-soft); color: var(--red); }
.vote-abstain { background: var(--bg-hover); color: var(--text-soft); }
.vote-segment {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  padding: 0 8px;
  min-width: 0;
}

/* ---- Charts (simple CSS bars) ---------------------------------------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 200px;
  padding-top: 20px;
  border-bottom: 1px solid var(--border);
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.bar-stack {
  width: 100%;
  max-width: 36px;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  height: 100%;
  justify-content: flex-start;
}
.bar-seg {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.4s;
  position: relative;
  cursor: pointer;
}
.bar-seg::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}
.bar-seg::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1a1a1a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}
.bar-seg:hover::after,
.bar-seg:hover::before {
  opacity: 1;
}
.bar-label { font-size: 11px; color: var(--text-muted); }

/* ---- Empty states ----------------------------------------------------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty .icon { font-size: 36px; opacity: 0.4; margin-bottom: 10px; }
.empty .title { font-weight: 600; color: var(--text-soft); margin-bottom: 4px; }

/* ---- Toast ------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: #1a1a1a;
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  z-index: 1000;
  animation: toastIn 0.2s ease;
  max-width: 360px;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Modal ------------------------------------------------------------ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(60,64,67,0.4);
  display: grid; place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ---- List items ------------------------------------------------------- */
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

/* ---- Misc ------------------------------------------------------------- */
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.bold { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 13px; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* Type scale — replaces the repeated inline `font-size:NNpx`. Values preserved
   1:1 from the inline styles they supersede, so rendering is unchanged. */
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-15 { font-size: 15px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; }
.fs-22 { font-size: 22px; }
.fs-24 { font-size: 24px; }
.fs-28 { font-size: 28px; }

/* Layout / box utilities — the other high-frequency inline styles. */
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.pointer { cursor: pointer; }
.hidden { display: none; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.p-0 { padding: 0; }

/* Semantic text colours (tokens only). .text-red already exists above. */
.text-green { color: var(--green); }
.text-amber { color: var(--amber-strong); }

.section-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.01em; }

/* ---- AI feature styling ------------------------------------------------ */
.ai-card {
  background: linear-gradient(135deg, #f0f6ff 0%, #f7f9fc 100%);
  border: 1px solid #c5d9f5;
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ai-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, var(--brand), #4285f4);
  color: white;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.ai-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 320px;
  overflow-y: auto;
}

/* ---- Per-role login screen ------------------------------------------- */
.role-login {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    var(--bg-soft);
}

.role-login-wrap {
  min-height: calc(100vh - 65px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.role-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 28px;
  text-align: center;
}

.rl-badge {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 22px;
  margin: 0 auto 18px;
}

.rl-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}

.rl-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rl-tagline {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 26px;
}

.rl-form { text-align: left; }

.rl-form .form-group { margin-bottom: 14px; }

.rl-error {
  font-size: 13px;
  color: var(--red);
  margin: 4px 0 12px;
  padding: 8px 12px;
  background: var(--red-soft);
  border-radius: var(--radius-sm);
}
.rl-error code { font-family: var(--mono); font-weight: 600; }

.rl-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
  padding: 11px 16px;
  font-size: 15px;
}

.rl-divider {
  margin: 24px 0 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  position: relative;
}
.rl-divider::before, .rl-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 70px);
  height: 1px;
  background: var(--border);
}
.rl-divider::before { left: 0; }
.rl-divider::after { right: 0; }

.rl-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rl-switch-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s, border-color 0.12s;
  text-align: left;
}
.rl-switch-btn:hover {
  background: var(--bg-hover);
  text-decoration: none;
  border-color: var(--border-strong);
}
/* A portal that exists in the picker but is not available to sign into yet. */
.rl-switch-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.rls-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}
.rls-info { flex: 1; min-width: 0; }
.rls-title { font-weight: 600; font-size: 13px; }
.rls-sub { font-size: 11px; color: var(--text-muted); }

.rl-hint {
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
}
.rl-hint code {
  font-family: var(--mono);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ---- Chat (live messaging) -------------------------------------------- */
.chat-who-name { font-weight: 600; }
.chat-who-role { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.chat-pick-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}

.prop-search-wrap { position: relative; }
.prop-search-wrap .search-results { top: calc(100% + 4px); }

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 80%;
}
.chat-msg.chat-mine {
  flex-direction: row-reverse;
  margin-left: auto;
}

.chat-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}

.chat-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 0;
}
.chat-msg.chat-mine .chat-bubble {
  background: var(--brand-soft);
  border-color: #c5d9f5;
}

.chat-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.chat-text {
  font-size: 14px;
  color: var(--text);
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* ---- Mobile-first (contractor) --------------------------------------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px 18px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
}

/* Mobile bottom nav for contractor */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  z-index: 50;
}
.mobile-nav .items { display: flex; justify-content: space-around; }
.mobile-nav .item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-muted);
  padding: 6px 12px; border-radius: 8px;
}
.mobile-nav .item.active { color: var(--brand); font-weight: 600; }
.mobile-nav .item .icon { font-size: 20px; }

body.contractor .mobile-nav { display: block; }
body.contractor .content { padding-bottom: 80px; }
/* ---- Trust & Compliance hub -------------------------------------------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand-strong);
  white-space: nowrap;
}
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-amber { background: var(--amber-soft); color: #b06000; }
.pill-green { background: var(--green-soft); color: var(--green); }
.text-red { color: var(--red); }
.note-box strong { font-weight: 700; }
.complie-tab:hover { color: var(--brand) !important; }

/* ---- Segmented focus tabs (property page) ------------------------------ */
.seg-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px;
}
.seg-tab {
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  padding: 8px 16px; border-radius: 9px; transition: background .15s, color .15s;
}
.seg-tab:hover { color: var(--text); }
.seg-tab.active { background: var(--bg-card); color: var(--brand-strong); box-shadow: var(--shadow-sm); }

/* ---- Accessibility: visible keyboard focus ----------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
.row-hover:focus-visible,
.list-item:focus-visible,
.nav-item:focus-visible,
.seg-tab:focus-visible,
.sr-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Don't show the ring on mouse click, only keyboard nav */
:focus:not(:focus-visible) { outline: none; }

/* ---- Person picker (relational owner/tenant assignment) ------------------ */
.pp-results { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.pp-result {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); cursor: pointer; font: inherit; text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.pp-result:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.pp-empty { padding: 10px; font-size: 13px; color: var(--text-muted); }
.pp-create { margin-top: 8px; }
.pp-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--brand); border-radius: var(--radius-sm);
  background: var(--brand-soft);
}

