/* ── 🗺️ Skill map: focus chip, modal (desktop) / bottom sheet (phone), paths of nodes ── */
.mb-focus { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; max-width: 24em; color: var(--text); border-color: var(--action); }
.mb-focus > span:nth-child(3) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-focus:focus-visible, .sm-node:focus-visible, .sm-root:focus-visible, .sm-hub-btn:focus-visible, .sm-toggle:focus-visible,
.sm-chip:focus-visible, .sm-themes-btn:focus-visible, .sm-manage:focus-visible { outline: 2px solid var(--action-lilac); outline-offset: 2px; }

.modal.sm-modal { width: min(820px, 100%); max-height: 88vh; position: relative; }   /* .modal.* beats modal.css (loaded later) */
.sm-body { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }

/* Hub: "Any type" + grand final line + Themes drawer */
.sm-hub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sm-hub-btn, .sm-root, .sm-manage, .sm-themes-btn, .sm-chip {
  min-height: 44px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 700;
  color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 22px; cursor: pointer;
}
.sm-hub-btn { display: inline-flex; align-items: center; gap: 8px; border-color: var(--action); }
.sm-hub-btn:hover, .sm-root:hover, .sm-manage:hover, .sm-themes-btn:hover, .sm-chip:hover { background: var(--surface-3); }
.sm-hub-btn.is-active, .sm-root.is-active { background: var(--action); border-color: var(--action); color: var(--text-strong); }
.sm-chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.sm-chip { font-weight: 600; }
.sm-chip[aria-pressed="true"] { background: var(--action); border-color: var(--action); color: var(--text-strong); }
.sm-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.sm-gf { flex: 1 1 200px; }

/* A path = one domain */
.sm-path { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 12px; background: color-mix(in srgb, var(--text-strong) 2%, transparent); }
.sm-path.sm-locked, .sm-path.sm-soon { border-style: dashed; }
.sm-custom { border-style: dashed; }
.sm-path-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sm-h { margin: 0; font-size: 14px; }
.sm-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px;
  font: inherit; font-size: 14px; font-weight: 800; color: var(--text); background: none; border: 0; cursor: default;
}
.sm-toggle:disabled { color: var(--text); opacity: 1; }
.sm-count { font-size: 11px; font-weight: 700; color: var(--muted); }
.sm-chev { display: none; color: var(--muted); }
.sm-goal { margin: 2px 0 8px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.sm-goal b { color: var(--text); }

.sm-nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sm-nodes li { display: flex; gap: 4px; }

/* Node: shape + glyph + name — the state is never colour alone (glyph + text + border style) */
.sm-node {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  min-height: 44px; max-width: 100%; padding: 6px 12px; text-align: left;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.sm-node:hover { border-color: var(--action-lilac); }
.sm-glyph { font-size: 12px; }
.sm-path { --shade: var(--action-lilac); }   /* set per domain by ui-skillmap.js (DOMAIN_SHADE) */
.sm-mastered { border-color: color-mix(in srgb, var(--shade) 55%, transparent); }
.sm-mastered .sm-glyph { color: var(--shade); }
.sm-frontier { border: 2px solid var(--action-hi); box-shadow: 0 0 10px color-mix(in srgb, var(--action-hi) 30%, transparent); }
.sm-frontier .sm-glyph { color: var(--action-hi); }
/* Locked: dim the shape, not the label (text keeps its contrast) */
.sm-node[aria-disabled="true"] { background: transparent; border-style: dashed; cursor: help; }
.sm-node[aria-disabled="true"] .sm-glyph { opacity: 0.7; }
.sm-node.is-active { outline: 3px solid var(--action-lilac); outline-offset: 1px; }
.sm-node.is-active::after, .sm-root.is-active::after { content: ' · current'; font-size: 10px; font-weight: 700; color: var(--action-lilac); }
.sm-root.is-active::after { color: var(--text-strong); }
.sm-gauge { flex-basis: 100%; height: 5px; border-radius: 3px; background: var(--surface-sunk); overflow: hidden; }
.sm-gauge > span { display: block; height: 100%; background: var(--shade); }
.sm-mini { font-size: 10px; color: var(--muted); }
.sm-crown { font-size: 13px; }
.sm-note.sm-gf, .sm-path-body > .sm-note { padding: 2px 0 8px; }
.sm-manage { font-size: 12px; }

/* Requirement popover (tap a locked node) */
.sm-pop {
  position: fixed; z-index: 700; padding: 10px 12px; font-size: 12px; line-height: 1.5;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--action-lilac); border-radius: 10px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--shadow) 60%, transparent);
}
.sm-pop[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .sm-frontier { animation: sm-glow 2.4s ease-in-out infinite; }
  @keyframes sm-glow { 50% { box-shadow: 0 0 16px color-mix(in srgb, var(--action-hi) 50%, transparent); } }
}

/* Phone: bottom sheet, 5 accordions, each path a horizontally snapping row */
@media (max-width: 720px) {
  .modal-overlay.sm-overlay { align-items: flex-end; padding: 0; }
  .modal.sm-modal { width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; }
  .sm-body { padding-bottom: 24px; }
  .sm-toggle { flex: 1; cursor: pointer; }
  .sm-toggle:disabled { cursor: default; }
  .sm-h { flex: 1 1 auto; }
  .sm-chev { display: inline; margin-left: auto; transition: transform 0.15s; }
  .sm-toggle[aria-expanded="true"] .sm-chev { transform: rotate(180deg); }
  .sm-path:not(.is-open) .sm-path-body, .sm-path:not(.is-open) .sm-root { display: none; }
  .sm-nodes { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; touch-action: pan-x pan-y; padding-bottom: 6px; }
  .sm-nodes li { flex: none; scroll-snap-align: start; }
  .sm-node { white-space: nowrap; min-width: 96px; }
  .sm-node.is-active { outline-width: 2px; }
}
