:root {
  --bg: #f3f7fb;
  --paper: #ffffff;
  --paper-soft: #f8fbff;
  --ink: #17202e;
  --muted: #617086;
  --faint: #8b9ab0;
  --line: #d6e0ec;
  --border: #d6e0ec;
  --line-strong: #aebcd0;
  --panel: #ffffff;
  --blue: #2f6fff;
  --ninja-green: #18a058;
  --ninja-gold: #f6b339;
  --ninja-black: #101722;
  --purple: #8b4cf6;
  --orange: #ff8a31;
  --green: #16a34a;
  --red: #ef3333;
  --pink: #ec4899;
  --black: #111827;
  --gray-wire: #9aa7b7;
  --plate: #c98d42;
  --plate-red: #df5965;
  --plate-dark: #1e2938;
  --stage-grid: #d9e4f0;
  --component-pickup: #eaf2ff;
  --component-plate: #c98d42;
  --component-red-plate: #df5965;
  --component-dark: #1e2938;
  --component-control: #ffffff;
  --component-pickguard-panel: #f8fafc;
  --component-jack: #fff3e7;
  --component-ground: #eaf8ef;
  --component-metal: #dbe3ed;
  --component-section-fill: rgba(255, 255, 255, 0.38);
  --component-section-stroke: rgba(23, 32, 46, 0.24);
  --component-dark-ink: #ffffff;
  --component-dark-muted: #cbd7e6;
  --signal-glow: rgba(255, 138, 49, 0.62);
  --terminal-glow: rgba(47, 111, 255, 0.58);
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --warning-ink: #9a3412;
  --shadow: 0 20px 60px rgba(31, 45, 72, 0.12);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  min-height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-140%);
  padding: 8px 10px;
  color: white;
  background: var(--ninja-black);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  border-bottom: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  flex: 0 1 auto;
  max-width: min(760px, 100%);
}

.brand-home {
  color: inherit;
  text-decoration: none;
  border-radius: 14px;
  inline-size: fit-content;
  max-inline-size: 100%;
}

.brand-home:focus-visible {
  outline: 3px solid rgba(47, 111, 255, 0.38);
  outline-offset: 4px;
}

.brand-home:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(16, 23, 34, 0.26);
}

.brand-block > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: white;
  background: #f8fbff;
  border: 1px solid rgba(24, 160, 88, 0.42);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(16, 23, 34, 0.22);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.brand-mascot {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-mascot-dark {
  display: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0;
}

.subhead {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.header-actions,
.tool-row,
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-action-row {
  display: grid;
  grid-template-columns: minmax(420px, auto) minmax(360px, 1fr);
  flex-basis: 100%;
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.header-actions {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  overflow: visible;
}

.header-actions .primary-button,
.header-actions .ghost-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 11.5px;
  white-space: normal;
  line-height: 1.1;
}

.mode-bar {
  display: flex;
  flex-basis: auto;
  justify-content: flex-start;
  gap: 0;
  flex-wrap: wrap;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-soft);
}

.mode-button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-height: 34px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-button:last-child {
  border-right: 0;
}

.mode-button.is-active {
  color: var(--ninja-green);
  background: white;
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--ninja-green);
}

.mode-context {
  display: grid;
  grid-template-columns: minmax(170px, 0.45fr) minmax(0, 2fr) auto;
  flex-basis: 100%;
  gap: 10px;
  align-items: center;
  min-height: 0;
  padding: 6px 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mode-context strong,
.mode-context span {
  display: block;
  min-width: 0;
}

.mode-context strong {
  font-size: 13px;
  font-weight: 950;
}

.mode-context span,
.workflow-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mode-context > div:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-meta {
  padding: 6px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 850;
  white-space: nowrap;
}

.mode-context .tool-row {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-context .tool-row::-webkit-scrollbar {
  display: none;
}

.mode-context .tool-group {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 5px;
  padding: 3px;
  background: white;
  border-radius: 9px;
}

.mode-context .tool-group-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mode-context .tool-button {
  min-height: 28px;
  width: 32px;
  border-radius: 8px;
  font-size: 11px;
}

.mode-context .tool-button.wide {
  width: auto;
  padding: 0 8px;
  white-space: nowrap;
}

.mode-context .zoom-readout {
  min-width: 36px;
  font-size: 11px;
}

.community-menu-mount {
  min-width: 0;
  margin-left: auto;
  justify-self: end;
  align-self: center;
}

.community-menu-mount.is-signed-in {
  grid-column: auto;
  grid-row: auto;
}

.community-top-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.community-menu-mount.is-signed-in .community-top-menu {
  justify-content: flex-end;
}

.community-menu-label {
  display: grid;
  gap: 1px;
  min-width: 72px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
}

.community-menu-label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.community-auth-buttons,
.community-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.app-header > .community-menu-mount {
  flex: 0 1 auto;
  max-width: min(760px, 58vw);
}

.community-auth-buttons button,
.community-top-actions button,
.support-paypal-button {
  min-height: 34px;
  padding: 0 9px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.support-paypal-button {
  color: #0f172a;
  background: #fff7ed;
  border-color: #fed7aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: min(100%, 430px);
}

.support-paypal-button::after {
  content: "$";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 7px;
  color: #fff;
  background: var(--ninja-green);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.support-paypal-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-paypal-text-mobile {
  display: none;
}

.community-register-button,
.community-top-actions button.primary-community-action {
  color: white;
  background: var(--ninja-black);
  border-color: var(--ninja-black);
}

.account-menu {
  position: relative;
  min-width: 190px;
}

.account-menu-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 4px 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 900;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: white;
  background: var(--ninja-black);
  border-radius: 999px;
  font-size: 10px;
}

.account-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
  text-align: left;
}

.account-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.account-copy small {
  color: var(--muted);
  font-size: 10px;
}

.account-caret {
  color: var(--muted);
  font-size: 11px;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 4px;
  width: 250px;
  padding: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(23, 32, 46, 0.18);
}

.account-dropdown[hidden] {
  display: none;
}

.account-dropdown button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.account-dropdown button:hover {
  background: var(--paper-soft);
}

.primary-button,
.ghost-button,
.tool-button {
  border: 0;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-button {
  background: var(--ninja-black);
  color: white;
  box-shadow: 0 12px 28px rgba(23, 32, 46, 0.2);
}

.ghost-button,
.tool-button {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button.is-active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.primary-button:hover,
.ghost-button:hover,
.tool-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(31, 45, 72, 0.12);
}

.icon-button {
  min-width: 44px;
  padding: 0 10px;
}

.library-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}

.library-heading strong {
  font-size: 15px;
  font-weight: 950;
}

.library-heading span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.library-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-soft);
}

.library-tab {
  min-height: 34px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 900;
}

.library-tab.is-active {
  color: var(--blue);
  background: white;
  box-shadow: inset 0 -2px 0 var(--blue);
}

html[data-library-tab="presets"] .parts-library-section {
  display: none;
}

