/* Interactive demo: quiz + mini Carlo app */
.demo-main { padding-block: 48px 96px; }
.demo-main h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin-block: 12px 16px; }
[hidden] { display: none !important; }

.quiz { margin-top: 36px; display: grid; gap: 28px; max-width: 44rem; }
.q { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.q label, .q legend { font-weight: 700; font-size: 1.1rem; padding: 0; margin-bottom: 2px; }
.q input[type=text] { font: inherit; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; max-width: 28rem; }
.q small { color: var(--muted); font-size: 0.85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips button { font: inherit; font-weight: 600; padding: 12px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chips button[aria-pressed=true] { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.quiz .btn { justify-self: start; border: 0; cursor: pointer; font-family: inherit; }

.demo-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.demo-title { margin: 10px 0 0 !important; }
button.btn { font-family: inherit; cursor: pointer; }
button.btn-primary { border: 0; }
button.btn-ghost { background: transparent; }
button.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.small { padding: 8px 14px; font-size: 0.9rem; margin-top: 10px; }

.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); border-radius: 24px; overflow: hidden; background: var(--cream); box-shadow: 0 40px 80px -44px rgba(23, 61, 45, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.07); min-height: 620px; }
.app-side { background: var(--forest); color: var(--cream); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; }
.app-logo { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.app-logo svg { width: 30px; height: 30px; padding: 5px; background: rgba(255, 255, 255, 0.1); border-radius: 8px; }
.app-logo small { display: block; font-weight: 400; font-size: 0.7rem; opacity: 0.6; }
.tabs { display: grid; gap: 4px; }
.tabs button { font: inherit; font-size: 0.95rem; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; color: rgba(246, 245, 239, 0.75); cursor: pointer; }
.tabs button:hover { background: rgba(255, 255, 255, 0.08); }
.tabs button[aria-selected=true] { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; }
.app-main { padding: clamp(18px, 3vw, 36px); min-width: 0; }
.pane { display: grid; gap: 18px; align-content: start; }
.pane-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pane-title { font-size: clamp(1.4rem, 2.6vw, 2rem); margin-top: -10px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: grid; gap: 14px; }
.card-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.card-head small { display: block; color: var(--muted); font-size: 0.85rem; }
.big-num { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.big-num.ok { color: #2f7a4f; } .big-num.warn { color: var(--warn); } .big-num.bad { color: #9b2c2c; }
.hint { color: var(--muted); font-size: 0.9rem; }
.scroll { overflow-x: auto; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.bars div { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; position: relative; padding-bottom: 18px; }
.bars i { display: block; width: 45%; max-width: 14px; background: var(--forest); border-radius: 3px 3px 0 0; }
.bars i.cost { background: #b9c9bd; }
.bars span { position: absolute; bottom: 0; font-size: 0.65rem; color: var(--muted); }

.attention { list-style: none; margin: 0 -20px -18px; padding: 0; }
.att { width: 100%; font: inherit; text-align: left; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 20px; background: transparent; border: 0; border-top: 1px solid var(--line); border-left: 4px solid var(--c, var(--line)); cursor: pointer; }
.att:hover { background: var(--cream); }
.att.critical { --c: #9b2c2c; } .att.important { --c: var(--warn); } .att.needed { --c: #8a7a2e; }
.att small { display: block; color: var(--muted); font-size: 0.85rem; }
.pill { font-style: normal; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.critical { background: #f6dcdc; color: #9b2c2c; } .pill.important { background: #f7e7d2; color: var(--warn); } .pill.needed { background: #f3efd6; color: #8a7a2e; }
.pill.draft { background: #f7e7d2; color: var(--warn); } .pill.ok { background: #dcefe3; color: #2f7a4f; }

.wi-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.wi-grid > div:first-child { display: grid; gap: 16px; justify-items: start; }
.note { background: #fbfaf5; border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; transform: rotate(-1.5deg); box-shadow: 0 18px 36px -24px rgba(0, 0, 0, 0.45); font-size: 0.9rem; width: 100%; }
.note b { letter-spacing: 0.04em; font-size: 1.05rem; }
.note small { display: block; color: var(--muted); margin-bottom: 8px; }
.note .row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #cfcfc6; }
.note .row.x span:first-child { outline: 2.5px solid #b3261e; outline-offset: 3px; border-radius: 40%; }
.note .row em { color: #b3261e; font-size: 0.8rem; margin-left: auto; }
.chat { display: grid; gap: 10px; align-content: start; }
.bubble { border-radius: 16px; padding: 12px 16px; font-size: 0.95rem; max-width: 100%; }
.bubble.me { background: var(--forest); color: var(--cream); justify-self: end; border-bottom-right-radius: 4px; }
.bubble.carlo { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 600; margin-bottom: 4px; }
.bubble a { color: var(--forest); font-weight: 600; }
.typing { display: inline-flex; gap: 6px; justify-self: start; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--forest); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }

.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tbl th small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.tbl .r { text-align: right; }
.tbl td small { display: block; color: var(--muted); font-size: 0.8rem; }
.tbl input[type=number] { width: 64px; font: inherit; text-align: right; padding: 5px 8px; border: 1.5px solid var(--sage, #8fa89a); border-radius: 8px; }
.tbl select { font: inherit; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; width: 100%; min-width: 7rem; }
.tbl td.open { background: #fdecec; } .tbl td.open select { border-color: #b3261e; color: #b3261e; }
.tbl.mini { margin: 10px 0; font-size: 0.85rem; } .tbl.mini tr.x td { color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.dp-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.hours { list-style: none; margin: 0; padding: 0; }
.hours li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.93rem; }
.hours small { display: block; color: var(--muted); font-size: 0.78rem; }
.hours .over { color: #9b2c2c; font-weight: 700; }

.dishes { list-style: none; margin: 0; padding: 0; display: grid; }
.dishes li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 3.2rem; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.dishes li:first-child { border-top: 0; }
.dishes small { display: block; color: var(--muted); font-size: 0.82rem; }
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--sand); overflow: visible; }
.meter i { display: block; height: 100%; border-radius: 6px; }
.meter u { position: absolute; left: 60%; top: -4px; bottom: -4px; width: 2px; background: var(--forest); }
.meter i.ok, .pct.ok { background: #2f7a4f; } .meter i.warn { background: var(--warn); } .meter i.bad { background: #9b2c2c; }
.pct { background: transparent !important; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pct.ok { color: #2f7a4f; } .pct.warn { color: var(--warn); } .pct.bad { color: #9b2c2c; }
.slider { display: flex; justify-content: space-between; font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--forest); }

.demo-cta { margin-top: 36px; background: var(--forest); color: var(--cream); border-radius: 24px; padding: clamp(24px, 4vw, 40px); display: flex; justify-content: space-between; gap: 24px; align-items: center; flex-wrap: wrap; }
.demo-cta h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.demo-cta h2 em { color: var(--mint); }
.demo-cta p { color: #cfe0d4; max-width: 34rem; margin-top: 8px; }
.demo-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-cta .btn-ghost { border-color: var(--mint); color: var(--cream); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .app-side { flex-direction: row; align-items: center; gap: 12px; padding: 12px; overflow-x: auto; }
  .app-logo span { display: none; }
  .tabs { display: flex; gap: 4px; }
  .tabs button { white-space: nowrap; padding: 8px 12px; }
  .wi-grid, .dp-grid { grid-template-columns: 1fr; }
  .dishes li { grid-template-columns: minmax(0, 1fr) 3.2rem; }
  .dishes .meter { grid-column: 1 / -1; order: 3; }
}
