@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

/* Core layout */
:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ink: #1a1815;
  --ink-2: #3d3a34;
  --ink-3: #6b6458;
  --ink-4: #9a9188;
  --accent: #c49510;
  --accent-strong: #a97807;
  --accent-soft: rgba(196, 149, 16, 0.1);
  --accent-on-dark: #e3b008;
  --canvas: #f7f5f0;
  --surface-card: #ffffff;
  --surface-subtle: #f2efe9;
  --surface-inset: #edeae3;
  --rule: rgba(26, 24, 21, 0.08);
  --rule-strong: rgba(26, 24, 21, 0.14);
  --success: #1e7a45;
  --success-soft: rgba(30, 122, 69, 0.1);
  --danger: #b03030;
  --danger-soft: rgba(176, 48, 48, 0.1);
  --info: #2563a8;
  --info-soft: rgba(37, 99, 168, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(26, 24, 21, 0.06), 0 1px 2px rgba(26, 24, 21, 0.04);
  --shadow-md: 0 12px 28px rgba(26, 24, 21, 0.08), 0 2px 6px rgba(26, 24, 21, 0.05);
  --shadow-card: 0 1px 4px rgba(26, 24, 21, 0.06), 0 0 0 1px rgba(26, 24, 21, 0.05);
  --brand: var(--accent);
  --brand-dark: var(--accent-strong);
  --text: var(--ink);
  --background: var(--canvas);
  --card: var(--surface-card);
  --border: var(--rule);
  --surface-muted: var(--surface-subtle);
  --panel-shadow: var(--shadow-card);
  --button-primary: #1a1815;
  --button-primary-dark: #3d3a34;
  --button-primary-text: #ffffff;
  --button-primary-dark-text: #ffffff;
  --page-gradient-start: transparent;
  --page-gradient-mid: transparent;
  --page-gradient-end: transparent;
  --page-gradient-radial-a: transparent;
  --page-gradient-radial-b: transparent;
  --page-gradient-radial-c: transparent;
  --page-gradient-overlay-opacity: 0;
  --space-section-y: 2.75rem;
  --space-section-y-lg: 3.25rem;
  --space-section-padding: 1.5rem;
  --space-card-padding: 1.125rem;
  --space-element-gap: 0.875rem;
  --font-size-base: 0.95rem;
  --font-size-page-title: 1.78rem;
  --font-size-section-title: 1.14rem;
  --font-size-label: 0.8rem;
  --text-muted: var(--ink-3);
}

/* Cool neutral palette — cool grey/stone undertones */
html[data-palette="cool"] {
  --canvas: #f3f4f6;
  --surface-subtle: #ebedf0;
  --surface-inset: #e5e7eb;
  --ink: #1a1c23;
  --ink-2: #374151;
  --ink-3: #606770;
  --ink-4: #868c98;
  --rule: rgba(26, 30, 40, 0.08);
  --rule-strong: rgba(26, 30, 40, 0.14);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 4px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.05);
  --text: var(--ink);
  --background: var(--canvas);
  --border: var(--rule);
  --surface-muted: var(--surface-subtle);
  --text-muted: var(--ink-3);
}

/* High contrast palette — maximum readability, all tokens pass AA text */
html[data-palette="contrast"] {
  --canvas: #ffffff;
  --surface-card: #ffffff;
  --surface-subtle: #f0f0f0;
  --surface-inset: #e0e0e0;
  --ink: #000000;
  --ink-2: #1a1a1a;
  --ink-3: #3d3d3d;
  --ink-4: #595959;
  --accent: #946d00;
  --accent-strong: #7a5900;
  --accent-soft: rgba(148, 109, 0, 0.12);
  --rule: rgba(0, 0, 0, 0.18);
  --rule-strong: rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08);
  --text: var(--ink);
  --background: var(--canvas);
  --border: var(--rule);
  --surface-muted: var(--surface-subtle);
  --text-muted: var(--ink-3);
  --button-primary: #000000;
  --button-primary-dark: #1a1a1a;
}

/* Ocean palette — calming blue-grey tones */
html[data-palette="ocean"] {
  --canvas: #f0f4f8;
  --surface-subtle: #e2e8f0;
  --surface-inset: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --ink-3: #475569;
  --ink-4: #5f6d80;
  --rule: rgba(15, 23, 42, 0.08);
  --rule-strong: rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 1px 4px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --text: var(--ink);
  --background: var(--canvas);
  --border: var(--rule);
  --surface-muted: var(--surface-subtle);
  --text-muted: var(--ink-3);
}

/* Sage palette — soft green-grey, nature-inspired */
html[data-palette="sage"] {
  --canvas: #f1f4ef;
  --surface-subtle: #e4e9e0;
  --surface-inset: #d6ddd1;
  --ink: #1a2318;
  --ink-2: #2d3b29;
  --ink-3: #566150;
  --ink-4: #7d8a77;
  --rule: rgba(26, 35, 24, 0.08);
  --rule-strong: rgba(26, 35, 24, 0.14);
  --shadow-sm: 0 1px 3px rgba(26, 35, 24, 0.06), 0 1px 2px rgba(26, 35, 24, 0.04);
  --shadow-md: 0 12px 28px rgba(26, 35, 24, 0.08), 0 2px 6px rgba(26, 35, 24, 0.05);
  --shadow-card: 0 1px 4px rgba(26, 35, 24, 0.06), 0 0 0 1px rgba(26, 35, 24, 0.05);
  --text: var(--ink);
  --background: var(--canvas);
  --border: var(--rule);
  --surface-muted: var(--surface-subtle);
  --text-muted: var(--ink-3);
}

/* Sandstone palette — deeper warm, earthy terracotta tones */
html[data-palette="sandstone"] {
  --canvas: #f5f0eb;
  --surface-subtle: #ebe4db;
  --surface-inset: #e0d6cb;
  --ink: #2a1f16;
  --ink-2: #4a3c2f;
  --ink-3: #6f6050;
  --ink-4: #968778;
  --rule: rgba(42, 31, 22, 0.08);
  --rule-strong: rgba(42, 31, 22, 0.14);
  --shadow-sm: 0 1px 3px rgba(42, 31, 22, 0.06), 0 1px 2px rgba(42, 31, 22, 0.04);
  --shadow-md: 0 12px 28px rgba(42, 31, 22, 0.08), 0 2px 6px rgba(42, 31, 22, 0.05);
  --shadow-card: 0 1px 4px rgba(42, 31, 22, 0.06), 0 0 0 1px rgba(42, 31, 22, 0.05);
  --text: var(--ink);
  --background: var(--canvas);
  --border: var(--rule);
  --surface-muted: var(--surface-subtle);
  --text-muted: var(--ink-3);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --accent-on-dark: #facc15;
  --brand: #60a5fa;
  --brand-dark: #3b82f6;
  --text: #f1f5f9;
  --text-muted: rgba(148, 163, 184, 0.95);
  --background: #0b1220;
  --card: #0f172a;
  --border: rgba(148, 163, 184, 0.24);
  --surface-muted: rgba(148, 163, 184, 0.12);
  --panel-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --nav-bg: #0b1220;
  --nav-text: #f1f5f9;
  --card-bg: #0f172a;
  --button-primary: #1a1815;
  --button-primary-dark: #3d3a34;
  --button-primary-text: #ffffff;
  --button-primary-dark-text: #ffffff;
  --hero-bg-start: #0b1220;
  --hero-bg-end: #0f172a;
  --hero-text: #f8fafc;
  --hero-text-muted: rgba(226, 232, 240, 0.82);
  --hero-eyebrow: rgba(96, 165, 250, 0.95);
  --hero-stat-surface: rgba(15, 23, 42, 0.82);
  --hero-stat-label: rgba(226, 232, 240, 0.72);
  --hero-stat-value: rgba(248, 250, 252, 0.96);
  --hero-cta-ghost-bg: rgba(255, 255, 255, 0.06);
  --hero-cta-ghost-border: rgba(148, 163, 184, 0.32);
  --hero-cta-ghost-text: rgba(248, 250, 252, 0.96);
  --hero-cta-secondary-bg: rgba(255, 255, 255, 0.08);
  --hero-cta-secondary-text: rgba(248, 250, 252, 0.96);
  --page-gradient-start: rgba(59, 130, 246, 0.12);
  --page-gradient-mid: rgba(96, 165, 250, 0.08);
  --page-gradient-end: rgba(2, 6, 23, 0.32);
  --page-gradient-radial-a: rgba(59, 130, 246, 0.16);
  --page-gradient-radial-b: rgba(96, 165, 250, 0.12);
  --page-gradient-radial-c: rgba(2, 6, 23, 0.22);
  --page-gradient-overlay-opacity: 0.65;
  --hero-softness: 0;
}

html[data-theme="dark"] :where(
  .team-hero,
  .inspection-header,
  .quote-hero,
  .rem-hero,
  .remedials-hero
) {
  --hero-softness: 0 !important;
  --hero-bg-start: #0b1220 !important;
  --hero-bg-end: #0f172a !important;
  --hero-text: #f8fafc !important;
  --hero-text-muted: rgba(226, 232, 240, 0.82) !important;
  --hero-eyebrow: rgba(96, 165, 250, 0.95) !important;
  --hero-stat-surface: rgba(15, 23, 42, 0.82) !important;
  --hero-stat-label: rgba(226, 232, 240, 0.72) !important;
  --hero-stat-value: rgba(248, 250, 252, 0.96) !important;
  --hero-cta-ghost-bg: rgba(255, 255, 255, 0.06) !important;
  --hero-cta-ghost-border: rgba(148, 163, 184, 0.32) !important;
  --hero-cta-ghost-text: rgba(248, 250, 252, 0.96) !important;
  --hero-cta-secondary-bg: rgba(255, 255, 255, 0.08) !important;
  --hero-cta-secondary-text: rgba(248, 250, 252, 0.96) !important;
}

html[data-theme="dark"] :where(
  .team-hero__stats,
  .quote-hero__stats,
  .rem-hero__stats,
  .invoice-hero__stats
) dt {
  color: var(--hero-stat-label, rgba(226, 232, 240, 0.72)) !important;
}

html[data-theme="dark"] :where(
  .team-hero__stats,
  .quote-hero__stats,
  .rem-hero__stats,
  .invoice-hero__stats
) dd {
  color: var(--hero-stat-value, rgba(248, 250, 252, 0.96)) !important;
}





html[data-theme="dark"] .top-bar {
  --topbar-control-bg: rgba(15, 23, 42, 0.82);
  --topbar-control-bg-hover: rgba(15, 23, 42, 0.92);
  --topbar-control-border: rgba(148, 163, 184, 0.36);
  --topbar-control-border-hover: rgba(226, 232, 240, 0.46);
  --topbar-control-text: rgba(226, 232, 240, 0.92);
  --topbar-control-shadow-focus: 0 10px 22px rgba(0, 0, 0, 0.45);
  background: rgba(2, 6, 23, 0.66);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .top-bar-actions .btn__icon {
  color: rgba(226, 232, 240, 0.86);
}

html[data-theme="dark"] .top-bar-toplink {
  color: rgba(226, 232, 240, 0.88);
}

html[data-theme="dark"] .top-bar-toplink .btn__icon {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.82);
}

