/* SwiftHire Carbon v2.0.0 — Full Verocity Parity, Subpath Mount, Dynamic Co-Branded WCAG AA Theme & Conversational Dossier */
:root {
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --ink: #102a2b;
  --muted: #465a5c;
  --green: #184e47;
  --green-hover: #113a35;
  --brand-hover: #113a35;
  --brand-on-primary: #ffffff;
  --mint: #e3f0ea;
  --mint-hover: #d4e8df;
  --brand-border: #b9cec6;
  --step-bg-top: #f6fbf8;
  --step-bg-bottom: #edf6f1;
  --line: #d4dfda;
  --amber-bg: #f6eedc;
  --amber-ink: #634619;
  --vault-bg: #eef3f8;
  --vault-ink: #1d3c5e;
  --danger: #8b372a;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button, input, select, textarea {
  font: inherit;
}

/* Prevent iOS & iPadOS Safari auto-zoom on focus across ALL viewports */
input, select, textarea {
  font-size: 16px;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

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

/* Top Bar */
.topbar {
  min-height: 60px;
  padding: 6px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}

.brand-symbol {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 23px;
  font-weight: 700;
  flex: none;
}

.brand-wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.brand-wordmark small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-top: 2px;
}

.practice {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--amber-bg);
  color: var(--amber-ink);
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--mint);
  color: var(--green);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 8px 13px;
  min-height: 44px;
  min-width: 44px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-switch-pill:hover:not(:disabled) {
  background: var(--mint-hover);
}

.brand-swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px #ffffff;
  flex: none;
}

.brand-switch-label-short {
  display: none;
}

.topbar-save {
  display: none;
  background: var(--mint);
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  min-height: 44px;
  min-width: 44px;
}

button.quiet, a.quiet {
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

a.quiet {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--green);
}

button.quiet:hover, a.quiet:hover {
  background: var(--surface-soft);
}

/* Buttons & Badges */
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  background: var(--green);
  color: var(--brand-on-primary, #ffffff);
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  min-height: 46px;
  min-width: 44px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.primary:hover:not(:disabled) {
  background: var(--brand-hover, var(--green-hover));
}

.primary.full, .secondary.full, .text-button.full {
  width: 100%;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--mint);
  color: var(--green);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
}

.secondary:hover:not(:disabled) {
  background: var(--mint-hover, #d4e8df);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--green);
  padding: 8px 10px;
  min-height: 44px;
  min-width: 44px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fine {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 8px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  padding: 4px 9px;
  background: var(--mint);
  color: var(--green);
  border-radius: 999px;
  white-space: nowrap;
}

.pill-pending {
  background: var(--amber-bg);
  color: var(--amber-ink);
}

.pill-neutral {
  background: var(--vault-bg);
  color: var(--vault-ink);
}

/* Welcome Screen */
.welcome {
  max-width: 1160px;
  margin: 30px auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 48px;
  align-items: start;
}

.welcome-cobrand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  margin-bottom: 16px;
}

.welcome-employer-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.welcome-employer-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.welcome-cra-block {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 999px;
  max-width: 100%;
}

.welcome-cra-block strong {
  color: var(--ink);
}

.cra-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: contain;
  flex: none;
}

.cra-logo-xs {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  object-fit: contain;
  flex: none;
}

.brand-preview-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  margin: 0 0 22px;
}

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

.brand-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.brand-preview-card {
  width: 100%;
  min-height: 56px;
  min-width: 44px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.brand-preview-card:hover:not(:disabled) {
  border-color: var(--brand-border);
  background: var(--mint);
}

.brand-preview-card.active {
  border-color: var(--green);
  background: var(--mint);
  box-shadow: 0 0 0 1px var(--green);
}

.brand-card-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  flex: none;
}

.brand-card-meta {
  min-width: 0;
  flex: 1;
}

.brand-card-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.brand-card-meta small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.brand-modal-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.brand-modal-item {
  width: 100%;
  min-height: 64px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.brand-modal-item:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--mint);
}

.brand-modal-item.active {
  border-color: var(--green);
  background: var(--mint);
}

