/* Sushi Mawari: indigo like a shop curtain, vermilion like the stools and the express lane, wood floor. */
:root {
  --indigo: #1f2a44;
  --indigo-2: #2c3854;
  --vermilion: #c8402a;
  --vermilion-soft: #f8e4df;
  --paper: #ffffff;
  --bg: #eef0f2;
  --wood: #e9e4dc;
  --ink: #15171b;
  --muted: #646a72;
  --line: #dde0e4;
  --rules: #1f7a4a;
  --llm: #5a4bd1;
  --chat-w: 420px;
  --top-h: 58px;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --sans: "IBM Plex Sans", "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); display: flex; flex-direction: column; overflow: hidden; }
body.chat-docked { padding-right: var(--chat-w); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ── top bar ── */
.top { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: var(--indigo); color: #f4f1ec; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand-ja { font: 700 20px var(--sans); letter-spacing: .04em; }
.brand-en { font: 700 13px var(--display); font-stretch: 110%; letter-spacing: .14em; color: #f0a08f; }
.modes { display: flex; background: var(--indigo-2); border-radius: 6px; padding: 3px; margin-left: auto; }
.modes button { border: 0; background: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; color: #c9cfdb; font-weight: 500; }
.modes button[aria-selected="true"] { background: #f4f1ec; color: var(--indigo); }
.top-tools { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; gap: 2px; }
.lang button { border: 0; background: none; color: #c9cfdb; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.lang button[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,.12); }
.back { font: 13px var(--mono); color: #c9cfdb; text-decoration: none; white-space: nowrap; }
.back:hover { color: #fff; }

/* ── live strip ── */
.live { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 10px 18px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 14px; }
.live-item { display: flex; align-items: baseline; gap: 6px; }
.live-item .k { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.live-item strong { font: 700 18px var(--display); font-variant-numeric: tabular-nums; }
.live-you { padding: 3px 10px; border-radius: 999px; background: var(--vermilion-soft); color: #8f2a19; }
.live-you strong { color: var(--vermilion); }
.live-order { display: flex; align-items: center; gap: 8px; }
.steps { display: inline-flex; gap: 3px; }
.steps i { width: 18px; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--vermilion); }
.demo-note { margin-left: auto; font: 12px var(--mono); color: var(--muted); }

/* ── stage ── */
.stage { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }
.view-restaurant { background: var(--wood); }
.scene { position: absolute; inset: 0; overflow: hidden; }
.scene canvas { display: block; }
.scene-note { position: absolute; left: 14px; bottom: 10px; margin: 0; font: 12px var(--mono); color: #6f6556; pointer-events: none; }
.scene-labels { position: absolute; inset: 0; pointer-events: none; }
.scene-label { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; will-change: transform; }
.scene-label.you { padding: 3px 9px; border-radius: 999px; background: var(--vermilion); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.scene-label.bubble { max-width: 260px; white-space: normal; padding: 6px 10px; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.scene-label.ready { padding: 3px 9px; border-radius: 4px; background: var(--rules); color: #fff; font-weight: 600; }
.scene-label.screen { display: grid; justify-items: center; padding: 4px 10px; border-radius: 4px; background: #101418; color: #9fe3b6; font-family: var(--mono); line-height: 1.2; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.scene-label.screen strong { font-size: 20px; color: #d6ffe4; }
.scene-label.screen small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.scene-label.place { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #6f6556; }
.scene-fallback { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; color: var(--muted); }

/* ── menu view ── */
.view-menu { overflow-y: auto; padding: 16px 18px 40px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cats button { border: 1px solid var(--line); background: var(--paper); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.cats button[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.dish { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; padding: 14px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); transition: box-shadow .3s, border-color .3s; }
.dish.hl { border-color: var(--vermilion); box-shadow: 0 0 0 2px var(--vermilion-soft); }
.dish-top { display: flex; align-items: center; gap: 12px; }
.plate { flex: none; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle, #fbfaf6 0 54%, var(--p) 56% 100%); position: relative; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.plate.bowl { background: radial-gradient(circle, var(--t) 0 46%, #7a2e22 48% 100%); }
.plate:not(.bowl)::after { content: ""; position: absolute; left: 15px; right: 15px; top: 20px; height: 12px; border-radius: 4px; background: var(--t); box-shadow: 0 4px 0 #f6f3ea; }
.plate.dark { background: radial-gradient(circle, #2a2a2c 0 54%, var(--p) 56% 100%); }
.dish h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.dish .alt { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.dish .price { font: 700 16px var(--display); }
.dish p { margin: 0; font-size: 13px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f0f1f3; color: #464b52; }
.tag.raw { background: #fde8e4; color: #8f2a19; }
.tag.veg { background: #e3f3e8; color: #1f6a3e; }
.dish-actions { display: flex; gap: 6px; }
.btn { border: 1px solid var(--line); background: var(--paper); padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--ink); }
.btn-red { background: var(--vermilion); border-color: var(--vermilion); color: #fff; }
.btn-red:hover { background: #a93422; border-color: #a93422; }
.special-tag { font: 600 11px var(--mono); color: var(--vermilion); text-transform: uppercase; letter-spacing: .06em; }

/* ── chat ── */
.chat { position: fixed; top: 0; right: 0; bottom: 0; width: var(--chat-w); display: flex; flex-direction: column; background: var(--paper); border-left: 1px solid var(--line); z-index: 20; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; height: var(--top-h); background: var(--indigo); color: #f4f1ec; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--vermilion); color: #fff; font-weight: 700; }
.chat-who { display: grid; line-height: 1.2; flex: 1; }
.chat-who span { font-size: 12px; color: #c9cfdb; }
.icon-btn { border: 0; background: none; color: inherit; font-size: 20px; width: 34px; height: 34px; border-radius: 4px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
body.chat-docked .chat-close { display: none; }
.chat-tools { display: flex; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; }
.switch { width: 26px; height: 15px; border-radius: 999px; background: #c9ccd1; position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tool-btn[aria-pressed="true"] .switch { background: var(--rules); }
.tool-btn[aria-pressed="true"] .switch::after { transform: translateX(11px); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; }
.msg.user { align-self: flex-end; background: var(--indigo); color: #fff; border-bottom-right-radius: 3px; }
.msg.bot { align-self: flex-start; background: #f1f2f4; border-bottom-left-radius: 3px; display: grid; gap: 8px; }
.msg.bot.ask { background: var(--vermilion-soft); }
.msg.error { background: #fde8e4; }
.msg-text { margin: 0; white-space: pre-wrap; }
.msg.bot.typing { display: flex; align-items: center; gap: 4px; padding: 12px 14px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa0a8; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .3; } }
.chat-card { display: grid; gap: 4px; text-align: left; width: 100%; padding: 9px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); cursor: pointer; }
.chat-card.wide { cursor: default; }
button.chat-card:hover { border-color: var(--ink); }
.cc-body { display: grid; gap: 2px; font-size: 13px; }
.cc-sub { color: var(--muted); }
.cc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.cc-tag { font-size: 11px; padding: 0 6px; border-radius: 999px; background: #f0f1f3; }
.cc-table table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 12.5px; }
.cc-table th, .cc-table td { text-align: left; padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line); }
.cc-table td:last-child, .cc-table th:last-child { text-align: right; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.timeline li { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); padding-left: 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #b6bbc2; }
.timeline li.done { color: var(--ink); }
.timeline li.done::before { background: var(--vermilion); border-color: var(--vermilion); }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.qr { border: 1px solid var(--line); background: var(--paper); padding: 5px 11px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.qr:hover { border-color: var(--ink); }
.qr.yes { background: var(--vermilion); border-color: var(--vermilion); color: #fff; }
.chat-compose { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.chat-compose input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; }
.chat-compose input:focus { outline: 2px solid var(--indigo); outline-offset: 0; border-color: var(--indigo); }
.chat-compose button { border: 0; background: var(--indigo); color: #fff; border-radius: 999px; padding: 0 16px; cursor: pointer; }
.chat-peek { margin: 0 14px 8px; border: 1px solid var(--indigo); background: var(--paper); color: var(--indigo); border-radius: 999px; padding: 7px; cursor: pointer; font-weight: 500; }
.chat-launch { position: fixed; right: 16px; bottom: 16px; z-index: 15; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--vermilion); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer; display: none; }

.examples { display: grid; gap: 8px; padding: 10px; border: 1px dashed #c3c8ce; border-radius: 10px; }
.examples-title { margin: 0; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ex-group { display: grid; gap: 4px; }
.ex-title { font-size: 12px; color: var(--muted); }
.ex-row { display: flex; flex-wrap: wrap; gap: 5px; }

.why { display: none; flex-wrap: wrap; align-items: center; gap: 4px 6px; font: 11.5px var(--mono); color: var(--muted); padding-top: 6px; border-top: 1px dashed #c9cdd2; }
body.why-on .why { display: flex; }
.why-via { padding: 1px 7px; border-radius: 999px; color: #fff; font-weight: 500; }
.why-rules { background: var(--rules); }
.why-llm { background: var(--llm); }
.why-search { background: #2f5fa7; }
.why-none, .why-offtopic, .why-command { background: #7b8088; }
.why-intent { color: var(--ink); }
.why-slot { display: inline-flex; gap: 4px; padding: 0 6px; border-radius: 4px; background: #e6e8eb; color: var(--ink); }
.why-slot .k { color: var(--muted); }
.why-slot.carried { background: none; border: 1px dashed #b6bbc2; }
.why-confirm { padding: 0 6px; border-radius: 4px; font-weight: 600; }
.why-confirm.yes { background: #e3f3e8; color: var(--rules); }
.why-confirm.no { background: #f0f1f3; }
.why-unknown { color: var(--vermilion); }
.why-weak { text-decoration: line-through; text-decoration-color: var(--vermilion); }
.why-meta { margin-left: auto; }

.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--vermilion); } }

/* ── narrow screens: the chat covers the view; a button brings it back ── */
@media (max-width: 899px) {
  .top { gap: 10px; padding: 0 12px; }
  .brand-en, .back { display: none; }
  .modes button { padding: 5px 9px; font-size: 13px; }
  .chat { width: 100%; border-left: 0; }
  .chat-launch { display: block; }
  body.chat-open .chat-launch { display: none; }
  body:not(.chat-open) .chat { display: none; }
  .live { padding: 8px 12px; gap: 6px 14px; font-size: 13px; }
  .demo-note { display: none; }
  .view-menu { padding: 12px; }
  .menu-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dish { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .flash, .typing span { animation: none; } }

/* live voice (voice.css) in the shop's colours */
:root { --call-ink: var(--indigo); --call-accent: var(--vermilion); --call-bg: var(--wood); }
