/* [****] live — Stage 6 styles.
   Phone screens built to the [****]Bot design; the inspector is demo chrome. */

:root {
  --teal: #2a8b9d;
  --teal-dark: #237b8c;
  --green: #74c264;
  --ink: #3a3d42;
  --ink-soft: #6b7077;
  --bot-bubble: #f1f1f1;
  --line: #e6e6e6;
  --bg: #eef0f6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.stage {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px;
  min-height: 100vh;
}

/* ============================ PHONE ============================ */
.phone {
  position: relative;
  width: 393px;
  height: 820px;
  background: #fff;
  border-radius: 44px;
  border: 11px solid #111;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: none;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 26px 4px;
  font-size: 14px;
  font-weight: 600;
}
.statusbar .notch { width: 18px; height: 18px; background: #111; border-radius: 50%; }
.status-icons { display: inline-flex; gap: 5px; align-items: center; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 20px 6px;
  border-bottom: 1px solid #eee;
}
.topbar-spacer { width: 56px; }
.topbar-logo { width: 40px; height: 40px; display: inline-block; }
.credits {
  width: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #fbe7c4;
  color: #7a5a1e;
  font-weight: 700;
  font-size: 14px;
  border-radius: 14px;
  padding: 4px 8px;
}
.coin {
  width: 17px; height: 17px; border-radius: 50%;
  background: #f0a02a; color: #fff;
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.history-pill {
  position: absolute;
  top: 78px; left: 50%; transform: translateX(-50%);
  z-index: 5;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  padding: 9px 18px;
  font-size: 14px; font-weight: 600;
  color: var(--ink);
}
.history-pill .chev { color: var(--ink-soft); margin-left: 2px; }

.screen { flex: 1; position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---------- landing ---------- */
#landing { justify-content: space-between; padding: 0 26px 16px; }
.landing-inner {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  gap: 6px;
}
.big-logo { width: 132px; height: 132px; margin-bottom: 8px; }
.headline {
  font-size: 26px; line-height: 1.25; font-weight: 800; color: #43474d;
  margin: 6px 0 30px;
  min-height: 66px;
}
.prompt-label { font-size: 15px; color: var(--ink-soft); font-style: italic; margin: 0 0 14px; }

.tone-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  width: 100%;
}
.tone-chip {
  border: 1.5px solid var(--teal);
  color: var(--teal-dark);
  background: #fff;
  border-radius: 12px;
  padding: 16px 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tone-chip:hover { background: #f0f8fa; }
.tone-chip.selected { background: var(--teal); color: #fff; }
.tone-chip.placeholder {
  border-color: #cfcfcf; color: #b3b3b3; cursor: default;
}

.cta {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 26px;
  padding: 17px;
  font-size: 17px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(42,139,157,.32);
  transition: background .15s;
}
.cta:hover { background: var(--teal-dark); }

/* ---------- chat ---------- */
#chat { padding: 0; }
.messages {
  flex: 1; overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex; flex-direction: column; gap: 14px;
}
.bubble {
  max-width: 80%;
  padding: 13px 16px;
  font-size: 15px; line-height: 1.45;
  border-radius: 18px;
  white-space: pre-wrap;
}
.bubble.bot { background: var(--bot-bubble); color: #444; align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.me {
  align-self: flex-end;
  background: #fff;
  border: 1.5px solid var(--teal);
  color: var(--ink);
  border-bottom-right-radius: 6px;
}
.bubble.typing { color: var(--ink-soft); font-style: italic; }
.context-label {
  align-self: flex-start;
  border-left: 3px solid var(--teal);
  padding: 2px 0 2px 10px;
  font-size: 12px; font-weight: 700; color: var(--teal-dark);
  text-transform: none;
}

.composer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #eee;
}
.composer input {
  flex: 1;
  border: 1px solid #d8d8d8;
  border-radius: 22px;
  padding: 12px 16px;
  font-size: 15px;
  outline: none;
}
.composer input:focus { border-color: var(--teal); }
.mic, .send { border: none; background: none; cursor: pointer; padding: 4px; display: inline-flex; }

/* ---------- bottom nav ---------- */
.bottomnav {
  display: flex; justify-content: space-around; align-items: flex-start;
  padding: 8px 6px 14px;
  border-top: 1px solid #eee;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: #9aa0a6;
}
.nav-item.active { color: var(--teal); }
.nav-item.active label { color: var(--teal); font-weight: 700; }
.nav-logo { width: 24px; height: 24px; display: inline-block; }

/* ============================ INSPECTOR ============================ */
.inspector {
  width: 380px;
  flex: none;
  display: flex; flex-direction: column; gap: 16px;
}
.inspector-head h2 { margin: 0 0 4px; font-size: 17px; color: #2b2e33; }
.inspector-head .sub { margin: 0; font-size: 13px; color: var(--ink-soft); }

.panel {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* persona switcher */
.persona-switcher { display: flex; gap: 10px; }
.persona-card {
  flex: 1;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 4px;
  background: #f6f7f9;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.persona-card:hover { background: #eef0f3; }
.persona-card.active { border-color: var(--teal); background: #f0f8fa; }
.persona-card img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.persona-card .pc-name { display: block; font-size: 12px; font-weight: 700; margin-top: 5px; }

.persona-detail { margin-top: 14px; display: flex; gap: 12px; align-items: center; }
.persona-detail.empty { display: none; }
.persona-detail .pd-badge { width: 46px; height: 46px; object-fit: contain; flex: none; }
.persona-detail .pd-text { font-size: 13px; line-height: 1.4; }
.persona-detail .pd-role { color: var(--ink-soft); }
.persona-detail .pd-link {
  display: inline-block; margin-top: 4px;
  color: var(--teal-dark); font-weight: 600; font-size: 12.5px; text-decoration: none;
}
.persona-detail .pd-link:hover { text-decoration: underline; }

/* scenarios */
.scenario-list { display: flex; flex-direction: column; gap: 8px; }
.scenario-btn {
  display: flex; flex-direction: column; gap: 3px;
  text-align: left; width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.scenario-btn:hover { border-color: var(--teal); background: #f7fbfc; }
.scenario-btn .sc-label { font-weight: 700; font-size: 13px; color: var(--teal-dark); }
.scenario-btn .sc-msg { font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); }
.scenario-empty { font-size: 13px; color: var(--ink-soft); font-style: italic; margin: 0; }

/* trace */
.trace-panel h3 { display: flex; align-items: center; justify-content: space-between; }
.trace-tone {
  text-transform: none; letter-spacing: 0;
  font-size: 11px; font-weight: 700;
  background: #eef6f8; color: var(--teal-dark);
  border-radius: 10px; padding: 2px 8px;
}
.trace-empty { font-size: 13px; color: var(--ink-soft); margin: 0; }
.trace-block { margin-bottom: 16px; }
.trace-block:last-child { margin-bottom: 0; }
.trace-block .tb-head {
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--teal-dark); font-weight: 800; margin-bottom: 6px;
}
.trace-summary { font-size: 14px; line-height: 1.45; margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; font-weight: 600;
  border-radius: 10px; padding: 3px 9px;
  background: #f0f1f3; color: #555;
}
.chip.warn { background: #fdeee2; color: #b25b1b; }
.chip.alert { background: #fbe3e3; color: #b13434; }
.chip.ok { background: #e8f4e6; color: #3f7d35; }

.move-text { font-size: 14px; line-height: 1.45; margin: 0 0 6px; font-weight: 600; }
.reason-text { font-size: 13px; line-height: 1.45; color: var(--ink-soft); margin: 0; }

.supp-item {
  border-left: 3px solid #e3b48a;
  padding: 2px 0 2px 10px;
  margin-bottom: 10px;
}
.supp-item:last-child { margin-bottom: 0; }
.supp-opt { font-size: 13.5px; font-weight: 600; margin: 0 0 2px; }
.supp-why { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

/* ============================ ACCESS GATE ============================ */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #2a8b9d, #1f6f7e);
  padding: 24px;
}
.gate-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  width: 340px; max-width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.gate-logo { width: 72px; height: 72px; margin: 0 auto 10px; }
.gate-card h1 { margin: 0 0 6px; font-size: 24px; color: #2b2e33; }
.gate-card p { margin: 0 0 18px; font-size: 14px; color: var(--ink-soft); }
.gate-card input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #d8d8d8; border-radius: 12px;
  padding: 13px 14px; font-size: 15px; outline: none;
  margin-bottom: 12px;
}
.gate-card input:focus { border-color: var(--teal); }
.gate-card button {
  width: 100%;
  background: var(--teal); color: #fff;
  border: none; border-radius: 24px;
  padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.gate-card button:hover { background: var(--teal-dark); }
.gate-error { color: #c0392b !important; font-size: 13px; min-height: 18px; margin: 10px 0 0 !important; }

@media (max-width: 820px) {
  .stage { flex-direction: column; align-items: center; }
  .inspector { width: 393px; }
}