.welcome h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 46px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -1.1px;
  margin: 14px 0 16px;
}

.welcome h1 em {
  color: var(--green);
  font-style: italic;
}

.welcome-copy > p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 22px;
}

.welcome-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  gap: 14px;
}

.welcome-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.welcome-steps li > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 2px;
}

.welcome-steps strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.welcome-steps small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

.welcome-cta-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.test-tools {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.test-tools summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.practice-selector {
  margin-top: 10px;
}

.welcome-example {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(16, 42, 43, 0.07);
}

.example-top {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.example-top small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.assistant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex: none;
}

.sample-user {
  margin: 18px 0 14px 28px;
  background: var(--ink);
  color: #fff;
  padding: 13px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 13.5px;
  line-height: 1.55;
}

.sample-assistant {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 12px 15px;
  border-radius: 14px 14px 14px 4px;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.sample-facts {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-soft);
  display: grid;
  gap: 10px;
}

.sample-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

.sample-facts span {
  color: var(--muted);
}

.sample-facts strong {
  font-weight: 600;
  text-align: right;
}

.example-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
}

/* 3-Column Studio Workspace (Desktop >= 960px) */
.workspace {
  display: grid;
  grid-template-columns: 236px minmax(360px, 1fr) 364px;
  height: calc(100dvh - 61px);
  max-width: 1640px;
  margin: 0 auto;
  background: var(--surface);
}

/* Column 1: Left Journey Rail */
.journey {
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

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

.employer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cobrand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.employer-monogram {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 20px;
  flex: none;
}

.employer-meta {
  min-width: 0;
}

.employer {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cra-row {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}

.cra-brand-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cra-row strong {
  color: var(--ink);
  font-weight: 600;
}

.journey-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.journey-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--muted);
}

.journey-step-counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}

.journey-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 14px;
}

.journey-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  width: 12%;
  transition: width 0.25s ease;
}

.journey-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 4px;
}

.journey-steps li {
  margin: 0;
}

.journey-step-btn {
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  font-size: 12.5px;
}

.journey-step-btn:hover {
  background: rgba(24, 78, 71, 0.06);
}

.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #b5c4bd;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}

.step-state-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.journey-steps li.active .journey-step-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}

.journey-steps li.active .step-dot {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.journey-steps li.active .step-state-tag {
  color: var(--amber-ink);
}

.journey-steps li.done .journey-step-btn {
  color: var(--green);
  font-weight: 600;
}

.journey-steps li.done .step-dot {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--green);
}

.journey-steps li.done .step-state-tag {
  color: var(--green);
}

.journey-bottom {
  margin-top: auto;
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

.privacy-shield {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  background: var(--vault-bg);
  color: var(--vault-ink);
  padding: 10px 12px;
  border-radius: 10px;
}

.shield {
  font-size: 16px;
  line-height: 1;
  margin-top: 1px;
}

/* Column 2: Center Live Assistant Stream */
.conversation {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  min-width: 0;
  min-height: 0;
}

.conversation-head {
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
}

.conversation-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-employer-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
  flex: none;
}

.header-employer-monogram {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  flex: none;
}

.conversation-title-copy {
  min-width: 0;
}

.assistant-live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 7px;
  vertical-align: 1px;
}

.conversation-head h1 {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
}

.conversation-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.mobile-cobrand-line {
  display: none;
}

.save-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.saved {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: var(--mint);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.save-pending {
  background: var(--amber-bg);
  color: var(--amber-ink);
}

.save-needs-attention {
  background: #fbeae6;
  color: var(--danger);
}

.save-feedback {
  margin: 8px 22px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--amber-bg);
  color: var(--amber-ink);
  font-size: 12.5px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  min-height: 160px;
}

.message {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  line-height: 1.6;
  font-size: 14.5px;
  animation: appear 0.18s ease-out;
}

.message-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 86%;
}

.message.assistant .message-content {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  padding: 12px 15px;
}

.message.user {
  justify-content: flex-end;
}

.message.user .message-content {
  background: var(--ink);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  padding: 11px 16px;
}

