.demo { padding-block: 38px; }
.demo [hidden], dialog [hidden] { display: none; }
.demo-intro { padding: clamp(20px, 5vw, 40px); border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(125deg, #163540, var(--surface) 65%); }
.demo h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin: 8px 0; }
.demo h2, dialog h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.demo h3, dialog h3 { font-size: 1.1rem; }
.demo p, dialog p { color: var(--muted); }
.demo-views { margin-top: 18px; }
button.button { font: inherit; font-weight: 700; cursor: pointer; }
button.secondary { background: transparent; color: var(--ink); }
button.secondary:hover { background: #213c48; }
.demo-views button[aria-pressed="true"] { color: #09231f; background: var(--mint); border-color: var(--mint); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.demo-feedback { margin-block: 16px; }
.demo-feedback:not(:empty) { padding: 10px 14px; border-inline-start: 3px solid var(--mint); background: #143339; color: var(--ink); }
.demo-heading, .demo-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.demo-heading p { margin-top: 6px; }
.demo-filters, .demo-panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-block: 16px; }
.demo label, dialog label { display: grid; gap: 5px; font-size: .9rem; }
.demo input, .demo select, dialog input, dialog select, dialog textarea { width: 100%; min-height: 44px; background: var(--bg); color: var(--ink); border: 1px solid #456270; border-radius: 8px; padding: 9px 11px; font: inherit; }
dialog textarea { min-height: 76px; resize: vertical; }
.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.demo-card { display: grid; align-content: start; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.demo-card article { padding-block: 12px; border-top: 1px solid var(--line); }
.demo-card .button { justify-self: start; margin-top: 4px; }
.demo-metrics { margin-top: 16px; }
.demo-metrics dd { font-size: 1.75rem; color: var(--mint); font-weight: 800; }
.demo-tag { justify-self: start; color: var(--mint); background: #183f44; border-radius: 20px; padding: 2px 9px; font-size: .85rem; }
.demo-tag.warning { color: #ffe3ae; background: #49391f; }
.demo-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
dialog { width: min(600px, calc(100% - 28px)); max-height: calc(100dvh - 36px); border: 1px solid #456270; border-radius: 14px; color: var(--ink); background: var(--surface); padding: clamp(14px, 4vw, 24px); }
dialog::backdrop { background: #02070bcf; }
dialog .demo-form { display: grid; gap: 12px; margin-top: 15px; }
dialog .demo-form .button { justify-self: start; }
.demo-history { padding-inline-start: 20px; }
.demo-history li { margin-bottom: 6px; }
@media (max-width: 650px) {
  .demo { padding-block: 20px; }
  .demo-grid, .demo-panel-grid, .demo-filters { grid-template-columns: 1fr; }
  .demo-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .demo-metrics .demo-card { padding: 8px; font-size: .75rem; }
  .demo .button { padding-inline: 12px; }
}
.demo-profile { margin-top: 16px; max-width: 350px; }
.demo-tasks { margin-top: 16px; }
.demo-card small, .demo-history small { display: block; color: var(--muted); margin-top: 4px; }
.demo-photo-fields { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; }
.demo-photo { display: block; object-fit: contain; max-width: 100%; max-height: 240px; margin-top: 8px; border-radius: 8px; }
.demo-history li { padding-block: 8px; }
.demo-action-row { margin-block: 16px; }
.demo-qr { width: min(100%, 220px); margin: 16px auto; }
.demo-qr canvas, .demo-video { width: 100%; height: auto; display: block; }
.demo-video[hidden] { display: none; }
.demo-report-table { overflow: auto; max-height: 320px; margin-block: 12px; }
.demo-report-table table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.demo-report-table th, .demo-report-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.demo-in-dialog { margin-top: 8px; }
