/* breadboard to pcb: the board's views on the right, the panel (check, numbers, parts, download) on the
   left under the title; stacked on phones. same dark studio as the other labs. */
.pcb {
  --g-ink: #eef2f7;
  --g-muted: rgba(226, 232, 240, .64);
  --g-line: rgba(255, 255, 255, .1);
  --g-fill: rgba(255, 255, 255, .06);
  --g-fill-2: rgba(255, 255, 255, .11);
  --g-teal: #5eead4;
  --g-amber: #fbbf5a;
  --g-red: #f87171;
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(310px, 360px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "intro stage" "panel stage"; column-gap: 8px;
  height: clamp(660px, 88vh, 920px); padding: 0 12px 12px 0;
  border-radius: 28px; color: var(--g-ink); overflow: clip;
  background: radial-gradient(120% 80% at 70% 0%, #1b2636 0%, transparent 60%), linear-gradient(180deg, #121820 0%, #0c1118 100%);
}
.pcb button, .pcb select { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.pcb :focus-visible { outline: 2px solid var(--g-teal); outline-offset: 2px; }
.pcb-intro { grid-area: intro; padding: 28px 22px 0 28px; }
.pcb-intro h1 { margin: 0; font-size: clamp(1.8rem, 2.4vw, 2.3rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.05; color: #fff; }
.pcb-intro p { margin: 8px 0 0; color: var(--g-muted); font-size: .95rem; line-height: 1.5; }

/* the panel */
.pcb-panel { grid-area: panel; min-height: 0; overflow-y: auto; padding: 16px 18px 18px 28px; display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; }
.pcb-group h2 { margin: 0 0 8px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-muted); }
.pcb-pick { width: 100%; min-height: 40px; padding: 0 34px 0 12px; border-radius: 12px; border: 1px solid var(--g-line); background: var(--g-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center / 18px no-repeat; -webkit-appearance: none; appearance: none; font-size: .88rem; cursor: pointer; }
.pcb-pick option { color: #0f172a; }
.pcb-status { margin-top: 8px; color: var(--g-muted); font-size: .8rem; line-height: 1.45; min-height: 1.2em; }
.pcb-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .84rem; }
.pcb-checks li { display: flex; gap: 8px; align-items: baseline; }
.pcb-checks li > span { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; font-size: .72rem; font-weight: 700; }
.pcb-checks li.ok > span { background: color-mix(in srgb, var(--g-teal) 22%, transparent); color: var(--g-teal); }
.pcb-checks li.bad > span { background: color-mix(in srgb, var(--g-red) 22%, transparent); color: var(--g-red); }
.pcb-checks li.more { color: var(--g-red); font-size: .78rem; padding-left: 26px; }
.pcb-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .84rem; }
.pcb-stats dt { color: var(--g-muted); }
.pcb-stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.pcb-bom { width: 100%; border-collapse: collapse; font-size: .8rem; }
.pcb-bom th { text-align: left; color: var(--g-muted); font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: 0 6px 4px 0; }
.pcb-bom td { padding: 6px 6px 6px 0; border-top: 1px solid var(--g-line); vertical-align: top; }
.pcb-bom td:first-child { color: var(--g-teal); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; width: 30%; }
.pcb-bom td:last-child, .pcb-bom th:last-child { text-align: right; padding-right: 0; }
.pcb-bom small { display: block; color: var(--g-muted); font-size: .7rem; }
.pcb-acts { display: flex; flex-direction: column; gap: 8px; }
.pcb-act { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--g-line); background: var(--g-fill); color: var(--g-ink); font-size: .88rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.pcb-act:hover { background: var(--g-fill-2); }
.pcb-act.primary { background: #fff; color: #0f172a; border-color: #fff; font-weight: 600; }
.pcb-act:disabled { opacity: .45; cursor: not-allowed; }
.pcb-note { margin: 2px 0 0; color: var(--g-muted); font-size: .76rem; line-height: 1.45; }

/* the views */
.pcb-stage { grid-area: stage; position: relative; min-height: 0; margin-top: 12px; border-radius: 20px; background: radial-gradient(60% 60% at 50% 45%, #1d2a3b 0%, transparent 70%), #0e141c; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.pcb-tabs { display: flex; gap: 4px; padding: 12px 12px 0; }
.pcb-tab { min-height: 36px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--g-line); background: var(--g-fill); font-size: .86rem; cursor: pointer; }
.pcb-tab[aria-selected="true"] { background: #fff; color: #0f172a; border-color: #fff; font-weight: 600; }
.pcb-view { min-height: 0; overflow: auto; padding: 12px; }
.pcb-view[hidden] { display: none; }
.pcb-view > svg { display: block; width: 100%; height: 100%; }
.pcb-board-view > svg { max-height: 100%; }
.pcb-board-view svg [data-net] { cursor: pointer; }
.pcb-sch-view > svg { height: auto; min-width: 640px; }
.pcb-3d-view { padding: 0; overflow: hidden; }
.pcb-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.pcb-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.pcb-bar[hidden] { display: none; }
.pcb-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--g-line); background: var(--g-fill); font-size: .8rem; cursor: pointer; }
.pcb-chip[aria-pressed="false"] { opacity: .45; }
.pcb-chip i { width: 10px; height: 10px; border-radius: 3px; }
.pcb-chip .sw-top { background: #e0524a; } .pcb-chip .sw-bot { background: #4d84d6; } .pcb-chip .sw-silk { background: #f4f1e6; }
.pcb-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.pcb-swatch[aria-pressed="true"] { border-color: var(--g-teal); }
.m-green { background: #0f5a32; } .m-black { background: #16181c; } .m-blue { background: #123f86; } .m-purple { background: #45207a; } .m-red { background: #8c1d1d; } .m-white { background: #e9e9e4; }

/* tablets and phones: title, the views, then the panel */
@media (max-width: 899px) {
  .pcb { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "intro" "stage" "panel"; padding: 0 10px 10px; }
  .pcb-intro { padding: 22px 10px 0; }
  .pcb-stage { height: clamp(380px, 62svh, 620px); }
  .pcb-panel { padding: 16px 6px 6px; overflow: visible; }
}
@media (max-width: 560px) {
  .pcb { border-radius: 22px; padding: 0 8px 8px; }
  .pcb-intro h1 { font-size: 1.55rem; }
  .pcb-intro p { display: none; }
  .pcb-stage { height: clamp(340px, 56svh, 520px); }
}
