/* NUT-189: tour /demo/. Nạp sau landing.css, dùng token của nó. Token mới chỉ cho vẻ ngoài widget (lấy từ mcp/widget/today.html, bản sáng). */

.tour {
  --w-surface: #fffdf6;
  --w-surface-2: #ebe6d8;
  --w-border: #cfc8b8;
  --w-accent-soft: #ffe8d6;
  --w-link: #b8400f;
  --w-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Hero with scene 1 ---------- */

.tour-hero {
  align-items: start;
}

.tour-hero h1 {
  max-width: 12ch;
}

.tour-hero .go-link {
  margin-top: -8px;
}

/* Teaser dưới lede (uma P1): đưa khoảnh khắc "hỏi trước" lên màn hình đầu trên 390 px. */
.tour-teaser {
  font-size: 0.95rem;
}

.tour-teaser a {
  font-weight: 600;
  color: var(--ink);
}

.tour-teaser a:hover {
  background: var(--star);
}

/* Link #scene-2 không bị header dính che mất tiêu đề. */
.tour-band,
#scene-1 {
  scroll-margin-top: 72px;
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Scene index: a real sequence, so numbered. Hidden under 900 px where the scenes follow right away. */
.tour-steps {
  display: none;
}

@media (min-width: 900px) {
  .tour-steps {
    counter-reset: ts;
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--muted);
    width: 100%;
  }
  .tour-steps li {
    counter-increment: ts;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
  }
  .tour-steps li::before {
    content: counter(ts);
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    background: var(--label);
    border: 2px solid var(--ink);
    font: 400 0.8rem/1 var(--display);
  }
  .tour-steps a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--ink);
  }
}

/* ---------- Scene heading ---------- */

.scene {
  margin: 0;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.scene-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Tablet and phone: one column, but chat and record stay a readable width instead of stretching to 730 px. */
@media (max-width: 899px) {
  .scene,
  .tour-text {
    max-width: 36rem;
  }
}

.scene-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--label);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: 400 1.1rem/1 var(--display);
}

.scene-title {
  font: 400 clamp(1.35rem, 3.6vw, 2rem) / 1.1 var(--display);
  max-width: 22ch;
  text-wrap: balance;
}

.scene figcaption {
  font-size: 0.8rem;
  color: var(--muted);
}

.scene figcaption .tag {
  margin-right: 4px;
}

/* Scene 2 là ví dụ riêng, không nằm trong ngày mẫu ở scene 3 (uma P1): nói rõ ngay trên khung chat. */
.scene-flag {
  font-size: 0.85rem;
  color: var(--ink);
}

.scene-flag .tag {
  margin-right: 6px;
}

/* ---------- Chat frame (receipt-style, not glass) ---------- */

.chat-frame {
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.chat-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px dashed var(--muted);
}

.chat-who {
  flex: 1;
  font-weight: 500;
  font-size: 0.88rem;
}

.replay,
.show-all {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 500 0.78rem/1 var(--mono);
  cursor: pointer;
  transition: background-color 120ms var(--ease-out);
}

.replay:hover,
.show-all:hover {
  background: var(--star);
}

/* Replay và Show all chỉ có nghĩa khi dòng chạy hiệu ứng. */
html:not(.js) .replay,
html:not(.js) .show-all {
  display: none;
}

.chat-thread {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.msg {
  max-width: 88%;
  font-size: 0.9rem;
  line-height: 1.5;
}

.msg.me {
  justify-self: end;
  padding: 8px 12px;
  background: var(--paper-2);
  border-radius: 16px 16px 4px 16px;
}

.msg.ai {
  justify-self: start;
}

.tool {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.tool code {
  font: 500 0.78rem/1 var(--mono);
  color: var(--ink);
}

.tool-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--src-checked);
}

/* The call that was held back: hollow dot, so the state does not rest on colour alone. */
.tool-dot-ask {
  background: none;
  border: 1.5px solid var(--src-confirmed);
}

/* ---------- Widget look (what Claude shows), from mcp/widget/today.html ---------- */

.w-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--w-surface);
  border: 1px solid var(--w-border);
  border-radius: 16px;
  font: 15px/1.5 var(--w-sans);
}

.w-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.w-pill {
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--w-accent-soft);
  color: var(--w-link);
  font-size: 0.76rem;
  white-space: nowrap;
}

.w-title {
  font-weight: 600;
}

.w-lead {
  color: var(--muted);
}

.w-big {
  font: 600 2rem/1.1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.w-big small {
  font: 400 0.95rem/1 var(--w-sans);
  color: var(--muted);
  margin-left: 4px;
}

.w-items {
  display: grid;
  gap: 8px;
}

.w-items li,
.w-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 8px 12px;
  background: var(--w-surface-2);
  border-radius: 12px;
}

.w-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.w-name {
  font-weight: 600;
}

.w-kcal {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.w-items .src-tag {
  grid-column: 1 / -1;
  font-family: var(--w-sans);
  font-size: 0.8rem;
}

.w-from b {
  font-size: 1.1rem;
}

.w-from,
.w-ref {
  color: var(--muted);
}

.w-from b {
  color: var(--ink);
}

.w-ask {
  color: var(--ink);
}

.w-day {
  font-size: 0.85rem;
  color: var(--muted);
}

.w-day b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Line-by-line print (only with JS and motion allowed) ---------- */

.js .chat-thread [data-line] {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.js .chat-thread [data-line].on {
  opacity: 1;
  transform: none;
}

/* ---------- Scenes 2 and 3 ---------- */

.tour-band {
  background: var(--paper-2);
}

.tour-band .msg.me {
  background: var(--paper-2);
}

.tour-split {
  display: grid;
  gap: 24px;
  align-items: start;
}

.tour-text {
  display: grid;
  gap: 16px;
  max-width: 46ch;
}

@media (min-width: 900px) {
  .tour-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 48px;
  }
  .tour-split .tour-text {
    position: sticky;
    top: 96px;
    padding-top: 8px;
  }
  .tour-split.flip > .tour-text {
    order: 2;
  }
}

.r-new {
  background: var(--star);
  margin-inline: -8px;
  padding-inline: 8px !important;
}

.from-chat {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid var(--ink);
  font-size: 0.72rem;
}

/* ---------- Final band ---------- */

.tour-end {
  max-width: 720px;
  gap: 16px;
}

.tour-end .solo-chips {
  display: grid;
  gap: 8px 24px;
  padding-block: 12px;
  border-block: 2px dashed var(--ink);
}

@media (min-width: 600px) {
  .tour-end .solo-chips {
    grid-template-columns: repeat(2, max-content);
  }
}

.tour-end .solo-chips li {
  font-size: 1rem;
}

.tour-end .solo-chips li::before {
  background: var(--ink);
}

/* Màn cảm ứng: nút đủ 44 px (uma P2). */
@media (pointer: coarse) {
  .replay,
  .show-all,
  .tour .nav-menu summary {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .replay,
  .show-all {
    transition: none;
  }
}
