:root {
  color-scheme: light;
  --paper: #f4f2ed;
  --surface: #fbfaf7;
  --surface-strong: #ffffff;
  --ink: #18231f;
  --muted: #66706b;
  --line: #dcded8;
  --line-strong: #c9cdc5;
  --accent: #1e695f;
  --accent-soft: #dcebe7;
  --risk: #c95f47;
  --risk-soft: #f3ded8;
  --strength: #2f8a62;
  --process: #946c25;
  --process-soft: #eee2cb;
  --fact: #536e89;
  --fact-soft: #dfe8ef;
  --person: #74588d;
  --person-soft: #e9e1ef;
  --other: #7a817d;
  --shadow: 0 18px 44px rgba(28, 39, 34, 0.08);
  --radius: 18px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

.app-header {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.96);
}

.header-session {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 0.78rem;
}

.account-menu > span {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.account-link {
  text-decoration: none;
}

.settings-page {
  overflow: auto;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(30, 105, 95, 0.1), transparent 30%),
    var(--paper);
}

.settings-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.96);
}

.settings-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.settings-nav a {
  text-decoration: none;
}

.settings-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 62px 0 80px;
}

.narrow-settings {
  width: min(680px, calc(100% - 40px));
}

.settings-heading {
  margin-bottom: 28px;
}

.settings-heading h1 {
  margin: 5px 0 10px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.settings-heading > p:last-child,
.settings-heading > div > p:last-child {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.account-stat {
  min-width: 120px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}

.account-stat strong,
.account-stat span {
  display: block;
}

.account-stat strong {
  font-size: 2rem;
}

.account-stat span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.settings-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.narrow-settings .settings-card {
  padding: 30px;
}

.profile-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.profile-summary span,
.settings-form small {
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.settings-form label {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 750;
}

.settings-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-strong);
  outline: none;
}

.settings-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.settings-submit {
  margin-top: 20px;
}

.form-feedback {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.form-error {
  color: #8a3527;
  background: var(--risk-soft);
}

.form-success {
  color: #145b3e;
  background: #dff2e7;
}

.admin-card {
  padding: 8px;
}

.table-scroll {
  overflow-x: auto;
}

.accounts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.accounts-table th,
.accounts-table td {
  padding: 17px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.accounts-table tr:last-child td {
  border-bottom: 0;
}

.accounts-table th {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.accounts-table td:first-child strong,
.accounts-table td:first-child span {
  display: block;
}

.accounts-table td:first-child span {
  max-width: 310px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}

.role-badge,
.status-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
}

.role-admin {
  color: #4c377d;
  background: var(--person-soft);
}

.role-viewer {
  color: #31546f;
  background: var(--fact-soft);
}

.is-enabled {
  color: #145b3e;
  background: #dff2e7;
}

.is-disabled {
  color: #6a6f6c;
  background: #e8e9e6;
}

.account-actions {
  display: flex;
  gap: 7px;
  min-width: 205px;
}

.danger-button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #e1a99c;
  border-radius: 9px;
  color: #8a3527;
  background: #fff4f1;
  font-size: 11px;
  font-weight: 750;
}

.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.credential-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(24, 35, 31, 0.26);
}

.credential-dialog::backdrop {
  background: rgba(24, 35, 31, 0.52);
  backdrop-filter: blur(3px);
}

.credential-card {
  padding: 30px;
}

.credential-card h2 {
  margin: 6px 0 10px;
}

.credential-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

#temporary-password {
  display: block;
  margin: 22px 0;
  padding: 16px;
  border: 1px dashed var(--accent);
  border-radius: 11px;
  background: var(--accent-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 750;
  text-align: center;
  user-select: all;
}

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.dialog-actions .primary-button {
  margin: 0;
}

.login-page {
  overflow: auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 15% 15%, rgba(30, 105, 95, 0.14), transparent 34%),
    radial-gradient(circle at 85% 82%, rgba(148, 108, 37, 0.12), transparent 32%),
    var(--paper);
}

