.idea-explorer {
  padding-block: clamp(2rem, 4.5vw, 4.2rem);
  --board-border: #c7cfe0;
}
.idea-heading h1 {
  max-width: none;
  font-size: clamp(2.75rem, 5.5vw, 5rem);
}
.idea-heading .eyebrow {
  margin-bottom: 0.7rem;
}
.idea-heading .lede {
  max-width: 72ch;
  margin-top: 0.9rem;
  color: var(--muted);
}
.explorer-tools,
.view-switch,
.board-controls,
.zoom-controls,
.reader-bar {
  display: flex;
  align-items: center;
}
.explorer-tools {
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.8rem 0 0.8rem;
}
.view-switch {
  border: 1px solid var(--board-border);
  border-radius: 0.35rem;
  padding: 3px;
}
.view-switch button,
.board-controls button,
.reader-bar button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 700;
}
.view-switch button {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 0.2rem;
}
.view-switch button[aria-pressed="true"] {
  background: var(--navy);
  color: white;
}
.board-symbol,
.list-symbol {
  width: 14px;
  height: 14px;
  display: inline-block;
}
.board-symbol {
  background:
    linear-gradient(currentColor 0 0) 0 0 / 6px 6px,
    linear-gradient(currentColor 0 0) 100% 0 / 6px 6px,
    linear-gradient(currentColor 0 0) 0 100% / 6px 6px,
    linear-gradient(currentColor 0 0) 100% 100% / 6px 6px;
  background-repeat: no-repeat;
}
.list-symbol {
  background: repeating-linear-gradient(
    to bottom,
    currentColor 0 2px,
    transparent 2px 5px
  );
}
.idea-search {
  position: relative;
  width: min(100%, 23rem);
}
.idea-search::before,
.idea-search::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.idea-search::before {
  left: 1rem;
  top: calc(50% - 7px);
  width: 10px;
  height: 10px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}
.idea-search::after {
  left: calc(1rem + 11px);
  top: calc(50% + 5px);
  width: 6px;
  height: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}