html[data-library-tab="parts"] .preset-library-section,
html[data-library-tab="parts"] .community-library-section {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(560px, 1fr) minmax(310px, 380px);
  gap: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.sidebar,
.workspace,
.inspector {
  min-height: 0;
}

.sidebar,
.inspector {
  overflow: auto;
  background: var(--paper);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.sidebar {
  padding: 18px 18px 28px;
}

.inspector {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 18px 18px 28px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  background: var(--paper);
}

body.gww-builder-expanded .app-shell {
  grid-template-columns: minmax(230px, 290px) minmax(760px, 1fr);
}

body.gww-builder-expanded .inspector {
  display: none;
}

body.gww-builder-expanded .stage-toolbar {
  display: none;
}

body.gww-builder-expanded .stage-frame {
  min-height: calc(100vh - 226px);
}

.stage-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  min-height: 0;
  padding: 8px 16px;
  background: var(--paper);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.stage-toolbar > div:first-child {
  min-width: 0;
}

.stage-toolbar .tool-row {
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
}

.tool-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 6px;
  background: #f8fbff;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 12px;
}

.tool-group-label {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.tool-group-primary {
  border-color: rgba(47, 111, 255, 0.24);
  background: #f1f6ff;
}

.step-strip {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(130px, 0.55fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px 12px;
  background: var(--paper);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}

.step-index-pill {
  padding: 9px 11px;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.1);
  border: 1px solid rgba(47, 111, 255, 0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.step-strip input[type="range"] {
  width: 100%;
}

.step-timeline,
.step-strip > div:last-child {
  grid-column: 1 / -1;
}

.step-timeline {
  position: relative;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 0;
}

.step-timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 20px;
  height: 2px;
  background: var(--line);
}

.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.step-dot.is-done {
  color: #047857;
  background: #dcfce7;
  border-color: #86efac;
}

.step-dot.is-active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.step-dot-more {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.step-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.step-description {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.active-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.active-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.tool-button {
  width: 40px;
  padding: 0;
}

.tool-button.wide {
  width: auto;
  padding: 0 14px;
}

.custom-stage-action {
  border-color: rgba(47, 111, 255, 0.28);
  background: #eef5ff;
  color: #1d4ed8;
}

.primary-stage-action {
  color: white;
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.zoom-readout {
  min-width: 54px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.stage-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(47, 111, 255, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 111, 255, 0.065) 1px, transparent 1px),
    #fbfdff;
  background-size: 34px 34px;
  border: 1px solid rgba(174, 188, 208, 0.7);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(31, 45, 72, 0.08);
}

.stage-frame::after {
  content: "Scroll to zoom • drag blank space to pan • click two lugs to add a wire • drag wire handles to bend";
  position: absolute;
  left: 18px;
  bottom: 14px;
  padding: 8px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
}

.stage-frame[data-empty="true"]::after {
  content: "Choose a wiring option from Browse Wiring";
}

.stage-frame[data-custom="true"]::after {
  content: "Wiring builder • drag parts in • click two terminals to wire • drag cable handles to bend";
}

.stage-frame[data-preset-view="wiring"]::after {
  content: "Preset wiring • drag parts to reposition • click two lugs to add a wire • drag wire handles to bend";
}

.stage-frame[data-preset-view="layout"]::after {
  content: "Preset layout • drag parts freely • wires are dimmed for easier part placement";
}

.stage-frame[data-preset-view="schematic"]::after {
  content: "Preset schematic • simplified parts and cleaner signal routes for checking connections";
}

.stage-frame[data-preset-view="vector"]::after {
  content: "Preset vector view • instrument outline plus movable wiring parts";
}

.diagram-svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.empty-diagram-panel {
  fill: rgba(255, 255, 255, 0.9);
  stroke: rgba(174, 188, 208, 0.82);
  stroke-width: 2;
}

.empty-diagram-title {
  fill: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.empty-diagram-copy {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.diagram-svg:active {
  cursor: grabbing;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.count-pill {
  min-width: 28px;
  padding: 3px 9px;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.1);
  border: 1px solid rgba(47, 111, 255, 0.2);
  border-radius: 999px;
  text-align: center;
}

.search-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.search-input {
  width: 100%;
  height: 42px;
  margin-bottom: 12px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
}

.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 111, 255, 0.12);
}

.filter-row {
  margin-bottom: 14px;
}

.secondary-title {
  margin: 12px 0 10px;
}

.platform-row {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: white;
  font-size: 12px;
  font-weight: 850;
}

.filter-chip.is-active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.platform-chip {
  min-width: 92px;
  justify-content: center;
}

.config-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-section {
  margin-bottom: 14px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

html[data-mode="browse"] .sidebar-section:first-of-type,
html[data-mode="build"] .guided-builder-section,
html[data-mode="build"] .builder-section,
html[data-mode="verify"] .inspector,
html[data-mode="export"] .stage-toolbar {
  border-color: rgba(24, 160, 88, 0.55);
  box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.08);
}

.sidebar-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.sidebar-section summary::-webkit-details-marker {
  display: none;
}

.sidebar-section summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.1);
  border: 1px solid rgba(47, 111, 255, 0.2);
  border-radius: 999px;
  font-weight: 950;
}

.sidebar-section[open] summary {
  margin-bottom: 12px;
}

.sidebar-section[open] summary::after {
  content: "-";
}

.sidebar-section summary .count-pill {
  margin-left: auto;
}

.builder-card {
  margin-top: 0;
  padding: 14px;
  background: #fff8ef;
  border: 1px solid #ffd4a7;
  border-radius: 18px;
}

.guided-builder-card {
  margin-top: 0;
}

.guided-builder-card .build-wizard {
  margin-bottom: 0;
}

.build-wizard {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border: 1px solid rgba(47, 111, 255, 0.22);
  border-radius: 14px;
}

.build-wizard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.build-wizard-head strong,
.build-wizard-result strong,
.build-wizard-step h3 {
  display: block;
  color: var(--ink);
  font-weight: 950;
  line-height: 1.2;
}

.build-wizard-head strong {
  font-size: 13px;
}

.build-wizard-head span,
.build-wizard-step p,
.build-wizard-result span,
.build-wizard-choice span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.build-wizard-head .builder-button {
  width: auto;
  margin-top: 0;
}

.build-wizard-progress,
.build-wizard-choice-grid,
.build-wizard-actions {
  display: grid;
  gap: 7px;
}

.build-wizard-progress {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.build-wizard-progress button,
.build-wizard-actions button,
.build-wizard-choice {
  min-width: 0;
  min-height: 34px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
}

.build-wizard-progress button.is-active,
.build-wizard-choice.is-selected {
  color: #1d4ed8;
  background: rgba(47, 111, 255, 0.1);
  border-color: rgba(47, 111, 255, 0.42);
}

.build-wizard-progress button.is-done::after {
  content: " done";
  color: var(--ninja-green);
  font-size: 9px;
}

.build-wizard-step {
  display: grid;
  gap: 8px;
}

.build-wizard-step h3,
.build-wizard-step p {
  margin: 0;
}

.build-wizard-choice {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  text-align: left;
}

.build-wizard-choice strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.build-wizard-result {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--paper-soft);
  border: 1px dashed rgba(47, 111, 255, 0.3);
  border-radius: 12px;
}

.build-wizard-actions {
  grid-template-columns: 1fr;
}

.preset-finder-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  background: #f7fbff;
  border: 1px solid rgba(47, 111, 255, 0.18);
  border-radius: 14px;
}

.preset-finder-title {
  display: grid;
  gap: 3px;
}

.preset-finder-title strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.preset-finder-title span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.builder-button {
  width: 100%;
  margin-top: 12px;
}

.builder-options,
.builder-matches {
  display: grid;
  gap: 10px;
}

.builder-group {
  min-width: 0;
  margin: 0;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.builder-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  list-style: none;
  cursor: pointer;
}

.builder-group summary::-webkit-details-marker {
  display: none;
}

.builder-group summary em {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.1);
  border: 1px solid rgba(47, 111, 255, 0.18);
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
}

.builder-help {
  margin: 7px 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.builder-selected {
  padding: 10px;
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}

.builder-selected-title {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.builder-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.builder-chip {
  display: grid;
  gap: 2px;
  max-width: 100%;
  padding: 7px 9px;
  text-align: left;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.builder-chip span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.builder-chip strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
}

.builder-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.checkbox-grid {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.builder-check {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.builder-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--purple);
}

.builder-check em {
  min-width: 20px;
  padding: 2px 6px;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.1);
  border: 1px solid rgba(47, 111, 255, 0.18);
  border-radius: 999px;
  font-style: normal;
  text-align: center;
}

.builder-actions {
  margin-top: 10px;
}

.builder-card p,
.preset-finder-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.custom-workspace-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 212, 167, 0.9);
}

.builder-card .custom-workspace-panel:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.custom-workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.custom-build-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.custom-flow-step {
  display: grid;
  gap: 2px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.custom-flow-step strong {
  color: var(--ink);
  font-size: 11px;
}

.custom-flow-step span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.custom-flow-step.is-complete {
  border-color: rgba(22, 163, 74, 0.35);
  background: #ecfdf3;
}

.custom-flow-step.is-complete span {
  color: #166534;
}

.custom-wire-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.custom-open-button {
  width: 100%;
}

.custom-mini-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.custom-field,
.custom-color-control,
.custom-color-inline {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-field input[type="text"],
.custom-field select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.pickup-color-profile {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pickup-color-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.custom-color-control input,
.custom-color-inline input {
  width: 42px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
}

.starter-template-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.starter-template-list > strong {
  color: var(--ink);
  font-size: 11px;
}

.starter-template-button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
}

.starter-template-button span,
.starter-template-button small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.starter-template-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.custom-part-create-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 100%);
  border: 1px solid rgba(47, 111, 255, 0.28);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(47, 111, 255, 0.08);
}

.custom-part-create-card strong,
.custom-part-create-card p {
  display: block;
  min-width: 0;
}

.custom-part-create-card strong {
  font-size: 13px;
  font-weight: 950;
}

.custom-part-create-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.custom-part-create-card .custom-mini-button {
  width: 100%;
  justify-content: center;
}

.custom-map-view {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.preset-view-control {
  display: grid;
  gap: 8px;
  margin: 14px 0 6px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.custom-map-view > strong {
  color: var(--ink);
  font-size: 11px;
}

.preset-view-control > strong {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preset-view-control p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.custom-map-view-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preset-view-control .custom-map-view-buttons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.custom-view-button {
  min-height: 32px;
  color: var(--muted);
  background: var(--paper-soft);
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 10px;
  font-weight: 900;
}

.custom-view-button:last-child {
  border-right: 0;
}

.custom-view-button.is-active {
  color: white;
  background: var(--blue);
}

.custom-load-button {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.custom-load-button input {
  display: none;
}

.custom-control-section {
  display: grid;
  gap: 8px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.custom-control-section + .custom-control-section,
.custom-control-section + .custom-palette,
.custom-palette + .custom-control-section {
  margin-top: 8px;
}

.custom-control-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  list-style: none;
}

.custom-control-section summary::-webkit-details-marker {
  display: none;
}

.custom-control-section summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.1);
  border: 1px solid rgba(47, 111, 255, 0.22);
  border-radius: 999px;
  font-weight: 950;
}

.custom-control-section[open] summary::after {
  content: "-";
}

.custom-palette {
  display: grid;
  gap: 10px;
}

.custom-palette-group {
  display: grid;
  gap: 7px;
}

.custom-palette-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.custom-palette-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 8px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.15;
  text-align: left;
  cursor: grab;
}

.custom-palette-item:hover {
  border-color: rgba(47, 111, 255, 0.5);
  box-shadow: 0 8px 20px rgba(31, 45, 72, 0.1);
}

.part-tile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.part-tile-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.part-tile-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.part-visual {
  position: relative;
  display: block;
  width: 58px;
  height: 48px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(214, 224, 236, 0.45) 1px, transparent 1px),
    linear-gradient(rgba(214, 224, 236, 0.45) 1px, transparent 1px),
    #f8fbff;
  background-size: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.part-visual .pv-main,
.part-visual .pv-detail,
.part-visual .pv-lug {
  position: absolute;
  display: block;
}

.part-visual .pv-lug {
  width: 7px;
  height: 7px;
  background: white;
  border: 2px solid var(--blue);
  border-radius: 999px;
}

.part-visual-pickup .pv-main {
  left: 7px;
  right: 7px;
  top: 12px;
  height: 24px;
  background: #1f2937;
  border: 2px solid rgba(17, 24, 39, 0.25);
  border-radius: 7px;
}

.part-visual-pickup .pv-detail {
  top: 21px;
  width: 7px;
  height: 7px;
  background: #ffffff;
  border-radius: 999px;
}

.part-visual-pickup .pv-detail-a {
  left: 16px;
}

.part-visual-pickup .pv-detail-b {
  left: 26px;
}

.part-visual-pickup .pv-detail-c {
  left: 36px;
}

.part-visual-pot .pv-main {
  left: 14px;
  top: 7px;
  width: 30px;
  height: 30px;
  background: #ffffff;
  border: 3px solid #9aa7b7;
  border-radius: 999px;
}

.part-visual-pot .pv-detail-a {
  left: 28px;
  top: 10px;
  width: 2px;
  height: 15px;
  background: #617086;
  transform: rotate(35deg);
  transform-origin: bottom center;
}

.part-visual-pot .pv-lug-a {
  left: 13px;
  bottom: 5px;
}

.part-visual-pot .pv-lug-b {
  left: 25px;
  bottom: 3px;
}

.part-visual-pot .pv-lug-c {
  left: 37px;
  bottom: 5px;
}

.part-visual-blade .pv-main {
  left: 9px;
  right: 9px;
  top: 22px;
  height: 5px;
  background: #c98d42;
  border-radius: 999px;
}

.part-visual-blade .pv-detail-a {
  left: 28px;
  top: 11px;
  width: 4px;
  height: 22px;
  background: #617086;
  border-radius: 999px;
  transform: rotate(24deg);
}

.part-visual-blade .pv-lug-a {
  left: 9px;
  top: 8px;
}

.part-visual-blade .pv-lug-b {
  left: 21px;
  top: 8px;
}

.part-visual-blade .pv-lug-c {
  right: 21px;
  bottom: 8px;
}

.part-visual-blade .pv-lug-d {
  right: 9px;
  bottom: 8px;
}

.part-visual-switch .pv-main {
  left: 12px;
  right: 12px;
  top: 15px;
  height: 20px;
  background: #ffffff;
  border: 2px solid #9aa7b7;
  border-radius: 6px;
}

.part-visual-switch .pv-detail-a {
  left: 28px;
  top: 8px;
  width: 3px;
  height: 24px;
  background: #17202e;
  border-radius: 999px;
  transform: rotate(-28deg);
}

.part-visual-switch .pv-lug-a {
  left: 16px;
  bottom: 7px;
}

.part-visual-switch .pv-lug-b {
  left: 26px;
  bottom: 7px;
}

.part-visual-switch .pv-lug-c {
  right: 16px;
  bottom: 7px;
}

.part-visual-cap .pv-main {
  left: 7px;
  right: 7px;
  top: 23px;
  height: 3px;
  background: #16a34a;
}

.part-visual-cap .pv-detail-a,
.part-visual-cap .pv-detail-b {
  top: 13px;
  width: 4px;
  height: 23px;
  background: #16a34a;
  border-radius: 2px;
}

.part-visual-cap .pv-detail-a {
  left: 24px;
}

.part-visual-cap .pv-detail-b {
  right: 24px;
}

.part-visual-jack .pv-main {
  left: 14px;
  top: 11px;
  width: 30px;
  height: 26px;
  background: #fff3e7;
  border: 3px solid #c98d42;
  border-radius: 999px 999px 12px 12px;
}

.part-visual-jack .pv-detail-a {
  left: 27px;
  top: 17px;
  width: 4px;
  height: 15px;
  background: #617086;
  border-radius: 999px;
}

.part-visual-jack .pv-lug-a {
  left: 13px;
  bottom: 5px;
}

.part-visual-jack .pv-lug-b {
  right: 13px;
  bottom: 5px;
}

.part-visual-ground .pv-main {
  left: 13px;
  right: 13px;
  top: 14px;
  height: 5px;
  background: #16a34a;
  border-radius: 999px;
}

.part-visual-ground .pv-detail-a,
.part-visual-ground .pv-detail-b,
.part-visual-ground .pv-detail-c {
  left: 50%;
  height: 3px;
  background: #16a34a;
  border-radius: 999px;
  transform: translateX(-50%);
}

.part-visual-ground .pv-detail-a {
  top: 23px;
  width: 28px;
}

.part-visual-ground .pv-detail-b {
  top: 29px;
  width: 18px;
}

.part-visual-ground .pv-detail-c {
  top: 35px;
  width: 8px;
}

.custom-palette-item:active {
  cursor: grabbing;
}

.builder-match {
  width: 100%;
  padding: 10px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.builder-match.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 255, 0.1);
}

