/* Help articles. Uses the variables and components of style.css.
   The list borrows the equipment catalogue's rows (hd-cat...); everything here starts with hda-. */

/* ---- The list ---- */
.hda-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 0; }
.hda-tiles .tile { padding: 13px 14px; gap: 12px; min-width: 0; white-space: normal; }
.hda-tiles .tile .chip { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.hda-tiles .tile .value { font-size: 24px; }
.hda-tiles .tile .label { line-height: 1.25; }
.hda-tiles .tile.active, .hda-tiles .tile.active:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.hda-panel .dtools select { max-width: 230px; }
.hda-panel .dtools .searchbox input { padding-left: 34px; }
.hda-count { margin-left: auto; }

.hda-row { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.hda-row.draft { background: color-mix(in srgb, var(--warn-soft) 35%, transparent); }
.hda-row.draft:hover { background: color-mix(in srgb, var(--warn-soft) 70%, transparent); }
.hda-title { color: var(--text); font-weight: 600; font-size: 14.5px; text-decoration: none; border-radius: 4px; }
.hda-title:hover { color: var(--accent); text-decoration: underline; }
.hda-nosum { font-style: italic; }
.hda-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12.5px; }
.hda-dot { opacity: .6; }
.hda-poor { color: var(--warn); font-weight: 600; }
.hda-row .pill .icon { width: 12px; height: 12px; }
.hda-row .orgactions { flex-wrap: wrap; max-width: 330px; }
.hda-view { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.hda-view:hover { background: var(--accent-soft); }
.hda-pinned { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.hda-cathead { align-items: center; }
.hda-catmove { display: inline-flex; gap: 2px; margin-right: 4px; }
.hda-catmove button { padding: 2px 5px; }
.hda-catmove button:disabled, .hda-row .hd-catmove button:disabled { opacity: .3; cursor: default; }

/* ---- The editor ---- */
.hda-form { display: grid; gap: 0; }
.hda-head { flex-wrap: wrap; gap: 8px 10px; position: sticky; top: 0; z-index: 3; background: var(--panel); border-radius: var(--radius) var(--radius) 0 0; }
.hda-head h2 { font-size: 16px; }
.hda-head h2:focus { outline: none; }
.hda-back { padding: 6px 9px; margin-left: -6px; }
.hda-state { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hda-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hda-error { margin: 12px 18px 0; padding: 9px 12px; border-radius: 9px; background: var(--bad-soft); font-weight: 600; }
.hda-saved { display: flex; align-items: center; gap: 8px; margin: 12px 18px 0; padding: 9px 12px; border-radius: 9px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }

.hda-fields { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px 28px; padding: 18px; border-bottom: 1px solid var(--line); }
.hda-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.hda-field input, .hda-field select, .hda-field textarea { width: 100%; font-weight: 400; }
.hda-field textarea { resize: vertical; min-height: 58px; line-height: 1.45; }
.hda-hint { font-weight: 400; }
.hda-who { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; min-width: 0; }
.hda-who legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.hda-orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; max-height: 168px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); }

.hda-write { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.hda-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px 18px; }
.hda-pane + .hda-pane { border-left: 1px solid var(--line); }
.hda-panehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; flex-wrap: wrap; }
.hda-panehead .subhead { margin: 0; }
.hda-size { margin: 0; padding: 3px; }
.hda-size button { padding: 3px 10px; font-size: 12.5px; }
.hda-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.hda-tool { padding: 4px 9px; }
.hda-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--line-strong); }
.hda-body { width: 100%; height: clamp(360px, 62vh, 900px); min-height: 240px; padding: 14px 16px; font: 14.5px/1.65 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; tab-size: 2; }
.hda-framebox { flex: 1; display: flex; justify-content: center; height: clamp(360px, 62vh, 900px); min-height: 240px; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--panel-2); }
.hda-frame { width: 100%; height: 100%; border: 0; background: #fff; color-scheme: light dark; }
/* The ClayGen Support window on a PC is about this wide. */
.hda-framebox.narrow .hda-frame { width: 420px; max-width: 100%; border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
.hda-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.hda-guide { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.hda-guide summary { padding: 8px 12px; cursor: pointer; font-weight: 600; font-size: 13px; border-radius: 9px; }
.hda-guide summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.hda-guide-body { display: grid; gap: 8px; padding: 2px 12px 12px; }
.hda-guide-table td { white-space: nowrap; padding: 6px 10px 6px 0; vertical-align: top; }
.hda-guide-table td.wrap { white-space: normal; min-width: 0; width: auto; }
.hda-guide-table tr:last-child td { border-bottom: 0; }

.hda-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.hda-slug { font-family: "Cascadia Mono", Consolas, monospace; color: var(--text); overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .hda-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hda-fields { grid-template-columns: minmax(0, 1fr); }
  .hda-write { grid-template-columns: minmax(0, 1fr); }
  .hda-pane + .hda-pane { border-left: 0; border-top: 1px solid var(--line); }
  .hda-body, .hda-framebox { height: clamp(300px, 52vh, 700px); }
  .hda-row { grid-template-columns: auto minmax(0, 1fr); }
  .hda-row .orgactions { grid-column: 2; justify-content: flex-start; max-width: none; }
}
@media (max-width: 640px) {
  .hda-head { position: static; }
  .hda-fields .formrow { grid-template-columns: minmax(0, 1fr); }
}
