/* ============================================================
   NICO — Skill detail (preview/configure/install) + builder
   Extends nico-settings.css + nico-mcp.css. Reuses .field,
   .txt-input, .callout, .seg-pick, .stepper, .side-card.
   ============================================================ */

/* ---- skill hero ---- */
.sk-detail-hero { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.sk-detail-hero .sh-ic {
  width: 52px; height: 52px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); border: 0.5px solid var(--line); color: var(--accent-text);
}
.sk-detail-hero .sh-ic svg { width: 26px; height: 26px; }
.sk-detail-hero.on .sh-ic { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.sk-detail-hero .sh-text { flex: 1; min-width: 0; }
.sk-detail-hero h2 { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); display: flex; align-items: center; gap: 10px; }
.sk-detail-hero .sh-by { font-family: var(--mono); font-size: 11px; color: var(--text-4); margin-top: 5px; }
.sk-detail-hero .sh-by .dotsep { margin: 0 7px; opacity: 0.5; }
.sk-detail-hero .sh-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin-top: 11px; max-width: 600px; }
.sk-detail-hero .sh-cta { display: flex; flex-direction: column; gap: 9px; align-items: flex-end; flex: none; }

.sk-badge { font-family: var(--mono); font-size: 9.5px; padding: 3px 9px; border-radius: 6px; font-weight: 500; letter-spacing: 0.02em; }
.sk-badge.verified { color: var(--ok); background: oklch(0.805 0.15 150 / 0.13); border: 0.5px solid oklch(0.805 0.15 150 / 0.35); }
.sk-badge.beta { color: var(--run); background: var(--run-dim); border: 0.5px solid oklch(0.83 0.15 85 / 0.4); }

/* enabled toggle line in hero */
.enabled-line { display: flex; align-items: center; gap: 9px; justify-content: flex-end; font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* ---- two-col layout ---- */
.sk-grid { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; }
.sk-main { min-width: 0; }
.sk-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 14px; }

/* section heading inside main */
.sk-sec { margin-bottom: 28px; }
.sk-sec > .sks-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; }
.sk-sec > .sks-sub { font-size: 12.5px; color: var(--text-4); line-height: 1.5; margin-bottom: 16px; }

/* ---- the play: numbered timeline ---- */
.play-steps { display: flex; flex-direction: column; }
.play-step { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.play-step:last-child { padding-bottom: 0; }
.play-step .ps-num {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; z-index: 1;
  font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent-text);
  background: var(--accent-dim); border: 0.5px solid var(--accent-line);
}
.play-step::before {
  content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 0.5px; background: var(--line);
}
.play-step:last-child::before { display: none; }
.play-step .ps-body { padding-top: 2px; }
.play-step .ps-t { font-size: 13px; color: var(--text); font-weight: 500; }
.play-step .ps-t code { font-family: var(--mono); font-size: 11px; color: var(--accent-text); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.play-step .ps-d { font-size: 12px; color: var(--text-4); line-height: 1.5; margin-top: 4px; }

/* ---- guardrails ---- */
.guard-list { display: flex; flex-direction: column; gap: 9px; }
.guard-row { display: flex; gap: 11px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.guard-row svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--ok); }

/* ---- config fields (reuses .field/.txt-input) ---- */
.sk-config .field .seg-mini { display: flex; gap: 8px; flex-wrap: wrap; }
.sk-config .switch-field { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 0.5px solid var(--line-soft); }
.sk-config .switch-field:first-of-type { border-top: none; }
.sk-config .switch-field .sf-t { font-size: 13px; color: var(--text); font-weight: 500; }
.sk-config .switch-field .sf-d { font-size: 11.5px; color: var(--text-4); margin-top: 4px; line-height: 1.45; max-width: 420px; }

