/**
 * Shared help modal styles (ARSYSplotLite in-app + Analytics hub).
 */
:root {
  --help-ink: #1c1916;
  --help-muted: #6b645c;
  --help-line: #d9d2c6;
  --help-panel: #fffdf8;
  --help-accent: #0f5c4c;
  --help-accent-ink: #ffffff;
  --help-radius: 10px;
  --help-mono: "IBM Plex Mono", ui-monospace, monospace;
}

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(28, 25, 22, 0.45);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--help-ink);
}

.modal-back[hidden] { display: none; }

.modal {
  width: min(480px, 100%);
  padding: 16px;
  background: var(--help-panel);
  border: 1px solid var(--help-line);
  border-radius: var(--help-radius);
  box-shadow: 0 12px 40px rgba(28, 25, 22, 0.18);
}

.modal h2 {
  margin: 0 0 6px;
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--help-ink);
}

.modal-help {
  width: min(640px, 100%);
  max-height: min(90vh, 780px);
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}

.modal-help .muted {
  color: var(--help-muted);
  margin: 0 0 6px;
  font-size: 13px;
  word-break: normal;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.modal-help .modal-actions {
  flex-shrink: 0;
  margin-top: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--help-accent);
  background: var(--help-accent);
  color: var(--help-accent-ink);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  color: var(--help-ink);
  border-color: var(--help-line);
}

.btn-small { padding: 4px 8px; font-size: 12px; }

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -16px -16px 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #f0b429 0%, #e08a2e 100%);
  border-radius: var(--help-radius, 10px) var(--help-radius, 10px) 0 0;
  color: #1c1916;
}

.help-head h2 {
  margin: 0;
  color: #1c1916;
}

.help-head .btn-ghost {
  border-color: rgba(28, 25, 22, 0.35);
  color: #1c1916;
  background: rgba(255, 253, 248, 0.55);
}

.help-head .btn-ghost:hover {
  background: #fffdf8;
  border-color: #1c1916;
}

.help-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
  margin: 8px 0 4px;
  padding-right: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--help-ink);
}

.help-toc {
  flex-shrink: 0;
  margin: 4px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--help-line);
  border-radius: 8px;
  background: #fff;
}

.help-toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--help-muted);
  margin-bottom: 6px;
}

.help-toc-list {
  margin: 0;
  padding: 0 0 0 16px;
  columns: 2;
  gap: 12px;
}

.help-toc-list a {
  color: var(--help-accent);
  text-decoration: none;
}

.help-toc-list a:hover { text-decoration: underline; }

.help-foot {
  flex-shrink: 0;
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--help-line);
}

.help-licence {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--help-muted);
}

.help-section {
  margin: 0 0 18px;
  padding-top: 2px;
}

.help-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--help-ink);
}

.help-section h4 {
  margin: 12px 0 6px;
  font-size: 13px;
  color: var(--help-ink);
}

.help-section p {
  margin: 0 0 8px;
}

.help-list {
  margin: 0 0 8px;
  padding: 0 0 0 18px;
}

.help-list li { margin: 0 0 4px; }

.help-table-wrap {
  overflow: auto;
  margin: 0 0 10px;
  border: 1px solid var(--help-line);
  border-radius: 8px;
}

.help-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.help-table th,
.help-table td {
  border-bottom: 1px solid var(--help-line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.help-table th {
  background: #f0ebe3;
  font-weight: 600;
}

.help-table tr:last-child td { border-bottom: none; }

.help-section code {
  font-family: var(--help-mono);
  font-size: 12px;
  background: #f0ebe3;
  padding: 1px 4px;
  border-radius: 3px;
}

.help-example {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e0d5c4;
  background: #faf6ef;
  font-size: 12.5px;
  line-height: 1.45;
}

.help-example-title {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a7355;
  margin: 0 0 6px;
}

.help-example p { margin: 0 0 6px; }
.help-example p:last-child { margin-bottom: 0; }

.help-example pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  overflow: auto;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--help-line);
  font-family: var(--help-mono);
  font-size: 11.5px;
  white-space: pre-wrap;
}
