.mind-toggle { color: #aafce2; border-color: #5e9f9a; }
.mind-toggle[aria-pressed="true"] { background: #20423e; border-color: #86dcc4; }
.mind-view { --network: #93dbc8; }

.mind-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 19px;
}
.mind-heading h2 {
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  letter-spacing: -.06em;
  font-weight: 660;
}
.mind-heading h2:focus { outline: none; }
.mind-progress { width: min(37%, 260px); display: grid; gap: 7px; justify-items: end; }
.mind-progress output { font: .875rem var(--mono); color: #b1f7e2; text-align: right; }
.mind-progress progress { display: block; width: 100%; height: 8px; accent-color: #78f7cc; }

.mind-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(315px, 1fr); gap: 15px; align-items: start; }
.mind-map, .mind-detail {
  border: 1px solid #385259;
  border-radius: 8px;
  box-shadow: 0 16px 42px #0005;
}
.mind-map {
  min-width: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 18px;
  background:
    radial-gradient(ellipse at 50% 48%, #163439 0%, #0b1b22 52%, transparent 78%),
    radial-gradient(circle at 1px 1px, #627b8342 1px, transparent 1px) 0 0 / 18px 18px,
    #091419;
}
#mind-web { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.mind-axis { position: absolute; inset: 45px 29% 22px; pointer-events: none; }
.mind-branches { display: flex; justify-content: space-between; gap: clamp(28px, 21%, 145px); position: relative; z-index: 1; }
.mind-branch-column { width: min(35%, 183px); min-width: 128px; }
.mind-branch-column h3 { color: #b5d6da; font: 600 .875rem var(--mono); margin: 0 0 11px; }
.mind-branch-list { display: grid; gap: 7px; }
.mind-branch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  min-height: 43px;
  padding: 7px 9px;
  text-align: left;
  color: #e4f3f1;
  border: 1px solid color-mix(in srgb, var(--branch) 25%, #354750);
  border-left: 2px solid color-mix(in srgb, var(--branch) 67%, #396068);
  border-radius: 4px;
  background: #111e25ed;
  font-size: .875rem;
  line-height: 1.25;
}
.mind-branch:hover { background: #182c34; }
.mind-branch[aria-pressed="true"] {
  border-color: var(--branch);
  background: color-mix(in srgb, var(--branch) 18%, #0d2029);
  box-shadow: 0 0 18px color-mix(in srgb, var(--branch) 24%, transparent);
}
.mind-branch span { color: #bfccd1; white-space: nowrap; font: .73rem var(--mono); }
.mind-branch[aria-pressed="true"] span { color: #e4f9f5; }

.mind-detail { background: #101c21; overflow: hidden; min-width: 0; }
.mind-detail-head {
  padding: 16px;
  border-bottom: 1px solid #334b52;
  background: linear-gradient(125deg, color-mix(in srgb, var(--network) 15%, #142029), #132027 73%);
}
.mind-detail-head h3 { font-size: 1.33rem; margin: 0 0 5px; }
.mind-detail-head p { color: #b8d1d4; font-size: .875rem; }
.mind-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; padding: 11px 15px 4px; font-size: .8125rem; color: #b9ccce; }
.mind-legend span { display: inline-flex; gap: 5px; align-items: center; }
.mind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.mind-dot.lit { background: #8ff1ce; box-shadow: 0 0 6px #84fbd683; }
.mind-dot.grey { background: #9aa7b4; }
.mind-dot.unknown { border: 1px dashed #879ba3; }
.mind-nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 12px 15px 15px;
  max-height: clamp(300px, 61svh, 560px);
  overflow: auto;
  scrollbar-color: #516b70 #10181c;
}
.mind-node {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 82px;
  padding: 5px;
  border-radius: 5px;
  color: #e8f8f5;
  background: radial-gradient(ellipse at 50% 20%, #213941, #15252c 70%);
  border: 1px solid color-mix(in srgb, var(--network) 38%, #213840);
  text-align: center;
  line-height: 1.2;
  font-size: .8125rem;
  overflow-wrap: anywhere;
}
.mind-node .emblem { width: 41px; height: 41px; }
.mind-node.grey { background: #252b31; border-color: #687782; color: #d2dbe0; }
.mind-node.grey .emblem { filter: grayscale(1); opacity: .7; }
.mind-node.unknown { color: #9baaaf; background: #101a20; border: 1px dashed #42585f; font: 1.4rem var(--mono); }

@media (max-width: 1040px) {
  .mind-workspace { grid-template-columns: minmax(0, 1.15fr) minmax(285px, 1fr); }
  .mind-branches { gap: 31px; }
  .mind-branch-column { width: 44%; }
}
@media (max-width: 820px) {
  .mind-workspace { grid-template-columns: minmax(0, 1fr); }
  .mind-branches { gap: clamp(16px, 18%, 130px); }
  .mind-branch-column { width: min(42%, 219px); }
  .mind-nodes { grid-template-columns: repeat(auto-fill, minmax(87px, 1fr)); max-height: none; }
}
@media (max-width: 460px) {
  .topbar { flex-wrap: wrap; }
  .topbar .settings { flex-wrap: wrap; }
  .mind-progress { width: 49%; }
  .mind-map { padding: 12px; }
  .mind-branch-column { min-width: 0; width: 44%; }
  .mind-branches { gap: 19px; padding-top: 90px; }
  .mind-axis { inset: 8px 21% auto; height: 90px; }
  .mind-branch { padding-inline: 5px; font-size: .8125rem; }
  .mind-branch span { font-size: .67rem; }
}
