/* The chat's own layout, from @v1d/web-kit's tokens. The looks of the parts are the kit's and kit/chat-kit.css's; this file only places them.
   At a desk (900 px and up) a side list of conversations stands beside the chat; on a phone the list opens from the menu. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
body { overflow: hidden; }
#app { height: 100dvh; }
button { font-family: inherit; }

/* the page before a person is in */
.entry { display: grid; place-items: center; height: 100%; padding: 24px 16px; }
.entry-card { display: grid; justify-items: center; gap: 12px; width: min(380px, 100%); text-align: center; }
.entry-card h1 { margin: 8px 0 0; font-size: var(--type-page); }
.entry-card p { margin: 0; color: var(--muted); }
.entry-actions { display: grid; gap: 10px; width: 100%; margin-top: 12px; }
.entry-actions .part-button { justify-content: center; }

/* the shell */
.chat-shell { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; }
@media (min-width: 900px) { .chat-shell { grid-template-columns: 300px minmax(0, 1fr); } }
.chat-side { display: none; flex-direction: column; gap: 12px; min-height: 0; padding: 14px 12px; background: var(--card); border-right: 1px solid var(--border); }
@media (min-width: 900px) { .chat-side { display: flex; } }
.side-brand { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.side-brand span { color: var(--muted); font-size: var(--type-small); }
.side-list { display: grid; align-content: start; gap: 6px; flex: 1; min-height: 0; overflow-y: auto; }
.side-list .part-feed { background: transparent; }
.side-list .part-feed:hover { background: var(--border); }
.side-list .part-feed.current { background: var(--control); }
.side-list .part-feed-tile { background: var(--bg); }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.side-foot small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.list-empty { margin: 8px 4px; color: var(--muted); font-size: var(--type-body); }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.chat-head .grow, .grow { flex: 1; }
.switch-slot { min-width: 0; display: flex; }
.bot-switch { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; min-height: 44px; padding: 4px 10px 4px 4px; border: 0; border-radius: var(--radius); background: transparent; color: var(--fg); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bot-switch:hover { background: var(--card); }
.bot-switch:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.bot-switch-words { display: grid; min-width: 0; }
.bot-switch-words strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-switch-words small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--type-small); }
.bot-tile { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: var(--card); color: var(--fg); font: 700 15px/1 var(--font); box-shadow: inset 0 0 0 1px var(--border); }
.bot-tile.large { width: 64px; height: 64px; border-radius: 16px; font-size: 26px; }

.chat-banner { display: grid; gap: 6px; padding: 0 12px; }
.chat-banner:not(:empty) { padding-top: 8px; }
.chat-banner > * { width: 100%; max-width: 720px; margin-inline: auto; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 12px; }
.chat-log > * { width: 100%; max-width: 720px; margin-inline: auto; flex: none; }
.chat-foot { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.chat-foot-in { max-width: 720px; margin-inline: auto; }

/* nothing said yet */
.empty { display: grid; justify-items: center; gap: 8px; margin-block: auto; padding: 24px 0; text-align: center; }
.empty h1 { margin: 8px 0 0; font-size: var(--type-page); }
.empty p { margin: 0; color: var(--muted); }
.empty-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

/* sheets */
.list { display: grid; gap: 6px; }
.sheet-note { margin: 0; color: var(--muted); font-size: var(--type-small); }
.bot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.bot-form { display: grid; gap: 14px; }
.form-voice { display: grid; gap: 6px; justify-items: start; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.bot-form .form-reset { justify-self: start; }
.form-problem[hidden], .form-said[hidden] { display: none; }