html[data-theme="dark"] .top-bar-toplink:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .top-bar-toplink:focus-visible .btn__icon {
  border-color: rgba(226, 232, 240, 0.45);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .top-bar-toplink:focus-visible .top-bar-help-label {
  color: rgba(248, 250, 252, 0.95);
}

html[data-theme="dark"] .top-bar-user {
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .top-bar-user-avatar {
  box-shadow: 0 0 0 2px rgba(2, 6, 23, 0.85);
}

html[data-theme="dark"] .top-bar-notifications__badge {
  box-shadow: 0 0 0 2px rgba(2, 6, 23, 0.9);
}

html[data-theme="dark"] .top-bar-user-menu__dropdown {
  background: var(--card);
  border-color: var(--border);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .top-bar-user-menu__header {
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .top-bar-user-menu__name {
  color: var(--text);
}

html[data-theme="dark"] .top-bar-user-menu__email {
  color: var(--text-muted);
}

html[data-theme="dark"] .top-bar-user-menu__label {
  color: var(--text);
}

html[data-theme="dark"] .top-bar-user-menu__hint {
  color: var(--text-muted);
}

html[data-theme="dark"] .top-bar-user-menu__divider {
  background: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .top-bar-user-menu__item--logout .top-bar-user-menu__label {
  color: #f87171;
}

html[data-theme="dark"] .top-bar-user-menu__item--logout .top-bar-user-menu__icon {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

html[data-theme="dark"] .top-bar-user-menu__item--logout:hover,
html[data-theme="dark"] .top-bar-user-menu__item--logout:focus-visible {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.2);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.36);
  color: var(--text);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .modal__dialog {
  background: var(--card);
}

html[data-theme="dark"] .modal__header,
html[data-theme="dark"] .modal__footer {
  background: var(--card);
}

html[data-theme="dark"] .modal__header {
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .modal__footer {
  border-top-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] table,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-responsive {
  background: var(--card);
  border-color: var(--border);
}

html[data-theme="dark"] thead th {
  background: rgba(15, 23, 42, 0.9);
  color: rgba(226, 232, 240, 0.9);
  border-bottom-color: rgba(148, 163, 184, 0.26);
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.48);
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(30, 41, 59, 0.65);
}

html[data-theme="dark"] .top-bar-theme-toggle {
  --topbar-link-accent: rgba(96, 165, 250, 0.95);
}

html[data-theme="dark"] .first-win-banner {
  border-color: rgba(227, 176, 8, 0.15);
  background: linear-gradient(135deg, rgba(227, 176, 8, 0.06), rgba(227, 176, 8, 0.02));
}

/* Old dark-mode rules for dock/helper/handoff/hero removed —
   dark mode for .fw-panel lives in first-win.css */

html[data-theme="dark"] .first-win-picker-card {
  background: var(--card, #0f172a);
  border-color: var(--border, rgba(148, 163, 184, 0.24));
  box-shadow: none;
}

html[data-theme="dark"] .first-win-picker-card:hover {
  border-color: rgba(148, 163, 184, 0.38);
}

html[data-theme="dark"] .first-win-picker-card.is-selected {
  border-color: rgba(227, 176, 8, 0.45);
  box-shadow: 0 0 0 3px rgba(227, 176, 8, 0.1);
}

html[data-theme="dark"] .app-notifications__panel {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .app-notifications__mark-all {
  color: var(--text-muted);
}

html[data-theme="dark"] .app-notifications__mark-all:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .app-notifications__close {
  color: rgba(148, 163, 184, 0.95);
}

html[data-theme="dark"] .app-notifications__close:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .app-notifications__item--unread {
  background: rgba(196, 149, 16, 0.14);
}

html[data-theme="dark"] .app-notifications__body,
html[data-theme="dark"] .app-notifications__meta,
html[data-theme="dark"] .app-notifications__empty-title,
html[data-theme="dark"] .app-notifications__empty-sub,
html[data-theme="dark"] .app-notifications__footer-link {
  color: var(--text-muted);
}

html[data-theme="dark"] .table-actions__menu {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .table-actions__menu-item:hover,
html[data-theme="dark"] .table-actions__menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .table-actions__menu-item:active {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .component-guide-modal__dialog {
  background: var(--card);
  border: 1px solid var(--border);
}

html[data-theme="dark"] .component-guide-modal__header {
  background: rgba(15, 23, 42, 0.92);
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .component-guide-modal__close {
  color: var(--text-muted);
}

html[data-theme="dark"] .today-visit-item {
  background: rgba(15, 23, 42, 0.65);
}

html[data-theme="dark"] .today-visit-item:hover {
  background: rgba(30, 41, 59, 0.68);
}

html[data-theme="dark"] .today-visit-item__time {
  color: var(--text);
}

html[data-theme="dark"] .today-visit-item__label {
  color: var(--text-muted);
}

html[data-theme="dark"] .booking-card__field {
  color: var(--text-muted);
}

html[data-theme="dark"] .booking-card__field select {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.36);
  color: var(--text);
}

html[data-theme="dark"] .u-bg-surface {
  background: var(--card);
}

html[data-theme="dark"] .u-bg-danger-soft {
  background: rgba(239, 68, 68, 0.12);
}

html[data-theme="dark"] .card--timeline {
  background: var(--card);
}

html[data-theme="dark"] .timeline::before {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.22), rgba(96, 165, 250, 0.08));
}

html[data-theme="dark"] .timeline-date {
  color: rgba(148, 163, 184, 0.9);
}

html[data-theme="dark"] .timeline-item {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.92));
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .timeline-item__icon {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .timeline-item__time,
html[data-theme="dark"] .timeline-item__title {
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .timeline-item__pill {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.86);
}

html[data-theme="dark"] .timeline-item__pill--start {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}

html[data-theme="dark"] .timeline-item__pill--add {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

html[data-theme="dark"] .timeline-item__pill--edit {
  background: rgba(249, 115, 22, 0.22);
  color: #fdba74;
}

html[data-theme="dark"] .timeline-item__pill--status {
  background: rgba(147, 51, 234, 0.22);
  color: #ddd6fe;
}

html[data-theme="dark"] .timeline-item__pill--update {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.82);
}

html[data-theme="dark"] .timeline-chip {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.84);
}

html[data-theme="dark"] .timeline-chip strong {
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .timeline-chip--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.24);
  color: rgba(226, 232, 240, 0.9);
}

html[data-theme="dark"] .add-door-app {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(2, 6, 23, 0.92) 70%);
  box-shadow: var(--panel-shadow);
}

html[data-theme="dark"] .add-door-app__hero {
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .app-chip {
  background: rgba(59, 130, 246, 0.2);
  color: rgba(248, 250, 252, 0.92);
}

html[data-theme="dark"] .app-chip--quiet {
  background: rgba(148, 163, 184, 0.16);
  color: rgba(226, 232, 240, 0.84);
}

html[data-theme="dark"] .app-field-card {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.92));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .door-card__section--app {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(15, 23, 42, 0.9));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .add-door-app .component-row {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .component-row--app {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .component-row__helper {
  color: rgba(148, 163, 184, 0.9);
}

html[data-theme="dark"] .component-row__fields--app label {
  background: rgba(2, 6, 23, 0.7);
  color: var(--text);
}

html[data-theme="dark"] .component-issue-hints--app {
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.7);
}

html[data-theme="dark"] .component-issue-hints--app summary {
  color: rgba(248, 250, 252, 0.92);
}

html[data-theme="dark"] .component-issue-hints--app ul {
  color: rgba(226, 232, 240, 0.86);
}

html[data-theme="dark"] .door-type-option span {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.42);
  color: rgba(248, 250, 252, 0.92);
}

html[data-theme="dark"] .add-door-app--fullscreen .door-stepper__controls {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.92));
  box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.52);
}

html[data-theme="dark"] .component-icon--threshold {
  background: rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .import-pdf-grid__aside h4 {
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .file-field > label {
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .file-upload-card {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(2, 6, 23, 0.55);
}

html[data-theme="dark"] .file-upload-card__action {
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
}

html[data-theme="dark"] .file-upload-card__action:hover,
html[data-theme="dark"] .file-upload-card--has-value .file-upload-card__action {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .file-upload-card__action strong {
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .file-upload-card__action p {
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .import-pdf-flag {
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .import-pdf-preview-frame {
  background: rgba(2, 6, 23, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
}


/* Property page uses severity-pill--{low,medium,high}. Ensure consistent styling across views. */
.severity-pill--high {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.severity-pill--medium {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

.severity-pill--low {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

html[data-theme="dark"] .severity-pill--high {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

html[data-theme="dark"] .severity-pill--medium {
  background: rgba(245, 158, 11, 0.14);
  color: #fdba74;
}

html[data-theme="dark"] .severity-pill--low {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

html[data-theme="dark"] .insp-history-filter input,
html[data-theme="dark"] .insp-history-filter select {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.36);
  color: var(--text);
}

html[data-theme="dark"] .door-detail-card {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.65);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

/* First Win banner — matches setup-resume-banner pattern */
.first-win-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  margin: 16px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--accent-soft, rgba(196, 149, 16, 0.18));
  background: linear-gradient(135deg, rgba(196, 149, 16, 0.06), rgba(196, 149, 16, 0.02));
  box-shadow: var(--shadow-sm);
}

/* When the banner sits inside .inspections-proto (dashboard + setup
   workspace views since 2026-04-24), the proto extends itself to the
   full viewport bleed via `margin-inline: calc(var(--ipi-page-gutter) *
   -1)`. Siblings like .ipi-page-header and .ipi-stats-strip compensate
   with `padding: ... var(--ipi-page-gutter)` so their content aligns
   with the page content column. Mirror that here via horizontal margin
   so the banner card itself lines up with the header content below — and
   no longer bleeds wider than the rest of the page. */
.inspections-proto > .first-win-banner {
  margin-left: var(--ipi-page-gutter);
  margin-right: var(--ipi-page-gutter);
}

.first-win-banner__state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.first-win-banner__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.first-win-banner__content strong {
  font-size: 13.5px;
  color: var(--ink, #1a1815);
}

.first-win-banner__content .text-muted {
  font-size: 12px;
}

.first-win-banner__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Old first-win dock/page-helper/handoff/hero CSS removed —
   replaced by .fw-panel in first-win.css */

.first-win-picker-modal__options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.first-win-picker-card {
  appearance: none;
  text-align: left;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  background: var(--surface-card, #ffffff);
  color: inherit;
  display: grid;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.first-win-picker-card:hover {
  transform: translateY(-1px);
  border-color: var(--rule-strong, rgba(26, 24, 21, 0.14));
  box-shadow: var(--shadow-md);
}

.first-win-picker-card.is-selected {
  border-color: var(--accent-strong, #a97807);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(196, 149, 16, 0.1));
}

.first-win-picker-card__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #1a1815);
}

.first-win-picker-card__copy {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3, #6b6458);
  line-height: 1.45;
}

.first-win-picker-card__steps {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink-3, #6b6458);
}

.first-win-picker-card__steps li + li {
  margin-top: 3px;
}

.first-win-picker-modal__error {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--danger, #b03030);
}

@media (max-width: 900px) {
  .first-win-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
  }
  .first-win-banner__state {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .first-win-banner__actions {
    width: 100%;
  }
  .first-win-banner__actions .btn {
    width: 100%;
    min-height: 40px;
  }
  .first-win-picker-modal__options {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

/* Global elements improvements */
/*
 * Make images within the main content and card components responsive.
 * Restricting the selector scope prevents brand logos and decorative
 * icons from unintentionally scaling to fill their containers.
 */
.content img,
.card img,
.table-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*
 * Provide accessible focus outlines on interactive elements only.
 * This ensures that hidden or non-interactive elements do not render
 * unexpected focus indicators on larger screens. The outline offset
 * creates breathing room between the element and the outline.
 */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text);
  font-size: var(--font-size-base, 0.9375rem);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

body.tenant-app-shell {
  height: 100vh;
  overflow: hidden;
}

@supports (height: 100dvh) {
  body.tenant-app-shell {
    height: 100dvh;
  }
}

h1,
h2,
h3,
h4,
h5,
h6,
.text-page-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

body.mobile-nav-open {
  overflow: hidden;
}

.mobile-nav-trigger {
  position: relative;
  top: auto;
  right: auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--surface-card);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  z-index: 1200;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

.mobile-nav-trigger span {
  width: 18px;
  height: 1.75px;
  background: var(--ink-2);
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-nav-open .mobile-nav-trigger span:nth-child(1) {
  transform: translateY(5.75px) rotate(45deg);
}

.mobile-nav-open .mobile-nav-trigger span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-open .mobile-nav-trigger span:nth-child(3) {
  transform: translateY(-5.75px) rotate(-45deg);
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, 0.24);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.25s ease;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.mobile-nav-trigger:focus {
  outline: 2px solid var(--brand);
}

body.mobile-nav-open .mobile-nav-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

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

.app-shell {
  display: grid;
  grid-template-rows: 56px 1fr;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--canvas);
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  width: auto;
  color: var(--ink-2);
  padding: 12px 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-right: 1px solid var(--rule);
  background: var(--surface-card);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.11) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.11);
  border-radius: 2px;
}

.sidebar-brand {
  display: none;
}

.sidebar-brand img {
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.sidebar-nav__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav__section + .sidebar-nav__section {
  margin-top: 2px;
}

.sidebar-nav__section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-nav__section-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ink-4);
  padding: 8px 10px 2px;
  margin: 0;
}

.sidebar-nav__section-heading .sidebar-nav__section-label {
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-nav__section-bell {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-4);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  opacity: 1;
}

.sidebar-nav__section-bell:hover,
.sidebar-nav__section-bell:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--brand) 18%, var(--rule));
}

.sidebar-nav__section-bell .top-bar-notifications__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav__section-bell .top-bar-notifications__icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-nav__section-bell .top-bar-notifications__badge {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--surface-card);
}

.sidebar-nav__section-bell .top-bar-notifications__badge[hidden] {
  display: none !important;
}

.sidebar-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav__item {
  margin: 0;
  padding: 0;
}

.sidebar-nav__form {
  margin: 0;
}

.sidebar-nav__form button {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sidebar-link-padding);
  border-radius: 10px;
  color: var(--ink-3);
  border: 1px solid transparent;
  background: transparent;
  position: relative;
  min-height: 40px;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-nav__item--mobile-only {
  display: none;
}

.sidebar-nav__link--button {
  width: 100%;
  text-align: left;
  font: inherit;
}

.sidebar-nav__badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav__badge[hidden] {
  display: none !important;
}

.sidebar-nav__link::before {
  display: none;
}

.sidebar-nav__link:hover,
.sidebar-nav__link:focus-visible {
  color: var(--ink-2);
  background: var(--surface-subtle);
  border-color: var(--rule);
}

.sidebar-nav__link.active {
  background: color-mix(in srgb, var(--brand) 9%, #ffffff);
  color: var(--brand-dark);
  font-weight: 600;
  border-color: color-mix(in srgb, var(--brand) 18%, var(--rule));
}

.sidebar-nav__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
}

.sidebar-nav__icon-svg {
  width: 16px;
  height: 16px;
  opacity: 0.78;
}

.sidebar-nav__label {
  flex: 1;
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sidebar-nav__chevron {
  display: none;
}

.sidebar-nav__divider {
  width: 100%;
  height: 1px;
  background: var(--rule);
  border-radius: 999px;
}

.sidebar-nav__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-nav__version {
  padding: 0 10px;
  font-size: 0.74rem;
  color: var(--ink-4);
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-nav__link {
    transition: none;
  }

  .sidebar-nav__link:hover,
  .sidebar-nav__link:focus-visible {
    transform: none;
  }

  .sidebar-nav__link::before,
  .sidebar-nav__link.active::before {
    transition: none;
  }
}

.sidebar-nav__link--logout {
  font-size: 0.9rem;
  width: 100%;
  opacity: 1;
  color: var(--ink-4);
}

.sidebar-nav__form--logout {
  margin: 0;
}

.sidebar-nav__logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: none;
  font: inherit;
  background: transparent;
  color: var(--ink-3);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  opacity: 0.65;
  text-align: left;
}

.sidebar-nav__logout-button span {
  white-space: nowrap;
}

.sidebar-nav__logout-button:hover,
.sidebar-nav__logout-button:focus-visible {
  opacity: 1;
}

.content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  padding: 0 28px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
}

.content::before {
  display: none;
}

/* Page-level layout + spacing utilities */
.page-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-section-y, 2.5rem);
}

.page-main {
  flex: 1 1 auto;
  min-width: 0;
}

.page-sidebar {
  flex: 0 0 320px;
  max-width: 360px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-element-gap, 0.75rem);
  margin-bottom: var(--space-section-y, 2.5rem);
}

.page-section {
  padding: var(--space-section-padding, 1.5rem) 0;
}

.page-section + .page-section {
  margin-top: var(--space-section-y, 2.5rem);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stack-12 {
  display: flex;
  flex-direction: column;
  gap: var(--space-element-gap, 0.75rem);
}

.stack-24 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.layout-columns-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-element-gap, 0.75rem);
}

.layout-columns-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-element-gap, 0.75rem);
}

.show-on-mobile {
  display: none !important;
}

.show-on-mobile.btn,
.show-on-mobile.btn-primary-modern,
.show-on-mobile.btn-secondary-outline,
.show-on-mobile.btn-sm-modern,
.show-on-mobile.btn-small {
  display: none !important;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.shell-icon {
  width: 15px;
  height: 15px;
  display: block;
  flex-shrink: 0;
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  background: var(--surface-card);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-right: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.logo-flame {
  width: 28px;
  height: 28px;
  background: #1a1815;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-flame svg {
  width: 16px;
  height: 16px;
}

.logo-image {
  height: 28px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo-name b {
  color: var(--accent);
}

/* ── "Your Logo" placeholder (no brand logo uploaded) ── */
.logo-placeholder { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo-placeholder svg { display: block; }
.logo-placeholder--compact svg { height: 28px; width: auto; }
.logo-placeholder--default svg { height: 48px; width: auto; }
.logo-placeholder--large svg { height: 120px; width: auto; }

html[data-theme="dark"] .logo-placeholder svg text { fill: rgba(148, 163, 184, 0.7); }
html[data-theme="dark"] .logo-placeholder svg rect:first-child { stroke: #e3b008; }

.tb-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.11);
  flex-shrink: 0;
}

.tb-divider--compact {
  margin: 0 4px;
}

.tb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  background: var(--canvas);
  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 8px;
  padding: 0 13px;
  flex: 0 0 320px;
  width: 320px;
  max-width: 320px;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tb-search:focus-within {
  border-color: rgba(196, 149, 16, 0.4);
  box-shadow: 0 0 0 3px rgba(196, 149, 16, 0.08);
}

.tb-search .shell-icon {
  width: 13px;
  height: 13px;
  color: var(--ink-4);
}

.tb-search input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink);
  width: 100%;
  min-width: 0;
}

.tb-search input::placeholder {
  color: var(--ink-4);
}

.tb-search-kbd {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--ink-4);
  background: var(--surface-inset);
  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 4px;
  padding: 1px 5px;
}

.tb-spacer {
  flex: 1;
}

/* ── Topbar breadcrumb ── */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-4);
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.topbar-breadcrumb__link {
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.12s;
}

.topbar-breadcrumb__link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.topbar-breadcrumb__sep {
  color: var(--ink-4);
  opacity: 0.4;
}

.topbar-breadcrumb__current {
  color: var(--ink-2);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .topbar-breadcrumb__link {
  color: rgba(148, 163, 184, 0.7);
}

html[data-theme="dark"] .topbar-breadcrumb__link:hover {
  color: rgba(248, 250, 252, 0.9);
}

html[data-theme="dark"] .topbar-breadcrumb__current {
  color: rgba(248, 250, 252, 0.8);
}

.tb-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tb-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-3);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.tb-btn:hover,
.tb-btn:focus-visible {
  background: var(--surface-subtle);
  color: var(--ink-2);
  outline: none;
}

.tb-btn .shell-icon {
  width: 14px;
  height: 14px;
}

.tb-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  transition: background 0.15s, color 0.15s;
}

.tb-icon:hover,
.tb-icon:focus-visible {
  background: var(--surface-subtle);
  color: var(--ink-3);
  outline: none;
}

.tb-icon.notif {
  position: relative;
}

.topbar .top-bar-notifications {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--ink-4);
  box-shadow: none;
}

.topbar .top-bar-notifications:hover,
.topbar .top-bar-notifications:focus-visible {
  background: var(--surface-subtle);
  color: var(--ink-3);
  border: none;
  box-shadow: none;
}

.tb-notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  min-width: 6px;
  padding: 0;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--surface-card);
  color: transparent;
  font-size: 0;
  box-shadow: none;
}

.topbar .top-bar-notifications__badge {
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--surface-card);
  box-shadow: none;
}

.tb-notif-dot[hidden] {
  display: none !important;
}

.shell-user-menu {
  position: relative;
}

.shell-user-menu summary {
  list-style: none;
}

.shell-user-menu summary::-webkit-details-marker {
  display: none;
}

.tb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.11);
  background: var(--surface-card);
  cursor: pointer;
  margin-left: 4px;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: var(--shadow-sm);
}

.tb-user:hover,
.tb-user:focus-visible {
  background: var(--surface-subtle);
  border-color: rgba(0, 0, 0, 0.11);
  outline: none;
}

.tb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.tb-uname {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.tb-chevron {
  width: 10px;
  height: 10px;
  color: var(--ink-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shell-user-menu[open] .tb-chevron {
  transform: rotate(180deg);
}

.sb-section {
  margin-bottom: 4px;
}

.sb-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 8px 10px 4px;
  display: block;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
  transition: background 0.12s, color 0.12s;
  margin-bottom: 1px;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sb-item:hover,
.sb-item:focus-visible {
  background: var(--surface-subtle);
  color: var(--ink-2);
  outline: none;
}

.sb-item.active {
  background: rgba(196, 149, 16, 0.08);
  color: var(--accent);
  font-weight: 500;
}

.sb-item-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-item-icon .shell-icon {
  width: 15px;
  height: 15px;
  color: currentColor;
  opacity: 0.7;
}

.sb-item.active .sb-item-icon .shell-icon {
  opacity: 1;
}

.sb-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-badge-red {
  background: rgba(176, 48, 48, 0.07);
  color: var(--danger);
}

.sb-badge-neu {
  background: var(--surface-inset);
  color: var(--ink-4);
}

.sb-footer {
  margin-top: auto;
  padding: 16px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-version {
  padding: 0 10px;
  font-size: 0.74rem;
  color: var(--ink-4);
  line-height: 1.2;
}

.sb-footer__form {
  margin: 0;
}

.sb-item--logout {
  color: var(--ink-4);
}

.sb-item--logout:hover,
.sb-item--logout:focus-visible {
  color: var(--ink-2);
}

.top-bar-user-menu__mobile-only {
  display: none;
}

.top-bar {
  --topbar-control-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -24px -28px 24px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1600;
  backdrop-filter: blur(12px);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.top-bar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
  color: var(--ink);
}

.top-bar-brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1a1815;
  color: #f5c853;
  flex: 0 0 auto;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.top-bar-brand__mark svg {
  width: 16px;
  height: 16px;
}

.top-bar-brand__mark--image {
  padding: 2px;
}

.top-bar-brand__mark--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.top-bar-brand__mark-fallback {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.top-bar-brand__name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}

.top-bar-search {
  display: inline-flex;
  align-items: center;
  height: var(--topbar-control-height);
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--canvas);
  border: 1px solid var(--rule-strong);
  box-shadow: none;
  flex: 1 1 320px;
  max-width: 360px;
  min-width: 220px;
}

.top-bar-search:focus-within {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--rule-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}

.top-bar-search__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  flex: 0 0 auto;
}

.top-bar-search__icon .sidebar-nav__icon-svg {
  width: 15px;
  height: 15px;
  opacity: 1;
}

.top-bar-search input {
  border: none;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 0.86rem;
  color: var(--ink);
  font-family: var(--font-sans);
}

.top-bar-search input::placeholder {
  color: var(--ink-4);
}

.top-bar-search input:focus:not(:focus-visible) {
  outline: none;
}

.top-bar-search__shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--surface-inset);
  color: var(--ink-4);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex: 0 0 auto;
}

