.b3d-page {
  --b3d-stage: #ffffff;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.1rem 1.1rem 2.4rem;
}
.b3d-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: .9rem;
}
.b3d-head h1 { margin: .15rem 0 .35rem; font-size: 1.45rem; color: var(--navy); }
.b3d-head .lead { margin: 0; max-width: 46rem; }
.b3d-head-meta {
  display: flex; flex-direction: column; gap: .35rem;
  color: #fff; font-weight: 800; font-size: .8rem;
}
.b3d-head-meta span {
  background: var(--navy); border-radius: 999px; padding: .28rem .7rem; white-space: nowrap;
}
.b3d-toolbar {
  display: flex; flex-wrap: wrap; gap: .55rem .7rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .7rem .8rem;
  box-shadow: var(--shadow);
  margin-bottom: .85rem;
}
.b3d-views, .b3d-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.b3d-toolbar button {
  border: 1px solid var(--line);
  background: #f7f9fc;
  color: var(--navy);
  border-radius: 999px;
  padding: .38rem .75rem;
  font-weight: 800;
  font-size: .8rem;
  cursor: pointer;
}
.b3d-toolbar button.is-on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.b3d-statuses { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1; }
.b3d-status {
  display: inline-flex; align-items: center; gap: .35rem;
  border-radius: 999px; padding: .32rem .65rem;
  border: 1px solid transparent;
  background: #f4f7fb;
  font-weight: 800; font-size: .76rem; cursor: pointer;
}
.b3d-status i {
  width: .7rem; height: .7rem; border-radius: 3px; display: inline-block;
}
.b3d-status.is-on {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy);
}
.b3d-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .85fr);
  gap: .85rem;
  align-items: start;
}
.b3d-stage {
  position: relative;
  min-height: 620px;
  height: min(72vh, 760px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.b3d-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.b3d-load {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: .35rem;
  color: var(--navy); background: rgba(255,255,255,.9);
  font-weight: 800;
}
.b3d-load[hidden] { display: none; }
.b3d-hud {
  position: absolute; right: .8rem; bottom: .8rem;
  background: rgba(255,255,255,.92);
  color: var(--navy);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .78rem; font-weight: 800;
  pointer-events: none;
}
.b3d-side { display: grid; gap: .75rem; }
.b3d-schematic-card, .b3d-list-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: .85rem .9rem; box-shadow: var(--shadow);
}
.b3d-side h2 { margin: 0 0 .55rem; font-size: .95rem; color: var(--navy); }
.b3d-side h2 small { color: var(--muted); font-weight: 700; margin-right: .35rem; }
.b3d-schematic {
  position: relative;
  background: #eef3f8;
  border-radius: 14px;
  overflow: hidden;
}
.b3d-schematic svg { width: 100%; height: auto; display: block; }
.b3d-schematic-hint { margin: .45rem 0 0; color: var(--muted); font-size: .75rem; }
.b3d-pins { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.b3d-pins li {
  display: grid; gap: .4rem;
  border: 1px solid var(--line); border-radius: 12px; padding: .5rem .6rem;
  font-size: .82rem; font-weight: 700;
}
.b3d-pins-empty { border-style: dashed; color: var(--muted); font-weight: 600; }
.b3d-pin-head { display: flex; align-items: center; gap: .4rem; }
.b3d-pin-num {
  display: inline-grid; place-content: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: .72rem; flex-shrink: 0;
}
.b3d-pin-head button {
  margin-right: auto; border: 0; background: transparent;
  color: #9b1c2c; font-weight: 800; font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.b3d-pin-note {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: .35rem .45rem; font: inherit; font-weight: 600; resize: vertical; min-height: 2.4rem;
}
.b3d-pin-note:focus { outline: 2px solid rgba(11,31,77,.25); border-color: var(--navy); }
.b3d-marker-dialog {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-content: center;
  background: rgba(7, 21, 54, .55); border: 0; padding: 1rem; margin: 0;
  max-width: none; max-height: none; width: 100%; height: 100%;
}
.b3d-marker-dialog[hidden] { display: none; }
.b3d-marker-inner {
  background: #fff; border-radius: 18px; padding: 1rem 1.1rem;
  width: min(22rem, 92vw); box-shadow: var(--shadow);
}
.b3d-marker-inner h3 { margin: 0 0 .35rem; font-size: 1rem; color: var(--navy); }
.b3d-marker-hint { margin: 0 0 .6rem; color: var(--muted); font-size: .78rem; font-weight: 600; }
.b3d-marker-status { margin-bottom: .55rem; }
.b3d-marker-inner textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem .6rem; font: inherit; font-weight: 600; resize: vertical;
}
.b3d-marker-inner textarea.is-error { border-color: #dc3545; outline: 2px solid rgba(220,53,69,.2); }
.b3d-marker-actions { display: flex; justify-content: flex-end; gap: .45rem; margin-top: .65rem; }
.b3d-marker-save {
  border: 0; background: var(--navy); color: #fff; border-radius: 999px;
  padding: .45rem .9rem; font-weight: 800; font-size: .82rem; cursor: pointer;
}
.b3d-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  border-radius: 999px; padding: .1rem .45rem; color: #fff; font-size: .72rem;
}
@media (max-width: 980px) {
  .b3d-workspace { grid-template-columns: 1fr; }
  .b3d-stage { min-height: 420px; height: 62vh; }
  .b3d-head { flex-direction: column; align-items: flex-start; }
}
