/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
  /* Base — monochrome palette used everywhere during intake */
  --bg:       #F2F0EF;
  --surface:  #FFFFFF;
  --border:   #D8D2CC;
  --text:     #1C1917;
  --text-2:   #6D6863;
  --text-3:   #8E8782;
  --accent:   #1C1917;

  /* Gold — result header accent */
  --gold:        #B88734;
  --gold-bg:     #F7EFE1;
  --gold-border: #DFC8A2;

  /* Functional — used ONLY on result states */
  --green:        #0E9A73;
  --green-bg:     #EAF8F3;
  --green-border: #A8E3CF;
  --red:          #D14B4B;
  --red-bg:       #FCEFEF;
  --red-border:   #F2B8B8;
  --amber:        #C98E2D;
  --amber-bg:     #FBF4E8;
  --amber-border: #EBCD9B;
  --blue:         #3B82F6;
  --blue-bg:      #EFF6FF;
  --blue-border:  #BFDBFE;

  /* Structure */
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05);
  --sidebar-w: 240px;
}

/* ── Base ── */
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════
   LOGIN / SIGNUP / WORKSPACE SCREENS
═══════════════════════════════════════════════ */
#signup-screen, #workspace-screen, #invite-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

/* Usage bar in sidebar */
.usage-bar {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.usage-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.usage-fill.warning { background: #F59E0B; }
.usage-fill.danger  { background: #EF4444; }

.usage-upgrade-link {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.usage-upgrade-link:hover {
  color: var(--text);
}

/* ═══════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════ */
.screen { width: 100%; height: 100vh; }

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow-y: auto;
  padding: 24px;
}

/* ── Split layout ── */
.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.auth-standalone {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-back-link {
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--text);
}

.auth-brand {
  flex: 1;
  background: #171717;
  color: #F5F3EE;
  display: flex;
  flex-direction: column;
  padding: 48px 56px;
  justify-content: flex-start;
  gap: 20px;
  overflow-y: auto;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #F5F3EE;
}

.auth-brand-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 40px 0;
}

.auth-brand-left {
  flex: 1;
  min-width: 0;
}

.auth-brand-right {
  flex-shrink: 0;
  width: 260px;
}

.auth-brand-eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 20px;
}

.auth-brand-headline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #F5F3EE;
  margin-bottom: 20px;
}

.auth-brand-sub {
  font-size: 14px;
  color: rgba(245,243,238,0.5);
  line-height: 1.7;
  margin-bottom: 32px;
}

.auth-onboarding {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 28px;
}

.auth-onboarding-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: rgba(245,243,238,0.7);
  border: 1px solid rgba(245,243,238,0.15);
  border-radius: 999px;
  padding: 6px 10px;
}

