/* Screen 3 — the Kitty stage: chocolate-themed call screen with side panels.
   Phone in the center; Kitty intro + agent entries on the left; voice & personality
   settings on the right — all outside the phone, per Jack's direction. */

:root {
  --ck-bg-0: #150a07;
  --ck-bg-1: #2a1712;
  --ck-panel: rgba(255, 248, 240, 0.045);
  --ck-panel-border: rgba(201, 167, 126, 0.22);
  --ck-tan: #c9a77e;
  --ck-cream: #f6efe6;
  --ck-muted: #a08a75;
  --ck-accent: #e0b98a;
  --ck-live: #55c07a;
}

body.phone-stage.kitty-stage {
  background:
    radial-gradient(90% 70% at 50% 18%, var(--ck-bg-1) 0%, var(--ck-bg-0) 72%);
  color: var(--ck-cream);
  display: grid;
  grid-template-columns: minmax(260px, 340px) auto minmax(280px, 360px);
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-content: center;
  column-gap: 28px;
  row-gap: 6px;
  padding: 18px 26px 12px;
  box-sizing: border-box;
  overflow: hidden;
}
.kitty-stage .phone-wrap { grid-column: 2; grid-row: 1; }
.kitty-stage .stage-caption { grid-column: 1 / -1; grid-row: 2; justify-self: center; }

/* ---------- side panels ---------- */
.side {
  background: var(--ck-panel);
  border: 1px solid var(--ck-panel-border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  backdrop-filter: blur(6px);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.55;
}
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: rgba(201,167,126,.25); border-radius: 3px; }
.side h2 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ck-cream);
  letter-spacing: .01em;
}
.side .sub { color: var(--ck-muted); font-size: 11.5px; margin-bottom: 14px; }
.side h3 {
  margin: 16px 0 8px;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ck-tan);
  font-weight: 700;
}

/* Hershey wordmark row (text mark, no logo asset) */
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.hershey-mark {
  font-weight: 900;
  letter-spacing: .1em;
  font-size: 17px;
  color: var(--ck-tan);
}
.brand-div { width: 1px; height: 16px; background: var(--ck-panel-border); }
.brand-sub { font-size: 12px; color: var(--ck-muted); }

.kitty-rules.do li::marker { color: #55c07a; }
.kitty-rules.dont li::marker { color: #d9463e; }

/* icon chip buttons (settings) */
.chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip {
  font: inherit;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: rgba(21, 10, 7, .5);
  border: 1px solid var(--ck-panel-border);
  border-radius: 10px;
  color: var(--ck-cream);
  font-size: 12.5px; font-weight: 700;
  padding: 9px 11px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.chip .ci { font-size: 16px; }
.chip .ct { font-size: 10px; font-weight: 500; color: var(--ck-muted); }
.chip:hover:not([disabled]) { background: rgba(255,248,240,.06); }
.chip.active { border-color: var(--ck-tan); background: rgba(201,167,126,.14); }
.chip.active .ct { color: var(--ck-tan); }
.chip[disabled] { opacity: .45; cursor: not-allowed; }

/* agent entry cards */
.entry {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-bottom: 6px;
}
.entry:hover { background: rgba(255,248,240,.05); }
.entry.active {
  background: rgba(201,167,126,.12);
  border-color: var(--ck-tan);
}
.entry img {
  width: 46px; height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: #3a241a;
}
.entry .e-name { font-weight: 700; font-size: 13px; color: var(--ck-cream); }
.entry .e-tag { font-size: 11px; color: var(--ck-muted); }
.entry .e-dot {
  margin-left: auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--ck-muted);
  flex-shrink: 0;
}
.entry.active .e-dot { background: var(--ck-tan); border-color: var(--ck-tan); }

.kitty-desc { color: var(--ck-cream); opacity: .88; font-size: 12.5px; }
.kitty-rules { margin: 10px 0 0; padding-left: 16px; color: var(--ck-muted); font-size: 11.5px; }
.kitty-rules li { margin-bottom: 4px; }

/* ---------- settings panel ---------- */
.set-row { margin-bottom: 14px; }
.set-row label {
  display: block;
  font-size: 11px;
  color: var(--ck-muted);
  margin-bottom: 5px;
  letter-spacing: .04em;
}
.set-row select, .set-row textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(21, 10, 7, .6);
  border: 1px solid var(--ck-panel-border);
  border-radius: 8px;
  color: var(--ck-cream);
  font: inherit;
  font-size: 12.5px;
  padding: 8px 10px;
}
.set-row textarea { resize: vertical; min-height: 52px; }
.slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.slider-row .s-name { width: 74px; font-size: 12px; color: var(--ck-cream); }
.slider-row input[type=range] {
  flex: 1;
  accent-color: var(--ck-tan);
  height: 4px;
}
.slider-row .s-val {
  width: 34px; text-align: right;
  font-size: 11px; color: var(--ck-muted);
  font-variant-numeric: tabular-nums;
}
.slider-ends { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ck-muted); margin: -6px 0 10px 84px; }

