/* MidGuide v2, phase 3: tools in the header, video workflows, prompt builder, learning path.
   Loaded after main.css on every page. Mobile first; desktop rules sit in the media blocks at the end. */
.hdr-top { justify-content: space-between; gap: 8px; }
.hdr-tools { display: flex; gap: 6px; flex: none; }
.tpill { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 10px; border: 1.5px dashed var(--navy); border-radius: var(--r-pill); background: var(--white); color: var(--navy); text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tpill:hover { border-style: solid; }
.tpill[aria-current="page"] { background: var(--yellow); border-style: solid; }
.tpill svg.i { width: 15px; height: 15px; color: var(--coral); }
.tpill[aria-current="page"] svg.i { color: var(--navy); }
.tp-more { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 379px) {
  .tpill svg.i { display: none; }
  .word small { display: none; }
}
.foot nav { flex-wrap: wrap; gap: 8px 20px; }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tool { display: flex; gap: 8px; align-items: flex-start; background: var(--white); border: 1.5px dashed var(--line); border-radius: var(--r-field); padding: 9px 10px; text-decoration: none; color: var(--navy); min-width: 0; }
.tool:hover { border-color: var(--navy); }
.tool svg.i { width: 20px; height: 20px; color: var(--coral); margin-top: 1px; }
.tool-b { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool b { font-size: 14px; font-weight: 800; line-height: 1.2; }
.tool-b > span { font-size: 12px; color: var(--ink); line-height: 1.35; }

/* video workflows */
.tline-fig { margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.tline { list-style: none; display: grid; gap: 3px; }
.tseg { border: 1.5px dashed var(--navy); border-radius: 8px; padding: 6px 3px 5px; background: var(--white); display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: center; }
.tseg.first { background: var(--yellow); border-style: solid; }
.tseg b { font-size: 12px; font-weight: 700; line-height: 1.2; }
.tseg span { font-size: 11px; color: var(--ink); white-space: nowrap; }
.also { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.also li { font-size: 14.5px; line-height: 1.5; }
.step .clip { margin-inline: auto; }

/* prompt builder */
.bld-grid { display: flex; flex-direction: column; gap: 22px; }
.bld-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.bld-ver { border: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bld-ver legend { font-size: 13px; font-weight: 700; padding: 0; margin-bottom: 6px; }
.chip.radio { position: relative; }
.chip.radio input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip.radio:has(input:checked) { background: var(--yellow); border-style: solid; font-weight: 700; }
.chip.radio:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 3px; }
.slots { display: flex; flex-direction: column; gap: 12px; }
.slot { background: var(--white); border: 2px dashed var(--navy); border-radius: var(--r-card); padding: 12px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.slot-h { display: flex; align-items: center; gap: 8px; }
.slot-h label { font-size: 15.5px; font-weight: 800; }
.slot-hint { font-size: 13px; color: var(--ink); line-height: 1.45; }
.slot .input input { font-family: var(--mono); font-size: 14px; direction: ltr; text-align: left; }
.slot .input input::placeholder { color: #6B7499; }
.sugg .chip { white-space: normal; text-align: left; line-height: 1.3; padding: 4px 11px; font-size: 12.5px; max-width: 100%; direction: ltr; unicode-bidi: isolate; }
.pgroups { display: flex; flex-direction: column; gap: 12px; }
.pgroup { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1.5px dashed var(--line); min-width: 0; }
.pgroup:last-child { border-bottom: 0; padding-bottom: 0; }
.pgroup h3 { font-size: 14.5px; font-weight: 800; }
.pchip code { background: none; padding: 0; font-size: 12.5px; font-weight: 700; color: inherit; white-space: nowrap; }
.pchip span { font-size: 12.5px; }
.pchip.warn { border-color: var(--error); background: var(--error-tint); }
.pchip.warn[aria-pressed="true"] { border-style: solid; }
.pchip.unk[aria-pressed="true"] { background: var(--mist); }
.prow { background: var(--mist); border-radius: var(--r-field); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prow-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.prow-h code { font-weight: 700; background: var(--white); }
.prow select, .prow input { height: 36px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--white); font: inherit; font-family: var(--mono); font-size: 13.5px; color: var(--navy); padding: 0 10px; min-width: 0; }
.prow input { flex: 1 1 160px; direction: ltr; text-align: left; }
.prow-x { font-size: 13px; line-height: 1.5; color: var(--navy); }
.bld-mini { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 8px; background: var(--white); border: 2px solid var(--navy); border-radius: var(--r-field); padding: 6px 10px; box-shadow: 0 -6px 16px rgba(27, 45, 107, 0.1); min-width: 0; }
.bld-mini-t { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; direction: ltr; text-align: left; unicode-bidi: isolate; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bld-mini .btn { min-height: 38px; padding: 0 12px; flex: none; }
.bld-out { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ptext.empty { color: var(--ink); font-family: var(--he); direction: rtl; text-align: right; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bld-checks { background: var(--white); border: 2px dashed var(--navy); border-radius: var(--r-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.bld-checks.bad { border-color: var(--error); }
.ck-h { display: flex; align-items: flex-start; gap: 6px; font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.ck-h svg.i { margin-top: 1px; }
.bld-checks.ok .ck-h svg.i { color: var(--success); }
.bld-checks.bad .ck-h svg.i { color: var(--error); }
.bld-checks.unk .ck-h svg.i { color: var(--ink); }
.ck-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ck { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; min-width: 0; }
.ck > span { min-width: 0; }
.ck svg.i { width: 16px; height: 16px; margin-top: 3px; }
.ck.no svg.i { color: var(--error); }
.ck.unk svg.i, .ck.tip svg.i { color: var(--ink); }
.ck.info svg.i { color: var(--success); }
.bld-pp { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bld-pp .btn svg.i { color: var(--yellow); }
.bld-pp .btn[aria-disabled="true"] { opacity: 0.5; }

/* learning path */
.pprog { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.pprog svg.i { color: var(--coral); }
.pmap ol { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.pm { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1.5px dashed var(--navy); border-radius: var(--r-field); padding: 6px 10px; text-decoration: none; color: var(--navy); min-width: 0; height: 100%; }
.pm:hover { border-style: solid; }
.pm .num { width: 24px; height: 24px; font-size: 12.5px; }
.pm-t { flex: 1; font-size: 13.5px; font-weight: 700; line-height: 1.3; min-width: 0; }
.pm-l { font-size: 12px; color: var(--ink); white-space: nowrap; }
.pm.done { background: var(--success-tint); border-style: solid; border-color: var(--success); }
.pm.done .num { background: var(--success); }
.psteps { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.pstep { background: var(--white); border: 2px dashed var(--navy); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 16px; min-width: 0; }
.pstep.done { border-style: solid; border-color: var(--success); }
.pstep.done .pstep-h .num { background: var(--success); }
.pstep-h { display: flex; gap: 10px; align-items: flex-start; }
.pstep-t { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.pstep h2 { font-size: 17px; }
.pstep h3 { font-size: 14px; font-weight: 800; }
.pcols { display: flex; flex-direction: column; gap: 12px; }
.plinks { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.mini-b { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mini-b .k { font-size: 11.5px; color: var(--ink); font-weight: 500; }
.ptile { display: flex; align-items: center; justify-content: center; background: var(--mist); border-radius: 10px; }
.ptile.tool { background: var(--yellow); }
.ptile svg.i { width: 22px; height: 22px; color: var(--navy); }
.pex { background: var(--mist); border-radius: var(--r-field); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.pex p { font-size: 14px; line-height: 1.5; }
.pex-a { display: flex; flex-wrap: wrap; gap: 8px; }
.pex .btn { min-height: 40px; font-size: 13.5px; white-space: normal; text-align: center; padding: 4px 14px; }
.done-btn[aria-pressed="true"] { background: var(--success-tint); border-color: var(--success); color: var(--success); }

@media (min-width: 640px) {
  .pmap ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plinks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .hdr-top { display: contents; }
  .hdr .wrap > .hdr-top > .brand { order: 1; }
  .nav { order: 2; margin-inline-start: auto; }
  .hdr-tools { order: 3; margin-inline-start: 32px; gap: 8px; }
  .tpill { min-height: 38px; padding: 0 14px; font-size: 14.5px; }
  .tpill svg.i { width: 17px; height: 17px; }
  .tp-more { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: nowrap; }
  .foot nav { gap: 10px 24px; max-width: 520px; }

  .tools { gap: 16px; }
  .tool { align-items: center; padding: 12px 16px; gap: 12px; }
  .tool svg.i { width: 24px; height: 24px; margin-top: 0; }
  .tool b { font-size: 16.5px; }
  .tool-b > span { font-size: 14px; }

  .tseg { padding: 8px 6px 7px; }
  .tseg b { font-size: 13.5px; }
  .tseg span { font-size: 12.5px; }

  .bld h1, .pathp h1 { font-size: 40px; }
  .bld-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .bld-out { position: sticky; top: 20px; }
  .bld-mini { display: none; }
  .slot { padding: 14px 16px; }
  .sugg .chip { font-size: 13px; min-height: 32px; }
  .pchip code, .pchip span { font-size: 13.5px; }
  .ck { font-size: 14px; }

  .pmap ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .psteps { gap: 22px; }
  .pstep { padding: 20px 24px; gap: 14px; }
  .pstep h2 { font-size: 22px; }
  .pstep h3 { font-size: 15.5px; }
  .pcols { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
  .pex { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; }
  .pex p { font-size: 15px; }
  .pex-a { flex: none; }
}
