:root {
  --page: #f7f9ff;
  --ink: #17213d;
  --muted: #516079;
  --line: rgba(102, 126, 234, 0.18);
  --panel: rgba(255, 255, 255, 0.94);
  --panel-soft: #eef3ff;
  --panel-wash: rgba(102, 126, 234, 0.06);
  --field-bg: #fbfcff;
  --teal: #667eea;
  --teal-dark: #4f63d7;
  --gold: #b67b28;
  --red: #b94a55;
  --green: #287348;
  --blue: #667eea;
  --button-bg: rgba(255, 255, 255, 0.82);
  --chip-bg: #f0f3ff;
  --shadow: 0 24px 70px rgba(44, 62, 120, 0.14);
}

body.dark-mode {
  --page: #070b18;
  --ink: #f7f9ff;
  --muted: #b8c3d9;
  --line: rgba(150, 166, 255, 0.2);
  --panel: rgba(14, 21, 39, 0.92);
  --panel-soft: rgba(102, 126, 234, 0.12);
  --panel-wash: rgba(255, 255, 255, 0.055);
  --field-bg: rgba(255, 255, 255, 0.07);
  --teal: #667eea;
  --teal-dark: #b7c2ff;
  --gold: #d6a44f;
  --red: #ef858c;
  --green: #72c995;
  --blue: #9db0ff;
  --button-bg: rgba(255, 255, 255, 0.06);
  --chip-bg: rgba(255, 255, 255, 0.07);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(102, 126, 234, 0.18), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(155, 92, 255, 0.16), transparent 26%),
    linear-gradient(135deg, #f7f9ff 0%, #eef3ff 46%, #f8fbff 100%);
}

body.dark-mode {
  background:
    radial-gradient(circle at 18% 8%, rgba(102, 126, 234, 0.28), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(155, 92, 255, 0.22), transparent 26%),
    linear-gradient(135deg, #070b18 0%, #0d1428 46%, #111827 100%);
}

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

button {
  border: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 3rem;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.is-hidden {
  display: none !important;
}

.intake-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(102, 126, 234, 0.18), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(155, 92, 255, 0.14), transparent 28%),
    linear-gradient(135deg, #f7f9ff 0%, #eef3ff 46%, #f8fbff 100%);
}

body.dark-mode .intake-screen {
  background:
    radial-gradient(circle at 18% 18%, rgba(102, 126, 234, 0.28), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(155, 92, 255, 0.24), transparent 28%),
    linear-gradient(135deg, #070b18 0%, #0d1428 46%, #111827 100%);
}

.intake-card {
  width: min(760px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.intake-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}

.intake-brand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
}

.intake-hero-copy {
  display: grid;
  gap: 12px;
  max-width: 640px;
  padding: 14px 0 4px;
}

.intake-beta-pill {
  justify-self: start;
  margin-bottom: 0;
  border: 1px solid rgba(102, 126, 234, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  background: #eef3ff;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.intake-hero-copy h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 3rem;
  line-height: 1.02;
}

.intake-hero-copy p:not(.intake-beta-pill) {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.intake-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 4px;
}

.intake-trust-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.saved-project-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(102, 126, 234, 0.24);
  border-radius: 16px;
  background: rgba(102, 126, 234, 0.08);
}

body.dark-mode .saved-project-prompt {
  border-color: rgba(123, 167, 255, 0.28);
  background: rgba(123, 167, 255, 0.1);
}

.saved-project-prompt strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
}

.saved-project-prompt p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.saved-project-prompt .secondary-button {
  flex: 0 0 auto;
  border-radius: 999px;
  white-space: nowrap;
}

.intake-card h1 {
  margin-bottom: 0;
}

.intake-card .primary-button {
  justify-self: start;
  min-width: 150px;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 14px 30px rgba(102, 126, 234, 0.25);
}

.intake-card label {
  color: var(--ink);
}

.intake-card input,
.intake-card textarea {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--ink);
}

.intake-card input::placeholder,
.intake-card textarea::placeholder {
  color: #8997b6;
}

.intake-card input:focus,
.intake-card textarea:focus {
  outline: 3px solid rgba(102, 126, 234, 0.18);
  border-color: #667eea;
}

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.header-actions,
.panel-header,
.tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.matrix-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.side-panel,
.main-panel,
.tab-panel,
.function-section,
.insight-grid article,
.metric,
.evidence-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.side-panel,
.main-panel {
  padding: 18px;
}

