@layer reset, tokens, layout, components, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  html {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
  }
  body {
    min-height: 100dvh;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  img, svg, canvas {
    display: block;
    max-width: 100%;
  }
  input, button, textarea, select {
    font: inherit;
    color: inherit;
  }
  button {
    cursor: pointer;
    background: none;
    border: none;
  }
  table {
    border-collapse: collapse;
    width: 100%;
  }
}

@layer tokens {
  :root {
    /* Sovereign Deep Pine Obsidian + Imperial Cadastral Jade + Bullion Gold */
    --bg-canvas: oklch(0.135 0.016 168);
    --bg-surface-1: oklch(0.175 0.019 168);
    --bg-surface-2: oklch(0.215 0.022 168);
    --bg-surface-3: oklch(0.260 0.025 168);
    --bg-glass: oklch(0.175 0.019 168 / 0.88);

    --bg-page: var(--bg-canvas);
    --surface-base: var(--bg-surface-1);
    --surface-card: var(--bg-surface-2);
    --surface-card-hover: var(--bg-surface-3);
    --surface-elevated: var(--bg-surface-3);
    --surface-input: oklch(0.155 0.018 168);

    --brand-primary: oklch(0.680 0.145 166);
    --brand-primary-hover: oklch(0.730 0.150 166);
    --brand-primary-soft: oklch(0.680 0.145 166 / 0.15);
    --brand-primary-subtle: var(--brand-primary-soft);
    --brand-primary-border: oklch(0.680 0.145 166 / 0.42);

    --brand-gold: oklch(0.800 0.135 80);
    --brand-gold-soft: oklch(0.800 0.135 80 / 0.15);
    --accent-gold: var(--brand-gold);
    --accent-gold-subtle: var(--brand-gold-soft);
    --accent-gold-border: oklch(0.800 0.135 80 / 0.42);

    --brand-blue: oklch(0.680 0.130 235);
    --brand-blue-soft: oklch(0.680 0.130 235 / 0.15);

    --status-success: oklch(0.700 0.150 160);
    --status-success-bg: oklch(0.700 0.150 160 / 0.14);
    --status-safe: var(--status-success);
    --status-safe-bg: var(--status-success-bg);
    --status-warning: oklch(0.790 0.145 78);
    --status-warning-bg: oklch(0.790 0.145 78 / 0.15);
    --status-danger: oklch(0.650 0.195 25);
    --status-danger-bg: oklch(0.650 0.195 25 / 0.15);
    --status-info: var(--brand-blue);
    --status-info-bg: var(--brand-blue-soft);

    --border-subtle: oklch(0.275 0.022 168);
    --border-strong: oklch(0.365 0.030 168);
    --border-focus: oklch(0.800 0.135 80);
    --border-highlight: var(--border-focus);
    --border-emerald: oklch(0.680 0.145 166 / 0.42);
    --border-gold: oklch(0.800 0.135 80 / 0.42);
    --border-danger: oklch(0.650 0.195 25 / 0.45);

    --text-primary: oklch(0.965 0.008 85);
    --text-secondary: oklch(0.810 0.014 165);
    --text-muted: oklch(0.640 0.016 165);
    --text-inverse: oklch(0.135 0.016 168);

    --font-sans: -apple-system, BlinkMacSystemFont, "Sukhumvit Set", "Thonburi", "Noto Sans Thai", "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 9999px;

    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
    --shadow-card: var(--shadow-md);
    --shadow-elevated: var(--shadow-lg);
  }

  /* =========================================================================
     Option A: Institutional Private Banking Navy & Cadastral Forest Jade
     (Default Light Mode — Inspired by Smartfinn + SCB Julius Baer + BAM)
     ========================================================================= */
  :root,
  [data-theme="light"],
  [data-palette="optA"] {
    color-scheme: light;

    --bg-canvas: #F4F6F9; /* oklch(0.968 0.005 245) - Crisp Private Banking Daylight Slate-Alabaster */
    --bg-surface-1: #FFFFFF;
    --bg-surface-2: #F8FAFC;
    --bg-surface-3: #F1F5F9;
    --bg-glass: rgba(255, 255, 255, 0.92);

    --bg-page: var(--bg-canvas);
    --surface-base: #FFFFFF;
    --surface-card: #FFFFFF;
    --surface-card-hover: #F8FAFC;
    --surface-elevated: #F8FAFC;
    --surface-input: #FFFFFF;

    --text-primary: #0B1F3A; /* oklch(0.220 0.045 250) - Deep Oxford Banking Navy */
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;

    --brand-primary: #0F5132; /* oklch(0.390 0.095 162) - Deep Heritage Land Office Forest Green */
    --brand-primary-hover: #0A3622;
    --brand-primary-soft: rgba(15, 81, 50, 0.08);
    --brand-primary-subtle: rgba(15, 81, 50, 0.08);
    --brand-primary-border: rgba(15, 81, 50, 0.28);

    --brand-gold: #9A6E23; /* oklch(0.550 0.115 75) - Burnished Sovereign Bronze-Gold */
    --brand-gold-soft: rgba(154, 110, 35, 0.10);
    --accent-gold: var(--brand-gold);
    --accent-gold-subtle: var(--brand-gold-soft);
    --accent-gold-border: rgba(154, 110, 35, 0.35);

    --brand-blue: #1D4ED8;
    --brand-blue-soft: rgba(29, 78, 216, 0.08);

    --status-success: #0F5132;
    --status-success-bg: rgba(15, 81, 50, 0.08);
    --status-safe: var(--status-success);
    --status-safe-bg: var(--status-success-bg);

    --status-warning: #9A6E23;
    --status-warning-bg: rgba(154, 110, 35, 0.10);

    --status-danger: #B91C1C;
    --status-danger-bg: rgba(185, 28, 28, 0.08);

    --status-info: #1E40AF;
    --status-info-bg: rgba(30, 64, 175, 0.08);

    --border-subtle: #E2E8F0;
    --border-strong: #CBD5E1;
    --border-input: #CBD5E1;
    --border-focus: #0F5132;
    --border-highlight: #0F5132;
    --border-emerald: rgba(15, 81, 50, 0.28);
    --border-gold: rgba(154, 110, 35, 0.35);
    --border-danger: rgba(185, 28, 28, 0.30);

    --shadow-card: 0 1px 3px rgba(11, 31, 58, 0.05), 0 4px 12px rgba(11, 31, 58, 0.04);
    --shadow-elevated: 0 10px 25px -5px rgba(11, 31, 58, 0.08), 0 8px 10px -6px rgba(11, 31, 58, 0.04);
    --shadow-sm: 0 1px 2px 0 rgba(11, 31, 58, 0.05);
    --shadow-md: var(--shadow-card);
    --shadow-lg: var(--shadow-elevated);
  }

  /* =========================================================================
     Option B: Royal Chanote Parchment Ivory & Heritage Jade
     (Inspired by Lombard Odier + Land Office Deed Parchment + SAM)
     ========================================================================= */
  [data-palette="optB"] {
    color-scheme: light;

    --bg-canvas: #F7F4EC; /* Warm Chanote Ivory Parchment */
    --bg-surface-1: #FFFFFF;
    --bg-surface-2: #FAF8F3;
    --bg-surface-3: #F0EAE1;
    --bg-glass: rgba(255, 255, 255, 0.94);

    --bg-page: var(--bg-canvas);
    --surface-base: #FFFFFF;
    --surface-card: #FFFFFF;
    --surface-card-hover: #FAF8F3;
    --surface-elevated: #FAF8F3;
    --surface-input: #FFFFFF;

    --text-primary: #18241E; /* Deep Cadastral Charcoal-Pine */
    --text-secondary: #3D4D44;
    --text-muted: #68786F;
    --text-inverse: #FFFFFF;

    --brand-primary: #164E3B; /* Royal Cadastral Jade */
    --brand-primary-hover: #0D3326;
    --brand-primary-soft: rgba(22, 78, 59, 0.08);
    --brand-primary-subtle: rgba(22, 78, 59, 0.08);
    --brand-primary-border: rgba(22, 78, 59, 0.28);

    --brand-gold: #8F6520; /* Antique Garuda Seal Bronze */
    --brand-gold-soft: rgba(143, 101, 32, 0.10);
    --accent-gold: var(--brand-gold);
    --accent-gold-subtle: var(--brand-gold-soft);
    --accent-gold-border: rgba(143, 101, 32, 0.35);

    --brand-blue: #1E3A8A;
    --brand-blue-soft: rgba(30, 58, 138, 0.08);

    --status-success: #164E3B;
    --status-success-bg: rgba(22, 78, 59, 0.08);
    --status-safe: var(--status-success);
    --status-safe-bg: var(--status-success-bg);

    --status-warning: #8F6520;
    --status-warning-bg: rgba(143, 101, 32, 0.10);

    --status-danger: #B91C1C;
    --status-danger-bg: rgba(185, 28, 28, 0.08);

    --status-info: #1E3A8A;
    --status-info-bg: rgba(30, 58, 138, 0.08);

    --border-subtle: #E5DEC9;
    --border-strong: #D6CFC2;
    --border-input: #D6CFC2;
    --border-focus: #164E3B;
    --border-highlight: #164E3B;
    --border-emerald: rgba(22, 78, 59, 0.28);
    --border-gold: rgba(143, 101, 32, 0.35);
    --border-danger: rgba(185, 28, 28, 0.30);

    --shadow-card: 0 1px 3px rgba(24, 36, 30, 0.05), 0 4px 12px rgba(24, 36, 30, 0.04);
    --shadow-elevated: 0 10px 25px -5px rgba(24, 36, 30, 0.08), 0 8px 10px -6px rgba(24, 36, 30, 0.04);
    --shadow-sm: 0 1px 2px 0 rgba(24, 36, 30, 0.05);
    --shadow-md: var(--shadow-card);
    --shadow-lg: var(--shadow-elevated);
  }

  /* Institutional Sovereign Dark Mode Tokens (Bug F8) */
  html[data-theme="dark"],
  [data-theme="dark"] {
    color-scheme: dark;
    --bg-canvas: oklch(0.125 0.016 168);
    --bg-page: var(--bg-canvas);
    --bg-surface-1: oklch(0.145 0.018 168);
    --bg-surface-2: oklch(0.175 0.020 168);
    --bg-surface-3: oklch(0.205 0.022 168);
    --bg-glass: oklch(0.145 0.018 168 / 0.88);
    --surface-base: oklch(0.145 0.018 168);
    --surface-card: oklch(0.175 0.020 168);
    --surface-card-hover: oklch(0.205 0.022 168);
    --surface-elevated: oklch(0.205 0.022 168);
    --surface-input: oklch(0.155 0.018 168);
    --text-primary: oklch(0.965 0.010 168);
    --text-secondary: oklch(0.820 0.015 168);
    --text-muted: oklch(0.660 0.016 168);
    --text-inverse: oklch(0.135 0.016 168);
    --brand-primary: #34d399;
    --brand-primary-hover: #10b981;
    --brand-primary-soft: rgba(52, 211, 153, 0.15);
    --brand-primary-subtle: rgba(52, 211, 153, 0.15);
    --brand-primary-border: rgba(52, 211, 153, 0.35);
    --brand-gold: #fbbf24;
    --brand-gold-soft: rgba(251, 191, 36, 0.15);
    --accent-gold: var(--brand-gold);
    --accent-gold-subtle: var(--brand-gold-soft);
    --accent-gold-border: rgba(251, 191, 36, 0.35);
    --brand-blue: #60a5fa;
    --brand-blue-soft: rgba(96, 165, 250, 0.15);
    --status-success: #34d399;
    --status-success-bg: rgba(52, 211, 153, 0.15);
    --status-safe: var(--status-success);
    --status-safe-bg: var(--status-success-bg);
    --status-warning: #fbbf24;
    --status-warning-bg: rgba(251, 191, 36, 0.15);
    --status-danger: #f87171;
    --status-danger-bg: rgba(248, 113, 113, 0.15);
    --status-info: #60a5fa;
    --status-info-bg: rgba(96, 165, 250, 0.15);
    --border-subtle: rgba(52, 211, 153, 0.22);
    --border-strong: rgba(52, 211, 153, 0.35);
    --border-input: rgba(52, 211, 153, 0.25);
    --border-focus: #34d399;
    --border-highlight: var(--border-focus);
    --border-emerald: rgba(52, 211, 153, 0.35);
    --border-gold: rgba(251, 191, 36, 0.35);
    --border-danger: rgba(248, 113, 113, 0.35);
    --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

@layer layout {
  body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  .app-container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem 2.5rem 1.25rem;
    flex: 1 0 auto;
  }

  /* Safe Topbar Pattern */
  .topbar-main {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-base);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.625rem 1.125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 100%;
    overflow-x: clip;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
  }

  .brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
  }

  .brand-icon,
  .brand-mark {
    width: 32px;
    height: 32px;
    background: var(--brand-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    flex-shrink: 0;
  }
  .brand-text {
    display: flex;
    flex-direction: column;
  }
  .brand-title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }
  .brand-subtitle {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.25;
  }

  .topbar-center {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 1;
    min-width: 0;
  }

  .topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: max-content;
  }

  .live-pill-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 1;
    min-width: 0;
  }

  .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.45rem;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.3;
    min-height: 22px;
    white-space: nowrap;
    border: 1px solid transparent;
  }

  .status-pill.online {
    background: var(--status-safe-bg);
    color: var(--status-safe);
    border-color: var(--brand-primary-border);
  }
  .status-pill.badge-subtle {
    background: var(--surface-card);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
  }

  /* Topbar Option A: Deep Institutional Bank Navy */
  :root:not([data-palette="optB"]) .topbar-main,
  [data-palette="optA"] .topbar-main {
    background: #0B2545;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
  }
  :root:not([data-palette="optB"]) .topbar-main .brand-logo,
  [data-palette="optA"] .topbar-main .brand-logo {
    color: #FFFFFF;
  }
  :root:not([data-palette="optB"]) .topbar-main .brand-title,
  [data-palette="optA"] .topbar-main .brand-title {
    color: #FFFFFF;
    font-weight: 700;
  }
  :root:not([data-palette="optB"]) .topbar-main .brand-subtitle,
  [data-palette="optA"] .topbar-main .brand-subtitle {
    color: rgba(255, 255, 255, 0.82);
  }
  :root:not([data-palette="optB"]) .topbar-main .brand-icon,
  [data-palette="optA"] .topbar-main .brand-icon {
    background: #D4AF37;
    color: #0B2545;
    font-weight: 800;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  }
  :root:not([data-palette="optB"]) .topbar-main .status-pill.online,
  [data-palette="optA"] .topbar-main .status-pill.online {
    background: rgba(16, 185, 129, 0.18);
    color: #34D399;
    border: 1px solid rgba(52, 211, 153, 0.40);
  }
  :root:not([data-palette="optB"]) .topbar-main .status-pill.badge-subtle,
  [data-palette="optA"] .topbar-main .status-pill.badge-subtle {
    background: rgba(255, 255, 255, 0.12);
    color: #F8FAFC;
    border: 1px solid rgba(255, 255, 255, 0.22);
  }
  :root:not([data-palette="optB"]) .topbar-main #theme-toggle-btn,
  [data-palette="optA"] .topbar-main #theme-toggle-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.25);
  }

  /* Topbar Option B: Warm Ivory-White with Royal Jade & Gold Accent */
  [data-palette="optB"] .topbar-main {
    background: #FFFFFF;
    border-top: 3px solid #164E3B;
    border-bottom: 1px solid #E5DEC9;
    color: #18241E;
  }
  [data-palette="optB"] .topbar-main .brand-logo {
    color: #18241E;
  }
  [data-palette="optB"] .topbar-main .brand-title {
    color: #18241E;
    font-weight: 700;
  }
  [data-palette="optB"] .topbar-main .brand-subtitle {
    color: #68786F;
  }
  [data-palette="optB"] .topbar-main .brand-icon {
    background: #164E3B;
    color: #FFFFFF;
    font-weight: 800;
  }
  [data-palette="optB"] .topbar-main .status-pill.online {
    background: rgba(22, 78, 59, 0.08);
    color: #164E3B;
    border: 1px solid rgba(22, 78, 59, 0.28);
  }
  [data-palette="optB"] .topbar-main .status-pill.badge-subtle {
    background: #F7F4EC;
    color: #3D4D44;
    border: 1px solid #E5DEC9;
  }
  [data-palette="optB"] .topbar-main #theme-toggle-btn {
    background: #F7F4EC;
    color: #18241E;
    border: 1px solid #D6CFC2;
  }

  .pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulseGlow 2s infinite ease-in-out;
  }
  @keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
  }

  /* Navigation Bar */
  .main-nav-bar {
    background: var(--surface-base);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: thin;
    gap: 0.5rem;
  }

  .nav-tabs {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0 auto;
    max-width: 1440px;
    width: 100%;
  }

  .nav-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
  }

  .nav-tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface-card-hover);
  }

  .nav-tab-btn.active {
    color: var(--brand-primary);
    background: var(--surface-card);
    border-color: var(--brand-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
  }

  .tab-icon {
    font-size: 1rem;
    line-height: 1;
  }

  /* Tab View Container */
  .tab-view {
    display: none;
    padding-top: 1.5rem;
  }
  .tab-view.active {
    display: block;
    animation: fadeIn 0.18s ease-out;
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* 12-Column Grid Architecture */
  .grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
  }

  .col-12, .col-span-12 { grid-column: span 12; }
  .col-8 { grid-column: span 8; }
  .col-7 { grid-column: span 7; }
  .col-6, .col-span-6 { grid-column: span 6; }
  .col-5 { grid-column: span 5; }
  .col-4 { grid-column: span 4; }
  .col-3 { grid-column: span 3; }

  .grid-2col-responsive {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
  .grid-3col-responsive {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  /* 3-Zone Flex-Column Card Architecture */
  .card-3zone {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease;
  }
  .card-3zone:hover {
    border-color: var(--border-strong);
  }

  .card-zone-header {
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  .card-zone-header > div:first-child {
    min-width: 0;
    flex: 1 1 130px;
  }

  .card-zone-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-wrap: anywhere;
  }

  .card-zone-footer {
    margin-top: auto;
    padding-top: 0.875rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .card-zone-footer > span:first-child {
    min-width: 0;
    flex: 1 1 180px;
  }
}
@layer components {
  /* Form Elements */
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.875rem;
  }
  .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
  }

  .form-input, .form-select {
    width: 100%;
    background-color: var(--surface-input);
    border: 1px solid var(--border-input, var(--border-strong));
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.15s ease;
    min-height: 42px;
  }
  .form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-primary-subtle);
  }
  .form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
  }

  .input-with-action {
    position: relative;
    display: flex;
    align-items: center;
  }
  .input-action-badge {
    position: absolute;
    right: 0.625rem;
    font-size: 0.75rem;
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
  }

  .number-tabular {
    font-variant-numeric: tabular-nums lining-nums;
  }

  /* Metric & KPI Display */
  .kpi-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
  }
  .kpi-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .kpi-value-huge {
    font-size: clamp(1.625rem, 2.2vw, 2.25rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    font-variant-numeric: tabular-nums lining-nums;
  }
  .kpi-value-huge.emerald {
    color: var(--brand-primary);
  }
  .kpi-value-huge.gold {
    color: var(--accent-gold);
  }
  .kpi-subtext {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .metrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .metric-mini-card {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.75rem;
  }
  .metric-mini-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
  }
  .metric-mini-val {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums lining-nums;
  }

  /* Key-Value Breakdown Table */
  .kv-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
  }
  .kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px dashed var(--border-subtle);
    font-size: 0.875rem;
  }
  .kv-row:last-child {
    border-bottom: none;
  }
  .kv-row.total-row {
    font-weight: 700;
    border-top: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-strong);
    padding: 0.5rem 0;
    color: var(--brand-primary);
    font-size: 0.9375rem;
  }
  .kv-key {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
  }
  .kv-val {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 600;
    text-align: right;
  }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.125rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    min-height: 40px;
  }
  .btn-primary {
    background: var(--brand-primary);
    color: var(--text-inverse);
    box-shadow: 0 1px 3px var(--brand-primary-border);
  }
  .btn-primary:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
  }
  .btn-secondary {
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
  }
  .btn-secondary:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-highlight);
  }
  .btn-gold {
    background: var(--accent-gold);
    color: var(--text-inverse);
    font-weight: 700;
  }
  .btn-gold:hover {
    filter: brightness(1.08);
  }
  .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 32px;
  }
  .btn-full {
    width: 100%;
  }
  .filter-chip.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
    border-color: var(--brand-primary);
  }
  .scenario-matrix-pill {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    white-space: normal !important;
    text-align: left !important;
    min-width: 0 !important;
  }
  /* Badges & Pills */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    border: 1px solid transparent;
  }
  .badge-emerald {
    background: var(--brand-primary-subtle);
    color: var(--brand-primary);
    border-color: var(--brand-primary-border);
  }
  .badge-gold {
    background: var(--accent-gold-subtle);
    color: var(--accent-gold);
    border-color: var(--accent-gold-border);
  }
  .badge-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border-color: var(--border-danger);
  }
  .badge-info {
    background: var(--status-info-bg);
    color: var(--status-info);
    border-color: var(--brand-blue-soft);
  }
  .badge-neutral {
    background: var(--surface-base);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
  }

  /* Underwriting Verdict Box */
  .verdict-box {
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    line-height: 1.45;
    margin-bottom: 0.875rem;
    border: 1px solid var(--border-subtle);
  }
  .verdict-box.pass {
    background: var(--status-safe-bg);
    border-color: var(--border-emerald);
    color: var(--text-primary);
  }
  .verdict-box.reject {
    background: var(--status-danger-bg);
    border-color: var(--border-danger);
    color: var(--text-primary);
  }

  /* Alerts / Information callouts */
  .alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    border: 1px solid transparent;
  }
  .alert-banner.info {
    background: var(--status-info-bg);
    color: var(--text-primary);
    border-color: var(--brand-blue-soft);
  }
  .alert-banner.warning {
    background: var(--status-warning-bg);
    color: var(--text-primary);
    border-color: var(--accent-gold-border);
  }
  .alert-banner.safe {
    background: var(--status-safe-bg);
    color: var(--text-primary);
    border-color: var(--brand-primary-border);
  }

  /* Slider range controls */
  .range-container {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
  }
  .range-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-weight: 600;
  }
  .range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--surface-input);
    outline: none;
    cursor: pointer;
  }
  .range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary);
    border: 2px solid var(--surface-base);
    cursor: pointer;
    box-shadow: 0 1px 4px oklch(0 0 0 / 0.4);
    transition: transform 0.1s ease;
  }
  .range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
  }

  /* 10-Fraud Shield Matrix */
  .fraud-shield-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.875rem;
  }
  .fraud-shield-item {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.15s ease;
  }
  .fraud-shield-item:hover {
    border-color: var(--brand-primary-border);
  }
  .fraud-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .fraud-item-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
  }
  .fraud-item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
  }
  .fraud-item-shield {
    font-size: 0.75rem;
    background: var(--surface-card);
    border-left: 2px solid var(--brand-primary);
    padding: 0.375rem 0.5rem;
    color: var(--brand-primary);
    font-weight: 600;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }

  /* Deal Room Cards & Blind Maps */
  .deal-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.15s ease, border-color 0.15s ease;
  }
  .deal-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
  }
  .deal-map-preview,
  .gis-preview-box {
    height: 160px;
    background: var(--surface-base);
    position: relative;
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .blind-radius-circle {
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--brand-primary-soft);
    border: 2px dashed var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 0.6875rem;
    font-weight: 700;
    text-align: center;
    backdrop-filter: blur(2px);
  }
  .deal-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .deal-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
  }
  .deal-location {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
  }

  /* Co-Buyer Syndicate Box (ป.พ.พ. ม.1356) */
  .cobuyer-syndicate-box {
    margin: 0.5rem 0 0.75rem 0;
    padding: 0.625rem 0.75rem;
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
  }
  .cobuyer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
  }
  .cobuyer-progress-track {
    height: 6px;
    background: var(--surface-input);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.375rem;
  }
  .cobuyer-progress-fill {
    height: 100%;
    background: var(--brand-primary);
    border-radius: 999px;
    transition: width var(--transition-normal);
  }
  .cobuyer-footer-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.6875rem;
  }

  /* Tab 4: GPS Pin verifier & Sec 17 Engine */
  .gps-pin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .gps-pin-card {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
  }
  .gps-pin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 700;
  }
  .distance-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .distance-badge.pass {
    background: var(--status-safe-bg);
    color: var(--status-safe);
  }
  .distance-badge.fail {
    background: var(--status-danger-bg);
    color: var(--status-danger);
  }

  .timeline-tracking {
    position: relative;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
  }
  .timeline-tracking::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-subtle);
  }
  .timeline-step {
    position: relative;
  }
  .timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface-base);
    border: 2px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .timeline-step.completed .timeline-marker {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
  }
  .timeline-step.active .timeline-marker {
    border-color: var(--accent-gold);
    background: var(--surface-base);
  }
  .timeline-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
  }
  .timeline-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
  }

  /* Funnel Visualization */
  .funnel-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
  }
  .funnel-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
  }
  .funnel-label {
    width: 160px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-weight: 500;
  }
  .funnel-bar-track {
    flex: 1;
    height: 28px;
    background: var(--surface-base);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-subtle);
  }
  .funnel-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    transition: width 0.4s ease;
  }
  .funnel-metric {
    width: 90px;
    text-align: right;
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
  }

  /* Financial Tables */
  .styled-table {
    width: 100%;
    font-size: 0.8125rem;
  }
  .styled-table th {
    background: var(--surface-base);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-strong);
    text-align: left;
    white-space: nowrap;
  }
  .styled-table th.num-col, .styled-table td.num-col {
    text-align: right;
    font-variant-numeric: tabular-nums lining-nums;
  }
  .styled-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
  }
  .styled-table tr:hover td {
    background: var(--surface-card-hover);
    color: var(--text-primary);
  }
  .styled-table tfoot td {
    font-weight: 700;
    color: var(--brand-primary);
    border-top: 2px solid var(--border-strong);
    background: var(--surface-base);
  }

  /* Dialog / Modal */
  dialog.modal-sheet {
    border: 1px solid var(--border-strong);
    background: var(--surface-card);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(92vw, 540px);
    margin: auto;
    padding: 0;
    overflow: hidden;
  }
  dialog::backdrop {
    background: oklch(0 0 0 / 0.65);
    backdrop-filter: blur(4px);
  }
  .modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-base);
  }
  .modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
  }
  .modal-body {
    padding: 1.25rem;
    max-height: 75vh;
    overflow-y: auto;
  }
  .modal-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--surface-base);
  }

  /* Institutional Document Preview Modal & Paper Styling */
  dialog.modal-print-dialog {
    width: min(94vw, 860px);
    max-height: 90vh;
  }
  .doc-tab-switcher button.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
    font-weight: 700;
  }
  .print-doc-container {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
  }
  .paper-sheet {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
  }
  .paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--brand-primary);
    padding-bottom: 0.875rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .paper-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  .paper-stat-box {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
  }
  .paper-table {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
  }
  .paper-table th, .paper-table td {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  .paper-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75rem;
  }
  .paper-checklist {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
  }
  .paper-checklist li {
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
@layer utilities {
  .text-right { text-align: right; }
  .text-center { text-align: center; }
  .text-muted { color: var(--text-muted); }
  .text-secondary { color: var(--text-secondary); }
  .text-emerald { color: var(--brand-primary); }
  .text-gold { color: var(--accent-gold); }
  .text-danger { color: var(--status-danger); }
  .font-mono { font-family: var(--font-mono); }
  .font-bold { font-weight: 700; }
  .nowrap { white-space: nowrap; }
  .hidden { display: none !important; }

  /* Spacing */
  .mt-1 { margin-top: 0.5rem; }
  .mt-2 { margin-top: 1rem; }
  .mt-3 { margin-top: 1.5rem; }
  .mb-1 { margin-bottom: 0.5rem; }
  .mb-2 { margin-bottom: 1rem; }
  .gap-1 { gap: 0.5rem; }
  .gap-2 { gap: 1rem; }

  /* Global 16px input enforcement for iOS zoom guard */
  input:not([type="range"]), select, textarea {
    font-size: 16px !important;
  }

  /* Responsive Media Queries */
  @media (max-width: 900px) {
    .grid-12 {
      display: flex !important;
      flex-direction: column !important;
      gap: 1rem !important;
    }
    .col-12, .col-span-12, .col-8, .col-7, .col-6, .col-span-6, .col-5, .col-4, .col-3 {
      width: 100% !important;
      max-width: 100% !important;
      flex: 1 1 auto !important;
    }
    .topbar-main {
      padding: 0.5rem 0.75rem;
      flex-wrap: wrap;
    }
    .topbar-center .status-pill.badge-subtle,
    .live-pill-cluster .status-pill.badge-subtle,
    .topbar-right .status-pill.badge-subtle {
      display: none !important;
    }
    .main-nav-bar {
      padding: 0.375rem 0.75rem;
      -webkit-overflow-scrolling: touch;
    }
    .nav-tabs {
      gap: 0.25rem;
    }
    .nav-tab-btn {
      min-height: 48px !important;
      padding: 0.5rem 0.75rem !important;
      font-size: 0.8125rem;
    }
    .app-container {
      padding: 0 0.75rem 1.5rem 0.75rem;
    }
    .card-3zone {
      padding: 1rem;
    }
    .form-input, .form-select {
      font-size: 16px !important;
      min-height: 48px;
    }
    .btn {
      min-height: 48px !important;
    }
    #btn-simulate-rm-boomerang, #btn-broker-lock {
      white-space: normal !important;
      max-width: 100% !important;
      text-align: center;
      line-height: 1.35;
    }
    .funnel-bar-wrapper {
      flex-direction: column !important;
      align-items: flex-start !important;
      gap: 0.25rem !important;
    }
    .funnel-label {
      width: 100% !important;
      font-size: 0.75rem;
    }
    .funnel-bar-track {
      width: 100% !important;
    }
    .funnel-metric {
      align-self: flex-end !important;
    }
    .fraud-shield-grid {
      grid-template-columns: 1fr !important;
    }
    .gps-pin-grid {
      grid-template-columns: 1fr !important;
    }
    .metrics-summary-grid {
      grid-template-columns: 1fr 1fr !important;
    }
    .grid-2col-responsive {
      grid-template-columns: 1fr !important;
      gap: 1rem !important;
    }
    .grid-3col-responsive {
      grid-template-columns: 1fr !important;
      gap: 1rem !important;
    }
    .alert-banner {
      flex-wrap: wrap !important;
      gap: 0.75rem !important;
    }
    .alert-banner > div:nth-child(2) {
      flex: 1 1 200px !important;
      min-width: 0 !important;
    }
    .alert-banner > div:nth-child(3) {
      flex: 1 1 100% !important;
      width: 100% !important;
      justify-content: flex-start !important;
    }
    .paper-grid-2 {
      grid-template-columns: 1fr !important;
      gap: 0.75rem !important;
    }
    .paper-sheet {
      padding: 1rem !important;
    }
    .modal-print-dialog {
      width: 96vw !important;
    }
    .modal-header.doc-modal-actions {
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 0.5rem !important;
    }
    .doc-tab-switcher {
      width: 100% !important;
      display: flex !important;
      flex-wrap: wrap !important;
    }
    .doc-tab-switcher button {
      flex: 1 1 calc(50% - 4px) !important;
      min-width: 0 !important;
      white-space: normal !important;
      min-height: 40px !important;
      line-height: 1.25 !important;
      text-align: center !important;
    }
  }

  /* Mobile Fold Budget Guard (<= 35% fold limit) */
  @media (max-width: 768px) {
    .topbar-center {
      display: none !important;
    }
    .topbar-main {
      min-height: 52px;
      max-height: 56px;
      padding: 0.5rem 0.75rem;
      flex-wrap: nowrap !important;
      justify-content: space-between !important;
    }
    .brand-subtitle {
      display: none !important;
    }
  }

  /* Intermediate Tablet / Split-Screen Breakpoint */
  @media (min-width: 901px) and (max-width: 1200px) {
    .col-3 {
      width: 50% !important;
      max-width: 50% !important;
      flex: 0 0 50% !important;
    }
  }

  /* Container Queries for Adaptive 3-Zone Cards */
  #deals-container,
  .deals-grid,
  .app-container {
    container-type: inline-size;
  }

  dialog[hidden] {
    display: none !important;
  }

  /* Institutional Print Sheet Engine */
  @media print {
    @page {
      size: A4 portrait;
      margin: 12mm 15mm;
    }
    body {
      background: white !important;
      color: #0c1a29 !important;
      font-size: 11pt !important;
    }
    .topbar,
    .topbar-main,
    .tab-nav,
    .main-nav-bar,
    .bottom-thumb-nav,
    .persona-switcher-bar,
    .persona-switcher-bar-container,
    .executive-command-deck,
    .doc-modal-actions,
    .modal-actions,
    .btn,
    button:not(.print-allow-btn),
    dialog:not([open]),
    dialog[hidden],
    dialog:not(#doc-print-modal):not(#modal-notice17):not(#closing-pack-modal),
    #modal-escrow,
    #theme-toggle-btn {
      display: none !important;
    }
    /* When a print modal is open, suppress background app container to prevent ghosting */
    body:has(dialog.modal-print-dialog[open]) .app-container,
    body:has(dialog#modal-notice17[open]) .app-container {
      display: none !important;
    }
    dialog#doc-print-modal[open],
    dialog#modal-notice17[open],
    dialog#closing-pack-modal[open] {
      display: block !important;
      position: static !important;
      width: 100% !important;
      max-width: 100% !important;
      height: auto !important;
      max-height: none !important;
      border: none !important;
      box-shadow: none !important;
      background: white !important;
      color: #0c1a29 !important;
      padding: 0 !important;
      margin: 0 !important;
      overflow: visible !important;
    }
    dialog#closing-pack-modal .modal-header,
    dialog#closing-pack-modal .modal-footer,
    dialog#modal-notice17 .modal-header,
    dialog#modal-notice17 .modal-footer {
      display: none !important;
    }
    dialog#doc-print-modal::backdrop,
    dialog#modal-notice17::backdrop,
    dialog#closing-pack-modal::backdrop {
      display: none !important;
    }
    .print-doc-container {
      padding: 0 !important;
      max-height: none !important;
      overflow: visible !important;
    }
    .paper-sheet {
      background: white !important;
      color: #0c1a29 !important;
      border: 1px solid #cbd5e1 !important;
      box-shadow: none !important;
      padding: 0.5rem 0 !important;
      page-break-after: avoid;
      break-after: avoid;
    }
    .paper-stat-box {
      background: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
      color: #0c1a29 !important;
    }
    .paper-table th, .paper-table td {
      border-bottom: 1px solid #e2e8f0 !important;
      color: #0c1a29 !important;
    }
    .badge {
      border: 1px solid #cbd5e1 !important;
      color: #0c1a29 !important;
      background: #f1f5f9 !important;
    }
  }
}