/* range/slider field */
.range-field { display: flex; align-items: center; gap: 14px; }
.range-field input[type=range] {
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; flex: 1;
  background: var(--surface-3); cursor: pointer;
}
.range-field input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface-1); box-shadow: 0 1px 4px oklch(0 0 0 / 0.3); cursor: pointer;
}
.range-field input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-1); cursor: pointer;
}
.range-field .rf-val { font-family: var(--mono); font-size: 13px; color: var(--accent-text); font-weight: 600; min-width: 44px; text-align: right; }

/* chips for connector multi-select (builder) */
.conn-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.conn-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; cursor: pointer;
  background: var(--surface-1); border: 0.5px solid var(--line); font-size: 12.5px; color: var(--text-2); transition: all .12s;
}
.conn-chip:hover { border-color: var(--line-bright); }
.conn-chip .dt { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.conn-chip .cc-check { width: 14px; height: 14px; opacity: 0; color: var(--accent-text); transition: opacity .12s; margin-left: 2px; }
.conn-chip.sel { border-color: var(--accent-line); background: var(--accent-dim); color: var(--text); }
.conn-chip.sel .cc-check { opacity: 1; }

/* ---- sidebar cards (reuse .side-card from nico-mcp) ---- */
.sk-side .side-card { background: var(--surface-1); border: 0.5px solid var(--line); border-radius: var(--r-lg); padding: 15px 16px; }
.sk-side .side-card .sc-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-4); margin-bottom: 12px; }
.needs-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 0.5px solid var(--line-soft); }
.needs-row:first-of-type { border-top: none; }
.needs-row .dt { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.needs-row .nr-name { font-size: 12.5px; color: var(--text-2); flex: 1; }
.needs-row .nr-state { font-family: var(--mono); font-size: 10px; color: var(--ok); display: inline-flex; align-items: center; gap: 4px; }
.needs-row .nr-state svg { width: 11px; height: 11px; }
.needs-row .nr-state.missing { color: var(--run); }
.needs-row .nr-state.missing a { color: var(--run); text-decoration: none; }

.sticky-cta { display: flex; flex-direction: column; gap: 9px; }
.sticky-cta .btn.lg { height: 40px; }
.sticky-cta .cta-note { font-size: 11px; color: var(--text-4); text-align: center; line-height: 1.4; }

/* preview banner for not-yet-added skills */
.preview-banner {
  display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--r-md);
  background: var(--accent-dim); border: 0.5px solid var(--accent-line); margin-bottom: 22px;
}
.preview-banner .pb-ic { color: var(--accent-text); flex: none; margin-top: 1px; }
.preview-banner .pb-ic svg { width: 16px; height: 16px; }
.preview-banner .pb-t { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.preview-banner .pb-t b { color: var(--text); font-weight: 600; }

/* save toast inline */
.sk-save-msg { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--ok); }
.sk-save-msg svg { width: 14px; height: 14px; }

/* builder: example output preview */
.sk-preview-out {
  background: oklch(0.145 0.006 264); border: 0.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
[data-theme="light"] .sk-preview-out, [data-theme="sierra"] .sk-preview-out { background: var(--surface-1); }
.sk-preview-out .po-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-bottom: 0.5px solid var(--line-soft);
  background: var(--surface-2); font-family: var(--mono); font-size: 10.5px; color: var(--text-4);
}
.sk-preview-out .po-body { padding: 14px 15px; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--text-3); }
.sk-preview-out .po-body .ok { color: var(--ok); }
.sk-preview-out .po-body .acc { color: var(--accent-text); }
.sk-preview-out .po-body .dim { color: var(--text-4); }

/* builder: icon picker */
.icon-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-pick .ic-opt {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-1); border: 0.5px solid var(--line); color: var(--text-3); transition: all .12s;
}
.icon-pick .ic-opt svg { width: 20px; height: 20px; }
.icon-pick .ic-opt:hover { border-color: var(--line-bright); color: var(--text-2); }
.icon-pick .ic-opt.sel { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 2px 10px var(--accent-dim); }

/* builder: error flash on required field */
.txt-input.err-flash { border-color: var(--err) !important; animation: errShake .4s; }
@keyframes errShake { 0%,100%{transform:none} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }
