﻿:root {
  color-scheme: light;
  --ink: #000000;
  --muted: #51565E;
  --line: #91C7DE;
  --panel: #ffffff;
  --surface: #F2F2F2;
  --accent: #0777A8;
  --accent-strong: #134E84;
  --idrn-black: #000000;
  --idrn-gray: #51565E;
  --idrn-navy: #134E84;
  --idrn-blue: #0777A8;
  --idrn-sky: #91C7DE;
  --idrn-gold: #F0D886;
  --idrn-light: #F2F2F2;
  --danger: #b42318;
  --warning: #51565E;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
}

body.auth-locked .app-shell {
  display: none;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #f2f2f2 0%, #d7eef7 48%, #f0d886 100%);
}

.auth-panel {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid rgba(7, 119, 168, 0.22);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(19, 78, 132, 0.18);
}

.auth-panel h1 {
  margin: -6px 0 4px;
  color: var(--idrn-navy);
}

.auth-note,
.auth-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.auth-panel button {
  background: var(--idrn-navy);
  color: #ffffff;
  font-weight: 800;
}

.auth-panel button:hover {
  background: var(--idrn-blue);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  min-height: 100vh;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  overflow: auto;
  padding: 18px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.control-panel > * {
  flex-shrink: 0;
}

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

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.7rem;
  line-height: 1.08;
}

h2 {
  font-size: 1rem;
}

.eyebrow,
.muted,
small {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.identity-panel,
.entry-panel,
.filter-panel,
.admin-panel,
.audit-panel {
  display: grid;
  gap: 14px;
}

.identity-panel {
  margin: -18px -18px 0;
  padding: 18px;
  border-bottom: 0;
  background: var(--idrn-navy);
  color: #ffffff;
}

body.dev-machine .identity-panel {
  background: #9f1d20;
}

.identity-panel h1 {
  color: #fff;
}

.app-version-label {
  min-height: 14px;
  margin-top: 3px;
  color: var(--idrn-sky);
  font-size: 0.7rem;
  font-style: italic;
  line-height: 1.2;
}

.identity-panel .eyebrow {
  color: var(--idrn-sky);
}

.identity-panel label {
  color: var(--idrn-light);
}

.identity-panel input {
  border-color: var(--idrn-sky);
  background: #ffffff;
}

.identity-panel button:not(.ghost-button) {
  background: var(--idrn-gold);
  color: var(--idrn-navy);
  font-weight: 800;
}

.identity-panel button:not(.ghost-button):hover {
  background: #fff0a8;
}

.identity-panel .session-card {
  border-color: rgba(145, 199, 222, 0.7);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
}

.identity-panel .session-card .muted {
  color: var(--idrn-sky);
}

.identity-panel .ghost-button {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.identity-panel .ghost-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.login-form,
.relationship-form,
.import-form,
.merge-form,
.user-management-form {
  display: grid;
  gap: 12px;
}

.admin-accordion {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(7, 119, 168, 0.26);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.admin-accordion + .admin-accordion {
  margin-top: -4px;
}

.admin-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  background: var(--idrn-blue);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.admin-accordion summary::-webkit-details-marker {
  display: none;
}

.admin-accordion summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
}

.admin-accordion[open] summary {
  border-bottom: 1px solid rgba(7, 119, 168, 0.26);
  background: var(--idrn-navy);
}

.admin-accordion[open] summary::after {
  content: "-";
}

.admin-accordion > form,
.admin-accordion > .audit-list,
.admin-accordion > .user-list {
  padding: 12px;
}

label,
fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #344054;
  font-size: 0.88rem;
  font-weight: 650;
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 74px;
  resize: vertical;
}

input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--accent);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #475467;
}

.segmented-control input:checked + span {
  border-color: var(--accent);
  background: #e8f4f5;
  color: var(--accent-strong);
}

.section-heading,
.session-card,
.range-row,
.graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-panel > .section-heading {
  margin: 0 -18px;
  padding: 12px 18px;
  background: var(--idrn-navy);
  color: #ffffff;
}

.admin-panel > .section-heading h2 {
  color: #ffffff;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
}

