@font-face { font-family: 'Bricolage'; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; src: url(fonts/bricolage-grotesque-latin-wdth-normal.woff2) format('woff2'); }
@font-face { font-family: 'Spline Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/spline-sans-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Spline Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/spline-sans-mono-latin-600-normal.woff2) format('woff2'); }

:root {
  --page: #e8efe4;
  --paper: #ffffff;
  --bubble: #eef3ea;
  --ink: #15261b;
  --ink-2: #4b5f50;
  --line: #c9d6c5;
  --field: #6c806f;
  --mora: #5b2a86;
  --mora-d: #43206a;
  --mora-t: #efe6f7;
  --mora-soft: #7d6a9c;
  --taxo: #f4c430;
  --aji: #b82f1b;
  --ui: 'Bricolage', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Spline Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--ui); font-size: 1rem; line-height: 1.5; font-variation-settings: 'opsz' 14; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--mora); outline-offset: 2px; }
.chat-head :focus-visible, .btn.send:focus-visible { outline-color: var(--taxo); }
.btn.send:focus-visible { outline-color: var(--ink); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }

.wrap { width: min(1480px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.band { height: 14px; background-color: var(--taxo); background-image: linear-gradient(135deg, var(--mora) 25%, transparent 25%), linear-gradient(225deg, var(--mora) 25%, transparent 25%); background-size: 28px 28px; background-position: 0 0; background-repeat: repeat-x; }

/* Cabecera */
.top { padding: 14px 0; }
.top-in { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.back { color: var(--ink); font-size: 0.95rem; text-underline-offset: 3px; }
.brand { flex: 1; font-weight: 650; font-stretch: 90%; display: flex; align-items: baseline; gap: 2px 12px; flex-wrap: wrap; }
.demo-tag { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
#reset { margin-left: auto; }

.btn { border: 0; border-radius: 12px; font-weight: 650; padding: 0 20px; min-height: 46px; background: var(--mora); color: #fff; }
.btn:hover { background: var(--mora-d); }
.btn--quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--field); min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 0.92rem; }
.btn--quiet:hover { background: rgba(21, 38, 27, 0.07); }

/* Título */
.intro { padding: 10px 0 22px; display: grid; gap: 12px; }
.poster { font-family: var(--ui); font-weight: 800; font-stretch: 75%; font-size: clamp(2.7rem, 6.4vw, 4.6rem); line-height: 0.94; letter-spacing: -0.012em; font-variation-settings: 'opsz' 96; color: var(--ink); }
.lead { max-width: 84ch; font-size: 1.05rem; color: var(--ink); }
.lead strong { font-weight: 700; }

/* Distribución */
.grid { display: grid; grid-template-columns: 290px minmax(0, 1fr) 380px; gap: 26px; align-items: start; padding-bottom: 48px; }
.side { position: sticky; top: 16px; display: grid; gap: 18px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 2px; }

/* Carta de hoy: pizarra oscura con precios en amarillo taxo */
.board { position: sticky; top: 16px; background: var(--ink); color: #f1efe2; border-radius: 18px; padding: 20px 20px 16px; max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: 0 18px 40px -26px rgba(21, 38, 27, 0.7); }
.board h2 { font-size: 1.5rem; font-weight: 800; font-stretch: 78%; line-height: 1.05; color: #fff; }
.board-status { margin: 6px 0 4px; font-size: 0.92rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.board-status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #9aa89d; }
.board-status.is-open::before { background: #7ddc8f; }
.board-status.is-closed::before { background: #f29b8b; }
.board h3 { font-size: 0.95rem; font-weight: 700; color: var(--taxo); margin: 12px 0 2px; }
.board ul { display: grid; }
.dish { width: 100%; display: flex; align-items: baseline; gap: 8px; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 4px 8px; margin: 0 -8px; width: calc(100% + 16px); color: #f1efe2; font-size: 0.97rem; }
.dish:hover { background: rgba(255, 255, 255, 0.09); }
.dish:focus-visible { outline-color: var(--taxo); }
.dn { flex: 1; min-width: 0; }
.star { color: var(--taxo); }
.dp { font-family: var(--mono); font-size: 0.9rem; color: var(--taxo); font-weight: 600; }
.board-hint { margin-top: 14px; font-size: 0.88rem; color: #c9d6c5; }
.board-hours { margin-top: 8px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, 0.3); font-size: 0.86rem; color: #c9d6c5; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.tab { background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); }
.tab[aria-selected='true'] { background: var(--mora); border-color: var(--mora); color: #fff; }
.tab:not([aria-selected='true']):hover { border-color: var(--mora); color: var(--mora-d); }

/* Chat */
.chat { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; height: clamp(520px, calc(100dvh - 270px), 720px); box-shadow: 0 18px 40px -26px rgba(21, 38, 27, 0.5); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--mora); color: #fff; }
.chat-head h2 { font-size: 1.2rem; font-weight: 750; font-stretch: 85%; line-height: 1.1; }
.status { font-size: 0.86rem; color: #e6d8f3; }
.seal { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--taxo); color: var(--ink); font-weight: 800; font-stretch: 80%; font-size: 1.4rem; line-height: 1; flex: none; }
.jump { display: none; margin-left: auto; color: #fff; font-size: 0.88rem; text-underline-offset: 3px; white-space: nowrap; }
.chat-head > div { min-width: 0; }

.log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.msg { max-width: 90%; display: flex; flex-direction: column; animation: arrive 0.18s ease-out; }
.msg--bot { align-self: flex-start; }
.msg--me { align-self: flex-end; }
.bubble { padding: 10px 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg--bot .bubble { background: var(--bubble); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; }
.msg--me .bubble { background: var(--mora); color: #fff; border-radius: 16px 4px 16px 16px; }
.bubble p + p, .bubble p + ul, .bubble ul + p { margin-top: 6px; }
.bubble ul { list-style: disc; padding-left: 1.15em; }
.bubble li { margin: 3px 0; }
.bubble strong { font-weight: 700; }
.typing .bubble { display: flex; gap: 5px; align-items: center; min-height: 40px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); animation: blink 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 18px 4px; border-top: 1px solid var(--line); max-height: 110px; overflow-y: auto; }
.chips:empty { display: none; }
.chip { background: var(--paper); border: 1.5px solid var(--mora); color: var(--mora-d); border-radius: 999px; padding: 5px 14px; font-size: 0.92rem; font-weight: 560; }
.chip:hover { background: var(--mora-t); }

.composer { display: flex; gap: 8px; padding: 12px 18px 16px; }
.composer input { flex: 1; min-width: 0; min-height: 46px; border: 1.5px solid var(--field); border-radius: 12px; padding: 0 14px; background: var(--paper); }
.composer input::placeholder { color: #5f7263; }

/* Panel lateral */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.panel h2 { font-size: 1.3rem; font-weight: 780; font-stretch: 82%; line-height: 1.15; margin-bottom: 8px; }
.think-intro, .think-empty { font-size: 0.95rem; color: var(--ink-2); }
.think-label { font-size: 0.86rem; font-weight: 650; color: var(--ink-2); margin: 16px 0 6px; }
.tokens { display: flex; flex-wrap: wrap; gap: 5px; font-family: var(--mono); font-size: 0.88rem; }
.tok { padding: 1px 7px; border-radius: 5px; border: 1px dashed var(--line); }
.tok.hit { background: var(--taxo); border: 1px solid #b8921a; font-weight: 600; }
.tok.ent { background: var(--mora-t); border: 1px solid var(--mora); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--ink-2); margin-top: 8px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .k-hit::before { background: var(--taxo); border: 1px solid #b8921a; }
.legend .k-ent::before { background: var(--mora-t); border: 1px solid var(--mora); }
.bars { display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 0.94rem; }
.bars .score { font-family: var(--mono); font-size: 0.84rem; color: var(--ink-2); }
.bars .track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: #e0e9dc; overflow: hidden; }
.bars .fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--mora-soft); transition: width 0.5s ease-out; }
.bars .win .name { font-weight: 720; }
.bars .win .fill { background: var(--mora); }
.ents { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.94rem; }
.ents dt { color: var(--ink-2); }
.ents dd { font-weight: 600; }
.slots { display: grid; gap: 4px; font-size: 0.94rem; }
.slots li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); padding-bottom: 3px; }
.slots .miss { color: var(--ink-2); text-align: right; }
.slots .miss s { color: var(--aji); text-decoration-thickness: 2px; }
.slots .got { font-weight: 650; }
.note { font-size: 0.88rem; color: var(--ink-2); margin-top: 12px; }

.try ul { display: grid; gap: 6px; }
.q { width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 0.95rem; }
.q:hover { background: var(--mora-t); border-color: var(--mora); }
.topics { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.topics summary { cursor: pointer; font-weight: 650; }
.topics ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.topics li { background: var(--bubble); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 0.84rem; }

@media (max-width: 1240px) {
  .grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .board { grid-column: 1 / -1; grid-row: 2; position: static; max-height: none; }
  .board ul { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 24px; }
  .board-hint, .board-hours { max-width: 60ch; }
}
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .chat { order: 1; }
  .board { grid-row: auto; order: 2; }
  .side { order: 3; }
  .side { position: static; max-height: none; overflow: visible; }
  .chat { height: clamp(500px, 78dvh, 700px); }
  .jump { display: inline; }
}
@media (max-width: 560px) {
  .lead { font-size: 1rem; }
  .status { display: none; }
  .brand { order: 1; flex: 1 1 0; min-width: 0; font-size: 0.9375rem; line-height: 1.3; }
  .back { order: 2; align-self: flex-start; white-space: nowrap; font-size: 0.875rem; }
  #reset { order: 3; flex-basis: 100%; margin-left: 0; }
  .top-in { gap: 10px 16px; }
  .log { padding: 14px; }
  .chips, .composer { padding-left: 14px; padding-right: 14px; }
  .msg { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