.btn-tan {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  border: 0;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  background: var(--ck-tan);
  color: #241310;
  width: 100%;
}
.btn-tan:hover:not([disabled]) { filter: brightness(1.08); }
.btn-tan[disabled] { opacity: .4; cursor: not-allowed; }
.btn-ghost {
  font: inherit; font-size: 12px; font-weight: 600;
  background: transparent; border: 1px solid var(--ck-panel-border);
  color: var(--ck-cream); border-radius: 8px; padding: 7px 14px; cursor: pointer;
  width: 100%;
  margin-top: 8px;
}
.btn-ghost:hover:not([disabled]) { background: rgba(255,248,240,.06); }
.btn-ghost[disabled] { opacity: .4; cursor: not-allowed; }

.lamp-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ck-muted); margin-bottom: 12px; }
.lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--ck-muted); flex-shrink: 0; }
.lamp.on { background: var(--ck-live); animation: puls 1.8s ease-in-out infinite; }
.lamp.err { background: #d9463e; }
@keyframes puls { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.set-note { font-size: 10.5px; color: var(--ck-muted); line-height: 1.5; margin-top: 10px; }
.set-status { font-size: 11.5px; color: var(--ck-accent); min-height: 16px; margin-top: 8px; }

/* ---------- phone call screen (warmed) ---------- */
.call-screen {
  background: linear-gradient(180deg, #1d1410 0%, #0d0806 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.call-top { flex-shrink: 0; text-align: center; padding-top: 30px; }
.call-avatar {
  width: 92px; height: 92px;
  border-radius: 50%;
  overflow: hidden;
  background: #3a241a;
  margin: 0 auto 12px;
  border: 2px solid rgba(201,167,126,.4);
}
.call-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.call-avatar.mono {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #3a241a, #241310);
}
.call-avatar.mono span {
  font-weight: 900; font-size: 40px; letter-spacing: .04em;
  color: var(--ck-tan);
}
.callee { font-size: 18px; font-weight: 600; }
.call-sub { font-size: 12px; color: var(--ck-muted); margin-top: 4px; }
.call-timer { font-size: 13px; color: #d9cec2; margin-top: 8px; font-variant-numeric: tabular-nums; }

.waveform {
  height: 26px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  margin-top: 10px;
  opacity: 0; transition: opacity .3s;
}
.waveform.speaking { opacity: 1; }
.waveform i {
  width: 3.5px; border-radius: 2px;
  background: var(--ck-tan);
  height: 6px;
  animation: wave 1s ease-in-out infinite;
}
.waveform i:nth-child(2) { animation-delay: .1s; }
.waveform i:nth-child(3) { animation-delay: .2s; }
.waveform i:nth-child(4) { animation-delay: .3s; }
.waveform i:nth-child(5) { animation-delay: .4s; }
.waveform i:nth-child(6) { animation-delay: .5s; }
.waveform i:nth-child(7) { animation-delay: .6s; }
@keyframes wave { 0%,100% { height: 5px; } 50% { height: 22px; } }

.captions {
  flex: 1; min-height: 0;
  margin: 14px 14px 8px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  overflow: hidden;
}
.cap-label {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: #6f5c4d; text-align: center; margin-bottom: 2px;
}
.cap { font-size: 14px; line-height: 1.5; opacity: .34; transition: opacity .3s; }
.cap.current { opacity: 1; }
.cap .who { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.cap.kitty .who { color: var(--ck-tan); }
.cap.darnell .who { color: #9fb6d8; }

.live-btn-row { flex-shrink: 0; text-align: center; padding: 4px 0 2px; }
.live-inline-btn {
  font: inherit; font-size: 12px; font-weight: 700;
  background: rgba(201,167,126,.16);
  border: 1px solid rgba(201,167,126,.5);
  color: var(--ck-accent);
  border-radius: 999px; padding: 6px 16px; cursor: pointer;
}
.live-inline-btn:hover { background: rgba(201,167,126,.28); }

.call-controls {
  flex-shrink: 0;
  display: flex; justify-content: center; gap: 22px;
  padding: 10px 0 26px;
}
.cbtn {
  width: 54px; height: 54px; border-radius: 50%;
  background: #33241c; color: #e8ddd2;
  display: flex; align-items: center; justify-content: center;
  opacity: .45;
}
.cbtn.end { background: #d9463e; opacity: 1; }
.cbtn.end.pulse { animation: endpulse .7s ease 1; }
@keyframes endpulse { 50% { transform: scale(1.12); } }

.toast {
  position: absolute; top: 54px; left: 10px; right: 10px;
  background: rgba(32, 22, 16, .97);
  border: 1px solid rgba(201,167,126,.35);
  border-radius: 14px; padding: 10px 12px;
  transform: translateY(-200%);
  opacity: 0;
  pointer-events: none;
  transition: transform .45s cubic-bezier(.2,.9,.3,1.1), opacity .3s;
  z-index: 5;
}
.toast.show { transform: none; opacity: 1; }
.toast .t-head { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ck-muted); margin-bottom: 4px; }
.toast .t-ico {
  width: 16px; height: 16px; border-radius: 4px;
  background: #1f7a6d; color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.toast .t-body { font-size: 12.5px; line-height: 1.45; color: #f0e8de; }

.capture-banner {
  margin-top: 8px; font-size: 12px; color: var(--ck-live);
  text-align: center; opacity: 0; transition: opacity .4s;
}
.capture-banner.show { opacity: 1; }
.call-ended-dim .call-top, .call-ended-dim .captions { opacity: .55; }

/* post-call summary card (inside the phone, replaces captions after a live call) */
.call-summary {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(32, 22, 16, .55);
  border: 1px solid rgba(201, 167, 126, .3);
  border-radius: 14px;
  padding: 12px 12px 10px;
  overflow: hidden;
}
.cs-head { font-size: 13.5px; font-weight: 700; color: var(--ck-cream); }
.cs-sub { font-size: 10.5px; color: var(--ck-live); margin: 2px 0 8px; }
.cs-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 4px; }
.cs-list::-webkit-scrollbar { width: 4px; }
.cs-list::-webkit-scrollbar-thumb { background: rgba(201,167,126,.3); border-radius: 2px; }
.cs-row { font-size: 12px; line-height: 1.45; }
.cs-row .cs-who { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cs-row.k .cs-who { color: var(--ck-tan); }
.cs-row.d .cs-who { color: #9fb6d8; }
.cs-row .cs-text { color: #f0e8de; opacity: .92; }

/* provenance chips reused from tokens-phone */
.stage-caption { color: var(--ck-muted); }
.prov-chip.real { color: var(--ck-live); }
.prov-chip.scripted { color: var(--ck-muted); }

/* narrow fallback: stack panels below phone */
@media (max-width: 1150px) {
  body.phone-stage.kitty-stage {
    display: flex; flex-direction: column; overflow-y: auto; height: auto; min-height: 100dvh;
  }
  .side { max-height: none; width: min(560px, 92vw); }
}