.auth-onboarding-num {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(245,243,238,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #F5F3EE;
  flex-shrink: 0;
}

/* Stats strip */
.auth-brand-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}
.auth-brand-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.auth-stat-num {
  font-size: 20px;
  font-weight: 600;
  color: #F5F3EE;
  letter-spacing: -0.02em;
}
.auth-stat-label {
  font-size: 11px;
  color: rgba(245,243,238,0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-brand-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(245,243,238,0.1);
}

/* ── Product mockup card ── */
.lp-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-top: 2px solid var(--gold);
  border-radius: 10px;
  padding: 18px;
  transform: rotate(1.5deg);
  box-shadow: 0 24px 48px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
}
.lp-card-label {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(245,243,238,0.35);
  margin-bottom: 6px;
}
.lp-card-visa {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: #F5F3EE;
  line-height: 1.1;
  margin-bottom: 14px;
}
.lp-card-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.lp-score {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  min-width: 48px;
  text-align: center;
}
.lp-score-green { color: #6EE7B7; }
.lp-score-right { flex: 1; }
.lp-score-label { font-size: 10px; color: rgba(245,243,238,0.35); margin-bottom: 6px; }
.lp-score-sub   { color: rgba(245,243,238,0.2); }
.lp-score-track { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.lp-score-fill  { height: 100%; background: linear-gradient(90deg, #059669, #6EE7B7); border-radius: 2px; }
.lp-checks {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 12px;
  border-radius: 6px;
  overflow: hidden;
}
.lp-check {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.35;
  background: rgba(255,255,255,0.02);
}
.lp-ci { font-size: 10px; font-weight: 700; flex-shrink: 0; width: 11px; text-align: center; }
.lp-pass   { color: rgba(245,243,238,0.55); }
.lp-pass .lp-ci   { color: #6EE7B7; }
.lp-fail   { color: #FCA5A5; background: rgba(239,68,68,0.06); }
.lp-fail .lp-ci   { color: #EF4444; }
.lp-unknown { color: rgba(245,243,238,0.55); }
.lp-unknown .lp-ci { color: #C9A84C; }
.lp-card-tag {
  font-size: 10px;
  color: #FCA5A5;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 4px;
  padding: 5px 9px;
  text-align: center;
}

.auth-brand-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-brand-points li {
  font-size: 14px;
  color: rgba(245,243,238,0.6);
  line-height: 1.55;
  padding-left: 20px;
  position: relative;
}

.auth-brand-points li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 600;
}

.auth-brand-foot {
  font-size: 12px;
  color: rgba(245,243,238,0.3);
}

.auth-pricing {
  border-top: 1px solid rgba(245,243,238,0.1);
  padding-top: 18px;
  margin-bottom: 12px;
}

.auth-info-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-info-card {
  border: 1px solid rgba(245,243,238,0.14);
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 14px;
}

.auth-info-title {
  font-size: 12px;
  font-weight: 600;
  color: #F5F3EE;
  margin-bottom: 8px;
}

.auth-info-copy {
  font-size: 12px;
  color: rgba(245,243,238,0.65);
  line-height: 1.6;
  margin-bottom: 10px;
}

.auth-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-info-list li {
  font-size: 11px;
  color: rgba(245,243,238,0.72);
  padding-left: 14px;
  position: relative;
}

.auth-info-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.auth-step-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(245,243,238,0.72);
}

.auth-step span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(245,243,238,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #F5F3EE;
}

.auth-pricing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #F5F3EE;
  margin-bottom: 10px;
}

.auth-pricing-meta {
  color: rgba(245,243,238,0.45);
}

.auth-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pricing-plan-card {
  border: 1px solid rgba(245,243,238,0.14);
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 12px;
}

.pricing-plan-card.featured {
  border-color: var(--gold);
  background: rgba(201,168,76,0.12);
}

.pricing-plan-tier {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,243,238,0.6);
  margin-bottom: 5px;
}

.pricing-plan-price {
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #F5F3EE;
}

.pricing-plan-price span {
  font-size: 10px;
  color: rgba(245,243,238,0.6);
  margin-left: 3px;
}

.pricing-plan-copy {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(245,243,238,0.55);
}

.pricing-plan-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pricing-plan-list li {
  font-size: 11px;
  color: rgba(245,243,238,0.74);
  padding-left: 14px;
  position: relative;
}

.pricing-plan-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #6EE7B7;
  font-weight: 700;
}

.auth-pricing-cta {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

.auth-pricing-btn {
  border: 1px solid var(--gold);
  color: #171717;
  background: var(--gold);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.auth-pricing-btn:hover {
  opacity: 0.9;
}

.auth-form-panel {
  width: 440px;
  min-width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 48px 40px;
  min-height: 100vh;
}

.auth-form-panel .login-card {
  width: 100%;
  max-width: 360px;
  box-shadow: none;
  border: none;
  padding: 0;
}

.login-card {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-login-card {
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 28px rgba(24,20,16,.08);
}

.signup-card {
  width: 440px;
}

.signup-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: -2px 0 -10px;
}

.signup-progress-step {
  color: var(--text-3);
}

.signup-progress-step.active {
  color: var(--text);
  font-weight: 500;
}

.signup-progress-sep {
  color: var(--text-3);
}

.signup-hint {
  margin-top: -8px;
  color: var(--text-2);
  font-size: 12px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: -4px;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-sub {
  color: var(--text-2);
  font-size: 14px;
  margin-top: -12px;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.login-card input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s;
}
.login-card select,
.login-card textarea {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s;
}
.login-card input:focus { border: 2px solid var(--text); padding: 10px 13px; }
.login-card select:focus,
.login-card textarea:focus { border: 2px solid var(--text); padding: 10px 13px; }

.onboard-notice {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #faf9f8;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.onboard-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.onboard-copy {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

.onboard-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px !important;
  color: var(--text) !important;
  font-weight: 500;
}

.onboard-check input {
  margin-top: 2px;
}

.onboard-check a {
  color: var(--text);
  text-decoration: underline;
}

.error-banner {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
}

.error-banner a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.auth-login-help {
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
  margin-top: -4px;
}

.auth-login-help a {
  color: var(--text);
}

.auth-login-help a:hover {
  opacity: 0.8;
}

@media (max-width: 1080px) {
  .auth-brand {
    padding: 40px 36px;
  }
  .auth-brand-body {
    gap: 28px;
  }
  .auth-brand-right {
    width: 220px;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }
  .auth-split {
    flex-direction: column;
    min-height: auto;
  }
  .auth-brand {
    padding: 28px 22px;
  }
  .auth-brand-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 24px 0;
  }
  .auth-brand-right {
    width: 100%;
    max-width: 340px;
  }
  .auth-brand-headline {
    font-size: 40px;
  }
  .auth-pricing-grid {
    grid-template-columns: 1fr;
  }
  .auth-info-stack {
    grid-template-columns: 1fr;
  }
  .auth-form-panel {
    width: 100%;
    min-width: 0;
    min-height: auto;
    padding: 26px 22px 30px;
  }
  .auth-form-panel .login-card {
    max-width: 520px;
  }
  #signup-screen,
  #workspace-screen,
  #invite-screen {
    padding: 18px;
    height: auto;
    min-height: 100vh;
    align-items: flex-start;
  }
  .signup-card,
  .login-card {
    width: 100%;
    max-width: 520px;
  }
}

/* ═══════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════ */
#app { display: flex; height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 0 4px;
}

.btn-new {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s;
}
.btn-new:hover { opacity: 0.85; }

.nav-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 0 8px;
  margin-bottom: 4px;
}

.case-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  margin-bottom: 1px;
}
.case-item:hover  { background: var(--bg); }
.case-item.active { background: var(--bg); }
.case-main { min-width: 0; flex: 1; }
.case-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.case-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.case-delete-btn {
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  flex-shrink: 0;
}
.case-item:hover .case-delete-btn,
.case-item.active .case-delete-btn {
  opacity: 1;
}
.case-delete-btn:hover {
  color: #b42318;
  background: #fff5f5;
  border-color: #fecaca;
}
@media (hover: none) {
  .case-delete-btn { opacity: 1; }
}

.sidebar-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* Bulk worker picker */
.bulk-picker { padding: 8px; }
.bulk-picker-header { margin-bottom: 16px; }
.bulk-picker-title { font-size: 15px; font-weight: 600; color: var(--text); }
.bulk-picker-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.bulk-worker-list { display: flex; flex-direction: column; gap: 8px; }
.bulk-worker-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.bulk-worker-name { font-size: 14px; font-weight: 500; color: var(--text); }
.bulk-worker-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-kb, .btn-signout {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  transition: background 0.1s, color 0.1s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.btn-kb:hover, .btn-signout:hover { background: var(--bg); color: var(--text); }

/* ── Main ── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 48px 56px;
  max-width: 760px;
}
.main.full-width {
  max-width: 1140px;
  padding: 48px 56px;
}

/* ── Steps ── */
.step { display: none; }
.step.active { display: block; }

.step-header { margin-bottom: 32px; }
.step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.step-header h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 6px; }
.step-header p  { color: var(--text-2); font-size: 14px; }

.usage-mini-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.usage-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.usage-mini-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.usage-mini-btn {
  padding: 7px 12px;
  font-size: 12px;
  box-shadow: none;
}

.usage-mini-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.usage-mini-text {
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text);
}

