/* ============================================================
   CAREER MAP — top-down fan tree with curved elbow connectors.

   Deliberately separate from career-tree.css: this page is the curated
   diagram, that one is the full database-driven outline. Nothing here
   touches .icg-tree-* classes.

   Connectors are drawn entirely with pseudo-element borders plus
   border-radius, which is why they curve without a single SVG path or
   any layout JavaScript.
   ============================================================ */

/* Wider than the normal content shell, so a six-branch fan has room. */
.icg-map-shell{max-width:1600px;margin:0 auto;padding:0 var(--gut)}

/* ---- section heading ---- */
.icg-map-head{display:flex;align-items:flex-end;justify-content:space-between;gap:26px;
  flex-wrap:wrap;margin-bottom:22px}
.icg-map-lede{margin:9px 0 0;max-width:46rem;font-size:14.5px;line-height:1.6;color:var(--ink-2)}

.icg-map-legend{display:flex;flex-wrap:wrap;gap:14px}
.icg-map-legend span{display:inline-flex;align-items:center;gap:7px;
  font-family:var(--f-data);font-size:10px;letter-spacing:.05em;color:var(--muted)}
.icg-map-legend i{width:11px;height:3px;border-radius:2px;flex:0 0 auto}
.icg-map-legend i.is-root{background:#16309b}
.icg-map-legend i.is-stream{background:#c8880c}
.icg-map-legend i.is-page{background:#8f97a6}

/* ---- canvas: graph-paper panel, scrolls sideways only if it must ---- */
.icg-map-canvas{
  --map-line:#d3cfc4;
  position:relative;overflow-x:auto;overflow-y:hidden;
  padding:30px 22px 34px;
  border:1px solid var(--line);border-radius:20px;
  background-color:var(--card);
  background-image:
    linear-gradient(to right, rgba(19,27,46,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(19,27,46,.045) 1px, transparent 1px);
  background-size:22px 22px;
  box-shadow:0 1px 2px rgba(19,27,46,.04),0 22px 44px -34px rgba(19,27,46,.5);
  scrollbar-width:thin;
}
/* max-content plus auto margins: centred when it fits, scrollable when it does not. */
.icg-map{width:max-content;min-width:100%;margin-inline:auto}

/* ---- the tree ----
   Classic fan layout. Each row is a flex list; every item draws half a
   horizontal bar plus a vertical drop, and the first and last items round
   their outer corner to produce the curve. */
.icg-map-kids{
  --drop:34px;                    /* vertical distance between levels */
  --curve:10px;                   /* corner radius of each elbow */
  display:flex;justify-content:center;list-style:none;
  margin:0;padding:var(--drop) 0 0;position:relative;
}
.icg-map > .icg-map-kids{padding-top:0}

.icg-map-kids > li{
  position:relative;list-style:none;
  padding:var(--drop) 7px 0;text-align:center;
}

/* the two halves of the horizontal bar, each with the drop into its own box */
.icg-map-kids > li::before,
.icg-map-kids > li::after{
  content:"";position:absolute;top:0;right:50%;
  width:50%;height:var(--drop);
  border-top:1.5px solid var(--map-line);
}
.icg-map-kids > li::after{right:auto;left:50%;border-left:1.5px solid var(--map-line)}

/* a lone child needs no bar, just the stem already drawn by its parent list */
.icg-map-kids > li:only-child{padding-top:0}
.icg-map-kids > li:only-child::before,
.icg-map-kids > li:only-child::after{display:none}

/* trim the bar so it never overhangs the outermost boxes, and curve the corners */
.icg-map-kids > li:first-child::before,
.icg-map-kids > li:last-child::after{border:0 none}
.icg-map-kids > li:last-child::before{
  border-right:1.5px solid var(--map-line);
  border-radius:0 var(--curve) 0 0;
}
.icg-map-kids > li:first-child::after{border-radius:var(--curve) 0 0 0}

/* stem dropping out of a parent box into its children's bar */
.icg-map-kids .icg-map-kids::before{
  content:"";position:absolute;top:0;left:50%;
  width:0;height:var(--drop);
  border-left:1.5px solid var(--map-line);
}

/* The root sits alone above everything and needs no incoming connector. */
.icg-map > .icg-map-kids > li{padding-top:0}
.icg-map > .icg-map-kids > li::before,
.icg-map > .icg-map-kids > li::after{display:none}

/* ---- final level stacks downward instead of fanning ---- */
.icg-map-kids--stack{flex-direction:column;align-items:center;gap:8px}
.icg-map-kids--stack > li{padding:0}
.icg-map-kids--stack > li::before,
.icg-map-kids--stack > li::after{display:none}
/* short vertical link between stacked boxes */
.icg-map-kids--stack > li + li::before{
  content:"";display:block;position:absolute;top:-8px;left:50%;
  width:0;height:8px;border-left:1.5px solid var(--map-line);border-top:0;
}

/* ---- the box ---- */
.icg-map-box{
  --tone:#8f97a6;
  position:relative;display:inline-flex;align-items:center;justify-content:space-between;gap:10px;
  width:186px;min-height:42px;padding:9px 12px 9px 15px;
  text-align:left;text-decoration:none;
  background:#fff;border:1px solid var(--line);border-radius:9px;
  box-shadow:0 1px 2px rgba(19,27,46,.05);
  transition:border-color .16s ease,box-shadow .18s ease,transform .16s ease;
}
/* the coloured strip down the left edge, as in the reference */
.icg-map-box::before{
  content:"";position:absolute;left:0;top:6px;bottom:6px;width:3px;
  border-radius:0 3px 3px 0;background:var(--tone);
}
.icg-map-box:hover{
  border-color:var(--tone);transform:translateY(-2px);
  box-shadow:0 2px 4px rgba(19,27,46,.05),0 14px 26px -16px rgba(19,27,46,.5);
}
.icg-map-label{
  font-family:var(--f-data);font-size:11.5px;font-weight:600;line-height:1.35;
  color:var(--ink);overflow-wrap:anywhere;
}
.icg-map-count{
  flex:0 0 auto;font-family:var(--f-data);font-size:11px;font-weight:600;color:var(--tone);
}

/* tone bands */
.icg-map-box--root{--tone:#16309b;width:206px;min-height:48px;border-color:#c9d2ee;background:#fff}
.icg-map-box--root .icg-map-label{font-family:var(--f-display);font-size:14px;font-weight:800;
  letter-spacing:-.02em}
.icg-map-box--stage{--tone:#12a37a}
.icg-map-box--stream{--tone:#c8880c}
.icg-map-box--page{--tone:#8f97a6;background:#fdfdfb}
.icg-map-box--page .icg-map-label{font-weight:500;color:var(--ink-2)}

/* ---- footnote + note card ---- */
.icg-map-foot{margin:14px 0 0;padding:0 4px;font-family:var(--f-data);font-size:10.5px;
  line-height:1.6;color:var(--muted)}

.icg-map-note{display:grid;gap:6px;margin:20px 0 0;padding:18px 20px;
  background:var(--blue-soft);border:1px solid rgba(27,63,196,.2);border-radius:14px}
.icg-map-note strong{font-family:var(--f-display);font-size:14.5px;font-weight:700;
  letter-spacing:-.018em;color:var(--ink)}
.icg-map-note span{font-size:13.5px;line-height:1.65;color:var(--ink-2)}
.icg-map-note a{justify-self:start;margin-top:3px;font-family:var(--f-data);font-size:11px;
  font-weight:600;color:var(--blue);text-decoration:none;
  border-bottom:1px solid rgba(27,63,196,.32);padding-bottom:1px}
.icg-map-note a:hover{border-color:var(--blue)}

/* ---- responsive ---- */
@media (max-width:1080px){
  .icg-map-canvas{padding:24px 16px 28px}
  .icg-map-box{width:168px}
  .icg-map-box--root{width:188px}
}
@media (max-width:640px){
  .icg-map-head{align-items:flex-start}
  .icg-map-canvas{padding:20px 12px 24px;border-radius:16px}
  .icg-map-kids{--drop:26px;--curve:8px}
  .icg-map-kids > li{padding-left:4px;padding-right:4px}
  .icg-map-box{width:146px;min-height:38px;padding:8px 10px 8px 13px}
  .icg-map-box--root{width:166px;min-height:42px}
  .icg-map-label{font-size:10.5px}
  .icg-map-count{font-size:10px}
}

@media (prefers-reduced-motion:reduce){
  .icg-map-box{transition:none}
  .icg-map-box:hover{transform:none}
}

@media print{
  .icg-ai{display:none}
  .icg-map-canvas{box-shadow:none;overflow:visible}
}
