/* ==========================================================================
   guide.css — the troubleshooting section. Builds on app.css.
   ========================================================================== */

/* ---- shared site nav (used on both pages) ------------------------------- */

.sitenav { display: flex; gap: 4px; align-items: center; }
.sitenav a {
  padding: 7px 15px; border-radius: 3px;
  font-size: 12.5px; letter-spacing: .05em;
  color: var(--ink-3); text-decoration: none;
  border: 1px solid transparent;
  transition: color .18s, border-color .18s, background .18s;
}
.sitenav a:hover { color: var(--ink); background: var(--panel-2); }
.sitenav a.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* ---- page frame --------------------------------------------------------- */

/* prose, so it wants to be narrower than the movement page */
.guide-page { --page-max: 1180px; }
.guide { max-width: var(--page-max); margin: 0 auto; padding: 26px var(--page-pad) 10px; }

.g-hero { padding: 14px 0 34px; border-bottom: 1px solid var(--line-soft); }
.g-hero h1 {
  font-family: var(--serif); font-size: clamp(30px, 4vw, 42px);
  margin: 8px 0 0; letter-spacing: -0.01em;
}
.g-lead { max-width: 62ch; margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }
.g-lead em { color: var(--ink); font-style: italic; }

.g-anatomy {
  display: grid; grid-template-columns: 150px 1fr; gap: 26px;
  margin-top: 28px; align-items: center;
}
.g-anatomy-trace { width: 150px; }
.g-anatomy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.g-anatomy-list li { display: grid; grid-template-columns: 100px 1fr; gap: 14px; align-items: baseline; }
.g-anatomy-list .ax {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.g-anatomy-list span:last-child { font-size: 13.4px; color: var(--ink-2); }

/* ---- sections ----------------------------------------------------------- */

.g-section { padding: 34px 0; border-bottom: 1px solid var(--line-soft); }
.g-section:last-of-type { border-bottom: 0; }
.g-section h2 { font-family: var(--serif); font-size: 24px; }
.g-sub { margin: 8px 0 0; max-width: 68ch; font-size: 13.6px; color: var(--ink-3); }

.g-section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
}
.g-tools { display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }

.g-search {
  width: min(300px, 60vw); padding: 8px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: inherit; font-size: 13px;
}
.g-search:focus { outline: none; border-color: var(--accent); }

.g-filters { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.g-chip {
  padding: 5px 11px; border-radius: 2px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-3);
  font-family: inherit; font-size: 11.5px;
  transition: border-color .16s, color .16s;
}
.g-chip:hover { color: var(--ink); }
.g-chip.on { border-color: var(--accent); color: var(--accent); }

/* ---- period cards ------------------------------------------------------- */

.g-periods-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin-top: 20px;
}
.g-period {
  padding: 15px 16px 16px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 4px;
  border-top: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.g-period h3 { font-size: 14px; }
.g-period-p {
  margin: 5px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--accent);
}
.g-period-n { margin: 9px 0 0; font-size: 12.4px; color: var(--ink-3); }

/* ---- trace rendering ---------------------------------------------------- */

