/* v3 guides styles: plain-English guide panel, glossary terms/tooltips, glossary page, bulk progress */

/* ------------------------------------------------------------ guide panel */
.guide-card { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.guide-card .card-title .icon { color: var(--accent); }
.guide-loading .skeleton { max-width: 100%; }
.guide-sk-short { width: 55%; }
.guide-sk-mid { width: 80%; }

.guide-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.guide-head .card-title { margin-bottom: 0; }
.guide-badges { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.guide-badges .pill { gap: 5px; }
.guide-badges .pill .icon { width: 13px; height: 13px; }

.guide-section { margin-top: var(--s-5); }
.guide-section:first-of-type { margin-top: var(--s-4); }
.guide-h {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 var(--s-2); font-size: var(--fs-sm); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim);
}
.guide-h .icon { color: var(--text-faint); }
.guide-lede { font-size: var(--fs-lg); line-height: 1.6; color: var(--text); }

.guide-list { margin: 0; padding-left: 20px; line-height: 1.6; }
.guide-list li + li { margin-top: 4px; }
.guide-mistakes li::marker { color: var(--warn); }

.guide-elements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.guide-el {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  padding: var(--s-3) var(--s-4);
}
.guide-el-head { display: flex; gap: var(--s-3); align-items: baseline; }
.guide-el-head .mono { flex: 0 0 auto; }
.guide-el-meaning { flex: 1; min-width: 0; font-weight: 500; line-height: 1.5; }
.guide-upload-label { margin: var(--s-2) 0 4px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.guide-checklist { list-style: none; margin: 0; padding: 0; }
.guide-checklist li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; line-height: 1.5; }
.guide-checklist li .icon { flex: 0 0 auto; margin-top: 3px; color: var(--ok); }
.guide-example {
  display: flex; gap: 8px; align-items: flex-start; margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-text);
}
.guide-example .icon { flex: 0 0 auto; margin-top: 2px; }

.guide-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  margin-top: var(--s-5); padding-top: var(--s-3); border-top: 1px solid var(--border);
}
.guide-foot .inline-form { display: inline-flex; }

.guide-empty { display: flex; gap: var(--s-3); align-items: flex-start; margin-top: var(--s-3); }
.guide-empty > .icon { color: var(--text-faint); margin-top: 2px; }

.guide-dialog { width: min(760px, calc(100vw - 32px)); }
.guide-edit-body { max-height: 70vh; overflow-y: auto; }
.guide-edit-el { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-2) var(--s-4) var(--s-4); margin: var(--s-4) 0 0; }
.guide-edit-el legend { padding: 0 6px; color: var(--text-dim); }
.guide-edit-el textarea { min-height: 64px; }

/* PM board expanded row */
.guide-oneliner { padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); }

/* ---------------------------------------------------- glossary term tooltips */
.term {
  position: relative; cursor: help;
  text-decoration: underline dotted color-mix(in srgb, var(--accent) 70%, transparent);
  text-underline-offset: 3px; text-decoration-thickness: 1.5px;
  border-radius: 2px;
}
.term:focus { outline: none; box-shadow: var(--focus); }
.term::after {
  content: attr(data-tip);
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 50;
  width: max-content; max-width: min(320px, 80vw);
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--surface);
  font-size: var(--fs-sm); font-weight: 400; line-height: 1.45; letter-spacing: 0;
  text-transform: none; white-space: normal; text-align: left;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s var(--ease);
}
.term:hover::after, .term:focus::after, .term:focus-visible::after { opacity: 1; visibility: visible; }

/* ------------------------------------------------------------ glossary page */
.glossary { display: flex; flex-direction: column; gap: var(--s-4); }
.glossary .card + .card { margin-top: 0; }
.glossary-list { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.glossary-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.glossary-item:last-child { border-bottom: 0; }
.glossary-item dt { font-weight: 600; }
.glossary-item dd { margin: 0; color: var(--text-dim); line-height: 1.55; }
.glossary-item.glossary-hit { background: var(--accent-soft); border-radius: var(--radius-sm); padding-left: var(--s-2); padding-right: var(--s-2); }
@media (max-width: 720px) {
  .glossary-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ------------------------------------------------------------ bulk generation */
.guide-bulk { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: var(--s-3) var(--s-4); }
.guide-bulk-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.guide-bulk-row .grow { flex: 1; min-width: 200px; }
.guide-bulk .meter { margin: 6px 0 4px; }
.guide-bulk-spin { color: var(--accent); }
.guide-bulk .icon { color: var(--accent); vertical-align: -2px; }