.main-panel {
  min-width: 0;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.helper-copy {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.stacked-form,
.entity-list {
  display: grid;
  gap: 12px;
}

.case-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.case-switcher .secondary-button {
  min-width: 96px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  background: var(--field-bg);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: #8997b6;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(102, 126, 234, 0.18);
  border-color: #667eea;
}

textarea {
  resize: vertical;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.primary-button,
.secondary-button,
.text-button,
.tab,
.icon-button,
.theme-toggle {
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 0 14px 30px rgba(102, 126, 234, 0.22);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--teal-dark);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--button-bg);
  color: var(--teal-dark);
  font-weight: 800;
}

.theme-toggle-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.text-button {
  background: transparent;
  color: var(--teal-dark);
  font-weight: 800;
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover,
.tab:hover,
.icon-button:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
}

.status-pill,
.winner-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.neutral {
  background: var(--chip-bg);
  color: var(--muted);
}

.pass {
  background: rgba(40, 115, 72, 0.12);
  color: var(--green);
}

.warn {
  background: rgba(182, 123, 40, 0.14);
  color: var(--gold);
}

.fail {
  background: rgba(164, 59, 66, 0.12);
  color: var(--red);
}

.entity-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.entity-sga {
  padding-right: 34px;
}

.icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--button-bg);
  color: var(--red);
  font-weight: 900;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.tabs {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px 14px 0 0;
  padding: 0 8px;
}

.tab {
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  padding: 12px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  border-bottom-color: var(--teal);
  color: var(--teal-dark);
}

.tab-panel {
  display: none;
  padding: 18px;
  box-shadow: none;
}

.tab-panel.active {
  display: block;
}

.function-matrix {
  display: grid;
  gap: 16px;
}

.function-section,
.risk-section,
.risk-entity-switcher {
  overflow-x: auto;
  box-shadow: none;
}

.risk-section,
.risk-entity-switcher {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.risk-entity-switcher {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.risk-entity-switcher h3 {
  margin-bottom: 2px;
}

.tp-profile-legend {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.tp-profile-legend h3 {
  margin-bottom: 2px;
}

.tp-legend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tp-legend-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-wash);
}

.tp-legend-card strong,
.tp-profile-result strong {
  color: var(--teal-dark);
}

.tp-legend-card span,
.tp-profile-result span,
.tp-notes-field span {
  color: var(--muted);
  line-height: 1.45;
}

.tp-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tp-profile-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.tp-profile-card h3 {
  margin-bottom: 3px;
}

.tp-profile-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tp-score-toggle {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.tp-score-toggle button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 900;
}

.tp-score-toggle button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.tp-profile-result,
.tp-notes-field {
  display: grid;
  gap: 6px;
}

.risk-super-heading {
  padding: 6px 2px 0;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entity-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.entity-toggle {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--button-bg);
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 800;
}

.entity-toggle.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.function-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--panel-wash);
  border-bottom: 1px solid var(--line);
}

.function-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.score-table {
  display: grid;
  min-width: 0;
  width: 100%;
}

.score-row,
.risk-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(5, minmax(68px, 0.45fr)) minmax(280px, 1.45fr);
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.risk-table {
  display: grid;
  min-width: 720px;
}

.risk-row {
  grid-template-columns: minmax(220px, 1fr) minmax(90px, 0.25fr) minmax(320px, 1.2fr);
}

.score-row > *,
.risk-row > * {
  min-width: 0;
}

.score-row:last-child,
.risk-row:last-child {
  border-bottom: 0;
}

.score-head,
.risk-head {
  background: var(--panel-wash);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.risk-category-cell strong {
  overflow-wrap: anywhere;
}

.entity-cell {
  display: grid;
  gap: 3px;
}

.entity-cell small {
  color: var(--muted);
}

.score-input {
  gap: 4px;
}

.score-input span {
  display: none;
}

.score-input input {
  text-align: center;
}

.score-row textarea,
.risk-row textarea {
  min-width: 0;
}

.summary-grid,
.document-summary,
.questionnaire-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.questionnaire-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  padding: 16px;
  box-shadow: none;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  color: var(--blue);
  font-size: 1.2rem;
}

.insight-grid,
.evidence-plan,
.document-list,
.questionnaire-list {
  display: grid;
  gap: 14px;
}

.insight-grid article,
.evidence-card,
.document-row,
.questionnaire-row,
.interviewee-roster,
.empty-state {
  padding: 16px;
  box-shadow: none;
}

.interviewee-roster {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.interviewee-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.interviewee-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(110px, 0.7fr);
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.interviewee-row:last-child {
  border-bottom: 0;
}

.interviewee-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.interviewee-head {
  background: var(--panel-wash);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.interviewee-empty {
  padding: 12px;
  color: var(--muted);
}

.company-people-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.alt-approach-card {
  margin-top: 16px;
}

.alt-approach-matrix {
  overflow-x: auto;
}

.alt-approach-table {
  min-width: 850px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.alt-approach-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.25fr) minmax(170px, 1.1fr) repeat(5, minmax(105px, 0.85fr));
  border-bottom: 1px solid var(--line);
}

.alt-approach-row:last-child {
  border-bottom: 0;
}

.alt-approach-row > span {
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 9px;
  border-right: 1px solid var(--line);
  font-size: 0.78rem;
}

.alt-approach-row > span:last-child {
  border-right: 0;
}

.alt-approach-row strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.alt-approach-row small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}

.alt-approach-head {
  background: var(--panel-soft);
}

.alt-approach-head > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.company-people-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: var(--panel);
}