.usage-mini-plan {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.usage-mini-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════════
   INTAKE — Monochrome. No functional color.
═══════════════════════════════════════════════ */
.intake-area { display: flex; flex-direction: column; gap: 20px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.12s;
  box-shadow: var(--shadow);
}
textarea:focus { border: 2px solid var(--text); padding: 13px 15px; }

.upload-row { display: flex; align-items: center; gap: 12px; }

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-2);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.12s, color 0.12s;
  box-shadow: var(--shadow);
}
.upload-btn:hover { border-color: var(--text-3); color: var(--text); }
.file-name { font-size: 13px; color: var(--text-2); }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover    { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
  box-shadow: var(--shadow);
}
.btn-secondary:hover { background: var(--bg); }

.step-actions { display: flex; gap: 10px; margin-top: 36px; }

/* ── Spinner ── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   PROFILE FORM — Monochrome. No functional color.
═══════════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.profile-grid .full-width { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s;
  box-shadow: var(--shadow);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border: 2px solid var(--text);
  padding: 9px 11px;
}
.field .null-hint {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}

/* ═══════════════════════════════════════════════
   RESULT — Color enters here. Purposeful, high-contrast.
═══════════════════════════════════════════════ */

/* Streaming placeholder */
.streaming-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
  padding: 48px 0;
}
.streaming-dot {
  width: 7px;
  height: 7px;
  background: var(--text-3);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ═══════════════════════════════════════════════
   RECOMMENDATION CARD (rc-*)
   White, consistent with rest of app
═══════════════════════════════════════════════ */

/* ── Outer card shell ── */
.rec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Loading state ── */
.rc-loading {}

.rc-loading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.rc-loading-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rc-loading-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.rc-loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: dot-pulse 1.4s ease-in-out infinite;
}
.rc-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.rc-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1.1); }
}

