/* キトちゃん — styles on top of the Bekito UI kit (/ui/css/bekito-ui.css).
   Layout and components use kit tokens only. The hex values below belong to
   the character drawing (her illustration colours on dark surfaces).

   Rules kept throughout (ui-kit/SERVICE-STANDARD.md, 2b): the page is the one
   scrolling box; nothing has a fixed height that could cut its content; text
   boxes grow; layers use the kit's --bk-z-* tokens. */

/* ───────── the character ───────── */
/* kito-colors:start — written by scripts/build.mjs from PALETTES in public/js/kito-art.js; change colours there */
:root {
  --kito-cream: #F9DEC8;
  --kito-shade: #EEC7A9;
  --kito-belly: #F9DCC4;
  --kito-collar: #ECC6A8;
  --kito-seam: #E0B796;
  --kito-dark: #4A4241;
  --kito-edge: #5C5251;
  --kito-deep: #2E2827;
  --kito-screen: #35302F;
  --kito-copper: #C0743D;
  --kito-line: #2E2827;
  --kito-rim: #7A6D6A;
  --kito-led: #FFEACB;
  --kito-glow: #B8772F;
  --kito-lens: #5A3523;
  --kito-shine: #FFF6EC;
}
.kito .k-c-cream { fill: var(--kito-cream); }
.kito .k-c-shade { fill: var(--kito-shade); }
.kito .k-c-belly { fill: var(--kito-belly); }
.kito .k-c-collar { fill: var(--kito-collar); }
.kito .k-c-seam { fill: var(--kito-seam); }
.kito .k-c-dark { fill: var(--kito-dark); }
.kito .k-c-edge { fill: var(--kito-edge); }
.kito .k-c-deep { fill: var(--kito-deep); }
.kito .k-c-screen { fill: var(--kito-screen); }
.kito .k-c-copper { fill: var(--kito-copper); }
.kito .k-c-line { fill: var(--kito-line); }
.kito .k-c-rim { fill: var(--kito-rim); }
.kito .k-c-led { fill: var(--kito-led); }
.kito .k-c-glow { fill: var(--kito-glow); }
.kito .k-c-lens { fill: var(--kito-lens); }
.kito .k-c-shine { fill: var(--kito-shine); }
.kito .k-line, .kito .k-s-line { stroke: var(--kito-line); }
.kito .k-s-dark { stroke: var(--kito-dark); }
.kito .k-s-seam { stroke: var(--kito-seam); }
.kito .k-s-glow { stroke: var(--kito-glow); }
/* kito-colors:end */
.kito { display: block; width: 100%; height: auto; overflow: visible; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.kito--bust { clip-path: inset(-30% -30% 0 -30%); }   /* only the bottom edge cuts her off */
.kito .k-led circle { transition: opacity 90ms linear; }
.kito .k-led { transform: scale(calc(1 + var(--k-voice, 0) * .09)); transition: transform 110ms linear; }
.kito .k-head__turn { transform: translate(var(--k-shift, 0px), var(--k-nod, 0px)) rotate(var(--k-tilt, 0deg)); transition: transform 460ms var(--bk-ease); }
/* the head poses of sheet 04: curious tilts, proud lifts the chin, embarrassed ducks a little */
.kito .k-head__pose { transition: transform 520ms var(--bk-ease); }
.kito[data-strokes="curious"] .k-head__pose { transform: rotate(-8deg); }
.kito[data-strokes="proud"] .k-head__pose { transform: translateY(-5px) rotate(-1.5deg); }
.kito[data-strokes="embarrassed"] .k-head__pose { transform: translateY(3px) rotate(6deg); }
.kito .k-stroke__turn { transform: rotate(-136deg); transition: transform 380ms var(--bk-ease); }
.kito[data-strokes="proud"] .k-stroke__turn { transform: rotate(-104deg); }
.kito[data-strokes="embarrassed"] .k-stroke__turn { transform: rotate(-166deg); }
.kito[data-strokes="curious"] .k-stroke--a .k-stroke__turn { transform: rotate(-132deg); }
.kito[data-strokes="curious"] .k-stroke--b .k-stroke__turn { transform: rotate(-58deg); }
/* she breathes: the head floats a little, the body follows */
.kito .k-head__float { animation: k-float 5.2s ease-in-out infinite; }
.kito .k-body { transform-origin: 200px 370px; animation: k-breathe 5.2s ease-in-out infinite; }
.kito.is-speaking .k-head__float { animation-duration: 2.6s; }
.kito.is-nodding .k-head__float { animation: k-nod 640ms var(--bk-ease) 1; }
.kito.is-perking .k-strokes { animation: k-perk 640ms var(--bk-ease) 1; }
@keyframes k-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.4px); } }
@keyframes k-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
@keyframes k-nod { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(5px); } }
@keyframes k-perk { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-5px); } }