.builder-match strong,
.builder-match span {
  display: block;
}

.builder-match strong {
  color: var(--ink);
  font-size: 12px;
}

.builder-match span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.wire-detail-panel {
  padding: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.wire-detail-panel h2 {
  margin-bottom: 8px;
  font-size: 14px;
}

.wire-detail-panel h3 {
  margin: 10px 0 7px;
  font-size: 12px;
}

.wire-detail-panel p,
.wire-detail-panel li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.custom-wire-add-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.custom-wire-add-panel.is-active {
  background: rgba(47, 111, 255, 0.08);
  border-color: rgba(47, 111, 255, 0.36);
  box-shadow: 0 0 0 3px rgba(47, 111, 255, 0.08);
}

.custom-wire-add-panel strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.custom-wire-add-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.custom-wire-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-color-inline {
  margin: 10px 0;
  text-transform: uppercase;
}

.selected-part-settings.is-context-target {
  border-color: rgba(47, 111, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 111, 255, 0.12);
}

.selected-part-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.selected-part-terminal-editor {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.selected-part-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selected-part-editor-head strong,
.selected-part-editor-head span {
  display: block;
}

.selected-part-editor-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.selected-part-editor-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.selected-part-terminal-list {
  display: grid;
  gap: 8px;
}

.selected-part-terminal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  gap: 7px;
  align-items: end;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.selected-part-terminal-row label:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.selected-part-terminal-row label:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.selected-part-terminal-row label:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.selected-part-terminal-row label:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.selected-part-terminal-row label:nth-child(5) {
  grid-column: 1;
  grid-row: 3;
}

.selected-part-terminal-row label:nth-child(6) {
  grid-column: 2;
  grid-row: 3;
}

.selected-part-terminal-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-part-terminal-row input,
.selected-part-terminal-row select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 7px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.selected-part-terminal-remove {
  grid-column: 3;
  grid-row: 1 / span 3;
  align-self: stretch;
  height: auto;
  min-height: 32px;
}

.custom-part-list {
  display: grid;
  gap: 8px;
}

.custom-part-row {
  width: 100%;
  padding: 10px;
  text-align: left;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.custom-part-row.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 255, 0.1);
}

.custom-part-row strong,
.custom-part-row span {
  display: block;
}

.custom-part-row strong {
  color: var(--ink);
  font-size: 12px;
}

.custom-part-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.user-wire-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0 0;
  padding: 10px;
  background: var(--paper-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

.user-wire-summary strong {
  color: var(--ink);
  font-size: 12px;
}

.config-card {
  width: 100%;
  padding: 13px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.config-card.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 111, 255, 0.1);
}

.config-card .group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.config-card h3 {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0;
}

.config-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  color: #8a4a00;
  background: #fff4e8;
  border: 1px solid #ffd3a6;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.inspector-card {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.workflow-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 13px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.workflow-panel h2 {
  margin: 0;
  font-size: 15px;
}

.workflow-panel p {
  margin: 0;
}

.workflow-panel.is-clear {
  background: #effaf3;
  border-color: rgba(24, 160, 88, 0.32);
}

.workflow-panel.has-warnings {
  background: #fff7ed;
  border-color: #fed7aa;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.muted-card {
  background: var(--paper-soft);
}

.inspector-card h2 {
  margin-bottom: 8px;
  font-size: 16px;
  letter-spacing: 0;
}

.inspector-card h3 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.inspector-card p,
.inspector-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inspector-card ul,
.inspector-card ol {
  margin: 0;
  padding-left: 18px;
}

.summary-grid,
.controls-grid {
  display: grid;
  gap: 9px;
}

.summary-item,
.control-item {
  padding: 10px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.simulator-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.signal-status {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
}

.signal-dot {
  width: 10px;
  height: 10px;
  background: var(--faint);
  border-radius: 999px;
}

.signal-dot.is-live {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 138, 49, 0.16);
}

.signal-toggle {
  min-height: 34px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.signal-toggle.is-active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.simulator-controls {
  display: grid;
  gap: 10px;
}

.sim-control {
  display: grid;
  gap: 6px;
}

.sim-control-label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.position-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.position-button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.position-button.is-active {
  color: white;
  background: var(--purple);
  border-color: var(--purple);
}

.warning-list {
  display: grid;
  gap: 8px;
}

.connection-assistant-list {
  display: grid;
  gap: 8px;
}

.connection-assistant-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.connection-assistant-item strong,
.connection-assistant-item span {
  display: block;
}

.connection-assistant-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.position-matrix {
  display: grid;
  gap: 8px;
}

.position-matrix-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.position-matrix-row strong,
.position-matrix-row span {
  display: block;
}

.position-matrix-row p {
  margin: 5px 0 0;
  color: var(--warning-ink);
  font-size: 12px;
}

.community-queue {
  display: grid;
  gap: 8px;
}

.community-queue-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.community-queue-item strong,
.community-queue-item span,
.community-queue-item em {
  display: block;
}

.community-queue-item span,
.community-queue-item em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.community-queue-open {
  width: 100%;
  justify-content: center;
}

.pickup-color-table {
  display: grid;
  gap: 8px;
}

.pickup-color-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.pickup-color-row strong,
.pickup-color-row span {
  display: block;
}

.pickup-color-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.bench-checklist {
  display: grid;
  gap: 8px;
}

.bench-checklist label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.35;
}

.warning-item {
  padding: 9px 10px;
  color: var(--warning-ink);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.35;
}

.warning-item.is-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.step-integrity-list {
  display: grid;
  gap: 8px;
}

.step-integrity-item,
.step-integrity-ok {
  padding: 9px 10px;
  color: var(--warning-ink);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.35;
}