.top-bar::after { display: none; }

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-page,
.top-bar-page-subtitle {
  display: none;
}

.top-bar-offline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--topbar-control-height);
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--surface-subtle);
  color: var(--ink-4);
  font-size: 0.76rem;
  white-space: nowrap;
}

.top-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--topbar-control-height);
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

.top-bar-link:focus-visible {
  outline: none;
  background: var(--surface-subtle);
  border-color: var(--rule);
  color: var(--ink-2);
}

.top-bar-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: currentColor;
}

.top-bar-link__icon .sidebar-nav__icon-svg {
  width: 15px;
  height: 15px;
  opacity: 1;
}

.top-bar-link__label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: currentColor;
}

.top-bar-utility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--topbar-control-height);
  height: var(--topbar-control-height);
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-4);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-shadow: none;
}

.top-bar-utility:focus-visible {
  background: var(--surface-subtle);
  border-color: var(--rule);
  transform: none;
  color: var(--ink-2);
}

.top-bar-notifications {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--topbar-control-height);
  height: var(--topbar-control-height);
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-4);
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.top-bar-notifications__icon svg {
  width: 16px;
  height: 16px;
}

.top-bar-notifications__badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  background: var(--danger);
  color: transparent;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--surface-card);
}

.top-bar-notifications__badge[hidden] {
  display: none !important;
}

.top-bar-notifications:hover,
.top-bar-notifications:focus-visible {
  color: var(--ink-2);
  border-color: var(--rule);
  background: var(--surface-subtle);
}

.top-bar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar-control-height);
  padding: 0 10px 0 6px;
  border-radius: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--surface-card);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  min-width: 0;
  max-width: 220px;
}

.top-bar-user:focus-visible {
  background: var(--surface-subtle);
  border-color: var(--rule);
  transform: none;
}

.top-bar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.top-bar-user-avatar-initials {
  line-height: 1;
}

.top-bar-user-meta {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.top-bar-user-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-user-name::after {
  content: '';
  display: inline-block;
  flex: 0 0 auto;
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: var(--ink-4) transparent transparent transparent;
  transform: translateY(1px);
  opacity: 0.9;
}

.top-bar-user-menu {
  position: relative;
}

.top-bar-user-menu summary {
  list-style: none;
}

.top-bar-user-menu summary::-webkit-details-marker {
  display: none;
}

.top-bar-user-menu[open] .top-bar-user-name::after {
  transform: translateY(0) rotate(180deg);
}

.top-bar-user-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: min(260px, calc(100vw - 24px));
  max-width: min(300px, calc(100vw - 16px));
  border-radius: 12px;
  background: var(--surface-card);
  border: 1px solid color-mix(in srgb, var(--rule) 85%, transparent);
  box-shadow:
    0 14px 36px rgba(26, 24, 21, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  padding: 6px;
  z-index: 1610;
}

.top-bar-user-menu__dropdown form {
  margin: 0;
}

.top-bar-user-menu__header {
  padding: 6px 8px 8px;
  margin: 0 0 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 65%, transparent);
}

.top-bar-user-menu__identity {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.top-bar-user-menu__name {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--ink);
}

.top-bar-user-menu__email {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.top-bar-user-menu__items {
  display: flex;
  flex-direction: column;
  padding-top: 4px;
  gap: 2px;
}

.top-bar-user-menu__item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}

/* Shown only on small viewports (see mobile.css); top bar keeps Theme on tablet/desktop */
.top-bar-user-menu__item--theme-picker {
  display: none;
}

.top-bar-user-menu__divider {
  height: 1px;
  background: var(--rule);
  margin: 2px 0 0;
}

.top-bar-user-menu__item--logout {
  padding: 4px 6px;
  gap: 6px;
  border-radius: 8px;
}

.top-bar-user-menu__item--logout .top-bar-user-menu__icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.top-bar-user-menu__item--logout .top-bar-user-menu__icon svg {
  width: 12px;
  height: 12px;
}

.top-bar-user-menu__item--logout .top-bar-user-menu__label {
  color: var(--danger);
  font-size: 0.75rem;
}

.top-bar-user-menu__item--logout:hover,
.top-bar-user-menu__item--logout:focus-visible {
  background: color-mix(in srgb, var(--danger) 6%, transparent);
  border-color: color-mix(in srgb, var(--danger) 18%, transparent);
}

.top-bar-user-menu__icon--shell .shell-icon {
  width: 17px;
  height: 17px;
  display: block;
}

button.top-bar-user-menu__item {
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.top-bar-user-menu__item:hover,
.top-bar-user-menu__item:focus-visible {
  background: color-mix(in srgb, var(--surface-subtle) 92%, var(--surface-card));
  border-color: color-mix(in srgb, var(--rule) 55%, transparent);
  outline: none;
}

.top-bar-user-menu__icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface-subtle) 88%, transparent);
  color: var(--ink-3);
  flex-shrink: 0;
}

.top-bar-user-menu__icon svg {
  width: 16px;
  height: 16px;
}

.top-bar-user-menu__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.top-bar-user-menu__label {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.top-bar-user-menu__hint {
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--ink-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.top-bar-help .top-bar-link__label {
  color: inherit;
}

.top-bar-guided-tour .top-bar-link__label {
  color: var(--accent);
  font-weight: 600;
}

.tb-btn.top-bar-guided-tour {
  position: relative;
}

.tb-btn.top-bar-guided-tour.is-tour-active,
.tb-btn.top-bar-guided-tour.is-tour-hidden {
  color: var(--accent);
}

.tb-btn.top-bar-guided-tour.is-tour-active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tb-btn.top-bar-guided-tour.is-tour-hidden {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

@keyframes guided-tour-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(230, 86, 30, 0.3);
    opacity: 0.95;
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(230, 86, 30, 0);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(230, 86, 30, 0);
    opacity: 0.95;
  }
}

.top-bar-brand__mark img {
  display: block;
}

.app-notifications {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 2135;
}

.app-notifications[hidden] {
  display: none !important;
}

.app-notifications__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 24, 21, 0.45);
}

.app-notifications__panel {
  position: relative;
  margin: 78px 24px 24px;
  width: 100%;
  max-width: 360px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: app-notifications-in 0.18s cubic-bezier(.16, 1, .3, 1);
}

@keyframes app-notifications-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-notifications__header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.app-notifications__title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1815;
  letter-spacing: -0.02em;
}

.app-notifications__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-notifications__mark-all {
  border: none;
  background: transparent;
  color: #c49510;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s ease;
}

.app-notifications__mark-all:hover {
  opacity: 0.7;
}

.app-notifications__close {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: #edeae3;
  color: #9a9188;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.app-notifications__close:hover {
  background: #e5e1d8;
}

.app-notifications__close svg {
  width: 11px;
  height: 11px;
}

.app-notifications__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.app-notifications__list::-webkit-scrollbar {
  width: 4px;
}

.app-notifications__list::-webkit-scrollbar-thumb {
  background: #e5e1d8;
  border-radius: 2px;
}

.app-notifications__item {
  position: relative;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  background: #ffffff;
  transition: background 0.12s ease;
}

.app-notifications__item:last-child {
  border-bottom: none;
}

.app-notifications__item:hover {
  background: #f2efe9;
}

.app-notifications__item--unread {
  background: rgba(196, 149, 16, 0.08);
}

.app-notifications__item--unread:hover {
  background: rgba(196, 149, 16, 0.13);
}

.app-notifications__item--unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #c49510;
  border-radius: 0 2px 2px 0;
}

.app-notifications__title-row {
  font-size: 13px;
  font-weight: 600;
  color: #c49510;
  line-height: 1.3;
}

.app-notifications__item:not(.app-notifications__item--unread) .app-notifications__title-row {
  color: #3d3a34;
}

.app-notifications__link {
  color: inherit;
  text-decoration: none;
}

.app-notifications__link:hover {
  text-decoration: none;
}

.app-notifications__link:focus-visible {
  outline: 2px solid rgba(196, 149, 16, 0.3);
  outline-offset: 2px;
  border-radius: 4px;
}

.app-notifications__body {
  margin-top: 4px;
  color: #6b6458;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
}

.app-notifications__meta {
  margin-top: 5px;
  color: #9a9188;
  font-size: 11.5px;
  font-weight: 400;
}

.app-notifications__empty {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.app-notifications__empty-icon {
  width: 24px;
  height: 24px;
  color: #9a9188;
  margin-bottom: 4px;
}

.app-notifications__empty-title {
  color: #6b6458;
  font-size: 13.5px;
  font-weight: 500;
}

.app-notifications__empty-sub {
  color: #9a9188;
  font-size: 12.5px;
  font-weight: 300;
}

.app-notifications__footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  text-align: center;
  flex-shrink: 0;
}

.app-notifications__footer-link {
  color: #9a9188;
  font-size: 12.5px;
  font-weight: 500;
}

.card-grid {
  display: grid;
  gap: var(--space-element-gap, 0.75rem);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card);
  padding: var(--space-card-padding, 1rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.card-header,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-element-gap, 0.75rem);
}

.card__header,
.card__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-element-gap, 0.75rem);
  flex-wrap: wrap;
}

.card__header {
  margin-bottom: var(--space-element-gap, 0.75rem);
}

.card__footer {
  margin-top: var(--space-element-gap, 0.75rem);
}

.card__header .text-section-title {
  margin: 0;
}

.card__header p {
  margin: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-element-gap, 0.75rem);
}

.card-header + .card-body,
.card-body + .card-footer {
  margin-top: var(--space-element-gap, 0.75rem);
}

.card + .card {
  margin-top: 20px;
}

.card--surface {
  background: var(--surface-muted);
}

.card--brand {
  border-top: 4px solid var(--brand);
}

.card--timeline {
  background: #ffffff;
}

.card--full-mobile {
  width: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover,
  .card:focus-within {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--rule-strong);
  }
}

.card--wizard .form-section {
  border: none;
  background: #f5f7ff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.form-progress {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.form-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #7a8090;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.form-progress__step span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  color: #fff;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.card h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
}

.stats {
  font-size: 2rem;
  font-weight: 700;
}

/* Shared rotation keyframes for inline spinners (buttons, guided tour, mobile nav-pending). */
@keyframes fdBtnSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Submit / async buttons: JS sets data-loading="1" while a request is in flight. */
.btn[data-loading="1"],
.ipi-filter-railbtn[data-loading="1"] {
  position: relative;
  pointer-events: none;
}

.btn[data-loading="1"]::after,
.ipi-filter-railbtn[data-loading="1"]::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  vertical-align: -2px;
  animation: fdBtnSpin 0.8s linear infinite;
  opacity: 0.85;
}

/* Generic content-area loading placeholder (modal bodies, list containers, etc.). */
.fd-content-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--ink-4, #9a9188);
}

.fd-content-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: fdBtnSpin 0.8s linear infinite;
  flex-shrink: 0;
}

/* Canonical tenant-app button system aligned to the refactored page headers. */
.btn,
.btn-primary-modern,
.btn-secondary-outline,
.btn-ghost,
.ipi-ph-btn,
.dbp-header-btn,
.ipi-filter-railbtn,
.ipi-row-action-btn,
.ipi-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-family: var(--font-sans, inherit);
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:disabled,
.btn[disabled],
.btn-primary-modern:disabled,
.btn-primary-modern[disabled],
.btn-secondary-outline:disabled,
.btn-secondary-outline[disabled],
.btn-ghost:disabled,
.btn-ghost[disabled],
.ipi-ph-btn:disabled,
.ipi-ph-btn[disabled],
.dbp-header-btn:disabled,
.dbp-header-btn[disabled],
.ipi-filter-railbtn:disabled,
.ipi-filter-railbtn[disabled],
.ipi-row-action-btn:disabled,
.ipi-row-action-btn[disabled],
.ipi-action-btn:disabled,
.ipi-action-btn[disabled] {
  opacity: 1;
  background: #edeae3;
  border-color: rgba(0, 0, 0, 0.16);
  color: #6b6458;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary:disabled,
.btn-primary[disabled],
.btn-primary-modern:disabled,
.btn-primary-modern[disabled],
.btn-danger:disabled,
.btn-danger[disabled] {
  background: rgba(26, 24, 21, 0.58);
  border-color: rgba(26, 24, 21, 0.58);
  color: #ffffff;
}

.btn__icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
}