.login-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-intro,
.login-card {
  padding: clamp(32px, 6vw, 64px);
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 560px;
  background: linear-gradient(145deg, #173f39, #1e695f);
  color: #f7faf8;
}

.login-brand {
  margin-bottom: auto;
  color: inherit;
  text-decoration: none;
}

.login-brand small,
.login-intro .eyebrow {
  color: rgba(247, 250, 248, 0.7);
}

.login-intro h1 {
  max-width: 12ch;
  margin: 10px 0 20px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.login-intro > p:last-child {
  max-width: 46ch;
  color: rgba(247, 250, 248, 0.8);
  line-height: 1.65;
}

.login-card {
  align-self: center;
}

.login-card h2 {
  margin: 5px 0 8px;
  font-size: 1.8rem;
}

.login-help,
.login-notice {
  color: var(--muted);
  line-height: 1.5;
}

#login-form {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

#login-form label {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 750;
}

#login-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

#login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-submit {
  width: 100%;
  margin-top: 16px;
}

.login-error {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--risk-soft);
  color: #8a3527;
  font-size: 0.82rem;
}

.login-notice {
  margin: 22px 0 0;
  font-size: 0.75rem;
}

@media (max-width: 760px) {
  .login-page {
    padding: 16px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 300px;
  }

  .login-brand {
    margin-bottom: 56px;
  }

  .header-session {
    gap: 8px;
  }

  .account-menu > span {
    display: none;
  }
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-strong);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  height: 1px;
  background: var(--accent);
  transform-origin: left center;
}

.brand-mark::before {
  width: 15px;
  top: 13px;
  left: 9px;
  transform: rotate(28deg);
}

.brand-mark::after {
  width: 13px;
  top: 21px;
  left: 8px;
  transform: rotate(-24deg);
}

.brand-mark i {
  position: absolute;
  z-index: 1;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface-strong);
  border-radius: 50%;
  background: var(--accent);
}

.brand-mark i:nth-child(1) {
  top: 7px;
  left: 7px;
}

.brand-mark i:nth-child(2) {
  top: 12px;
  right: 6px;
}

.brand-mark i:nth-child(3) {
  bottom: 6px;
  left: 8px;
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.view-button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.view-button:hover,
.view-button:focus-visible {
  color: var(--ink);
}

.view-button.is-active {
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 2px 10px rgba(28, 39, 34, 0.08);
}

.view-button[data-view="strengths"].is-active {
  color: #236b4a;
  background: #e3f2e9;
}

.header-chat-button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #f7fffc;
  background: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.header-chat-button:hover,
.header-chat-button:focus-visible {
  background: #15574e;
}

.api-state {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1943a;
  box-shadow: 0 0 0 4px #f4e9d6;
}

.api-state.is-online .state-dot {
  background: #4f8f65;
  box-shadow: 0 0 0 4px #e1eee4;
}

.api-state.is-offline .state-dot {
  background: var(--risk);
  box-shadow: 0 0 0 4px var(--risk-soft);
}

.workspace {
  height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 300px minmax(460px, 1fr) 340px;
  gap: 12px;
  padding: 12px;
}

.control-panel,
.graph-shell,
.details-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.control-panel,
.details-panel {
  overflow-y: auto;
}

.control-panel {
  padding: 8px 20px 20px;
}

.panel-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  border-bottom: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 250px;
  margin-bottom: 10px;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

label,
.section-heading {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 750;
}

.search-section {
  position: relative;
  z-index: 4;
}

.search-box {
  position: relative;
}

.search-box input,
.path-controls select,
.issue-filter-grid select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: var(--surface-strong);
}

.search-box input {
  padding: 0 42px 0 12px;
}

.search-box input:focus,
.path-controls select:focus-visible,
.issue-filter-grid select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box kbd {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 23px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font-size: 11px;
}

.search-results {
  position: absolute;
  top: calc(100% - 14px);
  left: 0;
  right: 0;
  max-height: 310px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  text-align: left;
  background: transparent;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--paper);
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.current-node {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.current-node strong,
.current-node small {
  display: block;
}

.current-node strong {
  font-size: 13px;
}

.current-node small {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.type-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--other);
}