.step-integrity-item.is-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.step-integrity-ok {
  margin-bottom: 0;
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.muted-line {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong,
.control-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12px;
}

.control-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.legend-list {
  display: grid;
  gap: 8px;
}

.wire-color-list {
  padding: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.wire-color-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.wire-color-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.wire-color-row {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.wire-color-row:first-of-type {
  border-top: 0;
}

.wire-color-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.wire-color-copy strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.wire-color-copy em {
  color: var(--faint);
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
}

.wire-color-picker {
  display: grid;
  gap: 3px;
  justify-items: end;
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.wire-color-picker input {
  width: 32px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: 0;
}

.custom-wire-palette {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}

.custom-wire-swatch {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 42px;
  padding: 7px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.custom-wire-swatch:hover,
.custom-wire-swatch.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(47, 111, 255, 0.12);
}

.custom-wire-swatch-chip {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.custom-wire-swatch-chip.is-auto {
  background:
    linear-gradient(135deg, #2f6fff 0 24%, #16a34a 24% 48%, #ef3333 48% 72%, #f59e0b 72%);
}

.custom-wire-swatch strong,
.custom-wire-swatch small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-wire-swatch strong {
  font-size: 11px;
  font-weight: 950;
}

.custom-wire-swatch small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.custom-wire-palette-editor {
  width: 100%;
  padding: 8px;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.custom-wire-palette-editor summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
}

.custom-wire-editor-actions {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.custom-wire-editor-add {
  width: 44px;
  height: 44px;
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.custom-wire-editor-add:hover,
.custom-wire-editor-add:focus-visible {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 255, 0.16);
}

.custom-wire-editor-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.custom-wire-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 32px;
  gap: 6px;
  align-items: end;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.custom-wire-editor-row label.is-wide {
  grid-column: 1 / -1;
}

.custom-wire-editor-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-wire-editor-row input[type="text"] {
  width: 100%;
  min-height: 32px;
  padding: 7px 8px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.custom-wire-editor-row input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
}

.custom-wire-editor-remove {
  width: 32px;
  height: 32px;
}

.step-list {
  display: grid;
  gap: 8px;
}

.step-list-item {
  width: 100%;
  padding: 10px;
  text-align: left;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.step-list-item.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 255, 0.1);
}

.step-list-item strong,
.step-list-item span {
  display: block;
}

.step-list-item strong {
  color: var(--ink);
  font-size: 12px;
}

.step-list-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.legend-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.legend-swatch {
  width: 22px;
  height: 5px;
  border-radius: 999px;
}

.svg-title {
  fill: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.svg-subtitle,
.svg-label,
.svg-small {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.svg-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.svg-small {
  font-size: 11px;
}

.component-shell {
  stroke: rgba(23, 32, 46, 0.18);
  stroke-width: 2;
  filter: drop-shadow(0 10px 20px rgba(31, 45, 72, 0.1));
  cursor: move;
}

.component-drag-grip {
  fill: rgba(47, 111, 255, 0.12);
  stroke: rgba(47, 111, 255, 0.72);
  stroke-width: 1.5;
  pointer-events: none;
}

.component-drag-grip-mark {
  fill: none;
  stroke: rgba(47, 111, 255, 0.9);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.component-section-shell {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(47, 111, 255, 0.28);
  stroke-width: 1.7;
  cursor: move;
  filter: drop-shadow(0 8px 18px rgba(31, 45, 72, 0.1));
}

.component-section-shell.is-switch-section {
  fill: rgba(215, 163, 92, 0.42);
  stroke: rgba(151, 96, 38, 0.34);
}

.component-section-shell.is-pot-section {
  fill: rgba(255, 255, 255, 0.78);
}

.component-section-shell.is-jack-section {
  fill: rgba(255, 243, 231, 0.78);
}

.component-section-shell.is-roller-section,
.component-section-shell.is-utility-section {
  fill: rgba(234, 248, 239, 0.62);
}

.section-drag-grip {
  fill: rgba(47, 111, 255, 0.16);
  stroke: rgba(47, 111, 255, 0.75);
  stroke-width: 1.4;
  pointer-events: none;
}

.section-drag-grip-mark {
  fill: none;
  stroke: rgba(47, 111, 255, 0.95);
  stroke-width: 1.6;
  stroke-linecap: round;
  pointer-events: none;
}

.custom-part-shell {
  fill: var(--paper);
  stroke: rgba(23, 32, 46, 0.18);
  stroke-width: 2;
  filter: drop-shadow(0 10px 20px rgba(31, 45, 72, 0.1));
  cursor: move;
}

.custom-part.is-selected .custom-part-shell {
  stroke: var(--blue);
  stroke-width: 3;
  filter: drop-shadow(0 0 12px rgba(47, 111, 255, 0.32));
}

.custom-part-delete {
  cursor: pointer;
}

.custom-part-delete-dot {
  fill: #fff1f2;
  stroke: var(--red);
  stroke-width: 2;
  filter: drop-shadow(0 4px 8px rgba(239, 51, 51, 0.22));
}

.custom-part-delete-text {
  fill: var(--red);
  font-size: 13px;
  font-weight: 950;
  text-anchor: middle;
  pointer-events: none;
}

.custom-part-title {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 950;
  pointer-events: none;
}

.custom-part-subtitle {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

.custom-pot-body {
  fill: rgba(47, 111, 255, 0.08);
  stroke: rgba(47, 111, 255, 0.22);
  stroke-width: 2;
  pointer-events: none;
}

.custom-pot-plate {
  fill: #f8fafc;
  stroke: #9aa7b7;
  stroke-width: 3;
  pointer-events: none;
}

.custom-pot-wiper,
.custom-blade-lever,
.custom-jack-tip {
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  pointer-events: none;
}

.custom-pickup-bobbin {
  fill: #1f2937;
  stroke: rgba(17, 24, 39, 0.34);
  stroke-width: 2;
  pointer-events: none;
}

.custom-pickup-pole {
  fill: #ffffff;
  stroke: rgba(226, 232, 240, 0.9);
  stroke-width: 1.5;
  pointer-events: none;
}

.custom-switch-plate {
  fill: rgba(201, 141, 66, 0.82);
  stroke: rgba(122, 78, 30, 0.42);
  stroke-width: 2;
  pointer-events: none;
}

.custom-roller-slot,
.custom-blade-slot {
  stroke: rgba(97, 112, 134, 0.62);
  stroke-width: 3;
  stroke-linecap: round;
  pointer-events: none;
}

.custom-roller-wheel,
.custom-blade-tip {
  fill: rgba(47, 111, 255, 0.1);
  stroke: rgba(47, 111, 255, 0.32);
  stroke-width: 2;
  pointer-events: none;
}

.custom-jack-arc {
  fill: none;
  stroke: #c98d42;
  stroke-width: 5;
  stroke-linecap: round;
  pointer-events: none;
}

.custom-ground-bus {
  stroke: var(--green);
  stroke-width: 5;
  stroke-linecap: round;
  pointer-events: none;
}

.custom-cap-body {
  fill: var(--green);
  stroke: rgba(22, 101, 52, 0.42);
  stroke-width: 1.5;
  pointer-events: none;
}

.custom-cap-line,
.custom-cap-plate {
  stroke: var(--muted);
  stroke-width: 3;
  stroke-linecap: round;
  pointer-events: none;
}

.section-label {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 3;
  letter-spacing: 0;
  pointer-events: none;
}

.roller-slot {
  stroke: rgba(226, 232, 240, 0.55);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.roller-wheel {
  fill: rgba(255, 255, 255, 0.16);
  stroke: rgba(226, 232, 240, 0.72);
  stroke-width: 2;
  pointer-events: none;
}

.terminal-dot {
  stroke: var(--blue);
  stroke-width: 4;
  fill: #f7fbff;
}

.terminal-dot.is-active,
.terminal-dot.is-selected,
.terminal-dot.is-pending {
  stroke: var(--orange);
  stroke-width: 5;
  fill: #fff7ed;
  filter: drop-shadow(0 0 9px var(--terminal-glow));
}

.terminal-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-anchor: middle;
}

.terminal-label-inside {
  fill: #17202e;
  font-size: 7.2px;
  font-weight: 950;
  pointer-events: none;
}

.custom-terminal-hit {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
}

.custom-terminal-dot {
  stroke: var(--blue);
  stroke-width: 4;
  fill: #f7fbff;
  cursor: crosshair;
}

.custom-terminal-dot.has-wire {
  fill: #eef6ff;
}

.custom-terminal-dot.is-addable {
  stroke-width: 5;
  filter: drop-shadow(0 0 8px rgba(47, 111, 255, 0.22));
}

.custom-terminal-dot.is-pending {
  stroke: var(--orange);
  stroke-width: 5;
  fill: #fff7ed;
  filter: drop-shadow(0 0 9px var(--terminal-glow));
}

.custom-terminal-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.wire-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
}

.wire-halo {
  fill: none;
  stroke: transparent;
  stroke-width: 26;
  cursor: pointer;
}

.custom-wire-path {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px rgba(31, 45, 72, 0.18));
}

.custom-wire-path.is-selected {
  filter: drop-shadow(0 0 9px rgba(47, 111, 255, 0.55));
}

.custom-wire-halo {
  fill: none;
  stroke: transparent;
  stroke-width: 30;
  cursor: pointer;
}

.wire-endpoint,
.custom-wire-endpoint {
  stroke: white;
  stroke-width: 4;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(31, 45, 72, 0.26));
}

.stage-frame[data-custom-view="layout"] .custom-wire {
  opacity: 0.26;
}

.stage-frame[data-custom-view="layout"] .custom-terminal-label,
.stage-frame[data-custom-view="layout"] .custom-wire-handle,
.stage-frame[data-custom-view="layout"] .custom-wire-handle-hit {
  opacity: 0.22;
}

.stage-frame[data-custom-view="layout"] .custom-part-shell {
  stroke-width: 3;
}

.stage-frame[data-custom-view="schematic"] .custom-part-shell {
  fill: #ffffff;
  filter: none;
}

.stage-frame[data-custom-view="schematic"] .custom-pickup-bobbin,
.stage-frame[data-custom-view="schematic"] .custom-switch-plate,
.stage-frame[data-custom-view="schematic"] .custom-pot-plate {
  fill: transparent;
}

.stage-frame[data-custom-view="schematic"] .custom-wire-path {
  stroke-width: 5;
  filter: none;
}

.stage-frame[data-preset-view="layout"] .wire-path,
.stage-frame[data-preset-view="layout"] .wire-handle,
.stage-frame[data-preset-view="layout"] .wire-handle-hit,
.stage-frame[data-preset-view="layout"] .wire-label {
  opacity: 0.22;
}

.stage-frame[data-preset-view="layout"] .terminal-label {
  opacity: 0.34;
}

.stage-frame[data-preset-view="layout"] .component-shell {
  stroke-width: 3;
}

.stage-frame[data-preset-view="schematic"] .component-shell {
  fill: #ffffff;
  filter: none;
}

.stage-frame[data-preset-view="schematic"] .custom-pickup-bobbin,
.stage-frame[data-preset-view="schematic"] .custom-switch-plate,
.stage-frame[data-preset-view="schematic"] .custom-pot-plate,
.stage-frame[data-preset-view="schematic"] .custom-cap-body {
  fill: transparent;
}

.stage-frame[data-preset-view="schematic"] .wire-path {
  stroke-width: 4;
  filter: none;
}

.stage-frame[data-preset-view="schematic"] .component-drag-grip,
.stage-frame[data-preset-view="schematic"] .component-drag-grip-mark {
  opacity: 0.55;
}

.vector-instrument {
  pointer-events: none;
}

.vector-body-outline {
  fill: rgba(235, 242, 252, 0.72);
  stroke: rgba(86, 112, 150, 0.34);
  stroke-width: 4;
  filter: drop-shadow(0 18px 42px rgba(31, 45, 72, 0.12));
}

.vector-centerline {
  fill: none;
  stroke: rgba(86, 112, 150, 0.18);
  stroke-width: 2;
  stroke-dasharray: 8 10;
}

.vector-pickguard {
  fill: rgba(255, 255, 255, 0.42);
  stroke: rgba(86, 112, 150, 0.2);
  stroke-width: 2;
}

.vector-body-label {
  fill: rgba(86, 112, 150, 0.54);
  font-size: 15px;
  font-weight: 900;
  text-anchor: middle;
}

.stage-frame[data-preset-view="vector"] .component-shell {
  fill: rgba(255, 255, 255, 0.86);
  stroke: rgba(47, 111, 255, 0.28);
}

.stage-frame[data-preset-view="layout"] .component-shell.is-compound,
.stage-frame[data-preset-view="vector"] .component-shell.is-compound {
  fill: rgba(255, 255, 255, 0.26);
  stroke: rgba(47, 111, 255, 0.18);
  stroke-dasharray: 8 8;
  filter: none;
}

.stage-frame[data-preset-view="vector"] .wire-path {
  filter: drop-shadow(0 2px 6px rgba(31, 45, 72, 0.26));
}

.wire-handle-hit,
.custom-wire-handle-hit {
  fill: transparent;
  stroke: transparent;
  cursor: grab;
  pointer-events: all;
}

.custom-wire-handle {
  fill: #ffffff;
  stroke: #1f2937;
  stroke-width: 2;
  cursor: grab;
  filter: drop-shadow(0 5px 9px rgba(31, 45, 72, 0.18));
}

.custom-wire-handle.is-selected {
  stroke: var(--blue);
  stroke-width: 3;
}

.wire-path.is-selected {
  filter: drop-shadow(0 0 8px rgba(47, 111, 255, 0.55));
}

.wire-path.is-current-step {
  filter: drop-shadow(0 0 7px rgba(47, 111, 255, 0.35));
}

.wire-path.is-previous-step {
  opacity: 0.34;
}

.wire-path.is-signal-muted {
  opacity: 0.14;
  filter: none;
}

.wire-path.is-live-signal {
  opacity: 1;
  filter: drop-shadow(0 0 10px var(--signal-glow));
}

.wire-path.is-terminal-match {
  opacity: 1;
  filter: drop-shadow(0 0 10px var(--terminal-glow));
}

.wire-path.is-selected {
  opacity: 1;
}

.wire-handle {
  fill: white;
  stroke: var(--ink);
  stroke-width: 2;
  cursor: grab;
  filter: drop-shadow(0 5px 9px rgba(31, 45, 72, 0.18));
}

.wire-handle:active {
  cursor: grabbing;
}

.wire-handle-hit:active,
.custom-wire-handle-hit:active {
  cursor: grabbing;
}

.wire-handle.is-signal-muted {
  opacity: 0.16;
}

.wire-handle.is-terminal-match {
  stroke: var(--orange);
  filter: drop-shadow(0 0 8px var(--terminal-glow));
}

.wire-label {
  paint-order: stroke;
  stroke: white;
  stroke-width: 5;
  fill: var(--ink);
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

.workbench-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
}

.footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.footer-toggle,
.footer-action {
  min-height: 34px;
  padding: 0 14px;
  color: var(--blue);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}

.footer-toggle {
  order: 2;
  margin-left: auto;
  color: var(--ink);
}

.footer-action.secondary {
  color: var(--ink);
}

body.footer-collapsed .workbench-footer {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 30;
  padding: 0;
  background: transparent;
  border: 0;
}

body.footer-collapsed .footer-actions {
  display: none;
}

body.footer-collapsed .footer-toggle {
  box-shadow: 0 14px 36px rgba(31, 45, 72, 0.18);
}

.callout-box {
  fill: rgba(255, 255, 255, 0.92);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.callout-title {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.callout-line {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

html[data-theme="dark"] {
  --bg: #0d1320;
  --paper: #121a29;
  --paper-soft: #172235;
  --ink: #eef4ff;
  --muted: #aebbd0;
  --faint: #75839a;
  --line: #2c3b52;
  --line-strong: #50627d;
  --blue: #7aa2ff;
  --purple: #a78bfa;
  --orange: #fb923c;
  --green: #4ade80;
  --red: #f87171;
  --pink: #f472b6;
  --black: #f8fafc;
  --gray-wire: #cbd5e1;
  --plate: #a66f36;
  --plate-red: #b94755;
  --plate-dark: #0f172a;
  --stage-grid: #23325a;
  --component-pickup: #182a45;
  --component-plate: #956634;
  --component-red-plate: #9f3d4b;
  --component-dark: #080d17;
  --component-control: #111827;
  --component-pickguard-panel: #141f31;
  --component-jack: #2b2118;
  --component-ground: #123223;
  --component-metal: #293445;
  --component-section-fill: rgba(255, 255, 255, 0.08);
  --component-section-stroke: rgba(226, 232, 240, 0.22);
  --component-dark-ink: #f8fafc;
  --component-dark-muted: #aebbd0;
  --signal-glow: rgba(251, 146, 60, 0.86);
  --terminal-glow: rgba(122, 162, 255, 0.72);
  --warning-bg: rgba(154, 52, 18, 0.2);
  --warning-border: rgba(251, 146, 60, 0.45);
  --warning-ink: #fdba74;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(122, 162, 255, 0.16), transparent 30%),
    radial-gradient(circle at 100% 12%, rgba(244, 114, 182, 0.12), transparent 34%),
    var(--bg);
}

html[data-theme="dark"] .app-header,
html[data-theme="dark"] .mode-context {
  background: rgba(18, 26, 41, 0.94);
  border-color: rgba(80, 98, 125, 0.7);
}

html[data-theme="dark"] .brand-mark {
  color: #0d1320;
  background: #05080d;
}

html[data-theme="dark"] .brand-mascot-light {
  display: none;
}

html[data-theme="dark"] .brand-mascot-dark {
  display: block;
}

html[data-theme="dark"] .mode-bar,
html[data-theme="dark"] .library-tabs,
html[data-theme="dark"] .custom-map-view-buttons {
  background: #172235;
  border-color: rgba(80, 98, 125, 0.7);
}

html[data-theme="dark"] .mode-button,
html[data-theme="dark"] .library-tab {
  color: #aebbd0;
  border-color: rgba(80, 98, 125, 0.7);
}

html[data-theme="dark"] .mode-button.is-active,
html[data-theme="dark"] .library-tab.is-active {
  color: #7aa2ff;
  background: #0d1320;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .inspector,
html[data-theme="dark"] .stage-toolbar,
html[data-theme="dark"] .step-strip {
  background: rgba(18, 26, 41, 0.88);
  border-color: rgba(80, 98, 125, 0.7);
}

html[data-theme="dark"] .workbench-footer {
  background: rgba(18, 26, 41, 0.94);
}

html[data-theme="dark"] body.footer-collapsed .workbench-footer {
  background: transparent;
}

html[data-theme="dark"] .ghost-button,
html[data-theme="dark"] .tool-button,
html[data-theme="dark"] .footer-toggle,
html[data-theme="dark"] .footer-action,
html[data-theme="dark"] .community-auth-buttons button,
html[data-theme="dark"] .community-top-actions button,
html[data-theme="dark"] .account-menu-button,
html[data-theme="dark"] .support-paypal-button,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .config-card,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .builder-group,
html[data-theme="dark"] .builder-match,
html[data-theme="dark"] .builder-selected,
html[data-theme="dark"] .builder-chip,
html[data-theme="dark"] .build-wizard,
html[data-theme="dark"] .build-wizard-choice,
html[data-theme="dark"] .build-wizard-progress button,
html[data-theme="dark"] .build-wizard-actions button,
html[data-theme="dark"] .build-wizard-result,
html[data-theme="dark"] .preset-finder-card,
html[data-theme="dark"] .custom-field input[type="text"],
html[data-theme="dark"] .preset-view-control,
html[data-theme="dark"] .custom-map-view,
html[data-theme="dark"] .custom-palette-item,
html[data-theme="dark"] .custom-part-row,
html[data-theme="dark"] .wire-detail-panel,
html[data-theme="dark"] .wire-color-list,
html[data-theme="dark"] .signal-toggle,
html[data-theme="dark"] .position-button {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

html[data-theme="dark"] .primary-button,
html[data-theme="dark"] .community-register-button,
html[data-theme="dark"] .community-top-actions button.primary-community-action,
html[data-theme="dark"] .signal-toggle.is-active {
  color: #0d1320;
  background: #eef4ff;
}

html[data-theme="dark"] button:disabled,
html[data-theme="dark"] input:disabled {
  color: #8ea0ba;
  background: rgba(30, 41, 59, 0.62);
  border-color: rgba(148, 163, 184, 0.22);
  opacity: 0.72;
}

html[data-theme="dark"] .account-dropdown {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .account-dropdown button {
  color: var(--ink);
}

html[data-theme="dark"] .account-dropdown button:hover {
  background: rgba(122, 162, 255, 0.12);
}

html[data-theme="dark"] .ghost-button.is-active {
  color: #0d1320;
  background: var(--blue);
  border-color: var(--blue);
}

html[data-theme="dark"] .custom-stage-action {
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.28);
  border-color: rgba(96, 165, 250, 0.38);
}

html[data-theme="dark"] .tool-group {
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(80, 98, 125, 0.64);
}

html[data-theme="dark"] .tool-group-primary {
  background: rgba(30, 64, 175, 0.18);
  border-color: rgba(96, 165, 250, 0.32);
}

html[data-theme="dark"] .primary-stage-action {
  color: white;
  background: #2563eb;
  border-color: #60a5fa;
}

html[data-theme="dark"] .stage-frame {
  background:
    linear-gradient(rgba(122, 162, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 255, 0.08) 1px, transparent 1px),
    #0a101b;
  border-color: rgba(80, 98, 125, 0.7);
}

html[data-theme="dark"] .stage-frame::after {
  background: rgba(18, 26, 41, 0.9);
  border-color: var(--line);
}

html[data-theme="dark"] .svg-title,
html[data-theme="dark"] .svg-label,
html[data-theme="dark"] .custom-part-title {
  fill: #eef4ff;
}

html[data-theme="dark"] .svg-subtitle,
html[data-theme="dark"] .svg-small,
html[data-theme="dark"] .custom-part-subtitle,
html[data-theme="dark"] .custom-terminal-label,
html[data-theme="dark"] .terminal-label {
  fill: #aebbd0;
}

html[data-theme="dark"] .custom-part-shell {
  fill: #121a29;
  stroke: rgba(122, 162, 255, 0.32);
}

html[data-theme="dark"] .custom-pot-plate,
html[data-theme="dark"] .custom-terminal-dot,
html[data-theme="dark"] .terminal-dot {
  fill: #172235;
}

html[data-theme="dark"] .custom-pot-body,
html[data-theme="dark"] .custom-switch-plate {
  fill: rgba(122, 162, 255, 0.16);
  stroke: rgba(122, 162, 255, 0.38);
}

html[data-theme="dark"] .custom-pickup-bobbin {
  fill: #030712;
  stroke: rgba(226, 232, 240, 0.26);
}

html[data-theme="dark"] .custom-wire-path {
  filter: drop-shadow(0 0 7px rgba(122, 162, 255, 0.2));
}

html[data-theme="dark"] .wire-endpoint,
html[data-theme="dark"] .custom-wire-endpoint {
  stroke: #0a101b;
}

html[data-theme="dark"] .custom-view-button {
  color: #aebbd0;
  background: #172235;
}

html[data-theme="dark"] .custom-view-button.is-active {
  color: #0d1320;
  background: #7aa2ff;
}

html[data-theme="dark"] .stage-frame[data-custom-view="schematic"] .custom-part-shell {
  fill: #121a29;
}

html[data-theme="dark"] .stage-frame[data-preset-view="schematic"] .component-shell {
  fill: #121a29;
}

html[data-theme="dark"] .vector-body-outline {
  fill: rgba(20, 31, 49, 0.72);
  stroke: rgba(122, 162, 255, 0.24);
}

html[data-theme="dark"] .vector-centerline {
  stroke: rgba(174, 187, 208, 0.2);
}

html[data-theme="dark"] .vector-pickguard {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(174, 187, 208, 0.16);
}

html[data-theme="dark"] .vector-body-label {
  fill: rgba(174, 187, 208, 0.58);
}

html[data-theme="dark"] .stage-frame[data-preset-view="vector"] .component-shell {
  fill: rgba(18, 26, 41, 0.9);
  stroke: rgba(122, 162, 255, 0.36);
}

html[data-theme="dark"] .stage-frame[data-preset-view="layout"] .component-shell.is-compound,
html[data-theme="dark"] .stage-frame[data-preset-view="vector"] .component-shell.is-compound {
  fill: rgba(18, 26, 41, 0.28);
  stroke: rgba(122, 162, 255, 0.2);
}

html[data-theme="dark"] .component-section-shell {
  fill: rgba(18, 26, 41, 0.78);
  stroke: rgba(122, 162, 255, 0.34);
}

html[data-theme="dark"] .component-section-shell.is-switch-section {
  fill: rgba(149, 102, 52, 0.34);
  stroke: rgba(251, 146, 60, 0.34);
}

html[data-theme="dark"] .component-section-shell.is-jack-section {
  fill: rgba(43, 33, 24, 0.74);
}

html[data-theme="dark"] .component-section-shell.is-roller-section,
html[data-theme="dark"] .component-section-shell.is-utility-section {
  fill: rgba(18, 50, 35, 0.6);
}

html[data-theme="dark"] .section-drag-grip,
html[data-theme="dark"] .component-drag-grip {
  fill: rgba(122, 162, 255, 0.18);
  stroke: rgba(122, 162, 255, 0.72);
}

html[data-theme="dark"] .workbench-footer {
  border-color: rgba(80, 98, 125, 0.7);
}

html[data-theme="dark"] .empty-diagram-panel {
  fill: rgba(18, 26, 41, 0.9);
  stroke: rgba(80, 98, 125, 0.78);
}

html[data-theme="dark"] .builder-card {
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.35);
}

html[data-theme="dark"] .build-wizard {
  background: rgba(47, 111, 255, 0.08);
  border-color: rgba(122, 162, 255, 0.25);
}

html[data-theme="dark"] .preset-finder-card {
  background: rgba(47, 111, 255, 0.1);
  border-color: rgba(122, 162, 255, 0.25);
}

html[data-theme="dark"] .custom-workspace-panel {
  border-bottom-color: rgba(251, 146, 60, 0.24);
}

html[data-theme="dark"] .badge {
  color: #fdba74;
  background: rgba(251, 146, 60, 0.14);
  border-color: rgba(251, 146, 60, 0.35);
}

html[data-theme="dark"] .section-label {
  stroke: rgba(13, 19, 32, 0.72);
}

html[data-theme="dark"] .step-integrity-item.is-error {
  color: #fca5a5;
  background: rgba(153, 27, 27, 0.22);
  border-color: rgba(248, 113, 113, 0.4);
}

html[data-theme="dark"] .warning-item.is-error {
  color: #fca5a5;
  background: rgba(153, 27, 27, 0.22);
  border-color: rgba(248, 113, 113, 0.4);
}

html[data-theme="dark"] .step-integrity-ok {
  color: #86efac;
  background: rgba(22, 101, 52, 0.2);
  border-color: rgba(74, 222, 128, 0.35);
}

html[data-theme="dark"] .terminal-dot {
  fill: #111827;
}

html[data-theme="dark"] .custom-part-shell {
  fill: var(--paper);
  stroke: rgba(226, 232, 240, 0.2);
}

html[data-theme="dark"] .custom-terminal-dot {
  fill: #111827;
}

html[data-theme="dark"] .custom-terminal-dot.is-pending {
  fill: #2b2118;
}

html[data-theme="dark"] .terminal-dot.is-active,
html[data-theme="dark"] .terminal-dot.is-selected,
html[data-theme="dark"] .terminal-dot.is-pending {
  fill: #2b2118;
}

html[data-theme="dark"] .wire-handle,
html[data-theme="dark"] .custom-wire-handle {
  fill: #f8fafc;
  stroke: #0f172a;
}

html[data-theme="dark"] .wire-label {
  stroke: #0a101b;
}

html[data-theme="dark"] .callout-box {
  fill: rgba(18, 26, 41, 0.92);
}

.community-page {
  display: none;
  min-height: calc(100vh - 132px);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(239, 246, 255, 0.72)),
    var(--paper-soft);
}

body.community-page-open {
  overflow: auto;
}

body.community-page-open .app-shell,
body.community-page-open .workbench-footer {
  display: none;
}

body.community-page-open .community-page {
  display: block;
}

.community-page-inner {
  display: grid;
  gap: 14px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.community-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 70px rgba(23, 32, 46, 0.08);
}

.community-page-kicker {
  margin: 0 0 6px;
  color: var(--ninja-green);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.community-page-hero h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.02;
  letter-spacing: 0;
}

.community-page-hero p:not(.community-page-kicker),
.community-directory-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.community-page-actions,
.community-directory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.community-page-actions button,
.community-directory-actions button,
.community-page-tabs button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.community-page-actions .primary-community-button,
.community-directory-actions .primary-community-button,
.community-card-actions .primary-community-button {
  color: white;
  background: var(--ninja-black);
  border-color: var(--ninja-black);
}

.community-page-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  scrollbar-width: thin;
}

.community-page-tab.is-active {
  color: white;
  background: var(--ninja-green);
  border-color: var(--ninja-green);
}

.community-page-body {
  display: grid;
  gap: 12px;
  min-height: 360px;
  padding: 0;
  overflow: visible;
}

.community-directory-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.community-directory-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.1;
}

.community-page .community-explore-controls {
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
  padding: 14px;
  margin: 0;
  background: white;
  border-radius: 12px;
}

.community-page .community-explore-controls button {
  grid-column: auto;
  min-width: 132px;
  white-space: nowrap;
}

.community-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}

.community-request-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.community-request-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.community-request-card p,
.community-request-card small,
.community-request-card em,
.community-request-card span,
.community-request-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.community-request-card em {
  display: block;
  color: var(--blue);
  font-style: normal;
  font-weight: 900;
  text-transform: capitalize;
}

.community-request-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.community-directory-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.community-directory-stats div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.community-directory-stats strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.community-directory-stats span,
.community-directory-stats p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.community-directory-stats p {
  align-self: center;
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.community-diagram-card.is-directory-card {
  gap: 10px;
  min-height: 100%;
  margin: 0;
  border-radius: 12px;
}

.community-card-preview {
  display: grid;
  place-items: center;
  min-height: 148px;
  width: 100%;
  overflow: hidden;
  padding: 8px;
  color: var(--muted);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.community-card-preview:hover {
  border-color: rgba(37, 99, 235, 0.45);
}

.community-card-preview svg {
  width: 100%;
  max-height: 150px;
}

.community-card-preview.is-empty {
  min-height: 92px;
  font-size: 12px;
  font-weight: 850;
}

.community-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.community-card-head strong {
  display: block;
  margin-bottom: 3px;
  font-size: 16px;
  line-height: 1.2;
}

.community-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.community-remix-note {
  display: block;
  margin-top: 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 850;
}

.community-card-meta span,
.community-rank-row span {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.community-card-actions {
  align-content: end;
}

.community-empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  background: white;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: 12px;
}

.community-empty-state h3 {
  margin: 0;
  font-size: 20px;
}

.community-empty-state p {
  max-width: 620px;
  margin: 0;
}

.community-ranking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.community-rank-row {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.community-rank-row:last-child {
  border-bottom: 0;
}

.community-panel {
  position: static;
  width: 100%;
  max-height: none;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  margin-top: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
  backdrop-filter: none;
}

.community-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.community-panel-head strong {
  font-size: 16px;
}

.community-panel-head span,
.community-diagram-card span,
.community-body p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.community-notice {
  margin: 12px 14px 0;
  padding: 10px 12px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.community-notice.is-error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.community-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
}

.community-actions button,
.community-row button,
.community-button-link {
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  white-space: normal;
}

.community-actions button:hover,
.community-row button:hover,
.community-button-link:hover {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.45);
}

.community-body {
  min-height: 0;
  overflow: auto;
  padding: 0 14px 14px;
}

.community-body h3 {
  margin: 12px 0 8px;
  font-size: 14px;
}

.community-explore-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  align-items: end;
  max-width: 100%;
  overflow: hidden;
  padding: 12px;
  margin: 12px 0;
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.community-explore-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.community-explore-controls input,
.community-explore-controls select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.community-explore-controls button {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-height: 36px;
  padding: 0 12px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-diagram-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.community-diagram-card strong {
  font-size: 14px;
}

.community-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.community-card-tags span {
  padding: 4px 7px;
  color: #155e75;
  background: #ecfeff;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.community-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.community-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.community-detail-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.community-score-box {
  display: grid;
  place-items: center;
  min-width: 58px;
  padding: 8px;
  color: white;
  background: var(--ninja-black);
  border-radius: 12px;
}

.community-score-box strong {
  font-size: 18px;
  line-height: 1;
}

.community-score-box span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 900;
}

.community-preview {
  display: grid;
  place-items: center;
  min-height: 170px;
  overflow: hidden;
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.community-preview svg {
  width: 100%;
  max-height: 260px;
}

.community-preview.is-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.community-detail-summary {
  margin: 0;
}

.community-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.community-detail-stats span {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.community-reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
}

.community-reference-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.community-reference-panel h3 {
  margin: 0;
}

.community-reference-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-reference-panel li {
  display: grid;
  gap: 2px;
}

.community-reference-panel li span {
  color: var(--muted);
  font-size: 11px;
}

.community-wire-table {
  display: grid;
  gap: 6px;
}

.community-wire-table > div {
  display: grid;
  grid-template-columns: 34px minmax(100px, 1fr) minmax(68px, 0.8fr) minmax(68px, 0.8fr);
  gap: 6px;
  align-items: center;
  padding: 7px;
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.community-wire-table span,
.community-wire-table code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.community-wire-table code {
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-comments-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.profile-hero-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.profile-hero-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-stat-card {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.profile-stat-card strong {
  font-size: 18px;
}

.profile-stat-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-dashboard-panel {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.profile-dashboard-panel h3 {
  margin: 0 0 4px;
}

.admin-launch-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.admin-launch-panel h3,
.admin-launch-panel p {
  margin: 0;
}

.admin-launch-panel p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.admin-launch-actions,
.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.admin-check {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.admin-check.is-ok {
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: inset 3px 0 0 #16a34a;
}

.admin-check.needs-work {
  border-color: rgba(220, 38, 38, 0.32);
  box-shadow: inset 3px 0 0 #dc2626;
}

.admin-check strong {
  font-size: 11px;
  text-transform: uppercase;
}

.admin-check span,
.admin-check small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-check small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.admin-dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.admin-settings-panel {
  align-content: start;
}

.admin-settings-console {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.admin-settings-header {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.admin-settings-header h3,
.admin-settings-header p {
  margin: 0;
}

.admin-settings-header p:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.admin-settings-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.admin-settings-summary button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  text-align: left;
}

.admin-settings-summary button strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.12);
  border: 1px solid rgba(47, 111, 255, 0.22);
  border-radius: 999px;
  font-size: 12px;
}

.admin-settings-summary button span {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-settings-groups {
  display: grid;
  gap: 10px;
}

.admin-setting-group {
  min-width: 0;
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.admin-setting-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.admin-setting-group summary::-webkit-details-marker {
  display: none;
}

.admin-setting-group summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-setting-group summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-setting-group summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-setting-group summary b {
  padding: 5px 9px;
  color: var(--blue);
  background: rgba(47, 111, 255, 0.1);
  border: 1px solid rgba(47, 111, 255, 0.22);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.admin-setting-grid {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.admin-setting-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 0 10px 12px;
}

.admin-setting-group-actions button {
  min-height: 36px;
}

.preset-admin-grid {
  grid-template-columns: minmax(360px, 1.2fr) repeat(2, minmax(280px, 1fr));
}

.admin-preset-panel {
  align-content: start;
}

.admin-preset-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-preset-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-preset-form label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-preset-form input,
.admin-preset-form select,
.admin-preset-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.admin-preset-form textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.35;
}

.admin-preset-wide,
.admin-preset-form button {
  grid-column: 1 / -1;
}

.admin-preset-row {
  border-left: 4px solid rgba(47, 111, 255, 0.45);
}

.admin-setting-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(240px, 1.1fr) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-setting-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.admin-setting-row span strong,
.admin-setting-row span small,
.admin-setting-row span em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-setting-row span strong {
  color: var(--ink);
}

.admin-setting-row span small {
  color: var(--blue);
  font-size: 10px;
}

.admin-setting-row span em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.25;
  text-transform: none;
}

.admin-setting-row input,
.admin-setting-row select,
.admin-setting-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.admin-setting-row textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.35;
}

.admin-setting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.profile-dashboard-panel button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.profile-dashboard-panel .secondary-danger-button {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.38);
}

.admin-report-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-report-row strong,
.admin-report-row p,
.admin-report-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-report-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.activity-feed {
  display: grid;
  gap: 8px;
}

.activity-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.activity-item.is-unread {
  border-color: rgba(47, 111, 255, 0.42);
  box-shadow: inset 3px 0 0 var(--blue);
}

.activity-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.community-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.community-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 10px;
}

.community-section-title strong {
  font-size: 14px;
}

.community-section-title button,
.community-dialog-actions button,
.community-icon-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.community-comment-card {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.community-comment-card p {
  margin: 0;
}

.community-comment-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.community-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

.community-dialog-card {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
}

.welcome-disclaimer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(9px);
}

.welcome-disclaimer-card {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98)),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 34px 110px rgba(15, 23, 42, 0.32);
}

.welcome-disclaimer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.welcome-disclaimer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 44px;
  min-width: 0;
}

.welcome-disclaimer-logo-shell {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  min-width: 104px;
  overflow: visible;
}

.welcome-disclaimer-mascot {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: contain;
}

.welcome-disclaimer-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.welcome-disclaimer-card h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.welcome-disclaimer-copy {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
}

.welcome-disclaimer-copy p {
  margin: 0;
}

.welcome-disclaimer-copy strong {
  color: var(--ink);
}

.welcome-disclaimer-actions {
  display: flex;
  justify-content: flex-end;
}

.welcome-disclaimer-actions .primary-button {
  min-height: 46px;
  padding-inline: 18px;
  font-size: 15px;
}

.support-dialog-card {
  width: min(520px, calc(100vw - 32px));
}

.support-amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding: 16px 18px 0;
}

.support-amount-grid button {
  min-height: 42px;
  color: #0f172a;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 950;
}

.support-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 18px 0;
}

.support-custom-row input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-weight: 850;
}

.community-part-builder {
  width: min(920px, calc(100vw - 32px));
}

.community-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.community-dialog-head strong {
  font-size: 18px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.community-icon-button {
  width: 34px;
  padding: 0;
  text-transform: uppercase;
}

.community-dialog-intro {
  margin: 0;
  padding: 14px 18px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.community-dialog-helper {
  margin: 12px 18px 0;
  padding: 10px 12px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.community-setup-body {
  display: grid;
  gap: 10px;
  padding: 16px 18px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.community-setup-body p {
  margin: 0;
}

.community-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
}

.community-form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 850;
}

.community-form-field span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.community-form-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.community-form-field.is-wide {
  grid-column: 1 / -1;
}

.community-form-field:has(.hcaptcha-field) {
  grid-column: 1 / -1;
}

.hcaptcha-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.hcaptcha-widget {
  min-height: 78px;
  overflow: hidden;
}

.community-form-field input,
.community-form-field textarea,
.community-form-field select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.community-form-field textarea {
  resize: vertical;
  line-height: 1.4;
}

.community-dialog-error {
  margin: 0 18px 14px;
  padding: 10px 12px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
}

.community-dialog-error[hidden] {
  display: none;
}

.community-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 18px 18px;
}

.community-setup-card .community-dialog-actions {
  padding-top: 18px;
}

.community-dialog-actions .community-link-button {
  margin-right: auto;
  color: #2563eb;
  background: transparent;
  border-color: transparent;
  padding-inline: 0;
}

.community-dialog-actions .primary-community-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.community-dialog-actions button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.part-terminal-builder {
  display: grid;
  gap: 10px;
  margin: 0 18px 16px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
}

.part-terminal-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.part-terminal-builder-head strong,
.part-terminal-builder-head span {
  display: block;
}

.part-terminal-builder-head strong {
  font-size: 14px;
  font-weight: 950;
}

.part-terminal-builder-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.part-terminal-list {
  display: grid;
  gap: 8px;
}

.part-terminal-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.8fr) minmax(130px, 1fr) minmax(150px, 1fr) minmax(96px, 0.7fr) 38px;
  gap: 8px;
  align-items: end;
  padding: 8px;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
}

.part-terminal-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.part-terminal-row label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-terminal-row input,
.part-terminal-row select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.part-terminal-remove {
  align-self: end;
}

html[data-theme="dark"] .community-panel {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .community-panel-head,
html[data-theme="dark"] .community-diagram-card,
html[data-theme="dark"] .community-request-card {
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .community-diagram-card,
html[data-theme="dark"] .community-request-card,
html[data-theme="dark"] .community-comment-card,
html[data-theme="dark"] .community-dialog-card,
html[data-theme="dark"] .welcome-disclaimer-card,
html[data-theme="dark"] .admin-launch-panel,
html[data-theme="dark"] .admin-check,
html[data-theme="dark"] .admin-report-row,
html[data-theme="dark"] .admin-settings-console,
html[data-theme="dark"] .admin-settings-summary button,
html[data-theme="dark"] .admin-setting-group,
html[data-theme="dark"] .admin-setting-row,
html[data-theme="dark"] .admin-setting-row input,
html[data-theme="dark"] .admin-setting-row select,
html[data-theme="dark"] .admin-setting-row textarea,
html[data-theme="dark"] .community-actions button,
html[data-theme="dark"] .community-row button,
html[data-theme="dark"] .community-button-link,
html[data-theme="dark"] .community-section-title button,
html[data-theme="dark"] .community-dialog-actions button,
html[data-theme="dark"] .community-icon-button,
html[data-theme="dark"] .community-form-field input,
html[data-theme="dark"] .community-form-field textarea,
html[data-theme="dark"] .community-form-field select {
  color: #e5e7eb;
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .admin-setting-row span strong,
html[data-theme="dark"] .admin-setting-group summary strong,
html[data-theme="dark"] .admin-setting-row span em {
  color: #e5e7eb;
}

html[data-theme="dark"] .support-amount-grid button,
html[data-theme="dark"] .support-custom-row input {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .welcome-disclaimer-backdrop {
  background: rgba(2, 6, 23, 0.68);
}

html[data-theme="dark"] .welcome-disclaimer-close {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .welcome-disclaimer-kicker {
  color: #7dd3fc;
}

html[data-theme="dark"] .welcome-disclaimer-copy strong {
  color: #f8fafc;
}

html[data-theme="dark"] .community-dialog-actions .primary-community-button {
  color: #fff;
  background: #2563eb;
  border-color: #3b82f6;
}

html[data-theme="dark"] .community-dialog-actions .community-link-button {
  color: #93c5fd;
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .community-dialog-error {
  color: #fecaca;
  background: rgba(153, 27, 27, 0.22);
  border-color: rgba(248, 113, 113, 0.32);
}

html[data-theme="dark"] .community-dialog-helper {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(147, 197, 253, 0.28);
}

html[data-theme="dark"] .part-terminal-builder,
html[data-theme="dark"] .part-terminal-row,
html[data-theme="dark"] .part-terminal-row input,
html[data-theme="dark"] .part-terminal-row select,
html[data-theme="dark"] .custom-part-create-card,
html[data-theme="dark"] .custom-control-section,
html[data-theme="dark"] .selected-part-terminal-editor,
html[data-theme="dark"] .selected-part-terminal-row,
html[data-theme="dark"] .selected-part-terminal-row input,
html[data-theme="dark"] .selected-part-terminal-row select,
html[data-theme="dark"] .custom-wire-swatch,
html[data-theme="dark"] .custom-wire-palette-editor,
html[data-theme="dark"] .custom-wire-editor-row,
html[data-theme="dark"] .custom-wire-editor-row input[type="text"] {
  color: #e5e7eb;
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .custom-wire-editor-add {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(147, 197, 253, 0.28);
}

html[data-theme="dark"] .community-page {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.84)),
    #0f172a;
}

html[data-theme="dark"] .community-page-hero,
html[data-theme="dark"] .community-page-tabs,
html[data-theme="dark"] .community-directory-head,
html[data-theme="dark"] .community-empty-state,
html[data-theme="dark"] .community-page .community-explore-controls {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .community-page-actions button,
html[data-theme="dark"] .community-directory-actions button,
html[data-theme="dark"] .community-page-tabs button,
html[data-theme="dark"] .community-card-meta span,
html[data-theme="dark"] .community-rank-row span {
  color: #e5e7eb;
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .community-page-tab.is-active,
html[data-theme="dark"] .community-page-actions .primary-community-button,
html[data-theme="dark"] .community-directory-actions .primary-community-button,
html[data-theme="dark"] .community-card-actions .primary-community-button {
  color: white;
  background: #15803d;
  border-color: #22c55e;
}

html[data-theme="dark"] .community-notice {
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.22);
  border-color: rgba(96, 165, 250, 0.34);
}

html[data-theme="dark"] .community-notice.is-error {
  color: #fecaca;
  background: rgba(153, 27, 27, 0.22);
  border-color: rgba(248, 113, 113, 0.32);
}

.public-reference-page {
  display: block;
  min-height: 100vh;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(236, 244, 255, 0.92)),
    #f8fbff;
}

.public-reference-shell {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.public-reference-hero,
.public-reference-preview,
.public-reference-grid article,
.public-reference-notes,
.public-reference-tags {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.public-reference-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
}

.public-reference-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.public-reference-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.public-reference-meta,
.public-reference-actions,
.public-reference-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-reference-meta {
  margin-top: 14px;
}

.public-reference-meta span,
.public-reference-tags span {
  padding: 7px 10px;
  color: var(--muted);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.public-reference-actions {
  justify-content: flex-end;
}

.public-reference-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.public-reference-actions .primary-community-button {
  color: white;
  background: var(--ninja-black);
  border-color: var(--ninja-black);
}

.public-reference-preview {
  padding: 16px;
  overflow: hidden;
}

.public-reference-preview svg {
  display: block;
  width: 100%;
  max-height: 620px;
}

.public-reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.public-reference-grid article,
.public-reference-notes {
  padding: 18px;
}

.public-reference-grid h2,
.public-reference-notes h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.public-reference-grid dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.public-reference-grid dl div {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.public-reference-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.public-reference-grid dd {
  min-width: 0;
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.public-reference-grid ul,
.public-reference-notes ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.public-reference-tags {
  padding: 14px;
}

@media (max-width: 1020px) {
  .community-part-builder {
    width: min(720px, calc(100vw - 24px));
  }

  .part-terminal-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  }

  .part-terminal-row label:nth-child(3),
  .part-terminal-row label:nth-child(4) {
    grid-column: span 1;
  }

  .part-terminal-remove {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: stretch;
    height: auto;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 280px minmax(500px, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    height: 320px;
  }

  .inspector-card {
    margin-bottom: 0;
  }
}

@media (max-width: 860px) {
  body {
    display: block;
    overflow: auto;
  }

  .app-header,
  .stage-toolbar {
    align-items: flex-start;
  }

  .app-header {
    flex-direction: column;
  }

  .stage-toolbar {
    grid-template-columns: 1fr;
  }

  .app-header > .community-menu-mount {
    width: 100%;
    max-width: none;
    margin-left: 0;
    align-self: stretch;
  }

  .nav-action-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .community-page {
    min-height: auto;
    padding: 12px;
  }

  .community-page-hero,
  .community-directory-head,
  .community-ranking-grid,
  .community-directory-stats,
  .admin-settings-header,
  .admin-dashboard-grid,
  .admin-checklist,
  .public-reference-grid,
  .community-reference-grid {
    grid-template-columns: 1fr;
  }

  .community-wire-table > div {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .community-page-actions,
  .community-directory-actions,
  .admin-row-actions {
    justify-content: flex-start;
  }

  .admin-launch-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .public-reference-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .public-reference-actions {
    justify-content: flex-start;
  }

  .admin-setting-row {
    grid-template-columns: 1fr;
  }

  .admin-settings-summary {
    grid-template-columns: 1fr;
  }

  .community-page .community-explore-controls {
    grid-template-columns: 1fr;
  }

  .community-page .community-explore-controls button {
    grid-column: 1;
    width: 100%;
  }

  .community-top-menu,
  .header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .part-terminal-row,
  .selected-part-grid,
  .selected-part-terminal-row,
  .custom-wire-palette,
  .custom-wire-editor-row {
    grid-template-columns: 1fr;
  }

  .selected-part-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-part-terminal-row label {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .selected-part-terminal-remove {
    grid-column: auto;
    grid-row: auto;
    align-self: end;
    width: 44px;
  }

  body.gww-builder-expanded .inspector {
    display: block;
  }

  .part-terminal-remove {
    grid-column: auto;
    grid-row: auto;
    align-self: end;
    width: 44px;
  }

  .community-form-grid {
    grid-template-columns: 1fr;
  }

  .part-terminal-builder-head {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 0;
  }

  .sidebar,
  .workspace,
  .inspector {
    margin-bottom: 16px;
  }

  .stage-frame {
    height: 70vh;
    min-height: 520px;
  }

  .step-strip {
    grid-template-columns: repeat(3, auto);
  }

  .step-strip input,
  .step-strip > div {
    grid-column: 1 / -1;
  }

  .inspector {
    display: block;
    height: auto;
  }

  .wire-color-actions,
  .wire-color-row {
    grid-template-columns: 1fr;
  }

  .wire-color-picker {
    justify-items: start;
  }

  .community-panel {
    position: static;
    width: auto;
    max-height: none;
    margin: 16px;
  }

  .community-explore-controls,
  .profile-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .profile-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-detail-head {
    grid-template-columns: 1fr;
  }

  .account-menu {
    width: 100%;
  }

  .account-dropdown {
    left: 0;
    right: auto;
    width: min(280px, 100%);
  }
}

@media (max-width: 520px) {
  .app-header,
  .brand-block,
  .nav-action-row,
  .mode-context,
  .mode-bar,
  .header-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  h1,
  .subhead {
    overflow-wrap: anywhere;
  }

  .mode-bar,
  .header-actions {
    overflow-x: auto;
  }

  .mode-context {
    grid-template-columns: 1fr;
  }

  .mode-context > * {
    min-width: 0;
    max-width: 100%;
  }

  .mode-context .tool-row {
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    contain: paint;
  }

  .workflow-meta {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .profile-stat-grid {
    grid-template-columns: 1fr;
  }

  .build-wizard-head,
  .build-wizard-progress {
    grid-template-columns: 1fr;
  }

  .community-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .support-custom-row {
    grid-template-columns: 1fr;
  }

  .support-custom-row .primary-community-button {
    justify-content: center;
  }
}

@media (max-width: 1180px) {
  .app-header {
    gap: 10px;
  }

  .nav-action-row {
    grid-template-columns: 1fr;
  }

  .mode-bar,
  .header-actions,
  .mode-context .tool-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .mode-button,
  .header-actions .primary-button,
  .header-actions .ghost-button,
  .tool-group,
  .tool-button.wide {
    flex: 0 0 auto;
  }

  .header-actions {
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .mode-context {
    grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.6fr) auto;
  }
}

@media (max-width: 980px) {
  body {
    display: block;
    min-height: 100vh;
    overflow: auto;
  }

  .app-header {
    position: relative;
    z-index: 5;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    overflow: visible;
  }

  .workspace {
    order: 1;
  }

  .sidebar {
    order: 2;
  }

  .inspector {
    order: 3;
  }

  .sidebar,
  .inspector {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 14px;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--line);
  }

  .inspector {
    display: block;
  }

  .stage-toolbar,
  .step-strip {
    padding-left: 12px;
    padding-right: 12px;
  }

  .stage-frame {
    width: 100%;
    height: min(66vh, 620px);
    min-height: 430px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .stage-frame,
  .diagram-svg {
    touch-action: pan-y pinch-zoom;
  }

  body.gww-builder-expanded .app-shell {
    display: flex;
  }

  body.gww-builder-expanded .sidebar,
  body.gww-builder-expanded .inspector {
    display: block;
  }

  body.gww-builder-expanded .stage-frame {
    min-height: 58vh;
  }

  .step-strip {
    grid-template-columns: repeat(4, minmax(0, auto));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .step-strip input,
  .step-strip > div:last-child,
  .step-timeline {
    grid-column: 1 / -1;
  }

  .workbench-footer {
    position: static;
    flex-wrap: wrap;
  }

  .footer-actions {
    order: 2;
    flex: 0 0 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .footer-toggle {
    order: 1;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 8px 10px;
  }

  .brand-block {
    min-width: 0;
    width: auto;
    max-width: 100%;
    flex: 0 1 auto;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  h1 {
    font-size: 16px;
  }

  .subhead {
    display: none;
  }

  .community-menu-mount,
  .app-header > .community-menu-mount {
    width: 100%;
    margin-left: 0;
    align-self: stretch;
  }

  .community-top-menu {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: stretch;
    overflow: visible;
    -webkit-overflow-scrolling: auto;
  }

  .community-auth-buttons,
  .community-top-actions {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    overflow: visible;
    scrollbar-width: none;
  }

  .community-auth-buttons::-webkit-scrollbar,
  .community-top-actions::-webkit-scrollbar {
    display: none;
  }

  .support-paypal-button {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    max-width: 96px;
    padding-inline: 10px;
    overflow: hidden;
    font-size: 0;
  }

  .support-paypal-button::before {
    content: attr(data-mobile-label);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
  }

  .support-paypal-button::after {
    flex: 0 0 18px;
    font-size: 11px;
    margin-left: 7px;
  }

  .support-paypal-text,
  .support-paypal-text-full,
  .support-paypal-text-mobile {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
  }

  .mode-context {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .mode-context > div:first-child {
    display: none;
  }

  .workflow-meta {
    width: 100%;
    text-align: left;
  }

  .tool-row {
    gap: 6px;
  }

  .tool-group {
    gap: 6px;
    padding: 5px;
    border-radius: 10px;
  }

  .tool-group-label {
    font-size: 9px;
  }

  .tool-button {
    width: 36px;
    min-height: 34px;
  }

  .tool-button.wide {
    padding: 0 10px;
  }

  .mode-button,
  .header-actions .primary-button,
  .header-actions .ghost-button {
    min-height: 36px;
    font-size: 12px;
  }

  .stage-frame {
    height: 60vh;
    min-height: 360px;
  }

  .stage-frame::after {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    border-radius: 12px;
    font-size: 10.5px;
    line-height: 1.25;
  }

  .active-title {
    font-size: 14px;
  }

  .active-subtitle,
  .step-description {
    font-size: 11px;
  }

  .sidebar-section,
  .inspector-card,
  .builder-card,
  .guided-builder-card {
    border-radius: 12px;
  }

  .community-page {
    padding: 10px;
  }

  .community-page-hero,
  .community-directory-head,
  .community-page-body,
  .community-card,
  .admin-panel {
    border-radius: 12px;
  }
}

@media (max-width: 460px) {
  .app-header {
    padding: 7px;
  }

  .brand-block {
    gap: 9px;
    max-width: 100%;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  h1 {
    font-size: 15px;
  }

  .mode-bar {
    border-radius: 9px;
    flex-wrap: wrap;
    overflow: visible;
  }

  .mode-button {
    flex: 1 1 33%;
    min-width: 0;
    padding: 0 7px;
    font-size: 11.5px;
    text-align: center;
  }

  .header-actions .primary-button,
  .header-actions .ghost-button {
    padding: 0 9px;
  }

  .stage-toolbar {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .step-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .step-strip .tool-button.wide,
  .step-index-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .stage-frame {
    height: 58vh;
    min-height: 330px;
  }

  .sidebar,
  .inspector {
    padding: 10px;
  }

  .footer-actions {
    gap: 8px;
  }

  .footer-toggle,
  .footer-action {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }
}

[hidden],
.account-menu[hidden],
.account-dropdown[hidden] {
  display: none !important;
}