.rc-loading-score-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 0 16px;
}

.rc-loading-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 120px;
}
.rc-loading-check-row {
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  letter-spacing: 0.02em;
}
.rc-loading-check-row.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Blocker banner ── */
.rc-blocker {
  background: var(--red-bg);
  border: 1.5px solid var(--red-border);
  border-left: 4px solid var(--red);
  border-radius: 6px;
  padding: 14px 16px;
}
.rc-blocker-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}
.rc-blocker-item {
  font-size: 13px;
  color: #7F1D1D;
  line-height: 1.55;
  padding-left: 12px;
  border-left: 2px solid var(--red-border);
  margin-top: 6px;
}

/* ── Missing information notice (result card) ── */
.rc-missing {
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.rc-missing-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #92400E;
  margin-bottom: 8px;
}
.rc-missing-list {
  margin: 0;
  padding-left: 16px;
}
.rc-missing-list li {
  font-size: 13px;
  color: #78350F;
  line-height: 1.55;
  margin-top: 4px;
}

/* ── Compliance flags list ── */
.rc-flags-list {
  margin: 0;
  padding: 12px 16px;
  list-style: none;
}
.rc-flags-list li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  padding-left: 12px;
  border-left: 2px solid var(--amber, #F59E0B);
  margin-top: 6px;
}
.rc-flags-list li:first-child { margin-top: 0; }