/* on a dark surface she keeps her own colours; only her outline turns into a soft light rim */
.bk-hero .kito, .kb-body .kito, .kf .kito, .kito--on-dark { --kito-line: var(--kito-rim); }
:root[data-theme="dark"] .kito { --kito-line: var(--kito-rim); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kito { --kito-line: var(--kito-rim); } }

/* the product name in the header is a link home, but reads as a name (the kit styles it for a <span>) */
a.bk-brand__product, a.bk-brand__product:hover { color: var(--bk-fg); text-decoration: none; }
a.bk-brand__product { display: inline-flex; align-items: center; min-height: 44px; }
/* what the kit (v12) does not size for touch: the width of a two-letter link ("EN"), a link on its own line */
.bk-topbar__link { min-width: 44px; justify-content: center; }
.kl-close > a:not(.bk-btn) { display: inline-flex; align-items: center; min-height: 44px; }
/* phones: the logo and the product name sit close together; the landing page keeps the "Bekito" word (it has room) */
@media (max-width: 420px) {
  .bk-topbar__in { gap: 6px; }
  .kl .bk-brand__name { display: block; }
  .kl .bk-brand__product { border-left: 1px solid var(--bk-line-strong); padding-left: 10px; }
}
@media (max-width: 720px) { .kl-nav-wide { display: none; } }

/* ───────── landing ───────── */
.kl-hero .bk-hero__in { padding-block: clamp(28px, 6vw, 72px) clamp(24px, 5vw, 56px); }
.kl-hero .bk-split { align-items: center; }
.kl-hero .bk-split > * { min-width: 0; }
.kl-hero h1 { max-width: 12em; }
.kl-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.kl-cta__note { font-size: var(--bk-text-sm); color: rgba(243, 238, 230, .8); white-space: nowrap; }
/* the stage is as wide as its column, but never taller than the window allows */
.kl-stage { position: relative; width: min(100%, 440px, calc((100dvh - var(--bk-bar-h) - 72px) * .92)); min-width: 220px; margin-inline: auto; aspect-ratio: 440 / 478; }
.kl-stage__kito { position: absolute; left: 14%; right: 14%; bottom: 0; }
.kl-prop { position: absolute; opacity: 0; transition: opacity 420ms var(--bk-ease), transform 420ms var(--bk-ease); pointer-events: none; }
.kl-prop.is-on { opacity: 1; transform: none; }
.kl-prop--voice { left: 0; top: 32%; width: 21%; transform: translateX(-8px); }
.kl-prop--ask { left: 1%; top: 3%; width: 17%; transform: translateY(8px); }
.kl-prop--card { right: 0; top: 47%; width: 26%; transform: translateY(8px); }   /* beside her body, clear of her hip and leg */
.kl-prop__label { display: block; margin-top: 4px; font-size: var(--bk-text-xs); font-weight: 700; letter-spacing: .08em; text-align: center; white-space: nowrap; color: rgba(243, 238, 230, .86); }
.kl-prop--voice .kl-bars path { transform-box: fill-box; transform-origin: center; animation: kl-bar 900ms ease-in-out infinite alternate; }
.kl-prop--voice .kl-bars path:nth-child(2n) { animation-delay: -300ms; }
.kl-prop--voice .kl-bars path:nth-child(3n) { animation-delay: -600ms; }
.kl-prop:not(.is-on) .kl-bars path { animation-play-state: paused; }
@keyframes kl-bar { from { transform: scaleY(.45); } to { transform: scaleY(1); } }

.kl-step::before { content: none; }
.kl-step__art { width: 100%; max-width: 220px; aspect-ratio: 220 / 132; margin: 0 auto 6px; }
.kl-step__art svg { width: 100%; height: 100%; }
.kl-step h3 { display: flex; align-items: baseline; gap: 10px; }
.kl-step h3 span { font-family: var(--bk-font-latin); font-size: var(--bk-text-xs); font-weight: 700; letter-spacing: .1em; color: var(--bk-accent); }
.kl-art .kl-ink { stroke: var(--bk-fg); }
.kl-art .kl-paper { fill: var(--bk-surface-2); }
.kl-art .kl-accent { stroke: var(--bk-accent); }
.kl-art .kl-ok { stroke: var(--bk-ok); }