.btn__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.btn-sm-modern {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg-modern {
  min-height: 42px;
  padding: 10px 18px;
  font-size: 13px;
}

.btn-primary,
.btn-primary-modern,
.ipi-ph-primary,
.dbp-header-btn--primary,
.ipi-filter-railbtn--primary,
.ipi-row-action-btn--primary,
.btn-danger {
  background: #1a1815;
  color: var(--button-primary-text, #fff);
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-stripe {
  background: #635BFF;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(99, 91, 255, 0.2), 0 1px 2px rgba(99, 91, 255, 0.1);
}

.btn-stripe:hover {
  background: #5349e0;
}

.btn-stripe:focus-visible {
  outline: 2px solid #635BFF;
  outline-offset: 2px;
}

html[data-theme="dark"] .btn-stripe {
  background: #7a73ff;
}

html[data-theme="dark"] .btn-stripe:hover {
  background: #635BFF;
}

.btn-primary:focus-visible,
.btn-primary-modern:focus-visible,
.ipi-ph-primary:focus-visible,
.dbp-header-btn--primary:focus-visible,
.ipi-filter-railbtn--primary:focus-visible,
.ipi-row-action-btn--primary:focus-visible,
.btn-danger:focus-visible {
  background: #3d3a34;
  color: var(--button-primary-dark-text, var(--button-primary-text, #fff));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.btn-outline,
.btn-secondary,
.btn-light,
.btn-secondary-outline,
.ipi-ph-secondary,
.dbp-header-btn--ghost,
.ipi-filter-railbtn,
.ipi-row-action-btn,
.ipi-row-action-btn--utility,
.ipi-action-btn {
  background: #ffffff;
  color: #3d3a34;
  border-color: rgba(0, 0, 0, 0.11);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-outline:focus-visible,
.btn-secondary:focus-visible,
.btn-light:focus-visible,
.btn-secondary-outline:focus-visible,
.ipi-ph-secondary:focus-visible,
.dbp-header-btn--ghost:focus-visible,
.ipi-filter-railbtn:focus-visible,
.ipi-row-action-btn:focus-visible,
.ipi-row-action-btn--utility:focus-visible,
.ipi-action-btn:focus-visible {
  background: #f2efe9;
  color: #1a1815;
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: #3d3a34;
  border: 1px solid transparent;
}

.btn-ghost:focus-visible {
  background: rgba(26, 24, 21, 0.04);
  color: #1a1815;
  box-shadow: none;
  transform: translateY(-1px);
}

@media (hover: hover) and (pointer: fine) {
  .top-bar-utility:hover {
    background: var(--surface-subtle);
    border-color: var(--rule);
    transform: none;
    color: var(--ink-2);
  }

  .top-bar-link:hover {
    background: var(--surface-subtle);
    border-color: var(--rule);
    color: var(--ink-2);
  }

  .top-bar-user:hover {
    background: var(--surface-subtle);
    border-color: var(--rule);
    transform: none;
  }

  .top-bar-user:hover .top-bar-user-name::after {
    border-top-color: var(--ink-3);
  }

  .btn-primary:hover {
    background: #3d3a34;
    color: var(--button-primary-dark-text, var(--button-primary-text, #fff));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
  }

  .btn-primary-modern:hover {
    background: #3d3a34;
    color: var(--button-primary-dark-text, var(--button-primary-text, #fff));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
  }

  .ipi-ph-primary:hover,
  .dbp-header-btn--primary:hover,
  .ipi-filter-railbtn--primary:hover,
  .ipi-row-action-btn--primary:hover,
  .btn-danger:hover {
    background: #3d3a34;
    color: var(--button-primary-dark-text, var(--button-primary-text, #fff));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
  }

  .btn-outline:hover,
  .btn-secondary:hover,
  .btn-light:hover,
  .btn-secondary-outline:hover {
    background: #f2efe9;
    color: #1a1815;
    border-color: rgba(0, 0, 0, 0.16);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
  }

  .ipi-ph-secondary:hover,
  .dbp-header-btn--ghost:hover,
  .ipi-filter-railbtn:hover,
  .ipi-row-action-btn:hover,
  .ipi-row-action-btn--utility:hover,
  .ipi-action-btn:hover {
    background: #f2efe9;
    color: #1a1815;
    border-color: rgba(0, 0, 0, 0.16);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
  }

  .btn-ghost:hover {
    background: rgba(26, 24, 21, 0.04);
    color: #1a1815;
    box-shadow: none;
    transform: translateY(-1px);
  }

}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

thead th {
  background: color-mix(in srgb, var(--surface-subtle, #f2efe9) 90%, #ffffff 10%);
  color: var(--ink-3, #6b6458);
  font-weight: 700;
  border-bottom: 1px solid var(--rule-strong);
}

tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-subtle, #f2efe9) 62%, #ffffff 38%);
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft, rgba(196, 149, 16, 0.1)) 70%, #ffffff 30%);
}

tbody tr:focus-within {
  background: color-mix(in srgb, var(--accent-soft, rgba(196, 149, 16, 0.1)) 80%, #ffffff 20%);
  box-shadow: inset 0 0 0 2px rgba(196, 149, 16, 0.22);
}

@media (min-width: 769px) {
  .table td[data-label="Actions"],
  .table td[data-label=""] {
    text-align: right;
  }
}

.table-condensed th,
.table-condensed td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.table--compact th,
.table--compact td {
  padding: 10px 12px;
}

.table-modern {
  font-size: 0.92rem;
}

.table-modern thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  background: rgba(248, 250, 252, 0.95);
}

.table-modern tbody tr {
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.table-modern tbody tr:hover {
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .table-modern thead th {
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.9);
}

html[data-theme="dark"] .table tbody td[colspan] {
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.75);
}

.table tbody td[colspan] {
  text-align: center;
  padding: 18px 14px;
  color: #64748b;
  background: rgba(248, 250, 252, 0.92);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.input--search {
  width: min(320px, 100%);
}

.table-wrapper,
.table-responsive {
  border-radius: 14px;
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.table-wrapper > table,
.table-responsive > table {
  border-radius: 0;
  border: 0;
}

.table-wrapper > table thead th,
.table-responsive > table thead th {
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.32);
}

@media (min-width: 1025px) {
  .table--dividers td + td,
  .table--dividers th + th {
    border-left: 1px solid rgba(226, 232, 240, 0.65);
  }
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

:where(
  .ipi-table-wrap,
  .table-wrapper,
  .table-responsive,
  .asset-door-table-wrapper,
  .asset-component-table-wrapper,
  .rem-board-table-wrapper
  
).table-actions-menu-open {
  overflow: visible;
}

.table-stack-mobile {
  width: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pill--ok {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.status-pill--warn {
  background: rgba(234, 179, 8, 0.14);
  color: #854d0e;
}

.status-pill--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
}

.status-pass {
  background: rgba(10, 135, 84, 0.15);
  color: var(--success);
}

.status-fail {
  background: rgba(192, 57, 43, 0.15);
  color: var(--danger);
}

.status-na {
  background: rgba(100, 116, 139, 0.14);
  color: rgba(71, 85, 105, 0.95);
}

html[data-theme="dark"] .status-na {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.9);
}

.legacy-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e5e5;
  color: #555;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

form {
  background: var(--card);
  padding: 16px;
  border-radius: 12px;
  display: grid;
  gap: 12px;
}

.sidebar-nav__form {
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: block;
  gap: 0;
}

/* Forms inside modals don't get the global form card chrome — the modal
   body and its content cards already provide the surface. Without this
   override the form itself renders as a white card with padding, creating
   a double-card effect behind the actual content cards. */
.modal form {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Generic collapsible / accordion */
.accordion {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  overflow: hidden;
}

.accordion__item + .accordion__item {
  border-top: 1px solid var(--border);
}

.accordion__header {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.accordion__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.accordion__chevron {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}

.accordion__header[aria-expanded="true"] .accordion__chevron {
  transform: rotate(90deg);
}

.accordion__panel {
  padding: 0 16px 12px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.22s ease;
}

.accordion__panel[hidden] {
  display: none;
  max-height: 0;
  opacity: 0;
}

/* ── Role-based helper hint ── */
.role-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--ink-4);
  padding: 6px 4px;
  margin: 0;
}

.role-hint__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

html[data-theme="dark"] .role-hint {
  color: rgba(148, 163, 184, 0.7);
}

/* ── Sidebar role badge ── */
.sidebar-role-badge {
  padding: 4px 16px 8px;
}

.sidebar-role-badge__pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  color: var(--ink-3);
  background: var(--surface-subtle);
}

.sidebar-role-badge__pill--owner {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

html[data-theme="dark"] .sidebar-role-badge__pill {
  color: rgba(148, 163, 184, 0.8);
  background: rgba(71, 85, 105, 0.35);
}

html[data-theme="dark"] .sidebar-role-badge__pill--owner {
  color: #e3b008;
  background: rgba(196, 149, 16, 0.18);
}

/* ── Workflow guide — compact collapsible inside page headers ── */
.workflow-guide {
  margin-top: 6px;
}

.workflow-guide__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ipi-accent, var(--accent));
  transition: color 0.15s ease;
}

.workflow-guide__toggle:hover {
  color: var(--ipi-ink-2, var(--ink-2));
}

.workflow-guide__chevron {
  width: 10px;
  height: 10px;
  transition: transform 0.18s ease;
}

.workflow-guide__toggle[aria-expanded="true"] .workflow-guide__chevron {
  transform: rotate(90deg);
}

.workflow-guide__body {
  margin-top: 8px;
}

.workflow-guide__steps {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: wf-step;
}

.workflow-guide__steps li {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ipi-ink-3, var(--ink-3));
  counter-increment: wf-step;
  line-height: 1.35;
}

.workflow-guide__steps li::before {
  content: counter(wf-step);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ipi-accent, var(--accent));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: 1px;
}

.workflow-guide__steps li + li::after {
  display: none;
}

.workflow-guide__steps li strong {
  font-weight: 600;
  color: var(--ipi-ink-2, var(--ink-2));
}

/* Arrow separators between steps */
.workflow-guide__steps li + li {
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--ipi-rule, var(--rule));
}

@media (max-width: 900px) {
  .workflow-guide__steps {
    flex-direction: column;
    gap: 4px;
  }
  .workflow-guide__steps li + li {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-section {
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-section__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-section__title {
  margin: 0;
}

.form-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted, #6c6c6c);
  margin-top: 4px;
}

.quick-fill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-fill-dropdown {
  border: 1px dashed color-mix(in srgb, var(--border, #d7d7d7) 80%, transparent);
  border-radius: 10px;
  background: var(--surface-muted, #fafafa);
  margin-top: 8px;
  padding: 8px 10px;
}

.quick-fill-dropdown summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text, #444);
  list-style: none;
}

.quick-fill-dropdown summary::-webkit-details-marker {
  display: none;
}

.quick-fill-dropdown[open] {
  border-color: var(--button-primary, var(--brand));
  background: color-mix(in srgb, var(--button-primary, var(--brand)) 8%, var(--surface-muted, #fafafa));
}

.quick-fill-dropdown[open] summary {
  margin-bottom: 6px;
}

.quick-fill {
  border: 1px dashed color-mix(in srgb, var(--border, #d7d7d7) 85%, transparent);
  background: transparent;
  color: var(--brand);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.quick-fill:hover,
.quick-fill:focus {
  border-color: var(--brand);
  color: var(--brand-dark);
}

label {
  font-size: 0.9rem;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
}

input[type='checkbox'],
input[type='radio'] {
  width: auto;
  padding: 0;
}

.door-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.door-card {
  border: 1px dashed #ddd;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
}

.door-card + .door-card {
  margin-top: 12px;
}

.door-card__section {
  margin-top: 16px;
  border-top: 1px solid #dfe5f4;
  padding-top: 16px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
}

.door-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.door-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  margin: 0;
  color: #6c6c6c;
}

.door-card__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 12px;
}

.door-components__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.door-components summary {
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.component-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.door-stepper__progress,
.door-stepper__controls {
  display: none;
}

.door-stepper--active .door-stepper__controls {
  margin-top: auto;
}

.add-door-app--fullscreen .door-stepper__controls {
  position: sticky;
  bottom: calc(0px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), #fff);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.12);
  z-index: 5;
}

.component-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.component-row + .component-row {
  margin-top: 10px;
}

.component-row__label strong {
  display: block;
  margin-bottom: 4px;
}

.component-row__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.door-spec-grid {
  gap: 16px;
}

.door-spec-grid--update {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 12px;
}

.door-type-fieldset {
  border: 1px solid rgba(0, 82, 204, 0.15);
  border-radius: 16px;
  padding: 12px 16px 16px;
}

.door-type-fieldset legend {
  font-weight: 600;
  padding: 0 6px;
}

.door-type-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.door-type-option {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.door-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.door-type-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 120px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-weight: 600;
  color: #1f2937;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.door-type-option input:checked + span {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(0, 82, 204, 0.25);
}

.door-type-option input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.door-type-option--inline span {
  border-radius: 10px;
}

.door-type-options--update {
  grid-column: span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.door-type-options--update > span {
  font-weight: 600;
  margin-right: 8px;
}

.door-step--intro {
  display: none;
}

.door-stepper--active .door-step--intro {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.component-info-trigger {
  display: none;
  margin-left: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 82, 204, 0.12);
  color: var(--brand);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.component-info-trigger svg {
  width: 18px;
  height: 18px;
  display: block;
  color: currentColor;
}

.component-info-trigger__label {
  letter-spacing: 0.01em;
}

.component-info-trigger:focus-visible,
.component-info-trigger:hover {
  background: rgba(0, 82, 204, 0.2);
}

.door-stepper--active .component-info-trigger {
  display: inline-flex;
}

.door-stepper__progress-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.door-stepper__jump-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 82, 204, 0.14);
  background: rgba(248, 251, 255, 0.96);
  color: #20457d;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

.door-stepper__jump-trigger:focus-visible,
.door-stepper__jump-trigger:hover {
  background: rgba(0, 82, 204, 0.08);
}

.door-stepper__jump-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.door-stepper__jump-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(0, 82, 204, 0.1);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), #fff);
  text-align: left;
  color: var(--text, #0f172a);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.door-stepper__jump-item.is-current {
  border-color: rgba(0, 82, 204, 0.28);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

.door-stepper__jump-item-step {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b679f;
}

.door-stepper__jump-item-label {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
}

.door-stepper__collapse {
  font-size: 0.85rem;
  color: var(--brand);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.door-stepper__resume {
  display: none;
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed rgba(0, 82, 204, 0.35);
  border-radius: 12px;
  background: rgba(0, 82, 204, 0.06);
}

.door-stepper--collapsed .door-stepper__resume {
  display: block;
}

.add-door-app {
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 60%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  border: none;
  overflow: hidden;
}

.add-door-app--fullscreen {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}

/* Add-door app: tighten the layout when the stepper overlay is open. */
body.stepper-overlay-open .add-door-app {
  margin-top: 0 !important;
}

.add-door-app__hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 82, 204, 0.12);
  margin-bottom: 24px;
}

.add-door-app__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}

.add-door-app__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 82, 204, 0.14);
  color: var(--brand);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.app-chip--quiet {
  background: rgba(15, 23, 42, 0.06);
  color: #4c5b7a;
}

.add-door-app__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-field-grid {
  gap: 16px;
}

.app-field-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(0, 82, 204, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), #fff);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.app-field-card--stacked textarea {
  min-height: 90px;
}

.app-field-card input[type="text"],
.app-field-card input[type="file"],
.app-field-card textarea,
.app-field-card select {
  margin-top: 6px;
}

.door-card__section--app {
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(0, 82, 204, 0.05), rgba(255, 255, 255, 0.95));
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.component-grid--cards {
  gap: 18px;
}

.component-row--app {
  border: none;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.component-row__label--app {
  display: flex;
  align-items: center;
  gap: 12px;
}

.component-row__helper {
  display: block;
  color: #6c7ba5;
  font-size: 0.8rem;
  margin-top: 2px;
}

.component-row__fields--app {
  margin-top: 12px;
}

.component-row__fields--app label {
  background: #f7f9ff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: #1f2a44;
}

.component-row__fields--app label select,
.component-row__fields--app label input[type="text"],
.component-row__fields--app label input[type="file"] {
  margin-top: 6px;
  font-weight: 500;
}

.component-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(0, 82, 204, 0.12);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.component-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  color: inherit;
}

.component-icon--door {
  background: rgba(0, 82, 204, 0.15);
  color: #0052cc;
}

.component-icon--frame {
  background: rgba(13, 101, 214, 0.12);
  color: #0d65d6;
}

.component-icon--hinge {
  background: rgba(10, 135, 84, 0.15);
  color: #0a8754;
}

.component-icon--closer {
  background: rgba(241, 153, 36, 0.15);
  color: #d97706;
}

.component-icon--lock {
  background: rgba(126, 87, 194, 0.15);
  color: #6d28d9;
}

.component-icon--vision {
  background: rgba(56, 189, 248, 0.18);
  color: #0284c7;
}

.component-icon--seal {
  background: rgba(45, 212, 191, 0.18);
  color: #0f766e;
}

.component-icon--threshold {
  background: rgba(248, 250, 252, 1);
  color: #6366f1;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.component-icon--gap {
  background: rgba(59, 130, 246, 0.18);
  color: #2563eb;
}

.component-icon--signage {
  background: rgba(248, 113, 113, 0.15);
  color: #dc2626;
}

.component-icon--hardware {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.component-icon--hold {
  background: rgba(249, 115, 22, 0.2);
  color: #c2410c;
}

.component-icon--label {
  background: rgba(244, 114, 182, 0.2);
  color: #be185d;
}

.component-icon--general {
  background: rgba(203, 213, 225, 0.35);
  color: #475569;
}

.component-issue-hints--app {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(0, 82, 204, 0.25);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.85);
}

.component-issue-hints--app summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
}

.component-guide-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
}

.component-guide-modal[hidden] {
  display: none;
}

.component-guide-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.component-guide-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: min(520px, 100%);
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 1;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.38);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.component-guide-modal__header {
  position: relative;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.98);
}

.component-guide-modal__body {
  padding: 18px 24px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-block-size: 0;
}

.component-guide-modal:not([hidden]) .component-guide-modal__overlay {
  opacity: 1;
}

.component-guide-modal:not([hidden]) .component-guide-modal__dialog {
  opacity: 1;
  transform: translateY(0);
}

.component-guide-modal__close {
  position: absolute;
  top: 10px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: #475569;
  cursor: pointer;
}

.component-guide-modal__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}

.component-guide-modal__dialog h4 {
  margin-top: 0;
  margin-bottom: 12px;
}

.component-guide-modal__content {
  color: #0f172a;
  line-height: 1.55;
}

.component-guide-modal__content :where(p) {
  margin: 0 0 12px;
  color: #334155;
}

.component-guide-modal__content :where(p strong) {
  color: #0f172a;
}

.component-guide-modal__content :where(h5) {
  margin: 16px 0 10px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.component-guide-modal__content :where(h5)::before {
  content: "";
  inline-size: 18px;
  block-size: 18px;
  border-radius: 6px;
  background: rgba(0, 82, 204, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 82, 204, 0.18);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  flex: 0 0 auto;
}

/* Section icons (ordered as rendered in the component guide). */
.component-guide-modal__content :where(h5):nth-of-type(1)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%230052cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M2.5 12s3.8-7 9.5-7 9.5 7 9.5 7-3.8 7-9.5 7-9.5-7-9.5-7z'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%230052cc' stroke-width='1.8'/%3E%3C/svg%3E");
}

.component-guide-modal__content :where(h5):nth-of-type(2)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%230052cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M7 11V7a2 2 0 0 1 4 0v4m0 0V6a2 2 0 0 1 4 0v5m0 0V8a2 2 0 0 1 4 0v7a4 4 0 0 1-4 4H11a5 5 0 0 1-5-5v-3a2 2 0 0 1 4 0v2'/%3E%3C/svg%3E");
}

.component-guide-modal__content :where(h5):nth-of-type(3)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%230052cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M12 9v4'/%3E%3Cpath fill='none' stroke='%230052cc' stroke-width='1.8' stroke-linecap='round' d='M12 17h.01'/%3E%3Cpath fill='none' stroke='%230052cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M10.3 4.4 2.7 18a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3L13.7 4.4a2 2 0 0 0-3.4 0z'/%3E%3C/svg%3E");
}

.component-guide-modal__content :where(h5):nth-of-type(4)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%230052cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M9 7h6l1 2h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3l1-2z'/%3E%3Ccircle cx='12' cy='14' r='3' fill='none' stroke='%230052cc' stroke-width='1.8'/%3E%3C/svg%3E");
}

.component-guide-modal__content :where(h5):nth-of-type(5)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%230052cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M8 6h13M8 12h13M8 18h13'/%3E%3Ccircle cx='4' cy='6' r='1.4' fill='none' stroke='%230052cc' stroke-width='1.8'/%3E%3Ccircle cx='4' cy='12' r='1.4' fill='none' stroke='%230052cc' stroke-width='1.8'/%3E%3Ccircle cx='4' cy='18' r='1.4' fill='none' stroke='%230052cc' stroke-width='1.8'/%3E%3C/svg%3E");
}

.component-guide-modal__content :where(ol) {
  padding-left: 1.4rem;
  margin: 0 0 12px;
}

.component-guide-modal__content :where(ol li) {
  margin: 0 0 10px;
  color: #0f172a;
}

.component-guide-modal__content :where(ul) {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.component-guide-modal__content :where(ul li) {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.9);
  color: #0f172a;
}

.component-guide-modal__content :where(ul li)::before {
  content: "•";
  color: var(--brand);
  font-weight: 900;
  margin-right: 10px;
  flex: 0 0 auto;
}

.component-guide-modal__content :where(ul li) {
  display: flex;
  align-items: flex-start;
}

.component-guide-issue {
  gap: 12px;
}

.component-guide-issue__text {
  flex: 1 1 auto;
  min-width: 0;
}

.component-guide-issue__severity {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.component-guide-issue__severity--low {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}

.component-guide-issue__severity--medium {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.28);
}

.component-guide-issue__severity--high {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
}

/* Generic modal & drawer surfaces */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 2125;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2130;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.modal[hidden] {
  display: none;
}

.modal :where([hidden]),
:where([hidden]) {
  display: none !important;
}

.modal__dialog {
  width: min(560px, 100%);
  max-height: 85vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.38);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.modal__dialog--narrow {
  width: min(520px, 100%);
}

.modal-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.95);
  margin-bottom: 14px;
}

.modal-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.modal-tab[aria-selected="true"] {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.modal-tab:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.modal__header,
.modal__footer {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal__header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.modal__footer {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  justify-content: flex-end;
}

.modal__title {
  margin: 0;
  font-size: 1.05rem;
}

.modal__body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal__dialog--confirm,
.invoice-modal__dialog {
  width: min(980px, 100%);
  max-height: 90vh;
}

/* ==========================================================================
   Canonical mobile modal behaviour (≤900px): FULL-SCREEN
   --------------------------------------------------------------------------
   Every modal with `.modal--sheet` on its root takes over the full viewport
   on mobile. No rounded corners, no shadow, no slide-up, no gap.

   Page CSS MUST NOT override .modal--sheet dialog dimensions, align-items,
   border-radius, or transform inside @media (max-width: 900px). Those are
   owned here. Page CSS may still tune body padding, header layout, footer
   button grids, form grids, etc. — anything that sizes the dialog's children
   within the full-screen frame.

   See docs/component_canonical_map.md "Mobile Modal Pattern" for full spec.
   ========================================================================== */
@media (max-width: 900px) {
  .modal.modal--sheet {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .modal.modal--sheet .modal__overlay {
    background: rgba(26, 24, 21, 0.42);
  }

  /* Chrome properties use !important to guarantee full-screen on mobile
     regardless of page CSS specificity. Page CSS MUST NOT override these
     at mobile (see .claude/rules/css-standards.md). */
  .modal.modal--sheet .modal__dialog {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1;
    transition: opacity 0.18s ease;
  }

  /* Form wrapping body+footer must flex so body overflow works. */
  .modal.modal--sheet form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    width: 100%;
  }

  .modal.modal--sheet .modal__header {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    flex-shrink: 0;
  }

  .modal.modal--sheet .modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Extra scroll-past room so last element isn't flush with the footer on
       mobile. !important because every modal family sets its own body padding
       at equal-or-higher specificity; this guarantees the room is there. */
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Canonical mobile modal footer padding — unified across every family.
     !important so per-family padding rules don't create inconsistency
     between invoices/rams/quotes/billing/jobs/team/clients/etc. footers. */
  .modal.modal--sheet .modal__footer {
    padding-top: 12px !important;
    padding-right: 12px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 12px !important;
    flex-shrink: 0;
  }

  /* Canonical mobile input spec — matches Create Inspection wizard exactly.
     !important because every modal family declares its own input rules at
     equal-or-higher specificity; this unifies them on mobile. */
  .modal.modal--sheet input[type="text"],
  .modal.modal--sheet input[type="email"],
  .modal.modal--sheet input[type="password"],
  .modal.modal--sheet input[type="number"],
  .modal.modal--sheet input[type="tel"],
  .modal.modal--sheet input[type="url"],
  .modal.modal--sheet input[type="search"],
  .modal.modal--sheet input[type="date"],
  .modal.modal--sheet input[type="datetime-local"],
  .modal.modal--sheet input[type="time"],
  .modal.modal--sheet select,
  .modal.modal--sheet textarea {
    width: 100% !important;
    min-height: 0 !important;
    padding: 9px 12px !important;
    background: var(--ipi-bg-card, #ffffff) !important;
    border: 1px solid var(--ipi-rule-h, rgba(0, 0, 0, 0.11)) !important;
    border-radius: 8px !important;
    color: var(--ipi-ink, #1a1815) !important;
    font-family: var(--font-sans) !important;
    font-size: 13.5px !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .modal.modal--sheet textarea {
    min-height: 92px !important;
    resize: vertical !important;
  }

  .modal.modal--sheet input:focus,
  .modal.modal--sheet select:focus,
  .modal.modal--sheet textarea:focus {
    border-color: var(--ipi-accent-border, rgba(196, 149, 16, 0.34)) !important;
    box-shadow: 0 0 0 3px var(--ipi-accent-bg, rgba(196, 149, 16, 0.08)) !important;
  }
}

/* ==========================================================================
   Gold-Standard Mobile Modal Spec (≤900px) — every tenant modal, every variant
   --------------------------------------------------------------------------
   Single source of truth for per-modal CHROME at mobile across all 76 tenant
   modals regardless of which class naming system they use. The canonical
   full-screen rule above (4833–4935) owns dialog dimensions.

   Selector lists are EXHAUSTIVE and scoped inside `.modal.modal--sheet`.
   !important forces gold values to win regardless of per-family desktop
   cascade — scoped to mobile-only via @media, so desktop is untouched.

   Variants covered by the selector lists:
     Eyebrow: .eyebrow, [class*="__eyebrow"], .qbm-eyebrow, .ivm-eyebrow,
              .insp-wizard-step-label
     Title:   .modal__title, h3, h2, .theme-picker-modal__title,
              .insp-wizard-title, .schedule-sync-modal__title,
              .prebooking-capture-modal__title, .schedule-status-modal__heading
     Subtitle: .text-muted, .small-text, [class*="__lede"],
               [class*="__subcopy"], [class*="__subtitle"], .ivm-subcopy,
               direct-child <p> in header
     Close:    .modal__close, [class*="__close"] inside .modal__header

   Footer button layout:
     - Per-family `__footer-actions` grids (grid-2 + full-width-odd) stay as
       set in each feature CSS file.
     - Additional `:has(> .btn)` rule catches raw-button footers with no
       wrapper (team invite, team bulk, property create/edit, etc.)
   ========================================================================== */
@media (max-width: 900px) {
  /* -- Header: padding + safe-area-top -- */
  .modal.modal--sheet .modal__header {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px !important;
    gap: 8px !important;
    align-items: flex-start !important;
  }

  /* -- Eyebrow — every class variant in use -- */
  .modal.modal--sheet .modal__header .eyebrow,
  .modal.modal--sheet .modal__header [class*="__eyebrow"],
  .modal.modal--sheet .modal__header .qbm-eyebrow,
  .modal.modal--sheet .modal__header .ivm-eyebrow,
  .modal.modal--sheet .modal__header .insp-wizard-step-label {
    margin: 0 0 4px !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    line-height: 1.1 !important;
    color: var(--accent, #c49510) !important;
  }

  /* -- Title — every class variant, including custom headings (h2 for int) -- */
  .modal.modal--sheet .modal__header .modal__title,
  .modal.modal--sheet .modal__header h3,
  .modal.modal--sheet .modal__header h2,
  .modal.modal--sheet .modal__header .theme-picker-modal__title,
  .modal.modal--sheet .modal__header .insp-wizard-title,
  .modal.modal--sheet .modal__header .prebooking-capture-modal__title,
  .modal.modal--sheet .modal__header .schedule-status-modal__heading {
    margin: 0 0 4px !important;
    font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    color: var(--ink, #1a1815) !important;
  }

  /* -- Subtitle / lede — every class variant -- */
  .modal.modal--sheet .modal__header .text-muted,
  .modal.modal--sheet .modal__header .small-text,
  .modal.modal--sheet .modal__header [class*="__lede"],
  .modal.modal--sheet .modal__header [class*="__subcopy"],
  .modal.modal--sheet .modal__header [class*="__subtitle"],
  .modal.modal--sheet .modal__header .ivm-subcopy,
  .modal.modal--sheet .modal__header > div > p:not(.eyebrow):not([class*="__eyebrow"]):not(.qbm-eyebrow):not(.ivm-eyebrow) {
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
    color: var(--ink-3, #6b6458) !important;
    max-width: none !important;
  }

  /* -- Close button — 44×44 touch target on every variant -- */
  .modal.modal--sheet .modal__header .modal__close,
  .modal.modal--sheet .modal__header [class*="modal__close"],
  .modal.modal--sheet .modal__header button[class*="__close"] {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    line-height: 1 !important;
    border-radius: 10px !important;
    color: var(--ink-3, #6b6458) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
  }

  /* -- Body: top/side padding (padding-bottom owned by canonical :4888) -- */
  .modal.modal--sheet .modal__body {
    padding-top: 14px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* -- Footer: top/side padding + column layout
        (padding-bottom owned by canonical :4892) -- */
  .modal.modal--sheet .modal__footer {
    padding-top: 12px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* -- Footer-copy hidden on mobile -- */
  .modal.modal--sheet [class*="__footer-copy"] {
    display: none !important;
  }

  /* -- Universal button-row grid for RAW-button footers (no wrapper).
        Catches team invite, team bulk, team warning, team member,
        property create/edit, jobs fd-job, jobs client switcher, sched,
        and any modal whose buttons sit directly inside .modal__footer. -- */
  .modal.modal--sheet .modal__footer:has(> .btn) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    row-gap: 8px !important;
    column-gap: 8px !important;
  }

  .modal.modal--sheet .modal__footer:has(> .btn) > .btn:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  .modal.modal--sheet .modal__footer:has(> .btn) > .btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  /* -- Form grids inside modals collapse to a single column -- */
  .modal.modal--sheet .form-grid,
  .modal.modal--sheet .form-grid.two-col,
  .modal.modal--sheet .form-grid.three-col,
  .modal.modal--sheet .set-form-grid,
  .modal.modal--sheet .set-form-grid--three,
  .modal.modal--sheet .qbm-form-grid,
  .modal.modal--sheet .ivm-form-grid,
  .modal.modal--sheet .props-form-grid,
  .modal.modal--sheet .clients-form-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Dark-mode parity for gold-spec */
@media (max-width: 900px) {
  html[data-theme="dark"] .modal.modal--sheet .modal__header .eyebrow,
  html[data-theme="dark"] .modal.modal--sheet .modal__header [class*="__eyebrow"],
  html[data-theme="dark"] .modal.modal--sheet .modal__header .qbm-eyebrow,
  html[data-theme="dark"] .modal.modal--sheet .modal__header .ivm-eyebrow,
  html[data-theme="dark"] .modal.modal--sheet .modal__header .insp-wizard-step-label {
    color: var(--accent-dark, #e3b008) !important;
  }

  html[data-theme="dark"] .modal.modal--sheet .modal__header .modal__title,
  html[data-theme="dark"] .modal.modal--sheet .modal__header h3,
  html[data-theme="dark"] .modal.modal--sheet .modal__header h2,
  html[data-theme="dark"] .modal.modal--sheet .modal__header .theme-picker-modal__title,
  html[data-theme="dark"] .modal.modal--sheet .modal__header .insp-wizard-title,
  html[data-theme="dark"] .modal.modal--sheet .modal__header .prebooking-capture-modal__title,
  html[data-theme="dark"] .modal.modal--sheet .modal__header .schedule-status-modal__heading {
    color: var(--text, #f4e9d5) !important;
  }

  html[data-theme="dark"] .modal.modal--sheet .modal__header .text-muted,
  html[data-theme="dark"] .modal.modal--sheet .modal__header .small-text,
  html[data-theme="dark"] .modal.modal--sheet .modal__header [class*="__lede"],
  html[data-theme="dark"] .modal.modal--sheet .modal__header [class*="__subcopy"],
  html[data-theme="dark"] .modal.modal--sheet .modal__header [class*="__subtitle"],
  html[data-theme="dark"] .modal.modal--sheet .modal__header .ivm-subcopy,
  html[data-theme="dark"] .modal.modal--sheet .modal__header > div > p {
    color: var(--text-muted, #c9bda7) !important;
  }

  html[data-theme="dark"] .modal.modal--sheet .modal__header .modal__close,
  html[data-theme="dark"] .modal.modal--sheet .modal__header [class*="modal__close"],
  html[data-theme="dark"] .modal.modal--sheet .modal__header button[class*="__close"] {
    color: var(--text-muted, #c9bda7) !important;
  }
}

.modal-form-grid,
.invoice-modal-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.modal-form-panel,
.invoice-modal__primary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.modal-form-panel > .modal-form-card,
.invoice-modal__primary > .invoice-card {
  max-width: 520px;
  width: 100%;
}

.modal-form-card,
.invoice-card {
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 18px 18px 16px;
  background: #f8fafc;
  /* `<fieldset>` gets a browser default `margin-inline: 2px`. Without this
     reset the card renders 4px narrower than its body's content box, so on
     a 375px viewport it sits at 339px instead of the expected 343px. */
  margin: 0;
}

.modal-form-card legend,
.invoice-card legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-form-actions,
.invoice-modal__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

html[data-theme="dark"] .modal-form-card,
html[data-theme="dark"] .invoice-card {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .modal-form-card legend,
html[data-theme="dark"] .invoice-card legend {
  color: rgba(226, 232, 240, 0.92);
}

.modal__close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: #6b7280;
}

body.modal-open .modal__dialog,
.modal:not([hidden]) .modal__dialog {
  opacity: 1;
  transform: translateY(0);
}

body.modal-open {
  overflow: hidden;
}

.modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.modal__actions--split {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
}

.modal__actions-left,
.modal__actions-right {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-action-hint {
  min-height: 1em;
}

/* ===================================================================
   EMAIL PREVIEW MODAL — shared across analytics + jobs pages
   CSS lives here (not analytics.css) because the modal container is
   global (app.php) and is triggered from multiple pages.
   =================================================================== */

/*
 * The .ipi-tabs / .ipi-tab primitives consume --ipi-* variables that are
 * normally only defined inside .inspections-page. The modal lives outside
 * that ancestor, so we re-declare the needed tokens here so tabs render.
 */
[data-analytics-email-modal] {
  --ipi-bg-inset: #edeae3;
  --ipi-rule-h: rgba(0, 0, 0, 0.11);
  --ipi-bg-card: #ffffff;
  --ipi-ink: #1a1815;
  --ipi-ink-4: #9a9188;
  --ipi-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-analytics-email-modal] .modal__dialog {
  width: min(820px, calc(100vw - 48px));
  max-height: min(90vh, 960px);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3), 0 4px 16px rgba(15, 23, 42, 0.1);
}

/* --- Header --- */
[data-analytics-email-modal] .modal__header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(26, 24, 21, 0.07);
  position: relative;
  flex-shrink: 0;
}

[data-analytics-email-modal] .modal__header .quote-eyebrow {
  color: var(--accent, #c49510);
  margin: 0 0 6px;
}

[data-analytics-email-modal] .modal__header .modal__title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink, #1a1815);
  margin: 0;
}

[data-analytics-email-modal] .modal__header .text-muted {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-3, #6b6458);
}

[data-analytics-email-modal] .modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-inset, #edeae3);
  color: var(--ink-4, #9a9188);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

[data-analytics-email-modal] .modal__close:hover {
  background: var(--surface-subtle, #f2efe9);
  color: var(--ink, #1a1815);
}

/* --- Body --- */
[data-analytics-email-modal] .modal__body {
  padding: 20px 22px 22px;
  background: var(--canvas, #f7f5f0);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* --- Meta card (To / Template / Sent by) --- */
.aem-meta-card {
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.aem-meta-card__cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.aem-meta-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3, #6b6458);
}

.aem-meta-card__value {
  font-size: 0.9rem;
  color: var(--ink, #1a1815);
  overflow-wrap: anywhere;
}

/* --- Preview panels --- */
.aem-preview-panel {
  display: none;
}

.aem-preview-panel.is-active {
  display: block;
}

/* --- Iframe preview --- */
.aem-preview-iframe {
  width: 100%;
  height: min(55vh, 560px);
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
}

/* --- Text preview --- */
.aem-preview-text {
  width: 100%;
  max-height: min(55vh, 560px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  border-radius: var(--radius-md, 12px);
  background: var(--surface-subtle, #f2efe9);
  color: var(--ink, #1a1815);
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* --- Context collapsible --- */
.aem-collapse {
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  border-radius: var(--radius-md, 12px);
  background: var(--surface-subtle, #f2efe9);
  margin-top: 14px;
}

.aem-collapse > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink, #1a1815);
  user-select: none;
}

.aem-collapse pre {
  margin: 0;
  padding: 0 14px 12px;
}

/* Strip border/radius when aem-preview-text is nested inside the collapse */
.aem-collapse .aem-preview-text {
  border: none;
  border-radius: 0;
  background: transparent;
  max-height: min(40vh, 360px);
  padding: 0 14px 12px;
}

/* ===================================================================
   EMAIL PREVIEW MODAL — dark mode
   =================================================================== */
html[data-theme="dark"] [data-analytics-email-modal] {
  --ipi-bg-inset: rgba(15, 23, 42, 0.55);
  --ipi-rule-h: rgba(148, 163, 184, 0.22);
  --ipi-bg-card: rgba(30, 41, 59, 0.8);
  --ipi-ink: rgba(226, 232, 240, 0.92);
  --ipi-ink-4: rgba(148, 163, 184, 0.7);
  --ipi-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] [data-analytics-email-modal] .modal__dialog {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] [data-analytics-email-modal] .modal__header {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] [data-analytics-email-modal] .modal__body {
  background: rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] [data-analytics-email-modal] .modal__close {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(248, 250, 252, 0.7);
}

html[data-theme="dark"] [data-analytics-email-modal] .modal__close:hover {
  background: rgba(15, 23, 42, 0.8);
  color: rgba(248, 250, 252, 0.95);
}

html[data-theme="dark"] .aem-meta-card {
  background: var(--card, rgba(15, 23, 42, 0.55));
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .aem-meta-card__label {
  color: rgba(148, 163, 184, 0.7);
}

html[data-theme="dark"] .aem-meta-card__value {
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .aem-preview-iframe {
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .aem-preview-text {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.16);
  color: rgba(226, 232, 240, 0.9);
}

html[data-theme="dark"] .aem-collapse {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .aem-collapse > summary {
  color: rgba(226, 232, 240, 0.92);
}

/* ===================================================================
   EMAIL PREVIEW MODAL — mobile content tweaks at 900px.
   Full-screen modal sizing is handled globally by the canonical
   .modal.modal--sheet rule in style.css.
   =================================================================== */
@media (max-width: 900px) {
  [data-analytics-email-modal] .modal__header {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px;
    flex-shrink: 0;
  }

  [data-analytics-email-modal] .modal__header .modal__title {
    font-size: 1.1rem;
  }

  [data-analytics-email-modal] .modal__close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    width: 44px;
    height: 44px;
  }

  [data-analytics-email-modal] .modal__body {
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .aem-meta-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .aem-preview-iframe {
    height: min(45vh, 400px);
  }

  .aem-preview-text {
    max-height: min(45vh, 400px);
  }
}

.import-pdf-loading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.import-pdf-loading__spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.4);
  border-top-color: var(--brand);
  animation: importPdfLoadingSpin 0.9s linear infinite;
}

.import-pdf-loading__copy {
  margin: 0;
}

.import-pdf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 12px;
}

@media (min-width: 980px) {
  .import-pdf-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
  }
}

.import-pdf-grid__main {
  min-width: 0;
}

.import-pdf-grid__aside {
  border-radius: 20px;
  padding: 18px;
}

.import-pdf-grid__aside h4 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.import-pdf-checklist {
  margin: 10px 0 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.import-pdf-text-preview {
  max-height: 320px;
  overflow: auto;
  background: #0b1220;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 10px;
  white-space: pre-wrap;
}

.import-pdf-field {
  position: relative;
}

.import-pdf-field__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.import-pdf-field--needs-review {
  border-radius: 12px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.import-pdf-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #0f172a;
  margin-left: 10px;
}

.import-pdf-flag--low {
  background: rgba(148, 163, 184, 0.18);
}

.import-pdf-flag--medium {
  background: rgba(59, 130, 246, 0.14);
}

.import-pdf-flag--high {
  background: rgba(239, 68, 68, 0.14);
}

.import-pdf-preview-frame {
  width: 100%;
  height: 440px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: #ffffff;
}

.u-opacity-70 {
  opacity: 0.7;
}

@keyframes importPdfLoadingSpin {
  to {
    transform: rotate(360deg);
  }
}

.drawer:not([hidden]) .drawer__panel {
  transform: translateX(0);
  opacity: 1;
}

.drawer {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  z-index: 2120;
}

.drawer[hidden] {
  display: none;
}

.drawer__panel {
  width: min(420px, 100%);
  max-width: 100%;
  height: 100%;
  background: #ffffff;
  box-shadow: -18px 0 40px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  transform: translateX(12px);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.drawer__header,
.drawer__footer {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer__header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.drawer__footer {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  justify-content: flex-end;
}

.drawer__body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* Global search drawer is mobile-only (mobile.css controls display). */
.global-search-drawer {
  position: static;
  inset: auto;
  display: none;
  z-index: auto;
}

.global-search-drawer .modal__overlay {
  display: none;
}

.global-search-drawer .drawer__panel {
  width: 100%;
  max-width: none;
  height: auto;
  box-shadow: none;
  transform: none;
  opacity: 1;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
}

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
}

.flash-success {
  background: rgba(10, 135, 84, 0.15);
  color: var(--success);
}

.flash-error {
  background: rgba(192, 57, 43, 0.15);
  color: var(--danger);
}

.flash-info {
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.quote-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 6px 0;
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(420px, calc(100vw - 44px));
}

.toast-stack[hidden] {
  display: none !important;
}

.toast-stack .flash {
  margin: 0;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
  transition: opacity 240ms ease, transform 240ms ease;
  font-weight: 500;
  line-height: 1.4;
}

.toast-stack .flash-info {
  background: #e0efff;
  color: #0f172a;
  border: 1px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.toast-stack .flash-success {
  background: #dcfce7;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.toast-stack .flash-error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.toast-stack__item--fade {
  opacity: 0;
  transform: translateY(6px);
}

.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(2.5px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  z-index: 2500;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
  background: transparent;
}

.nav-progress.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.nav-progress::after {
  content: "";
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 2.5px;
  background: transparent;
}

.nav-progress.is-visible::after {
  backdrop-filter: none;
}

.nav-progress::before {
  content: "";
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  height: 2.5px;
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(196, 149, 16, 0) 0%,
    rgba(196, 149, 16, 1) 20%,
    rgba(196, 149, 16, 0.92) 50%,
    rgba(196, 149, 16, 1) 80%,
    rgba(196, 149, 16, 0) 100%
  );
  opacity: 0;
  animation: navProgressIndeterminate 1.1s cubic-bezier(.4, 0, .2, 1) infinite;
}

@keyframes navProgressIndeterminate {
  0% {
    transform: translateX(-100%);
    opacity: 1;
  }
  70% {
    transform: translateX(0%);
    opacity: 1;
  }
  85% {
    transform: translateX(0%);
    opacity: 1;
  }
  100% {
    transform: translateX(0%);
    opacity: 0;
  }
}

.nav-pending {
  opacity: 0.8;
}

/* Sidebar nav item: show a small spinner on the right when navigation is pending. */
.sb-item.nav-pending {
  opacity: 1;
  pointer-events: none;
}

.sb-item.nav-pending .sb-badge {
  display: none;
}

.sb-item.nav-pending::after {
  content: '';
  margin-left: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: fdBtnSpin 0.8s linear infinite;
  opacity: 0.6;
  flex-shrink: 0;
}

/* Clickable table rows: dim + trailing spinner during navigation. */
tr.nav-pending {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

tr.nav-pending::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: fdBtnSpin 0.8s linear infinite;
  opacity: 0.5;
}

/* Touch tap feedback for interactive elements. */
.btn:active:not(:disabled),
.ipi-ph-btn:active:not(:disabled),
.ipi-action-btn:active:not(:disabled),
.ipi-row-action-btn:active:not(:disabled),
.ipi-filter-railbtn:active:not(:disabled) {
  transform: scale(0.97);
  opacity: 0.85;
}

/* Clickable table row tap highlight. */
tr[data-properties-row]:active,
tr[data-jobs-client-link]:active,
tr[data-insp-link]:active {
  background: rgba(26, 24, 21, 0.04);
}

html[data-theme="dark"] tr[data-properties-row]:active,
html[data-theme="dark"] tr[data-jobs-client-link]:active,
html[data-theme="dark"] tr[data-insp-link]:active {
  background: rgba(148, 163, 184, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .nav-progress::before {
    animation: none;
    width: 100%;
    transform: none;
    background: var(--accent, #c49510);
    opacity: 0.85;
  }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand, #0052cc);
  margin: 0 0 0.35rem 0;
}

.eyebrow--danger {
  color: var(--danger, #b03030);
}

.broadcast-banner-stack {
  margin: 16px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.broadcast-banner {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.broadcast-banner__content {
  min-width: 240px;
}

.broadcast-banner__actions {
  display: flex;
  align-items: center;
}

.broadcast-banner--info {
  background: rgba(14, 116, 144, 0.08);
  border-color: rgba(14, 116, 144, 0.3);
}

.broadcast-banner--warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.broadcast-banner--error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
}

.setup-resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  margin: 16px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--accent-soft, rgba(196, 149, 16, 0.18));
  background: linear-gradient(135deg, rgba(196, 149, 16, 0.06), rgba(196, 149, 16, 0.02));
  box-shadow: var(--shadow-sm);
}

.setup-resume-banner__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setup-resume-banner__content strong {
  font-size: 13.5px;
  color: var(--ink, #1a1815);
}

.setup-resume-banner__content .text-muted {
  font-size: 12px;
}

@media (max-width: 900px) {
  .setup-resume-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
  }

  .setup-resume-banner__actions .btn {
    width: 100%;
    min-height: 40px;
  }
}

html[data-theme="dark"] .setup-resume-banner {
  border-color: rgba(227, 176, 8, 0.15);
  background: linear-gradient(135deg, rgba(227, 176, 8, 0.06), rgba(227, 176, 8, 0.02));
}

.guided-tour {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--guided-tour-offset-bottom, 0px));
  width: min(440px, calc(100vw - 36px));
  background: #ffffff;
  border: 1px solid rgba(26, 24, 21, 0.1);
  border-radius: 14px;
  box-shadow:
    0 4px 28px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Above fixed top-bar (1600) but below modals/drawers (2100+) */
  z-index: 1650;
}

.guided-tour__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid rgba(26, 24, 21, 0.07);
  background: #ffffff;
  flex-shrink: 0;
}

.guided-tour__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.guided-tour__close-btn {
  display: inline-flex;
}

.guided-tour__icon-btn {
  border: 1px solid rgba(26, 24, 21, 0.12);
  background: var(--canvas, #f7f5f0);
  color: #3d3a34;
  border-radius: 9px;
  width: 34px;
  height: 34px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
}

.guided-tour__icon-svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.guided-tour__icon-btn:hover {
  background: #edeae3;
  border-color: rgba(26, 24, 21, 0.16);
  color: #1a1815;
}

.guided-tour__icon-btn:focus-visible {
  outline: 2px solid rgba(196, 149, 16, 0.45);
  outline-offset: 2px;
}

.guided-tour[data-guided-tour-draggable="1"] .guided-tour__header {
  cursor: grab;
}

.guided-tour.guided-tour--dragging .guided-tour__header {
  cursor: grabbing;
}

.guided-tour.guided-tour--dragging {
  user-select: none;
}

.guided-tour.guided-tour--drag-armed .guided-tour__header {
  cursor: grabbing;
}

.guided-tour__drag-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.guided-tour[data-guided-tour-draggable="0"] .guided-tour__drag-icon {
  display: none;
}

.guided-tour[data-guided-tour-draggable="0"] .guided-tour__eyebrow {
  gap: 0;
}

.guided-tour__drag-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.guided-tour.guided-tour--top {
  top: calc(12px + env(safe-area-inset-top, 0px));
  bottom: auto;
}

.guided-tour.guided-tour--dragged {
  top: var(--guided-tour-top, auto);
  left: var(--guided-tour-left, auto);
  right: auto;
  bottom: auto;
}

.guided-tour__meta {
  min-width: 0;
}

.guided-tour__eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c49510;
  margin: 0 0 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.guided-tour__eyebrow-label {
  color: inherit;
}

.guided-tour__title {
  display: block;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
  color: #1a1815;
}

.guided-tour__progress {
  margin: 6px 0 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: #6b6458;
}

.guided-tour__hint {
  margin: 0;
  padding: 8px 14px 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: #9a9188;
  flex-shrink: 0;
}

.guided-tour__content {
  padding: 12px 14px 14px;
  background: var(--canvas, #f7f5f0);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guided-tour__step {
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  color: #3d3a34;
  background: #ffffff;
  border: 1px solid rgba(26, 24, 21, 0.08);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.guided-tour__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  border: 1px solid rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.07);
  color: rgba(153, 27, 27, 0.95);
}

.guided-tour__gotchas {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.guided-tour__gotchas-title {
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  color: #5f594e;
  list-style: none;
}

.guided-tour__gotchas-title::-webkit-details-marker {
  display: none;
}

.guided-tour__gotchas-list {
  margin: 8px 0 0 0;
  padding-left: 1.1rem;
  font-size: 12px;
  line-height: 1.45;
  color: #6b6458;
}

.guided-tour__footer {
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(26, 24, 21, 0.08);
  background: #ffffff;
  flex-shrink: 0;
}

.guided-tour__actions {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.guided-tour.guided-tour--busy .guided-tour__actions button[disabled],
.guided-tour.guided-tour--busy .guided-tour__actions a[aria-disabled="true"] {
  opacity: 0.65;
}

.guided-tour__actions a[aria-disabled="true"] {
  pointer-events: none;
}

.guided-tour__nav {
  display: flex;
  gap: 8px;
}

.guided-tour__pill {
  margin: 8px 14px 0;
  flex-shrink: 0;
}

.guided-tour__pill-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: color-mix(in srgb, var(--text, #0f172a) 4%, transparent);
  color: var(--text, #0f172a);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  touch-action: manipulation;
}

.guided-tour__pill-title {
  font-weight: 650;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guided-tour__pill-progress {
  font-size: 0.82rem;
  color: var(--text-muted, rgba(15, 23, 42, 0.65));
  white-space: nowrap;
}

.tenant-app-shell .support-fab {
  position: fixed;
  right: 28px;
  bottom: 26px;
  z-index: 1300;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--button-primary, #1a1815);
  color: var(--button-primary-text, #ffffff);
  /* Match primary buttons + light brand rim so it stays discoverable without breaking the system */
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 0 0 1px color-mix(in srgb, var(--brand, #e6561e) 24%, transparent);
  cursor: pointer;
  font-family: var(--font-sans, inherit);
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.tenant-app-shell .support-fab:focus-visible {
  outline: none;
  background: var(--button-primary-dark, #3d3a34);
  color: var(--button-primary-dark-text, var(--button-primary-text, #ffffff));
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 0 0 2px color-mix(in srgb, var(--brand, #e6561e) 45%, transparent);
  transform: translateY(-1px);
}

.tenant-app-shell .support-fab__icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.tenant-app-shell .support-fab__icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.tenant-app-shell .support-fab__label {
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .tenant-app-shell .support-fab:hover {
    background: var(--button-primary-dark, #3d3a34);
    color: var(--button-primary-dark-text, var(--button-primary-text, #ffffff));
    box-shadow:
      0 4px 14px color-mix(in srgb, var(--brand, #e6561e) 26%, transparent),
      0 2px 6px rgba(0, 0, 0, 0.1),
      0 0 0 1px color-mix(in srgb, var(--brand, #e6561e) 38%, transparent);
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tenant-app-shell .support-fab,
  .tenant-app-shell .support-fab:hover,
  .tenant-app-shell .support-fab:focus-visible {
    transition: none;
    transform: none;
  }
}

html[data-theme="dark"] .tenant-app-shell .support-fab {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 0 0 1px color-mix(in srgb, var(--brand, #e6561e) 42%, transparent);
}

html[data-theme="dark"] .tenant-app-shell .support-fab:focus-visible {
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.45),
    0 0 0 2px color-mix(in srgb, var(--brand, #e6561e) 55%, transparent);
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme="dark"] .tenant-app-shell .support-fab:hover {
    box-shadow:
      0 4px 18px color-mix(in srgb, var(--brand, #e6561e) 18%, transparent),
      0 2px 8px rgba(0, 0, 0, 0.35),
      0 0 0 1px color-mix(in srgb, var(--brand, #e6561e) 48%, transparent);
  }
}

body.stepper-active .support-fab,
body.stepper-overlay-open .support-fab {
  display: none !important;
}

@media (max-width: 1024px) {
  .tenant-app-shell .support-fab {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  body.modal-open .support-fab {
    pointer-events: none;
    opacity: 0;
  }
}

.guided-tour.guided-tour--min {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  width: auto;
  max-width: min(420px, calc(100vw - 36px));
  min-width: 0;
}

/* mobile.css is max-width:768px only; desktop needs the same compact chrome when minimised */
.guided-tour.guided-tour--min .guided-tour__meta {
  display: none;
}

.guided-tour.guided-tour--min .guided-tour__header-actions {
  gap: 6px;
}

.guided-tour.guided-tour--min .guided-tour__content,
.guided-tour.guided-tour--min .guided-tour__footer,
.guided-tour.guided-tour--min .guided-tour__hint {
  display: none !important;
}

.guided-tour.guided-tour--min .guided-tour__pill {
  display: block !important;
  order: -1;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
}

.guided-tour.guided-tour--min .guided-tour__pill-btn {
  min-height: 38px;
  padding: 6px 10px;
  gap: 8px;
}

.guided-tour.guided-tour--min .guided-tour__pill-title {
  flex: 1 1 auto;
  min-width: 0;
}

.guided-tour.guided-tour--min .guided-tour__pill-progress {
  flex-shrink: 0;
}

.guided-tour.guided-tour--min .guided-tour__header {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
  border-bottom: none;
  gap: 8px;
}

.guided-tour--first-win {
  width: min(460px, calc(100vw - 36px));
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  border-color: color-mix(in srgb, var(--button-primary, var(--brand, #0052cc)) 18%, var(--border, rgba(15, 23, 42, 0.12)));
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(37, 99, 235, 0.08), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--card, #ffffff) 94%, rgba(37, 99, 235, 0.04)), var(--card, #ffffff));
  box-shadow: 0 28px 54px rgba(15, 23, 42, 0.2);
}

.guided-tour--first-win .guided-tour__header {
  align-items: center;
  padding: 16px 18px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--button-primary, var(--brand, #0052cc)) 12%, var(--border, rgba(15, 23, 42, 0.1)));
}

.guided-tour--first-win .guided-tour__content {
  padding: 14px 18px 16px;
  background: transparent;
  gap: 12px;
}

.guided-tour--first-win .guided-tour__footer {
  padding: 14px 18px 16px;
  border-top-color: color-mix(in srgb, var(--button-primary, var(--brand, #0052cc)) 12%, var(--border, rgba(15, 23, 42, 0.1)));
}

.guided-tour--first-win .guided-tour__hint {
  padding-left: 18px;
  padding-right: 18px;
}

.guided-tour--first-win .guided-tour__eyebrow {
  color: color-mix(in srgb, var(--button-primary, var(--brand, #0052cc)) 72%, var(--text-muted, rgba(15, 23, 42, 0.6)));
}

.guided-tour--first-win .guided-tour__title {
  font-size: 1.08rem;
}

.guided-tour--first-win .guided-tour__progress {
  margin-top: 6px;
  font-weight: 650;
}

.guided-tour--first-win .guided-tour__step {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--button-primary, var(--brand, #0052cc)) 6%, var(--card, #ffffff));
  border: 1px solid color-mix(in srgb, var(--button-primary, var(--brand, #0052cc)) 14%, var(--border, rgba(15, 23, 42, 0.12)));
}

.guided-tour--first-win .guided-tour__gotchas {
  margin-top: 0;
}

.guided-tour--first-win .guided-tour__actions {
  margin-top: 0;
  align-items: stretch;
}

.guided-tour--first-win .guided-tour__actions > :where(.btn, .btn-secondary-outline, .btn-primary-modern),
.guided-tour--first-win .guided-tour__actions > :where(a.btn, a.btn-secondary-outline, a.btn-primary-modern),
.guided-tour--first-win .guided-tour__nav {
  width: 100%;
}

.guided-tour--first-win .guided-tour__nav {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
}

.guided-tour--first-win .guided-tour__close-btn {
  display: inline-flex;
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) {
  background: rgba(15, 23, 42, 0.97);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow:
    0 4px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(148, 163, 184, 0.06);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__header,
html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__footer {
  background: rgba(15, 23, 42, 0.97);
  border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__content {
  background: rgba(30, 41, 59, 0.35);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__title {
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__progress,
html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__hint {
  color: rgba(148, 163, 184, 0.88);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__eyebrow,
html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__eyebrow-label {
  color: #e8c04a;
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__icon-btn {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__icon-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(148, 163, 184, 0.3);
  color: #ffffff;
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__step {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.92);
  box-shadow: none;
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__gotchas {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__gotchas-title {
  color: rgba(203, 213, 225, 0.92);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__gotchas-list {
  color: rgba(148, 163, 184, 0.9);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__error {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.1);
  color: rgba(254, 202, 202, 0.96);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__pill-btn {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.94);
}

html[data-theme='dark'] .guided-tour:not(.guided-tour--first-win) .guided-tour__pill-progress {
  color: rgba(148, 163, 184, 0.85);
}

html[data-theme='dark'] .guided-tour--first-win {
  border-color: rgba(96, 165, 250, 0.28);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(37, 99, 235, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.99));
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__header {
  border-bottom-color: rgba(96, 165, 250, 0.2);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__footer {
  border-top-color: rgba(96, 165, 250, 0.2);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__eyebrow {
  color: rgba(147, 197, 253, 0.88);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__title {
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__progress {
  color: rgba(148, 163, 184, 0.88);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__step {
  background: color-mix(in srgb, var(--button-primary, #60a5fa) 12%, rgba(30, 41, 59, 0.65));
  border-color: rgba(96, 165, 250, 0.24);
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__gotchas {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(96, 165, 250, 0.18);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__gotchas-title {
  color: rgba(203, 213, 225, 0.92);
}

html[data-theme='dark'] .guided-tour--first-win .guided-tour__gotchas-list {
  color: rgba(148, 163, 184, 0.9);
}

html[data-theme='dark'] .guided-tour .guided-tour__menu-panel {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .guided-tour .guided-tour__menu-item {
  color: rgba(226, 232, 240, 0.92);
}

html[data-theme='dark'] .guided-tour .guided-tour__menu-item:hover,
html[data-theme='dark'] .guided-tour .guided-tour__menu-item:focus-visible {
  background: rgba(51, 65, 85, 0.55);
}

html[data-theme='dark'] .guided-tour .guided-tour__menu-divider {
  background: rgba(148, 163, 184, 0.16);
}

.guided-tour__menu {
  position: relative;
}

.guided-tour__menu summary {
  list-style: none;
}

.guided-tour__menu summary::-webkit-details-marker {
  display: none;
}

.guided-tour__menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--card, var(--card-bg, #ffffff));
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  border-radius: 12px;
  box-shadow: var(--panel-shadow, 0 18px 46px rgba(15, 23, 42, 0.16));
  padding: 8px;
  z-index: 2;
}

@media (max-width: 768px) {
  .guided-tour:not(.guided-tour--top) .guided-tour__menu-panel {
    top: auto;
    bottom: calc(100% + 8px);
  }

  .guided-tour.guided-tour--top .guided-tour__menu-panel {
    top: calc(100% + 8px);
    bottom: auto;
  }
}

.guided-tour__menu-item {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text, rgba(15, 23, 42, 0.9));
}

.guided-tour__menu-item:hover,
.guided-tour__menu-item:focus-visible {
  background: color-mix(in srgb, var(--text, #0f172a) 8%, transparent);
}

.guided-tour__menu-divider {
  height: 1px;
  background: var(--border, rgba(15, 23, 42, 0.1));
  margin: 8px 0;
}

.guided-tour__menu-item--danger {
  color: #b91c1c;
}

/* Guided tour picker — align with tenant inspections / warm shell */
.modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  border-radius: 14px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__header {
  align-items: flex-start;
  padding: 18px 20px 14px;
  background: #ffffff;
  border-bottom: 1px solid rgba(26, 24, 21, 0.07);
}

.modal.guided-tour-picker-modal .guided-tour-picker__header-main {
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 8px;
}

.modal.guided-tour-picker-modal .guided-tour-picker__eyebrow,
.modal.guided-tour-picker-modal .guided-tour-picker__header .eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c49510;
  margin: 0 0 6px;
}

.modal.guided-tour-picker-modal .guided-tour-picker__title,
.modal.guided-tour-picker-modal #guided-tour-title {
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: #1a1815;
}

.modal.guided-tour-picker-modal .guided-tour-picker__lede {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  max-width: 54ch;
  color: #6b6458;
}

.modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__body {
  padding: 16px 20px 18px;
  background: var(--canvas, #f7f5f0);
}

.modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__footer {
  padding: 12px 20px 16px;
  background: #ffffff;
  border-top: 1px solid rgba(26, 24, 21, 0.07);
  gap: 8px;
  flex-wrap: wrap;
}

.guided-tour-picker__grid {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .guided-tour-picker__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.guided-tour-picker__field {
  margin: 0;
  min-width: 0;
}

.guided-tour-picker__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6458;
  margin: 0 0 6px;
}

.guided-tour-picker__micro {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #9a9188;
}

.guided-tour-picker__select {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 9px 34px 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(26, 24, 21, 0.12);
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%239A9188' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px;
  font-family: var(--font-sans, inherit);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: #1a1815;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.guided-tour-picker__select:hover:not(:disabled) {
  border-color: rgba(196, 149, 16, 0.35);
}

.guided-tour-picker__select:focus-visible {
  border-color: rgba(196, 149, 16, 0.55);
  box-shadow: 0 0 0 3px rgba(196, 149, 16, 0.15);
}

.guided-tour-picker__select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #edeae3;
}

.guided-tour-picker__advanced {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.guided-tour-picker__advanced-summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #5f594e;
  list-style: none;
}

.guided-tour-picker__advanced-summary::-webkit-details-marker {
  display: none;
}

.guided-tour-picker__advanced-summary::after {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.35em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.65;
  vertical-align: middle;
}

.guided-tour-picker__advanced[open] .guided-tour-picker__advanced-summary::after {
  transform: rotate(225deg) translateY(1px);
}

.guided-tour-picker__advanced-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(26, 24, 21, 0.06);
}

.guided-tour-picker__advanced-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
}

.guided-tour-picker__messages {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guided-tour-picker__hint-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.modal.guided-tour-picker-modal .guided-tour-picker__error {
  margin: 0;
}

.modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__loading {
  margin-bottom: 14px;
  border-color: rgba(26, 24, 21, 0.1);
  background: #ffffff;
  color: #3d3a34;
}

.modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__loading-spinner {
  border-top-color: #c49510;
}

.guided-tour-picker__loading-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

html[data-theme='dark'] .modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__dialog {
  background: var(--card, #0f172a);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__header,
html[data-theme='dark'] .modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__footer {
  background: var(--card, #0f172a);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .modal.guided-tour-picker-modal .guided-tour-picker__eyebrow,
html[data-theme='dark'] .modal.guided-tour-picker-modal .guided-tour-picker__header .eyebrow {
  color: #e3b008;
}

html[data-theme='dark'] .modal.guided-tour-picker-modal .guided-tour-picker__title,
html[data-theme='dark'] .modal.guided-tour-picker-modal #guided-tour-title {
  color: var(--text, #f8fafc);
}

html[data-theme='dark'] .modal.guided-tour-picker-modal .guided-tour-picker__lede {
  color: var(--text-muted, rgba(148, 163, 184, 0.95));
}

html[data-theme='dark'] .modal.guided-tour-picker-modal:not(.guided-tour-modal--first-win) .guided-tour-picker__body {
  background: rgba(15, 23, 42, 0.65);
}

html[data-theme='dark'] .guided-tour-picker__label {
  color: rgba(226, 232, 240, 0.78);
}

html[data-theme='dark'] .guided-tour-picker__micro {
  color: rgba(148, 163, 184, 0.88);
}

html[data-theme='dark'] .guided-tour-picker__select {
  background-color: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text, #f8fafc);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}

html[data-theme='dark'] .guided-tour-picker__select:disabled {
  background-color: rgba(30, 41, 59, 0.9);
}

html[data-theme='dark'] .guided-tour-picker__advanced {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .guided-tour-picker__advanced-summary {
  color: rgba(226, 232, 240, 0.88);
}

/* Theme picker — match guided tour picker shell (compact warm tenant modal) */
.modal.theme-picker-modal .theme-picker-modal__dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  border-radius: 14px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* theme-picker-modal dialog chrome owned by canonical .modal--sheet rule in style.css:4847 */

.modal.theme-picker-modal .theme-picker-modal__header {
  align-items: flex-start;
  padding: 18px 20px 14px;
  background: #ffffff;
  border-bottom: 1px solid rgba(26, 24, 21, 0.07);
}

.modal.theme-picker-modal .theme-picker-modal__header-main {
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 8px;
}

.modal.theme-picker-modal .theme-picker-modal__eyebrow,
.modal.theme-picker-modal .theme-picker-modal__header .eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c49510;
  margin: 0 0 6px;
}

.modal.theme-picker-modal .theme-picker-modal__title,
.modal.theme-picker-modal #theme-picker-title {
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: #1a1815;
}

.modal.theme-picker-modal .theme-picker-modal__lede {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  max-width: 54ch;
  color: #6b6458;
}

.modal.theme-picker-modal .theme-picker-modal__body {
  padding: 16px 20px 18px;
  background: var(--canvas, #f7f5f0);
}

.modal.theme-picker-modal .theme-picker-modal__micro {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #9a9188;
}

.modal.theme-picker-modal .theme-picker-modal__footer {
  padding: 12px 20px 16px;
  background: #ffffff;
  border-top: 1px solid rgba(26, 24, 21, 0.07);
  gap: 8px;
  flex-wrap: wrap;
}

.modal.theme-picker-modal .theme-picker-modal__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .modal.theme-picker-modal .theme-picker-modal__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.modal.theme-picker-modal .theme-picker-modal__tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  background: rgba(255, 255, 255, 0.72);
  cursor: default;
}

.modal.theme-picker-modal .theme-picker-modal__swatch {
  display: block;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(26, 24, 21, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.modal.theme-picker-modal .theme-picker-modal__swatch--warm {
  background: linear-gradient(145deg, #fff9f0 0%, #fdeecf 42%, #f0d9a8 100%);
}

.modal.theme-picker-modal .theme-picker-modal__swatch--cool {
  background: linear-gradient(145deg, #faf8f5 0%, #ebe6de 48%, #d8d2c8 100%);
}

.modal.theme-picker-modal .theme-picker-modal__swatch--contrast {
  background: linear-gradient(145deg, #ffffff 0%, #c0c0c0 50%, #333333 100%);
}

.modal.theme-picker-modal .theme-picker-modal__swatch--ocean {
  background: linear-gradient(145deg, #f0f4f8 0%, #cbd5e1 48%, #5f6d80 100%);
}

.modal.theme-picker-modal .theme-picker-modal__swatch--sage {
  background: linear-gradient(145deg, #f1f4ef 0%, #d6ddd1 48%, #7d8a77 100%);
}

.modal.theme-picker-modal .theme-picker-modal__swatch--sandstone {
  background: linear-gradient(145deg, #f5f0eb 0%, #e0d6cb 48%, #968778 100%);
}

.modal.theme-picker-modal .theme-picker-modal__tile-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6458;
}

.modal.theme-picker-modal .theme-picker-modal__tile-hint {
  font-size: 12px;
  line-height: 1.35;
  color: #9a9188;
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__dialog {
  background: var(--card, #0f172a);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__header,
html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__footer {
  background: var(--card, #0f172a);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__eyebrow,
html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__header .eyebrow {
  color: #e3b008;
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__title,
html[data-theme='dark'] .modal.theme-picker-modal #theme-picker-title {
  color: var(--text, #f8fafc);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__lede {
  color: var(--text-muted, rgba(148, 163, 184, 0.95));
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__body {
  background: rgba(15, 23, 42, 0.65);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__micro {
  color: rgba(148, 163, 184, 0.88);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__tile {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__tile-label {
  color: rgba(226, 232, 240, 0.78);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__tile-hint {
  color: rgba(148, 163, 184, 0.88);
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__swatch {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Theme tile interactivity */
.modal.theme-picker-modal .theme-picker-modal__tile--active {
  border-color: var(--accent, #c49510);
  background: rgba(196, 149, 16, 0.06);
  box-shadow: 0 0 0 2px rgba(196, 149, 16, 0.18);
}

.modal.theme-picker-modal button.theme-picker-modal__tile {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  font: inherit;
}

.modal.theme-picker-modal button.theme-picker-modal__tile:hover:not(.theme-picker-modal__tile--disabled) {
  border-color: rgba(26, 24, 21, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.modal.theme-picker-modal button.theme-picker-modal__tile:focus-visible {
  outline: 2px solid var(--accent, #c49510);
  outline-offset: 2px;
}

.modal.theme-picker-modal .theme-picker-modal__tile--active:hover {
  border-color: var(--accent, #c49510);
  box-shadow: 0 0 0 2px rgba(196, 149, 16, 0.18);
}

.modal.theme-picker-modal .theme-picker-modal__tile--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

html[data-theme='dark'] .modal.theme-picker-modal .theme-picker-modal__tile--active {
  border-color: #e3b008;
  background: rgba(227, 176, 8, 0.08);
  box-shadow: 0 0 0 2px rgba(227, 176, 8, 0.2);
}

html[data-theme='dark'] .modal.theme-picker-modal button.theme-picker-modal__tile:hover:not(.theme-picker-modal__tile--disabled) {
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.guided-tour-picker__toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #3d3a34;
  cursor: pointer;
}

.guided-tour-picker__toggle input {
  margin-top: 3px;
  flex-shrink: 0;
}

/* Modal-only: overlay tour errors use .guided-tour__error rules near .guided-tour */
.guided-tour-picker__error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.32);
  background: rgba(220, 38, 38, 0.08);
  color: rgba(153, 27, 27, 0.95);
  font-weight: 650;
  font-size: 13px;
  line-height: 1.4;
}

html[data-theme="dark"] .guided-tour-picker__error {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.08);
  color: rgba(254, 202, 202, 0.95);
}

.guided-tour-picker__loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: rgba(248, 250, 252, 0.92);
  color: rgba(51, 65, 85, 0.92);
  font-weight: 600;
}

.guided-tour-picker__loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  border-top-color: rgba(37, 99, 235, 0.9);
  animation: fdBtnSpin 0.8s linear infinite;
  flex: 0 0 auto;
}

html[data-theme="dark"] .guided-tour-picker__loading {
  border-color: rgba(71, 85, 105, 0.88);
  background: rgba(30, 41, 59, 0.86);
  color: rgba(226, 232, 240, 0.94);
}

.guided-tour-first-win__options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.guided-tour-modal--first-win .modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guided-tour-modal--first-win .modal__footer {
  gap: 10px;
}

.guided-tour-modal--first-win .modal__dialog {
  width: min(1040px, 96%);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(1200px circle at 0% 0%, rgba(37, 99, 235, 0.12), transparent 42%),
    radial-gradient(900px circle at 100% 0%, rgba(14, 165, 233, 0.1), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--card, #ffffff) 92%, rgba(239, 246, 255, 0.8)), var(--card, #ffffff));
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.guided-tour-modal--first-win .modal__header {
  padding: 22px 24px 0;
  border-bottom: 0;
}

.guided-tour-modal--first-win .modal__header .eyebrow {
  color: color-mix(in srgb, var(--button-primary, var(--brand, #0052cc)) 70%, var(--text-muted, rgba(15, 23, 42, 0.6)));
}

.guided-tour-modal--first-win .modal__header h3 {
  font-size: 1.5rem;
}

.guided-tour-modal--first-win .modal__body {
  padding: 18px 24px 20px;
}

.guided-tour-modal--first-win .modal__footer {
  padding: 0 24px 24px;
}

.guided-tour-first-win__hero {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(248, 250, 252, 0.86));
  border: 1px solid rgba(191, 219, 254, 0.78);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.guided-tour-first-win__eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(37, 99, 235, 0.88);
}

.guided-tour-first-win__hero h4 {
  margin: 0;
  font-size: 1.2rem;
  color: rgba(15, 23, 42, 0.96);
}

.guided-tour-first-win__copy {
  margin: 8px 0 0;
  max-width: 60ch;
  color: rgba(71, 84, 103, 0.96);
}

.guided-tour-first-win__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.guided-tour-first-win__meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(191, 219, 254, 0.86);
  color: rgba(30, 41, 59, 0.92);
  font-size: 0.82rem;
  font-weight: 650;
}

@media (min-width: 860px) {
  .guided-tour-modal--first-win .modal__dialog {
    width: min(980px, 100%);
  }

  .guided-tour-first-win__options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 640px) and (max-width: 859px) {
  .guided-tour-modal--first-win .modal__dialog {
    width: min(760px, 100%);
  }

  .guided-tour-first-win__options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.guided-tour-first-win-card {
  width: 100%;
  text-align: left;
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: var(--card, var(--card-bg, #ffffff));
  padding: 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.guided-tour-first-win-card::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.72);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.96);
}

.guided-tour-first-win-card:hover {
  border-color: rgba(0, 82, 204, 0.25);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.guided-tour-first-win-card.is-selected {
  border-color: rgba(0, 82, 204, 0.6);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.98));
  box-shadow: 0 24px 48px rgba(0, 82, 204, 0.16);
}

.guided-tour-first-win-card.is-selected::after {
  border-color: rgba(37, 99, 235, 0.95);
  background: rgba(37, 99, 235, 0.95);
}

.guided-tour-first-win-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.guided-tour-first-win-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: rgba(0, 82, 204, 0.95);
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.9);
}

.guided-tour-first-win-card__icon svg {
  width: 18px;
  height: 18px;
}

.guided-tour-first-win-card__title-text {
  min-width: 0;
}

.guided-tour-first-win-card__meta {
  color: var(--text-muted, rgba(71, 84, 103, 0.95));
  margin: 0;
  font-weight: 600;
}

.guided-tour-first-win-card__steps {
  margin: 10px 0 0 0;
  padding-left: 18px;
  color: var(--text-muted, rgba(71, 84, 103, 0.95));
}

.onboarding-confirm {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(248, 250, 252, 0.9);
}

.onboarding-confirm__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.35;
  margin: 0;
}

.timeline {
  position: relative;
  padding-left: 68px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 82, 204, 0.15), rgba(0, 82, 204, 0.05));
}

.timeline-empty {
  padding: 8px 0 0 0;
}

.timeline-date {
  padding-left: 12px;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a8090;
}

.timeline-item {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), #fff);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
  padding: 18px 20px 18px 28px;
  margin-left: 0;
}

.timeline-item__icon {
  position: absolute;
  left: -11px;
  top: 18px;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(0, 82, 204, 0.15);
  color: #0052cc;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15);
}

.timeline-item__icon svg {
  width: 20px;
  height: 20px;
}

.timeline-item__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-item__time {
  font-weight: 600;
  color: #1c2434;
}

.timeline-item__pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.timeline-item__pill--start {
  background: rgba(0, 82, 204, 0.14);
  color: #0052cc;
}

.timeline-item__pill--add {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.timeline-item__pill--edit {
  background: rgba(249, 115, 22, 0.2);
  color: #c2410c;
}

.timeline-item__pill--status {
  background: rgba(147, 51, 234, 0.16);
  color: #7e22ce;
}

.timeline-item__pill--update {
  background: rgba(100, 116, 139, 0.2);
  color: #475569;
}

.timeline-item__title {
  font-weight: 600;
  margin: 0;
  color: #1f2937;
}

.timeline-item__door {
  margin: 0;
  font-size: 0.9rem;
}

.timeline-item__summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-chip {
  background: rgba(226, 232, 240, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  color: #475569;
  font-weight: 500;
}

.timeline-chip strong {
  margin-left: 4px;
  color: #111c2b;
}
.timeline-chip--ghost {
  background: rgba(15, 23, 42, 0.08);
  color: #1f2937;
  border: 1px dashed rgba(15, 23, 42, 0.2);
}

.timeline-item__delta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.timeline-item__failures {
  font-size: 0.82rem;
}

.timeline-item--start .timeline-item__icon {
  background: rgba(0, 82, 204, 0.15);
  color: #0052cc;
}

.timeline-item--add .timeline-item__icon {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.timeline-item--edit .timeline-item__icon {
  background: rgba(249, 115, 22, 0.2);
  color: #c2410c;
}

.timeline-item--status .timeline-item__icon {
  background: rgba(147, 51, 234, 0.18);
  color: #7e22ce;
}

.timeline-item--update .timeline-item__icon {
  background: rgba(100, 116, 139, 0.2);
  color: #475569;
}

.timeline-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.timeline-controls form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.timeline-controls select {
  min-width: 160px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid.three-col {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.small-text {
  font-size: 0.8rem;
}

.tiny-text {
  font-size: 0.75rem;
}


.form-errors {
  border: 1px solid rgba(192, 57, 43, 0.3);
  background: rgba(192, 57, 43, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.form-errors ul {
  margin: 8px 0 0;
  padding-left: 16px;
}

.auth-wrapper {
  max-width: 420px;
  margin: 80px auto;
  padding: 24px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 12px 44px rgba(17, 17, 17, 0.15);
}

.twofactor-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface-muted);
}

.twofactor-qr img {
  display: block;
}

.btn-link {
  border: none;
  background: none;
  color: #3d3a34;
  cursor: pointer;
  padding: 0;
  min-height: auto;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: none;
}

.btn-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
}

.door-overview-table--compact th,
.door-overview-table--compact td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.door-detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 20px;
}

.door-detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #fff);
}

.door-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.door-detail-card table {
  margin-top: 12px;
}

.door-detail-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.door-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.door-detail-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.door-spec-chip {
  background: rgba(0, 82, 204, 0.08);
  color: #0f1f3d;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 82, 204, 0.2);
}

.door-notes {
  margin: 0;
  color: #475569;
  line-height: 1.45;
}

.door-media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.door-summary {
    margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(230, 86, 30, 0.35);
  background: rgba(230, 86, 30, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.door-summary > div {
  min-width: 120px;
}

.door-summary p {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c6c6c;
}

.door-summary strong {
  font-size: 1.15rem;
  display: block;
  color: var(--brand);
}

.door-summary-detail {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
}

.component-issue-hints {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.component-issue-hints summary {
  font-weight: 600;
  cursor: pointer;
  color: #444;
}

.component-issue-hints[open] summary {
  margin-bottom: 4px;
}

.component-issue-hints ul {
  margin: 0;
  padding-left: 20px;
  color: #555;
}

.component-issue-hints li {
  margin-bottom: 2px;
}

.component-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.component-table th,
.component-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  text-align: left;
  vertical-align: top;
}

.component-table thead th {
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
  font-weight: 700;
}

.component-row--legacy td {
  background: rgba(230, 86, 30, 0.04);
}

.severity-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.severity-low {
  background: rgba(10, 135, 84, 0.15);
  color: var(--success);
}

.severity-medium {
  background: rgba(255, 193, 7, 0.2);
  color: #9c6b00;
}

.severity-high {
  background: rgba(192, 57, 43, 0.15);
  color: var(--danger);
}

.door-edit {
  margin-top: 16px;
}

.door-edit summary {
  font-weight: 600;
  cursor: pointer;
}

.door-update-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.door-setup {
  padding: 16px;
  border-radius: 12px;
  background: rgba(230, 86, 30, 0.05);
  border: 1px dashed rgba(230, 86, 30, 0.3);
}

.door-setup__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.door-flow {
  margin: 0;
  padding-left: 20px;
  color: #555;
}

.door-flow li + li {
  margin-top: 4px;
}

.door-form-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.draft-status {
  font-size: 0.9rem;
  margin: 0;
}

.text-danger {
  color: var(--danger);
}

.text-muted {
  color: var(--text-muted, #6a6f76);
  font-size: 0.9rem;
}

.text-page-title {
  font-size: var(--font-size-page-title, 1.7rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

.text-section-title {
  font-size: var(--font-size-section-title, 1.125rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.text-label {
  font-size: var(--font-size-label, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #4b5563;
}

.text-body {
  font-size: var(--font-size-base, 0.9375rem);
  font-weight: 400;
  color: var(--text, #1d1d1f);
}

.section-heading__title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading__title h3 {
  margin: 0;
}

.section-heading__title p {
  margin: 4px 0 0;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table--inspections {
  width: 100%;
  border-collapse: collapse;
}

.table--inspections th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #7a8090;
  border-bottom: 1px solid rgba(223, 229, 244, 0.8);
  padding: 12px 16px;
}

.table--inspections td {
  padding: 16px;
  border-bottom: 1px solid rgba(223, 229, 244, 0.6);
}

.table--inspections tr:last-child td {
  border-bottom: none;
}

.table-subtext {
  display: block;
  color: #7a8090;
  font-size: 0.85rem;
  margin-top: 2px;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  align-items: center;
  gap: 6px;
}

.badge--success {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.badge--info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.badge--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.badge--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.badge--muted {
  background: rgba(148, 163, 184, 0.14);
  color: rgba(15, 23, 42, 0.72);
}

.badge--date {
  background: rgba(0, 82, 204, 0.1);
  color: var(--brand);
}

.badge--client {
  background: rgba(122, 128, 144, 0.15);
  color: #565b66;
}

html[data-theme="dark"] .badge--success {
  background: rgba(34, 197, 94, 0.18);
  color: rgba(187, 247, 208, 0.95);
}

html[data-theme="dark"] .badge--info {
  background: rgba(59, 130, 246, 0.18);
  color: rgba(191, 219, 254, 0.95);
}

html[data-theme="dark"] .badge--warning {
  background: rgba(245, 158, 11, 0.18);
  color: rgba(253, 186, 116, 0.95);
}

html[data-theme="dark"] .badge--danger {
  background: rgba(239, 68, 68, 0.18);
  color: rgba(254, 202, 202, 0.95);
}

html[data-theme="dark"] .badge--muted {
  background: rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.86);
}

html[data-theme="dark"] .badge--date {
  background: rgba(59, 130, 246, 0.18);
  color: rgba(191, 219, 254, 0.95);
}

html[data-theme="dark"] .badge--client {
  background: rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.86);
}

.btn--compact {
  min-height: 34px;
  padding: 6px 12px;
}

.btn-sm,
.btn-small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.btn--tiny {
  padding: 4px 10px;
  font-size: 0.78rem;
  min-height: 30px;
}

.table-actions {
  display: flex;
  gap: 12px;
}

.table-actions__more {
  position: relative;
}

.table-actions__more > summary {
  list-style: none;
}

.table-actions__more > summary::-webkit-details-marker {
  display: none;
}

.table-actions__more-toggle {
  width: 38px;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.table-actions__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(223, 229, 244, 0.9);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.12);
  padding: 6px;
  z-index: 2500;
}

.table-actions__menu--floating {
  position: fixed;
  right: auto;
  top: 0;
  left: 0;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: auto;
  z-index: 6000;
}

.table-actions__more--up .table-actions__menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.table-actions__menu-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.table-actions__menu-item:hover,
.table-actions__menu-item:focus-visible {
  background: rgba(17, 24, 39, 0.06);
  outline: none;
}

.table-actions__menu-item:active {
  background: rgba(17, 24, 39, 0.1);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-warning {
  background: var(--brand);
}

.toast-success {
  background: var(--success);
}


/* Utility spacing helpers (migrated from inline styles) */
.u-mt-0 {
  margin-top: 0;
}

.u-mt-neg-6 {
  margin-top: -6px;
}

.u-mt-2 {
  margin-top: 2px;
}

.u-mt-4 {
  margin-top: 4px;
}

.u-mt-6 {
  margin-top: 6px;
}

.u-mt-8 {
  margin-top: 8px;
}

.u-mt-10 {
  margin-top: 10px;
}

.u-mt-12 {
  margin-top: 12px;
}

.u-mt-14 {
  margin-top: 14px;
}

.u-mt-16 {
  margin-top: 16px;
}

.u-mt-20 {
  margin-top: 20px;
}

.u-mt-24 {
  margin-top: 24px;
}

.u-mb-0 {
  margin-bottom: 0;
}

.u-mb-4 {
  margin-bottom: 4px;
}

.u-mb-6 {
  margin-bottom: 6px;
}

.u-mb-8 {
  margin-bottom: 8px;
}

.u-mb-10 {
  margin-bottom: 10px;
}

.u-mb-12 {
  margin-bottom: 12px;
}

.u-mb-16 {
  margin-bottom: 16px;
}

.u-flex {
  display: flex;
}

.u-flex-col {
  flex-direction: column;
}

.u-flex-1 {
  flex: 1;
}

.u-inline-flex {
  display: inline-flex;
}

.u-flex-wrap {
  flex-wrap: wrap;
}

.u-align-center {
  align-items: center;
}

.u-align-end {
  align-items: flex-end;
}

.u-justify-center {
  justify-content: center;
}

.u-justify-between {
  justify-content: space-between;
}

.u-gap-4 {
  gap: 4px;
}

.u-gap-6 {
  gap: 6px;
}

.u-gap-8 {
  gap: 8px;
}

.u-gap-10 {
  gap: 10px;
}

.u-gap-12 {
  gap: 12px;
}

.u-gap-16 {
  gap: 16px;
}

.u-block {
  display: block;
}

.u-minw-220 {
  min-width: 220px;
}

.u-minw-180 {
  min-width: 180px;
}

.u-maxw-180 {
  max-width: 180px;
}

.u-inline-form {
  display: inline;
  margin: 0;
}

.u-pl-16 {
  padding-left: 16px;
}

.u-p-12 {
  padding: 12px;
}

.u-pt-12 {
  padding-top: 12px;
}

.u-pt-16 {
  padding-top: 16px;
}

.u-m-0 {
  margin: 0;
}

.u-icon-32 {
  width: 32px;
  height: 32px;
}

.u-icon-inline {
  margin-right: 4px;
  vertical-align: text-bottom;
}

.u-rounded-full {
  border-radius: 999px;
}

.u-rounded-12 {
  border-radius: 12px;
}

.u-border {
  border: 1px solid #e2e8f0;
}

.u-border-top {
  border-top: 1px solid #e2e8f0;
}

.u-border-danger {
  border: 1px solid #fee2e2;
}

.u-bg-muted {
  background: rgba(15, 23, 42, 0.06);
}

.u-bg-faint {
  background: rgba(15, 23, 42, 0.02);
}

.u-bg-surface {
  background: #ffffff;
}

.u-bg-danger-soft {
  background: #fef2f2;
}

.u-text-center {
  text-align: center;
}

.u-fs-90 {
  font-size: 0.9rem;
}

.u-ml-auto {
  margin-left: auto;
}

.u-ml-4 {
  margin-left: 4px;
}

.u-ml-8 {
  margin-left: 8px;
}

.u-list-reset {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.text-brand {
  color: var(--brand, #e6561e);
}

.text-success {
  color: var(--success, #0a8754);
}

.text-indigo {
  color: #6366f1;
}

.text-sky {
  color: #0ea5e9;
}

.text-green {
  color: #22c55e;
}

.text-amber {
  color: #f59e0b;
}

.icon-surface-indigo {
  background: #eef2ff;
  color: #4338ca;
}

.file-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-field > label {
  font-weight: 600;
  color: #0f172a;
}

.file-upload-card {
  border: 1px dashed #94a3b8;
  border-radius: 18px;
  background: #f8fafc;
  padding: 6px;
}

.file-upload-card input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.file-upload-card__action {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--card, #ffffff);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.file-upload-card__action:hover,
.file-upload-card--has-value .file-upload-card__action {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

@media (hover: hover) and (pointer: fine) {
  .file-upload-card__action:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
  }
}

.file-upload-card__icon {
  font-size: 1.4rem;
}

.file-upload-card__action strong {
  display: block;
  color: var(--text, #0f172a);
}

.file-upload-card__action p {
  margin: 0;
  color: var(--text-muted, #475569);
  font-size: 0.85rem;
}

.floorplan-repeater {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-muted, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.floorplan-repeater__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.floorplan-card {
  border-radius: 14px;
  background: var(--card, #ffffff);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.floorplan-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.floorplan-card__header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text, #0f172a);
}

.floorplan-card__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.floorplan-card__notes textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border, #cbd5f5);
  background: var(--card, #ffffff);
  color: var(--text, #0f172a);
  padding: 10px;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
}

.floorplan-card__label-inputs {
  display: flex;
  gap: 8px;
}

.floorplan-card__label-inputs select,
.floorplan-card__label-inputs input {
  flex: 1;
}

.floorplan-repeater__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.floorplan-repeater__limit {
  font-size: 0.85rem;
  color: var(--text-muted, #475569);
}
