.demo { padding-top: 40px; padding-bottom: 56px; }
.demo-head { margin-bottom: 28px; }
.demo-head h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); }
.banner { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; padding: 12px 16px; font-size: .92rem; color: var(--ink-2); max-width: 52rem; }
.demo-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1040px) { .demo-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
.steps { display: grid; gap: 20px; min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.panel h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel h3.sub { font: 600 .82rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.sticky { position: sticky; top: 80px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 600 .82rem/1 var(--sans); flex: none; }
.count { font: 600 .78rem/1 var(--sans); background: var(--brand-soft); color: var(--brand); padding: 5px 8px; border-radius: 999px; }
.fields { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
label, fieldset { display: grid; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--ink-2); min-width: 0; }
label small, legend small { font-weight: 400; color: var(--muted); }
label.full, fieldset.full { margin-top: 14px; }
fieldset { border: 0; padding: 0; margin-inline: 0; }
legend { padding: 0; margin-bottom: 8px; }
input, select, textarea {
  font: 400 .95rem/1.4 var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 50%, transparent); border-color: var(--brand); }
.type-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--ink-2); font-size: .92rem; }
.counter { font-size: .8rem; color: var(--muted); font-weight: 400; }
.checks-grid { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .checks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.checks-grid label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.checks-grid input { width: auto; margin-top: 4px; }
.checks-grid code { font-size: .78rem; color: var(--muted); }
.btn-row.tight { margin-top: 10px; }
.btn-row.end { justify-content: flex-end; margin-top: 20px; }
.btn.file { cursor: pointer; }
.small { font-size: .88rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); background: var(--bg); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.has-err td:first-child { box-shadow: inset 3px 0 0 var(--err); }
tbody tr.has-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
td .act { display: flex; gap: 6px; justify-content: flex-end; }
td .act button { background: none; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: .8rem; color: var(--ink-2); cursor: pointer; }
td .act button:hover { border-color: var(--brand); color: var(--brand); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: .92rem; }
.empty[hidden] { display: none; }

.summary { margin-top: 18px; font-size: .92rem; }
.summary .big { font: 600 1.05rem var(--sans); display: block; margin-bottom: 4px; }
.summary.ok .big { color: var(--ok); } .summary.bad .big { color: var(--err); } .summary.warn .big { color: var(--warn); }
.issues { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.issues li { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 9px 11px; font-size: .85rem; background: var(--bg); }
.issues li.block { border-left-color: var(--err); }
.issues li.warn { border-left-color: var(--warn); }
.issues li .where { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.issues li .fix { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 3px 10px; font: 600 .78rem var(--sans); color: var(--brand); cursor: pointer; }
.issues li .fix:hover { border-color: var(--brand); }
.sample-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--brand-soft); color: var(--ink-2); font-size: .85rem; }
.issues li b { font-weight: 600; }

#output { margin-top: 20px; }
pre.xml { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 16px 18px; overflow: auto; max-height: 70vh; font-size: .8rem; line-height: 1.6; margin: 10px 0 0; }

dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--card); color: var(--ink); width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 16, 13, .5); }
dialog form { padding: 24px; }
dialog h2 { font-size: 1.4rem; }
[data-for][hidden], [data-cp][hidden] { display: none !important; }