.message.waiting .message-content {
  color: var(--muted);
  font-style: italic;
}

/* Inline Active Step Card above Composer */
.conversation-actions {
  padding: 0 20px 10px;
}

.chat-step {
  border: 1px solid var(--brand-border, #b9cec6);
  background: linear-gradient(180deg, var(--step-bg-top, #f6fbf8) 0%, var(--step-bg-bottom, #edf6f1) 100%);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.chat-step-copy {
  flex: 1 1 220px;
  min-width: 0;
}

.chat-step h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 3px 0 4px;
}

.chat-step p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.chat-step-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-wrap {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.suggestions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.suggestions::-webkit-scrollbar {
  display: none;
}

.suggestions button {
  flex: none;
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

.suggestions button:hover:not(:disabled) {
  background: var(--mint);
  border-color: var(--brand-border);
  color: var(--green);
}

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 8px 10px 8px 14px;
  border: 1.5px solid #b7c8c0;
  border-radius: 14px;
  background: #ffffff;
}

.composer:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24, 78, 71, 0.12);
}

.composer textarea {
  resize: none;
  flex: 1;
  min-width: 0;
  max-height: 125px;
  min-height: 36px;
  line-height: 1.5;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 6px 0;
  font-size: 16px;
  color: var(--ink);
}

.composer textarea:disabled {
  opacity: 0.65;
  cursor: wait;
}

.send {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 11px;
  background: var(--green);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.composer-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding-top: 8px;
}

/* Column 3: Right Live Applicant Dossier */
.details {
  background: var(--surface-soft);
  border-left: 1px solid var(--line);
  padding: 18px 18px 28px;
  overflow-y: auto;
  min-height: 0;
}

.mobile-back-chat {
  display: none;
  margin-bottom: 14px;
}

.dossier-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.details h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  margin: 4px 0 6px;
}

.details-top > p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.dossier-cards {
  display: grid;
  gap: 11px;
}

.fact-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 15px;
}

.fact-group.vault-card {
  border-color: #c5d4e6;
  background: #fbfdff;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.group-head h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0;
}

