/* UNIT live demo */
.demo-body { background: var(--paper-2); height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.demo-top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.demo-top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-top .btn { height: 36px; font-size: 14px; padding: 0 14px; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.demo { flex: 1; display: grid; grid-template-columns: minmax(340px, 440px) 1fr; min-height: 0; }
.convo { display: flex; flex-direction: column; min-height: 0; background: #fff; border-right: 1px solid var(--line); }
.convo-scroll { flex: 1; overflow-y: auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 88%; padding: 12px 16px; border-radius: 18px; font-size: 15px; line-height: 1.5; animation: rise .35s var(--ease); }
.bubble.me { align-self: flex-end; background: #000; color: #fff; border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--paper-3); border-bottom-left-radius: 6px; }
.bubble.ai.typing { color: var(--muted); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { font: 13px var(--font); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.suggest button:hover { border-color: #000; }
.demo-prompt { margin: 0; max-width: none; border-radius: 0; border: 0; border-top: 1px solid var(--line); box-shadow: none; padding: 12px 12px 12px 20px; background: #fff; }
.demo-prompt .btn { height: 44px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.canvas { display: grid; grid-template-columns: 1fr 320px; grid-template-rows: auto 1fr; min-height: 0; }
.canvas-head { grid-column: 1 / -1; padding: 24px 28px 8px; }
.canvas-body { padding: 12px 28px 28px; overflow-y: auto; display: grid; gap: 16px; align-content: start; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rail { border-left: 1px solid var(--line); padding: 12px 20px 20px; overflow-y: auto; }
.timeline.light li { background: #fff; border-color: var(--line); color: var(--ink-2); font-size: 14px; padding: 12px 14px 12px 38px; animation: rise .35s var(--ease); }
.timeline.light li::before { left: 14px; top: 16px; width: 10px; height: 10px; }
.timeline.light .who { color: var(--faint); }
.timeline.light .t-human::before { background: #000; }
.timeline.light .t-system::before { border-color: #9a9a9a; }
.timeline.light .t-approve { border-color: #000 !important; }

.u-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; align-content: start; animation: rise .4s var(--ease); }
.u-card.wide { grid-column: 1 / -1; }
.u-card.alert { border-color: #000; }
.u-card h4 { margin: 0; }
.u-card p { margin: 0; color: var(--muted); font-size: 14px; }
.u-row { display: flex; gap: 12px; align-items: center; }
.u-meta { font-size: 13px; color: var(--muted); }
.u-state { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper-3); white-space: nowrap; }
.u-state.go { background: #000; color: #fff; }
.u-state.warn { background: #ffe9df; }
.u-state.ok { background: #e3f6ec; }
.u-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.u-actions .btn { height: 36px; font-size: 14px; padding: 0 14px; }
.u-thumb { width: 64px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, #d9d9d6, #f2f2ef); flex: none; display: grid; place-items: center; font-size: 11px; color: #6b6b6b; font-weight: 600; }
.u-list { list-style: none; margin: 0; padding: 0; display: grid; }
.u-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: center; }
.u-list li:first-child { border-top: 0; }
.u-bar { height: 8px; border-radius: 8px; background: var(--paper-3); overflow: hidden; }
.u-bar span { display: block; height: 100%; background: #000; border-radius: 8px; }
.u-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.u-steps { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 6px; }

@media (max-width: 1100px) { .canvas { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; } .rail { border-left: 0; border-top: 1px solid var(--line); } .canvas-body { overflow: visible; } }
@media (max-width: 820px) {
  .demo-body { height: auto; overflow: auto; }
  .demo { grid-template-columns: 1fr; }
  .convo { border-right: 0; border-bottom: 1px solid var(--line); height: 70vh; }
  .demo-badge, .toggle span { display: none; }
}