/* ── Profile gaps notice (profile step) ── */
.profile-gaps-notice {
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.profile-gaps-title {
  font-size: 12px;
  font-weight: 600;
  color: #92400E;
  margin-bottom: 8px;
}
.profile-gaps-list {
  margin: 0;
  padding-left: 16px;
}
.profile-gaps-list li {
  font-size: 13px;
  color: #78350F;
  line-height: 1.55;
  margin-top: 4px;
}

/* ── Header row: visa name + worker strip ── */
.rc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.rc-route-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.rc-visa-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.rc-worker-strip {
  text-align: right;
  flex-shrink: 0;
}
.rc-worker-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
}
.rc-worker-meta {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.rc-worker-flag { font-size: 20px; margin-top: 4px; }

/* ── Score row ── */
.rc-score-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.rc-score-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 56px;
  font-weight: 500;
  line-height: 1;
  min-width: 80px;
  text-align: center;
}
.rc-score-num.score-green { color: var(--green); }
.rc-score-num.score-amber { color: var(--gold); }
.rc-score-num.score-red   { color: var(--red); }

.rc-score-right { flex: 1; }
.rc-score-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.rc-score-sub { color: var(--text-3); }
.rc-score-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.rc-score-fill {
  height: 100%;
  border-radius: 3px;
  width: var(--score, 0%);
  animation: score-grow 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes score-grow { from { width: 0%; } to { width: var(--score, 0%); } }
.rc-score-fill.score-green { background: linear-gradient(90deg, #059669, var(--green)); }
.rc-score-fill.score-amber { background: linear-gradient(90deg, #A8893A, var(--gold)); }
.rc-score-fill.score-red   { background: linear-gradient(90deg, #991B1B, var(--red)); }

/* ── Check breakdown rows ── */
.rc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.check-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.check-row:last-child { border-bottom: none; }
.cr-icon {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.cr-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cr-label {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text);
}
.cr-detail {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
}
.cr-fail .cr-icon  { color: var(--red); }
.cr-fail .cr-label { color: #7F1D1D; }
.cr-fail           { background: var(--red-bg); }
.cr-unknown .cr-icon  { color: var(--amber); }
.cr-unknown .cr-label { color: var(--text); }
.cr-passes-summary .cr-icon  { color: var(--green); }
.cr-passes-summary .cr-label { color: var(--text-2); font-size: 12px; }

/* ── Check feedback ── */
.cr-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.fb-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
}
.fb-btn:hover { opacity: 1; }
.fb-active-up   { opacity: 1; border-color: var(--green); background: var(--green-bg); }
.fb-active-down { opacity: 1; border-color: var(--red); background: var(--red-bg); }
.fb-comment-toggle {
  font-size: 11px;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: underline dotted;
}
.fb-comment-wrap { width: 100%; margin-top: 4px; }
.fb-comment-input {
  width: 100%;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  resize: vertical;
  font-family: inherit;
}
.fb-submit-btn {
  margin-top: 4px;
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
.fb-submit-btn:hover { background: var(--canvas); }

/* ── AI summary ── */
.rc-summary {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
}
.rc-summary-icon { color: var(--gold); font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.rc-summary-text { font-size: 13px; line-height: 1.7; color: var(--text-2); }

/* ── Collapsible disclosures ── */
.rc-disclosures { display: flex; flex-direction: column; gap: 2px; }

.rc-disclosure {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.rc-disclosure[open] { border-color: #D1D1D1; }

.rc-disclosure-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
  background: var(--bg);
}
.rc-disclosure-trigger::-webkit-details-marker { display: none; }
.rc-disclosure-trigger:hover { background: var(--border); }
.rc-disclosure[open] .rc-disclosure-trigger { color: var(--text); border-bottom: 1px solid var(--border); background: var(--bg); }

/* Chevron via CSS */
.rc-disclosure-trigger::after {
  content: '›';
  color: var(--text-3);
  font-size: 16px;
  transition: transform 0.2s;
  transform: rotate(90deg);
}
.rc-disclosure[open] .rc-disclosure-trigger::after { transform: rotate(-90deg); }

/* Move count before chevron */
.rc-disclosure-trigger > span:last-of-type { order: -1; }
.rc-disclosure-count {
  font-size: 11px;
  font-weight: 500;
  background: var(--border);
  color: var(--text-3);
  padding: 2px 7px;
  border-radius: 10px;
  margin-right: auto;
  margin-left: 8px;
}

/* Docs list inside disclosure */
.rc-docs-list {
  list-style: none;
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rc-docs-list li {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.rc-docs-list li::before { content: '✓'; color: var(--gold); font-size: 11px; font-weight: 600; flex-shrink: 0; margin-top: 2px; }

/* Fee body inside disclosure */
.rc-fee-body {
  padding: 10px 14px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.8;
  white-space: pre-line;
}

/* Alt routes inside disclosure */
.rc-alts { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.rc-alt-item { padding: 10px 12px; background: var(--bg); border-radius: 4px; border-left: 2px solid var(--blue); }
.rc-alt-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.rc-alt-body { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.rc-alt-cond { font-size: 12px; color: var(--blue); margin-top: 6px; }
.rc-alt-assess-btn { margin-top: 10px; font-size: 12px; }

/* Back banner — shown when viewing an alt route assessment */
.rc-back-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 10px;
}
.rc-back-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.rc-back-btn:hover { color: var(--blue); }
.rc-back-label {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}

/* Actions list inside disclosure */
.rc-actions-list {
  padding: 10px 14px 14px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rc-actions-list li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  padding-left: 4px;
}

/* ── Verdict banner ── */
.verdict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  gap: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ── Critical flags banner ── */
.critical-banner {
  background: var(--red-bg);
  border: 1.5px solid var(--red-border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.critical-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.critical-icon {
  font-size: 15px;
  line-height: 1;
}
.critical-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.critical-list li {
  font-size: 13px;
  color: #7F1D1D;
  line-height: 1.55;
  padding-left: 14px;
  position: relative;
}
.critical-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--red);
  font-weight: 600;
}

/* ── Worker summary strip ── */
.worker-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  gap: 16px;
}
.worker-summary-left { display: flex; flex-direction: column; gap: 2px; }
.worker-summary-name { font-size: 13px; font-weight: 500; color: var(--text); }
.worker-summary-meta { font-size: 12px; color: var(--text-3); }
.worker-summary-right { font-size: 22px; flex-shrink: 0; }

/* ── Result header card ── */
.result-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.result-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.result-header-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.result-visa-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}
.result-verdict-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  margin-top: 4px;
}
.verdict-pill-pass    { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-border); }
.verdict-pill-fail    { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-border);   }
.verdict-pill-unknown { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-border); }
.verdict-pill-pass::before    { content: '✓'; }
.verdict-pill-fail::before    { content: '✗'; }
.verdict-pill-unknown::before { content: '!'; }

/* Confidence bar */
.confidence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.confidence-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #A8893A, var(--gold));
  animation: conf-grow 1.2s ease-out forwards;
  width: 0%;
}
@keyframes conf-grow {
  from { width: 0%; }
}
.confidence-fill-high   { --target-w: 88%; animation: conf-grow-high   1.2s ease-out forwards; }
.confidence-fill-medium { --target-w: 55%; animation: conf-grow-medium 1.2s ease-out forwards; }
.confidence-fill-low    { --target-w: 28%; animation: conf-grow-low    1.2s ease-out forwards; }
@keyframes conf-grow-high   { from { width: 0%; } to { width: 88%; } }
@keyframes conf-grow-medium { from { width: 0%; } to { width: 55%; } }
@keyframes conf-grow-low    { from { width: 0%; } to { width: 28%; } }

.confidence-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}

/* Eligibility tags */
.eligibility-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.eligibility-tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.01em;
}
.eligibility-tag.tag-pass    { background: var(--green-bg);  color: var(--green);  border-color: var(--green-border); }
.eligibility-tag.tag-fail    { background: var(--red-bg);    color: var(--red);    border-color: var(--red-border);   }
.eligibility-tag.tag-unknown { background: var(--amber-bg);  color: var(--amber);  border-color: var(--amber-border); }

/* ── Eligibility check groups ── */
.check-groups {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}
.check-groups-1 { grid-template-columns: 1fr; }
.check-groups-2 { grid-template-columns: 1fr 1fr; }
.check-groups-3 { grid-template-columns: 1fr 1fr 1fr; }

.check-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Top bar is the color signal — thin but clear */
.group-pass    { border-top: 2.5px solid var(--green); }
.group-fail    { border-top: 2.5px solid var(--red);   }
.group-unknown { border-top: 2.5px solid var(--amber); }

.check-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* Header icon gets the functional color */
.group-pass    .check-group-header { color: var(--text-3); }
.group-fail    .check-group-header { color: var(--text-3); }
.group-unknown .check-group-header { color: var(--text-3); }

.check-group-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-pass    .check-group-count { background: var(--green-bg);  color: var(--green); }
.group-fail    .check-group-count { background: var(--red-bg);    color: var(--red);   }
.group-unknown .check-group-count { background: var(--amber-bg);  color: var(--amber); }

.check-group-items { padding: 4px 0; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.check-item:last-child { border-bottom: none; }

.check-item-icon {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 3px;
  width: 14px;
  text-align: center;
}
.group-pass    .check-item-icon { color: var(--green); }
.group-fail    .check-item-icon { color: var(--red);   }
.group-unknown .check-item-icon { color: var(--amber); }

.check-item-criterion { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.check-item-detail    { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }

/* ── Consultant action panel ── */
.actions-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2.5px solid var(--amber);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.actions-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.actions-panel-header svg { color: var(--amber); flex-shrink: 0; }

.actions-list { padding: 8px 0; }

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 18px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  border-bottom: 1px solid var(--border);
}
.action-item:last-child { border-bottom: none; }

.action-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  margin-top: 1px;
}

/* ── Bottom result grid ── */
.result-bottom-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

/* ── Result section wrapper ── */
.result-section { margin-bottom: 24px; }
.result-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* ── Required documents ── */
.docs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.docs-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  line-height: 1.45;
  box-shadow: var(--shadow);
  color: var(--text);
}
.docs-list li::before { content: '✓'; color: var(--gold); flex-shrink: 0; font-weight: 600; font-size: 12px; }

/* ── Alternative routes — blue accent, sparingly ── */
.alt-card {
  border: 1px solid var(--border);
  border-left: 2.5px solid var(--blue);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.alt-title { font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--text); }
.alt-body  { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.alt-conditions {
  font-size: 12px;
  color: var(--blue);
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--blue-bg);
  border-radius: 4px;
  line-height: 1.5;
}

/* ── AI summary ── */
.ai-summary-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.ai-summary-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; color: var(--text-3); }
.ai-summary-text { font-size: 13px; line-height: 1.75; color: var(--text-2); }

/* ═══════════════════════════════════════════════
   KNOWLEDGE BASE
═══════════════════════════════════════════════ */
.kb-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.kb-status  { font-size: 13px; color: var(--text-2); }

.kb-log {
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.8;
}

.section-heading {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 12px;
}

.kb-rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}
.kb-rule-name { font-size: 14px; font-weight: 500; margin-bottom: 3px; color: var(--text); }
.kb-rule-meta { font-size: 12px; color: var(--text-3); }

.kb-verified           { font-size: 12px; font-weight: 500; flex-shrink: 0; }
.kb-verified.ok        { color: var(--green); }
.kb-verified.stale     { color: var(--amber); }
.kb-verified.never     { color: var(--text-3); }
.kb-verified.checking  { color: var(--text-3); font-style: italic; }

.kb-change-card {
  background: var(--surface);
  border: 1px solid var(--amber-border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.kb-change-summary { font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.kb-change-detail  { font-size: 12px; color: var(--text-2); line-height: 1.55; margin-bottom: 12px; }
.kb-change-actions { display: flex; gap: 8px; }

.btn-approve {
  background: var(--green);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-approve:hover { opacity: 0.85; }

.btn-dismiss {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-dismiss:hover { background: var(--bg); }

/* ═══════════════════════════════════════════════
   SIDEBAR USER BLOCK
═══════════════════════════════════════════════ */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 2px;
}
.sidebar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.sidebar-user-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════
   SETTINGS & TEAM
═══════════════════════════════════════════════ */

/* Tabs */
.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.settings-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-3);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.settings-tab.active { color: var(--text); border-bottom-color: var(--text); }
.settings-tab:hover:not(.active) { color: var(--text-2); }

.settings-tab-content { display: block; }

/* Toolbar */
.settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.settings-readonly-notice {
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
}

/* Team list */
.team-list { display: flex; flex-direction: column; gap: 2px; }

.team-member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.12s;
}
.team-member-card:hover { border-color: #D4D4D4; }

.team-member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.team-member-avatar.suspended { background: var(--text-3); }

.team-member-info { flex: 1; min-width: 0; }
.team-member-name  { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-member-email { font-size: 12px; color: var(--text-3); }

.team-member-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--bg);
  flex-shrink: 0;
}
.team-member-badge.admin    { background: var(--text); color: white; border-color: var(--text); }
.team-member-badge.suspended { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

.team-member-actions { display: flex; gap: 6px; flex-shrink: 0; }
.team-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.team-action-btn:hover { background: var(--bg); color: var(--text); }
.team-action-btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

/* Pending invite card */
.invite-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-style: dashed;
}
.invite-card-info  { flex: 1; font-size: 13px; color: var(--text-2); }
.invite-card-email { font-weight: 500; color: var(--text); }
.invite-card-meta  { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Settings section title */
.settings-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 8px;
}

/* Org info card */
.org-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 520px;
}
.org-info-row {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.org-info-row:last-child { border-bottom: none; }
.org-info-label { color: var(--text-2); width: 140px; flex-shrink: 0; }

.org-compliance-card {
  margin-top: 16px;
  max-width: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px;
}
.org-compliance-copy {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  margin-bottom: 12px;
}

.billing-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
}

.billing-field select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}

.billing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}

