.ll1-demo {
  --ll1-ink: #172033;
  --ll1-muted: #647087;
  --ll1-line: #dbe1ea;
  --ll1-paper: #fff;
  --ll1-canvas: #f5f7fb;
  --ll1-purple: #522d80;
  --ll1-orange: #d95f27;
  --ll1-blue: #1769aa;
  --ll1-green: #18734a;
  --ll1-red: #aa3434;
  color: var(--ll1-ink);
  width: min(1220px, calc(100vw - 32px));
  margin-left: 50%;
  transform: translateX(-50%);
}
.ll1-demo * { box-sizing: border-box; }
.ll1-demo button, .ll1-demo input, .ll1-demo textarea { font: inherit; }
.ll1-demo h2 { margin: 2px 0 0; color: var(--ll1-ink); font-size: 1.08rem; font-style: normal; font-weight: 650; }
.ll1-lead { max-width: 850px; color: #455169; font-size: 1.05rem; }
.ll1-note { margin: 0; color: var(--ll1-muted); font-size: .82rem; line-height: 1.45; }
.ll1-eyebrow { display: block; color: var(--ll1-muted); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }

.ll1-presets { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 10px; }
.ll1-preset, .ll1-button, .ll1-transform, .ll1-tab {
  border: 1px solid #bbc5d4; border-radius: 7px; background: #fff; color: #263248;
  padding: 8px 12px; cursor: pointer; transition: border-color 120ms, background 120ms, transform 120ms;
}
.ll1-preset:hover, .ll1-button:hover:not(:disabled), .ll1-transform:hover:not(:disabled), .ll1-tab:hover { border-color: var(--ll1-purple); background: #f8f4fc; }
.ll1-preset:focus-visible, .ll1-button:focus-visible, .ll1-transform:focus-visible, .ll1-tab:focus-visible, .ll1-demo input:focus-visible, .ll1-demo textarea:focus-visible { outline: 3px solid rgba(23,105,170,.28); outline-offset: 2px; }
.ll1-preset.is-active, .ll1-tab.is-active { border-color: var(--ll1-purple); background: var(--ll1-purple); color: #fff; }
.ll1-button-primary { border-color: var(--ll1-orange); background: var(--ll1-orange); color: #fff; font-weight: 650; }
.ll1-button-primary:hover:not(:disabled) { border-color: #b94718; background: #b94718; }
.ll1-button:disabled, .ll1-transform:disabled { opacity: .42; cursor: not-allowed; }
.ll1-button:active:not(:disabled), .ll1-transform:active:not(:disabled), .ll1-preset:active { transform: translateY(1px); }

.ll1-editor { margin-bottom: 12px; border: 1px solid var(--ll1-line); border-radius: 8px; background: #fff; }
.ll1-editor summary { padding: 10px 13px; color: var(--ll1-purple); font-weight: 700; cursor: pointer; }
.ll1-editor[open] summary { border-bottom: 1px solid var(--ll1-line); }
.ll1-editor-body { padding: 13px; }
.ll1-editor-body > label { display: block; margin: 10px 0 4px; color: var(--ll1-muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ll1-editor textarea, .ll1-editor input { border: 1px solid #aeb9c9; border-radius: 6px; background: #fbfcfe; color: var(--ll1-ink); font: .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ll1-editor textarea { width: 100%; padding: 8px 10px; resize: vertical; }
.ll1-editor input { width: 130px; padding: 7px 9px; }
.ll1-editor-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.ll1-editor-row label { color: var(--ll1-muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ll1-editor-status { min-height: 1.2em; color: var(--ll1-green); font-size: .82rem; }
.ll1-editor-status.is-error { color: var(--ll1-red); }

.ll1-tabs { display: flex; gap: 6px; margin: 18px 0 0; border-bottom: 2px solid var(--ll1-purple); }
.ll1-tab { border-radius: 8px 8px 0 0; border-bottom: 0; }
.ll1-workspace { padding-top: 14px; }
.ll1-pipeline { display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 3px 1px 12px; }
.ll1-pipeline b { color: #9aa4b4; }
.ll1-transform { flex: 1 0 185px; text-align: left; }
.ll1-transform span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 5px; border-radius: 50%; background: #eee8f5; color: var(--ll1-purple); font-size: .74rem; font-weight: 750; }
.ll1-transform.is-done { border-color: #89bda4; background: #eef8f2; color: #185a3c; }
.ll1-transform.is-needed { border-color: #e2a17f; background: #fff7f2; }

.ll1-stepbar { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; min-height: 70px; margin-bottom: 14px; padding: 12px 14px; border-left: 5px solid var(--ll1-blue); border-radius: 6px; background: #edf6fd; }
.ll1-stepbar strong { display: block; line-height: 1.35; }
.ll1-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.ll1-grid-prepare { grid-template-columns: minmax(420px, 1.2fr) minmax(300px, .8fr); align-items: stretch; }
.ll1-grid-analysis { grid-template-columns: minmax(420px, 1.1fr) minmax(340px, .9fr); }
.ll1-grid-runtime { grid-template-columns: 1.25fr .75fr; }
.ll1-card { min-width: 0; border: 1px solid var(--ll1-line); border-radius: 9px; background: var(--ll1-paper); box-shadow: 0 1px 2px rgba(23,32,51,.04); overflow: hidden; }
.ll1-card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 15px 10px; border-bottom: 1px solid #edf0f4; background: #fbfcfe; }
.ll1-chip, .ll1-outcome { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; white-space: nowrap; font-size: .76rem; font-weight: 750; }
.ll1-chip { background: #eee8f5; color: var(--ll1-purple); }
.ll1-grammar { padding: 12px 16px 14px; font: 1.12rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ll1-grammar-compact { font-size: 1.05rem; }
.ll1-production { display: grid; grid-template-columns: 2.1em max-content 1.5em 1fr; gap: 5px; margin: 4px 0; }
.ll1-production .ll1-number { color: var(--ll1-muted); text-align: right; }
.ll1-production .ll1-lhs { color: var(--ll1-purple); font-weight: 750; }
.ll1-production .ll1-arrow { color: var(--ll1-muted); text-align: center; }
.ll1-production.is-source { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d4dae3; }
.ll1-diagnostics { display: grid; gap: 9px; padding: 14px 15px; }
.ll1-diagnostic { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; }
.ll1-diagnostic i { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #e6f4ec; color: var(--ll1-green); font-style: normal; font-size: .72rem; font-weight: 750; }
.ll1-diagnostic.is-warning i { background: #fff0e7; color: #a64418; }
.ll1-diagnostic strong { display: block; font-size: .86rem; }
.ll1-diagnostic small { display: block; margin-top: 2px; color: var(--ll1-muted); line-height: 1.35; }
.ll1-callout { padding: 13px 15px; border-left: 4px solid var(--ll1-purple); background: #f4f0f8; color: #3f3150; font-size: .86rem; line-height: 1.5; }

.ll1-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--ll1-line); border-radius: 9px 9px 0 0; background: var(--ll1-canvas); }
.ll1-controls label { color: var(--ll1-muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ll1-controls input { min-width: 190px; flex: 1 1 240px; max-width: 380px; border: 1px solid #aeb9c9; border-radius: 6px; padding: 8px 10px; background: #fff; color: var(--ll1-ink); font: 1rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ll1-divider { width: 1px; height: 27px; margin: 0 3px; background: var(--ll1-line); }
.ll1-progress-row { display: grid; grid-template-columns: auto auto auto minmax(100px,1fr) auto auto; gap: 9px; align-items: center; padding: 8px 12px; border: 1px solid var(--ll1-line); border-top: 0; background: #fff; }
.ll1-progress-row input { width: 100%; accent-color: var(--ll1-purple); }
.ll1-keyboard-hint, .ll1-step-count { color: var(--ll1-muted); font-size: .76rem; white-space: nowrap; }
.ll1-keyboard-hint kbd { display: inline-block; min-width: 1.7em; padding: 1px 5px; border: 1px solid #c5cdd9; border-bottom-width: 2px; border-radius: 4px; background: #f8f9fb; color: #3b465a; font: 700 .72rem ui-monospace, monospace; text-align: center; }
.ll1-step-count { min-width: 88px; text-align: right; font-variant-numeric: tabular-nums; }
.ll1-now { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 70px; margin: 14px 0; padding: 14px 16px; border-left: 5px solid var(--ll1-blue); border-radius: 6px; background: #edf6fd; }
.ll1-now strong { display: block; line-height: 1.35; }
.ll1-outcome.is-running { background: #d8e9f7; color: #185782; }
.ll1-outcome.is-accepted { background: #d8efe3; color: #12613c; }
.ll1-outcome.is-rejected, .ll1-outcome.is-conflict { background: #f7dddd; color: #8b2828; }

.ll1-table-wrap { max-width: 100%; overflow-x: auto; }
.ll1-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.ll1-table th, .ll1-table td { padding: 8px 10px; border-bottom: 1px solid #e5e9ef; text-align: left; vertical-align: top; }
.ll1-table th { background: #f7f9fc; color: #4c586d; font-size: .92rem; letter-spacing: .04em; }
.ll1-table code { border: 0; padding: 0; background: transparent; color: inherit; font-size: 1rem; }
.ll1-set-new { color: var(--ll1-orange); font-weight: 750; }
.ll1-table-card { margin-bottom: 14px; }
.ll1-table-card .ll1-table td:not(:first-child), .ll1-table-card .ll1-table th:not(:first-child) { text-align: center; }
.ll1-table-cell { min-width: 78px; }
.ll1-table-cell.is-current { background: #fff4ed; box-shadow: inset 0 0 0 2px #e88a5d; }
.ll1-table-cell.is-conflict { background: #fce8e8; color: #852828; font-weight: 700; }
.ll1-conflicts { color: var(--ll1-red); font-size: .78rem; font-weight: 700; }

.ll1-tape { display: flex; gap: 7px; min-height: 88px; padding: 17px; overflow-x: auto; }
.ll1-token { flex: 0 0 auto; min-width: 54px; padding: 8px 10px; border: 2px solid #c9d0dc; border-radius: 7px; background: #fff; font: 700 1rem ui-monospace, monospace; text-align: center; }
.ll1-token.is-consumed { border-color: #a5ceb9; background: #eaf6ef; color: #286046; }
.ll1-token.is-current { border-color: var(--ll1-orange); background: #fff6f0; box-shadow: 0 0 0 3px rgba(217,95,39,.13); }
.ll1-stack { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; min-height: 88px; padding: 18px; }
.ll1-stack-symbol { min-width: 36px; padding: 7px 8px; border: 1px solid #b7c1d0; border-radius: 5px; background: #f8f9fc; font: 700 .98rem ui-monospace, monospace; text-align: center; }
.ll1-stack-symbol:last-child { border-color: var(--ll1-blue); background: #edf5fc; }
.ll1-tree-card { margin-bottom: 14px; }
.ll1-tree { min-height: 220px; padding: 20px 10px 12px; overflow-x: auto; }
.ll1-tree-empty { display: grid; place-items: center; min-height: 160px; color: #929bad; }
.ll1-tree-list { display: flex; justify-content: center; position: relative; min-width: max-content; margin: 0; padding: 20px 0 0; list-style: none; }
.ll1-tree > .ll1-tree-list { padding-top: 0; }
.ll1-tree-item { position: relative; padding: 20px 5px 0; text-align: center; list-style: none; }
.ll1-tree > .ll1-tree-list > .ll1-tree-item { padding-top: 0; }
.ll1-tree-item::before, .ll1-tree-item::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 20px; border-top: 1px solid #aab4c3; }
.ll1-tree-item::after { right: auto; left: 50%; border-left: 1px solid #aab4c3; }
.ll1-tree-item:only-child::before, .ll1-tree-item:only-child::after { display: none; }
.ll1-tree-item:first-child::before, .ll1-tree-item:last-child::after { border: 0; }
.ll1-tree-item:last-child::before { border-right: 1px solid #aab4c3; border-radius: 0 5px 0 0; }
.ll1-tree-list .ll1-tree-list::before { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 1px solid #aab4c3; }
.ll1-tree-node { display: inline-block; padding: 6px 9px; border: 2px solid #aab4c3; border-radius: 7px; background: #fff; font: .9rem/1.2 ui-monospace, monospace; white-space: nowrap; }
.ll1-tree-node.is-nonterminal { border-radius: 999px; border-color: #8f76ad; background: #f5f0fa; color: #47236e; font-weight: 700; }
.ll1-tree-node.is-current { border-color: var(--ll1-orange); background: #fff4ed; }
.ll1-tree-node.is-matched { border-color: #72aa8d; background: #eaf6ef; color: #235b3e; }

@media (max-width: 820px) {
  .ll1-grid-prepare, .ll1-grid-analysis, .ll1-grid-runtime { grid-template-columns: 1fr; }
  .ll1-progress-row { grid-template-columns: auto auto auto 1fr; }
  .ll1-keyboard-hint { display: none; }
  .ll1-step-count { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 560px) {
  .ll1-demo { width: calc(100vw - 18px); }
  .ll1-stepbar { grid-template-columns: 1fr 1fr; }
  .ll1-stepbar > div { grid-column: 1 / -1; grid-row: 1; }
  .ll1-pipeline { display: grid; }
  .ll1-pipeline b { display: none; }
  .ll1-transform { min-width: 0; }
  .ll1-divider { display: none; }
}