.view-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-action-row button {
  border: 1px solid rgba(7, 119, 168, 0.34);
  border-radius: 6px;
  padding: 7px 11px;
  background: #134e84;
  color: #ffffff;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.view-action-row button:hover {
  background: #0777a8;
}

.share-status {
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.session-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover,
.icon-button:hover {
  background: #f2f4f7;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.status-pill {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #ecfdf3;
  color: #067647;
  font-size: 0.76rem;
  font-weight: 750;
}

.warning-pill {
  background: var(--idrn-gold);
  color: var(--idrn-black);
}

.admin-accordion summary .status-pill {
  background: var(--idrn-gold);
  color: var(--idrn-black);
}

.admin-accordion summary:hover {
  background: #0b6f94;
}

.admin-accordion[open] summary:hover {
  background: var(--idrn-navy);
}

.slider-label {
  grid-template-columns: 1fr auto;
}

.slider-label input {
  grid-column: 1 / -1;
}

output {
  color: var(--accent-strong);
  font-weight: 800;
}

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

.org-type-filter {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.org-type-filter legend {
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.org-type-filter.inactive legend,
.org-type-filter.inactive .switch {
  color: #98a2b3;
}

.org-type-filter.inactive .switch span {
  opacity: 0.62;
}

.org-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 0.82rem;
}

.switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.switch span {
  position: relative;
  flex: 0 0 34px;
  height: 20px;
  border-radius: 999px;
  background: #d0d5dd;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(14px);
}

.wide-switch {
  padding: 2px 0;
}

.search-panel,
.range-filter,
.focus-filter {
  display: grid;
  gap: 8px;
}

.search-panel {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.search-results {
  display: grid;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.search-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.search-results button:hover {
  background: #f2f4f7;
}

.search-results span {
  color: var(--muted);
  font-size: 0.76rem;
}

.entity-search-results {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  margin-top: -6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
}

.entity-search-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.entity-search-results button:hover {
  background: #f2f4f7;
}

.entity-search-results span {
  color: var(--muted);
  font-size: 0.74rem;
}

.focus-filter {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.focus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.focus-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.backup-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(7, 119, 168, 0.2);
  border-radius: 8px;
  background: #f7fbfd;
}

.backup-tools p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.backup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.backup-tools > button {
  width: 100%;
}

.audit-list article {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-audit {
  border-color: #fedf89;
  background: #fffbeb;
}

.merge-preview,
.import-preview {
  min-height: 42px;
  border: 1px dashed #d0d5dd;
  border-radius: 8px;
  padding: 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.import-preview {
  display: grid;
  gap: 3px;
}

.csv-format-help-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.48);
}

.mass-sector-edit-dialog {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.48);
}

.conx-path-search-dialog {
  position: fixed;
  inset: 0;
  z-index: 86;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.conx-path-search-card {
  display: grid;
  gap: 12px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.conx-path-search-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.conx-path-search-results {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.conx-path-search-results button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.conx-path-search-results button:hover,
.conx-path-search-results button:focus-visible {
  border-color: #91c7de;
  background: #eef7fb;
  outline: none;
}

.conx-path-search-results span {
  color: var(--muted);
  font-size: 0.76rem;
}

.mass-sector-edit-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(980px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.mass-sector-edit-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
}

.mass-sector-edit-controls fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}

.mass-sector-summary {
  grid-column: 1 / -1;
  border: 1px solid rgba(7, 119, 168, 0.22);
  border-radius: 8px;
  padding: 9px;
  background: #eef7fb;
  color: #134e84;
  font-size: 0.84rem;
  font-weight: 750;
}

.mass-sector-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.mass-sector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  cursor: pointer;
}

.mass-sector-row:hover {
  border-color: #91c7de;
  background: #eef7fb;
}

.mass-sector-row.selected {
  border-color: #134e84;
  background: #d7eef7;
  color: #134e84;
}

.mass-sector-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mass-sector-row small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.mass-sector-row label {
  min-width: 112px;
  font-size: 0.78rem;
}

.mass-sector-click-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mass-sector-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.csv-format-help-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(980px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 48px));
  max-height: min(820px, calc(100vh - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.csv-format-help-content {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 12px 4px 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.csv-format-help-content h3,
.csv-format-help-content p {
  margin: 0;
}

.csv-format-help-content h3 {
  color: #134e84;
  font-size: 1rem;
}

.csv-format-help-content .csv-pro-tip {
  border-left: 4px solid #134e84;
  padding: 9px 11px;
  background: #eef7fb;
  color: #134e84;
  font-size: 0.94rem;
}

.csv-format-help-content ul {
  margin: 0;
  padding-left: 20px;
}

.csv-format-help-content pre {
  margin: 0;
  overflow: visible;
  min-height: 96px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: #1d2939;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.csv-format-help-content code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.secondary-button {
  border: 1px solid rgba(7, 119, 168, 0.34);
  border-radius: 6px;
  padding: 8px 10px;
  background: #eef7fb;
  color: #134e84;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button:hover {
  background: #d7eef7;
}

.possible-duplicates-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.possible-duplicates-list > strong {
  font-size: 0.86rem;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.user-card div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.possible-duplicates-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid rgba(7, 119, 168, 0.2);
  border-radius: 7px;
  padding: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.possible-duplicates-list button:hover {
  background: #eef7fb;
}

.possible-duplicates-list small {
  color: var(--muted);
  font-size: 0.76rem;
}

.menu-help {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(7, 119, 168, 0.22);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.menu-help p {
  margin: 0;
}

.review-progress {
  display: grid;
  gap: 8px;
}

.review-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7eef7;
}

.review-progress-bar span {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: #0777a8;
  animation: review-progress-slide 0.9s ease-in-out infinite;
}

.repair-panel,
.repair-assessment {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(7, 119, 168, 0.22);
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1.4;
}

.repair-panel p,
.repair-assessment p {
  margin: 0;
}

.repair-assessment {
  border-color: rgba(19, 78, 132, 0.28);
  background: #eef7fb;
}

.repair-assessment ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.repair-assessment small {
  color: #134e84;
  font-weight: 700;
}

.repair-status {
  min-height: 18px;
  padding: 7px 9px;
  border: 1px solid rgba(7, 119, 168, 0.2);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

@keyframes review-progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(240%); }
}

.success-preview {
  border-color: #7cd4a6;
  background: #ecfdf3;
  color: #067647;
}

.error-preview {
  border-color: #fda29b;
  background: #fff1f0;
  color: var(--danger);
}

button:disabled {
  background: #98a2b3;
  cursor: not-allowed;
}

.audit-list span,
.audit-list small {
  font-size: 0.78rem;
}

.graph-stage {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  border-bottom: 0;
  background:
    linear-gradient(rgba(23, 32, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 51, 0.045) 1px, transparent 1px),
    #eef3f7;
  background-size: 28px 28px;
}

.graph-toolbar {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  right: 16px;
  align-items: flex-start;
  pointer-events: none;
}

.graph-toolbar > div:first-child {
  display: grid;
  gap: 4px;
  min-width: min(360px, 42vw);
  padding: 10px 12px;
  border: 1px solid rgba(217, 222, 232, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

#active-filter-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.graph-spacing-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding-top: 4px;
  color: #344054;
  font-size: 0.78rem;
}

.graph-spacing-control input {
  grid-column: 1 / -1;
  min-height: 22px;
}

.location-unlock-button {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: 6px;
  border: 1px solid rgba(7, 119, 168, 0.45);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--idrn-navy);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.location-unlock-button:hover,
.location-unlock-button:focus-visible {
  background: var(--idrn-blue);
  outline: none;
}

.conx-path-idrn-notice {
  margin-top: 6px;
  border: 1px solid #d6a92f;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--idrn-gold);
  color: var(--idrn-black);
  font-size: 0.82rem;
  font-weight: 900;
}

.hidden-node-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.hidden-node-list span {
  font-weight: 700;
}

.hidden-node-list button {
  max-width: 150px;
  border: 1px solid rgba(20, 108, 117, 0.24);
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef9fa;
  color: #0f5f68;
  font-size: 0.76rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden-node-list button:hover {
  background: #dff3f5;
}

.legend {
  position: relative;
  display: grid;
  justify-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 230px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(145, 199, 222, 0.5);
  pointer-events: auto;
}

.legend-title {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: #134e84;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-align: left;
}

.legend-title small {
  color: #f0d886;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.legend-title:hover,
.legend-title:focus-visible {
  background: #0777a8;
  outline: none;
}

.legend-section {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 100%;
}

.legend-section-label {
  width: 100%;
  color: #51565e;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.legend-grid {
  display: grid;
  justify-content: center;
  gap: 6px;
}

.sector-legend-grid {
  grid-template-columns: repeat(3, minmax(38px, 1fr));
}

.person-status-grid {
  grid-template-columns: repeat(5, minmax(30px, 1fr));
}

.legend-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  border: 1px solid rgba(217, 222, 232, 0.9);
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 750;
}

.legend-item {
  cursor: help;
}

.person-status-item {
  min-width: 30px;
}

.legend-item:hover,
.legend-item:focus-visible {
  border-color: var(--accent);
  background: #e8f4f5;
  outline: none;
}

.person-status-item.selected {
  border-color: #134e84;
  background: #134e84;
  color: #fff;
}

.sector-filter-item.selected {
  border-color: #134e84;
  background: #134e84;
  color: #fff;
}

.sector-filter-item.selected i {
  outline: 2px solid rgba(255, 255, 255, 0.85);
}

.legend-clear-filter {
  min-height: 28px;
  border: 1px solid #91c7de;
  border-radius: 999px;
  padding: 0 10px;
  background: #f2f2f2;
  color: #134e84;
  font-size: 0.72rem;
  font-weight: 850;
}

.legend-clear-filter:hover,
.legend-clear-filter:focus-visible {
  border-color: #0777a8;
  background: #e7f5fa;
  outline: none;
}

.legend-clear-all {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 0 0 8px 8px;
  padding: 6px 10px;
  background: #134e84;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.legend-clear-all:hover,
.legend-clear-all:focus-visible {
  background: #0777a8;
  outline: none;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-explanation {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 25;
  display: grid;
  gap: 5px;
  width: min(340px, 92vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
}

.legend-explanation p {
  color: #344054;
  font-size: 0.84rem;
  line-height: 1.35;
}

.legend-explanation small {
  line-height: 1.35;
}

.help-popover {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 6px;
  width: min(330px, calc(100vw - 24px));
  border: 1px solid rgba(7, 119, 168, 0.32);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
}

.help-popover small {
  color: #134e84;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.help-popover strong {
  color: #134e84;
  font-size: 0.95rem;
}

.help-popover p {
  margin: 0;
  color: #344054;
  font-size: 0.84rem;
  line-height: 1.35;
}

.help-popover button {
  justify-self: start;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.help-detail-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.help-detail-card {
  display: grid;
  gap: 13px;
  width: min(640px, calc(100vw - 40px));
  max-height: min(680px, calc(100vh - 48px));
  border: 1px solid rgba(7, 119, 168, 0.32);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.help-detail-card h2 {
  margin: 0;
  color: #134e84;
  font-size: 1.12rem;
}

.help-detail-content {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
  color: #344054;
  font-size: 0.95rem;
  line-height: 1.5;
}

.help-detail-content p {
  margin: 0;
}

.help-detail-summary {
  border-left: 4px solid var(--idrn-yellow);
  padding: 8px 10px;
  background: rgba(254, 218, 73, 0.2);
  color: var(--ink);
  font-weight: 750;
}

.help-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.app-message-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}

.app-message-dialog.positioned {
  display: block;
}

.app-message-card {
  display: grid;
  gap: 13px;
  width: min(460px, calc(100vw - 40px));
  border: 1px solid rgba(7, 119, 168, 0.32);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.app-message-dialog.positioned .app-message-card {
  position: fixed;
}

.app-message-card h2 {
  margin: 0;
  color: #134e84;
  font-size: 1.12rem;
}

.app-message-content {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 0.92rem;
  line-height: 1.45;
}

.app-message-content p {
  margin: 0;
}

.app-message-input {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

.app-message-input input {
  min-height: 38px;
}

.app-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.conx-close-confirm {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.conx-close-confirm-card {
  display: grid;
  gap: 7px;
  width: min(340px, calc(100vw - 40px));
  border: 1px solid rgba(7, 119, 168, 0.32);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--ink);
  pointer-events: auto;
}

.conx-close-confirm-card strong {
  color: #134e84;
  font-size: 1rem;
}

.conx-close-confirm-card p {
  margin: 0;
  color: #344054;
  font-size: 0.84rem;
  line-height: 1.35;
}

.conx-close-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.conx-close-confirm-actions button {
  min-height: 34px;
  border: 1px solid rgba(7, 119, 168, 0.34);
  border-radius: 7px;
  background: #eef7fb;
  color: var(--idrn-navy);
  font-size: 0.78rem;
  font-weight: 900;
}

.conx-close-confirm-actions [data-conx-close-confirm] {
  background: var(--idrn-navy);
  color: #ffffff;
}

#network-graph {
  width: 100%;
  height: 100vh;
  display: block;
  cursor: grab;
}

#network-graph:active {
  cursor: grabbing;
}

.link {
  opacity: 0.68;
  cursor: context-menu;
  pointer-events: stroke;
}

.conx-path-rail {
  stroke: #ff6b00;
  stroke-linecap: round;
  opacity: 0.94;
  pointer-events: none;
}

.conx-more-badge {
  pointer-events: none;
}

.conx-more-badge circle {
  fill: rgba(177, 223, 241, 0.76);
  stroke: rgba(19, 78, 132, 0.34);
  stroke-width: 1.5px;
  cursor: context-menu;
  pointer-events: all;
}

.conx-more-badge text {
  text-anchor: middle;
  fill: #134e84;
  font-weight: 900;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 3px;
  paint-order: stroke;
}

.conx-more-count {
  font-size: 0.9rem;
}

.conx-more-label {
  font-size: 0.74rem;
  text-transform: uppercase;
}

.conx-context-picker {
  position: absolute;
  z-index: 24;
  display: grid;
  gap: 8px;
  width: 280px;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.conx-context-picker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.conx-context-picker-actions button {
  min-height: 32px;
  border: 1px solid rgba(7, 119, 168, 0.34);
  border-radius: 7px;
  background: #eef7fb;
  color: var(--idrn-navy);
  font-size: 0.74rem;
  font-weight: 900;
}

.conx-context-picker-actions [data-conx-context-add],
.conx-context-picker-actions [data-conx-context-add-all] {
  background: var(--idrn-navy);
  color: #ffffff;
}

.conx-context-picker-list {
  display: grid;
  gap: 6px;
  max-height: 292px;
  overflow: auto;
  padding-right: 3px;
}

.conx-context-picker-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: #f8fafc;
}

.conx-context-picker-list label.already-visible {
  border-color: #91c7de;
  background: #eef7fb;
}

.conx-context-picker-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.conx-context-picker-list strong,
.conx-context-picker-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conx-context-picker-list small {
  color: var(--muted);
  font-size: 0.72rem;
}

.link.positive {
  stroke: #146c75;
}

.link.potential {
  stroke: #667085;
  stroke-dasharray: 4 5;
}

.link.negative {
  stroke: var(--danger);
}

.link.strength-positive-intense {
  stroke: #111827;
}

.link.strength-positive-important {
  stroke: #146c75;
}

.link.strength-positive-low {
  stroke: #2563eb;
}

.link.strength-zero {
  stroke: #db2777;
}

.link.strength-negative-low {
  stroke: #dc2626;
  stroke-dasharray: 1 7;
  stroke-linecap: round;
  opacity: 0.95;
}

.link.strength-negative-high {
  stroke: #dc2626;
  stroke-dasharray: none;
  stroke-linecap: butt;
  opacity: 0.95;
}

.link.needs-confirmation {
  stroke-dasharray: 2 6;
}

.link.strength-negative-low.needs-confirmation {
  stroke-dasharray: 1 7;
}

.link.strength-negative-high.needs-confirmation {
  stroke-dasharray: none;
}

.node {
  filter: drop-shadow(0 7px 9px rgba(15, 23, 42, 0.18));
  cursor: context-menu;
}

.node.conx-count-node {
  cursor: default;
  filter: drop-shadow(0 8px 10px rgba(19, 78, 132, 0.26));
}

.conx-count-label {
  fill: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  pointer-events: none;
  stroke: none;
}

.node-image {
  cursor: context-menu;
  filter: drop-shadow(0 10px 14px rgba(15, 23, 42, 0.24));
}

.node-image.primary-focus-node-image {
  filter: drop-shadow(0 14px 18px rgba(20, 108, 117, 0.36));
}

.node.primary-focus-node {
  fill: #ff6b00;
  stroke: #7c2d12;
  stroke-width: 4px;
  filter: drop-shadow(0 11px 15px rgba(124, 45, 18, 0.32));
}

.node.conx-path-endpoint-node,
.conx-path-endpoint-image-ring {
  fill: rgba(255, 107, 0, 0.16);
  stroke: #7c2d12;
  stroke-width: 3px;
  filter: drop-shadow(0 11px 15px rgba(124, 45, 18, 0.32));
}

.node.conx-path-endpoint-node {
  fill: #ff6b00;
  stroke-width: 4px;
}

.node-label {
  fill: #1d2939;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  pointer-events: none;
}

.node-label.organization-label {
  fill: #6b7280;
}

.node-label.primary-focus-label {
  font-size: 1.56rem;
}

.node-label.conx-path-node-label {
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 5px;
}

.node-label.conx-path-target-label {
  font-size: 1.34rem;
  font-weight: 900;
}

.node-label.idrn-network-label {
  font-size: 1.08rem;
  font-weight: 900;
}

.conx-path-clear-button {
  display: block;
  width: 100%;
  max-width: 520px;
  margin-top: 6px;
  border: 1px solid rgba(19, 78, 132, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
  background: #134e84;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.conx-path-clear-button:hover,
.conx-path-clear-button:focus-visible {
  background: #0777a8;
  outline: none;
}

.node-label.idrn-network-label.primary-focus-label {
  font-size: 1.7rem;
}

.node-details {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  display: grid;
  gap: 7px;
  width: min(320px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.node-details > button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.node-website-link {
  display: inline-grid;
  width: fit-content;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
}

.node-website-link:hover {
  background: #e8f4f5;
}

.relationship-load-score {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #91c7de;
  border-radius: 7px;
  padding: 8px 10px;
  background: #f7fbfc;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 850;
}

.relationship-load-score strong {
  display: inline-flex;
  align-items: baseline;
  color: #134e84;
  font-size: 0.95rem;
}

.relationship-score-limit {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: context-menu;
  font: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.relationship-score-current,
.relationship-score-limit.readonly {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.relationship-score-limit.readonly {
  cursor: help;
}

.relationship-score-limit:hover,
.relationship-score-limit:focus-visible,
.relationship-score-current:hover,
.relationship-score-current:focus-visible {
  color: #0777a8;
  outline: none;
}

.relationship-score-explanation {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(320px, 86vw);
}

.relationship-load-score.over-limit {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.relationship-load-score.over-limit strong {
  color: #dc2626;
}

.country-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.country-link-list a {
  display: inline-grid;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
}

.country-link-list a:hover {
  background: #e8f4f5;
}

.top-relationship-list {
  display: grid;
  gap: 6px;
}

.top-relationship-list > strong {
  font-size: 0.86rem;
}

.top-relationship-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.top-relationship-heading strong {
  margin-right: auto;
  font-size: 0.86rem;
}

.top-relationship-heading label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 850;
}

.top-relationship-heading input {
  width: 15px;
  min-height: 15px;
  accent-color: var(--accent);
}

.top-relationship-list p,
.top-relationship-list small {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.top-relationship-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.top-relationship-item:hover {
  background: #e8f4f5;
}

.top-relationship-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.top-relationship-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-menu {
  position: absolute;
  z-index: 20;
  width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.context-menu button + button {
  border-top: 1px solid var(--line);
}

.context-menu-title-banner,
.context-menu-banner {
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  background: var(--idrn-navy);
  color: #ffffff;
}

.context-menu-title-banner {
  border-bottom: 1px solid var(--line);
}

.context-menu-banner {
  border-top: 1px solid var(--line);
}

.context-menu-title-banner strong,
.context-menu-banner strong {
  font-size: 0.78rem;
  line-height: 1.1;
}

.context-menu-title-banner strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-menu .context-menu-banner span {
  color: #ffffff;
  font-size: 0.7rem;
  font-style: italic;
  line-height: 1.2;
}

.context-menu button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 58px;
  border-radius: 0;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.context-menu button:hover {
  background: #f2f4f7;
}

.context-menu button.active-context-option {
  border-left: 5px solid var(--idrn-gold);
  background: #e8f4f5;
}

.context-menu button.active-context-option strong::before {
  content: "✓ ";
  color: var(--idrn-navy);
}

.context-menu button.active-context-option span {
  color: var(--idrn-navy);
}

.context-menu button:disabled {
  cursor: not-allowed;
  background: #f8fafc;
  color: var(--muted);
}

.context-menu button:disabled span {
  color: var(--muted);
}

.context-menu span {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-menu .focus-depth-chip {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  border: 1px solid rgba(7, 119, 168, 0.34);
  border-radius: 999px;
  background: #eef7fb;
  color: var(--idrn-navy);
  cursor: context-menu;
  font-size: 0.86rem;
  overflow: visible;
}

.context-menu .focus-depth-chip:hover {
  background: #d7eef7;
}

.focus-depth-picker {
  position: fixed;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(6, 32px);
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.focus-depth-picker button {
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(7, 119, 168, 0.34);
  border-radius: 6px;
  background: #eef7fb;
  color: var(--idrn-navy);
  font-weight: 800;
}

.focus-depth-picker button:hover,
.focus-depth-picker button.selected {
  background: var(--idrn-navy);
  color: #ffffff;
}

.edit-dialog {
  position: absolute;
  inset: 0;
  z-index: 19;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.22);
}

.account-role-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.28);
}

.account-role-card {
  display: grid;
  gap: 12px;
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.account-role-card h2,
.account-role-card p {
  margin: 0;
}

.account-role-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.account-role-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.edit-form {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.edit-fields {
  display: grid;
  gap: 12px;
}

.node-image-preview {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin: 4px 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.edit-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.edit-actions button {
  flex: 1 1 auto;
}

.danger-button {
  border: 1px solid #fda29b;
  background: #fff1f0;
  color: var(--danger);
}

.danger-button:hover {
  background: #fee4e2;
}

.empty-state,
.relationship-picker-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .graph-stage,
  #network-graph {
    min-height: 680px;
    height: 680px;
  }
}

@media (max-width: 620px) {
  .control-panel {
    padding: 14px;
  }

  .toggle-grid,
  .org-type-grid,
  .segmented-control {
    grid-template-columns: 1fr;
  }

  .graph-toolbar {
    position: static;
    padding: 12px;
    flex-direction: column;
    background: #eef3f7;
  }

  .legend {
    justify-content: flex-start;
    max-width: none;
  }

  .legend-explanation {
    left: 0;
    right: auto;
  }

  .graph-stage,
  #network-graph {
    min-height: 620px;
    height: 620px;
  }
}

.menu-accordion {
  border: 1px solid rgba(7, 119, 168, 0.26);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.menu-accordion[open] {
  overflow: visible;
}

.menu-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  background: var(--idrn-blue);
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.menu-accordion summary::-webkit-details-marker {
  display: none;
}

.menu-accordion summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  color: #ffffff;
}

.menu-accordion[open] summary {
  border-bottom: 1px solid rgba(7, 119, 168, 0.26);
  background: var(--idrn-navy);
}

.menu-accordion[open] summary::after {
  content: "-";
}

.filter-panel.menu-accordion {
  gap: 12px;
}

.filter-panel.menu-accordion > :not(summary) {
  margin-left: 12px;
  margin-right: 12px;
}

.filter-panel.menu-accordion > :last-child {
  margin-bottom: 12px;
}

.filter-panel.menu-accordion summary .view-action-row {
  margin-left: auto;
}

.filter-panel.menu-accordion summary .view-action-row button {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.filter-panel.menu-accordion summary .view-action-row button:hover,
.filter-panel.menu-accordion summary .view-action-row button:focus-visible {
  background: #ffffff;
  color: var(--idrn-blue);
}
