/* Who Gets In? (information-technology/who-gets-in.php). The page chrome is the one-screen layout in
   /css/resource.css; this is the stage: the defences (left), the board with the attack's path (middle) and the
   attacks or missions (right). On a laptop or desktop it fits one window and the panels scroll inside
   themselves; on smaller screens it stacks. Theme tokens only: the board's own names for them are below. */

:root{
  --wg-attack:var(--viz-5); --wg-wall-off:color-mix(in srgb, var(--muted) 10%, transparent); --wg-wall-on:var(--viz-1-tint);
  --wg-pw-weak:var(--viz-2); --wg-pw-mid:var(--viz-7); --wg-pw-strong:var(--viz-3);
}

.rp-main{gap:10px}
.wg-stage{flex:1;min-height:0;display:grid;grid-template-columns:minmax(290px,330px) minmax(0,1fr) minmax(260px,300px);gap:12px}
.wg-defs,.wg-board,.wg-side{min-height:0;min-width:0;display:flex;flex-direction:column}

/* ---------- the defences ---------- */
.wg-defs{padding:10px 12px;gap:8px}
.wg-defs-head,.wg-side-head,.wg-board-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;flex:none}
.wg-mini{display:flex;gap:6px}
.wg-layers{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:6px;padding-right:2px}
.wg-layer{border:1px solid var(--line);border-radius:6px;background:var(--panel-2);padding:7px 9px;transition:border-color .15s,background .15s}
.wg-layer.on{border-color:var(--accent);background:var(--accent-tint)}
.wg-layer-row{display:flex;align-items:center;gap:9px}
.wg-layer-name{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.15}
.wg-layer-name strong{font:600 14px/1.2 var(--font-display);color:var(--ink)}
.wg-kind{font-size:11.5px;color:var(--muted)}
.wg-layer-marks{display:flex;flex-direction:column;align-items:flex-end;gap:1px;font:600 11.5px/1.2 var(--font-mono)}
.wg-cost{color:var(--warn)}
.wg-cost.free{color:var(--ok)}
.wg-pen{color:var(--muted)}
.wg-what{margin:4px 0 0;font-size:12.5px;line-height:1.4;color:var(--ink-soft)}
.wg-detail{margin-top:5px;font-size:12.5px;line-height:1.4;color:var(--ink-soft);border-top:1px dashed var(--line-strong);padding-top:5px}
.wg-detail p{margin:0 0 3px}
.wg-more{flex:none;width:26px;height:26px;border-radius:50%;border:1px solid var(--line-strong);background:var(--panel);color:var(--ink-soft);font:700 13px/1 var(--font-display);cursor:pointer}
.wg-more:hover,.wg-more[aria-expanded="true"]{border-color:var(--accent);color:var(--accent)}
.wg-more:focus-visible,.wg-switch:focus-visible,.wg-attack:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

/* a switch */
.wg-switch{flex:none;background:none;border:0;padding:0;cursor:pointer;display:inline-flex;align-items:center}
.wg-switch .track{width:40px;height:22px;border-radius:11px;background:var(--panel);border:1px solid var(--line-strong);position:relative;transition:background .18s}
.wg-switch .track::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--muted);transition:left .18s,background .18s}
.wg-switch[aria-checked="true"] .track{background:var(--accent);border-color:var(--accent)}
.wg-switch[aria-checked="true"] .track::after{left:20px;background:var(--on-accent)}