.edit {
  color: var(--green);
  background: var(--mint);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 48px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.edit:hover:not(:disabled) {
  background: var(--mint-hover, #d2e6dc);
}

.fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px dashed #e6ece8;
}

.fact label {
  font-size: 11.5px;
  color: var(--muted);
  flex: none;
}

.fact span {
  font-size: 12.5px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
  font-style: italic;
  font-weight: 400 !important;
}

.alias-bar {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.next-action {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
}

.next-action:empty {
  display: none;
}

.next-action h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
}

.next-action p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.receipt {
  padding: 14px;
  border: 1px solid #c3dccd;
  background: #edf7f1;
  border-radius: 12px;
}

.receipt h3 {
  margin: 6px 0;
}

.receipt code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* Mobile Subbar (Hidden on Desktop >= 960px) */
.mobile-subbar {
  display: none;
}

/* Dialogs, Forms, Autocomplete & Consents */
dialog {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 560px;
  width: calc(100% - 24px);
  color: var(--ink);
  max-height: 88dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-shadow: 0 28px 90px rgba(16, 42, 43, 0.28);
}

dialog::backdrop {
  background: rgba(16, 42, 43, 0.5);
  backdrop-filter: blur(3px);
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

.modal-header h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
  overflow-wrap: anywhere;
}

.close {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: var(--ink);
  font-size: 22px;
  flex: none;
  display: grid;
  place-items: center;
}

.modal-intro {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
  font-size: 14px;
}

.form-field {
  margin-bottom: 15px;
}

.form-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-field input, .form-field select, .form-field textarea {
  display: block;
  width: 100%;
  border: 1.5px solid #b8c8c0;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  min-height: 46px;
  font-size: 16px;
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

.form-field input:disabled, .form-field select:disabled {
  background: #eef2ef;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(16, 42, 43, 0.14);
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
}

.autocomplete-option {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background: transparent;
  text-align: left;
  border-bottom: 1px solid #edf2ef;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.autocomplete-option:last-child {
  border-bottom: 0;
}

.autocomplete-option:hover {
  background: var(--mint);
}

.autocomplete-option strong {
  font-size: 13.5px;
  color: var(--ink);
}

.autocomplete-option span {
  font-size: 11.5px;
  color: var(--muted);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.field-label-row label {
  margin-bottom: 0;
}

.inline-toggle {
  padding: 4px 10px;
  min-height: 44px;
  font-size: 12.5px;
}

#recovery-code, #resume-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
}

.notice {
  padding: 12px 14px;
  background: var(--amber-bg);
  color: var(--amber-ink);
  border-radius: 10px;
  line-height: 1.55;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.employment-section {
  margin: 18px 0;
}

.employment-section h3 {
  font-size: 14px;
  margin: 0 0 10px;
}

.employment-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
  overflow-wrap: anywhere;
  background: var(--surface-soft);
}

.employment-item p {
  margin: 6px 0;
  font-size: 13px;
}

.document-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 12px;
}

.document-row h3 {
  margin: 0;
  font-size: 14.5px;
}

.document-body {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 13.5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.consent-rich {
  line-height: 1.65;
  font-size: 13.5px;
  overflow-wrap: anywhere;
  margin-bottom: 14px;
}

.consent-rich table {
  max-width: 100%;
  border-collapse: collapse;
}

.consent-rich td, .consent-rich th {
  border: 1px solid var(--line);
  padding: 6px 8px;
}

.consent-input {
  min-width: 0;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.consent-input legend {
  font-weight: 700;
  padding: 0 4px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
  min-height: 44px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--green);
  margin: 0;
}

.signature-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.signature-methods .check {
  flex: 1;
  min-width: 88px;
  margin: 4px 0;
}

.consent-input canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 140px;
  touch-action: none;
  background: #ffffff;
  border: 1.5px solid #8aa09a;
  border-radius: 10px;
}

.signature-clear {
  margin-top: 10px;
}

.consent-copy {
  margin-bottom: 14px;
  text-align: center;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-actions > * {
  flex: 1;
}

.inline-summary {
  margin: 12px 0;
  background: var(--surface-soft);
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.65;
  font-size: 13px;
}

.connection-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.connection-card h3 {
  font-size: 14px;
  margin: 0 0 6px;
}

.connection-card p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #ffffff;
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  border-radius: 10px;
  z-index: 40;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  font-size: 13px;
}

.toast.error {
  background: var(--danger);
}

.thinking-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  vertical-align: -2px;
  margin-right: 8px;
  animation: spin 0.8s linear infinite;
}

.location-question {
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 18px;
}

.id-explanation {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.id-explanation summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}

/* Admin Page */
.admin-page {
  max-width: 900px;
  margin: 28px auto;
  padding: 0 20px 48px;
}

.admin-page h1 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  margin: 10px 0 14px;
}

.admin-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin: 18px 0;
}

