:root {
  color-scheme: light;
  --ink: #14231d;
  --muted: #66736d;
  --paper: #f6f7f2;
  --card: #ffffff;
  --green: #176b4d;
  --green-dark: #0e5038;
  --green-soft: #dff0e8;
  --line: #dce3de;
  --shadow: 0 18px 50px rgba(20, 35, 29, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(23, 107, 77, 0.1), transparent 34rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.people-home-link {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 20;
  display: none;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(20, 35, 29, 0.08);
}

body.people-graph-page .people-home-link {
  display: none;
}

.top-links {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 25;
  display: flex;
  gap: 8px;
}

.top-links a {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(20, 35, 29, 0.08);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(56px, 10vh, 110px) 0 48px;
  text-align: center;
}

body.people-graph-page .shell {
  width: 100%;
  padding: 0;
}

body.people-graph-page .shell > header,
body.people-graph-page #give-task,
body.people-graph-page .memory-header,
body.people-graph-page #memory-status,
body.people-graph-page #memory-filters {
  display: none;
}

.shell > header,
.shell > #key-panel,
.shell > #task-view,
.shell > #message {
  width: min(680px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.subtitle {
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.idle-view {
  width: min(1320px, 100%);
  margin-right: auto;
  margin-left: auto;
  margin-top: clamp(52px, 10vh, 92px);
}

.memory-panel {
  margin-top: 34px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  text-align: left;
}

.memory-panel:fullscreen,
.memory-panel.is-fullscreen-fallback {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 28px 32px 32px;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
}

.memory-panel:fullscreen {
  display: block;
}

.memory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.memory-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.memory-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.memory-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.memory-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f2f5f1;
}

.memory-toggle-wide {
  max-width: min(100%, 640px);
  justify-content: flex-end;
}

.memory-fullscreen-button {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-weight: 750;
}

.memory-fullscreen-button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.memory-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  padding: 10px 14px;
}

.memory-tab.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 35, 29, 0.08);
}

.memory-status {
  min-height: 20px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.portfolio-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-chip strong {
  color: var(--ink);
  font-size: 1rem;
}

.memory-list {
  display: grid;
  gap: 12px;
}

.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-filter-chip,
.person-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.tag-filter-chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  padding: 9px 12px;
}

.tag-filter-chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.memory-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.memory-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.memory-item h3 {
  margin: 0;
  font-size: 1rem;
}

.memory-badge {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.score-badge,
.state-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.score-badge {
  background: #edf0ff;
  color: #2f436f;
}

.state-pill {
  background: #f6efe2;
  color: #915f1b;
}

.state-pill.is-stale {
  background: #f7e8e8;
  color: #9d3c3c;
}

.state-pill.is-fresh {
  background: var(--green-soft);
  color: var(--green-dark);
}

.memory-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.person-tag {
  padding: 6px 10px;
  background: #eef5f0;
  color: var(--green-dark);
}

.memory-copy {
  margin: 10px 0 0;
  line-height: 1.5;
}

.strategy-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfa;
}

.strategy-block-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.strategy-field span,
.strategy-gaps > span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.strategy-field p {
  margin: 4px 0 0;
  line-height: 1.42;
}

.strategy-empty {
  margin: 0;
  color: var(--muted);
}

.strategy-gaps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

.strategy-gaps strong {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f7e8e8;
  color: #9d3c3c;
  font-size: 0.72rem;
}

.relationship-item .relationship-meta {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.memory-empty {
  margin: 0;
  padding: 14px 0;
  color: var(--muted);
}

.portfolio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.people-graph-panel {
  display: grid;
  gap: 16px;
  width: 100%;
}

.memory-panel[data-active-view="peopleGraph"] {
  padding: 22px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.94);
}

body.people-graph-page .memory-panel {
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.people-graph-page .people-graph-toolbar {
  position: fixed;
  top: 14px;
  right: 16px;
  left: 16px;
  z-index: 8;
  align-items: flex-start;
  pointer-events: none;
}

body.people-graph-page .people-graph-layout {
  height: 100vh;
  grid-template-rows: 42vh auto auto minmax(0, 1fr);
  gap: 0;
}

body.people-graph-page .people-graph-stage {
  min-height: 42vh;
  border-width: 0 0 1px;
  border-radius: 0;
}

body.people-graph-page .people-graph-nodes,
body.people-graph-page .people-graph-zones,
body.people-graph-page .people-graph-svg {
  transform-origin: 0 0;
}

body.people-graph-page .people-detail {
  min-height: 0;
  max-height: none;
  padding: 28px clamp(28px, 4vw, 64px);
  border-width: 0;
  border-radius: 0;
  overflow: auto;
}

body.people-graph-page #people-graph-summary {
  display: none;
}

body.people-graph-page .people-zone-controls,
body.people-graph-page .people-entity-controls,
body.people-graph-page .people-selection-tools,
body.people-graph-page .people-graph-actions,
body.people-graph-page .people-project-board-control,
body.people-graph-page .people-project-filter-control,
body.people-graph-page .people-search-control,
body.people-graph-page .people-add-contact-form,
body.people-graph-page .people-add-organisation-form {
  pointer-events: auto;
}

body.people-graph-page .people-add-contact-form,
body.people-graph-page .people-add-organisation-form {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.people-graph-page .people-add-contact-form.is-open,
body.people-graph-page .people-add-organisation-form.is-open {
  width: min(760px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid rgba(220, 227, 222, 0.86);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(20, 35, 29, 0.18);
  backdrop-filter: blur(14px);
}

body.people-graph-page .people-graph-actions {
  margin-top: 58px;
  pointer-events: auto;
}

body.people-graph-page .people-graph-toolbar-main {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
  pointer-events: none;
}

body.people-graph-page .people-zone-controls,
body.people-graph-page .people-selection-tools {
  margin-top: 0;
}

body.people-graph-page .people-primary-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: center;
  width: min(1080px, max(520px, calc(100vw - 420px)));
  padding: 4px;
  border: 1px solid rgba(220, 227, 222, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 38px rgba(20, 35, 29, 0.1);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

body.people-graph-page .people-entity-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 0;
  border-radius: 17px;
}

body.people-graph-page .people-project-filter-control,
body.people-graph-page .people-tag-filter-control,
body.people-graph-page .people-search-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 17px;
  background: rgba(246, 249, 246, 0.82);
}

body.people-graph-page .people-project-filter-control span,
body.people-graph-page .people-tag-filter-control span,
body.people-graph-page .people-search-control span {
  padding-left: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.people-graph-page .people-search-control {
  flex: 1 1 460px;
  min-width: 360px;
  background: white;
}

body.people-graph-page .people-selection-tools span {
  border: 0;
  background: transparent;
  padding: 7px 8px;
}

body.people-graph-page .people-selection-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  width: auto;
  margin: 8px 0 0 clamp(28px, 4vw, 64px);
  padding: 4px;
  border: 1px solid rgba(220, 227, 222, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(20, 35, 29, 0.08);
  backdrop-filter: blur(12px);
}

body.people-graph-page .people-graph-action-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 58px;
  padding: 10px clamp(28px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 242, 0.92);
}

body.people-graph-page .people-selection-tools[hidden] {
  display: none;
}

body.people-graph-page #people-add-contact-toggle {
  border-color: rgba(23, 107, 77, 0.28);
  background: var(--green);
  color: white;
}