.company-people-card h3 {
  margin: 2px 0 3px;
  font-size: 0.88rem;
  line-height: 1.2;
}

.company-people-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.25;
}

.company-card-metrics,
.person-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.company-card-metrics span,
.person-chip-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 6px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.document-upload,
.questionnaire-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-wash);
}

.fte-linkedin-field {
  grid-column: 1 / -1;
}

.individual-dempe-scoring {
  display: grid;
  gap: 12px;
}

.ai-questionnaire-builder {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ai-questionnaire-builder .panel-header {
  margin-bottom: 0;
}

#aiQuestionnaireStatus[data-tone="pass"] {
  color: var(--green);
}

#aiQuestionnaireStatus[data-tone="warn"] {
  color: var(--gold);
}

#aiQuestionnaireStatus[data-tone="fail"] {
  color: var(--red);
}

.ai-question-list {
  display: grid;
  gap: 10px;
}

.ai-question-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-wash);
}

.ai-question-card span {
  font-weight: 800;
  line-height: 1.35;
}

.ai-question-card small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.ai-score-toolbar .helper-copy {
  max-width: 520px;
  margin-bottom: 0;
  text-align: right;
}

#aiScoreStatus[data-tone="pass"] {
  color: var(--green);
}

#aiScoreStatus[data-tone="warn"] {
  color: var(--gold);
}

#aiScoreStatus[data-tone="fail"] {
  color: var(--red);
}

.individual-score-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.individual-score-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(100px, 0.35fr) minmax(100px, 0.35fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.individual-score-row:last-child {
  border-bottom: 0;
}

.individual-score-row > * {
  min-width: 0;
}

.individual-score-row strong,
.individual-score-row small {
  display: block;
}

.individual-score-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.wide-field {
  grid-column: 1 / -1;
}

.document-actions,
.questionnaire-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.document-row,
.questionnaire-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.document-row h3,
.questionnaire-row h3 {
  margin-bottom: 6px;
}

.document-row p,
.questionnaire-row p,
.empty-state {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.questionnaire-row p strong {
  color: var(--ink);
}

.dempe-score-detail {
  margin-top: 8px;
}

.document-note {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--teal);
}

.respondent-summary {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-wash);
}

.respondent-summary summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 900;
}

.respondent-summary[open] summary {
  border-bottom: 1px solid var(--line);
}

.respondent-summary-block {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
}

.respondent-summary-block + .respondent-summary-block {
  border-top: 1px solid var(--line);
}

.respondent-summary-block strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.respondent-summary-block p {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.document-type {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-row-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 10px;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.clean-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.clean-list li + li {
  margin-top: 7px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.chart-panel,
.entity-conclusion-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.pie-chart {
  width: min(260px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 10px auto 14px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
}

.pie-chart::after {
  content: "";
  position: absolute;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel);
}

.pie-chart span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.chart-legend,
.entity-conclusion-list {
  display: grid;
  gap: 8px;
}

.legend-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-item strong {
  color: var(--ink);
}

.empty-chart-note {
  margin-bottom: 0;
  color: var(--muted);
  text-align: center;
}

.entity-conclusion-panel {
  margin-top: 16px;
}

.entity-conclusion-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-wash);
}

.entity-conclusion-card h3 {
  margin-bottom: 6px;
}

.entity-conclusion-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.entity-conclusion-card > strong {
  flex: 0 0 auto;
  color: var(--blue);
}

.far-correlation-card {
  align-items: stretch;
}

.far-profile-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.far-profile-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.action-list {
  margin: 6px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.action-list-title {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 0.88rem;
}

.action-list li + li {
  margin-top: 5px;
}

.evidence-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.evidence-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.evidence-gap {
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: rgba(182, 123, 40, 0.08);
}

@media (max-width: 1120px) {
  .layout-grid,
  .workspace-header,
  .chart-grid,
  .company-people-grid,
  .evidence-card {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    align-items: flex-start;
  }

  .matrix-actions {
    justify-content: flex-start;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .saved-project-prompt {
    align-items: flex-start;
    flex-direction: column;
  }

  .function-section {
    overflow-x: auto;
  }

  .risk-entity-switcher,
  .tp-legend-grid,
  .tp-profile-grid,
  .score-row,
  .risk-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entity-toggle-group {
    justify-content: flex-start;
  }

  .score-head,
  .risk-head {
    display: none;
  }

  .score-input span {
    display: block;
  }

  .score-input input,
  .score-row textarea,
  .risk-row textarea {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .intake-card {
    padding: 22px;
  }

  .intake-hero-copy h1 {
    font-size: 2rem;
  }

  .intake-screen {
    padding: 16px;
  }

  .summary-grid,
  .document-summary,
  .questionnaire-summary,
  .document-upload,
  .questionnaire-form,
  .case-switcher,
  .individual-score-row,
  .interviewee-row {
    grid-template-columns: 1fr;
  }

  .fte-linkedin-field {
    grid-column: auto;
  }

  .document-row,
  .questionnaire-row,
  .entity-conclusion-card {
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
  }
}