/* the password */
.wg-pw{margin-top:6px;display:flex;flex-direction:column;gap:5px}
.wg-pw label{font:600 12px/1.2 var(--font-display);color:var(--ink)}
.wg-pw label span{font-weight:400;color:var(--muted)}
.wg-pw input{font:500 15px/1.2 var(--font-mono);padding:7px 9px;border-radius:5px;border:1px solid var(--line-strong);background:var(--panel);color:var(--ink);width:100%}
.wg-pw input:focus{outline:2px solid var(--focus);outline-offset:1px}
.wg-presets{display:flex;flex-wrap:wrap;gap:4px}
.wg-presets .btn{font-family:var(--font-mono);font-weight:500}
.wg-meter{display:grid;grid-template-columns:repeat(4,1fr);gap:3px}
.wg-meter i{height:7px;border-radius:3px;background:var(--line)}
.wg-meter[data-level="veryweak"] i.on,.wg-meter[data-level="weak"] i.on{background:var(--wg-pw-weak)}
.wg-meter[data-level="medium"] i.on{background:var(--wg-pw-mid)}
.wg-meter[data-level="strong"] i.on{background:var(--wg-pw-strong)}
.wg-meter-text{margin:0;font-size:12.5px;line-height:1.35;color:var(--ink-soft)}
.wg-meter-text b{font-family:var(--font-display)}
.lv-veryweak,.lv-weak{color:var(--bad)}.lv-medium{color:var(--warn)}.lv-strong{color:var(--ok)}
.wg-bits{color:var(--muted)}
.wg-reasons{margin:0;padding:0;list-style:none;font-size:12px;line-height:1.35;display:flex;flex-direction:column;gap:2px}
.wg-reasons li{padding-left:17px;position:relative;color:var(--ink-soft)}
.wg-reasons li::before{position:absolute;left:0;font-weight:700}
.wg-reasons li.ok::before{content:"✓";color:var(--ok)}
.wg-reasons li.part::before{content:"~";color:var(--warn)}
.wg-reasons li.bad::before{content:"✗";color:var(--bad)}

