/* rust.wiki base designer (/base-designer, 2026-11-16) - page-only styles, linked from base_designer.html so the shared
   wiki.css bundle is untouched. The 3D view is dark whatever the page theme; panels use the site tokens. */
.bd-wrap { --bd-glass: rgba(18, 21, 30, .78); --bd-glass-bd: rgba(255, 255, 255, .1); }
.bd-stage { position: relative; border: 1px solid var(--border-strong, #40435c); border-radius: 12px; overflow: hidden;
  background: linear-gradient(#5b6f86 0%, #94a7b8 55%, #4d5a3f 56%, #3c4630 100%); }
#bd-canvas { display: block; width: 100%; height: min(70vh, 660px); height: min(70svh, 660px); touch-action: none; cursor: crosshair;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
#bd-canvas:focus { outline: none; }
#bd-canvas:focus-visible { outline: 2px solid var(--accent, #5471b9); outline-offset: -2px; }
.bd-pill { position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px;
  background: var(--bd-glass); border: 1px solid var(--bd-glass-bd); box-shadow: 0 4px 14px rgba(0, 0, 0, .28); color: #e8eaf0;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: .78rem; }
.bd-pill .btn, .bd-bar .btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 7px;
  background: transparent; color: #c9cede; font-size: .78rem; font-weight: 600; line-height: 1.2; padding: .36rem .6rem; white-space: nowrap; }
.bd-pill .btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.bd-pill .btn.active { background: var(--accent, #5471b9); color: #fff; }
.bd-pill .btn:disabled { opacity: .4; }
.bd-level { top: 10px; left: 10px; }
.bd-level b { min-width: 4.6em; text-align: center; font-variant-numeric: tabular-nums; }
.bd-view { top: 10px; right: 10px; }
.bd-hint { left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: .35rem .7rem; font-weight: 500; color: #d7dbe6; pointer-events: none; }
.bd-hint kbd { background: rgba(255, 255, 255, .12); color: #fff; border-radius: 4px; padding: 0 .3em; font-size: .72rem; }
.bd-toast { top: 52px; left: 50%; transform: translateX(-50%); padding: .4rem .8rem; font-weight: 600; pointer-events: none; opacity: 0;
  transition: opacity .2s; }
.bd-toast.show { opacity: 1; }
.bd-fail { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; color: #fff;
  background: rgba(10, 12, 18, .82); z-index: 3; }

/* tool bar + palette under the view */
.bd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.bd-bar .bd-group { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-card, #1e2133);
  border: 1px solid var(--border-strong, #40435c); }
.bd-bar .btn { color: var(--text-secondary, #ccc); }
.bd-bar .btn:hover { background: var(--overlay-hover, rgba(255,255,255,.1)); color: var(--text-primary, #fff); }
.bd-bar .btn.active { background: var(--accent, #5471b9); color: #fff; }
.bd-grade { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0, 0, 0, .35); }
.bd-spacer { flex: 1 1 auto; }
.bd-bar .bd-group { max-width: 100%; }
#bd-tpl { max-width: 11rem; min-width: 0; }
.bd-pal { border: 1px solid var(--border-strong, #40435c); border-radius: 12px; background: var(--bg-card, #1e2133); padding: 8px; }
.bd-cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
.bd-cats .btn { white-space: nowrap; font-size: .78rem; padding: .25rem .6rem; border-radius: 999px; }
.bd-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.bd-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 8px; border: 1px solid transparent;
  background: rgba(255, 255, 255, .03); color: var(--text-secondary, #ccc); font-size: .72rem; line-height: 1.15; text-align: center; cursor: pointer; }
.bd-item:hover { border-color: var(--border-strong, #40435c); color: var(--text-primary, #fff); }
.bd-item.active { border-color: var(--accent, #5471b9); background: var(--accent-glow, rgba(84,113,185,.12)); color: var(--text-primary, #fff); }
.bd-item img, .bd-item svg { width: 36px; height: 36px; object-fit: contain; }
.bd-item kbd { font-size: .62rem; opacity: .6; background: none; color: inherit; padding: 0; }

/* side panel */
.bd-side .card { margin-bottom: 12px; }
.bd-side .card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bd-res { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-res .stat-tile { padding: 6px 10px; min-width: 0; }
.bd-res .stat-value { display: flex; align-items: center; gap: 5px; font-size: .95rem; }
.bd-res img { width: 22px; height: 22px; }
.bd-big { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bd-sub { font-size: .78rem; color: var(--text-muted, #8a8fa3); }
.bd-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bd-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 999px; font-size: .75rem;
  border: 1px solid var(--border-strong, #40435c); background: transparent; color: var(--text-secondary, #ccc); cursor: pointer; }
.bd-chip img { width: 18px; height: 18px; }
.bd-chip.on { background: var(--accent-glow, rgba(84,113,185,.15)); border-color: var(--accent, #5471b9); color: var(--text-primary, #fff); }
.bd-layers { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: bdl; }
.bd-layers li { position: relative; padding: 6px 0 6px 30px; border-top: 1px solid var(--border, rgba(255,255,255,.06)); font-size: .82rem; }
.bd-layers li::before { counter-increment: bdl; content: counter(bdl); position: absolute; left: 0; top: 7px; width: 21px; height: 21px; border-radius: 50%;
  background: #e5482d; color: #fff; font-weight: 700; font-size: .72rem; display: flex; align-items: center; justify-content: center; }
.bd-layers .ex { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; white-space: nowrap; }
.bd-side .ex { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; white-space: nowrap; }
.bd-side .ex img { width: 20px; height: 20px; }
.bd-tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: 0 5px;
  margin-left: 4px; vertical-align: 1px; }
.bd-tag.soft { background: rgba(61, 186, 111, .18); color: #5fd38e; }
.bd-tag.hard { background: rgba(224, 82, 82, .16); color: #f08a8a; }
.bd-tag.unv { background: rgba(224, 168, 75, .2); color: #e8b866; }
.bd-routes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.bd-routes .btn { font-size: .75rem; padding: .2rem .55rem; }
.bd-warn { font-size: .78rem; color: var(--warning, #c49038); margin: 0; padding-left: 1.1rem; }
.bd-insp dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: .82rem; }
.bd-insp dt { color: var(--text-muted, #8a8fa3); font-weight: 600; }
.bd-insp dd { margin: 0; }
.bd-kv { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; padding: 2px 0; }
.bd-kv b { font-variant-numeric: tabular-nums; }
.bd-input { width: 70px; display: inline-block; }

@media (max-width: 991.98px) {
  #bd-canvas { height: 60vh; height: 60svh; }
  .bd-items { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84px; overflow-x: auto; padding-bottom: 4px; }
  .bd-hint { display: none; }
  .bd-hint.touch { display: block; font-size: .72rem; }
}
@media (max-width: 575.98px) {
  .bd-bar .btn .l { display: none; }
  .bd-bar .btn { padding: .4rem .5rem; }
  .bd-view .btn .l, .bd-level .btn .l { display: none; }
  .bd-level b { min-width: 3.8em; }
  .bd-view { top: auto; bottom: 10px; }
  .bd-hint.touch { display: none; }
}