/* ==========================================================================
   2026 WORLD-CLASS FINTECH & PROPTECH VISUAL DESIGN SYSTEM
   Component Upgrades & 3 Distinct 2026 Design Paradigms
   ========================================================================== */

/* Crisp Inline Vector SVGs */
.ui-icon {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}
.inline-icon {
  margin-right: 4px;
}

/* Executive Command Deck Container */
.executive-command-deck {
  width: 100%;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* 4-Card Executive Telemetry Bento Ribbon */
.telemetry-ribbon-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0.25rem 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.executive-telemetry-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.telemetry-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 10px);
  padding: 0.875rem 1.125rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 108px;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.telemetry-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.telemetry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.telemetry-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.telemetry-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.telemetry-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.telemetry-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.telemetry-val.accent-emerald {
  color: #047857;
}

.telemetry-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.telemetry-sparkline {
  flex-shrink: 0;
}

.badge-trend-up {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-weight: 700;
  font-size: 0.6875rem;
}

.telemetry-pill-target {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-base);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.telemetry-progress-wrap {
  width: 100%;
  margin: 0.25rem 0 0.375rem 0;
}

.telemetry-progress-track {
  width: 100%;
  height: 6px;
  background: var(--surface-elevated, #E2E8F0);
  border-radius: 9999px;
  position: relative;
  overflow: visible;
}

.telemetry-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981 0%, #047857 100%);
  border-radius: 9999px;
}

