/* Second screen "Der zweite Gast" (21.10.2026): a guest asks an AI about the visitor's place. Today the answer
   names others, with KI-fit it names the visitor's business with the right facts. Beside the phone the numbers
   from our own check, under the steps a 30-second self-test: copy the question or ask ChatGPT directly.
   The chat inside the phone is laid out at 390 px and scaled like the other phones (ki.js). */

.ki {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: clamp(24px, 4vw, 72px); overflow-x: clip;
  padding: calc(var(--hdr) + 8px) calc(var(--gutter) + max(0px, (100% - 1480px) / 2)) 32px;
}
.ki-copy { max-width: 560px; justify-self: end; }
.ki-lead { margin: 22px 0 0; max-width: 32em; font-size: var(--t-lead); line-height: 1.6; color: var(--muted); }
.ki .steps { margin-top: 28px; }
/* only the step on screen tells its story: three full steps and the self-test do not fit one screen */
.ki .step:not(.on) .st-t { display: none; }
.ki.auto .step.on .st-bar { transform: scaleY(0); animation: stbar var(--dur, 4s) linear forwards; transition: none; }
.ki.auto .step.on.last .st-bar { animation: none; transform: scaleY(1); }
.ki.seen .sv { opacity: 1; transform: none; transition: opacity .8s var(--ease) var(--d, 0s), transform 1s var(--expo) var(--d, 0s); }