.idea-search input {
  width: 100%;
  min-height: 46px;
  font-size: 1rem;
  padding: 0.6rem 0.75rem 0.6rem 2.8rem;
  border: 1px solid var(--board-border);
  border-radius: 0.3rem;
  color: var(--ink);
  background: white;
}
#explorer-view {
  display: grid;
  align-items: start;
  gap: 0;
}
#explorer-view.reading-idea {
  grid-template-columns: minmax(0, 1.65fr) minmax(20rem, 1fr);
}
#board-view,
#idea-reader,
#idea-list {
  min-width: 0;
}
#board-view {
  border: 1px solid var(--board-border);
  border-radius: 0.3rem;
  overflow: clip;
}
.surface-bar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  background: var(--paper);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--board-border);
}
.surface-bar h2,
#idea-list > h2 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  letter-spacing: -0.025em;
  text-wrap: wrap;
}
.surface-bar p {
  color: var(--muted);
  font-size: 0.83rem;
  margin-top: 0.2rem;
}
.board-controls {
  gap: 0.65rem;
}
#show-clusters {
  text-decoration: underline;
  text-underline-offset: 0.23em;
}
.zoom-controls {
  border: 1px solid var(--board-border);
  background: #fff;
  border-radius: 0.25rem;
}
.zoom-controls button {
  min-width: 44px;
  font-size: 1.35rem;
  line-height: 1;
}
.zoom-controls button:disabled {
  color: #777f92;
  cursor: default;
}
#zoom-level {
  width: 3.1rem;
  text-align: center;
  color: var(--muted);
  font:
    500 0.8rem "Lab Inter",
    sans-serif;
  font-variant-numeric: tabular-nums;
}
#board-viewport {
  height: clamp(24rem, 62vh, 41rem);
  overflow: auto;
  position: relative;
  overscroll-behavior: contain;
  outline-offset: -4px;
  background-color: #f6f7fc;
  background-image: radial-gradient(#bcc6da 0.9px, transparent 0.9px);
  background-size: 16px 16px;
  cursor: grab;
}
#board-viewport.dragging,
#board-viewport.dragging * {
  cursor: grabbing;
  user-select: none;
}
#board-size {
  position: relative;
  overflow: clip;
  min-height: 1px;
  margin-inline: auto;
}
#board-surface {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.9rem), 1fr));
  align-content: start;
  align-items: stretch;
  gap: 1.1rem;
  padding: 1.4rem;
  transform-origin: top left;
}
#board-surface.focused {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
  gap: 1.2rem;
}
.cluster-stack,
.idea-note {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: var(--navy);
  overflow-wrap: anywhere;
  border: 1px solid #c6cddc;
  border-radius: 2px;
  background: white;
  padding: 0.85rem 0.9rem;
  box-shadow: 0 2px 4px #12194a0c;
}
.cluster-stack {
  min-height: 6.5rem;
  justify-content: space-between;
  gap: 0.6rem;
}
.cluster-stack.stacked {
  box-shadow:
    2px 2px 0 #fff,
    3px 3px 0 #c6cddc,
    4px 4px 0 #fff,
    5px 5px 0 #d5dae4;
}
.cluster-stack strong {
  font-size: 0.92rem;
  line-height: 1.24;
  letter-spacing: -0.015em;
}
.cluster-stack strong span {
  background: #ffdcf0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.08em 0.18em;
}
.cluster-stack.unplaced {
  border-style: dashed;
}
.cluster-stack.unplaced strong span {
  background: #e4e9f1;
}
.cluster-stack small {
  font-size: 0.77rem;
}
.cluster-stack:hover,
.idea-note:hover,
.idea-note[aria-current="true"] {
  border-color: var(--blue);
}
.cluster-stack:hover strong,
.idea-note:hover strong {
  color: var(--blue);
}
.idea-note {
  min-height: 8rem;
  gap: 0.55rem;
  border-left: 3px solid #a9b8de;
  padding: 1rem;
}
.idea-note[aria-current="true"] {
  box-shadow: 0 0 0 2px var(--blue);
}
.idea-note small,
.list-idea small {
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.idea-note strong {
  line-height: 1.28;
  font-size: 1rem;
}
.idea-note em {
  color: var(--magenta);
  font-size: 0.76rem;
  font-style: normal;
}
.placement {
  display: inline-block;
  color: #745500;
  font-size: 0.77rem;
  font-weight: 500;
}
.placement::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.35em;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}
.board-empty,
#list-empty {
  background: #fff;
  padding: 1rem;
  color: var(--muted);
  grid-column: 1 / -1;
}
#idea-list {
  background: #fff;
  padding: 1rem 0;
}
#idea-list > h2 {
  margin-bottom: 1.6rem;
}
.list-cluster {
  margin-bottom: 1.6rem;
}
.list-cluster h3 {
  font-size: 1.05rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid #f0b9dd;
}
.list-cluster ul {
  list-style: none;
  padding: 0;
}
.list-idea {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  align-items: baseline;
  gap: 0.4rem 1rem;
  min-height: 44px;
  padding: 0.65rem 0.3rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.list-idea:hover strong {
  text-decoration: underline;
}
#idea-reader {
  position: sticky;
  top: 0.4rem;
  border: 1px solid var(--board-border);
  border-radius: 0.3rem;
  background: white;
  margin-left: 0.75rem;
}
.reader-bar {
  justify-content: space-between;
  min-height: 52px;
  padding: 0.2rem 0.85rem;
  background: var(--navy);
}
.reader-bar button {
  color: white;
  padding: 0.4rem;
}
.reader-bar button:hover {
  text-decoration: underline;
}
.reader-bar .copy.done {
  color: var(--cyan);
}
#reader-content {
  max-height: min(68vh, 42rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(1rem, 2vw, 1.6rem);
}
#reader-content .eyebrow {
  font-size: 0.7rem;
  margin-bottom: 0.55rem;
}
#reader-content h2 {
  font-size: clamp(1.6rem, 2.3vw, 2.15rem);
  text-wrap: wrap;
}
.idea-prose {
  margin: 1rem 0;
}
.idea-record .idea-prose {
  font-size: 1.17rem;
  max-width: 64ch;
}
.idea-location {
  color: var(--muted);
  font-size: 0.87rem;
  margin: 1rem 0;
}
.idea-location .placement {
  display: block;
  margin-top: 0.25rem;
}
.idea-relations {
  margin-top: 1.6rem;
  border-top: 1px solid var(--line);
  padding-top: 1.15rem;
}
.idea-relations > :is(h2, h3) {
  font-size: 1.15rem;
}
.relation-intro {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.35rem 0 0.8rem;
}
.affinity-branch {
  margin: 1.05rem 0;
  border-left: 2px solid #c6c7fa;
  padding-left: 0.85rem;
}
.affinity-branch > :is(h3, h4) {
  font-size: 0.87rem;
  color: var(--navy);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.idea-links a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-height: 44px;
  padding: 0.5rem 0;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.35;
}
.idea-links a span {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.idea-links a small {
  font-size: 0.74rem;
}
.idea-links summary {
  min-height: 44px;
  padding: 0.7rem 0;
  color: var(--blue);
  font-size: 0.85rem;
}
.locate-idea {
  margin-top: 1.3rem;
}
@media (prefers-reduced-motion: no-preference) {
  #board-surface.enter-group > .idea-note {
    animation: into-group 0.19s ease-out;
  }
  @keyframes into-group {
    from {
      opacity: 0.45;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}
@media (max-width: 780px) {
  #explorer-view.reading-idea {
    grid-template-columns: minmax(0, 1fr);
  }
  .reading-idea #board-view,
  .reading-idea #idea-list {
    display: none;
  }
  #idea-reader {
    position: static;
    margin-left: 0;
  }
  #reader-content {
    max-height: none;
    overflow: visible;
  }
  .list-idea {
    grid-template-columns: 1fr;
    gap: 0.12rem;
  }
}
@media (max-width: 600px) {
  .explorer-tools {
    flex-wrap: wrap;
    margin-top: 1.2rem;
  }
  .idea-search {
    flex: 1 0 min(15rem, 100%);
  }
  .view-switch button {
    padding-inline: 0.65rem;
  }
  .surface-bar {
    padding: 0.7rem;
  }
  .board-controls {
    width: 100%;
    justify-content: space-between;
  }
  #board-viewport {
    height: clamp(22rem, 57dvh, 35rem);
  }
  #board-surface {
    gap: 0.8rem;
    padding: 0.9rem;
  }
  #board-surface.focused {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cluster-stack,
  .idea-note {
    padding: 0.65rem;
  }
  .cluster-stack strong {
    font-size: 0.86rem;
  }
  .idea-note strong {
    font-size: 0.9rem;
  }
}