.kl-sample { display: grid; gap: clamp(20px, 4vw, 40px); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 820px) { .kl-sample { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.kl-sample > * { min-width: 0; }
.kl-examples { gap: 14px; }
.kl-examples__h { font-size: var(--bk-text-md); margin: 10px 0 0; }
.kl-examples__hint { margin: -6px 0 0; font-size: var(--bk-text-sm); }
.kl-qa { gap: 12px; }
.kl-qa__row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 10px; align-items: baseline; }
.kl-qa__row p { margin: 0; }
.kl-qa__who { font-size: var(--bk-text-xs); font-weight: 700; color: var(--bk-fg-2); }
.kl-qa__row--you p { color: var(--bk-fg-2); }
.kl-data > * { max-width: 46em; }
.kl-trust { display: grid; gap: 14px; }
.kl-trust li { display: flex; gap: 14px; align-items: flex-start; }
.kl-trust p { min-width: 0; font-size: var(--bk-text-md); line-height: 1.75; padding-top: 9px; }
html[lang="en"] .kl-trust p { padding-top: 10px; }
.kl-plan { align-items: flex-start; }
.kl-plan .bk-badge { margin-top: 1px; flex-shrink: 0; }
.kl-plan p { min-width: 0; }
.kl-family__h { font-size: var(--bk-text-sm); font-weight: 700; color: var(--bk-fg-2); letter-spacing: .04em; }
.kl-family { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.kl-family a { display: block; height: 100%; padding: 14px 16px; border-radius: var(--bk-r-md); border: 1px solid var(--bk-line); background: var(--bk-surface); color: var(--bk-fg); text-decoration: none; transition: border-color var(--bk-fast), transform var(--bk-med) var(--bk-ease); }
.kl-family a:hover { border-color: var(--bk-line-strong); transform: translateY(-1px); color: var(--bk-fg); }
.kl-family strong { display: block; font-size: var(--bk-text-md); line-height: 1.5; }
.kl-family span { display: block; font-size: var(--bk-text-sm); color: var(--bk-fg-2); line-height: 1.6; }
.kl-close { text-align: center; align-items: center; }
.kl-reveal { opacity: 0; transform: translateY(8px); transition: opacity 360ms var(--bk-ease), transform 360ms var(--bk-ease); }
.kl-reveal.is-in { opacity: 1; transform: none; }

/* ───────── Japanese text cut into phrases (public/js/phrase.js puts <wbr> between them) ───────── */
.kp { word-break: keep-all; overflow-wrap: break-word; text-wrap: pretty; }
.kp-line { display: block; }

/* ───────── the card: what she heard, and the tools that may fit ───────── */
.kc { display: flex; flex-direction: column; gap: 16px; text-align: left; min-width: 0; }
.kc__head { display: flex; align-items: baseline; gap: 10px; min-height: 28px; margin-bottom: 6px; }
.kc__title { font-size: var(--bk-text-sm); font-weight: 700; color: var(--bk-fg-2); letter-spacing: .04em; line-height: 1.4; white-space: nowrap; }
.kc__hint { font-size: var(--bk-text-xs); color: var(--bk-fg-3); white-space: nowrap; }
.kc__stamp { margin-left: auto; align-self: center; }
.kc__lines { display: flex; flex-direction: column; gap: 8px; }
.kc__line { display: flex; align-items: flex-start; gap: 10px; }
.kc__line::before { content: ""; width: 6px; height: 6px; margin-top: 19px; border-radius: 50%; background: var(--bk-accent); flex-shrink: 0; }
.kc__line .bk-textarea { flex: 1 1 0; min-width: 0; min-height: 44px; padding-block: 9px; line-height: 1.55; font-weight: 500; cursor: text; white-space: normal; }
.kc__edit:empty::before { content: "\200b"; }
.kc__line p { min-width: 0; font-size: var(--bk-text-lg); line-height: 1.6; font-weight: 500; }
.kc .kc__line p { padding-block: 9px; }
ul.kc__lines .kc__line::before { margin-top: calc(9px + .8 * var(--bk-text-lg) - 3px); }   /* centred on the first line (padding + half the 1.6 line height − half the dot) */
.kc__tools { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.kc__tool { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--bk-r-md); border: 1px solid var(--bk-line); background: var(--bk-surface-2); color: var(--bk-fg); text-decoration: none; transition: border-color var(--bk-fast); }
a.kc__tool:hover { border-color: var(--bk-fg-3); color: var(--bk-fg); }
.kc__tool strong { display: block; line-height: 1.45; }
.kc__tool span { display: block; font-size: var(--bk-text-sm); color: var(--bk-fg-2); line-height: 1.6; }
.kc__tool small { display: block; font-family: var(--bk-font-latin); font-size: var(--bk-text-sm); color: var(--bk-fg-2); margin-top: 2px; overflow-wrap: anywhere; }
.kc__tool > div { flex: 1 1 0; min-width: 0; }
.kc__tool > .bk-ico { color: var(--bk-fg-3); }
.kc__none { padding: 12px 14px; border-radius: var(--bk-r-md); background: var(--bk-bg-sunken); }
.kc__none strong { display: block; }
.kc__none span { display: block; font-size: var(--bk-text-sm); color: var(--bk-fg-2); }
/* the buttons stay in sight while a long card scrolls (they rest at the card's foot) */
/* the buttons follow the card in normal flow: a sticky bar covered the suggested tool on short screens (1440×620, phones) */
.kc__actions { --_pad: clamp(16px, 3vw, 24px); display: flex; flex-wrap: wrap; gap: 10px; margin: 0 calc(-1 * var(--_pad)) calc(-1 * var(--_pad)); padding: 12px var(--_pad) calc(var(--_pad) + env(safe-area-inset-bottom)); background: var(--bk-surface); border-top: 1px solid var(--bk-line); border-radius: 0 0 var(--bk-r-lg) var(--bk-r-lg); }
.kc__actions .bk-btn { flex: 1 1 180px; }
.kc__note { flex: 1 1 100%; font-size: var(--bk-text-xs); color: var(--bk-fg-3); line-height: 1.5; }

/* ───────── talk ─────────
   Narrow: one centred column (her, her words, the buttons).
   Wide: she stands on the left, the conversation is on the right, so a short
   laptop window (1440×620) shows everything without scrolling. */
/* the talk page fills the first screen, so the footer waits below the fold and does not jump when she appears */
body > .kt { min-height: 100dvh; }
.kt-main { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 620px; margin-inline: auto; padding: clamp(8px, 2vw, 20px) var(--bk-gutter) calc(24px + env(safe-area-inset-bottom)); }
/* her stage: whole on the first screen; while talking on a narrow screen, a closer view of head and shoulders so the face is large */
.kt-stage { width: min(56%, 250px, 30dvh); min-width: 120px; flex-shrink: 0; aspect-ratio: 360 / 486; overflow: hidden; }
.kt-stage .kito { overflow: hidden; }
.kt:not([data-phase="intro"]) .kt-stage { width: min(64%, 260px, 30dvh); aspect-ratio: 360 / 312; }
.kt[data-card] .kt-stage, .kt[data-phase="stopped"] .kt-stage { width: min(34%, 140px, 20dvh); }
.kt-side { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kt-says { width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kt-says__text { font-size: clamp(1.125rem, 1rem + 1.2vw, 1.4375rem); line-height: 1.6; font-weight: 700; text-wrap: balance; max-width: 22em; }
.kt-says__text[data-size="mid"] { font-size: var(--bk-text-lg); line-height: 1.65; max-width: 26em; }
/* a caption longer than two lines reads better from the left edge */
.kt-says__text[data-size="long"] { font-size: var(--bk-text-md); line-height: 1.7; font-weight: 500; max-width: 32em; text-wrap: pretty; text-align: left; align-self: stretch; }
.kt-says__text:empty { display: none; }
html[lang="en"] .kt-says__text { line-height: 1.4; }
.kt[data-card] .kt-says__text { font-size: var(--bk-text-md); font-weight: 500; color: var(--bk-fg-2); max-width: 32em; line-height: 1.7; text-align: left; align-self: stretch; }
/* what the visitor said: two lines, the rest on a tap */
.kt-heard { display: flex; align-items: flex-start; justify-content: center; gap: 4px; width: 100%; max-width: 34em; min-height: 44px; padding: 6px 10px; border: 0; border-radius: var(--bk-r-md); background: none; color: var(--bk-fg-2); font-size: var(--bk-text-sm); line-height: 1.65; text-align: center; cursor: default; }
.kt-heard.is-long { cursor: pointer; }
.kt-heard__in { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-width: 0; }
.kt-heard[aria-expanded="true"] .kt-heard__in { display: block; }
.kt-heard b { font-weight: 700; margin-right: 8px; white-space: nowrap; }
.kt-heard__more { display: none; flex-shrink: 0; color: var(--bk-fg-3); transition: transform var(--bk-fast); }
.kt-heard.is-long .kt-heard__more { display: inline-flex; }
.kt-heard[aria-expanded="true"] .kt-heard__more { transform: rotate(180deg); }
/* the status line keeps its height in every state, so the button never moves while she thinks */
.kt-status { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 22px; font-size: var(--bk-text-sm); color: var(--bk-fg-2); }
.kt[data-phase="intro"] .kt-status, .kt[data-card]:not([data-mode="live"]) .kt-status, .kt[data-phase="stopped"] .kt-status, .kt[data-phase="ended"] .kt-status { display: none; }
.kt-panel { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.kt-panel:empty { display: none; }
.kt-intro { text-align: center; align-items: center; }
.kt-note { text-align: left; }
.kt-note > div { min-width: 0; }
.kt-note ul { display: flex; flex-direction: column; gap: 4px; }
.kt-note li { position: relative; padding-left: 14px; }
.kt-note li::before { content: ""; position: absolute; left: 0; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }

.kt-controls { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
.kt-mic { --_size: 92px; position: relative; width: var(--_size); height: var(--_size); flex-shrink: 0; border-radius: 50%; border: 0; background: var(--bk-accent); color: var(--bk-accent-ink); display: grid; place-items: center; box-shadow: var(--bk-shadow-2); transition: transform var(--bk-fast) var(--bk-ease), background var(--bk-fast); touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.kt-mic:hover { background: var(--bk-accent-hover); }
.kt-mic:active { transform: scale(.96); }
.kt-mic svg { width: 38%; height: 38%; }
.kt-mic[disabled] { opacity: .4; pointer-events: none; }
.kt-mic::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--bk-accent); opacity: 0; transform: scale(calc(.92 + var(--kt-level, 0) * .16)); transition: transform 90ms linear, opacity var(--bk-med); }
.kt-mic[aria-pressed="true"] { background: var(--bk-danger); color: var(--bk-surface); }
.kt-mic[aria-pressed="true"]::before { border-color: var(--bk-danger); opacity: .55; }
.kt-mic__hint { font-size: var(--bk-text-sm); color: var(--bk-fg-2); min-height: 1.7em; text-align: center; }
.kt-type { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 6px; }
.kt-type .bk-label { text-align: left; }
.kt-samples { width: 100%; max-width: 520px; align-items: center; }
.kt-samples:empty { display: none; }
.kt-samples__label { font-size: var(--bk-text-xs); color: var(--bk-fg-3); white-space: nowrap; }
.kt-foot { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 16px; font-size: var(--bk-text-xs); }
.kt-foot:empty { display: none; }
.kt-foot .bk-link-btn { color: var(--bk-fg-2); font-size: var(--bk-text-xs); min-height: 44px; }
.kt-foot a { color: var(--bk-fg-2); min-height: 44px; display: inline-flex; align-items: center; }
.kt-family { flex: 1 1 100%; gap: 0 16px; }

/* ───────── live voice ───────── */
/* one short line when the live voice cannot be used and the press-to-talk conversation takes over */
.kt-notice { display: flex; align-items: flex-start; gap: 8px; max-width: 34em; margin: 0; font-size: var(--bk-text-sm); line-height: 1.6; color: var(--bk-fg-2); text-align: left; }
.kt-notice[hidden] { display: none; }
.kt-notice .bk-ico { flex-shrink: 0; width: 18px; height: 18px; margin-top: 3px; color: var(--bk-fg-3); }
.kt-notice > span:last-child { min-width: 0; }
.kt-says__text.is-stopped { color: var(--bk-fg-3); transition: color var(--bk-med) var(--bk-ease); }
.kt-left { font-weight: 700; color: var(--bk-fg); font-variant-numeric: tabular-nums; }
/* hands-free: the open microphone shows a soft ring that follows the voice; muted, the button goes quiet */
.kt-mic.is-open::before { opacity: .4; }
.kt-mic.is-muted, .kt-mic.is-muted:hover { background: var(--bk-surface); color: var(--bk-fg-2); box-shadow: inset 0 0 0 2px var(--bk-line-strong); }
/* the button she asked the visitor to use */
.kt-attention { box-shadow: 0 0 0 4px var(--bk-accent-soft); }
.kt[data-mode="live"][data-card] .kt-samples { display: none; }
/* typing only (the microphone was refused, or the live voice's money for now is used up): no microphone button */
.kt[data-typing] .kt-mic, .kt[data-typing] .kt-mic__hint { display: none; }
/* hands-free: the round control only shows that she listens (a press while she speaks stops her); the small button mutes */
.kt-mic.is-indicator { cursor: default; background: var(--bk-surface); color: var(--bk-accent); box-shadow: inset 0 0 0 2px var(--bk-accent); }
.kt-mic.is-indicator:hover { background: var(--bk-surface); }
.kt-mic.is-indicator:active { transform: none; }
.kt-mic.is-indicator.is-muted { color: var(--bk-fg-2); box-shadow: inset 0 0 0 2px var(--bk-line-strong); }
.kt-mute { min-height: 44px; gap: 6px; }
.kt-mute[hidden] { display: none; }
/* one copper button at a time: while a card with its own copper button is up, the microphone is drawn outlined */
.kt[data-card] .kt-mic:not([aria-pressed="true"]), .kt[data-contact] .kt-mic:not([aria-pressed="true"]) { background: var(--bk-surface); color: var(--bk-accent); box-shadow: inset 0 0 0 2px var(--bk-accent); }
/* at a booth the "ask a person" card has no button (the people are right there): the tap button stays the main one */
.kb .kt[data-contact]:not([data-card]) .kt-mic:not(.is-indicator) { background: var(--bk-accent); color: var(--bk-accent-ink); box-shadow: var(--bk-shadow-2); }
.kt-help { font-size: var(--bk-text-sm); color: var(--bk-fg-2); max-width: 36em; }
.kt-help summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.kt-help p { margin: 4px 0 0; }
.kt-mentioned { font-size: var(--bk-text-sm); color: var(--bk-fg-2); margin: 0; }
.kt-mentioned a { color: var(--bk-fg); text-underline-offset: 3px; }
/* the "no tool fits" box: soft in both themes (the sunken background is nearly black in dark mode) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kc__none { background: var(--bk-surface-2, var(--bk-bg-sunken)); } }
:root[data-theme="dark"] .kc__none { background: var(--bk-surface-2, var(--bk-bg-sunken)); }
.kt-ended { justify-content: center; }
@media (min-width: 860px) { .kt-ended { justify-content: flex-start; } }

/* a short screen (a phone with the keyboard up): everything a little smaller, nothing cut */
@media (max-height: 700px) {
  .kt-main { gap: 8px; }
  .kt-side { gap: 8px; }
  .kt-mic { --_size: 68px; }
  .kt-mic::before { inset: -6px; }
  .kt:not([data-phase="intro"]) .kt-stage { width: min(48%, 200px, 24dvh); }
}
@media (min-width: 860px) {
  /* at least as tall as the window (so she and the conversation sit in its middle), and as much taller as the content needs */
  .kt-main { display: grid; grid-template-columns: minmax(200px, 460px) minmax(0, 560px); justify-content: center; align-items: center; align-content: center; gap: clamp(28px, 5vw, 80px); max-width: 1200px; min-height: calc(100dvh - var(--bk-bar-h) - 1px); padding-block: clamp(16px, 3vh, 40px) 32px; }
  .kt-stage, .kt:not([data-phase="intro"]) .kt-stage, .kt[data-card] .kt-stage, .kt[data-phase="stopped"] .kt-stage { width: min(100%, 420px, calc((100dvh - var(--bk-bar-h) - 72px) * .74)); min-width: 150px; aspect-ratio: 360 / 486; justify-self: center; }
  .kt-side { align-items: stretch; }
  /* with a card the conversation is taller than the window: she stays in view at the top of her column */
  .kt[data-card] .kt-stage, .kt[data-contact] .kt-stage { align-self: start; position: sticky; top: calc(var(--bk-bar-h) + 16px); }
  .kt-says { align-items: flex-start; text-align: left; }
  .kt-says__text { text-wrap: pretty; }
  .kt-heard { justify-content: flex-start; text-align: left; padding-inline: 0; }
  .kt-status { justify-content: flex-start; }
  .kt-intro { align-items: flex-start; text-align: left; }
  .kt-controls { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
  .kt-mic__hint { flex: 1 1 12em; text-align: left; min-height: 0; }
  .kt-type, .kt-samples { max-width: none; flex: 1 1 100%; }
  .kt-foot { justify-content: flex-start; }
}

/* ───────── booth (a kiosk: everything large, always on the dark stage) ─────────
   The kiosk is exactly one screen in both tablet orientations: nothing scrolls.
   Her size follows the window height; the card replaces the microphone. */
.kb-body { background: var(--bk-hero-bg); color: var(--bk-hero-fg); touch-action: manipulation; }
html:has(.kb:not([hidden])) { overflow: hidden; }
.kb { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.kb > .kt { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.kb-bar { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) clamp(16px, 3vw, 28px) 0; min-height: 64px; }
.kb-bar .bk-brand { color: var(--bk-hero-fg); pointer-events: none; }
.kb-bar__name { font-weight: 700; padding-left: 10px; border-left: 1px solid var(--bk-line-strong); line-height: 1.2; white-space: nowrap; }
.kb-bar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.kb-bar .bk-seg__item { min-height: 48px; padding: 0 18px; font-size: var(--bk-text-md); }
.kb-bar .bk-btn { min-height: 52px; }
/* a booth opened on a phone: the same bar, tighter, so nothing pushes the page wider than the screen */
@media (max-width: 560px) {
  .kb-bar { gap: 8px; padding-inline: 12px; min-height: 56px; }
  .kb-bar__name { padding-left: 8px; }
  .kb-bar__right { gap: 4px; }
  .kb-bar .bk-seg__item { min-height: 44px; padding: 0 10px; font-size: var(--bk-text-sm); }
  .kb-bar .bk-btn { min-height: 44px; padding: 0 12px; font-size: var(--bk-text-sm); }
}
.kb .kt-main { flex: 1 1 0; min-height: 0; max-width: 900px; gap: clamp(8px, 1.6vh, 18px); justify-content: center; padding-block: clamp(8px, 1.6vh, 16px) calc(clamp(10px, 2vh, 20px) + env(safe-area-inset-bottom)); }
.kb .kt-side { gap: clamp(8px, 1.6vh, 16px); }
/* the kiosk's start button: big enough to find and press at a glance; other languages said under it */
.kb .kb-attract .bk-btn--lg { min-height: 72px; padding-inline: 36px; font-size: var(--bk-text-lg); }
.kb-attract__langs { margin: 0; font-size: var(--bk-text-sm); color: var(--bk-fg-2); letter-spacing: .02em; }
.kb .kt-stage { width: min(60%, 380px, 30dvh); }
.kb .kt:not([data-phase="intro"]) .kt-stage { width: min(56%, 340px, 28dvh); }
.kb .kt[data-card] .kt-stage, .kb .kt[data-phase="stopped"] .kt-stage { width: min(36%, 250px, 22dvh); }
.kb .kt-says__text { font-size: clamp(1.375rem, 1rem + 1.9vw, 2rem); max-width: 20em; }
.kb .kt-says__text[data-size="mid"] { font-size: clamp(1.1875rem, 1rem + 1.1vw, 1.5rem); }
.kb .kt-says__text[data-size="long"], .kb .kt[data-card] .kt-says__text { font-size: var(--bk-text-md); }
.kb .kt-heard, .kb .kt-status, .kb .kt-mic__hint { font-size: var(--bk-text-md); }
.kb .kt-mic { --_size: clamp(88px, 15vh, 128px); }
.kb .bk-btn--lg { min-height: 64px; padding: 0 32px; font-size: var(--bk-text-xl); }
.kb .bk-btn { min-height: 56px; }
.kb .bk-composer__input { min-height: 52px; font-size: var(--bk-text-lg); padding-block: 12px; max-height: 6.5em; }
.kb .bk-composer > .bk-btn { min-height: 52px; width: 52px; }
/* the booth card: compact enough to fit a landscape tablet with her words above it */
.kb .kc { gap: clamp(10px, 1.6vh, 14px); padding: clamp(14px, 2vh, 20px); }
.kb .kc__actions { --_pad: clamp(14px, 2vh, 20px); padding-top: 10px; }
.kb .kc__head { margin-bottom: 4px; min-height: 24px; }
.kb .kc__line .bk-textarea { font-size: clamp(15px, 2.1vh, 18px); min-height: 48px; padding-block: 8px; }
.kb .kc__line p { font-size: clamp(15px, 2.1vh, 18px); padding-block: 8px; }
.kb .kc__line::before { margin-top: 20px; }
.kb .kc__tool { padding: 10px 14px; }
.kb .kc__tool strong { font-size: var(--bk-text-lg); }
.kb .kc__tool span, .kb .kc__title { font-size: var(--bk-text-md); }
.kb .kc__tool small { font-size: var(--bk-text-sm); }
.kb .kc__actions .bk-btn { flex: 1 1 200px; }
@media (min-width: 640px) { .kb .kc__tools:has(> :nth-child(2)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.kb-attract { display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2.4vh, 24px); text-align: center; width: 100%; }
.kb-attract__prompt { font-size: clamp(1.625rem, 1.1rem + 2.6vw, 2.75rem); font-weight: 700; line-height: 1.3; color: var(--bk-hero-fg); }
.kb-attract .kt-note { max-width: 640px; font-size: var(--bk-text-sm); }
@media (max-height: 700px) { .kb .kt-mic { --_size: 84px; } }
/* booth, live: with the card up, the tap button stays (small, beside its hint) and the text box and the end
   button go, so the card, her words and the button fit one screen in both orientations; the card carries the actions */
.kb .kt[data-mode="live"][data-card] .kt-type, .kb .kt[data-mode="live"][data-card] .kt-foot { display: none; }
/* the booth never scrolls: with a card up, the text box goes (the tap button and 「会話を終える」 stay) */
.kb .kt[data-mode="live"][data-contact] .kt-type { display: none; }
.kb .kt[data-mode="live"][data-card] .kt-controls { flex-direction: row; flex-wrap: nowrap; justify-content: center; gap: 14px; padding-top: 0; }
.kb .kt[data-mode="live"][data-card] .kt-mic { --_size: 64px; }
.kb .kt[data-mode="live"][data-card] .kt-mic__hint { flex: 0 1 auto; min-height: 0; text-align: left; }
/* the card holds what the visitor said; her words above it are enough */
.kb .kt[data-mode="live"][data-card] .kt-heard { display: none; }
.kb .kt[data-mode="live"][data-card] .kt-side { gap: clamp(6px, 1.2vh, 12px); }
.kb .kt-foot .bk-btn { min-height: 52px; }
@media (min-width: 860px) {
  .kb .kt-main { max-width: 1180px; grid-template-columns: auto minmax(0, 620px); min-height: 0; height: 100%; align-content: center; }
  /* she is as tall as the screen allows: the whole figure on every screen, smaller once the card is there */
  .kb .kt-stage, .kb .kt:not([data-phase="intro"]) .kt-stage { width: auto; height: min(72dvh, 560px); min-width: 0; aspect-ratio: 360 / 486; }
  .kb .kt[data-card] .kt-stage, .kb .kt[data-phase="stopped"] .kt-stage { width: auto; height: min(46dvh, 360px); }
  .kb .kt[data-card] .kt-main { grid-template-columns: auto minmax(0, 700px); }
  .kb-attract { align-items: flex-start; text-align: left; }
}
/* the "going back to the start" notice lives in the top bar, so it never covers the card or a button */
.kb-idle { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.kb-idle__in { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; border-radius: var(--bk-r-pill); background: var(--bk-surface); color: var(--bk-fg); box-shadow: var(--bk-shadow-2); font-size: var(--bk-text-md); font-weight: 700; }
.kb-idle__in span { white-space: nowrap; }
.kb-idle__in .bk-btn { min-height: 44px; }
.kb-pin { letter-spacing: .5em; text-align: center; font-family: var(--bk-font-latin); font-size: 1.75rem; min-height: 64px; }

/* the staff list: an ordinary page (the window scrolls, nothing else does) */
.kb-staff { background: var(--bk-bg); color: var(--bk-fg); min-height: 100dvh; padding: calc(8px + env(safe-area-inset-top)) var(--bk-gutter) calc(40px + env(safe-area-inset-bottom)); }
.kb-staff__in { max-width: 1180px; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; }
.kb-staff__top { position: sticky; top: 0; z-index: var(--bk-z-sticky); display: flex; flex-direction: column; gap: 12px; padding-block: 10px; background: var(--bk-bg); border-bottom: 1px solid var(--bk-line); }
.kb-staff__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.kb-staff__title h1 { font-size: var(--bk-text-2xl); line-height: 1.3; white-space: nowrap; }
.kb-staff__booth { min-width: 0; color: var(--bk-fg-2); font-size: var(--bk-text-sm); }
.kb-staff__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.kb-staff .bk-table { font-size: var(--bk-text-md); }
.kb-staff .bk-table td { vertical-align: top; }
.kb-staff__heard { min-width: 16em; }
.kb-staff__heard p { margin: 0; line-height: 1.6; }
.kb-staff__heard .bk-cell__sub { margin-top: 4px; }
.kb-staff__who { min-width: 9em; max-width: 16em; }
.kb-staff__who .bk-truncate { display: block; max-width: 100%; }
.kb-staff__co { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 24px; }
/* on touch screens the company name is a 44 px target; the extra height is taken back so the row does not grow */
@media (pointer: coarse), (max-width: 720px) { .kb-staff__co { min-height: 44px; margin-block: -10px; } }
.kb-staff__co[aria-expanded="true"] { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.kb-staff__who .bk-badge { margin-top: 6px; }
.kb-staff__when { line-height: 1.5; }
.kb-staff__when span { display: block; }
/* on a phone the list becomes cards: every cell takes the full width again */
@media (max-width: 640px) {
  .kb-staff .bk-table--cards td.is-fit { width: 100%; white-space: normal; }
  .kb-staff__when span { display: inline; margin-left: 8px; }
  .kb-staff__heard, .kb-staff__who { min-width: 0; max-width: none; }
  .kb-staff__who > div { min-width: 0; }
}
.kb-staff__count { font-size: var(--bk-text-sm); color: var(--bk-fg-2); white-space: nowrap; }

/* ───────── face (her head on a dark screen; a display surface, not a document) ───────── */
.kf { margin: 0; background: var(--bk-hero-bg); touch-action: none; }
.kf[data-bg="black"] { background: #000; }
.kf[data-bg="paper"] { background: var(--bk-bg); }
/* the stage is exactly the screen; she fills the space inside its margin and keeps her shape (the SVG letterboxes itself) */
.kf-stage { position: fixed; inset: 0; padding: 5vmin; display: block; }
.kf[data-shape="round"] .kf-stage { padding: 11vmin; }
.kf-stage > .kito { width: 100%; height: 100%; }
/* two round screens: each as large as the smaller of the height and half the width, centred */
.kf-eyes { width: 100%; height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); gap: 4vmin; }
.kf-eyes > div { min-width: 0; min-height: 0; position: relative; }
/* each eye fills its half and keeps its round shape (the drawing letterboxes itself), at any screen shape */
.kf-eyes .kito { position: absolute; inset: 0; width: 100%; height: 100%; }
.kf-caption { position: fixed; inset: auto 0 5% 0; z-index: var(--bk-z-sticky); text-align: center; color: var(--bk-hero-fg); font-size: clamp(1rem, 3vw, 2rem); font-weight: 700; padding-inline: 6%; pointer-events: none; text-wrap: balance; }

/* ───────── 404 ───────── */
.km { padding-block: clamp(24px, 6vw, 64px); text-align: center; }
.km #kito { width: min(220px, 60%); margin-inline: auto; }
.km .kito { width: 100%; }
.km .bk-row { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .kito .k-head__float, .kito .k-body, .kl-prop--voice .kl-bars path { animation: none !important; }
  .kl-reveal { opacity: 1; transform: none; }
}