.telemetry-progress-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: #B91C1C;
  border-radius: 1px;
}

.telemetry-badge-safe {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #047857;
  background: rgba(4, 120, 87, 0.08);
  border: 1px solid rgba(4, 120, 87, 0.2);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.telemetry-pill-live {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #1D4ED8;
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.2);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1D4ED8;
  animation: pulse-ring 2s infinite;
}

/* AI Cadastral Vision & Deed Telemetry Bar */
.cadastral-telemetry-bar {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  padding: 0.75rem 0.875rem;
  margin-bottom: 1rem;
}

.cadastral-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cadastral-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cadastral-scan-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--brand-primary-soft, rgba(29, 78, 216, 0.08));
  color: var(--brand-primary, #1D4ED8);
}

.cadastral-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-pdpa {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  background: rgba(4, 120, 87, 0.08);
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cadastral-action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4375rem 0.625rem;
  white-space: nowrap;
  border-radius: 8px;
}

.btn-fraud-test {
  color: #B91C1C !important;
  border-color: rgba(185, 28, 28, 0.3) !important;
  background: rgba(185, 28, 28, 0.04) !important;
}
.btn-fraud-test:hover {
  background: rgba(185, 28, 28, 0.08) !important;
}

.form-section-header {
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}

.form-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.form-input, .form-select {
  border-radius: 8px !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

/* Circular Score Gauge */
.kpi-score-gauge-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.score-gauge-box {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-circle-svg {
  transform: rotate(-90deg);
}

.score-circle-svg .gauge-bg {
  stroke: var(--border-subtle);
}

.score-circle-svg .gauge-fill {
  stroke: #10B981;
  transition: stroke-dashoffset 0.8s ease;
}

.score-gauge-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.score-gauge-num {
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.score-gauge-max {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.score-gauge-tier {
  font-size: 0.5625rem;
  font-weight: 700;
  color: #047857;
  margin-top: 2px;
}

/* Visual Dual-Cap Valuation Comparison Horizontal Waterfall */
.dual-cap-waterfall-card {
  margin-top: 1rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  padding: 0.75rem 0.875rem;
}

.waterfall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.waterfall-title-group {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.waterfall-bars-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.waterfall-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.waterfall-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.waterfall-name {
  color: var(--text-secondary);
}

.waterfall-val {
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
}

.waterfall-track {
  width: 100%;
  height: 18px;
  background: var(--surface-base);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.waterfall-bar {
  height: 100%;
  border-radius: 3px;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  transition: width 0.4s ease;
}

.waterfall-bar.bar-market {
  background: #64748B;
}

.waterfall-bar.bar-fsv {
  background: #475569;
}

.waterfall-bar.bar-treasury {
  background: #0284C7;
}

.waterfall-bar.bar-safe-loan {
  background: linear-gradient(90deg, #10B981 0%, #047857 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.bar-fill-text {
  font-size: 0.625rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
}

.waterfall-cushion-pill {
  margin-top: 0.375rem;
  padding: 0.3125rem 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #047857;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* 2026 Cadastral GIS Telemetry Map */
.deal-map-preview.gis-telemetry-map {
  position: relative;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: var(--surface-base);
  height: 160px;
  border-bottom: 1px solid var(--border-subtle);
}

.gis-map-badge {
  position: absolute;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  pointer-events: none;
  z-index: 5;
}

.gis-map-badge.top-left {
  top: 8px;
  left: 8px;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.gis-map-badge.center-privacy {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.25rem 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pulse-dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  animation: pulse-ring 2s infinite;
}

/* Topbar Design Paradigm Switcher */
.design-paradigm-pill-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface-elevated, #EEF2F6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.paradigm-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3125rem 0.625rem;
  border-radius: 6px;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.paradigm-pill-btn:hover {
  color: var(--text-primary);
}

.paradigm-pill-btn.active {
  background: var(--surface-card, #FFFFFF);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.p-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.p-dot-1 { background: #1D4ED8; }
.p-dot-2 { background: #D4AF37; }
.p-dot-3 { background: #05603A; }

.icon-only-btn {
  padding: 0.4375rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}


/* ==========================================================================
   PARADIGM 1: STRIPE CAPITAL & MERCURY FINTECH (COBALT-EMERALD)
   data-design="design1"
   ========================================================================== */
html[data-design="design1"] {
  --bg-page: #F4F6FA;
  --bg-canvas: #F4F6FA;
  --surface-base: #FFFFFF;
  --surface-card: #FFFFFF;
  --surface-card-hover: #F8FAFC;
  --surface-elevated: #EEF2F6;
  --surface-input: #FFFFFF;

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;

  --brand-primary: #1D4ED8;
  --brand-primary-hover: #1E40AF;
  --brand-primary-soft: rgba(29, 78, 216, 0.08);
  --brand-primary-border: rgba(29, 78, 216, 0.25);

  --accent-emerald: #047857;
  --accent-emerald-soft: rgba(4, 120, 87, 0.08);
  --accent-emerald-border: rgba(4, 120, 87, 0.25);

  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-input: #CBD5E1;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-elevated: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

html[data-design="design1"] body {
  background: radial-gradient(circle at 50% 0%, #FFFFFF 0%, #F4F6FA 100%);
  background-attachment: fixed;
}

html[data-design="design1"] .executive-command-deck {
  background: transparent;
}

html[data-design="design1"] .topbar-main {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #E2E8F0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-design="design1"] .brand-title {
  color: #0F172A;
}
html[data-design="design1"] .brand-subtitle {
  color: #64748B;
}
html[data-design="design1"] .brand-icon {
  background: #1D4ED8;
  color: #FFFFFF;
}

html[data-design="design1"] .main-nav-bar {
  background: transparent;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.5rem 1.25rem;
}

html[data-design="design1"] .nav-tabs {
  background: #EEF2F6;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
}

html[data-design="design1"] .nav-tab-btn {
  color: #475569;
  font-weight: 600;
  border-radius: 8px;
}

html[data-design="design1"] .nav-tab-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  border-bottom: 2px solid #1D4ED8;
}

html[data-design="design1"] .btn-primary {
  background: #1D4ED8;
  color: #FFFFFF;
}
html[data-design="design1"] .btn-primary:hover {
  background: #1E40AF;
}

html[data-design="design1"] .kpi-value-huge.emerald {
  color: #047857;
}


/* ==========================================================================
   PARADIGM 2: BLACKSTONE & SCB JULIUS BAER EXECUTIVE COMMAND HYBRID
   data-design="design2"
   ========================================================================== */
html[data-design="design2"] {
  --bg-page: #F6F5F0; /* Daylight Warm Alabaster Canvas */
  --bg-canvas: #F6F5F0;
  --surface-base: #FFFFFF;
  --surface-card: #FFFFFF;
  --surface-card-hover: #FAF9F5;
  --surface-elevated: #EDEAE1;
  --surface-input: #FFFFFF;

  --text-primary: #0B192C; /* Deep Oxford Navy */
  --text-secondary: #2D3E50;
  --text-muted: #5C6F84;

  --brand-primary: #0F5132; /* Heritage Forest */
  --brand-primary-hover: #0A3622;
  --brand-primary-soft: rgba(15, 81, 50, 0.08);
  --brand-primary-border: rgba(15, 81, 50, 0.28);

  --brand-gold: #9A6E23; /* Burnished Gold */
  --brand-gold-soft: rgba(154, 110, 35, 0.10);

  --border-subtle: #E5E1D5;
  --border-strong: #D5CFBF;
  --border-input: #D5CFBF;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --shadow-card: 0 4px 14px rgba(11, 25, 44, 0.05);
  --shadow-elevated: 0 12px 28px -4px rgba(11, 25, 44, 0.08);
}

html[data-design="design2"] body {
  background: #F6F5F0;
}

/* Deep Midnight Sovereign Header Deck */
html[data-design="design2"] .executive-command-deck {
  background: linear-gradient(135deg, #071120 0%, #0D1F38 60%, #0A2924 100%);
  color: #F8FAFC;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 10px 30px rgba(7, 17, 32, 0.35);
}

html[data-design="design2"] .topbar-main {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
}

html[data-design="design2"] .brand-title {
  color: #FFFFFF;
}

html[data-design="design2"] .brand-subtitle {
  color: rgba(255, 255, 255, 0.72);
}

html[data-design="design2"] .brand-icon {
  background: #D4AF37;
  color: #071120;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

html[data-design="design2"] .status-pill.online {
  background: rgba(52, 211, 153, 0.15);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

html[data-design="design2"] .status-pill.badge-subtle {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

html[data-design="design2"] .main-nav-bar {
  background: transparent;
  border-bottom: none;
  padding: 0.5rem 1.25rem;
}

html[data-design="design2"] .nav-tabs {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: 12px;
}

html[data-design="design2"] .nav-tab-btn {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  border-radius: 8px;
}

html[data-design="design2"] .nav-tab-btn:hover {
  color: #FFFFFF;
}

html[data-design="design2"] .nav-tab-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Telemetry Cards in Deck */
html[data-design="design2"] .telemetry-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

html[data-design="design2"] .telemetry-card:hover {
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(255, 255, 255, 0.09);
}

html[data-design="design2"] .telemetry-label {
  color: rgba(255, 255, 255, 0.75);
}

html[data-design="design2"] .telemetry-val {
  color: #D4AF37; /* Brushed Champagne Gold */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

html[data-design="design2"] .telemetry-val.accent-emerald {
  color: #34D399; /* Emerald */
}

html[data-design="design2"] .telemetry-sub {
  color: rgba(255, 255, 255, 0.65);
}

html[data-design="design2"] .telemetry-pill-target {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

html[data-design="design2"] .telemetry-progress-track {
  background: rgba(255, 255, 255, 0.12);
}

html[data-design="design2"] .telemetry-badge-safe {
  background: rgba(52, 211, 153, 0.15);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.35);
}

html[data-design="design2"] .telemetry-pill-live {
  background: rgba(212, 175, 55, 0.15);
  color: #D4AF37;
  border-color: rgba(212, 175, 55, 0.35);
}

html[data-design="design2"] .live-pulse {
  background: #D4AF37;
}

/* Daylight Paper Clarity on Workbench below Header Deck */
html[data-design="design2"] .app-container {
  padding-top: 1.5rem;
}

html[data-design="design2"] .card-3zone {
  border: 1px solid #E5E1D5;
  background: #FFFFFF;
  box-shadow: 0 4px 16px rgba(11, 25, 44, 0.05);
}

html[data-design="design2"] .btn-primary {
  background: #0F5132;
  color: #FFFFFF;
}
html[data-design="design2"] .btn-primary:hover {
  background: #0A3622;
}


/* ==========================================================================
   PARADIGM 3: APPLE CARD / WISE SPATIAL BENTO & EMERALD GIS STUDIO
   data-design="design3"
   ========================================================================== */
html[data-design="design3"] {
  --bg-page: #F1F3F2; /* Warm Titanium & Stone Bento */
  --bg-canvas: #F1F3F2;
  --surface-base: #FFFFFF;
  --surface-card: #FFFFFF;
  --surface-card-hover: #F8F9F8;
  --surface-elevated: #E5E7E5;
  --surface-input: #FAFBFA;

  --text-primary: #090D16; /* Deep Obsidian Ink */
  --text-secondary: #374151;
  --text-muted: #6B7280;

  --brand-primary: #05603A; /* Signature Botanical Emerald */
  --brand-primary-hover: #03482B;
  --brand-primary-soft: rgba(5, 96, 58, 0.08);
  --brand-primary-border: rgba(5, 96, 58, 0.25);

  --accent-amber: #B45309; /* Warm Amber-Bronze */
  --accent-amber-soft: rgba(180, 83, 9, 0.08);

  --border-subtle: #E5E7EB;
  --border-strong: #D1D5DB;
  --border-input: #D1D5DB;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 16px;

  --shadow-card: 0 4px 20px -2px rgba(9, 13, 22, 0.06), 0 1px 3px rgba(9, 13, 22, 0.04);
  --shadow-elevated: 0 12px 30px -4px rgba(9, 13, 22, 0.09), 0 4px 8px -2px rgba(9, 13, 22, 0.04);
}

html[data-design="design3"] body {
  background: #F1F3F2;
}

html[data-design="design3"] .executive-command-deck {
  background: transparent;
}

html[data-design="design3"] .topbar-main {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
}

html[data-design="design3"] .brand-title {
  color: #090D16;
  font-weight: 800;
  letter-spacing: -0.02em;
}

html[data-design="design3"] .brand-icon {
  background: #05603A;
  color: #FFFFFF;
  border-radius: 8px;
}

html[data-design="design3"] .main-nav-bar {
  background: transparent;
  border-bottom: none;
  padding: 0.5rem 1.25rem;
}

html[data-design="design3"] .nav-tabs {
  background: #E5E7EB;
  padding: 4px;
  border-radius: 9999px;
  border: none;
}

html[data-design="design3"] .nav-tab-btn {
  border-radius: 9999px;
  color: #4B5563;
  font-weight: 600;
}

html[data-design="design3"] .nav-tab-btn.active {
  background: #FFFFFF;
  color: #090D16;
  box-shadow: 0 2px 8px rgba(9, 13, 22, 0.08);
}

html[data-design="design3"] .card-3zone,
html[data-design="design3"] .telemetry-card,
html[data-design="design3"] .deal-card {
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 20px -2px rgba(9, 13, 22, 0.06), 0 1px 3px rgba(9, 13, 22, 0.04);
}

html[data-design="design3"] .btn {
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

html[data-design="design3"] .btn-primary {
  background: #05603A;
  color: #FFFFFF;
}
html[data-design="design3"] .btn-primary:hover {
  background: #03482B;
}

html[data-design="design3"] .number-tabular,
html[data-design="design3"] .kpi-value-huge,
html[data-design="design3"] .telemetry-val {
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Paradigm Dark Mode Theme Harmonizer (Bug F8 & ADR-030)
   Enforces distinct dark canvas, card surfaces, and accents across all 3 designs
   ========================================================================== */
html[data-theme="dark"],
html[data-theme="dark"][data-design="design2"] {
  --accent-primary: #10b981;
  --accent-secondary: #d4af37;
  --bg-surface: oklch(0.145 0.018 168);
  --bg-page: oklch(0.125 0.016 168);
  --bg-canvas: oklch(0.125 0.016 168);
  --surface-base: oklch(0.145 0.018 168);
  --surface-card: oklch(0.175 0.020 168);
  --surface-card-hover: oklch(0.205 0.022 168);
  --surface-elevated: oklch(0.205 0.022 168);
  --surface-input: oklch(0.155 0.018 168);
  --text-primary: oklch(0.965 0.010 168);
  --text-secondary: oklch(0.820 0.015 168);
  --text-muted: oklch(0.660 0.016 168);
  --border-subtle: rgba(52, 211, 153, 0.22);
  --border-strong: rgba(52, 211, 153, 0.35);
  --border-input: rgba(52, 211, 153, 0.25);
  --brand-primary: #34d399;
}

html[data-theme="dark"][data-design="design1"] {
  --accent-primary: #3b82f6;
  --accent-secondary: #6366f1;
  --bg-surface: #0b132b;
  --bg-page: #070d1f;
  --bg-canvas: #070d1f;
  --surface-base: #0b132b;
  --surface-card: #111c3d;
  --surface-card-hover: #172554;
  --surface-elevated: #1e293b;
  --surface-input: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-subtle: rgba(59, 130, 246, 0.26);
  --border-strong: rgba(99, 102, 241, 0.42);
  --border-input: rgba(59, 130, 246, 0.30);
  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-primary-soft: rgba(59, 130, 246, 0.16);
}

html[data-theme="dark"][data-design="design3"] {
  --accent-primary: #14b8a6;
  --accent-secondary: #38bdf8;
  --bg-surface: #0f172a;
  --bg-page: #09101d;
  --bg-canvas: #09101d;
  --surface-base: #0f172a;
  --surface-card: #132038;
  --surface-card-hover: #1a2c4b;
  --surface-elevated: #1e293b;
  --surface-input: #0f172a;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-subtle: rgba(20, 184, 166, 0.26);
  --border-strong: rgba(56, 189, 248, 0.40);
  --border-input: rgba(20, 184, 166, 0.30);
  --brand-primary: #14b8a6;
  --brand-primary-hover: #2dd4bf;
  --brand-primary-soft: rgba(20, 184, 166, 0.16);
}

html[data-theme="dark"] body,
html[data-theme="dark"][data-design="design1"] body,
html[data-theme="dark"][data-design="design2"] body,
html[data-theme="dark"][data-design="design3"] body {
  background: var(--bg-page) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"][data-design="design1"] .topbar-main,
html[data-theme="dark"][data-design="design2"] .topbar-main,
html[data-theme="dark"][data-design="design3"] .topbar-main {
  background: var(--surface-base) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}

html[data-theme="dark"][data-design="design1"] .brand-title,
html[data-theme="dark"][data-design="design2"] .brand-title,
html[data-theme="dark"][data-design="design3"] .brand-title {
  color: var(--text-primary) !important;
}

html[data-theme="dark"][data-design="design1"] .brand-subtitle,
html[data-theme="dark"][data-design="design2"] .brand-subtitle,
html[data-theme="dark"][data-design="design3"] .brand-subtitle {
  color: var(--text-muted) !important;
}

html[data-theme="dark"][data-design="design1"] .nav-tab-btn.active,
html[data-theme="dark"][data-design="design2"] .nav-tab-btn.active,
html[data-theme="dark"][data-design="design3"] .nav-tab-btn.active {
  background: var(--surface-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
}

html[data-theme="dark"] .card-3zone,
html[data-theme="dark"] .telemetry-card,
html[data-theme="dark"] .deal-card {
  background: var(--surface-card) !important;
  border-color: var(--border-subtle) !important;
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .executive-telemetry-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
  .cadastral-action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .executive-telemetry-ribbon {
    grid-template-columns: 1fr;
  }
  .telemetry-ribbon-wrapper {
    padding: 0.5rem 0.75rem 0 0.75rem;
  }

  /* Item 2: Mobile 390x844 Topbar & Persona Bar Clean Fit */
  .topbar,
  .topbar-main {
    padding: 0.5rem 0.75rem !important;
    min-height: 52px !important;
    max-height: 56px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .topbar-center,
  .design-paradigm-pill-group,
  .design-switcher-pills,
  .paradigm-pill-group {
    display: none !important;
  }
  .topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  .topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    flex-shrink: 0 !important;
  }
  .badge-institutional {
    display: none !important;
  }

  /* Persona Switcher 2x2 Grid on Mobile without horizontal overflow or clipping (ADR-030) */
  .persona-switcher-bar-container {
    padding: 0 0.625rem !important;
    margin: 0.2rem auto !important;
  }
  .persona-switcher-pill-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.25rem !important;
    padding: 0.35rem 0.45rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .persona-switcher-label {
    display: none !important;
  }
  .persona-switcher,
  .persona-pill-group,
  .persona-pills {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    overflow: visible !important;
    width: 100% !important;
    padding-bottom: 0 !important;
  }
  .persona-pill-btn {
    width: 100% !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.6875rem !important;
    padding: 0.25rem 0.35rem !important;
    min-height: 28px !important;
    box-sizing: border-box !important;
  }
}



/* Precision Fixes: Pill Contrast & Score Gauge */
html[data-design="design1"] .topbar-main .status-pill.badge-subtle,
html[data-design="design3"] .topbar-main .status-pill.badge-subtle,
[data-theme="light"] .topbar-main .status-pill.badge-subtle {
  background: #F1F5F9 !important;
  color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
}

html[data-design="design2"] .topbar .brand-title,
html[data-design="design2"] .topbar-main .brand-title,
html[data-design="design2"] .brand-title {
  color: #F8FAFC !important;
}

html[data-design="design2"] .topbar-main .status-pill.badge-subtle {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #E2E8F0 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.score-gauge-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
}

.score-gauge-num {
  font-size: 1.3125rem !important;
  font-weight: 800 !important;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1;
}

.score-gauge-max {
  font-size: 0.625rem !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.04em;
  margin-top: 2px;
}



/* ==========================================================================
   2026 INSTITUTIONAL PROPTECH & PRIVATE CREDIT SHOWCASE MEDIA UPGRADES
   ========================================================================== */

/* 1. Bespoke Institutional SVG Crest Logo */
.brand-icon {
  width: 42px !important;
  height: 42px !important;
  background: transparent !important;
  color: inherit !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.brand-crest-svg {
  width: 42px;
  height: 42px;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.28));
}
.badge-private-credit {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.15);
  color: #B45309;
  border: 1px solid rgba(212, 175, 55, 0.35);
  white-space: nowrap;
}
.badge-institutional {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}
html[data-design="design2"] .badge-private-credit {
  background: rgba(212, 175, 55, 0.2);
  color: #F5DE82;
  border-color: rgba(212, 175, 55, 0.45);
}
html[data-design="design2"] .badge-institutional {
  background: rgba(52, 211, 153, 0.18);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.4);
}

/* 2. Official Institutional & Regulatory Partner Trust Strip */
.partner-trust-strip-container {
  max-width: 1440px;
  margin: 0 auto 0.75rem auto;
  padding: 0 1.25rem;
  width: 100%;
}
.partner-trust-strip {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.875rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.trust-strip-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.trust-partners-list {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.875rem;
  flex-wrap: wrap;
}
.trust-partner-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.trust-partner-item:hover {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
}
.trust-partner-icon {
  color: var(--brand-primary);
  flex-shrink: 0;
}
.partner-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary-border);
}

html[data-design="design1"] .partner-trust-strip {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}
html[data-design="design2"] .partner-trust-strip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  backdrop-filter: blur(8px);
}
html[data-design="design2"] .trust-strip-label {
  color: rgba(255, 255, 255, 0.65);
}
html[data-design="design2"] .trust-partner-item {
  color: #E2E8F0;
}
html[data-design="design2"] .trust-partner-icon {
  color: #D4AF37;
}
html[data-design="design2"] .partner-badge {
  background: rgba(212, 175, 55, 0.15);
  color: #F5DE82;
  border-color: rgba(212, 175, 55, 0.35);
}
html[data-design="design3"] .partner-trust-strip {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 9999px;
  padding: 0.4rem 1.25rem;
}

/* 3. Live AI Deed Optical Scanner Viewport */
.ai-deed-scanner-card {
  margin-bottom: 0.875rem;
}
.deed-scanner-viewport {
  position: relative;
  width: 100%;
  height: 142px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #090D16;
  margin-bottom: 0.625rem;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.45);
}
.deed-scanner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  display: block;
}
.scanner-cadastral-hud-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.scanner-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(16,185,129,0) 0%, rgba(52,211,153,0.95) 50%, rgba(16,185,129,0) 100%);
  box-shadow: 0 0 8px #34D399, 0 0 16px #10B981;
  top: 45%;
  pointer-events: none;
  animation: scanLaserAnim 3.5s ease-in-out infinite alternate;
  z-index: 2;
}
@keyframes scanLaserAnim {
  0% { top: 12%; opacity: 0.6; }
  100% { top: 88%; opacity: 0.95; }
}
.scanner-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,17,32,0.65) 0%, rgba(7,17,32,0.1) 45%, rgba(7,17,32,0.75) 100%);
  pointer-events: none;
  z-index: 1;
}
.scanner-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(7, 17, 32, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.6875rem;
  font-weight: 700;
  z-index: 3;
  line-height: 1.3;
}
.scanner-pill-tl {
  top: 8px;
  left: 8px;
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.scanner-pill-tr {
  top: 8px;
  right: 8px;
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--font-mono);
}
@media (max-width: 768px) {
  /* Item 4 (ADR-030): Mobile AI Deed Scanner HUD Badge Wrapping without ellipsis */
  .deed-scanner-viewport {
    min-height: 175px !important;
  }
  .cadastral-scanner-hud,
  .scanner-hud-top,
  .scanner-pill,
  .scanner-pill-tl,
  .scanner-pill-tr {
    font-size: 0.70rem !important;
    padding: 3px 8px !important;
    white-space: normal !important;
    max-width: calc(100% - 16px) !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.25 !important;
  }
  .scanner-pill-tl {
    top: 6px !important;
    left: 8px !important;
  }
  .scanner-pill-tr {
    top: 32px !important;
    left: 8px !important;
    right: auto !important;
  }
  .scanner-pill-tr span {
    display: inline !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
  }
  .scanner-hud-meta {
    display: none !important;
  }
}
.scanner-pill-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(7, 17, 32, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.6875rem;
  color: #F1F5F9;
  z-index: 3;
}
.scanner-telemetry-text {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .scanner-pill-bottom,
  .scanner-hud-bottom {
    font-size: 0.70rem !important;
    padding: 4px 8px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
  }
  .scanner-telemetry-text {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 5px !important;
  }
  .scanner-telemetry-text span,
  #scanner-detected-title {
    display: inline !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }
  #scanner-status-tag {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    font-size: 0.625rem !important;
    padding: 1px 6px !important;
    white-space: nowrap !important;
  }
}

/* 4. Visual Asset Class Selector Pills */
.asset-selector-pills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.asset-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}
.asset-pill-btn:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-soft);
  color: var(--text-primary);
}
.asset-pill-btn.active {
  background: var(--brand-primary-soft);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--brand-primary-soft);
}
.asset-pill-icon {
  flex-shrink: 0;
  color: var(--brand-primary);
}
.asset-pill-btn.active .asset-pill-icon {
  color: var(--brand-primary);
}
.pill-text-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pill-title {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}
.pill-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.2;
}
.asset-pill-btn.active .pill-sub {
  color: var(--brand-primary);
}

/* 5. Two-Check Split Cashier's Check Preview */
.two-check-split-preview-card {
  margin: 1.25rem 0 1rem 0;
  padding: 0.875rem 1rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.two-check-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.two-check-title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
}
.checks-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.bank-check-card {
  position: relative;
  background: #FCFDFE;
  border: 1.5px dashed #CBD5E1;
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}
[data-theme="dark"] .bank-check-card,
html[data-design="design2"] .bank-check-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.18);
}
.bank-check-card.check-borrower {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(255, 255, 255, 0.95) 100%);
}
[data-theme="dark"] .bank-check-card.check-borrower,
html[data-design="design2"] .bank-check-card.check-borrower {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.bank-check-card.check-platform {
  border-color: rgba(212, 175, 55, 0.45);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.04) 0%, rgba(255, 255, 255, 0.95) 100%);
}
[data-theme="dark"] .bank-check-card.check-platform,
html[data-design="design2"] .bank-check-card.check-platform {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.check-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px dotted var(--border-subtle);
  padding-bottom: 0.25rem;
}
.check-bank-name {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
}
.check-type-badge {
  font-size: 0.5625rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.check-type-badge.badge-subtle {
  background: rgba(212, 175, 55, 0.15);
  color: #B45309;
  border-color: rgba(212, 175, 55, 0.3);
}
.check-body-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.check-payee-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.check-stamp {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #047857;
  display: inline-block;
  border: 1px solid #047857;
  padding: 0 4px;
  border-radius: 2px;
  width: fit-content;
}
.check-stamp.stamp-gold {
  color: #B45309;
  border-color: #B45309;
}
.check-payee-name {
  font-size: 0.75rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.check-desc-note {
  font-size: 0.625rem;
  color: var(--text-muted);
}
.check-amount-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}
.check-cur {
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--text-muted);
}
.check-amount-val {
  font-size: 1rem;
  font-weight: 800;
  color: #047857;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
.check-amount-val.gold {
  color: #B45309;
  font-size: 0.875rem;
}
html[data-design="design2"] .check-amount-val {
  color: #34D399;
}
html[data-design="design2"] .check-amount-val.gold {
  color: #F5DE82;
}
.check-sub-status {
  font-size: 0.5625rem;
  color: var(--text-muted);
}
.check-footer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dotted var(--border-subtle);
  padding-top: 0.25rem;
  font-size: 0.5625rem;
  color: var(--text-muted);
}
.check-micr {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  opacity: 0.75;
}

