.graph-workspace {
  max-width: 1800px;
  margin: auto;
  padding: 2rem;
}
.graph-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}
.graph-heading h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin: 0.3rem 0 0.8rem;
  letter-spacing: -0.035em;
}
.graph-heading p {
  max-width: 52rem;
  margin: 0.4rem 0;
}
.graph-heading > a {
  white-space: nowrap;
  font-size: 0.9rem;
}
.eyebrow {
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.graph-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.graph-sidebar,
.graph-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.graph-panel {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-0);
  padding: 1.25rem;
  min-width: 0;
}
.graph-panel h2 {
  font-size: 1.1rem;
  margin: 0 0 0.8rem;
}
.graph-panel h3 {
  font-size: 1rem;
}
.graph-panel label:not(.graph-check) {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.graph-sidebar select,
.graph-sidebar input:not([type='checkbox']),
.graph-sidebar textarea,
.graph-sidebar .bw-select,
.graph-sidebar #save {
  width: 100%;
}
.graph-sidebar textarea {
  padding: 0.75rem;
  resize: vertical;
}
.graph-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
}
.graph-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-loom-600);
}
.graph-panel .hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0.65rem 0;
}
.text-button {
  background: none;
  padding: 0.2rem 0;
  border: none;
  color: var(--color-loom-700);
  text-decoration: underline;
}
.graph-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2rem;
}
.graph-status p {
  margin: 0;
}
.graph-status [data-error='true'] {
  color: var(--color-error);
}
.graph-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.graph-toolbar h2 {
  margin: 0;
}
.graph-actions,
.graph-expansion {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
}
.graph-actions .bw-select {
  min-width: 10rem;
}
.graph-stage {
  position: relative;
}
#canvas {
  width: 100%;
  height: 600px;
  margin: 1rem 0;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
}
.graph-empty {
  position: absolute;
  top: 43%;
  left: 15%;
  right: 15%;
  text-align: center;
  pointer-events: none;
  color: var(--text-secondary);
}
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--border-default);
  padding-top: 0.8rem;
}
.graph-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}
#node,
.graph-toolbar .bw-select {
  max-width: 100%;
  width: min(26rem, 100%);
}
.graph-toolbar > div {
  min-width: 0;
}
.graph-actions .bw-select {
  width: 11rem;
  max-width: 100%;
}
#selection-description {
  overflow-wrap: anywhere;
}
#record-details {
  margin-top: 1rem;
}
.graph-panel pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 24rem;
  overflow: auto;
  background: var(--surface-1);
  padding: 1rem;
  font: 0.8rem/1.65 var(--font-mono);
}
.graph-records {
  display: grid;
  gap: 0.5rem;
}
.graph-record {
  text-align: left;
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.8rem;
  width: 100%;
}
.graph-record span {
  overflow-wrap: anywhere;
}
.graph-record small {
  display: block;
  color: var(--text-secondary);
}
.graph-record[aria-pressed='true'] {
  border-color: var(--color-loom-600);
  background: var(--surface-2);
}
#inputs p {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
[hidden] {
  display: none !important;
}
@media (max-width: 1150px) {
  .graph-layout {
    grid-template-columns: 245px minmax(0, 1fr);
  }
  .graph-workspace {
    padding: 1.25rem;
  }
  .graph-heading {
    display: block;
  }
}
@media (max-width: 760px) {
  .graph-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .graph-workspace {
    padding: 1rem;
  }
  #canvas {
    height: 440px;
  }
  .graph-panel {
    padding: 1rem;
  }
  .graph-empty {
    top: 45%;
  }
  .graph-record {
    grid-template-columns: 1fr;
  }
  .graph-heading > a {
    white-space: normal;
  }
}
