/* Generated chapter mind-map pages share this production stylesheet. */

:root {
  --mm-sky: #30bced;
  --mm-graphite: #303036;
  --mm-ghost: #fffaff;
  --mm-tomato: #fc5130;
  --mm-border: #d7d7dc;
}

.mm-shell {
  max-width: 1580px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.mm-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin: 1rem 0 1.2rem;
}

.mm-heading h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
}

.mm-heading p {
  max-width: 78ch;
  margin: 0;
  color: rgba(48, 48, 54, 0.72);
}

.mm-count {
  border: 1px solid var(--mm-border);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: white;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.mm-toolbar {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.mm-search-wrap {
  position: relative;
}

.mm-search {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--mm-border);
  border-radius: 11px;
  padding: 0.7rem 2.5rem 0.7rem 0.85rem;
  background: white;
  box-shadow: 0 5px 16px rgba(48, 48, 54, 0.06);
}

.mm-search-icon {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  transform: translateY(-50%);
  color: rgba(48, 48, 54, 0.5);
  pointer-events: none;
}

.mm-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--mm-border);
  border-radius: 11px;
  background: white;
  box-shadow: 0 16px 38px rgba(48, 48, 54, 0.18);
}

.mm-search-results[hidden] {
  display: none;
}

.mm-result {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #ececf0;
  padding: 0.65rem 0.75rem;
  background: white;
  color: var(--mm-graphite);
  text-align: left;
  cursor: pointer;
}

.mm-result:hover,
.mm-result:focus-visible {
  background: #f1f9fc;
}

.mm-result-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--result-color);
}

.mm-result small {
  display: block;
  margin-top: 0.1rem;
  color: rgba(48, 48, 54, 0.58);
}

.mm-actions {
  display: flex;
  gap: 0.4rem;
}

.mm-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: white;
  color: var(--mm-graphite);
  font-weight: 700;
  cursor: pointer;
}

.mm-button:hover,
.mm-button:focus-visible {
  border-color: var(--mm-sky);
  background: #daf3fc;
}

.mm-stage {
  min-height: 850px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  overflow: hidden;
  border: 1px solid var(--mm-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 16%, rgba(48, 188, 237, 0.12), transparent 31%),
    radial-gradient(circle at 80% 78%, rgba(126, 87, 194, 0.1), transparent 34%),
    white;
  box-shadow: 0 16px 45px rgba(48, 48, 54, 0.1);
}

.mm-canvas {
  min-width: 0;
  position: relative;
}

.mm-hint {
  position: absolute;
  z-index: 4;
  top: 1rem;
  left: 1rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid rgba(215, 215, 220, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(48, 48, 54, 0.68);
  font-size: 0.72rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

#chapter-mindmap {
  width: 100%;
  height: 850px;
  cursor: grab;
  touch-action: none;
}

#chapter-mindmap:active {
  cursor: grabbing;
}

.mm-side {
  padding: 1.3rem;
  background: rgba(255, 250, 255, 0.9);
  border-left: 1px solid var(--mm-border);
  backdrop-filter: blur(10px);
}

.mm-eyebrow {
  color: var(--mm-tomato);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-side h2 {
  margin: 0.4rem 0 0.55rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.mm-side p {
  color: rgba(48, 48, 54, 0.74);
  font-size: 0.9rem;
}

.mm-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0;
}

.mm-path span {
  padding: 0.25rem 0.48rem;
  border-radius: 999px;
  background: #daf3fc;
  color: var(--mm-graphite);
  font-size: 0.69rem;
  font-weight: 700;
}

.mm-toggle {
  width: 100%;
  margin: 0.2rem 0 1.1rem;
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: var(--mm-graphite);
  color: var(--mm-ghost);
  font-weight: 700;
  cursor: pointer;
}

.mm-toggle:hover {
  background: var(--mm-tomato);
}

.mm-toggle[hidden] {
  display: none;
}

.mm-legend {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mm-border);
}

.mm-legend strong {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mm-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  margin: 0.4rem 0;
  font-size: 0.78rem;
  color: rgba(48, 48, 54, 0.7);
}

.mm-legend-item span:first-child {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--legend-color);
}

.mm-page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.mm-page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--mm-graphite);
  font-weight: 700;
  text-decoration: none;
}

.mm-page-nav a:hover {
  color: var(--mm-tomato);
}

.mm-link {
  fill: none;
  stroke: var(--branch-color);
  stroke-width: var(--branch-width);
  stroke-linecap: round;
  opacity: 0.72;
  transition: opacity 0.18s, stroke-width 0.18s;
}

.mm-link.is-path {
  stroke: var(--mm-tomato);
  stroke-width: 4;
  opacity: 1;
}

.mm-link.is-muted {
  opacity: 0.1;
}

.mm-node {
  cursor: pointer;
  outline: none;
}

.mm-node circle {
  fill: white;
  stroke: var(--node-color);
  stroke-width: 2.5;
  transition: fill 0.18s, r 0.18s, opacity 0.18s;
}

.mm-node text {
  fill: var(--mm-graphite);
  font-family: "Cabin", sans-serif;
  font-size: 10px;
  font-weight: 600;
  paint-order: stroke;
  stroke: white;
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.mm-node[data-kind="Chapter"] text,
.mm-node[data-kind="Section"] text {
  font-weight: 700;
}

.mm-node[data-kind="Subtopic"] text {
  font-size: 9px;
}

.mm-node.has-hidden-children circle {
  fill: var(--node-color);
}

.mm-node:hover circle,
.mm-node:focus-visible circle,
.mm-node.is-path circle {
  fill: var(--node-color);
  r: 7.5;
}

.mm-node.is-selected circle {
  stroke: var(--mm-tomato);
  stroke-width: 4;
}

.mm-node.is-muted {
  opacity: 0.16;
}

.mindmap-index {
  max-width: 1260px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.mindmap-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

.mindmap-index-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 150px;
  border: 1px solid var(--mm-border);
  border-top: 5px solid var(--card-color);
  border-radius: 12px;
  padding: 1rem;
  background: white;
  color: var(--mm-graphite);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(48, 48, 54, 0.07);
  transition: transform 0.18s, box-shadow 0.18s;
}

.mindmap-index-card:hover {
  color: var(--mm-graphite);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(48, 48, 54, 0.12);
}

.mindmap-index-card .chapter-number {
  color: var(--mm-tomato);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mindmap-index-card strong {
  font-size: 1.02rem;
  line-height: 1.25;
}

.mindmap-index-card small {
  margin-top: auto;
  color: rgba(48, 48, 54, 0.62);
}

@media (max-width: 980px) {
  .mm-heading,
  .mm-toolbar,
  .mm-stage {
    grid-template-columns: 1fr;
  }

  .mm-count,
  .mm-actions {
    justify-self: start;
  }

  .mm-stage {
    min-height: 1080px;
  }

  #chapter-mindmap {
    height: 740px;
  }

  .mm-side {
    border-top: 1px solid var(--mm-border);
    border-left: 0;
  }
}