/* 6. VIP Deal Room Real High-Res Photography */
.deal-map-preview {
  position: relative;
  overflow: hidden;
  height: 185px !important;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
}
.deal-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.deal-card:hover .deal-photo-img {
  transform: scale(1.035);
}
.deal-photo-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,13,22,0.55) 0%, rgba(9,13,22,0.05) 45%, rgba(9,13,22,0.72) 100%);
  pointer-events: none;
  z-index: 1;
}
.deal-map-preview .photo-badge {
  position: absolute;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
  line-height: 1.3;
  max-width: 56%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-map-preview .photo-badge.top-left {
  top: 8px;
  left: 8px;
  border-color: rgba(16, 185, 129, 0.35);
}
.deal-map-preview .photo-badge.top-right {
  top: 8px;
  right: 8px;
  border-color: rgba(212, 175, 55, 0.4);
  color: #F8FAFC;
  font-family: var(--font-mono);
}
.deal-map-preview .photo-badge.bottom-left {
  bottom: 8px;
  left: 8px;
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(9, 13, 22, 0.85);
}
.deal-map-preview .photo-badge.bottom-right {
  bottom: 8px;
  right: 8px;
  font-size: 0.625rem;
  color: #34D399;
  background: rgba(9, 13, 22, 0.85);
  border-color: rgba(52, 211, 153, 0.35);
}

.mobile-kpi-drawer-btn {
  display: none;
}

@media (max-width: 768px) {
  .badge-institutional,
  .partner-trust-strip {
    display: none !important;
  }
  .executive-command-deck {
    padding-bottom: 0.35rem !important;
  }
  .telemetry-ribbon-wrapper {
    padding: 0.15rem 0.625rem 0.25rem 0.625rem !important;
  }
  .mobile-kpi-drawer-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    background: rgba(6, 24, 18, 0.82);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #F8FAFC;
    font-size: 0.64rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
  }
  .mobile-kpi-drawer-btn #mobile-kpi-caret {
    color: #34D399;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .kpi-ribbon,
  .kpi-grid,
  .executive-telemetry-ribbon {
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    margin-top: 0.45rem !important;
    margin-bottom: 0.45rem !important;
  }
  .kpi-grid.kpi-drawer-open,
  .executive-telemetry-ribbon.kpi-drawer-open,
  .kpi-drawer-open .executive-telemetry-ribbon {
    display: grid !important;
  }
  .kpi-ribbon .kpi-card,
  .executive-telemetry-ribbon .telemetry-card {
    padding: 0.55rem 0.65rem !important;
    min-height: 0 !important;
  }
  .kpi-ribbon .kpi-value,
  .executive-telemetry-ribbon .telemetry-val {
    font-size: 1.125rem !important;
  }
  .kpi-ribbon .kpi-sparkline,
  .kpi-ribbon .kpi-subtext,
  .kpi-ribbon .kpi-progress-track,
  .executive-telemetry-ribbon .telemetry-sparkline,
  .executive-telemetry-ribbon .telemetry-sub,
  .executive-telemetry-ribbon .telemetry-progress-track {
    display: none !important;
  }
  .asset-selector-pills-grid {
    grid-template-columns: 1fr 1fr;
  }
  .checks-grid-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Teedin V8.15 Visual GIS & Cadastral Intelligence Extensions (2026)
   ========================================================================== */

/* 1. 2D SVG Cadastral Plot Blueprint Studio */
.cadastral-blueprint-studio {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.blueprint-deal-selector {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  align-items: center;
}
.blueprint-deal-pill {
  font-size: 0.6875rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.blueprint-deal-pill:hover,
.blueprint-deal-pill.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 700;
}
.blueprint-svg-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.blueprint-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 250px;
}
.bp-canvas { fill: #0b1320; }
.bp-grid-line { stroke: rgba(255, 255, 255, 0.05); stroke-width: 0.75; }
.bp-sun-arc { fill: none; stroke: #F59E0B; stroke-width: 1.5; stroke-dasharray: 4 3; opacity: 0.85; }
.bp-sun-dot { fill: #F59E0B; }
.bp-sun-dot--pm { fill: #EF4444; }
.bp-wind { stroke-width: 1.5; stroke-linecap: round; }
.bp-wind--sw { stroke: #10B981; }
.bp-wind--ne { stroke: #38BDF8; }
.bp-wind-head--sw { fill: #10B981; }
.bp-wind-head--ne { fill: #38BDF8; }
.bp-compass__ring { fill: #111827; stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; }
.bp-compass__txt { fill: #E5E7EB; font-family: var(--font-sans); font-size: 8.5px; font-weight: 700; }
.bp-plot { fill: rgba(16, 185, 129, 0.22); stroke: #10B981; stroke-width: 2; stroke-linejoin: round; }
.bp-setback { fill: rgba(245, 158, 11, 0.12); stroke: #F59E0B; stroke-width: 1.25; stroke-dasharray: 4 2.5; }
.bp-frontage { stroke: #38BDF8; stroke-width: 3.5; stroke-linecap: round; }
.bp-road { fill: #1F2937; stroke: rgba(255, 255, 255, 0.15); stroke-width: 0.8; }
.bp-road__txt { fill: #9CA3AF; font-size: 8px; font-weight: 600; font-family: var(--font-sans); }
.bp-label-bg { fill: rgba(17, 24, 39, 0.94); stroke: rgba(255, 255, 255, 0.22); stroke-width: 0.8; }
.bp-dim { fill: #F9FAFB !important; font-size: 10px; font-weight: 700; font-family: var(--font-sans); }
.bp-sub { fill: #D1D5DB !important; font-size: 8px; font-weight: 600; font-family: var(--font-sans); }
.bp-tag { fill: #9CA3AF; font-size: 7.5px; font-weight: 600; font-family: var(--font-sans); }
.bp-tag--sun { fill: #F59E0B; }
.bp-tag--sun-pm { fill: #F87171; }
.bp-tag--sw { fill: #34D399; }
.bp-tag--ne { fill: #38BDF8; }
.bp-pin-marker { fill: #EF4444; stroke: #FFFFFF; stroke-width: 1.2; }
.bp-pin-tag { fill: #F9FAFB; font-size: 7px; font-weight: 700; font-family: var(--font-mono); }

/* 3-Point DEM Elevation Bar */
.dem-elevation-studio {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
}
.dem-elevation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.dem-elevation-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.2fr;
  align-items: center;
  gap: 0.375rem;
}
.dem-step-tile {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.dem-step-tile.is-plot {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}
.dem-step-name {
  font-size: 0.625rem;
  color: var(--text-muted);
}
.dem-step-val {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.dem-step-tile.is-plot .dem-step-val {
  color: var(--brand-primary);
}
.dem-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* 2. Interactive Cadastral GIS & Hazard Radar Viewport */
.cadastral-radar-card {
  width: 100%;
}
.radar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.radar-layer-pills {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  align-items: center;
}
.radar-layer-pill {
  font-size: 0.6875rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-base);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.radar-layer-pill:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
}
.radar-layer-pill.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 700;
}
.radar-viewport-container {
  position: relative;
  width: 100%;
  height: 380px;
  background: #060a12;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.radar-viewport-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.radar-hud-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(11, 19, 32, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  z-index: 10;
}
.radar-hud-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.radar-hud-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--brand-primary);
}

/* 3. Deal Card Cadastral Footprint & External Verification Bar (Tab 3) */
.deal-cadastral-footprint-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(9, 13, 22, 0.88);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-xs);
  padding: 0.2rem 0.45rem;
  font-size: 0.625rem;
  color: #34D399;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  z-index: 2;
}
.deal-ext-verify-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-subtle);
}
.deal-ext-verify-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.35rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.deal-ext-verify-link:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* 4. DBD Corporate Intel Vault Status Bar (Tab 2) */
.corp-intel-vault-bar {
  background: var(--surface-base);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
}
.corp-intel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.corp-intel-chips {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

/* 5. LED Government Auction NPA 4-Round EV Grid (Tab 4) */
.led-auction-ev-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.375rem;
  margin-top: 0.5rem;
}
.led-lot-tile {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.led-lot-tile.is-recommended {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.08);
}
.led-lot-title {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.led-lot-price {
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--brand-primary);
}
.led-lot-prob {
  font-size: 0.5625rem;
  color: var(--text-muted);
}
.led-lot-note {
  font-size: 0.5625rem;
  color: var(--accent-gold);
  line-height: 1.2;
}

@media (max-width: 768px) {
  .dem-elevation-steps {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .dem-arrow {
    display: none;
  }
  .radar-viewport-container {
    height: 280px;
  }
  .led-auction-ev-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .deal-ext-verify-bar {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   SEO & GEO Authority Command Center (2026 Engine 3+ / ADR-019)
   ============================================================================ */
.seo-geo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
}
.seo-kpi-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.seo-kpi-card:hover {
  border-color: var(--brand-primary);
}
.seo-kpi-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.8125rem;
}
.seo-kpi-list li {
  line-height: 1.4;
  color: var(--text-secondary);
}
.seo-corridors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.seo-corridor-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.seo-corridor-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.12);
  transform: translateY(-2px);
}
.seo-corridor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}
.seo-corridor-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}
.seo-corridor-office {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 0.625rem;
}
.seo-corridor-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
  margin-bottom: 0.625rem;
  padding: 0.375rem;
  background: var(--surface-card);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}
.seo-corridor-metric-item {
  display: flex;
  flex-direction: column;
}
.seo-corridor-metric-label {
  font-size: 0.5625rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.seo-corridor-metric-value {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--brand-primary);
}
.seo-corridor-actions {
  margin-top: auto;
  display: flex;
  gap: 0.375rem;
  padding-top: 0.625rem;
  border-top: 1px dashed var(--border-subtle);
}
.seo-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.seo-faq-item {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  overflow: hidden;
}
.seo-faq-item[open] {
  border-color: var(--brand-primary);
  background: var(--surface-card);
}
.seo-faq-summary {
  padding: 0.75rem 1rem;
  font-size: 0.84375rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
}
.seo-faq-summary::-webkit-details-marker {
  display: none;
}
.seo-faq-summary::after {
  content: '▼';
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  margin-left: 0.5rem;
}
.seo-faq-item[open] .seo-faq-summary::after {
  transform: rotate(180deg);
  color: var(--brand-primary);
}
.seo-faq-body {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
  border-top: 1px dashed var(--border-subtle);
}
.seo-provenance-badge {
  white-space: normal;
  max-width: 100%;
  line-height: 1.35;
  text-align: left;
}
@media (max-width: 1100px) {
  .seo-corridors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .seo-provenance-badge {
    font-size: 0.6875rem;
    padding: 0.35rem 0.5rem;
  }
  .seo-geo-kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }
  .seo-corridors-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .seo-corridor-actions {
    flex-direction: column;
  }
  .seo-corridor-actions button,
  .seo-corridor-actions a {
    width: 100%;
    text-align: center;
  }
  .geo-chip-btn {
    white-space: normal;
    word-break: break-word;
    text-align: left;
    max-width: 100%;
  }
}

/* ============================================================================
   Interactive GEO Research Lab, Competitor Matrix & Case Studies (ADR-019)
   ============================================================================ */
.seo-module-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

/* Module A: Princeton GEO Lab */
.geo-princeton-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.geo-lift-pill {
  font-size: 0.71875rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
  line-height: 1.25;
  border: 1px solid var(--border-subtle);
}
.geo-lift-pill.lift-stat {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #065f46;
}
[data-theme="dark"] .geo-lift-pill.lift-stat {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
  color: #34d399;
}
.geo-lift-pill.lift-cite,
.geo-lift-pill.lift-legal {
  background: rgba(30, 64, 175, 0.08);
  border-color: rgba(30, 64, 175, 0.25);
  color: #1e40af;
}
[data-theme="dark"] .geo-lift-pill.lift-cite,
[data-theme="dark"] .geo-lift-pill.lift-legal {
  background: rgba(30, 64, 175, 0.2);
  border-color: rgba(96, 165, 250, 0.35);
  color: #60a5fa;
}
.geo-lift-pill.lift-ans {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: #3730a3;
}
[data-theme="dark"] .geo-lift-pill.lift-ans {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(165, 180, 252, 0.35);
  color: #a5b4fc;
}
.geo-lift-pill.lift-pen {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}
[data-theme="dark"] .geo-lift-pill.lift-pen {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.35);
  color: #f87171;
}

.geo-chip-btn {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.55rem;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.geo-chip-btn:hover {
  background: var(--surface-input);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.geo-chip-btn.chip-danger:hover {
  border-color: var(--border-danger);
  color: var(--status-danger);
}

.geo-intent-output-box {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
  box-sizing: border-box;
}
.geo-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px dashed var(--border-subtle);
  max-width: 100%;
  box-sizing: border-box;
}
.geo-meta-strip .badge {
  white-space: normal;
  max-width: 100%;
  line-height: 1.35;
  word-break: break-word;
}
.geo-snippet-box {
  background: var(--surface-base);
  border-left: 3px solid var(--brand-primary);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
.geo-action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.71875rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
  gap: 0.375rem;
  max-width: 100%;
  box-sizing: border-box;
}
.geo-snippet-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  font-size: 0.71875rem;
  color: var(--text-secondary);
  background: var(--surface-base);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Module B: Competitor Gap Table & Negative Shield */
.seo-table-container {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
}
.seo-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: left;
}
.seo-compare-table th,
.seo-compare-table td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  line-height: 1.4;
}
.seo-compare-table thead th {
  background: var(--surface-card);
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-subtle);
  font-size: 0.71875rem;
}
.seo-compare-table tbody tr:last-child td {
  border-bottom: none;
}
.seo-compare-table th.col-highlight,
.seo-compare-table td.col-highlight {
  background: rgba(15, 118, 110, 0.05);
  border-left: 1px solid rgba(15, 118, 110, 0.2);
  border-right: 1px solid rgba(15, 118, 110, 0.2);
}
[data-theme="dark"] .seo-compare-table th.col-highlight,
[data-theme="dark"] .seo-compare-table td.col-highlight {
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.25);
}

.negative-shield-strip {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
}
.negative-shield-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
}
.negative-group-box {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.625rem;
}
.negative-group-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}
.negative-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.neg-tag {
  font-size: 0.625rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  background: rgba(239, 68, 68, 0.08);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  white-space: nowrap;
}

/* Module C: Case Studies */
.seo-case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}
.seo-case-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.seo-case-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}
.seo-case-card .card-zone-body {
  flex: 1 1 auto;
}
.seo-case-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

@media (max-width: 1024px) {
  .negative-shield-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .seo-case-grid {
    grid-template-columns: 1fr;
  }
  .negative-shield-grid {
    grid-template-columns: 1fr;
  }
  .geo-meta-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .geo-meta-strip > div {
    width: 100%;
  }
  .geo-action-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .geo-action-footer button {
    width: 100%;
    white-space: normal;
    text-align: center;
    padding: 0.4rem 0.5rem;
  }
}

/* ==========================================================================
   EXCLUSIVE MOBILE BOTTOM THUMB NAVIGATION (Rule 14 & ADR-027)
   ========================================================================== */
.bottom-thumb-nav {
  display: none;
}

@media (max-width: 768px) {
  .main-nav-bar,
  .tab-nav {
    display: none !important;
  }
  .bottom-thumb-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface-card, #ffffff);
    border-top: 1px solid var(--border-subtle, #e2e8f0);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  }
  .bottom-thumb-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted, #64748b);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: all 0.15s ease-in-out;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-thumb-btn.active {
    color: var(--brand-primary, #0f5132);
    font-weight: 700;
  }
  .bottom-thumb-btn .thumb-icon {
    width: 20px;
    height: 20px;
  }
  .bottom-thumb-btn.active .thumb-icon {
    stroke-width: 2.25;
  }
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}

[data-theme="dark"] .bottom-thumb-nav {
  background: var(--surface-card, #111e2e);
  border-top-color: var(--border-subtle, #1e293b);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .bottom-thumb-btn {
  color: var(--text-muted, #94a3b8);
}
[data-theme="dark"] .bottom-thumb-btn.active {
  color: #34d399;
}

/* ==========================================================================
   ADR-028: GTM Lead-Magnet & Partner Attribution Workbench (pixel-perfect)
   ========================================================================== */
.gtm-result-box {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  transition: all 0.2s ease-in-out;
}
.gtm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.gtm-stat-pill {
  padding: 0.45rem 0.625rem;
  border-radius: var(--radius-xs);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}
.gtm-pitch-box {
  width: 100%;
  min-height: 80px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-primary);
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   ADR-030: Sovereign UX/UI Polish, Modal Suppression & Accessibility
   ========================================================================== */
body:has(.modal-overlay.active) .bottom-thumb-nav,
body:has(.modal-backdrop.active) .bottom-thumb-nav,
body:has(dialog[open]) .bottom-thumb-nav {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent-primary, var(--brand-primary, #10b981)) !important;
  outline-offset: 2px !important;
}

#nas-deploy-readiness-banner,
#nas-deploy-readiness-banner .badge,
.cloud-run-status-banner,
.executive-pdf-hub-strip {
  white-space: normal !important;
  flex-wrap: wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .executive-pdf-btn-group {
    width: 100%;
  }
  .executive-pdf-btn-group .pdf-hub-btn {
    width: 100%;
    justify-content: center;
    white-space: normal !important;
    text-align: center;
  }
}

html[data-theme="dark"][data-design="design1"] .btn-primary {
  background: var(--accent-primary, #3b82f6) !important;
  border-color: var(--accent-secondary, #6366f1) !important;
  color: #ffffff !important;
}

html[data-theme="dark"][data-design="design3"] .btn-primary {
  background: var(--accent-primary, #14b8a6) !important;
  border-color: var(--accent-secondary, #38bdf8) !important;
  color: #ffffff !important;
}
