/* ------------------------------------------------------------------ tokens */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --card: #f6f7f9;

  --ink: #12141a;
  --ink-soft: #464b55;
  --muted: #7f858f;
  --faint: #a8adb5;

  --line: #e8e5df;
  --line-strong: #d6d2ca;

  --accent: #1e40af;
  --accent-hover: #1a3899;
  --accent-soft: #eef2fc;
  --ring: rgba(30, 64, 175, .28);

  --green: #3f6b52;
  --danger: #a4473b;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(18, 20, 26, .04);
  --shadow-sm: 0 1px 2px rgba(18, 20, 26, .04), 0 6px 16px -12px rgba(18, 20, 26, .18);
  --shadow-md: 0 1px 3px rgba(18, 20, 26, .05), 0 14px 34px -18px rgba(18, 20, 26, .22);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: .2s;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: #dde5f9; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------- shell */

.viewport {
  height: 100dvh;
  height: var(--visible-height, 100dvh);
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
}

.bar {
  flex: 0 0 auto;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 20;
}

.bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

.bar-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
  white-space: nowrap;
}

.pulse {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 107, 82, .38); }
  70% { box-shadow: 0 0 0 8px rgba(63, 107, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 107, 82, 0); }
}

.bar-right { display: flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------- language control */

.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

.lang:hover { border-color: var(--line-strong); color: var(--ink); }

.lang:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  color: var(--ink);
}

.lang-icon { flex: 0 0 auto; color: var(--muted); pointer-events: none; transition: color var(--dur) var(--ease); }
.lang:hover .lang-icon, .lang:focus-within .lang-icon { color: var(--accent); }

.lang-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.005em;
  color: inherit;
  cursor: pointer;
  outline: none;
}

.lang-btn:focus-visible { outline: none; }

.lang-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Popover menu: a native <select> popup cannot be styled at all. */
.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 40;
  display: grid;
  gap: 1px;
  min-width: 236px;
  max-height: min(58vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 20, 26, .04),
              0 20px 48px -20px rgba(18, 20, 26, .3);
  animation: menu-in .16s var(--ease) both;
}

.lang-menu[hidden] { display: none; }

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.lang-item {
  appearance: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  text-align: start;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .12s var(--ease), color .12s var(--ease);
}

.lang-item:hover,
.lang-item:focus-visible {
  background: rgba(18, 20, 26, .05);
  outline: none;
}

.lang-item[aria-selected="true"] {
  background: var(--accent-soft, rgba(30, 64, 175, .09));
  color: var(--accent-ink, var(--accent));
}

.lang-native { font-size: 13px; font-weight: 500; letter-spacing: -.005em; }
.lang-english { font-size: 10.5px; color: var(--muted); letter-spacing: .01em; white-space: nowrap; }

.lang-item[aria-selected="true"] .lang-english { color: inherit; opacity: .7; }

.lang-caret {
  flex: 0 0 auto;
  color: var(--muted);
  pointer-events: none;
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.lang:hover .lang-caret { color: var(--ink-soft); }
.lang:focus-within .lang-caret { color: var(--accent); transform: translateY(1px); }

.ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.ghost:hover { color: var(--ink); background: rgba(18, 20, 26, .045); }
.ghost:active { background: rgba(18, 20, 26, .07); }

/* ----------------------------------------------------------------- landing */

.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 88px;
  max-width: 560px;
}

.landing h1,
.handoff h2 {
  margin: 0 0 18px;
  font-size: clamp(36px, 6.2vw, 56px);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 500;
  text-wrap: balance;
}

.sub {
  margin: 0 0 32px;
  max-width: 430px;
  font-size: 15px;
  line-height: 1.62;
  letter-spacing: -.005em;
  color: var(--ink-soft);
}

/* shared button geometry: text is always optically centred */

.btn,
.enter,
.nudge-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.enter {
  align-self: flex-start;
  min-height: 48px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(30, 64, 175, .22);
}

.enter:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 10px -3px rgba(30, 64, 175, .42);
  transform: translateY(-1px);
}

.enter:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(30, 64, 175, .22); }
.enter:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

.enter span {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  opacity: .85;
  transition: transform var(--dur) var(--ease);
}

.enter:hover span { transform: translateX(2px); }

.start-error {
  margin: 14px 0 0;
  min-height: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--danger);
}

/* -------------------------------------------------------------------- room */