/* ---------- the self-test ---------- */
.ki-test { margin-top: 26px; }
.ki-lbl { display: block; margin-bottom: 12px; font: 500 var(--t-label)/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ki-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ki-row input {
  flex: 1 1 180px; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px;
  background: rgba(255, 255, 255, .04); color: var(--fg); font: 400 15px/1 var(--font); outline: none; transition: border-color .2s, background .2s;
}
.ki-row input::placeholder { color: var(--dim); }
.ki-row input:focus { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .07); }
.ki-row .btn { flex: none; }
.ki-row .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- the stage: phone, numbers, caption ---------- */
.ki-stage {
  --ph: clamp(420px, calc(100svh - 250px), 640px);
  position: relative; display: grid; grid-template-columns: auto auto; grid-template-areas: "phone nums" "verdict verdict" "cap cap";
  justify-content: center; align-items: center; column-gap: clamp(22px, 3.4vw, 60px);
}
.kphone { grid-area: phone; position: relative; }
.kphone .phone { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 0 0 calc(var(--ph) * .006) #050506, 0 calc(var(--ph) * .06) calc(var(--ph) * .12) calc(var(--ph) * -.03) rgba(0, 0, 0, .7); }
.kphone .screen { background: #fafaf8; }

/* the numbers from our check, stacked like the clock on the assistant screen */
.ki-nums { grid-area: nums; margin: 0; display: grid; gap: clamp(18px, 3svh, 30px); max-width: 230px; }
.ki-nums div { display: grid; gap: 8px; }
.ki-nums dt { font: 200 clamp(56px, 5.6vw, 96px)/.86 var(--font); letter-spacing: -.045em; color: var(--fg); font-variant-numeric: tabular-nums; }
.ki-nums dt small { font-size: .42em; letter-spacing: -.02em; color: var(--dim); }
.ki-nums dd { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.ki-nums .s { display: none; }
.ki-nums div:last-child dt { color: var(--terra-lit); }

/* what happened to the visitor's business in the answer, readable outside the small phone */
.ki-verdict {
  grid-area: verdict; justify-self: center; display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 0; min-height: 34px;
  padding: 7px 14px 7px 10px; border-radius: 99px; font-size: 14.5px; font-weight: 500; color: var(--fg);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); opacity: 0; transform: translateY(6px);
  transition: opacity .45s ease, transform .6s var(--expo), border-color .3s, background .3s;
}
.ki-verdict i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--dim); }
.ki-verdict i::after { content: ''; width: 10px; height: 10px; background: #0a0a0b; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.ki-verdict.miss { opacity: 1; transform: none; border-color: rgba(210, 102, 74, .45); background: rgba(168, 69, 47, .12); }
.ki-verdict.miss i { background: var(--terra-lit); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2 2 8' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ki-verdict.hit { opacity: 1; transform: none; border-color: rgba(90, 196, 130, .45); background: rgba(52, 199, 89, .1); }
.ki-verdict.hit i { background: #5ac482; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='m1.6 5.3 2.2 2.2 4.6-5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ki-cap { grid-area: cap; justify-self: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin: 14px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.ki-cap .tag { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--terra-lit); border: 1px solid rgba(210, 102, 74, .45); padding: 5px 7px; border-radius: 2px; }
.ki-cap small { flex-basis: 100%; font-size: 12px; color: var(--dim); }
.ki-cap .s { display: none; }

/* ---------- inside the phone: an AI chat app, 390 px wide ---------- */
.k-ui { position: absolute; left: 0; top: 0; width: 390px; transform-origin: 0 0; overflow: hidden; display: flex; flex-direction: column;
  background: #fafaf8; color: #1a1a1d; font-family: 'Manrope', sans-serif; }
.k-sb { flex: none; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 40px; font: 600 15px/1 'Inter Tight', sans-serif; color: #111; }
.k-sb svg { fill: currentColor; display: block; }
.k-sb .sb-i { display: flex; gap: 6px; align-items: center; }
.k-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 12px; }
.k-top .ic { width: 34px; height: 34px; display: grid; place-items: center; color: #6b6b72; }
.k-top .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.k-top b { display: inline-flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.k-top b svg { width: 18px; height: 18px; fill: #1a1a1d; }
.k-msgs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 6px 18px 12px; overflow: hidden; }
.k-q { align-self: flex-end; max-width: 84%; padding: 11px 15px; border-radius: 20px; border-bottom-right-radius: 6px; background: #ececea; font-size: 15px; line-height: 1.4; font-weight: 500; animation: kpop .45s var(--expo) both; }
.k-search { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #6b6b72; animation: kpop .4s var(--expo) both; }
.k-search i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #c9c9ce; border-top-color: #1a1a1d; animation: kspin .8s linear infinite; }
.k-search.done i { border-color: #1a1a1d; animation: none; background: #1a1a1d; -webkit-mask: none; position: relative; }
.k-search.done i::after { content: ''; position: absolute; inset: 2px; background: #fafaf8; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='m1.6 5.3 2.2 2.2 4.6-5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='m1.6 5.3 2.2 2.2 4.6-5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.k-a { display: grid; gap: 10px; font-size: 14.5px; line-height: 1.5; }
.k-a > * { animation: kpop .5s var(--expo) both; }
.k-a p { margin: 0; }
.k-a ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.k-a li { position: relative; display: grid; gap: 4px; padding: 10px 12px 10px 38px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); animation: kpop .5s var(--expo) both; }
.k-a li::before { content: attr(data-n); position: absolute; left: 13px; top: 10px; font-weight: 700; color: #9a9aa0; }
.k-a li b { font-weight: 700; }
.k-a li span { color: #4d4d53; font-size: 13.5px; }
.k-a li small { justify-self: start; margin-top: 2px; padding: 3px 8px; border-radius: 99px; background: #f0f0ee; color: #6b6b72; font: 600 11px/1.2 'Inter Tight', sans-serif; }
.k-red { display: inline-block; height: 13px; border-radius: 3px; background: #1d1d20; vertical-align: -1px; }
.k-a li.you { background: #f1fbf4; box-shadow: inset 0 0 0 1.5px rgba(52, 168, 83, .55); }
.k-a li.you::before { color: #23863f; }
.k-a li.you small { background: rgba(52, 168, 83, .14); color: #1d6e34; }
.k-in { flex: none; display: flex; align-items: center; gap: 10px; margin: 0 14px 26px; padding: 6px 6px 6px 16px; border-radius: 99px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 6px 18px rgba(0, 0, 0, .05); }
.k-in span { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; font-size: 14.5px; color: #8a8a90; white-space: nowrap; overflow: hidden; }
.k-in span.typing { color: #1a1a1d; }
.k-in span.typing::after { content: ''; width: 2px; height: 18px; margin-left: 1px; background: #1a1a1d; animation: kcaret .9s steps(1) infinite; }
.k-in i { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #1a1a1d; }
.k-in i::after { content: ''; display: block; width: 100%; height: 100%; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 18V7m0 0-5 5m5-5 5 5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 18V7m0 0-5 5m5-5 5 5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }
.k-msgs.out > * { animation: none; opacity: 0; transform: translateY(-8px); transition: opacity .3s ease, transform .3s ease; }
@keyframes kpop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes kspin { to { transform: rotate(360deg); } }
@keyframes kcaret { 50% { opacity: 0; } }

/* ---------- smaller screens ---------- */
@media (min-width: 901px) and (max-height: 860px) {
  .ki-lead { display: none; }
  .ki-stage { --ph: clamp(400px, calc(100svh - 292px), 640px); }
  .ki-cap small { font-size: 11px; }
  .ki .steps { margin-top: 22px; }
  .ki .step { padding-block: 9px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .ki-nums { max-width: 170px; }
  .ki-nums dd { font-size: 12px; }
}
@media (max-width: 900px) {
  .ki { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0; min-height: 0; padding-top: calc(var(--hdr) + 22px); padding-bottom: 28px; }
  .ki-copy { display: contents; }
  .ki .eyebrow { order: 1; margin-bottom: 14px; font-size: 10.5px; letter-spacing: .14em; }
  .ki .h2 { order: 2; font-size: clamp(1.9rem, 8.4vw, 3rem); }
  .ki-lead, .ki-cap small, .ki-cap .l, .ki-lbl, .ki-row [data-lead] { display: none; }
  .ki-cap .s { display: inline; }
  .ki-cap .tag { padding: 4px 6px; font-size: 9.5px; }
  .ki-stage { order: 3; --ph: clamp(290px, calc(100svh - 515px), 500px); margin-top: 14px; grid-template-columns: auto; grid-template-areas: "phone" "nums" "verdict" "cap"; }
  .kphone { justify-self: center; }
  /* the numbers become one row under the phone, with short labels */
  .ki-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; gap: 12px; margin-top: 12px; }
  .ki-nums div { gap: 5px; }
  .ki-nums dt { font-size: clamp(30px, 8.6vw, 44px); }
  .ki-nums dd { font-size: 11px; line-height: 1.3; }
  .ki-nums .l { display: none; } .ki-nums .s { display: inline; }
  .ki-verdict { margin-top: 10px; font-size: 13.5px; }
  .ki-cap { margin-top: 8px; font-size: 12px; }
  /* the steps become three switches in a row; the verdict under the phone tells what happened */
  .ki .steps { order: 4; display: flex; gap: 6px; margin-top: 14px; border-left: 0; }
  .ki .steps li { flex: 1; min-width: 0; }
  .ki .step { justify-items: center; padding: 8px 6px; border: 1px solid var(--line); border-radius: 99px; text-align: center; }
  .ki .step b, .ki .st-t, .ki .st-bar { display: none !important; }
  .ki .st-k { font-size: 10px; letter-spacing: .1em; white-space: nowrap; }
  .ki .step.on { border-color: rgba(210, 102, 74, .6); background: rgba(168, 69, 47, .12); }
  .ki-test { order: 5; margin-top: 12px; }
  .ki-row { flex-wrap: nowrap; }
  .ki-row input { flex: 1 1 100px; }
}
@media (max-width: 360px) { .ki .st-k { font-size: 9px; letter-spacing: .06em; } }
@media (prefers-reduced-motion: reduce) {
  .k-q, .k-search, .k-a > *, .k-a li, .ki-verdict { transition: none !important; animation: none !important; }
  .k-search i { animation: none; }
}
.h2 .ki-who { color: inherit; }   /* the trade's word (Gäste, Kunden, Patienten) stays bright: .h2 span is the dim line */