/* ---------- the board ---------- */
.wg-board{padding:10px 12px;gap:6px}
.wg-scores{display:flex;gap:6px}
.wg-score{display:flex;flex-direction:column;gap:1px;background:var(--paper);border:1px solid var(--line);border-radius:6px;padding:4px 9px;min-width:74px}
.wg-score .k{font:600 10px/1.2 var(--font-display);text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.wg-score .v{font:700 15px/1.2 var(--font-mono);color:var(--ink);white-space:nowrap}
.wg-score .bar{height:4px;border-radius:2px;background:var(--line);overflow:hidden}
.wg-score .bar i{display:block;height:100%;width:0;background:var(--ok);transition:width .25s}
.wg-score .bar i.mid{background:var(--warn)}.wg-score .bar i.bad{background:var(--bad)}
.wg-score .bar.cost i{background:var(--warn)}
.wg-svgbox{flex:1 1 55%;min-height:100px;display:flex;align-items:center;justify-content:center}
.wg-svgbox svg{display:block;width:100%;height:100%;max-height:100%;overflow:visible}
.wg-result{flex:1 1 45%;min-height:64px;overflow:auto;border-top:1px solid var(--line);padding-top:8px;font-size:13.5px;line-height:1.45;color:var(--ink-soft)}
.wg-intro{margin:0}
.wg-res-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.wg-res-head strong{font:600 15px/1.2 var(--font-display);color:var(--ink)}
.wg-verdict{font:700 12px/1 var(--font-mono);letter-spacing:.04em;text-transform:uppercase;padding:4px 8px;border-radius:4px}
.wg-verdict.ok{background:var(--ok-tint);color:var(--ok)}
.wg-verdict.bad{background:var(--bad-tint);color:var(--bad)}
.wg-story{margin:4px 0 6px}
.wg-bad{color:var(--bad)}
.wg-steps{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:3px}
.wg-steps li{display:grid;grid-template-columns:105px 110px minmax(0,1fr);gap:2px 8px;font-size:13px;padding:3px 0;border-bottom:1px dotted var(--line)}
.wg-steps .w{font-weight:600;color:var(--ink)}
.wg-steps .t{font:600 11.5px/1.6 var(--font-mono);text-transform:uppercase;letter-spacing:.03em}
.wg-steps .k-stop .t{color:var(--ok)}.wg-steps .k-pass .t{color:var(--bad)}.wg-steps .k-off .t{color:var(--bad)}.wg-steps .k-skip .t{color:var(--muted)}
.wg-steps .k-skip{opacity:.8}
.wg-sum{margin:6px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:3px;font-size:13px}
.wg-sum li{padding-left:18px;position:relative}
.wg-sum li::before{position:absolute;left:0;font-weight:700}
.wg-sum li.ok::before{content:"✓";color:var(--ok)}.wg-sum li.bad::before{content:"✗";color:var(--bad)}
.wg-sum b{color:var(--ink)}

/* the board's drawing */
.wg-road{stroke:var(--line-strong);stroke-width:3;stroke-dasharray:2 7;stroke-linecap:round}
.wg-trail{fill:none;stroke:var(--wg-attack);stroke-width:2.5;stroke-dasharray:7 6;opacity:.55}
.wg-token{fill:var(--wg-attack);stroke:var(--panel);stroke-width:2.5}
.wg-attacker circle,.wg-attacker path{fill:var(--wg-attack)}
.wg-attacker .wg-hood{fill:none;stroke:var(--wg-attack);stroke-width:4}
.wg-label{font:600 13px var(--font-display);fill:var(--ink-soft)}
.wg-brick{fill:var(--wg-wall-off);stroke:var(--line-strong);stroke-width:1.5;stroke-dasharray:5 4;transition:fill .2s}
.wg-wall.on .wg-brick{fill:var(--wg-wall-on);stroke:var(--accent);stroke-dasharray:none;stroke-width:2.5}
.wg-wall.on > .wg-label{fill:var(--ink)}
.wg-part rect{fill:var(--panel);stroke:var(--line-strong);stroke-width:1;stroke-dasharray:3 3}
.wg-part.on rect{stroke-dasharray:none;stroke:var(--accent);fill:var(--accent-tint)}
.wg-part[data-level="veryweak"].on rect,.wg-part[data-level="weak"].on rect{stroke:var(--wg-pw-weak);stroke-width:2}
.wg-part[data-level="medium"].on rect{stroke:var(--wg-pw-mid);stroke-width:2}
.wg-part[data-level="strong"].on rect{stroke:var(--wg-pw-strong);stroke-width:2}
.wg-part-t{font:600 10.5px var(--font-mono);fill:var(--muted)}
.wg-part.on .wg-part-t{fill:var(--ink)}
.wg-mark{font:700 20px var(--font-display)}
.wg-wall.stop .wg-brick{fill:var(--ok-tint);stroke:var(--ok);stroke-width:3.5;stroke-dasharray:none}
.wg-wall.stop .wg-mark{fill:var(--ok)}
.wg-wall.hit .wg-mark{fill:var(--bad)}
.wg-wall.skip .wg-mark{fill:var(--muted)}
.wg-db{fill:var(--accent-tint);stroke:var(--accent);stroke-width:2.5}
.wg-db-line{fill:none;stroke:var(--accent);stroke-width:2}
.wg-data.breached .wg-db{fill:var(--bad-tint);stroke:var(--bad)}
.wg-data.breached .wg-db-line{stroke:var(--bad)}
.wg-data.safe .wg-db{fill:var(--ok-tint);stroke:var(--ok)}
.wg-data.safe .wg-db-line{stroke:var(--ok)}

/* ---------- the attacks and missions ---------- */
.wg-side{padding:10px 12px;overflow:auto;gap:8px}
.wg-side > div{display:flex;flex-direction:column;gap:8px}
.wg-hint{margin:0;font-size:12.5px;color:var(--muted);line-height:1.4}
.wg-attacks{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:5px}
.wg-attack{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:1px;text-align:left;padding:6px 10px;border-radius:6px;border:1px solid var(--line-strong);background:var(--panel);color:var(--ink);cursor:pointer;font:600 13.5px/1.25 var(--font-display)}
.wg-attack:hover{border-color:var(--accent);background:var(--accent-tint)}
.wg-attack[aria-pressed="true"]{border-color:var(--accent);box-shadow:inset 3px 0 0 var(--accent)}
.wg-attack .s{font:600 11.5px/1.3 var(--font-mono);display:flex;gap:6px}
.wg-attack .s.ok{color:var(--ok)}.wg-attack .s.bad{color:var(--bad)}

.wg-mdots{display:flex;gap:4px}
.wg-mdots .cq-dot{width:28px;padding:6px 0}
.wg-mtitle{margin:0;font:700 16px/1.25 var(--font-display);color:var(--ink)}
.wg-mstory{margin:0;font-size:13.5px;line-height:1.45;color:var(--ink-soft)}
.wg-req{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:3px;font-size:13px}
.wg-req li{padding-left:18px;position:relative;color:var(--ink)}
.wg-req li::before{position:absolute;left:0;font-weight:700}
.wg-req li.ok::before{content:"✓";color:var(--ok)}.wg-req li.bad::before{content:"○";color:var(--muted)}
.wg-req .now{color:var(--muted);font-size:12px}
.wg-mbtns{display:flex;flex-wrap:wrap;gap:6px}
.wg-feedback{font-size:13px;line-height:1.45;color:var(--ink-soft)}
.wg-feedback:empty{display:none}
.wg-feedback p{margin:0 0 4px}
.wg-feedback ul,.wg-review ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px}
.wg-feedback i,.wg-review i{color:var(--hint);font-style:normal;display:block}
.wg-feedback .good{background:var(--ok-tint);border-radius:6px;padding:8px 10px;color:var(--ink)}
.wg-feedback .bad{color:var(--bad)}
.wg-done{margin:0;font-size:14px;color:var(--ink);background:var(--ok-tint);border-radius:6px;padding:8px 10px}
.wg-review{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px;font-size:13px;line-height:1.4;color:var(--ink-soft)}
.wg-review > li.ok::marker{color:var(--ok)}.wg-review > li.bad::marker{color:var(--bad)}
.wg-review b{color:var(--ink)}
.wg-review p{margin:3px 0 0}