.room { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.conversation-progress { flex: 0 0 auto; padding: 2px 0 20px; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.progress-meta > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.progress-track { height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-fill { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .35s var(--ease); }
.mobile-human { display: none; }
.retry-reply { margin-top: 8px; appearance: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; font: inherit; font-size: 12px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.retry-reply:disabled { opacity: .5; cursor: wait; }

.thread {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 2px 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.thread::-webkit-scrollbar,
.composer textarea::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.thread::-webkit-scrollbar-button,
.composer textarea::-webkit-scrollbar-button,
.composer textarea::-webkit-resizer { display: none; }

.turn {
  position: relative;
  display: flex;
  margin-bottom: 26px;
  animation: rise .32s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.turn.me { justify-content: flex-end; }

.bubble {
  max-width: 78%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14.5px;
  line-height: 1.7;
  letter-spacing: -.003em;
}

.turn.ai .bubble { padding: 2px 0; color: var(--ink); }
.turn.ai .bubble p { margin: 0 0 10px; }
.turn.ai .bubble p:last-child { margin-bottom: 0; }

.turn.ai .bubble code {
  font-size: 12.5px;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(18, 20, 26, .06);
}

.turn.me .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px 16px 6px 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -.14em;
  background: var(--green);
  animation: blink 1.05s steps(2, start) infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.thinking { display: inline-flex; gap: 5px; align-items: center; padding: 10px 0; }

.thinking i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b9bdb3;
  animation: think 1.25s infinite ease-in-out;
}

.thinking i:nth-child(2) { animation-delay: .16s; }
.thinking i:nth-child(3) { animation-delay: .32s; }

@keyframes think {
  0%, 60%, 100% { transform: translateY(0); opacity: .55; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.copy {
  position: absolute;
  left: 0;
  bottom: -19px;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1;
  color: var(--faint);
  cursor: pointer;
  opacity: .55;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}

.turn:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--ink); }

/* ------------------------------------------------------------------- nudge */

.nudge {
  margin: 4px 0 26px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  animation: rise .32s var(--ease) both;
}

.nudge p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.nudge-btn {
  min-height: 38px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 1px 2px rgba(30, 64, 175, .22);
}

.nudge-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 10px -3px rgba(30, 64, 175, .42);
  transform: translateY(-1px);
}

.nudge-btn:active { transform: translateY(0); }

.nudge-calendar {
  width: 100%;
  min-height: 58px;
  justify-content: flex-start;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 13px;
  text-decoration: none;
  text-align: start;
}

.nudge-calendar-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}

.nudge-calendar-copy {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}

.nudge-calendar-copy strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}

.nudge-calendar-copy small {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  line-height: 1.3;
}

.nudge-calendar-arrow {
  flex: 0 0 auto;
  font-size: 18px;
  opacity: .72;
  transition: transform .16s ease, opacity .16s ease;
}

.nudge-calendar:hover .nudge-calendar-arrow { opacity: 1; transform: translateX(3px); }

/* ------------------------------------------------------------------ status */

.status {
  flex: 0 0 auto;
  margin: 0 0 10px;
  padding: 0 4px;
  min-height: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.status.active { opacity: 1; }
.status:empty { display: none; }

.status.active.recording::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--danger);
  vertical-align: .08em;
  animation: rec 1.4s ease-in-out infinite;
}

@keyframes rec {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

/* ------------------------------------------------------------- transcribed */

.transcribed {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 9px 10px 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  animation: rise .28s var(--ease) both;
}

.transcribed p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.transcribed-edit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}

.transcribed-edit:hover { background: rgba(18, 20, 26, .05); }

/* ---------------------------------------------------------------- composer */

.composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.composer:focus-within {
  border-color: #c9c4ba;
  box-shadow: 0 0 0 3px rgba(18, 20, 26, .04), var(--shadow-md);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  max-height: 168px;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: none;
  resize: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}

.composer textarea::placeholder { color: var(--faint); }

.send {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.send:disabled { background: #eceae4; color: var(--faint); cursor: default; }

.send:not(:disabled):hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px -2px rgba(30, 64, 175, .45);
  transform: translateY(-1px);
}

.send:not(:disabled):active { transform: translateY(0) scale(.96); }

/* --------------------------------------------------------------------- mic */

.mic {
  flex: 0 0 auto;
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  cursor: pointer;
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.mic:hover { color: var(--ink-soft); background: rgba(18, 20, 26, .05); }
.mic:active { transform: scale(.95); }

.mic .mic-rec { display: none; }
.mic.recording .mic-idle { display: none; }

.mic.recording {
  color: var(--danger);
  background: rgba(164, 71, 59, .1);
  animation: micPulse 1.7s ease-in-out infinite;
}

.mic.recording .mic-rec { display: block; }

.mic.recording::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  animation: rec 1.4s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(164, 71, 59, .26); }
  60% { box-shadow: 0 0 0 7px rgba(164, 71, 59, 0); }
}

.mic:disabled { cursor: default; opacity: .45; }

.hint {
  flex: 0 0 auto;
  margin: 12px 0 18px;
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: .005em;
  color: var(--faint);
  text-align: center;
}

/* ----------------------------------------------------------------- handoff */

.handoff {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding-bottom: 40px;
  scrollbar-width: thin;
  scrollbar-color: #dcd8d1 transparent;
}

.handoff::-webkit-scrollbar { width: 6px; }
.handoff::-webkit-scrollbar-thumb { background: #ded9d1; border-radius: 10px; }

.handoff-inner {
  margin: auto 0;
  width: 100%;
  max-width: 520px;
  padding: 32px 0 8px;
}

.handoff h2 { font-size: clamp(30px, 5.2vw, 44px); margin-bottom: 14px; }

.handoff .sub { margin-bottom: 28px; max-width: 400px; }

/* ---------------------------------------------------------- calendar card */

.cal-cta {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: all .16s ease;
  cursor: pointer;
  margin: 6px 0 16px;
}

.cal-cta:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px -6px rgba(30, 64, 175, .2);
  transform: translateY(-2px);
}

.cal-cta:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.cal-logo {
  flex: 0 0 auto;
  display: block;
  width: 28px;
  height: 28px;
}

.cal-cta-copy {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cal-cta-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.012em;
  color: var(--ink);
}

.cal-cta-when {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.cal-arrow {
  flex: 0 0 auto;
  color: var(--accent);
  opacity: .6;
  transition: all .16s ease;
}

.cal-cta:hover .cal-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.cal-foot {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}


/* -------------------------------------------------------------------- form */

.handoff form { display: grid; gap: 16px; margin-top: 2px; }

.handoff label {
  display: grid;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .075em;
  line-height: 1.3;
  color: var(--muted);
  text-transform: uppercase;
}

.handoff input,
.handoff textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.003em;
  text-transform: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  resize: vertical;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

.handoff input::placeholder,
.handoff textarea::placeholder { color: var(--faint); }

.handoff input:hover,
.handoff textarea:hover { border-color: var(--line-strong); }

.handoff input:focus,
.handoff textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.handoff .enter { margin-top: 4px; }

/* -------------------------------------------------------------------- done */

.done {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  animation: rise .3s var(--ease) both;
}

.done-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(63, 107, 82, .1);
  color: var(--green);
  font-size: 13px;
  line-height: 1;
}

.done strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.done p { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }

[hidden] { display: none !important; }

/* ---------------------------------------------------------------- adaptive */

@media (min-width: 600px) {
  .cal-actions { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (max-width: 620px) {
  .viewport { padding: 0 18px; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bar { height: 64px; }
  .landing { padding-bottom: 64px; }
  .bubble { max-width: 88%; }
  .hint { font-size: 9.5px; margin-bottom: 14px; }
  .handoff-inner { padding-top: 20px; }
  .cal-card { padding: 16px; }
  .room { position: relative; padding-bottom: 60px; }
  .conversation-progress { padding-bottom: 15px; }
  .progress-meta { gap: 8px; align-items: flex-start; }
  .progress-meta > span { font-size: 10.5px; }
  .hint { margin: 8px 0 6px; }
  .mobile-human {
    position: fixed;
    z-index: 30;
    inset-inline: 18px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--accent);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
  }
  .mobile-human:hover { background: var(--accent-soft); }
  .mobile-human > span:last-child { margin-inline-start: auto; }
  .mobile-human > svg { margin-inline-end: auto; flex-shrink: 0; }
  body.keyboard-open .room { padding-bottom: 2px; }
  body.keyboard-open .mobile-human { display: none; }
}

@media (max-width: 480px) {
  .bar-title, .pulse { display: none; }
  .bar { justify-content: flex-end; }
  .lang-select { max-width: 84px; }
  .ghost { padding: 0 10px; }
}

@media (max-width: 360px) {
  .cal-card { padding: 14px; }
  .btn { font-size: 12.5px; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mic.recording { animation: none; }
  .mic.recording::after { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
