:root {
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #26344b;
  background: #f8f9fc;
  font-synthesis: none;
  font-size: 13px;
  font-weight: 450;
  --accent: #6355d8;
  --border: #e6e9f0;
  --muted: #929baa;
  --ink: #25344b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  color: inherit;
  transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #8d80e9;
  outline-offset: 3px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button:hover:not(:disabled) {
  color: var(--accent);
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3,
.brand {
  font-family: Manrope, "DM Sans", sans-serif;
}
h1 {
  font-size: 27px;
  letter-spacing: -1px;
  font-weight: 750;
  line-height: 1.4;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.6px;
}
h3 {
  font-size: 15px;
  letter-spacing: -0.2px;
}
small {
  font-size: 11px;
}
svg {
  flex-shrink: 0;
}
input,
select,
textarea {
  border: 1px solid #dfe4ed;
  border-radius: 7px;
  background: #fff;
  color: #334259;
  padding: 9px 10px;
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: #9ba3b1;
}
select {
  cursor: pointer;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}
pre {
  white-space: pre-wrap;
  font-size: 11px;
  background: #f3f5fa;
  padding: 15px;
  max-height: 280px;
  overflow: auto;
  border-radius: 6px;
}
code {
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.app-shell {
  min-height: 100vh;
}
.topbar {
  height: 74px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 27px;
  gap: 27px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1.7px;
  color: #26344b;
}
.brand-symbol {
  width: 35px;
  height: 35px;
  background: #6656d9;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  transform: rotate(-5deg);
}
.project-select {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #7a8494;
}
.project-select select {
  border: 0;
  font-weight: 600;
  font-size: 13px;
  max-width: 280px;
  padding: 8px 2px;
  color: #42516a;
}
.top-separator {
  height: 23px;
  width: 1px;
  background: var(--border);
  margin-right: 10px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dfe4ed;
  background: #fff;
  padding: 9px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.button:hover:not(:disabled) {
  background: #f7f7fc;
  border-color: #cec9ef;
}
.button.dark {
  background: #29384f;
  border-color: #29384f;
  color: white;
}
.button.dark:hover {
  background: #374963;
  color: #fff;
}
.button.primary {
  background: #6657d8;
  border-color: #6657d8;
  color: #fff;
}
.button.primary:hover {
  background: #574ac2;
  color: white;
}
.button.subtle {
  border: 0;
  background: transparent;
}
.button.full {
  width: 100%;
}
.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #7f8d9c;
  white-space: nowrap;
}
.save-status svg {
  color: #4b9f87;
}
.undo-buttons {
  display: flex;
  border-left: 1px solid var(--border);
  padding-left: 10px;
  gap: 2px;
}
.icon-button {
  height: 29px;
  min-width: 29px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: #8c96a6;
  padding: 5px;
}
.icon-button:hover {
  background: #f0f1f8;
}
.workspace-tabs {
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: 53px;
  gap: 28px;
  padding-right: 28px;
}
.workspace-label {
  width: 234px;
  min-width: 234px;
  padding-left: 27px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: #919ba9;
  font-weight: 700;
  letter-spacing: 1.1px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52a48d;
  flex-shrink: 0;
}
.live-dot.off {
  background: #c7a269;
}
.workspace-tabs > button {
  height: 53px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #7d8798;
  border-bottom: 2px solid transparent;
  padding: 0 2px;
}
.workspace-tabs > button.active {
  color: #6456d7;
  border-bottom-color: #6456d7;
  font-weight: 650;
}
.tiny-tag {
  font-size: 8px;
  letter-spacing: 0.7px;
  color: #a0a8b5;
  background: #f4f6f9;
  border-radius: 3px;
  padding: 3px 4px;
}
.tab-count {
  background: #f0f1f7;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  color: #818c9d;
}
.workspace-right {
  margin-left: auto;
  color: #a0a8b5;
  font-size: 11px;
}
.body-layout {
  display: grid;
  grid-template-columns: 234px minmax(520px, 1fr) 288px;
  min-height: calc(100vh - 127px);
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 26px 13px 18px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 127px);
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9ba3b1;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1px;
  margin: 0 9px 13px;
}
.sidebar-heading .icon-button {
  height: 23px;
  min-width: 23px;
}
.device-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.device-item {
  padding: 12px 9px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 9px;
  border-radius: 8px;
  position: relative;
  width: 100%;
}
.device-item.active {
  background: #f0eefb;
}
.device-icon {
  height: 33px;
  width: 33px;
  background: #f2f4f8;
  color: #8f99a9;
  display: grid;
  place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.device-item.active .device-icon {
  color: #7565da;
  background: #e7e2fa;
}
.device-icon.reference {
  color: #688e8f;
  background: #eff5f4;
}
.device-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.device-text strong {
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
  line-height: 1.3;
}
.device-text small {
  font-size: 9px;
  color: #a2a9b6;
}
.device-progress {
  font-size: 9px;
  color: #9d95c1;
  margin-left: auto;
  white-space: nowrap;
}
.add-component {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed #dce0e9;
  border-radius: 7px;
  padding: 11px;
  margin: 18px 9px;
  color: #8b93a4;
  font-size: 11px;
}
.splice-heading {
  margin-top: 17px;
}
.splice-item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #7b8c99;
  padding: 11px;
  border-radius: 7px;
  font-size: 11px;
  text-align: left;
}
.splice-item.active {
  background: #edf7f2;
  color: #38866b;
}
.splice-item small {
  margin-left: auto;
  background: #e9f2ed;
  padding: 2px 5px;
  border-radius: 4px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 48px 10px 0;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  color: #919bac;
  font-size: 10px;
  margin-bottom: 11px;
}
.progress-label strong {
  color: #67758c;
  font-size: 10px;
  font-weight: 500;
}
.progress-track {
  height: 4px;
  background: #edf0f5;
  border-radius: 4px;
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  background: #8b80de;
}
.sidebar-bottom p {
  font-size: 10px;
  color: #a5adba;
  margin: 9px 0 23px;
}
.main-panel {
  padding: 34px 30px 28px;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.45px;
  color: #9aa3b1;
  font-weight: 650;
  margin-bottom: 8px;
}
.page-heading p {
  font-size: 11px;
  color: #8b96a7;
  margin-top: 7px;
  line-height: 1.6;
}
.summary-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  margin-bottom: 23px;
  font-size: 10px;
  color: #8995a7;
}
.summary-strip > span {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.summary-strip .strip-end {
  margin-left: auto;
  font-size: 9px;
  color: #a8afbb;
}
.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
}
.dot.green {
  background: #68aa94;
}
.dot.hollow {
  border: 1px solid #a7b0be;
}
.worksheet-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  background: #fff;
  border: 1px solid #e0e5ef;
  border-radius: 7px;
  padding: 0 11px;
  color: #a3adbb;
}
.search-field input {
  width: 100%;
  padding: 10px 0;
  border: 0;
  outline: 0 !important;
  background: transparent;
  font-size: 11px;
}
.worksheet-tools .search-field {
  flex: 1;
  max-width: 340px;
}
.worksheet-tools select {
  margin-left: auto;
  font-size: 11px;
  padding: 9px;
}
.connector-section {
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 23px;
  box-shadow: 0 2px 5px #273b5b03;
}
.connector-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid #edf0f5;
  font-size: 10px;
  color: #a0a9b7;
}
.connector-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eeecfa;
  color: #7565c3;
  border-radius: 4px;
  font-weight: 650;
  padding: 5px 7px;
  font-size: 10px;
}
.connector-part {
  margin-left: auto;
  font-size: 9px;
}
.pin-header,
.pin-row {
  display: grid;
  grid-template-columns:
    39px minmax(110px, 1fr) minmax(128px, 1.18fr)
    55px 38px;
  gap: 8px;
  align-items: center;
  padding: 0 15px;
}
.pin-header {
  height: 34px;
  background: #fbfcfe;
  color: #a5adbb;
  font-size: 8px;
  letter-spacing: 0.65px;
  font-weight: 600;
  border-bottom: 1px solid #edf0f5;
}
.pin-row {
  min-height: 68px;
  border-bottom: 1px solid #edf0f5;
  cursor: pointer;
}
.pin-row:last-child {
  border-bottom: 0;
}
.pin-row:hover {
  background: #fafaff;
}
.pin-row.selected {
  background: #f3f1ff;
  box-shadow: inset 3px 0 #8272dc;
}
.pin-number {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  color: #56677f;
}
.pin-function {
  min-width: 0;
  line-height: 1.4;
  padding: 10px 0;
}
.pin-function strong {
  display: block;
  font-size: 11px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.pin-function small {
  display: block;
  font-size: 9px;
  color: #a2abba;
  margin-top: 4px;
  text-transform: capitalize;
}
.destination {
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  padding: 6px 0;
  font-size: 10px;
  min-width: 0;
}
.destination > span:nth-child(2) {
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.destination small {
  display: block;
  color: #93a2ac;
  font-size: 9px;
  margin-top: 3px;
}
.destination > svg {
  margin-left: auto;
  color: #a9b4c1;
}
.destination-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6aa793;
  flex-shrink: 0;
}
.connect-button {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #a0a8ba;
  padding: 8px 0;
  text-align: left;
}
.connect-button:hover {
  color: var(--accent);
}
.connect-button.suggested {
  color: #8c71d9;
}
.wire-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: #637089;
}
.wire-cell small {
  display: block;
  font-size: 8px;
  color: #aab1bb;
  margin-top: 2px;
}
.wire-swatch {
  width: 14px;
  height: 4px;
  border-radius: 2px;
}
.check-pin {
  color: #cbd2df;
  display: grid;
  place-items: center;
  padding: 6px;
}
.check-pin.checked {
  color: #66a590;
}
.worksheet-foot {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: #a1aab7;
  margin: 3px 0 25px;
}
.remove-device {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  margin-top: 35px;
  font-size: 9px;
  color: #b5bbc5;
}
.remove-device button {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: #9d9aaa;
}
.remove-device button:hover {
  color: #ba5c68;
}
.inspector {
  border-left: 1px solid var(--border);
  background: #fff;
  padding: 27px 21px;
  min-width: 0;
}
.inspector-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: #99a3b2;
  letter-spacing: 0.9px;
  margin-bottom: 24px;
  min-height: 26px;
}
.inspector-heading .icon-button {
  margin-left: auto;
}
.inspector-intro {
  padding: 1px 4px 23px;
}
.inspector-art {
  position: relative;
  background: #f4f2fc;
  width: 67px;
  height: 67px;
  border-radius: 18px;
  color: #a298d9;
  display: grid;
  place-items: center;
  margin: 10px 0 20px;
}
.art-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: #c6bde9;
  border: 2px solid #fff;
}
.art-dot.one {
  right: -2px;
  top: 13px;
}
.art-dot.two {
  left: 7px;
  bottom: -2px;
  background: #b3d7c8;
}
.inspector-intro h3 {
  font-size: 17px;
  line-height: 1.6;
  font-weight: 650;
  letter-spacing: -0.45px;
}
.inspector-intro p {
  font-size: 11px;
  line-height: 1.85;
  color: #98a2b2;
  margin: 10px 0 20px;
}
.tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  font-size: 10px;
  color: #939dad;
}
.tip span {
  font-size: 8px;
  background: #f5f6fa;
  color: #a7afbe;
  border-radius: 4px;
  padding: 5px;
}
.ai-card {
  border: 1px solid #e5e0f5;
  background: linear-gradient(145deg, #fbfaff, #f8f6ff);
  border-radius: 9px;
  padding: 15px 13px;
  margin-top: 14px;
}
.ai-card-title {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ai-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: #eeebfb;
  color: #9b87da;
  border-radius: 7px;
}
.ai-card h3 {
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  color: #73628e;
  font-weight: 600;
  letter-spacing: 0;
}
.ai-card p {
  font-size: 10px;
  color: #a096b1;
  line-height: 1.85;
  margin: 11px 0 14px;
}
.ai-button {
  background: #fff;
  border-color: #dcd4f2;
  color: #8a74c4;
  font-size: 10px;
  white-space: normal;
  line-height: 1.5;
}
.ai-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  color: #aaa1b7;
  flex-wrap: wrap;
  margin-top: 11px;
}
.ai-status small {
  font-size: 8px;
  margin-left: auto;
}
.wire-inspector h3 {
  font-size: 17px;
  line-height: 1.6;
}
.endpoint-pair {
  font-size: 10px;
  background: #f5f6fa;
  border-radius: 7px;
  padding: 11px;
  margin: 12px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.5;
  color: #8190a5;
}
.endpoint-pair svg {
  transform: rotate(90deg);
  color: #b0bac7;
}
.field-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 10px;
  color: #8793a6;
  margin: 17px 0;
}
.field-label input,
.field-label select {
  font-size: 11px;
  width: 100%;
  padding: 9px;
}
.field-label > span {
  font-size: 9px;
  color: #a8b0bc;
  margin-top: -3px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field-grid .field-label {
  margin: 0;
}
.cut-length {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  padding: 11px;
  background: #f5f7fa;
  border-radius: 6px;
  color: #93a0b0;
  font-size: 9px;
}
.cut-length strong {
  font-size: 11px;
  color: #65748a;
  font-weight: 550;
}
.cut-length strong small {
  font-size: 9px;
}
.cut-length > small {
  font-size: 8px;
  grid-column: 1/-1;
  color: #b0b7c2;
}
.inspector-note {
  display: flex;
  gap: 7px;
  line-height: 1.7;
  font-size: 9px;
  color: #a1aaba;
  margin: 18px 0;
}
.inspector-note svg {
  margin-top: 2px;
  color: #90b4a8;
}
.danger-link {
  width: 100%;
  font-size: 10px;
  color: #b08a94;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin: 17px 0;
}
.diagram-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.diagram-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  border-bottom: 1px solid #edf0f5;
  color: #929fb0;
  font-size: 9px;
}
.diagram-tools > div {
  display: flex;
  margin-left: auto;
  gap: 3px;
  flex-shrink: 0;
}
.diagram-tools button {
  padding: 5px 7px;
  border: 1px solid #e4e9f0;
  border-radius: 4px;
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
}
.legend-line {
  display: inline-block;
  width: 15px;
  border-top: 2px solid #92a4b7;
  margin-right: 6px;
  vertical-align: middle;
}
.diagram-scroll {
  overflow: auto;
  background: radial-gradient(#e2e7f0 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  min-height: 480px;
  max-height: 75vh;
}
.diagram-svg {
  margin: auto;
  padding: 10px;
}
.diagram-svg > svg {
  width: 100%;
  height: auto;
  min-height: 250px;
  display: block;
}
.diagram-caption {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: #829d90;
  margin-top: 17px;
}
.diagram-caption span {
  margin-left: auto;
  color: #9fa8b5;
}
.library-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
}
.library-toolbar .search-field {
  min-width: 180px;
  flex: 1;
}
.segmented {
  display: flex;
  gap: 3px;
  border: 1px solid #e4e7ef;
  background: #f0f2f7;
  border-radius: 7px;
  padding: 3px;
}
.segmented button {
  text-transform: capitalize;
  padding: 7px 10px;
  font-size: 10px;
  color: #8d96a6;
  border-radius: 4px;
}
.segmented .active {
  background: #fff;
  color: #6f61bb;
  box-shadow: 0 1px 3px #22344b0b;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.component-card {
  background: #fff;
  border: 1px solid #e0e5ee;
  border-radius: 10px;
  padding: 20px 18px;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
}
.library-icon {
  display: grid;
  place-items: center;
  color: #9283cf;
  background: #f1eefb;
  border-radius: 10px;
  width: 43px;
  height: 43px;
}
.origin-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 6px;
  border-radius: 4px;
  color: #a48c64;
  background: #fbf4e9;
}
.origin-badge.reference {
  background: #edf6f2;
  color: #749c8d;
}
.origin-badge.custom {
  background: #f0ecfc;
  color: #9380c5;
}
.component-card h3 {
  font-size: 15px;
}
.component-card p {
  margin-top: 6px;
  font-size: 10px;
  color: #96a0af;
}
.card-meta {
  display: flex;
  gap: 8px;
  font-size: 9px;
  color: #a5adba;
  margin: 20px 0 15px;
}
.card-actions {
  border-top: 1px solid #edf0f5;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-actions > button:first-child {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: #949daf;
}
.card-actions .button {
  font-size: 10px;
  padding: 7px 10px;
}
.library-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #a3adba;
  font-size: 10px;
  line-height: 1.7;
  margin-top: 24px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: #1c29445c;
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 100px #12223c40;
  width: 500px;
  max-height: 90vh;
  overflow: auto;
  padding: 26px;
}
.modal.wide {
  width: 940px;
}
.modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 20px;
}
.modal-description {
  font-size: 12px;
  line-height: 1.8;
  color: #929daf;
  margin-bottom: 20px;
}
.modal-footnote {
  font-size: 10px;
  color: #a0aab8;
  margin-top: 17px;
  line-height: 1.7;
}
.connecting-from {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px;
  background: #f5f3fc;
  border: 1px solid #ece7f9;
  border-radius: 8px;
  margin-bottom: 19px;
}
.connecting-from > span {
  font-size: 8px;
  letter-spacing: 1px;
  color: #a394c4;
}
.connecting-from strong {
  font-size: 13px;
  color: #665483;
}
.connecting-from small {
  font-size: 10px;
  color: #a299b7;
}
.destination-list {
  max-height: 380px;
  overflow: auto;
  margin-top: 13px;
}
.destination-list > button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 5px;
  text-align: left;
  border-bottom: 1px solid #f0f2f7;
}
.destination-list > button:hover {
  background: #f8f7fd;
}
.destination-list strong {
  display: block;
  font-size: 11px;
  font-weight: 550;
}
.destination-list small {
  display: block;
  font-size: 10px;
  color: #9aa6b6;
  margin-top: 4px;
}
.destination-list .target-state {
  margin-left: auto;
  font-size: 9px;
  white-space: nowrap;
}
.target-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 7px;
  background: #f1f2f7;
  color: #9da5b6;
}
.target-icon.splice {
  background: #ebf5ef;
  color: #76a18c;
}
.component-detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
}
.component-detail p {
  font-size: 11px;
  color: #939faf;
  line-height: 1.85;
  margin: 15px 0;
}
.source-block {
  background: #f6f7fa;
  padding: 12px;
  border-radius: 7px;
  margin: 16px 0 25px;
  font-size: 10px;
  color: #909bac;
}
.source-block p {
  margin: 5px 0;
  font-size: 10px;
}
.source-block a {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 9px;
  font-size: 10px;
}
.component-pins {
  border: 1px solid var(--border);
  border-radius: 7px;
  margin: 15px 0;
  overflow: hidden;
}
.component-pins h4 {
  padding: 12px;
  font-size: 11px;
  background: #f7f8fb;
}
.component-pins h4 small {
  display: block;
  font-size: 9px;
  color: #a0aabb;
  font-weight: 400;
  margin-top: 6px;
}
.component-pins > div {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
}
.component-pins strong {
  font-weight: 500;
}
.component-pins small {
  font-size: 9px;
  color: #a0aabb;
}
.component-schematic {
  min-width: 0;
  background: #fafbfe;
  border-radius: 8px;
  padding: 15px;
}
.component-schematic p {
  font-size: 10px;
  margin: 10px 0 15px;
}
.component-schematic .diagram-tools {
  display: none;
}
.component-schematic .diagram-scroll {
  min-height: 300px;
  max-height: 550px;
}
.export-option {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 21px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  text-align: left;
  margin: 13px 0;
}
.export-option:hover {
  background: #f8f7ff;
  border-color: #d2c9ee;
}
.export-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 10px;
  background: #f4edfc;
  color: #9d7fbd;
}
.export-icon.json {
  background: #edf7f1;
  color: #7da68c;
}
.export-option > span:nth-child(2) {
  flex: 1;
}
.export-option strong {
  display: block;
  font-size: 13px;
}
.export-option small {
  display: block;
  font-size: 10px;
  color: #99a3b4;
  margin-top: 7px;
  line-height: 1.6;
}
.export-option > svg {
  color: #a5aebc;
}
.suggestions {
  margin-top: 25px;
}
.suggestions-title {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.suggestions-title button {
  color: var(--accent);
  font-size: 10px;
}
.suggestion {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.suggestion > strong {
  display: block;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
}
.suggestion > svg {
  color: #a6b0be;
  margin: 5px 0;
}
.suggestion p,
.ai-notes {
  font-size: 10px;
  line-height: 1.8;
  color: #8d99ab;
  margin: 9px 0;
}
.suggestion > div {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.small-btn {
  font-size: 9px;
  padding: 6px 8px;
}
.validation-notes {
  background: #fff8e9;
  border-radius: 7px;
  padding: 13px;
  margin-top: 20px;
}
.validation-notes h4 {
  font-size: 10px;
  color: #aa8b46;
}
.validation-notes p {
  font-size: 10px;
  line-height: 1.7;
  color: #ab9973;
  margin-top: 9px;
}
.error-banner {
  background: #fff1ef;
  border-bottom: 1px solid #f2d8d4;
  color: #ba6962;
  font-size: 12px;
  padding: 13px 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-wrap: anywhere;
}
.error-banner button {
  margin-left: auto;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e51;
  color: #fff;
  padding: 13px 19px;
  border-radius: 9px;
  box-shadow: 0 8px 30px #1d2c4433;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  z-index: 110;
  max-width: 90vw;
}
.toast svg {
  color: #94d0b9;
}
.junction-content {
  max-width: 750px;
}
.junction-content > .field-label {
  max-width: 300px;
}
.branch-list {
  margin-top: 25px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.branch-row {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.branch-row:last-child {
  border: 0;
}
.branch-row > svg {
  color: #7ba493;
}
.branch-row > div {
  flex: 1;
}
.branch-row strong {
  font-size: 11px;
  font-weight: 500;
}
.branch-row small {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  color: #99a5b5;
}
.draft-review {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.draft-review p {
  font-size: 12px;
  line-height: 1.8;
  color: #8d99ab;
  margin: 10px 0 20px;
}
.draft-review h4 {
  font-size: 12px;
  margin: 16px 0;
}
.draft-pin {
  display: grid;
  grid-template-columns: 60px 1fr 180px;
  gap: 12px;
  padding: 11px;
  background: #f8f9fc;
  margin: 3px 0;
  font-size: 11px;
}
.draft-pin span {
  color: #8c99ab;
}
.draft-review details {
  margin: 20px 0;
  font-size: 11px;
  color: #929dad;
}
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 240px;
  color: #9eaabb;
  font-size: 12px;
  padding: 30px;
}
.empty.small {
  min-height: 90px;
  font-size: 11px;
}
.empty.large {
  flex-direction: column;
  min-height: 380px;
  text-align: center;
}
.empty.large h2 {
  color: #53647c;
}
.empty.large p {
  line-height: 1.8;
}
.loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  color: #8c80cb;
}
.loading p {
  color: #95a1b2;
}
.muted {
  color: #9eabba;
}
.error {
  color: #b46969 !important;
}
.sidebar-empty {
  font-size: 11px;
  line-height: 1.8;
  color: #9ca7b5;
  padding: 14px;
}
.spin {
  animation: spin 1.4s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1550px) {
  .body-layout {
    grid-template-columns: 252px minmax(600px, 1fr) 310px;
  }
  .workspace-label {
    width: 252px;
    min-width: 252px;
  }
  .main-panel {
    padding: 40px;
  }
  .pin-header,
  .pin-row {
    grid-template-columns:
      50px minmax(160px, 1fr) minmax(160px, 1.2fr)
      70px 45px;
  }
  .pin-row {
    min-height: 74px;
  }
  .pin-function strong {
    font-size: 12px;
  }
  .destination {
    font-size: 11px;
  }
  .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1180px) {
  .body-layout {
    grid-template-columns: 210px minmax(470px, 1fr) 250px;
  }
  .sidebar {
    padding-left: 8px;
    padding-right: 8px;
  }
  .workspace-label {
    width: 210px;
    min-width: 210px;
    font-size: 8px;
    padding-left: 20px;
  }
  .main-panel {
    padding: 28px 20px;
  }
  .inspector {
    padding: 23px 16px;
  }
  .topbar {
    padding: 0 18px;
    gap: 14px;
  }
  .top-actions {
    gap: 6px;
  }
  .project-select select {
    max-width: 200px;
  }
  .save-status {
    font-size: 10px;
  }
  .workspace-right {
    display: none;
  }
  .summary-strip .strip-end {
    display: none;
  }
  .pin-header,
  .pin-row {
    grid-template-columns:
      28px minmax(95px, 1fr) minmax(105px, 1.1fr)
      40px 28px;
    gap: 6px;
    padding: 0 10px;
  }
  .page-heading .button {
    font-size: 10px;
    padding: 8px;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .device-progress {
    display: none;
  }
  .diagram-tools > span {
    max-width: 220px;
    line-height: 1.6;
  }
}
@media (max-width: 980px) {
  .body-layout {
    grid-template-columns: 190px minmax(440px, 1fr);
  }
  .inspector {
    grid-column: 2;
    border-top: 1px solid var(--border);
    border-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .inspector-heading {
    grid-column: 1/-1;
    margin: 0;
  }
  .sidebar {
    grid-row: 1/3;
  }
  .workspace-label {
    width: 190px;
    min-width: 190px;
  }
  .save-status {
    display: none;
  }
  .workspace-tabs {
    gap: 22px;
  }
  .component-detail {
    grid-template-columns: 1fr 1fr;
  }
  .library-grid {
    gap: 12px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .inspector .ai-card {
    align-self: start;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: 70px;
    flex-wrap: wrap;
    padding: 12px 15px;
    gap: 10px;
  }
  .brand {
    font-size: 23px;
  }
  .brand-symbol {
    width: 29px;
    height: 29px;
  }
  .project-select {
    margin-left: auto;
    gap: 4px;
  }
  .project-select select {
    max-width: 210px;
  }
  .top-separator {
    display: none;
  }
  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .workspace-tabs {
    padding: 0 14px;
    gap: 22px;
  }
  .workspace-label,
  .workspace-tabs .tiny-tag,
  .tab-count {
    display: none;
  }
  .workspace-tabs > button {
    font-size: 11px;
  }
  .body-layout {
    display: flex;
    flex-direction: column;
  }
  .sidebar {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .sidebar-heading {
    margin-bottom: 6px;
  }
  .device-list {
    flex-direction: row;
    overflow: auto;
  }
  .device-item {
    min-width: 170px;
    width: 170px;
  }
  .add-component {
    margin: 10px 0 0;
  }
  .splice-heading,
  .splice-item,
  .sidebar-bottom {
    display: none;
  }
  .main-panel {
    padding: 25px 15px;
  }
  .inspector {
    display: block;
    border-left: 0;
    padding: 20px;
  }
  .inspector-intro {
    display: none;
  }
  .page-heading {
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .summary-strip {
    gap: 16px;
  }
  .pin-header,
  .pin-row {
    grid-template-columns:
      27px minmax(80px, 1fr) minmax(110px, 1.2fr)
      30px 25px;
    gap: 5px;
    padding: 0 8px;
  }
  .pin-function strong {
    font-size: 10px;
  }
  .pin-function small {
    font-size: 8px;
  }
  .wire-cell {
    gap: 3px;
    font-size: 9px;
  }
  .wire-swatch {
    width: 8px;
  }
  .destination {
    font-size: 9px;
  }
  .destination small {
    font-size: 8px;
  }
  .connect-button {
    font-size: 9px;
  }
  .connector-part {
    max-width: 150px;
    text-align: right;
  }
  .worksheet-tools {
    gap: 8px;
  }
  .worksheet-tools select {
    max-width: 145px;
  }
  .library-grid {
    grid-template-columns: 1fr 1fr;
  }
  .component-card {
    padding: 15px 12px;
  }
  .component-card h3 {
    font-size: 13px;
  }
  .card-meta {
    gap: 4px;
    font-size: 8px;
  }
  .overlay {
    padding: 14px;
  }
  .modal {
    padding: 20px;
    max-height: 94vh;
  }
  .modal-title h2 {
    font-size: 19px;
  }
  .component-detail {
    display: block;
  }
  .component-schematic {
    margin-top: 25px;
  }
  .draft-pin {
    grid-template-columns: 35px 1fr;
  }
  .draft-pin > span {
    grid-column: 2;
  }
  .diagram-scroll {
    min-height: 320px;
  }
  .diagram-tools {
    flex-wrap: wrap;
  }
  .diagram-caption {
    flex-wrap: wrap;
  }
  .diagram-caption span {
    margin-left: 0;
  }
  .branch-row {
    padding: 13px;
    flex-wrap: wrap;
  }
  .remove-device {
    gap: 12px;
  }
  .workspace-tabs > button {
    gap: 5px;
  }
  .library-toolbar .segmented {
    width: 100%;
    justify-content: space-between;
  }
  .inspector-heading {
    margin-bottom: 16px;
  }
  .wire-inspector {
    max-width: 450px;
  }
  .ai-card {
    max-width: 450px;
  }
  .toast {
    font-size: 11px;
  }
}
@media (min-width: 981px) {
  .body-layout.diagram-mode {
    grid-template-columns: 234px minmax(0, 1fr);
  }
  .diagram-mode > .inspector {
    display: none;
  }
  .diagram-mode .diagram-scroll {
    min-height: 560px;
  }
}

.project-source-note {
  margin: 14px 24px;
  padding: 12px 16px;
  background: #fff8e7;
  color: #665127;
  border: 1px solid #eadbb8;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* The closed inspector retains selection and AI state without occupying space. */
.body-layout.inspector-closed > .inspector {
  display: none;
}
.workspace-tabs > .reopen-inspector {
  margin-left: auto;
}
@media (min-width: 981px) {
  .body-layout.inspector-closed {
    grid-template-columns: 234px minmax(0, 1fr);
  }
}
@media (min-width: 981px) and (max-width: 1180px) {
  .body-layout.inspector-closed {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}

/* Project pages and continuous worksheet */
.projects-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 17px;
}
.project-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}
.project-card .card-top {
  width: 100%;
  color: #a0a8b7;
}
.project-card:hover {
  border-color: #bcb1e7;
  background: #fdfcff;
}
.project-card h2 {
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}
.project-card .project-description {
  color: #8a94a5;
  font-size: 12px;
  line-height: 1.7;
  margin: 8px 0 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-footer {
  margin-top: auto;
  width: 100%;
  color: #929caf;
  font-size: 10px;
  gap: 10px;
}
.project-card-footer > span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8172b9;
  white-space: nowrap;
}
.meta-separator {
  margin: 0 7px;
}
.worksheet-section {
  scroll-margin-top: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 34px;
  margin-bottom: 34px;
}
.body-layout > .sidebar {
  position: sticky;
  top: 0;
  height: auto;
  min-height: 0;
  max-height: 100dvh;
  overflow-y: auto;
  align-self: start;
  z-index: 5;
}
.body-layout > .sidebar > * {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .body-layout > .sidebar {
    align-self: stretch;
    max-height: 32dvh;
  }
}
.body-layout > .inspector {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}
.body-layout .main-panel {
  min-width: 0;
}
.usage-note {
  font-size: 12px;
  color: #57745b !important;
}
/* A compact chat composer with removable skills. */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: min(620px, calc(100vh - 240px));
  position: relative;
}
.chat-messages {
  flex: 1;
  padding: 12px 0;
}
.chat-message {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.chat-message.user {
  background: #f2f1f8;
  border-radius: 14px;
  padding: 10px 14px;
  margin-left: 24px;
}
.chat-message p {
  margin: 0 0 8px;
}
.chat-message p:last-child {
  margin-bottom: 0;
}
.chat-message pre {
  overflow: auto;
}
.chat-thinking {
  color: #9297a5;
  font-size: 12px;
}
.chat-composer {
  border: 1px solid #e1e2e8;
  border-radius: 16px;
  background: white;
  padding: 10px;
  box-shadow: 0 2px 8px #20243d05;
}
.chat-composer:focus-within {
  border-color: #b0a6df;
}
.chat-composer textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
  min-height: 54px;
  max-height: 180px;
  padding: 8px 5px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: none;
}
.chat-composer textarea:focus {
  outline: 0;
  box-shadow: none;
}
.chat-composer-actions {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-top: 6px;
}
.chat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #777887;
  background: transparent;
  cursor: pointer;
}
.chat-icon:hover {
  background: #f0eff7;
  color: #6654b8;
}
.chat-icon:disabled {
  opacity: 0.4;
  cursor: default;
}
.chat-send {
  margin-left: auto;
  background: #7560c7;
  color: white;
  border-radius: 50%;
}
.chat-send:hover {
  background: #6654b8;
  color: white;
}
.chat-new {
  align-self: flex-end;
}
.chat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 3px 6px;
}
.chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border-radius: 7px;
  background: #f0edf9;
  color: #705cb4;
  font-size: 11px;
  line-height: 1.5;
  padding: 4px 6px 4px 8px;
  overflow-wrap: anywhere;
}
.chat-pill button {
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 2px;
  cursor: pointer;
}
.chat-pill button:hover {
  background: #dfd8f3;
}
.chat-pill.attachment {
  background: #f2f3f5;
  color: #666b78;
}
.chat-pill.attachment > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-skill-picker {
  position: relative;
}
.skill-menu-dismiss {
  position: fixed;
  inset: 0;
  border: 0;
  background: transparent;
  z-index: 49;
  cursor: default;
}
.chat-skill-menu {
  position: absolute;
  bottom: 38px;
  left: 0;
  width: 170px;
  padding: 5px;
  border: 1px solid #e6e4ed;
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 25px #20243d15;
  z-index: 50;
}
.chat-skill-menu > button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  font-size: 12px;
  background: transparent;
  color: #474454;
  cursor: pointer;
}
.chat-skill-menu > button:hover {
  background: #f3f0fb;
}
.chat-skill-menu > button:disabled {
  opacity: 0.4;
  cursor: default;
}
.version-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}
.version-controls input {
  flex: 1;
  min-width: 200px;
}
.version-controls select {
  max-width: 100%;
}
.diff-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2px;
}
.diff-labels {
  padding: 12px;
  background: #eef0f5;
}
.json-diff section {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.json-diff section > code {
  display: block;
  padding: 12px;
  background: #f5f6fa;
}
.json-diff pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.json-diff .removed {
  background: #fff0f0;
  color: #872e3a;
}
.json-diff .added {
  background: #ebf8ee;
  color: #245b38;
}
.pinned-components {
  margin: 24px 0;
}
.pinned-components > div {
  display: flex;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 981px) {
  .body-layout {
    grid-template-columns: 220px minmax(0, 1fr) 340px;
  }
  .body-layout.no-index {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .body-layout.inspector-closed {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .body-layout.no-index.inspector-closed {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-tabs {
    flex-wrap: wrap;
    height: auto;
    min-height: 54px;
  }
  .workspace-label {
    display: none;
  }
}
@media (max-width: 980px) {
  .body-layout > .inspector {
    position: static;
    max-height: none;
  }
}
@media (max-width: 980px) {
  .body-layout.no-index {
    grid-template-columns: minmax(0, 1fr);
  }
  .body-layout > .inspector {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 100%);
    max-height: 100%;
    background: white;
    z-index: 40;
    box-shadow: -8px 0 30px #17243d20;
    overflow: auto;
    padding: 22px;
    box-sizing: border-box;
  }
  .workspace-tabs {
    flex-wrap: wrap;
    height: auto;
    min-height: 54px;
  }
  .workspace-label,
  .workspace-right {
    display: none;
  }
}
@media (max-width: 980px) {
  .body-layout > .inspector {
    display: block;
    height: 100%;
  }
  .body-layout > .inspector[hidden] {
    display: none;
  }
  .inspector-heading {
    margin-bottom: 24px;
  }
}
.body-layout > .inspector {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
}
.chat-panel {
  flex: 1;
  min-height: 260px;
}
.chat-messages {
  min-height: 0;
  overflow-y: auto;
}
.chat-composer {
  flex-shrink: 0;
}
@media (max-width: 980px) {
  .body-layout > .inspector {
    height: 100%;
  }
}

/* Keep workspace chrome in place; each pane owns its scroll position. */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.app-shell > .topbar,
.app-shell > .workspace-tabs,
.app-shell > .error-banner {
  flex-shrink: 0;
}
.app-shell > .body-layout {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr);
}
.body-layout > .main-panel {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}
.body-layout > .sidebar {
  position: static;
  grid-row: auto;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 981px) {
  .body-layout > .inspector {
    position: static;
    height: 100%;
    max-height: 100%;
    overscroll-behavior: contain;
  }
}
@media (max-width: 700px) {
  .body-layout > .sidebar {
    flex: 0 0 auto;
    height: auto;
    max-height: 25%;
  }
  .body-layout > .main-panel {
    flex: 1;
    height: auto;
  }
}

.login-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.login-card {
  width: 100%;
  max-width: 390px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
}
.login-card .library-icon {
  margin-bottom: 26px;
}
.login-card h1 {
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  letter-spacing: -0.8px;
  margin: 10px 0;
}
.login-card > p {
  color: #939dad;
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 28px;
}
.login-card input {
  width: 100%;
  margin: 0 0 18px;
  padding: 12px;
}
.login-card .field-label {
  margin-bottom: 8px;
}
.login-card #login-error {
  color: #b04d5c;
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 16px;
}
.login-card .button {
  min-height: 42px;
  justify-content: space-between;
}

.workspace-tabs {
  padding-left: 27px;
}
@media (max-width: 1180px) {
  .workspace-tabs {
    padding-left: 18px;
  }
}
@media (max-width: 700px) {
  .workspace-tabs {
    padding-left: 14px;
  }
}

.project-breadcrumb {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  flex: 1;
  margin-left: 8px;
}
.project-breadcrumb > button {
  flex-shrink: 0;
  padding: 8px 0;
  color: #8a94a5;
}
.project-breadcrumb > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #536075;
}
.breadcrumb-divider {
  color: #cbd0da;
  font-size: 17px;
}
.topbar > .brand,
.topbar > .top-actions {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .project-breadcrumb {
    gap: 10px;
    margin-left: 0;
  }
}

/* Shared workspace surfaces for the library, settings and history. */
.component-library-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 16px;
}
.library-component-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 12px;
  padding: 20px;
  border-radius: 12px;
}
.library-component-card .card-top {
  display: contents;
}
.library-component-card .library-icon {
  grid-column: 1;
  grid-row: 1;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.library-component-card .origin-badge {
  grid-column: 3;
  grid-row: 1;
  margin-top: 3px;
  font-size: 9px;
}
.component-card-title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.library-component-card h3 {
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.library-component-card .component-card-title p {
  font-size: 11px;
  margin-top: 3px;
}
.library-component-card .card-meta {
  grid-column: 1 / -1;
  margin: 20px 0 12px;
  font-size: 11px;
  color: #7b879b;
  gap: 8px;
}
.library-component-card .usage-note {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 0 0 18px;
  padding: 4px 8px;
  background: #f2f5f8;
  border-radius: 5px;
  color: #65758a !important;
  font-size: 10px;
}
.library-component-card .card-actions {
  grid-column: 1 / -1;
  padding-top: 12px;
}
.library-component-card .card-actions > button:first-child {
  color: #6c7890;
  font-size: 11px;
  padding: 8px 0;
}
.library-component-card .card-actions .button {
  font-size: 11px;
}
.overview-page,
.versions-page {
  max-width: 1120px;
  margin: 0 auto;
}
.settings-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.settings-card h2,
.diff-heading h2 {
  font-size: 16px;
  letter-spacing: -0.3px;
}
.project-details-form {
  display: grid;
  gap: 20px;
}
.project-details-form .field-label {
  display: grid;
  gap: 9px;
  color: #67758b;
  font-size: 12px;
  font-weight: 500;
}
.project-details-form input,
.project-details-form textarea,
.version-controls input,
.version-controls select {
  width: 100%;
  border: 1px solid #dce2ed;
  border-radius: 8px;
  background: #fff;
  padding: 11px 13px;
  color: var(--ink);
  line-height: 1.5;
  font-size: 13px;
}
.project-details-form textarea {
  resize: none;
  min-height: 110px;
}
.settings-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.settings-card-heading p {
  color: #8591a5;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 7px;
  max-width: 520px;
}
.settings-card-heading > .button {
  flex-shrink: 0;
}
.pinned-components {
  margin: 24px -24px -24px;
}
.pinned-components > div {
  align-items: center;
  gap: 16px;
  padding: 17px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}
.pinned-components strong {
  font-size: 12px;
  font-weight: 600;
}
.pinned-components span {
  color: #7e8aa0;
  font-size: 11px;
  background: #f5f6fa;
  padding: 5px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.version-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 28px;
  margin-top: 0;
}
.version-controls label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
.version-controls input {
  min-width: 0;
}
.commit-form {
  border-left: 1px solid var(--border);
  padding-left: 28px;
}
.commit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.diff-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 16px;
}
.diff-heading > span {
  color: #8b96a8;
  font-size: 12px;
}
.diff-labels {
  background: #edf0f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 11px;
  color: #78859a;
}
.diff-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 230px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #67a693;
}
.diff-empty h3 {
  color: var(--ink);
  font-size: 15px;
}
.diff-empty p {
  color: #8b96a8;
  font-size: 12px;
}
.json-diff section > code {
  font-size: 11px;
  color: #738097;
}
@media (max-width: 700px) {
  .settings-card {
    padding: 18px;
  }
  .settings-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .pinned-components {
    margin: 20px -18px -18px;
  }
  .pinned-components > div {
    padding: 15px 18px;
    flex-wrap: wrap;
  }
  .version-controls {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .commit-form {
    padding-left: 0;
    border-left: 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }
}

/* Keep dropdown text and chevrons comfortably inside the field. */
.app-shell select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b879b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  text-overflow: ellipsis;
}

