.ig { --ig-border: 1px solid var(--border-subtle); min-width: 0; }
.ig [hidden] { display: none !important; }
.ig h3,.ig h4,.ig p { margin: 0; }
.ig-topology { display: flex; align-items: center; justify-content: center; gap: clamp(.5rem,2vw,2rem); margin-bottom: 2rem; padding: 1.5rem; border: var(--ig-border); border-radius: 1rem; background: var(--bg-subtle); }
.ig-topology > div { display: grid; grid-template-columns: 1.5rem 1fr; gap: .25rem .75rem; min-width: 0; }
.ig-topology .icon { grid-row: span 2; color: var(--accent-fg); }
.ig-topology span { font-weight: 600; }
.ig-topology small { color: var(--text-secondary); font-size: .75rem; }
.ig-topology__arrow { color: var(--text-muted); }
.ig-workspace { display: grid; grid-template-columns: minmax(280px,.85fr) minmax(0,1.4fr); gap: 1.5rem; align-items: start; }
.ig-config,.ig-sequence,.ig-result { background: var(--surface-default); border: var(--ig-border); border-radius: 1rem; padding: clamp(1rem,2.5vw,2rem); min-width: 0; }
.ig-config { display: grid; gap: 1.1rem; }
.ig-panel-head { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.ig-panel-head h3 { font-size: clamp(1.05rem,2vw,1.25rem); letter-spacing: -.02em; line-height: 1.3; }
.ig-index { display: inline-grid; place-items: center; flex-shrink: 0; width: 2rem; height: 2rem; font: .75rem var(--font-mono); color: var(--accent-fg); background: var(--accent-subtle); border-radius: .5rem; }
.ig-field { display: grid; gap: .45rem; min-width: 0; font-size: .875rem; font-weight: 500; }
.ig-field select { width: 100%; min-height: 2.75rem; min-width: 0; padding: .6rem 2rem .6rem .75rem; border: 1px solid var(--border-control); border-radius: .5rem; background-color: var(--surface-default); color: var(--text-primary); font: inherit; text-overflow: ellipsis; }
.ig fieldset { display: grid; gap: 1rem; padding: 1rem 0 0; margin: 0; min-width: 0; border: 0; border-top: var(--ig-border); }
.ig legend { padding-right: .75rem; color: var(--text-secondary); font-size: .75rem; }
.ig-toggle { display: flex; gap: .75rem; align-items: start; font-size: .875rem; cursor: pointer; }
.ig-toggle input { width: 1.1rem; height: 1.1rem; margin: .15rem 0 0; flex-shrink: 0; accent-color: var(--accent-fg); }
.ig-toggle small { display: block; font-size: .75rem; line-height: 1.5; color: var(--text-secondary); margin-top: .4rem; }
.ig-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.ig .ig-hint { font-size: .8125rem; color: var(--text-secondary); line-height: 1.65; }
.ig-text-button { color: var(--accent-fg); font: inherit; font-size: .8125rem; background: none; border: 0; cursor: pointer; padding: .25rem; text-decoration: underline; text-underline-offset: .25rem; }
.ig-prerequisite { display: grid; gap: .75rem; padding: 1rem; background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: .6rem; }
.ig-prerequisite h4 { font-size: .875rem; }
.ig-prerequisite p { font-size: .8125rem; line-height: 1.65; color: var(--text-secondary); }
.ig-count { font: .75rem var(--font-mono); color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.ig-order { padding: 0; margin: 1.25rem 0; list-style: none; display: grid; gap: .45rem; }
.ig-order__item { display: flex; gap: .65rem; align-items: center; padding: .6rem .75rem; background: var(--bg-subtle); border: 1px solid transparent; border-radius: .6rem; min-width: 0; }
.ig-order__item[draggable=true] { cursor: grab; border-color: var(--border-strong); background: var(--surface-default); }
.ig-order__item[draggable=true]:active { cursor: grabbing; }
.ig-order__item.is-dragging { opacity: .5; }
.ig-order__item.is-target { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.ig-order__number { flex: 0 0 1.4rem; font: .6875rem var(--font-mono); color: var(--text-muted); }
.ig-order__text { flex: 1; min-width: 0; font-size: .8125rem; line-height: 1.4; overflow-wrap: anywhere; }
.ig-order__lock { color: var(--text-muted); font-size: .65rem; max-width: 6rem; overflow-wrap: anywhere; }
.ig-order__controls { display: flex; gap: .2rem; flex-shrink: 0; }
.ig-order__controls button { display: grid; place-items: center; border: var(--ig-border); border-radius: .35rem; background: var(--surface-default); color: var(--text-primary); min-width: 2rem; min-height: 2rem; font: 1rem var(--font-sans); cursor: pointer; }
.ig-order__controls button:disabled { opacity: .3; cursor: default; }
.ig-order__controls button:not(:disabled):hover { border-color: var(--accent-border); color: var(--accent-fg); }
.ig-status { font-size: .8125rem; color: var(--accent-fg); min-height: 1.3em; }
.ig-notes { border-top: var(--ig-border); padding-top: .75rem; }
.ig-notes summary { cursor: pointer; color: var(--text-secondary); font-size: .8125rem; }
.ig-warnings { margin: .5rem 0 0; padding-left: 1rem; font-size: .75rem; line-height: 1.6; color: var(--text-secondary); }
.ig-warnings li + li { margin-top: .4rem; }
.ig-result { margin-top: 1.5rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.ig-empty { padding: 2rem 1rem; text-align: center; color: var(--text-secondary); }
.ig-empty .icon { width: 2rem; height: 2rem; margin-bottom: 1rem; color: var(--accent-fg); }
.ig-empty h4 { font-size: 1rem; color: var(--text-primary); margin-bottom: .5rem; }
.ig-empty p { font-size: .875rem; }
.ig-notice { background: var(--warning-bg); color: var(--warning-fg); border-radius: .5rem; padding: .75rem 1rem; font-size: .8125rem; margin-bottom: 1rem !important; }
.ig-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .5rem 0 1.5rem; }
.ig-toolbar > span { font-size: .8125rem; color: var(--text-secondary); }
.ig-toolbar > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.ig-toolbar .btn { font-size: .75rem; min-height: 2.5rem; padding: .5rem .8rem; }
.ig-instructions { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; counter-reset: guide-step; }
.ig-instruction { border-top: var(--ig-border); padding-top: 1.5rem; min-width: 0; counter-increment: guide-step; }
.ig-instruction__title { display: flex; align-items: start; gap: .75rem; margin-bottom: .6rem !important; font-size: 1rem; }
.ig-instruction__title::before { content: counter(guide-step, decimal-leading-zero); color: var(--accent-fg); font: .75rem var(--font-mono); padding-top: .2rem; }
.ig-instruction p,.ig-instruction li { font-size: .875rem; line-height: 1.7; color: var(--text-secondary); }
.ig-instruction p + p { margin-top: .6rem; }
.ig-instruction ul { padding-left: 1rem; margin: .75rem 0; }
.ig-endpoint { display: flex; align-items: start; gap: .5rem; margin: .75rem 0; font: .75rem var(--font-mono); overflow-wrap: anywhere; }
.ig-endpoint span { flex-shrink: 0; color: var(--accent-fg); font-weight: 600; }
.ig-actor { display: inline-block; margin-bottom: .6rem; font-size: .6875rem; border: var(--ig-border); padding: .2rem .55rem; border-radius: 2rem; color: var(--text-secondary); }
.ig-branch { display: inline-block; margin: 0 0 .6rem .5rem; font-size: .6875rem; padding: .2rem .55rem; border-radius: 2rem; color: var(--warning-fg); background: var(--warning-bg); }
.ig-code { border: var(--ig-border); border-radius: .6rem; overflow: hidden; margin-top: .75rem; min-width: 0; background: var(--code-bg); }
.ig-code summary { cursor: pointer; padding: .8rem 1rem; font-size: .8125rem; font-weight: 500; }
.ig-code__bar { display: flex; align-items: center; gap: 1rem; justify-content: space-between; padding: .6rem 1rem; border-bottom: var(--ig-border); font-size: .75rem; }
.ig-code__bar button { background: transparent; color: var(--accent-fg); border: 0; font: inherit; cursor: pointer; padding: .25rem .4rem; }
.ig-code pre { margin: 0; padding: 1rem; overflow-x: auto; max-height: 32rem; max-width: 100%; white-space: pre; color: var(--code-fg); font: .75rem/1.7 var(--font-mono); tab-size: 2; }
.ig-code pre:focus-visible { outline-offset: -3px; }
.ig :is(button,select,input,summary):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
@media (max-width: 760px) {
  .ig-workspace { grid-template-columns: minmax(0,1fr); }
  .ig-topology { gap: .6rem; padding: 1rem; }
  .ig-topology > div { display: flex; flex-direction: column; font-size: .75rem; }
  .ig-topology small { font-size: .65rem; }
  .ig-order__controls button { min-width: 2.75rem; min-height: 2.75rem; }
}
@media (max-width: 400px) {
  .ig-field-row { grid-template-columns: 1fr; }
  .ig-topology__arrow { display: none; }
  .ig-topology { justify-content: space-between; }
}
