/* The chart guide dialog (js/chartHelp.js). Uses the app's tokens from css/app.css; adds rules only. */

/* The toolbar button: app.css makes .btn.help a 28px circle for one glyph; here it carries the word too. */
#helpBtn {
  display: inline-flex; align-items: center; gap: 6px;
  width: auto; padding: 0 12px; border-radius: 100px; white-space: nowrap;
}
#helpBtn span { font: 600 15px/1 var(--font-head); }
@media (max-width: 860px) {
  #helpBtn { gap: 4px; padding: 0 8px; }
}

.chart-help {
  width: min(720px, calc(100vw - 32px));
  max-height: min(86vh, 780px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(36, 36, 36, .22);
  overflow: hidden;
}
.chart-help[open] { display: flex; flex-direction: column; }
.chart-help::backdrop { background: rgba(36, 36, 36, .35); }

.help-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 22px 12px; border-bottom: 1px solid var(--line-soft);
}
.help-head h2 { margin: 0; font: 600 20px/1.25 var(--font-head); color: var(--navy); }
.help-intro { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.help-close {
  flex: none; height: 30px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 100px; background: transparent;
  font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer;
}
.help-close:hover { background: var(--sky); color: var(--navy); }
.help-close:focus-visible, .help-more summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.help-body { padding: 16px 22px 20px; overflow-y: auto; overscroll-behavior: contain; }

.help-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px;
}
.help-card {
  padding: 12px 14px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--paper);
}
.help-art { height: 44px; color: var(--navy); }
.help-art svg {
  display: block; width: 64px; height: 40px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.help-art .acc { stroke: var(--blue); }
.help-art .fill { fill: var(--white); }
.help-art .dots circle { fill: var(--muted); stroke: none; }
.help-card h3 { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font: 600 14.5px/1.3 var(--font-head); color: var(--navy); }
.help-num {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--navy); color: var(--white); font: 600 11px/1 var(--font-ui);
}
.help-card p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); }

.help-tip {
  margin: 14px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--sky);
  font-size: 13px; color: var(--navy);
}

.help-more { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.help-more summary {
  cursor: pointer; font: 600 13px/1.3 var(--font-ui); color: var(--navy); padding: 4px 0;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.help-more summary::-webkit-details-marker { display: none; }
.help-more summary::before {
  content: ''; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.help-more[open] summary::before { transform: rotate(45deg); }
.help-more-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.help-more-list li {
  display: grid; grid-template-columns: minmax(96px, 150px) 1fr; gap: 12px; align-items: baseline;
  font-size: 13px; line-height: 1.45;
}
.help-keys { display: flex; flex-wrap: wrap; gap: 4px; }
.help-keys kbd {
  padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  background: var(--white); color: var(--navy); font: 600 11.5px/1.5 var(--font-ui);
}

@media (max-width: 520px) {
  .help-more-list li { grid-template-columns: 1fr; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .help-more summary::before { transition: none; }
}
