/* The organisation canvas is intentionally separate from the generic styling.
   It models operational leadership and independent governance as two branches. */
.org-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr);
  gap: 16px;
  align-items: stretch;
}
.operations-branch,
.governance-branch {
  position: relative;
  padding: 18px;
  border: 1px solid #365b62;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(18, 51, 60, .82), rgba(11, 35, 43, .92));
}
.governance-branch {
  border-color: #55716e;
  background: linear-gradient(145deg, rgba(26, 56, 57, .86), rgba(10, 31, 37, .96));
}
.branch-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.branch-label span {
  color: #f4c67c;
  font-weight: 900;
  font-size: 9px;
  letter-spacing: .1em;
}
.branch-label small { color: #83a8aa; font-size: 10px; }
.executive-row {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(170px, .85fr);
  gap: 10px;
}
button.agent-node { font: inherit; cursor: pointer; text-align: left; }
.agent-node.staff {
  border-color: #3c777a;
  background: #11323a;
}
.agent-node.independent {
  width: 100%;
  min-height: 82px;
  margin-top: 8px;
  border-style: dashed;
  background: #112d34;
}
.agent-node.independent:hover,
.agent-node.staff:hover {
  border-color: #e0aa5b;
  background: #173c42;
}
.director-stem { height: 22px; }
.org-team { grid-template-columns: repeat(4, 1fr); gap: 9px; }
.registry-load {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px dashed #47686c;
  border-radius: 8px;
  color: #a7bfc0;
}
.registry-load b { color: #efc178; font-size: 11px; white-space: nowrap; }
.registry-load span { font-size: 10px; }
.governance-rule {
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid #35565c;
  color: #adbfbd;
  font-size: 10px;
  line-height: 1.45;
}
.backend-status { cursor: default; }
.backend-status i { color: #ecb768; }
.api-register {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #355b63;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(13, 40, 49, .98), rgba(8, 29, 36, .98));
}
.api-register > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.api-register h3 { margin: 4px 0 5px; color: #eef2e9; font-size: 18px; letter-spacing: -.025em; }
.api-register header p:last-of-type { max-width: 760px; margin: 0; color: #a9c0c0; font-size: 11px; }
.api-register > header > span { flex: none; margin-top: 2px; padding: 6px 9px; border: 1px solid #4d6f75; border-radius: 99px; color: #f0c176; font-size: 8px; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.api-register-empty { margin-top: 14px; padding: 12px; border: 1px dashed #476a70; border-radius: 8px; color: #91adae; font-size: 11px; }
.api-agent-roster { display: grid; gap: 14px; margin-top: 16px; }
.api-register-group h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: #f0c077; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.api-register-group h4 span { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid #536e73; border-radius: 99px; color: #b9cecc; font-size: 8px; }
.api-register-group > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.api-agent-card { display: grid; gap: 5px; min-width: 0; padding: 12px; border: 1px solid #2f555d; border-radius: 9px; background: #0d2831; color: #cfe0dc; text-align: left; }
.api-agent-card:hover { border-color: #e0aa5b; background: #14343d; }
.api-agent-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.api-agent-card-top b { color: #f0f1ea; font-size: 12px; }
.api-agent-card-top i { flex: none; padding: 3px 5px; border: 1px solid #3c686b; border-radius: 4px; color: #80cec0; font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.api-agent-card small { overflow: hidden; color: #91aeaf; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.api-agent-card em { display: -webkit-box; overflow: hidden; min-height: 32px; color: #b8cecd; font-size: 9px; font-style: normal; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.api-agent-card code { overflow: hidden; padding: 5px 6px; border: 1px solid #294953; border-radius: 5px; background: #08202a; color: #e2b56f; font: 7px/1.15 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.api-agent-card-foot { color: #79a5a4; font-size: 7px; }
.full-org-section {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #355b63;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(13, 40, 49, .98), rgba(8, 29, 36, .98));
}
.full-org-section > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.full-org-section h3 { margin: 4px 0 5px; color: #eef2e9; font-size: 18px; letter-spacing: -.025em; }
.full-org-section header p:last-of-type { max-width: 760px; margin: 0; color: #a9c0c0; font-size: 11px; }
.full-org-section > header > span { flex: none; margin-top: 2px; padding: 6px 9px; border: 1px solid #4d6f75; border-radius: 99px; color: #f0c176; font-size: 8px; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.full-org-empty { margin-top: 14px; padding: 12px; border: 1px dashed #476a70; border-radius: 8px; color: #91adae; font-size: 11px; }
.full-org-canvas { margin-top: 16px; overflow: hidden; padding: 16px; border: 1px solid #31555d; border-radius: 10px; background: radial-gradient(circle at 50% 0, rgba(68, 120, 121, .18), transparent 38%), #09242d; }
.full-org-root { display: grid; justify-items: center; min-width: 1020px; }
.full-org-founder { display: grid; gap: 4px; min-width: 280px; padding: 13px 18px; border: 1px solid #d9a352; border-radius: 9px; background: #254237; text-align: center; }
.full-org-founder span { color: #f1c57e; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.full-org-founder b { color: #f4f1e7; font-size: 14px; }
.full-org-founder small { color: #bed1c9; font-size: 9px; }
.full-org-stem { width: 1px; height: 24px; background: #c89954; }
.full-org-branches { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .85fr); width: 100%; gap: 14px; align-items: stretch; }
.full-org-operations,
.full-org-governance { padding: 13px; border: 1px solid #365f66; border-radius: 9px; background: rgba(12, 42, 51, .74); }
.full-org-governance { border-color: #5a756f; background: rgba(27, 51, 52, .78); }
.full-org-operations > header,
.full-org-governance > header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #315761; }
.full-org-operations > header span,
.full-org-governance > header span { color: #f0c177; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.full-org-operations > header small,
.full-org-governance > header small { color: #8eaaaa; font-size: 8px; }
.full-org-governance > p { margin: -2px 0 11px; color: #a6bfbb; font-size: 9px; line-height: 1.35; }
.full-org-lead { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .9fr); gap: 8px; margin-bottom: 12px; }
.full-org-directs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.full-org-governance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.full-org-agent-wrap { min-width: 0; }
.full-org-subteam { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 6px 4px 0; padding: 7px 6px 0; border-top: 1px dashed #4d7072; }
.full-org-agent { display: grid; gap: 5px; min-width: 0; padding: 10px; border: 1px solid #39616a; border-radius: 8px; background: #0d2c35; color: #cfe0dc; text-align: left; }
.full-org-agent:hover { border-color: #e0aa5b; background: #163943; }
.full-org-agent.director { border-color: #d19a50; background: #1d3e39; }
.full-org-agent.nikita { border-color: #4b8083; background: #12333b; }
.full-org-agent.governance { border-style: dashed; border-color: #5b7971; background: #153337; }
.full-org-agent.subordinate { padding: 8px; border-color: #497078; background: #102f38; }
.full-org-agent.subordinate .full-org-agent-top b { font-size: 9px; }
.full-org-agent.subordinate em { min-height: 0; -webkit-line-clamp: 2; }
.full-org-agent-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.full-org-agent-top b { color: #eef2e9; font-size: 11px; }
.full-org-agent-top i { flex: none; padding: 2px 4px; border: 1px solid #3d6b6d; border-radius: 4px; color: #81cfbf; font-size: 6px; font-style: normal; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.full-org-agent small { overflow: hidden; color: #8eaeb0; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.full-org-agent em { display: -webkit-box; overflow: hidden; min-height: 25px; color: #b9cfcc; font-size: 8px; font-style: normal; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.full-org-agent strong { color: #e7bf7b; font-size: 7px; font-weight: 800; line-height: 1.35; }
.case-compose {
  display: grid;
  grid-template-columns: minmax(180px, .75fr) minmax(280px, 1.6fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 14px;
  padding: 17px;
  border: 1px solid #3b6168;
  border-radius: 12px;
  background: #102c35;
}
.case-compose label,
.auth-dialog label { display: grid; gap: 6px; color: #aec7c7; font-size: 10px; font-weight: 800; }
.case-compose input,
.case-compose textarea,
.auth-dialog input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #426a70;
  border-radius: 7px;
  background: #09232c;
  color: #edf3ed;
  padding: 10px;
  font: inherit;
}
.case-compose textarea { min-height: 64px; resize: vertical; }
.case-compose .primary { margin: 0; white-space: nowrap; }
.case-list { display: grid; gap: 8px; }
.case-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #294f58;
  border-radius: 11px;
  background: #0d2831;
}
.case-row strong { display: block; color: #eef2e9; }
.case-row small { display: block; margin-top: 4px; color: #8eadaf; }
.case-row span { color: #efc177; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.auth-dialog p { color: #b0c8c7; }
.auth-dialog form { display: grid; gap: 12px; margin-top: 18px; }
.auth-dialog .primary { justify-self: start; margin: 0; }
.auth-result { min-height: 18px; color: #efc177 !important; font-size: 12px; }
@media (max-width: 960px) {
  .case-compose { grid-template-columns: 1fr; }
  .case-compose .primary { justify-self: start; }
}
@media (max-width: 1150px) {
  .org-split { grid-template-columns: 1fr; }
  .org-team { grid-template-columns: repeat(3, 1fr); }
  .api-register-group > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .full-org-root { min-width: 830px; }
  .full-org-branches { grid-template-columns: 1fr; }
  .full-org-subteam { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .org-split,
  .executive-row,
  .org-team { grid-template-columns: 1fr; }
  .director-stem { display: none; }
  .branch-label { display: block; }
  .branch-label small { display: block; margin-top: 4px; }
  .api-register { padding: 14px; }
  .api-register > header { display: block; }
  .api-register > header > span { display: inline-flex; margin-top: 9px; }
  .api-register-group > div { grid-template-columns: 1fr; }
  .full-org-section { padding: 14px; }
  .full-org-section > header { display: block; }
  .full-org-section > header > span { display: inline-flex; margin-top: 9px; }
  .full-org-canvas { overflow-x: auto; }
}