.trace { display: block; width: 100%; height: auto; }
.trace .tr-bg { fill: #0d0f12; }
.trace .tr-axis { stroke: rgba(200,164,92,.16); stroke-width: 1; stroke-dasharray: 3 6; }
.trace .tr-line-0 rect { fill: #d8dee6; }
.trace .tr-line-1 rect { fill: #8f9aa6; }

/* ---- fault cards -------------------------------------------------------- */

.g-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; align-items: start;
}

.g-card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 4px; overflow: hidden;
  transition: border-color .18s;
}
.g-card:hover { border-color: #333a42; }
.g-card.open { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.g-card-head {
  display: grid; grid-template-columns: 104px 1fr; gap: 14px;
  width: 100%; padding: 14px; cursor: pointer; text-align: left;
  background: none; border: 0; font-family: inherit;
}
.g-card-trace {
  border: 1px solid var(--line-soft); border-radius: 3px; overflow: hidden;
  background: #0d0f12;
}
.g-card-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.g-card-group {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.g-card-meta h3 { font-size: 15px; color: var(--ink); line-height: 1.25; }
.g-card-short { margin: 2px 0 0; font-size: 12.2px; color: var(--ink-3); }
.g-more {
  margin-top: auto; padding-top: 8px;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.g-more::after { content: '  ↓'; }
.g-card.open .g-more::after { content: '  ↑'; }
.g-card.open .g-more { color: var(--accent); }

.g-card-body { padding: 0 14px 16px; border-top: 1px solid var(--line-soft); }
.g-block { margin-top: 14px; }
.g-block h4 {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.g-block p { margin: 0; font-size: 13px; color: var(--ink-2); }

.g-list { margin: 0; padding: 0; list-style: none; }
.g-list li {
  position: relative; padding: 3px 0 3px 15px;
  font-size: 12.8px; color: var(--ink-2);
}
.g-list li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 6px; height: 1px; background: var(--ink-3);
}
.g-list.check li::before {
  content: ''; width: 5px; height: 5px; top: 9px; border-radius: 50%;
  background: none; border: 1px solid var(--good);
}

.g-remedy {
  padding: 12px 13px; border-radius: 3px;
  background: var(--panel-2); border-left: 2px solid var(--good);
}
.g-remedy h4 { color: var(--good); }
.g-amp { margin: 12px 0 0; font-size: 12.2px; color: var(--ink-3); }
.g-amp strong { color: var(--ink-2); font-weight: 500; }

.g-empty { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }

/* ---- checklist, targets, symptoms --------------------------------------- */

.g-checklist { margin: 20px 0 0; padding: 0 0 0 4px; counter-reset: c; list-style: none; }
.g-checklist li {
  position: relative; counter-increment: c;
  padding: 0 0 14px 40px; font-size: 13.4px; color: var(--ink-2);
}
.g-checklist li::before {
  content: counter(c);
  position: absolute; left: 0; top: -1px;
  width: 25px; height: 25px; display: grid; place-items: center;
  border: 1px solid var(--accent); border-radius: 50%;
  color: var(--accent); font-family: var(--mono); font-size: 11px;
}

.g-targets { margin-top: 20px; display: flex; flex-direction: column; gap: 1px; }
.g-target {
  display: grid; grid-template-columns: minmax(180px, 1fr) 150px minmax(200px, 1.4fr);
  gap: 16px; align-items: baseline;
  padding: 11px 12px; background: var(--panel); border-radius: 3px;
}
.g-target-k { font-size: 13px; color: var(--ink); }
.g-target-v { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.g-target-n { font-size: 12.2px; color: var(--ink-3); }

.g-symptoms { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; }
.g-symptom {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 4px;
}
.g-symptom > summary {
  padding: 12px 15px; cursor: pointer; list-style: none;
  font-size: 13.6px; color: var(--ink);
}
.g-symptom > summary::-webkit-details-marker { display: none; }
.g-symptom > summary::before {
  content: '+'; display: inline-block; width: 18px;
  color: var(--accent); font-family: var(--mono);
}
.g-symptom[open] > summary::before { content: '−'; }
.g-symptom[open] > summary { border-bottom: 1px solid var(--line-soft); }
.g-symptom .g-list { padding: 12px 15px 14px; }

.guide-page .foot { margin: 26px auto; max-width: var(--page-max); padding: 18px var(--page-pad) 0; }
.guide-page .foot strong { color: var(--ink-2); font-weight: 500; }

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 720px) {
  .guide { padding: 18px 14px 8px; }
  .g-anatomy { grid-template-columns: 1fr; }
  .g-anatomy-trace { width: 120px; }
  .g-anatomy-list li { grid-template-columns: 1fr; gap: 2px; }
  .g-section-head { flex-direction: column; align-items: stretch; }
  .g-tools { align-items: stretch; }
  .g-filters { justify-content: flex-start; }
  .g-search { width: 100%; }
  .g-target { grid-template-columns: 1fr; gap: 3px; }
}

.overlay-foot {
  margin: 18px 0 0; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.8px; color: var(--ink-3);
}
.overlay-foot a { color: var(--accent); }

/* the topbar now carries a nav as well as the picker */
.topbar { gap: 16px; }
.topbar .sitenav { margin-right: auto; padding-left: 8px; }
@media (max-width: 860px) {
  .topbar .sitenav { margin-right: 0; padding-left: 0; width: 100%; }
}

/* ================================================== problem catalogue v2 */

.g-jump {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 18px 0 0;
}
.g-jump a {
  padding: 5px 12px; border-radius: 2px; text-decoration: none;
  font-size: 11.5px; color: var(--ink-3);
  border: 1px solid var(--line); background: var(--panel);
  transition: color .16s, border-color .16s;
}
.g-jump a:hover { color: var(--accent); border-color: var(--accent); }

.g-h3 {
  margin: 28px 0 0; font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
}
.g-note {
  margin: 18px 0 0; max-width: 74ch; font-size: 13.2px; color: var(--ink-3);
  padding: 13px 15px; background: var(--panel); border-radius: 3px;
  border-left: 2px solid var(--line);
}

/* --- urgency ------------------------------------------------------------ */

.u-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  flex: none; margin-top: 5px;
}
.u-dot.u-now     { background: #d0705a; box-shadow: 0 0 0 3px rgba(208,112,90,.16); }
.u-dot.u-soon    { background: var(--warn); box-shadow: 0 0 0 3px rgba(216,163,74,.14); }
.u-dot.u-routine { background: #5f6a76; }

.g-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin: 0 0 16px; font-size: 11.5px; color: var(--ink-3);
}
.g-legend span { display: inline-flex; align-items: center; gap: 7px; }
.g-legend .u-dot { margin-top: 0; }

/* --- problem rows ------------------------------------------------------- */

.g-plist { display: flex; flex-direction: column; gap: 6px; }

.g-prob {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 4px; overflow: hidden;
  border-left: 2px solid var(--line);
  transition: border-color .16s;
}
.g-prob.u-now  { border-left-color: #d0705a; }
.g-prob.u-soon { border-left-color: var(--warn); }
.g-prob:hover  { border-color: #333a42; }
.g-prob.u-now:hover  { border-left-color: #d0705a; }
.g-prob.u-soon:hover { border-left-color: var(--warn); }
.g-prob.open { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.g-prob-head {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 13px;
  width: 100%; padding: 13px 15px; cursor: pointer; text-align: left;
  background: none; border: 0; font-family: inherit; align-items: start;
}
.g-prob-mid { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g-prob-group {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
/* an h3 for heading navigation, but it must sit in the row like the spans
   around it — no heading margin, no inherited heading size */
.g-prob-sym {
  font-size: 14.5px; color: var(--ink); line-height: 1.3;
  margin: 0; font-weight: 500; font-family: inherit;
}
.g-prob-short { font-size: 12.4px; color: var(--ink-3); }

.g-prob-tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.g-tag {
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 2px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--ink-3);
}
.g-tag.u-now  { color: #d0705a; border-color: rgba(208,112,90,.45); }
.g-tag.u-soon { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 42%, transparent); }
.g-tag.u-routine { color: var(--ink-3); }
.g-tag.who { color: var(--ink-3); border-style: dashed; }

.g-prob-body { padding: 0 15px 16px 42px; border-top: 1px solid var(--line-soft); }
.g-prob-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 26px;
}

/* --- mistakes ----------------------------------------------------------- */

.g-checklist .g-mistake-k {
  display: block; color: var(--ink); font-weight: 500; font-size: 13.4px;
  margin-bottom: 2px;
}
.g-checklist .g-mistake-n { display: block; font-size: 12.8px; color: var(--ink-3); }

@media (max-width: 720px) {
  .g-prob-head { grid-template-columns: 14px 1fr; }
  .g-prob-tags { flex-direction: row; grid-column: 1 / -1; align-items: center; }
  .g-prob-body { padding-left: 15px; }
}

.g-lead strong { color: var(--ink); font-weight: 500; }
.g-lead-2 { font-size: 13.4px; color: var(--ink-3); margin-top: 10px; }