.type-tool {
  background: var(--accent);
}

.type-process {
  background: var(--process);
}

.type-fact {
  background: var(--fact);
}

.type-risk {
  background: var(--risk);
}

.type-strength {
  background: var(--strength);
}

.type-issue {
  background: var(--person);
}

.type-person {
  background: var(--person);
}

.type-other {
  background: var(--other);
}

.path-controls {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 8px;
}

.path-controls select {
  padding: 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.issue-filter-grid {
  display: grid;
  gap: 12px;
}

.issue-filter-grid label {
  margin: 0;
}

.issue-filter-grid select {
  width: 100%;
  height: 40px;
  margin-top: 7px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.filter-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.primary-button {
  width: 100%;
  min-height: 42px;
  margin-top: 9px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #16564e;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 11px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend .type-dot {
  margin-top: 0;
}

.graph-shell {
  position: relative;
  overflow: hidden;
  background-color: #f8f7f3;
  background-image:
    linear-gradient(#e7e8e2 1px, transparent 1px),
    linear-gradient(90deg, #e7e8e2 1px, transparent 1px);
  background-size: 24px 24px;
}

.graph-toolbar {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  right: 14px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 222, 216, 0.9);
  border-radius: 13px;
  background: rgba(251, 250, 247, 0.92);
  box-shadow: 0 8px 24px rgba(28, 39, 34, 0.06);
  backdrop-filter: blur(12px);
}

.graph-toolbar h2 {
  max-width: 430px;
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-toolbar .eyebrow {
  margin-bottom: 4px;
}

.graph-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.graph-stats span {
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.graph-stats strong {
  color: var(--ink);
}

.graph-stats button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  font-size: 10px;
  font-weight: 750;
}

#cy {
  position: absolute;
  inset: 0;
}

.loading-layer,
.graph-message {
  position: absolute;
  z-index: 5;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(248, 247, 243, 0.84);
  backdrop-filter: blur(4px);
}

.loading-layer:not([hidden]),
.graph-message:not([hidden]) {
  display: flex;
}

.loading-layer strong,
.graph-message strong {
  font-size: 13px;
}

.graph-message span {
  max-width: 320px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.loader {
  width: 28px;
  height: 28px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.graph-hint {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(251, 250, 247, 0.9);
  font-size: 10px;
}

.details-panel {
  padding: 20px;
}

.details-empty {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 30px 12px;
  text-align: center;
}

.details-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--accent);
  background: var(--surface-strong);
  font-size: 28px;
}

.details-empty h2 {
  margin-bottom: 9px;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.details-empty p {
  max-width: 250px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.detail-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-title {
  margin-bottom: 7px;
  font-size: 23px;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.detail-id {
  margin: 0 0 18px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 20px;
}

.secondary-button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-strong);
  font-size: 11px;
  font-weight: 750;
}

.detail-block {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.detail-block h3 {
  margin: 0 0 11px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.property-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.property-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.7fr) 1fr;
  gap: 10px;
  font-size: 11px;
}

.property-row dt {
  color: var(--muted);
}

.property-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.evidence-list,
.collection-list,
.path-list {
  display: grid;
  gap: 10px;
}

.collection-section-title {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evidence-card,
.collection-card,
.path-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
}

.evidence-card header,
.collection-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font-size: 9px;
  font-weight: 750;
}

.status-pill.is-candidate {
  color: #825a18;
  background: #f2e5c9;
}

.status-pill.is-confirmed,
.status-pill.is-validated {
  color: #356047;
  background: #e0eee5;
}

.evidence-card strong,
.collection-card strong {
  font-size: 11px;
}

.evidence-card p,
.collection-card p,
.path-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.evidence-card blockquote {
  margin: 10px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--accent-soft);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.5;
}

.collection-card,
.path-card {
  width: 100%;
  text-align: left;
}

.issue-card header {
  align-items: flex-start;
}

.strength-card {
  border-left: 4px solid var(--strength);
}

.strength-card header {
  align-items: flex-start;
}

.strength-card strong {
  line-height: 1.35;
}

.strength-category {
  color: var(--strength) !important;
  font-weight: 750;
}

.strength-limit-note {
  margin: 10px 0 12px;
  padding: 9px 10px;
  border-left: 3px solid var(--strength);
  background: #edf7f1;
}

.strength-summary {
  border-top: 3px solid var(--strength);
}

.issue-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.issue-rank {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.issue-card .issue-title {
  line-height: 1.35;
}

.issue-metrics {
  color: var(--ink) !important;
  font-weight: 650;
}

.dominant-themes {
  margin-top: 7px;
}

button.collection-card:hover,
button.path-card:hover {
  border-color: var(--accent);
}

.collection-meta {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid #e1a99c;
  border-radius: 10px;
  color: #7d3324;
  background: #fff4f1;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 650;
}

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

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

.chat-backdrop {
  position: fixed;
  z-index: 24;
  inset: 76px 0 0;
  background: rgba(24, 35, 31, 0.28);
  backdrop-filter: blur(2px);
}

.chat-drawer {
  position: fixed;
  z-index: 25;
  top: 76px;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(470px, 100vw);
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -22px 0 50px rgba(24, 35, 31, 0.16);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-header h2 {
  margin: 3px 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  font-size: 1.35rem;
  line-height: 1;
}

.chat-notice {
  padding: 11px 22px;
  border-bottom: 1px solid #c6ded7;
  color: #315e54;
  background: #e8f3ef;
  font-size: 0.76rem;
  line-height: 1.45;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 22px;
}

.chat-message {
  max-width: 92%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 5px;
  background: var(--surface-strong);
}

.chat-message > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.62;
}

.chat-user-message {
  align-self: flex-end;
  border-color: #b8d5ce;
  border-radius: 15px 15px 5px 15px;
  background: var(--accent-soft);
}

.chat-message.is-pending p {
  color: var(--muted);
  font-style: italic;
}

.chat-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.chat-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #315e54;
  background: #f3f8f6;
  font-size: 0.7rem;
  font-weight: 700;
}

.chat-source .type-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
}

.chat-form {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
}

.chat-form textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.chat-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.chat-form-footer small {
  color: var(--muted);
  font-size: 0.68rem;
}

.chat-form-footer .primary-button {
  width: auto;
  min-width: 94px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 280px 1fr;
  }

  .details-panel {
    position: absolute;
    z-index: 8;
    top: 88px;
    right: 12px;
    bottom: 12px;
    width: min(340px, calc(100vw - 320px));
    box-shadow: var(--shadow);
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-header {
    height: auto;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 12px;
  }

  .view-switcher {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    justify-content: stretch;
    order: 3;
  }

  .view-button {
    flex: 1 1 28%;
  }

  .header-chat-button {
    flex: 1 1 100%;
  }

  .chat-backdrop {
    inset: 0;
  }

  .chat-drawer {
    top: 0;
  }

  .workspace {
    height: auto;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .control-panel {
    max-height: none;
  }

  .graph-shell {
    min-height: 70vh;
  }

  .details-panel {
    position: static;
    width: auto;
    min-height: 360px;
  }

  .graph-toolbar {
    align-items: flex-start;
  }

  .graph-stats {
    display: grid;
    grid-template-columns: auto auto;
  }

  .graph-stats button {
    grid-column: 1 / -1;
  }

  .graph-hint {
    left: 14px;
    text-align: center;
  }

  .account-link {
    display: none;
  }

  .settings-header {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .settings-header .brand small {
    display: none;
  }

  .settings-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
  }

  .settings-main,
  .narrow-settings {
    width: min(100% - 24px, 680px);
    padding: 38px 0 60px;
  }

  .admin-heading {
    align-items: flex-start;
  }

  .account-stat {
    min-width: 88px;
    padding: 13px;
  }

  .narrow-settings .settings-card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