/* Invite result */
.invite-result {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Inter', monospace;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--border);
}
.invite-result.success { background: var(--green-bg); border-color: var(--green-border); color: var(--green); }
.invite-result.error   { background: var(--red-bg);   border-color: var(--red-border);   color: var(--red);   }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 440px;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--text); }
.modal-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.modal-card label input,
.modal-card label select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
}
.modal-card label input:focus,
.modal-card label select:focus { border-color: var(--text); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* Welcome modal */
.welcome-card {
  max-width: 480px;
  width: min(480px, 94vw);
  align-items: flex-start;
  gap: 16px;
}
.welcome-icon { margin-bottom: 4px; }
.welcome-title { font-size: 18px; font-family: 'Fraunces', serif; }
.welcome-copy {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
}
.welcome-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}
.welcome-option-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.welcome-option-btn:hover { border-color: var(--text-2); background: #ece9e6; }
.welcome-option-primary { border-color: #0F172A; background: #0F172A; }
.welcome-option-primary:hover { border-color: #334155; background: #1e293b; }
.welcome-option-primary .welcome-option-label { color: #fff; }
.welcome-option-primary .welcome-option-hint  { color: rgba(255,255,255,0.6); }
.welcome-option-label { font-size: 14px; font-weight: 600; color: var(--text); }
.welcome-option-hint  { font-size: 12px; color: var(--text-3); }

/* Empty state in cases sidebar */
.cases-empty {
  padding: 12px 8px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* Post-first-match nudge banner */
.first-match-nudge {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  font-size: 13px;
  color: #1e40af;
  margin-bottom: 16px;
}
.first-match-nudge-text { flex: 1; line-height: 1.5; }
.first-match-nudge-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #93c5fd;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.first-match-nudge-close:hover { color: #1e40af; }

.compliance-card {
  max-width: 560px;
  width: min(560px, 94vw);
}
.compliance-summary {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}
.compliance-points {
  margin-left: 16px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}
.compliance-check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px !important;
  color: var(--text) !important;
  margin-top: 4px;
}
.compliance-check-row input {
  margin-top: 2px;
}