.project-index .device-item {
  min-height: 48px;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
}
.project-section {
  scroll-margin-top: 24px;
}
.project-versions-section {
  padding-top: 24px;
  margin-bottom: 36px;
  border-top: 1px solid var(--border);
}
.project-versions-section .page-heading h1 {
  font-size: 22px;
}
.transfer-section > p {
  margin-top: 10px;
  color: #8591a5;
  font-size: 12px;
  line-height: 1.7;
  max-width: 560px;
}
.transfer-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.project-details-form .field-label {
  margin: 0;
}
.overview-page .version-controls {
  grid-template-columns: 1fr;
  gap: 22px;
}
.overview-page .commit-form {
  border-left: 0;
  padding-left: 0;
  border-top: 1px solid var(--border);
  padding-top: 22px;
}

.assistant-mode:not([hidden]) {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.assistant-mode[hidden] {
  display: none;
}

.destination-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.destination-name > svg {
  color: #8d98ac;
}

.component-page {
  max-width: 1200px;
  margin: 0 auto;
}
.component-back {
  display: inline-flex;
  padding: 4px 0;
  margin-bottom: 26px;
  color: #7b879b;
  font-size: 12px;
}
.component-page-heading {
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.component-page-heading > .button {
  flex-shrink: 0;
  margin-top: 20px;
}
.component-page-heading p {
  max-width: 660px;
  line-height: 1.7;
}
.component-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  color: #7b879b;
  font-size: 11px;
}
.component-page .component-detail {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}
.component-definition-column {
  min-width: 0;
}
.component-definition-card,
.component-page .source-block,
.component-page .component-schematic,
.component-history {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.component-page h3 {
  font-size: 15px;
  letter-spacing: -0.2px;
}
.component-page .component-pins {
  margin: 20px 0 0;
  border-radius: 8px;
}
.component-page .component-pins h4 {
  padding: 14px;
  font-size: 12px;
}
.component-page .component-pins h4 small {
  line-height: 1.6;
  font-size: 10px;
}
.component-page .component-pins > div {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  padding: 14px;
  font-size: 11px;
  align-items: center;
}
.component-page .component-pins > div > small {
  font-size: 10px;
}
.component-page .source-block {
  margin: 20px 0 0;
  font-size: 12px;
}
.component-page .source-block > strong {
  color: var(--ink);
  font-weight: 600;
}
.component-page .source-block p {
  margin: 8px 0 0;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.component-page .component-schematic p {
  font-size: 11px;
  line-height: 1.7;
  margin: 10px 0 18px;
}
.component-page .component-schematic .diagram-scroll {
  min-height: 280px;
}
.component-history {
  margin-top: 24px;
}
.component-history summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}
.component-history summary > span {
  font-size: 11px;
  font-weight: 400;
  color: #8a95a7;
  margin-left: 14px;
}
.component-history[open] summary {
  margin-bottom: 20px;
}
.component-history select {
  width: 100%;
}
@media (max-width: 980px) {
  .component-page .component-detail {
    grid-template-columns: 1fr;
  }
  .component-page .component-schematic {
    display: block;
  }
}
@media (max-width: 600px) {
  .component-page-heading {
    flex-direction: column;
    gap: 0;
  }
  .component-history summary > span {
    display: block;
    margin: 8px 0 0 16px;
  }
}

.chat-draft {
  margin-top: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}
.chat-draft-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 11px;
}
.chat-draft h3 {
  margin: 12px 0 8px;
  font-size: 17px;
}
.chat-draft p {
  color: #7f8d9c;
  font-size: 12px;
  line-height: 1.6;
}
.chat-draft-connector {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}
.chat-draft-connector summary {
  padding: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.chat-draft-connector summary span {
  float: right;
  color: #7f8d9c;
  font-weight: 400;
}
.chat-draft-pins {
  max-height: 260px;
  overflow: auto;
}
.chat-draft-pin {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
}
.chat-draft-pin code {
  flex: 0 0 26px;
  overflow-wrap: anywhere;
}
.chat-draft-pin strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.chat-draft-pin small {
  display: block;
  margin-top: 4px;
  color: #7f8d9c;
}
.chat-draft-json {
  margin: 14px 0;
  font-size: 11px;
}
.chat-draft-json summary {
  cursor: pointer;
  color: #7f8d9c;
}
.chat-draft-json pre {
  max-height: 220px;
  overflow: auto;
  font-size: 10px;
}
.chat-draft .button {
  width: 100%;
  justify-content: center;
}
.chat-draft .chat-draft-status {
  margin-bottom: 0;
  color: #4b9f87;
}

.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-toolbar .chat-new {
  margin: 0 0 0 auto;
}
.chat-messages[hidden] {
  display: none;
}
.assistant-functions {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 2px 16px;
}
.assistant-help-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.assistant-help-heading h3 {
  font-size: 16px;
  margin: 0;
}
.assistant-functions > p {
  font-size: 12px;
  line-height: 1.6;
}
.assistant-functions article {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.assistant-functions code {
  color: var(--accent);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.assistant-functions article p {
  margin: 9px 0 0;
  line-height: 1.7;
  font-size: 12px;
  color: #64748b;
}

.assistant-header-actions:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.assistant-header-actions[hidden] {
  display: none;
}
.assistant-header-actions:not([hidden]) + .icon-button {
  margin-left: 0;
}
.chat-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  padding: 6px 3px;
  white-space: nowrap;
  cursor: pointer;
}
.chat-clear:disabled {
  opacity: 0.5;
  cursor: default;
}
.chat-clear-confirm {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  background: white;
}
.chat-clear-confirm p {
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 10px;
}
.chat-clear-confirm > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-clear-confirm .button {
  font-size: 10px;
  padding: 7px 9px;
}
.chat-clear-undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 12px;
  color: var(--muted);
}

/* Shared wire/assistant pane width, constrained by the available workspace. */
@media (min-width: 981px) {
  .body-layout:not(.inspector-closed) {
    grid-template-columns: 220px minmax(0, 1fr) var(--drawer-width, 380px);
  }
  .body-layout.no-index:not(.inspector-closed) {
    grid-template-columns: minmax(0, 1fr) var(--drawer-width, 380px);
  }
}
.body-layout > .inspector {
  width: var(--drawer-width, 380px);
  max-width: 100%;
  box-sizing: border-box;
}
.drawer-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(var(--drawer-width, 380px) - 4px);
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  z-index: 30;
}
.drawer-resize::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
}
.drawer-resize:hover::after,
.drawer-resize:focus-visible::after,
.drawer-resize.dragging::after {
  background: var(--accent);
}
.drawer-resize:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.drawer-resize {
  z-index: 41;
}
.wire-review-list {
  max-height: 300px;
  overflow: auto;
}
.wire-review-item {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.wire-review-item > small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin-top: 4px;
}
.wire-review-item p {
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.wire-review-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* Keep the AI toggle anchored at the right edge in both states. */
.workspace-tabs {
  position: relative;
  padding-right: 104px;
}
.workspace-tabs.ai-open {
  padding-right: 238px;
}
.ai-tab-controls {
  position: absolute;
  right: 18px;
  top: 0;
  bottom: 1px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
  background: transparent;
}
.ai-tab-toggle {
  order: 2;
  width: 62px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #67738a;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}
.ai-tab-toggle:hover {
  background: #f5f3ff;
  border-color: #d7d0fa;
}
.ai-tab-toggle.is-open {
  color: var(--accent);
  background: #f0edff;
  border-color: #dcd5fc;
}
.ai-tab-controls .assistant-header-actions {
  margin: 0;
  gap: 9px;
}
.ai-tab-controls .chat-clear {
  color: #778298;
}
.inspector-heading[hidden] {
  display: none;
}
@media (max-width: 700px) {
  .ai-tab-controls {
    right: 10px;
    gap: 8px;
  }
  .workspace-tabs {
    padding-right: 84px;
  }
  .workspace-tabs.ai-open {
    padding-right: 214px;
  }
}

.assistant-panel-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: -8px 0 8px;
}
.assistant-options {
  position: relative;
}
.conversation-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 174px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 24px #25344b14;
  z-index: 52;
}
.conversation-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.conversation-menu button:hover {
  background: #f5f3ff;
}
.conversation-menu button:disabled {
  color: var(--muted);
  opacity: 0.6;
  cursor: default;
}
.conversation-menu-dismiss {
  position: fixed;
  inset: 0;
  border: 0;
  background: transparent;
  z-index: 51;
  cursor: default;
}
.workspace-tabs.ai-open {
  padding-right: 104px;
}
@media (max-width: 700px) {
  .workspace-tabs.ai-open {
    padding-right: 84px;
  }
}

.skill-prompt-settings {
  padding: 8px 14px;
}
.skill-prompt-settings textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 120px;
  margin: 8px 0;
}

.skill-prompt-settings select {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
}
