/* Mind map template — tool styles. Shared chrome comes from /assets/css/shared.css. */

.mm-page .header-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 6px 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.mm-page .header-back-link:hover {
  border-color: var(--text-secondary);
  text-decoration: none;
}

.mm-page main {
  padding-top: 1.35rem;
}

.mm-page .page-intro {
  max-width: 42rem;
  margin-bottom: 1.1rem;
}

.mm-page .page-intro h1 {
  margin-bottom: 0.45rem;
}

.mm-page .lead {
  margin: 0 0 0.65rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

.mm-page .privacy-line {
  margin: 0;
}

.mm-tool {
  margin: 0 0 1.25rem;
}

.template-label {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.template-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.template-bar button,
.editor button,
.downloads button {
  font: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  cursor: pointer;
}

.template-bar button:hover,
.editor button:hover,
.downloads button:hover {
  border-color: var(--text-secondary);
}

.template-bar button[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 650;
}

.downloads button.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.board-wrap {
  height: 390px;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #f7f4ee;
  color-scheme: light;
  box-shadow: var(--shadow-sm);
}

.board {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.links {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

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

.node {
  position: absolute;
  z-index: 1;
}

.node-btn {
  display: block;
  max-width: 16rem;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--node-accent, #8aa0b8);
  border-radius: 999px;
  background: var(--node-bg, #fff);
  color: #1d1d1f;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: grab;
  touch-action: none;
}

.node--root .node-btn {
  max-width: 18rem;
  padding: 0.6rem 1.15rem;
  border-color: #16324f;
  background: #16324f;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
}

.node--c0 { --node-accent: #1d6fbf; --node-bg: #e7f2fb; }
.node--c1 { --node-accent: #0f7b5a; --node-bg: #e5f6ef; }
.node--c2 { --node-accent: #a15c07; --node-bg: #fbf3e4; }
.node--c3 { --node-accent: #8a3d6f; --node-bg: #f8eaf3; }
.node--c4 { --node-accent: #3d4fa3; --node-bg: #eceefe; }
.node--c5 { --node-accent: #9a3b32; --node-bg: #fdecea; }

.node.is-selected .node-btn {
  box-shadow: 0 0 0 2px #f7f4ee, 0 0 0 4px #005bb5;
}

.node.is-drop .node-btn {
  box-shadow: 0 0 0 2px #f7f4ee, 0 0 0 4px #0f7b5a;
}

.node.is-dragging {
  opacity: 0.45;
  z-index: 2;
}

.node-btn:active {
  cursor: grabbing;
}

.editor {
  margin-top: 0.75rem;
}

.editor-text label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--text-secondary);
}

.editor-text input {
  width: 100%;
  max-width: 36rem;
  min-width: 0;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}

.hint {
  margin: 0.65rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.downloads,
.seo,
.faq,
.cta,
.apps {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem 1.15rem;
  margin: 0 0 1rem;
}

.downloads h2,
.seo h2,
.faq h2,
.cta h2,
.apps h2 {
  margin: 0 0 0.4rem;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.downloads h3 {
  margin: 0.9rem 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.downloads p,
.seo p,
.apps p,
.faq p,
.cta p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.save-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.seo h3 {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
}

.seo ol,
.seo ul,
.apps ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.seo li,
.apps li {
  margin: 0.35rem 0;
  line-height: 1.5;
}

.faq details {
  border-top: 1px solid var(--border);
  padding: 0.7rem 0;
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  margin: 0.45rem 0 0.2rem;
}

.cta {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 72%),
    var(--bg-elevated);
}

.cta-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.cta h2 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.app-links {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 0.5rem;
}

.app-links li {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.app-links a {
  font-weight: 650;
}

.app-links span {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.mm-nav {
  margin: 0.25rem 0 0;
}

.editor button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .board-wrap {
    height: 360px;
  }

  .dl-row button,
  .template-bar button {
    flex: 1 1 calc(50% - 0.45rem);
  }

  .editor-text input {
    max-width: none;
  }
}

@media print {
  body::before,
  .site-header,
  .site-footer,
  .page-intro,
  .template-label,
  .template-bar,
  .editor,
  .downloads,
  .seo,
  .faq,
  .cta,
  .apps,
  .skip-link {
    display: none !important;
  }

  body,
  main,
  .mm-tool {
    margin: 0;
    padding: 0;
    max-width: none;
    background: #fff;
  }

  .board-wrap {
    height: auto;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }
}