.admin-decision {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Compact Desktop (960px - 1220px) */
@media (min-width: 960px) and (max-width: 1220px) {
  .workspace {
    grid-template-columns: 200px minmax(330px, 1fr) 320px;
  }
  .conversation-head {
    padding: 10px 16px;
  }
  .messages {
    padding: 16px;
  }
  .conversation-actions, .composer-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Mobile & Tablet (< 960px): Sticky Compact Header + Full-Height Chat + Slide-Over Dossier Drawer */
@media (max-width: 959px) {
  .topbar {
    min-height: 54px;
    padding: 4px 10px;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .brand {
    gap: 7px;
    min-width: 0;
  }

  .brand-symbol {
    width: 30px;
    height: 30px;
    font-size: 20px;
    border-radius: 8px;
  }

  .brand-wordmark {
    font-size: 16.5px;
  }

  .brand-wordmark small {
    display: none;
  }

  .practice {
    display: none;
  }

  .brand-switch-pill {
    padding: 8px 10px;
    font-size: 12px;
    gap: 5px;
  }

  .brand-switch-label-full {
    display: none;
  }

  .brand-switch-label-short {
    display: inline;
  }

  .topbar-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12.5px;
  }

  button.quiet {
    padding: 0 6px;
  }

  .mobile-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 12px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 54px;
    z-index: 19;
  }

  .mobile-progress {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dossier-drawer-btn {
    flex: none;
    background: var(--mint);
    color: var(--green);
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 999px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .welcome {
    grid-template-columns: 1fr;
    gap: 28px;
    margin: 18px auto;
    padding: 0 16px 36px;
  }

  .welcome h1 {
    font-size: 34px;
  }

  .workspace {
    display: block;
    height: calc(100dvh - 110px);
    min-height: 420px;
  }

  .journey {
    display: none;
  }

  .conversation {
    height: 100%;
  }

  .conversation-head {
    padding: 8px 14px;
  }

  .conversation-subtitle, .save-controls > .text-button {
    display: none;
  }

  .mobile-cobrand-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    min-width: 0;
  }

  #mobile-employer-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #mobile-cra-text {
    flex: none;
    white-space: nowrap;
  }

  .messages {
    padding: 14px 14px 10px;
    min-height: 0;
  }

  .conversation-actions {
    padding: 0 12px 8px;
  }

  .chat-step {
    padding: 11px 12px;
    gap: 10px;
  }

  .chat-step-actions {
    width: 100%;
  }

  .chat-step-actions .primary {
    flex: 1;
  }

  .composer-wrap {
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .details {
    display: none;
    border-left: 0;
    height: 100%;
    padding: 14px 14px 28px;
  }

  .mobile-back-chat {
    display: inline-flex;
  }

  .workspace.show-details .conversation {
    display: none;
  }

  .workspace.show-details .details {
    display: block;
  }
}

@media (max-width: 600px) {
  .brand-preview-grid {
    grid-template-columns: 1fr;
  }

  .welcome-cobrand {
    padding: 10px 12px;
  }
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  dialog {
    padding: 16px;
    width: calc(100% - 16px);
  }

  .welcome h1 {
    font-size: 30px;
  }

  .welcome-example {
    padding: 16px;
  }

  .sample-user {
    margin-left: 10px;
  }
}

/* Carbon v2.0 Lifecycle Screens, Applicant-Pay Banner & Withdrawal Controls */
.lifecycle-screen {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 16px 48px;
}

.lifecycle-card {
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 28px rgba(16, 42, 43, 0.06);
}

.lifecycle-card h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.18;
  margin: 14px 0 12px;
  color: var(--ink);
}

.lifecycle-copy {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 20px;
  overflow-wrap: anywhere;
}

.lifecycle-support {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.lifecycle-support > strong {
  display: block;
  font-size: 14px;
  margin: 4px 0;
  color: var(--ink);
}

.lifecycle-contacts {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.payment-banner {
  margin: 8px 14px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--mint);
  border: 1px solid var(--brand-border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.payment-banner strong {
  display: block;
  font-size: 13px;
  color: var(--green);
}

.payment-banner small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.payment-banner.payment-due {
  background: var(--amber-bg);
  border-color: #dec99a;
}

.payment-banner.payment-due strong {
  color: var(--amber-ink);
}

.danger-btn {
  background: #8b261d;
  color: #ffffff;
}

.danger-btn:hover:not(:disabled) {
  background: #6e1d16;
}

@media (max-width: 560px) {
  .lifecycle-card {
    padding: 18px 16px;
  }

  .lifecycle-card h1 {
    font-size: 26px;
  }

  .payment-banner .primary {
    width: 100%;
  }
}

/* v2.1.0 — Drug Screening Badge, Supporting File Uploads & Admin Consent Preview */
.drug-badge {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border: 1px solid #e6cfa2;
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item .modal-actions a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

#upload-file {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  min-height: 44px;
  border: 1px dashed var(--brand-border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.consent-preview-shell {
  max-width: 820px;
  width: 100%;
}

.consent-preview-banner {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border-color: #e6cfa2;
}

.consent-preview-page {
  margin-bottom: 14px;
}