body.people-graph-page #people-add-organisation-toggle {
  border-color: rgba(23, 107, 77, 0.18);
  background: white;
  color: var(--green-dark);
}

body.people-graph-page .compact-button,
body.people-graph-page .tag-filter-chip {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.people-graph-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.people-filtered-results {
  display: grid;
  gap: 8px;
  justify-self: center;
  width: min(1080px, max(520px, calc(100vw - 420px)));
  pointer-events: auto;
}

.people-filtered-count {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.people-filtered-list {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 0 4px;
}

.people-filtered-item {
  display: grid;
  gap: 2px;
  flex: 0 0 auto;
  max-width: 210px;
  padding: 8px 11px;
  border: 1px solid rgba(220, 227, 222, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(20, 35, 29, 0.06);
}

.people-filtered-item.is-active {
  border-color: rgba(23, 107, 77, 0.45);
  background: var(--green-soft);
}

.people-filtered-item strong,
.people-filtered-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-filtered-item strong {
  font-size: 0.84rem;
}

.people-filtered-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.people-zone-controls,
.people-graph-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.people-zone-controls {
  margin-top: 8px;
}

.people-selection-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.people-selection-tools span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.people-project-board-control {
  display: inline-grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-project-filter-control {
  display: inline-grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-search-control {
  display: inline-grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-add-contact-form {
  position: relative;
  display: grid;
  gap: 6px;
  max-width: 520px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-add-contact-panel,
.people-add-organisation-panel {
  position: relative;
  display: grid;
  gap: 12px;
}

.people-add-contact-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.people-add-contact-header div {
  display: grid;
  gap: 4px;
}

.people-add-contact-header strong,
.people-add-organisation-panel strong {
  color: var(--ink);
  font-size: 0.98rem;
  letter-spacing: 0;
  text-transform: none;
}

.people-add-contact-panel label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.people-add-contact-panel label {
  display: grid;
  gap: 7px;
}

.people-add-contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.people-add-contact-form input,
.people-add-contact-form select,
.people-add-contact-form textarea,
.people-add-organisation-form input,
.people-add-organisation-form textarea {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.people-add-contact-form textarea,
.people-add-organisation-form textarea {
  min-height: auto;
  padding: 12px 13px;
  resize: vertical;
}

.people-add-contact-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.people-add-contact-results {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 7px;
  width: min(520px, 100%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 18px 44px rgba(20, 35, 29, 0.14);
}

.people-add-contact-results button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 12px;
  background: #fbfcfa;
  color: var(--ink);
  text-align: left;
}

.people-add-contact-results button:hover {
  background: var(--green-soft);
}

.people-add-contact-results strong {
  font-size: 0.92rem;
}

.people-add-contact-results span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.people-project-board-control select,
.people-project-filter-control select,
.people-tag-filter-control select,
.people-search-control input {
  min-height: 34px;
  min-width: 180px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  outline: none;
}

.people-project-filter-control select,
.people-tag-filter-control select,
.people-search-control input {
  min-width: 120px;
}

.people-search-control input {
  width: 360px;
  font-size: 0.92rem;
}

.people-graph-actions {
  justify-content: flex-end;
}

.people-more-menu {
  position: relative;
}

.people-more-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  cursor: pointer;
}

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

.people-more-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  display: grid;
  gap: 10px;
  min-width: 280px;
  padding: 12px;
  border: 1px solid rgba(220, 227, 222, 0.86);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(20, 35, 29, 0.14);
  backdrop-filter: blur(10px);
}

body.people-graph-page .people-more-menu-panel .compact-button,
body.people-graph-page .people-more-menu-panel .tag-filter-chip {
  justify-content: flex-start;
  width: 100%;
}

.people-more-menu-panel .people-zone-controls {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.people-settings-form {
  display: grid;
  gap: 10px;
  min-width: 320px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfa;
}

.people-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.people-settings-form textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  resize: vertical;
  text-transform: none;
}

.people-more-home-link {
  color: var(--ink);
  text-decoration: none;
}

.people-graph-layout {
  display: grid;
  grid-template-rows: minmax(560px, 58vh) minmax(420px, auto);
  gap: 16px;
}

.compact-button {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.people-graph-stage,
.people-detail {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.people-graph-stage {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(circle at 18% 24%, rgba(23, 107, 77, 0.09), transparent 18rem),
    radial-gradient(circle at 74% 32%, rgba(47, 67, 111, 0.08), transparent 20rem),
    radial-gradient(circle at 48% 78%, rgba(145, 95, 27, 0.08), transparent 18rem),
    linear-gradient(180deg, #f8faf8 0%, white 100%);
}

.people-graph-stage.is-board {
  min-height: 560px;
  overflow: auto;
  touch-action: auto;
  background:
    radial-gradient(circle at 15% 0%, rgba(23, 107, 77, 0.08), transparent 24rem),
    #f8faf8;
}

.people-graph-stage::after {
  content: none;
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  color: rgba(102, 115, 109, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
  pointer-events: none;
}

.people-graph-stage.is-board::after {
  content: none;
}

.memory-panel:fullscreen .people-graph-stage,
.memory-panel.is-fullscreen-fallback .people-graph-stage {
  min-height: 58vh;
}

.people-graph-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  transform-origin: 0 0;
}

.people-graph-link {
  opacity: 0.5;
}

.people-graph-link.is-active {
  opacity: 1;
}

.people-graph-edge {
  stroke: rgba(20, 35, 29, 0.16);
  stroke-width: 0.34;
}

.people-graph-link.is-active .people-graph-edge {
  stroke: rgba(23, 107, 77, 0.52);
  stroke-width: 0.58;
}

.people-graph-edge-label {
  fill: rgba(20, 35, 29, 0.72);
  paint-order: stroke;
  stroke: white;
  stroke-width: 4px;
  font-size: 2.2px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.people-graph-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-origin: 0 0;
}

.people-graph-zones {
  position: absolute;
  inset: 0;
  z-index: 5;
  transform-origin: 0 0;
  pointer-events: none;
}

.people-organisation-group {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(23, 107, 77, 0.28);
  border-radius: 30px;
  background: rgba(223, 240, 232, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  cursor: grab;
  pointer-events: none;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.people-organisation-group:hover,
.people-organisation-group.is-dragging {
  border-color: rgba(23, 107, 77, 0.58);
  background: rgba(223, 240, 232, 0.48);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    0 18px 44px rgba(20, 35, 29, 0.12);
}

.people-organisation-group:hover {
  z-index: 8;
}

.people-organisation-group.is-dragging {
  cursor: grabbing;
  z-index: 9;
}

.people-organisation-group span {
  position: absolute;
  top: -46px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border: 1px solid rgba(23, 107, 77, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 36px rgba(20, 35, 29, 0.16);
  color: var(--green-dark);
  font-size: 1.04rem;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: auto;
  cursor: grab;
}

.people-graph-zone {
  position: absolute;
  border: 1px dashed rgba(23, 107, 77, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.42);
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.people-graph-zone span {
  position: absolute;
  top: 12px;
  left: 14px;
  color: rgba(20, 35, 29, 0.48);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-graph-zone.is-hot {
  border-color: rgba(23, 107, 77, 0.78);
  background: rgba(223, 240, 232, 0.55);
  box-shadow: inset 0 0 0 2px rgba(23, 107, 77, 0.16);
}

.people-graph-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  padding: 12px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 8px 24px rgba(20, 35, 29, 0.08);
  color: var(--ink);
  text-align: left;
  touch-action: none;
  user-select: none;
}

.people-graph-node:hover {
  border-color: rgba(23, 107, 77, 0.42);
  box-shadow: 0 12px 30px rgba(20, 35, 29, 0.12);
}

.people-graph-node span {
  min-width: 0;
  overflow: hidden;
  font-weight: 850;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-graph-node em {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-graph-node strong {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(20, 35, 29, 0.08);
  font-size: 0.78rem;
}

.people-graph-node-person {
  background: #fbf7f1;
}

.people-graph-node-person.is-active {
  border-color: var(--green);
  background: #fffdf7;
  box-shadow: 0 14px 34px rgba(23, 107, 77, 0.24);
  z-index: 3;
}

.people-graph-node-person.is-selected {
  border-color: var(--green);
  outline: 3px solid rgba(23, 107, 77, 0.18);
  background: #fffdf7;
}

.people-organisation-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  min-width: 180px;
  max-width: 260px;
  padding: 15px 16px;
  border: 1px solid rgba(23, 107, 77, 0.2);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(20, 35, 29, 0.1);
  color: var(--ink);
  text-align: left;
  touch-action: none;
  user-select: none;
}

.people-organisation-node:hover,
.people-organisation-node.is-active,
.people-organisation-node.is-dragging {
  border-color: rgba(23, 107, 77, 0.58);
  background: #f7fbf8;
  box-shadow: 0 18px 48px rgba(20, 35, 29, 0.14);
}

.people-organisation-node.is-dragging {
  cursor: grabbing;
}

.people-organisation-node span {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-organisation-node em {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.people-organisation-node strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(23, 107, 77, 0.12);
  color: var(--green-dark);
  font-size: 0.82rem;
}

.people-graph-node-person.is-stale:not(.is-active) {
  border-color: #ead3d3;
}

.people-graph-node.is-dragging {
  cursor: grabbing;
  z-index: 4;
  box-shadow: 0 18px 38px rgba(23, 107, 77, 0.25);
}

.people-graph-stage.is-board .people-graph-nodes {
  position: relative;
  inset: auto;
  min-height: 100%;
}

.people-kanban-board {
  display: grid;
  grid-auto-columns: minmax(260px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  min-height: 100%;
  padding: 16px;
}

.people-board-empty {
  padding: 24px;
}

.people-kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.people-kanban-column.is-hot {
  border-color: rgba(23, 107, 77, 0.78);
  background: rgba(223, 240, 232, 0.55);
  box-shadow: inset 0 0 0 2px rgba(23, 107, 77, 0.13);
}

.people-kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.people-kanban-column h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.people-kanban-column header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(20, 35, 29, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.people-kanban-cards {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1;
  padding: 12px;
}

.people-kanban-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  width: 100%;
  padding: 13px 13px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 22px rgba(20, 35, 29, 0.07);
  color: var(--ink);
  text-align: left;
}

.people-kanban-card:hover {
  border-color: rgba(23, 107, 77, 0.38);
  box-shadow: 0 12px 26px rgba(20, 35, 29, 0.1);
}

.people-kanban-card.is-active {
  border-color: var(--green);
  box-shadow: 0 14px 30px rgba(23, 107, 77, 0.19);
}

.people-kanban-card.is-stale:not(.is-active) {
  border-color: #ead3d3;
}

.people-kanban-card.is-dragging {
  opacity: 0.48;
}

.people-kanban-card span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-kanban-card small,
.people-kanban-card em {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-kanban-card strong {
  grid-column: 2;
  grid-row: 1;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(20, 35, 29, 0.08);
  font-size: 0.72rem;
}

.people-kanban-empty {
  margin: 0;
  padding: 18px 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.people-detail {
  min-height: 420px;
  max-height: 54vh;
  padding: 24px;
  overflow: auto;
}

body.people-graph-page .people-graph-stage {
  min-height: 40vh;
  border-width: 0 0 1px;
  border-radius: 0;
}

body.people-graph-page .people-detail {
  border-width: 0;
  border-radius: 0;
}

.cal-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(60px, 10vh, 110px) 0 54px;
}

.cal-hero {
  margin-bottom: 26px;
  text-align: center;
}

.cal-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(3rem, 10vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.cal-hero p {
  margin: 0 auto;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
}

.cal-card {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.cal-card h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.cal-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.cal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.small-primary {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 18px;
  font-size: 1rem;
  box-shadow: none;
}

.cal-key-form,
.availability-form {
  display: grid;
  gap: 12px;
}

.cal-key-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.availability-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.availability-form label,
.cal-key-form {
  text-align: left;
}

.availability-form label {
  display: grid;
  gap: 7px;
}

.availability-form label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.availability-form input,
.cal-key-form input,
.copy-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.sync-status {
  font-size: 0.86rem;
}

.checkbox-label {
  align-content: center;
  grid-template-columns: auto 1fr;
}

.checkbox-label input {
  width: auto;
}

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

.slot-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(23, 107, 77, 0.18);
  border-radius: 22px;
  background: #fbfdfb;
  text-align: left;
}

.slot-card span,
.slot-card p {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.slot-card strong {
  font-size: clamp(1.3rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.slot-card a {
  color: var(--green-dark);
  font-weight: 900;
}

.availability-grid {
  display: grid;
  grid-auto-columns: minmax(150px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.availability-day {
  min-width: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfa;
}

.availability-day-head {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}

.availability-day-head strong {
  font-size: 1rem;
}

.availability-day-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.availability-slots {
  display: grid;
  gap: 7px;
}

.availability-slots span,
.availability-slots em {
  display: block;
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
  text-align: center;
}

.availability-slots em {
  background: #f7e8e8;
  color: #9d3c3c;
}

.copy-tools {
  display: flex;
  justify-content: flex-end;
}

.language-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f2f5f1;
}

.language-toggle button {
  min-width: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 900;
}

.language-toggle button.is-active {
  background: var(--green);
  color: white;
}

.copy-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.copy-panel textarea {
  resize: vertical;
}

.cal-note {
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.cal-card summary {
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 900;
}

.contacts-page {
  --contacts-ink: #111318;
  --contacts-muted: #667085;
  --contacts-border: #e8ebef;
  --contacts-soft: #f6f7f9;
  --contacts-accent: #ff5a1f;
  background: #f7f8fa;
  color: var(--contacts-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.contacts-shell {
  width: min(1420px, calc(100% - 48px));
  margin: 0 auto;
  padding: 86px 0 44px;
}

.contacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

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

.contacts-header-actions a,
.tags-shell a.contacts-secondary-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.contacts-header h1 {
  margin-top: 3px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: -0.07em;
}

.contacts-card {
  padding: 0;
  border: 1px solid var(--contacts-border);
  border-radius: 18px;
  background: white;
  box-shadow: 0 16px 38px rgba(17, 19, 24, 0.05);
  overflow: hidden;
}

.contacts-card h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.contacts-key-form,
.contacts-filters {
  display: grid;
  gap: 10px;
}

.contacts-key-form {
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 18px;
}

.contacts-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.contacts-filters {
  grid-template-columns: minmax(360px, 1.5fr) repeat(3, minmax(170px, 0.55fr));
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--contacts-border);
  background: #fbfcfd;
}

.contacts-key-form input,
.contacts-filters input,
.contacts-filters select,
.contact-drawer-panel input,
.contact-drawer-panel select,
.contact-drawer-panel textarea,
.contact-method-add input,
.contact-method-add select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--contacts-border);
  border-radius: 8px;
  padding: 0 11px;
  background: white;
  color: var(--contacts-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 560;
}

.contact-drawer-panel textarea {
  padding: 12px 13px;
  resize: vertical;
}

.contacts-primary-button,
.contacts-secondary-button {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 720;
}

.contacts-primary-button {
  border: 1px solid var(--contacts-accent);
  background: var(--contacts-accent);
  color: white;
}

.contacts-secondary-button {
  border: 1px solid var(--contacts-border);
  background: white;
  color: var(--contacts-ink);
}

.contacts-table-wrap {
  overflow: auto;
}

.contacts-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1180px;
  background: white;
  table-layout: fixed;
}

.contacts-table th:nth-child(1),
.contacts-table td:nth-child(1) {
  width: 19%;
}

.contacts-table th:nth-child(2),
.contacts-table td:nth-child(2) {
  width: 14%;
}

.contacts-table th:nth-child(3),
.contacts-table td:nth-child(3) {
  width: 42%;
}

.contacts-table th:nth-child(4),
.contacts-table td:nth-child(4) {
  width: 15%;
}

.contacts-table th:nth-child(5),
.contacts-table td:nth-child(5),
.contacts-table th:nth-child(6),
.contacts-table td:nth-child(6) {
  width: 5%;
}

.tags-table th:nth-child(1),
.tags-table td:nth-child(1) {
  width: 22%;
}

.tags-table th:nth-child(2),
.tags-table td:nth-child(2) {
  width: 34%;
}

.tags-table th:nth-child(3),
.tags-table td:nth-child(3) {
  width: 28%;
}

.tags-table th:nth-child(4),
.tags-table td:nth-child(4) {
  width: 16%;
}

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

.contacts-table th:last-child,
.contacts-table td:last-child {
  border-right: 0;
}

.contacts-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfd;
  color: var(--contacts-muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contacts-table th button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.contacts-table tr:hover td {
  background: #fafbfc;
}

.contacts-person-cell {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
}

.contacts-person-cell input,
.contacts-inline-input,
.contacts-next-action textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--contacts-ink);
  font: inherit;
  outline: none;
}

.contacts-person-cell input {
  padding: 2px 0;
  font-size: 0.92rem;
  font-weight: 720;
}

.contacts-inline-input {
  min-height: 30px;
  padding: 4px 0;
  font-weight: 560;
}

.contacts-next-action textarea {
  min-height: 38px;
  padding: 4px 0;
  resize: vertical;
  font-weight: 620;
  line-height: 1.22;
}

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

.contacts-action-buttons {
  display: flex;
  gap: 5px;
}

.contacts-action-buttons button {
  min-height: 26px;
  border: 1px solid var(--contacts-border);
  border-radius: 999px;
  background: white;
  color: var(--contacts-muted);
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 760;
}

.contacts-action-buttons button:first-child {
  border-color: #d8eadf;
  background: #edf8f0;
  color: #23623f;
}

.contacts-person-cell input:focus,
.contacts-inline-input:focus,
.contacts-next-action textarea:focus {
  border-color: #d9dee6;
  background: white;
  padding-right: 7px;
  padding-left: 7px;
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.08);
}

.contacts-person-cell small,
.contacts-table td small {
  display: block;
  color: var(--contacts-muted);
  font-size: 0.74rem;
  font-weight: 520;
}

.contacts-next-action {
  color: #30343b;
  font-size: 0.9rem;
  font-weight: 620;
  line-height: 1.22;
}

.contacts-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contacts-tags span,
.contacts-tags button,
.contact-method-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 680;
}

.contacts-tags span,
.contacts-tags button {
  padding: 5px 8px;
  border: 1px solid #d8eadf;
  background: #edf8f0;
  color: #23623f;
}

.contacts-tags button {
  max-width: 102px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

.contacts-tags button:hover {
  border-color: #e2b5b5;
  background: #fbefef;
  color: #8c3636;
}

.contacts-tags select {
  min-height: 27px;
  max-width: 96px;
  border: 1px dashed #cfd8d3;
  border-radius: 999px;
  background: white;
  color: var(--contacts-muted);
  padding: 0 7px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 680;
}

.tags-filters {
  grid-template-columns: minmax(280px, 420px);
}

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

.contacts-secondary-button.is-danger {
  color: #963f3b;
}

.insights-filters {
  grid-template-columns: minmax(320px, 1fr) minmax(180px, 260px) minmax(140px, 200px);
}

.insights-list {
  display: grid;
  gap: 0;
}

.insight-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--contacts-border);
  background: white;
}

.insight-card:hover {
  background: #fbfcfd;
}

.insight-card-main {
  display: grid;
  gap: 10px;
}

.insight-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--contacts-muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-card-header small {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--contacts-soft);
  color: var(--contacts-muted);
  letter-spacing: 0;
  text-transform: none;
}

.insight-card h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.insight-card p {
  max-width: 920px;
  margin: 0;
  color: #30343b;
  font-size: 0.98rem;
  font-weight: 540;
  line-height: 1.45;
}

.insight-editor-actions {
  display: flex;
  gap: 10px;
}

.insights-empty {
  padding: 34px;
}

.closer-shell {
  max-width: 1180px;
}

.closer-north-star {
  border-left: 5px solid #e98555;
}

.closer-north-star h2 {
  max-width: 850px;
  margin: 8px 0;
  font-size: clamp(1.4rem, 3vw, 2.25rem);
}

.closer-toolbar,
.opportunity-card-header,
.opportunity-signals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.closer-toolbar select {
  min-width: 170px;
}

.opportunity-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.workspace-badge {
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: var(--ink, #17231c);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-shell { max-width: 820px; }
.workspace-settings-form { display: grid; gap: 22px; padding: 30px; overflow: visible; }
.workspace-settings-form label { display: grid; gap: 8px; color: var(--muted); font-size: 0.78rem; font-weight: 750; letter-spacing: 0.04em; }
.workspace-settings-form input, .workspace-settings-form textarea { width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcf9; color: var(--ink); font-size: 0.98rem; font-weight: 520; line-height: 1.45; outline: none; resize: vertical; }
.workspace-settings-form input:focus, .workspace-settings-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,77,0.1); background: white; }
.workspace-settings-form .contact-editor-footer { position: static; margin: 6px -30px -30px; padding: 20px 30px; border-radius: 0 0 22px 22px; }
.settings-note { margin: 0; color: var(--muted, #637068); font-size: 0.9rem; }

/* Minimal workspace shell */
.legacy-field { display: none !important; }

.workspace-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(18px);
}

.workspace-wordmark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 780;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.workspace-switcher-chevron { margin-left: 2px; color: var(--muted); font-size: 1rem; transform: translateY(-1px); }
.workspace-switcher-menu {
  position: absolute;
  top: 58px;
  left: 0;
  z-index: 60;
  display: grid;
  width: 230px;
  padding: 7px;
  border: 1px solid rgba(20,35,29,0.1);
  border-radius: 15px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 20px 50px rgba(20,35,29,0.14);
}
.workspace-switcher-menu[hidden] { display: none; }
.workspace-switcher-menu a { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-radius: 10px; color: var(--ink); font-size: 0.86rem; font-weight: 700; text-decoration: none; }
.workspace-switcher-menu a:hover { background: #f1f5ef; }
.workspace-switcher-menu a.is-current { background: var(--green-soft); }
.workspace-switcher-menu strong { color: var(--green); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }

.workspace-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-size: 0.82rem;
  box-shadow: 0 8px 20px rgba(20, 35, 29, 0.14);
}

.workspace-nav-links { display: flex; align-items: center; gap: 4px; }
.workspace-nav-links a {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 680;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}
.workspace-nav-links a:hover { color: var(--ink); background: rgba(255,255,255,0.65); }
.workspace-nav-links a.is-active { color: var(--ink); background: white; box-shadow: 0 3px 12px rgba(20,35,29,0.07); }

.focus-page { background: #f3f5ef; }
.focus-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: clamp(50px, 8vh, 94px) 0 80px; }
.focus-unlock { width: min(620px, 100%); margin: 8vh auto 0; text-align: center; }
.focus-unlock h1, .focus-hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}
.focus-unlock > p { color: var(--muted); font-size: 1.08rem; }
.focus-key-form { display: flex; gap: 8px; width: min(430px, 100%); margin: 30px auto 0; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.focus-key-form input { min-width: 0; flex: 1; padding: 12px 14px; border: 0; outline: 0; background: transparent; }
.focus-key-form button, .focus-add { padding: 12px 16px; border: 0; border-radius: 11px; background: var(--ink); color: white; font-weight: 720; text-decoration: none; }
.focus-status { min-height: 1.2em; color: #a64230 !important; font-size: 0.9rem !important; }

.focus-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.focus-hero h1 { font-size: clamp(3.2rem, 8vw, 6.8rem); }
.focus-add { display: inline-flex; align-items: center; gap: 18px; white-space: nowrap; box-shadow: 0 12px 30px rgba(20,35,29,0.16); }
.focus-add span { font-size: 1.25rem; line-height: 1; }

.focus-outcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-top: 64px;
  padding: 34px 36px;
  border-radius: 26px;
  background: var(--ink);
  color: white;
  box-shadow: 0 24px 60px rgba(20,35,29,0.16);
}
.focus-label { display: block; margin-bottom: 10px; color: #84958c; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.focus-outcome .focus-label { color: #8fb6a4; }
.focus-outcome h2 { max-width: 700px; margin: 0; font-size: clamp(1.55rem, 3vw, 2.45rem); line-height: 1.12; letter-spacing: -0.045em; }
.focus-outcome-stats { display: flex; gap: 32px; }
.focus-outcome-stats div { display: grid; min-width: 90px; }
.focus-outcome-stats strong { font-size: 2rem; letter-spacing: -0.06em; }
.focus-outcome-stats span { color: #aab8b1; font-size: 0.72rem; line-height: 1.25; }

.focus-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr); gap: 24px; margin-top: 24px; }
.focus-actions-panel, .focus-side-card { border: 1px solid rgba(20,35,29,0.08); border-radius: 24px; background: rgba(255,255,255,0.82); box-shadow: 0 16px 40px rgba(20,35,29,0.055); }
.focus-actions-panel { padding: 30px; }
.focus-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.focus-section-head h2 { margin: 0; font-size: 1.55rem; letter-spacing: -0.045em; }
.focus-section-head > span { color: var(--muted); font-size: 0.78rem; }
.focus-action { display: grid; grid-template-columns: 38px 1fr 24px; gap: 14px; align-items: center; padding: 20px 2px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.focus-action-number { color: #a5afa9; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.focus-action-body { display: grid; gap: 5px; min-width: 0; }
.focus-action-body strong { font-size: 1rem; line-height: 1.35; letter-spacing: -0.018em; }
.focus-action-body > span:last-child { color: var(--muted); font-size: 0.82rem; }
.focus-action-meta { color: var(--green); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.focus-action-arrow { color: #94a099; font-size: 1.15rem; transition: transform 160ms ease; }
.focus-action:hover .focus-action-arrow { transform: translateX(4px); color: var(--green); }
.focus-sidebar { display: grid; align-content: start; gap: 24px; }
.focus-side-card { padding: 28px; }
.focus-side-card p, .focus-side-card blockquote { margin: 0; font-size: 1rem; line-height: 1.52; letter-spacing: -0.015em; }
.focus-rule-card { background: #e4ede5; }
.focus-rule-card blockquote { font-family: Georgia, serif; font-size: 1.12rem; font-style: italic; }
.focus-empty { padding: 30px 4px 12px; border-top: 1px solid var(--line); }
.focus-empty p { color: var(--muted); }

/* Refine the three supporting screens */
.contacts-page { background: #f3f5ef; }
.contacts-page .contacts-shell { width: min(1120px, calc(100% - 40px)); padding-top: clamp(56px, 8vh, 86px); }
.contacts-page .contacts-header { margin-bottom: 34px; }
.contacts-page .contacts-header h1 { font-size: clamp(3rem, 8vw, 5.7rem); }
.contacts-page .contacts-card { border-color: rgba(20,35,29,0.08); border-radius: 22px; box-shadow: 0 16px 44px rgba(20,35,29,0.055); }
.contacts-page .contacts-primary-button { border-radius: 11px; background: var(--ink); box-shadow: 0 10px 24px rgba(20,35,29,0.13); }
.contacts-page .contacts-secondary-button { border-radius: 11px; }
.contacts-filters { grid-template-columns: minmax(240px, 1fr) auto; }
.closer-north-star { background: var(--ink) !important; color: white; }
.closer-north-star .eyebrow { color: #8fb6a4; }
.closer-north-star p { color: #b3c0ba; }
.closer-north-star { padding: 30px 32px !important; }
.closer-offer { display: flex; align-items: baseline; gap: 12px; margin-top: 20px; }
.closer-offer > span { color: #8fb6a4; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.closer-offer p { margin: 0; }
#closer-app > .contacts-card + .contacts-card { margin-top: 24px; }
.closer-toolbar { padding: 24px 28px 16px; }
.opportunity-list { padding: 0 28px 28px; }
.opportunity-list .contacts-empty { margin: 0; padding: 28px; border-radius: 14px; background: #f7f8f5; text-align: center; }

@media (max-width: 760px) {
  .workspace-nav { width: calc(100% - 24px); padding: 12px 0; align-items: flex-start; gap: 12px; }
  .workspace-wordmark > span:last-child { display: none; }
  .workspace-nav-links { gap: 0; overflow-x: auto; }
  .workspace-nav-links a { padding: 8px 9px; font-size: 0.78rem; }
  .focus-shell, .contacts-page .contacts-shell { width: calc(100% - 24px); padding-top: 44px; }
  .focus-hero, .focus-outcome { align-items: flex-start; flex-direction: column; }
  .focus-add { align-self: stretch; justify-content: space-between; }
  .focus-outcome { margin-top: 40px; padding: 26px; }
  .focus-grid { grid-template-columns: 1fr; }
  .focus-actions-panel { padding: 22px; }
  .focus-outcome-stats { width: 100%; justify-content: space-between; }
  .contacts-filters { grid-template-columns: 1fr; }
}

.opportunity-card {
  padding: 18px;
  border: 1px solid #d8ded9;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.opportunity-card:hover {
  border-color: #82978c;
  box-shadow: 0 8px 24px rgba(20, 35, 29, 0.08);
}

.opportunity-card h3 {
  margin: 7px 0 0;
}

.opportunity-stage {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1ee;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-qualified,
.stage-offer_due {
  background: #fff0d9;
  color: #7a4815;
}

.stage-offer_sent {
  background: #e7efff;
  color: #244c8f;
}

.stage-won {
  background: #dff3e7;
  color: #21633c;
}

.opportunity-meta {
  color: #66736d;
}

.opportunity-signals {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 12px 0;
}

.opportunity-signals span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f3f5f3;
  font-size: 0.78rem;
}

.opportunity-alert,
.opportunity-missing {
  padding: 10px 12px;
  border-radius: 9px;
  background: #fff3e8;
  color: #713d19;
}

.alert-stop,
.alert-stale,
.alert-decision {
  background: #fde8e5;
  color: #812f27;
}

.closer-principles > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.closer-principles article {
  padding: 14px;
  border-left: 3px solid #a7b7ae;
  background: #f7f8f7;
}

.closer-principles h3,
.closer-principles p {
  margin: 0;
}

.closer-principles p {
  margin-top: 7px;
}

.contacts-age {
  display: inline-flex;
  min-width: 36px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--contacts-soft);
  color: var(--contacts-ink);
  font-size: 0.78rem;
  font-weight: 760;
}

.contacts-empty {
  color: var(--contacts-muted);
  font-weight: 600;
  text-align: center;
}

.contacts-empty.compact {
  margin: 0;
  padding: 4px 0;
  text-align: left;
}

.contact-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.contact-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 24, 0.42);
}

.contact-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  gap: 20px;
  width: min(720px, 100%);
  height: 100%;
  padding: 28px;
  overflow: auto;
  background: white;
  box-shadow: -20px 0 60px rgba(17, 19, 24, 0.18);
}

.contact-drawer-header,
.contact-editor-footer,
.contact-method-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.contact-drawer-header span {
  color: var(--contacts-muted);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-drawer-header h2 {
  margin: 5px 0 0;
  font-size: 1.75rem;
  letter-spacing: -0.05em;
}

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

.contact-drawer-panel label {
  display: grid;
  gap: 7px;
  color: var(--contacts-muted);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.contact-editor-wide {
  grid-column: 1 / -1;
}

.contact-method-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--contacts-border);
  border-radius: 14px;
  background: #fbfcfd;
}

.contact-method-head h3,
.contact-method-head p {
  margin: 0;
}

.contact-method-head p {
  color: var(--contacts-muted);
  font-weight: 560;
}

.contact-method-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-method-pill {
  gap: 6px;
  padding: 7px 9px;
  background: white;
  border: 1px solid var(--contacts-border);
}

.contact-method-pill strong {
  color: var(--contacts-muted);
  text-transform: uppercase;
}

.contact-method-pill em {
  color: var(--contacts-muted);
  font-style: normal;
}

.contact-method-pill button {
  border: 0;
  background: transparent;
  color: var(--contacts-muted);
  font-weight: 950;
}

.contact-method-add {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 0.7fr) auto;
  gap: 8px;
}

.contact-editor-footer {
  position: sticky;
  bottom: -28px;
  align-items: center;
  margin: 8px -28px -28px;
  padding: 18px 28px;
  border-top: 1px solid var(--contacts-border);
  background: rgba(255, 255, 255, 0.96);
}

#contact-editor-status {
  color: var(--contacts-muted);
  font-weight: 600;
}

#contact-editor-status[data-tone="error"] {
  color: #963f3b;
}

@media (max-width: 780px) {
  .top-links {
    left: 16px;
    right: 16px;
    justify-content: center;
  }

  .cal-card-header,
  .copy-panel,
  .cal-key-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .availability-form,
  .slot-list {
    grid-template-columns: 1fr;
  }
}

.people-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.people-detail h3 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -0.055em;
}

.person-header-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.person-header-save {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.person-header-save .person-autosave-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.person-organisation-pill,
.contact-pill,
.person-project-pill,
.person-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(23, 107, 77, 0.16);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.84rem;
  font-weight: 850;
}

.person-project-pill {
  background: #eef4ff;
  color: #2d416c;
}

.person-organisation-pill.is-empty {
  border-color: var(--line);
  background: white;
  color: var(--muted);
}

.person-edit-form,
.organisation-panel,
.organisation-detail-panel,
.danger-zone,
.person-project-panel,
.person-tag-panel,
.contact-method-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfa;
}

.danger-zone {
  border-color: rgba(161, 45, 45, 0.22);
  background: #fffafa;
}

.danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.organisation-member-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.organisation-member-card {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  text-align: left;
  font: inherit;
}

.organisation-member-card:hover {
  border-color: rgba(23, 107, 77, 0.42);
  background: #f8fbf8;
}

.organisation-member-card strong {
  font-weight: 900;
}

.organisation-member-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.person-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.person-edit-form label,
.person-organisation-form,
.person-project-form,
.person-tag-form,
.person-contact-method-form {
  display: grid;
  gap: 7px;
}

.person-edit-form label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.person-edit-form input,
.person-edit-form textarea,
.person-organisation-form input,
.person-project-form select,
.person-tag-form input,
.person-contact-method-form input,
.person-contact-method-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.person-edit-form textarea {
  resize: vertical;
}

.person-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.person-edit-actions span,
.organisation-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.person-autosave-status[data-tone="error"] {
  color: #a12d2d;
}

.contact-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-pill {
  background: white;
  color: var(--ink);
}

.contact-pill strong,
.contact-pill em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-pill button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 35, 29, 0.08);
  color: var(--muted);
  font-weight: 900;
}

.organisation-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.organisation-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 850;
}

.organisation-chip:hover,
.organisation-chip.is-active {
  border-color: rgba(23, 107, 77, 0.48);
  background: var(--green-soft);
}

.person-organisation-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.person-contact-method-form {
  grid-template-columns: minmax(120px, 0.4fr) minmax(200px, 1fr) minmax(150px, 0.7fr) auto;
  align-items: center;
}

.project-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.quick-tag-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.quick-tag-chip:hover {
  border-color: rgba(23, 107, 77, 0.45);
  background: var(--green-soft);
  color: var(--green-dark);
}

.person-project-pill button,
.person-tag button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(45, 65, 108, 0.12);
  color: inherit;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.person-project-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}

.person-tag-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}

.people-merge-form {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(23, 107, 77, 0.3);
  border-radius: 20px;
  background: rgba(223, 240, 232, 0.34);
}

.merge-review-header,
.merge-review-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.merge-review-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.merge-target-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.merge-target-row label,
.merge-field-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.merge-field-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.merge-field-label {
  padding: 11px 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.merge-field-option input:not([type="radio"]),
.merge-field-option textarea {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.merge-field-option textarea {
  resize: vertical;
}

.person-note-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfa;
}

.person-note-form label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.person-note-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: white;
  color: var(--ink);
  line-height: 1.45;
}

.person-note-form button {
  justify-self: start;
}

.people-detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.people-detail-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.people-detail-list li {
  margin-bottom: 10px;
  line-height: 1.38;
}

.people-detail-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.person-notes {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.person-notes article {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfa;
}

.person-notes time {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.person-notes p {
  margin: 0;
  line-height: 1.48;
  white-space: pre-wrap;
}

.compact-empty {
  padding: 6px 0 0;
}

.memory-panel:fullscreen .portfolio-layout,
.memory-panel.is-fullscreen-fallback .portfolio-layout {
  grid-template-columns: minmax(0, 2.2fr) minmax(360px, 0.95fr);
}

.portfolio-panel {
  display: grid;
  gap: 14px;
}

.graph-stage,
.graph-detail,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.graph-stage {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(23, 107, 77, 0.08), transparent 26rem),
    linear-gradient(180deg, #f8faf8 0%, white 100%);
}

.memory-panel:fullscreen .graph-stage,
.memory-panel.is-fullscreen-fallback .graph-stage {
  min-height: calc(100vh - 260px);
}

.graph-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.graph-edge {
  stroke: rgba(20, 35, 29, 0.16);
  stroke-width: 0.35;
}

.graph-nodes {
  position: absolute;
  inset: 0;
}

.graph-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 24px rgba(20, 35, 29, 0.08);
  color: var(--ink);
  text-align: left;
}

.graph-node.is-active {
  border-color: var(--green);
  box-shadow: 0 12px 30px rgba(23, 107, 77, 0.2);
}

.graph-node-project {
  background: #f4fbf7;
}

.graph-node-person {
  background: #fbf7f1;
}

.graph-node-asset-domain {
  background: #f4f6fd;
}

.graph-node-task {
  background: #fcfbef;
}

.graph-node-decision {
  background: #f7f2fb;
}

.graph-node-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.graph-node-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(20, 35, 29, 0.08);
  font-size: 0.75rem;
  font-weight: 800;
}

.graph-detail {
  padding: 24px;
}

.graph-detail h3 {
  margin: 0;
  font-size: 1.3rem;
}

.detail-type {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.detail-block {
  margin-top: 18px;
}

.detail-block p,
.detail-grid p {
  margin: 7px 0 0;
  line-height: 1.5;
}

.table-wrap {
  overflow: auto;
}

.memory-panel:fullscreen .table-wrap,
.memory-panel.is-fullscreen-fallback .table-wrap {
  max-height: calc(100vh - 260px);
}

.asset-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

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

.asset-table th {
  position: sticky;
  top: 0;
  background: #f8faf8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.table-subscore {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.table-empty {
  color: var(--muted);
}

.research-panel {
  display: block;
}

.research-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
}

.research-sidebar,
.research-document {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.research-sidebar {
  padding: 18px;
  align-self: start;
}

.research-sidebar h3,
.research-document h3 {
  margin: 0;
}

.research-sidebar p {
  margin: 6px 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

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

.research-list-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfa;
  color: var(--ink);
  text-align: left;
}

.research-list-item.is-active {
  border-color: var(--green);
  background: var(--green-soft);
}

.research-list-item span,
.research-list-item small {
  color: var(--muted);
  line-height: 1.35;
}

.research-list-item span {
  font-size: 0.82rem;
  font-weight: 750;
}

.research-list-item small {
  display: block;
  font-size: 0.8rem;
}

.research-document {
  min-height: 680px;
  padding: clamp(22px, 4vw, 38px);
  overflow: auto;
}

.memory-panel:fullscreen .research-document,
.memory-panel.is-fullscreen-fallback .research-document {
  max-height: calc(100vh - 260px);
}

.research-document-meta {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.research-markdown {
  max-width: 980px;
  line-height: 1.62;
}

.research-markdown h2 {
  margin: 0 0 18px;
  font-size: 2rem;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.research-markdown h3 {
  margin: 34px 0 12px;
  font-size: 1.25rem;
}

.research-markdown h4,
.research-markdown h5 {
  margin: 24px 0 10px;
  font-size: 1rem;
}

.research-markdown p,
.research-markdown ul,
.research-markdown blockquote {
  margin: 0 0 14px;
}

.research-markdown ul {
  padding-left: 22px;
}

.research-markdown li {
  margin-bottom: 7px;
}

.research-markdown a {
  color: var(--green-dark);
  font-weight: 700;
}

.research-markdown code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #eef5f0;
  color: var(--green-dark);
  font-size: 0.92em;
}

.research-markdown blockquote {
  padding: 14px 18px;
  border-left: 4px solid var(--green);
  border-radius: 12px;
  background: #f6faf7;
  color: var(--ink);
}

.research-table-wrap {
  width: 100%;
  margin: 16px 0 22px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.research-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

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

.research-table th {
  background: #f8faf8;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.market-map-layout {
  grid-template-columns: minmax(280px, 0.45fr) minmax(0, 1.8fr);
}

.memory-panel:fullscreen .market-map-layout,
.memory-panel.is-fullscreen-fallback .market-map-layout {
  grid-template-columns: minmax(280px, 0.35fr) minmax(0, 2.4fr);
}

.market-map-detail h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.06em;
}

.market-map-summary {
  max-width: 920px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.market-map-note {
  padding: 12px 14px;
  border: 1px solid #ead9ad;
  border-radius: 14px;
  background: #fff9e8;
  color: #6f5316;
  font-weight: 700;
}

.market-map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.7fr);
  gap: 18px;
  margin: 18px 0 24px;
}

.memory-panel:fullscreen .market-map-grid,
.memory-panel.is-fullscreen-fallback .market-map-grid {
  grid-template-columns: minmax(0, 2.2fr) minmax(360px, 0.65fr);
}

.market-map-stage {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(23, 107, 77, 0.08), transparent 26rem),
    linear-gradient(180deg, #fbfcfa 0%, white 100%);
}

.memory-panel:fullscreen .market-map-stage,
.memory-panel.is-fullscreen-fallback .market-map-stage {
  min-height: calc(100vh - 360px);
}

.market-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.market-map-columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  height: 100%;
  padding: 22px;
}

.market-map-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-map-column h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-map-column > div {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 12px;
  min-height: 620px;
}

.market-node {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 24px rgba(20, 35, 29, 0.08);
  color: var(--ink);
  text-align: left;
}

.market-node.is-active {
  border-color: var(--green);
  box-shadow: 0 12px 30px rgba(23, 107, 77, 0.2);
}

.market-node span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}

.market-node-person {
  background: #fbf7f1;
}

.market-node-company {
  background: #f4fbf7;
}

.market-node-brand {
  background: #f4f6fd;
}

.market-node-market {
  background: #eef7fb;
}

.market-node-customer-segment {
  background: #fcfbef;
}

.market-node-opportunity {
  background: #f7f2fb;
}

.market-map-side {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.market-map-side h3 {
  margin: 6px 0 4px;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.market-map-side a {
  color: var(--green-dark);
  font-weight: 800;
}

.market-relationship-list {
  margin: 0;
  padding-left: 18px;
}

.market-relationship-list li {
  margin-bottom: 10px;
}

.market-relationship-list span {
  color: var(--muted);
}

.file-upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcfa;
}

.file-upload-panel h3 {
  margin: 0 0 6px;
}

.file-upload-panel p {
  margin: 0;
  color: var(--muted);
}

.file-upload-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.file-upload-form input[type="file"],
.file-upload-form input[type="text"] {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
}

.file-upload-form input[type="text"] {
  padding: 0 12px;
}

.file-text-preview {
  max-height: 620px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faf8;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.brief-preview {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfa;
}

.brief-preview h1 {
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.brief-preview h2 {
  margin-top: 22px;
  font-size: 1.1rem;
}

.brief-items {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.brief-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.brief-item.is-done {
  opacity: 0.62;
}

.brief-item h4 {
  margin: 4px 0 8px;
  font-size: 1rem;
}

.brief-item p {
  margin: 5px 0;
  color: var(--muted);
}

.brief-item-kind {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.brief-item-context {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f8faf8;
  color: var(--ink);
  white-space: pre-wrap;
}

.danger-button {
  color: #9d3c3c;
}

.brief-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7e8e8;
  color: #9d3c3c;
  font-weight: 750;
}

.brief-snapshot {
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf8;
  color: var(--ink);
  white-space: pre-wrap;
}

.primary-button {
  width: min(100%, 520px);
  min-height: 128px;
  padding: 28px 34px;
  border: 0;
  border-radius: 28px;
  background: var(--green);
  box-shadow: 0 14px 0 var(--green-dark), var(--shadow);
  color: white;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button:hover {
  background: #197a57;
  transform: translateY(-2px);
  box-shadow: 0 16px 0 var(--green-dark), var(--shadow);
}

.primary-button:active {
  transform: translateY(8px);
  box-shadow: 0 6px 0 var(--green-dark), var(--shadow);
}

.text-button {
  display: block;
  margin: 30px auto 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.key-panel,
.task-card {
  margin-top: 48px;
  padding: clamp(24px, 6vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}

.key-panel {
  width: min(100%, 520px);
  margin-right: auto;
  margin-left: auto;
}

.key-panel h2 {
  margin: 0;
  font-size: 1.4rem;
}

.key-panel p {
  margin: 8px 0 24px;
  color: var(--muted);
}

.key-panel label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.key-row {
  display: flex;
  gap: 10px;
}

.key-row input {
  min-width: 0;
  flex: 1;
  padding: 13px 14px;
  border: 1px solid #b9c5bd;
  border-radius: 10px;
  color: var(--ink);
}

.small-button,
.complete-button,
.secondary-button {
  border-radius: 10px;
  font-weight: 750;
}

.small-button,
.complete-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
}

.small-button {
  padding: 12px 18px;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.project-pill {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.timer {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.task-card h2 {
  margin: 30px 0 28px;
  font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

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

.detail-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail p {
  margin: 7px 0 0;
  line-height: 1.55;
}

blockquote {
  margin: 24px 0;
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 750;
}

.context-panel {
  margin: 24px 0 0;
}

.context-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.context-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 14px;
  border: 1px solid #b9c5bd;
  border-radius: 12px;
  color: var(--ink);
  line-height: 1.45;
}

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

.complete-button,
.secondary-button {
  min-height: 50px;
  padding: 12px 18px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.message {
  min-height: 24px;
  margin: 28px auto 0;
  color: var(--muted);
}

.message[data-tone="success"] {
  color: var(--green);
  font-weight: 700;
}

.message[data-tone="error"] {
  color: #a12d2d;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  body.people-graph-page .people-graph-toolbar {
    right: 10px;
    left: 10px;
  }

  body.people-graph-page .people-primary-controls {
    flex-wrap: wrap;
    max-width: calc(100vw - 88px);
  }

  body.people-graph-page .people-search-control {
    min-width: min(420px, calc(100vw - 120px));
  }

  .people-search-control input {
    width: min(360px, calc(100vw - 180px));
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 48px;
  }

  .shell > header,
  .shell > #key-panel,
  .shell > #task-view,
  .shell > #message,
  .idle-view {
    width: 100%;
  }

  .key-row,
  .actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .memory-header,
  .memory-item-top,
  .portfolio-layout,
  .people-graph-toolbar,
  .people-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .memory-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .memory-fullscreen-button {
    width: 100%;
  }

  .portfolio-layout {
    display: flex;
  }

  .people-graph-stage {
    min-height: 520px;
  }

  .people-graph-node {
    max-width: 150px;
    padding: 10px 12px;
  }

  .people-detail,
  .memory-panel {
    padding: 18px;
  }

  .people-detail-columns {
    grid-template-columns: 1fr;
  }

  .research-layout {
    grid-template-columns: 1fr;
  }

  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .research-document {
    min-height: 420px;
  }

  .graph-stage {
    min-height: 520px;
  }

  .actions {
    display: grid;
  }

  .secondary-button {
    width: 100%;
  }
}

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