/* === 7.3 Crank-No-Start troubleshooter — page styles ===
 * Relies on theme custom properties from styles.css (loaded first). */

.cns-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.cns-intro {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.cns-intro p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.cns-intro p:last-child { margin-bottom: 0; }
.cns-intro strong { color: var(--text-primary); }

/* === Progress bar === */
.cns-progress {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.cns-progress-track {
  flex: 1;
  min-width: 160px;
  height: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.cns-progress-fill {
  height: 100%;
  width: 0;
  background: var(--success);
  transition: width 0.25s ease;
}
.cns-progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* === Tabs === */
.cns-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}
.cns-tab {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: none;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.cns-tab:not(:last-child) { border-right: 1px solid var(--border); }
.cns-tab.active { background: var(--border-focus); color: #fff; }

/* === Guided walkthrough === */
.cns-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
}
.cns-crumb {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s;
}
.cns-crumb:hover { border-color: var(--border-focus); color: var(--text-secondary); }
.cns-crumb.current {
  border-color: var(--border-focus);
  color: var(--text-primary);
  background: var(--bg-input);
}
.cns-crumb-sep { color: var(--text-muted); }

.cns-step {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-focus);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
}
.cns-step-decision { border-left-color: var(--accent-a); }
.cns-step-action { border-left-color: var(--accent-b); }
.cns-step-info { border-left-color: #8b5cf6; }
.cns-step-terminal { border-left-color: var(--danger); }
.cns-step-start { border-left-color: var(--success); }
.cns-step-ref { border-left-color: var(--accent-b); }

.cns-step-kind {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.cns-step-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.cns-step-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

/* checkbox */
.cns-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-right: 1rem;
}
.cns-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--success); cursor: pointer; }
.cns-check-drawer { margin-top: 1rem; }

.cns-details-btn {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.cns-details-btn:hover { background: var(--border-focus); color: #fff; }

/* answers */
.cns-answers { margin-top: 1.2rem; }
.cns-answers-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.cns-answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}
.cns-answer {
  text-align: left;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cns-answer:hover {
  border-color: var(--accent-a);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.cns-answer-label {
  font-weight: 700;
  color: var(--accent-hover);
  font-size: 0.92rem;
}
.cns-answer-dest {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cns-endpoint {
  margin-top: 1.2rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.cns-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.cns-btn {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.cns-btn:hover { border-color: var(--border-focus); color: var(--text-primary); }
.cns-btn-ghost { margin-left: auto; }

/* === Map view === */
.cns-map-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.cns-map-scroll {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: 80vh;
}
#cns-map { min-width: 760px; }
#cns-map svg { max-width: none; height: auto; }
#cns-map .node { cursor: pointer; }
#cns-map .node.cns-node-done rect,
#cns-map .node.cns-node-done polygon,
#cns-map .node.cns-node-done circle,
#cns-map .node.cns-node-done path {
  stroke: var(--success) !important;
  stroke-width: 2.5px !important;
}

/* === Drawer (details popout) === */
.cns-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}
.cns-scrim.open { opacity: 1; pointer-events: auto; }

.cns-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(460px, 92vw);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
  z-index: 1001;
  overflow-y: auto;
  padding: 1.4rem 1.4rem 3rem;
}
.cns-drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.25s ease, visibility 0s linear 0s;
}

.cns-drawer-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}
.cns-drawer-close:hover { border-color: var(--danger); color: var(--danger); }

.cns-drawer-kind {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 0.6rem;
}
.cns-drawer-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.7rem;
  padding-right: 1.5rem;
}
.cns-drawer-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}
.cns-drawer-h {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-hover);
  margin: 1rem 0 0.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
}
.cns-how, .cns-tips, .cns-sources { padding-left: 1.2rem; }
.cns-how li, .cns-tips li {
  font-size: 0.86rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.45;
}
.cns-how li { padding-left: 0.2rem; }
.cns-drawer-why {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cns-pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
}
.cns-pill {
  font-size: 0.76rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.cns-pill-part { border-color: var(--accent-b); color: #9dc1f5; }
.cns-safety {
  margin-top: 1rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.84rem;
  color: #fda4a4;
}
.cns-sources li { font-size: 0.8rem; margin-bottom: 0.25rem; }
.cns-sources a { color: var(--accent-b); }
.cns-drawer-jump { display: block; margin-top: 1.2rem; margin-left: 0; }
.cns-muted { color: var(--text-muted); font-size: 0.88rem; }

/* === SEO / crawlable content === */
.cns-seo {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cns-seo h2 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}
.cns-seo-lead {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}
.cns-seo-group { margin-bottom: 1.4rem; }
.cns-seo-group h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--accent-hover);
}
.cns-seo-group > p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  line-height: 1.55;
}
.cns-seo-group ul { list-style: none; padding: 0; }
.cns-seo-group li {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 0.3rem 0 0.3rem 1rem;
  border-left: 2px solid var(--border);
  margin-bottom: 0.2rem;
  line-height: 1.5;
}
.cns-seo-group li strong { color: var(--text-secondary); }

/* === FAQ === */
.cns-faq {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cns-faq h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--text-primary); }
.cns-faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--bg-input);
}
.cns-faq summary {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
}
.cns-faq summary::-webkit-details-marker { display: none; }
.cns-faq summary::before { content: "＋ "; color: var(--accent-a); font-weight: 700; }
.cns-faq details[open] summary::before { content: "－ "; }
.cns-faq details[open] summary { border-bottom: 1px solid var(--border); }
.cns-faq .cns-faq-a {
  padding: 0.7rem 0.9rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* === Disclaimer === */
.cns-disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .cns-step { padding: 1rem; }
  .cns-step-title { font-size: 1.1rem; }
  .cns-btn-ghost { margin-left: 0; }
}