/* ---------- laptops up to 1300px: the attacks sit under the board ---------- */
@media (min-width:901px) and (max-width:1300px){
  .wg-stage{grid-template-columns:minmax(270px,300px) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"defs board" "defs side"}
  .wg-defs{grid-area:defs}.wg-board{grid-area:board}.wg-side{grid-area:side}
  .wg-attacks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .wg-attack{flex-direction:row;align-items:center;justify-content:space-between;gap:6px;padding:4px 9px}
  .wg-attack .n{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .wg-attack .s > span{display:none}
  .wg-attack .s{font-size:14px}
  .wg-hint{display:none}
  .wg-board-head{display:none}
  .wg-stage[data-mode="missions"] .wg-board-head{display:flex}
  .wg-side-head .wg-scores{margin-left:auto}
  .wg-side-head .wg-score{flex-direction:row;align-items:baseline;gap:6px;padding:3px 8px;min-width:0}
  .wg-side-head .wg-score .bar{display:none}
  .wg-stage[data-mode="free"] .wg-svgbox{flex:0 1 auto;min-height:0}
  .wg-stage[data-mode="free"] .wg-svgbox svg{height:auto;max-height:100%}
  .wg-label{font-size:17px}
  .wg-part-t{font-size:12px}
  /* missions: the mission card needs room, so it takes a third column */
  .wg-stage[data-mode="missions"]{grid-template-columns:minmax(250px,290px) minmax(0,1fr) minmax(240px,290px);grid-template-rows:minmax(0,1fr);grid-template-areas:"defs board side"}
}
@media (min-width:901px) and (max-height:700px){
  .wg-what{display:none}
  .wg-layer{padding:5px 8px}
  .wg-steps li{padding:1px 0}
  .wg-hint{display:none}
  .wg-score{padding:3px 8px}
}

/* ---------- tablets and phones: everything stacks and the page scrolls ---------- */
@media (max-width:900px){
  .wg-stage{display:flex;flex-direction:column}
  .wg-layers,.wg-side,.wg-result{overflow:visible}
  .wg-svgbox{min-height:0}
  .wg-svgbox svg{height:auto}
  .btn,.wg-attack{min-height:40px}
  .wg-more{width:40px;height:40px}
  .wg-switch{min-height:40px;min-width:44px}
  .wg-mdots .cq-dot{width:40px;min-height:40px}
  .rp-controls{width:100%}
  .seg-toggle button{min-height:40px}
}
@media (max-width:640px){
  .rp-main{padding-left:10px;padding-right:10px}
  .wg-scores{width:100%}
  .wg-score{flex:1;min-width:0}
  .wg-steps li{grid-template-columns:1fr auto}
  .wg-steps .r{grid-column:1 / -1}
  .wg-svgbox svg{max-width:420px;margin:0 auto}
  .wg-pw input{font-size:16px}
}
@media (prefers-reduced-motion:reduce){.wg-layer,.wg-switch .track,.wg-switch .track::after,.wg-brick,.wg-score .bar i{transition:none}}

.wg-part.stopper rect{stroke:var(--ok);stroke-width:3;fill:var(--ok-tint);stroke-dasharray:none}
@media (max-width:900px){.wg-stage[data-mode="missions"] .wg-side{order:-1}}
