/* MindOps · Reservation Reconfirmation demo */

:root {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --text: #14161f;
  --text-2: #3d4250;
  --muted: #5b6172;
  --faint: #6b7180;
  --line: #e6e7ef;
  --line-strong: #d6d8e3;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-ink: #3730a3;
  --accent-soft: #eef0ff;
  --accent-softer: #f6f6ff;
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --green: #15803d;
  --green-soft: #e9f8ef;
  --green-ink: #0f5f2e;
  --amber: #b45309;
  --amber-soft: #fff5e1;
  --amber-ink: #8a4108;
  --red: #b91c1c;
  --red-soft: #fdeeee;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(17, 20, 45, 0.05);
  --shadow: 0 1px 2px rgba(17, 20, 45, 0.04), 0 4px 12px -2px rgba(17, 20, 45, 0.06), 0 16px 40px -12px rgba(17, 20, 45, 0.08);
  --shadow-lg: 0 2px 4px rgba(17, 20, 45, 0.04), 0 12px 32px -8px rgba(30, 27, 75, 0.16), 0 32px 64px -24px rgba(30, 27, 75, 0.18);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.35);
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Noto Sans Arabic', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 520px at 12% -12%, rgba(99, 102, 241, 0.11), transparent 62%),
    radial-gradient(900px 480px at 100% -6%, rgba(124, 58, 237, 0.08), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 680; letter-spacing: -0.01em; color: var(--text); }
h2 { font-size: 1.08rem; }
h3 { font-size: 0.95rem; }
p { margin: 0; }

[hidden] { display: none !important; }

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

.mono { font-family: var(--mono); }

.icon { width: 18px; height: 18px; flex: none; }

:where(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--ring);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 247, 251, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(214, 216, 227, 0.7);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
}
.wordmark-dot {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--grad);
  display: inline-block;
}
.wordmark-lg { font-size: 1.5rem; }
.wordmark-lg .wordmark-dot { width: 9px; height: 9px; }
.brand-sep { width: 1px; height: 20px; background: var(--line-strong); }
.brand-product { font-weight: 600; color: var(--text-2); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill-live {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  font-weight: 550;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.banner {
  max-width: 1376px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--amber-ink);
  border: 1px solid #f6d9a8;
  font-weight: 550;
  font-size: 0.92rem;
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 620;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill .icon { width: 14px; height: 14px; }
.pill-lg { font-size: 0.92rem; padding: 6px 14px; }
.pill-confirmed { background: var(--green-soft); color: var(--green-ink); border-color: #c4ebd3; }
.pill-not_found { background: var(--red-soft); color: #9b1c1c; border-color: #f6caca; }
.pill-follow_up { background: var(--amber-soft); color: var(--amber-ink); border-color: #f6d9a8; }
.pill-review { background: #fff4ec; color: #a63b0a; border-color: #fbd3b8; }
.pill-ok { background: #f2fbf5; color: var(--green-ink); border-color: #d3f0de; }
.pill-neutral { background: #f1f2f6; color: #464c5c; border-color: var(--line); }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.08s, color 0.15s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-small { padding: 6px 12px; font-size: 0.84rem; border-radius: 9px; }
.btn-small .icon { width: 16px; height: 16px; }
.btn-lg { padding: 13px 20px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }

.btn-primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px -6px rgba(79, 70, 229, 0.6);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 22px -8px rgba(79, 70, 229, 0.7); }

.btn-secondary {
  background: #fff;
  color: var(--accent-ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) { border-color: #b9bcf3; background: var(--accent-softer); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: #fff; border-color: var(--line-strong); color: var(--text); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--text-2);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-icon:hover:not(:disabled) { color: var(--accent); border-color: #c9cbf6; }
.btn-icon.btn-small { width: 32px; height: 32px; }

.btn-call, .btn-hangup {
  min-width: 200px;
  height: 58px;
  padding: 0 30px;
  border-radius: 999px;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
}
.btn-call .icon, .btn-hangup .icon { width: 22px; height: 22px; }
.btn-call {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 55%, #166534 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 10px 24px -8px rgba(21, 128, 61, 0.65);
}
.btn-call:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 14px 30px -10px rgba(21, 128, 61, 0.75); }
.btn-call:disabled { background: #9aa1b1; opacity: 0.6; }
.btn-hangup {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 24px -8px rgba(185, 28, 28, 0.6);
}
.btn-hangup:hover:not(:disabled) { filter: brightness(1.06); }

/* ---------- Forms ---------- */

label, .field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}
.field-label { display: block; }
.hint { font-weight: 450; color: var(--faint); font-size: 0.75rem; margin-top: -4px; }

input, select {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 450;
  color: var(--text);
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  min-width: 0;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover { border-color: #c3c6d4; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[aria-invalid='true'] { border-color: var(--red); }
input::placeholder { color: #9a9fad; }

.form-error {
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 550;
  background: var(--red-soft);
  border: 1px solid #f6caca;
  border-radius: 10px;
  padding: 8px 12px;
}
.form-error-list {
  color: var(--red);
  font-size: 0.84rem;
  margin: 14px 0 0;
  padding: 10px 12px 10px 30px;
  background: var(--red-soft);
  border: 1px solid #f6caca;
  border-radius: 10px;
}

/* ---------- Login ---------- */

.login-view {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 48px 16px;
  position: relative;
  isolation: isolate;
}
.login-view::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(520px 380px at 30% 30%, rgba(99, 102, 241, 0.28), transparent 70%),
    radial-gradient(460px 360px at 72% 65%, rgba(168, 85, 247, 0.22), transparent 70%),
    radial-gradient(380px 300px at 60% 20%, rgba(56, 189, 248, 0.14), transparent 70%);
  filter: blur(8px);
}
.login-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 36px 32px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.5rem; margin-top: 10px; }
.login-lead { color: var(--muted); font-size: 0.95rem; margin-bottom: 8px; }
.code-input {
  height: 58px;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}
.code-input::placeholder { letter-spacing: 0.4em; }
.login-card .btn { margin-top: 4px; }
.login-foot { text-align: center; font-size: 0.78rem; color: var(--faint); margin-top: 6px; }

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

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.intro h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.intro p { margin-top: 6px; color: var(--muted); max-width: 720px; font-size: 1rem; }
.intro strong { color: var(--text-2); }

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-sub { color: var(--muted); font-size: 0.86rem; margin-top: 3px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.empty-state { color: var(--muted); font-size: 0.9rem; padding: 14px 0 4px; }

/* ---------- Booking list ---------- */

.bookings-panel { display: flex; flex-direction: column; gap: 16px; }
.booking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.booking-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 14px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.booking-item:hover { border-color: #c9cbf6; box-shadow: 0 4px 14px -8px rgba(30, 27, 75, 0.25); }
.booking-item[aria-selected='true'] {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f7f7ff, #f2f2ff);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.booking-item[aria-disabled='true'] { cursor: not-allowed; }
.booking-item[aria-disabled='true']:not([aria-selected='true']) { opacity: 0.55; }

.country-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  background: hsl(var(--hue, 243) 80% 95%);
  color: hsl(var(--hue, 243) 60% 30%);
  border: 1px solid hsl(var(--hue, 243) 60% 88%);
  flex: none;
}
.country-chip-lg { width: 52px; height: 52px; font-size: 0.95rem; }

.bk-body { min-width: 0; padding-right: 22px; }
.bk-hotel { font-weight: 680; letter-spacing: -0.01em; color: var(--text); line-height: 1.3; }
.bk-place { color: var(--muted); font-size: 0.84rem; margin-top: 1px; }
.bk-guest {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--text-2);
}
.bk-guest .icon { width: 14px; height: 14px; color: var(--faint); }
.bk-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}
.bk-check .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.booking-item[aria-selected='true'] .bk-check { opacity: 1; transform: none; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f4f5f9;
  border: 1px solid #e8e9f0;
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 520;
  line-height: 1.5;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .icon { width: 12px; height: 12px; color: var(--faint); }
.chip-hcn { background: var(--accent-soft); border-color: #dcdffd; color: var(--accent-ink); font-family: var(--mono); font-weight: 600; }
.chip-hcn .icon { color: var(--accent); }

/* ---------- Custom booking ---------- */

.custom-booking > summary { list-style: none; }
.custom-booking > summary::-webkit-details-marker { display: none; }
.custom-booking[open] > summary { background: var(--accent-softer); border-color: #c9cbf6; }
.custom-booking[open] > summary .icon { transform: rotate(45deg); }
.custom-booking > summary .icon { transition: transform 0.2s; }

.booking-form { margin-top: 14px; }
.booking-form fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 12px;
  padding: 12px 14px 14px;
  background: #fcfcfe;
  min-width: 0;
}
.booking-form legend {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
}
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.span2 { grid-column: 1 / -1; }
.rooms-container { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.room-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fff;
}
.room-row > label:first-child { grid-column: 1 / -1; }
.room-row .remove-room { height: 40px; width: 40px; }

/* ---------- Call stage ---------- */

.stage-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; container-type: inline-size; }

.stage {
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'booking'
    'core'
    'transcript'
    'tip';
}

.selected-booking {
  grid-area: booking;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfbff, #fff);
}
.selected-booking.is-empty { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 0.9rem; }
.selected-booking.is-empty strong { color: var(--text); font-size: 1rem; }

.sb-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sb-title { min-width: 0; }
.sb-hotel { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; margin-top: 2px; }
.sb-place { color: var(--muted); font-size: 0.9rem; }

.sb-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 8px 28px;
  margin-top: 16px;
}
.sb-fact { display: flex; flex-direction: column; min-width: 0; }
.sb-fact-k { font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.sb-fact-v { font-weight: 600; color: var(--text); font-size: 0.94rem; }

.sb-details { margin-top: 14px; }
.sb-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 620;
  color: var(--accent);
  border-radius: 6px;
}
.sb-details > summary::-webkit-details-marker { display: none; }
.sb-details > summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
.sb-details[open] > summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.sb-details > .def-grid {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.def-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px 20px;
  margin: 0;
}
.def-item { min-width: 0; }
.def-item.def-wide { grid-column: 1 / -1; }
.def-grid dt { font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.def-grid dd { margin: 2px 0 0; font-size: 0.92rem; color: var(--text); unicode-bidi: plaintext; overflow-wrap: anywhere; }

/* Core: avatar, status, timer, controls */
.stage-core {
  grid-area: core;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 28px;
  background:
    radial-gradient(360px 220px at 50% 0%, rgba(99, 102, 241, 0.09), transparent 75%);
}

.avatar-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
}
.avatar {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-size: 2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px rgba(79, 70, 229, 0.18), 0 18px 40px -12px rgba(79, 70, 229, 0.65);
  transition: filter 0.3s, box-shadow 0.3s;
}
.avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 55%);
}
.avatar-ring {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.06);
  opacity: 0;
  pointer-events: none;
}
.stage[data-state='connecting'] .avatar-ring,
.stage[data-state='ringing'] .avatar-ring { animation: ring-pulse 1.5s cubic-bezier(0.2, 0.6, 0.35, 1) infinite; }
.stage[data-state='connecting'] .ring-2,
.stage[data-state='ringing'] .ring-2 { animation-delay: 0.75s; }
.stage[data-state='in_call'] .avatar-ring {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.05);
  animation: ring-pulse 2.6s ease-out infinite;
}
.stage[data-state='in_call'] .ring-2 { animation-delay: 1.3s; }
.stage[data-state='in_call'] .avatar { box-shadow: 0 0 0 6px #fff, 0 0 0 8px rgba(22, 163, 74, 0.35), 0 18px 40px -12px rgba(79, 70, 229, 0.65); }
.stage[data-state='ended'] .avatar,
.stage[data-state='error'] .avatar { filter: saturate(0.55); }

@keyframes ring-pulse {
  0% { transform: scale(1); opacity: 0.75; }
  100% { transform: scale(1.5); opacity: 0; }
}

.assistant-name { margin-top: 10px; font-size: 0.8rem; font-weight: 600; color: var(--faint); }

.call-status {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text-2);
}
.call-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a3a8b6;
  flex: none;
}
.call-status[data-state='connecting'],
.call-status[data-state='ringing'] { color: var(--accent-ink); }
.call-status[data-state='connecting']::before,
.call-status[data-state='ringing']::before { background: var(--accent); animation: blink 1s ease-in-out infinite; }
.call-status[data-state='in_call'] { color: var(--green); }
.call-status[data-state='in_call']::before { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2); }
.call-status[data-state='ending'] { color: var(--amber); }
.call-status[data-state='ending']::before { background: #d97706; }
.call-status[data-state='ended']::before { background: var(--accent); }
.call-status[data-state='error'] { color: var(--red); }
.call-status[data-state='error']::before { background: var(--red); }

@keyframes blink { 50% { opacity: 0.3; } }

.call-timer {
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.timer-now { font-size: 2.75rem; font-weight: 680; letter-spacing: -0.03em; color: var(--text); line-height: 1.1; }
.timer-max { font-size: 0.95rem; font-weight: 550; color: var(--faint); }
.call-timer.warn .timer-now { color: var(--red); }

/* Mic visualizer: bars scale with --level (0..1) set from app.js */
.visualizer {
  --level: 0;
  margin-top: 14px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.visualizer span {
  --w: 0.6;
  width: 6px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7c3aed, #4f46e5);
  transform: scaleY(min(1, calc(0.14 + var(--level) * var(--w) * 2.2)));
  transition: transform 90ms linear;
  opacity: 0.35;
}
.stage[data-state='connecting'] .visualizer span,
.stage[data-state='ringing'] .visualizer span,
.stage[data-state='in_call'] .visualizer span { opacity: 1; }
.visualizer span:nth-child(1) { --w: 0.45; }
.visualizer span:nth-child(2) { --w: 0.75; }
.visualizer span:nth-child(3) { --w: 0.95; }
.visualizer span:nth-child(4) { --w: 1.1; }
.visualizer span:nth-child(5) { --w: 0.9; }
.visualizer span:nth-child(6) { --w: 0.7; }
.visualizer span:nth-child(7) { --w: 0.5; }
.visualizer-label { margin-top: 6px; font-size: 0.74rem; color: var(--faint); font-weight: 550; }

.lang-row { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lang-row .field-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); }

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: #eef0f6;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 100%;
}
.segmented button {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.segmented button:hover:not(:disabled) { color: var(--text); }
.segmented button[aria-pressed='true'] {
  background: #fff;
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(17, 20, 45, 0.08), 0 2px 8px -2px rgba(17, 20, 45, 0.1);
}
.segmented button:disabled { cursor: not-allowed; }
.segmented button:disabled:not([aria-pressed='true']) { opacity: 0.5; }

.call-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.call-error { margin-top: 16px; max-width: 520px; text-align: start; }

/* Transcript */
.transcript-block {
  grid-area: transcript;
  padding: 20px 24px 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.transcript-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--faint); font-weight: 550; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.agent { background: #a5a8f5; }
.legend-dot.hotel { background: #fff; border: 1px solid #b9bccb; margin-left: 8px; }

.transcript {
  list-style: none;
  margin: 0;
  padding: 16px;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafafd;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.transcript:empty { justify-content: center; align-items: center; }
.transcript:empty::before {
  content: 'The conversation will appear here once the call starts.';
  color: var(--faint);
  font-size: 0.88rem;
  text-align: center;
}
.t-line { display: flex; flex-direction: column; gap: 4px; max-width: min(82%, 560px); animation: bubble-in 0.2s ease-out; }
.t-line.agent { align-self: flex-start; }
.t-line.hotel { align-self: flex-end; align-items: flex-end; }
.t-meta { display: flex; align-items: baseline; gap: 8px; padding: 0 4px; }
.t-role { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; color: var(--accent-ink); }
.t-line.hotel .t-role { color: var(--text-2); }
.t-time { font-size: 0.7rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.t-text {
  padding: 10px 14px;
  border-radius: 16px 16px 16px 5px;
  background: var(--accent-soft);
  border: 1px solid #e0e2fd;
  color: #1e1b4b;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
  text-align: start;
  overflow-wrap: anywhere;
  font-size: 0.93rem;
}
.t-line.hotel .t-text {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
  border-radius: 16px 16px 5px 16px;
  box-shadow: var(--shadow-sm);
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } }

/* Tip */
.tip {
  grid-area: tip;
  margin: 12px 24px 22px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-softer);
  border: 1px solid #e6e7fb;
  color: var(--text-2);
  font-size: 0.86rem;
}
.tip .icon { color: var(--accent); margin-top: 1px; }

/* Wide stage: controls beside the transcript */
@container (min-width: 820px) {
  .stage {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    grid-template-areas:
      'booking booking'
      'core transcript'
      'tip tip';
  }
  .stage-core { justify-content: center; border-right: 1px solid var(--line); padding: 36px 24px; }
  .transcript-block { border-top: 0; padding: 22px 24px 4px; }
  .transcript { flex: 1; min-height: 360px; max-height: 460px; }
}

/* ---------- Result card ---------- */

.result-container:empty { display: none; }
.result-card {
  --oc: #9aa1b1;
  padding: 24px;
  background-image: linear-gradient(90deg, var(--oc), var(--oc));
  background-size: 100% 4px;
  background-repeat: no-repeat;
  background-color: var(--panel);
}
.result-container > .result-card { animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.3, 1); }
.result-card.outcome-confirmed { --oc: #16a34a; }
.result-card.outcome-not_found { --oc: #dc2626; }
.result-card.outcome-follow_up { --oc: #d97706; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.result-title { font-size: 1.25rem; margin-top: 3px; }

.ticket {
  position: relative;
  margin: 18px 0 20px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
  border: 1px dashed #bfc2f3;
}
.ticket::before, .ticket::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px dashed #bfc2f3;
}
.ticket::before { left: -10px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -10px; clip-path: inset(0 50% 0 0); }
.ticket-body { min-width: 0; }
.ticket-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.conf-no {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1e1b4b;
  line-height: 1.2;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.ticket.is-empty { background: #f6f7fa; border-color: var(--line-strong); }
.ticket.is-empty .ticket-label, .ticket.is-empty .conf-no { color: var(--faint); }
.copy-btn { background: #fff; }
.copy-btn.is-copied { color: var(--green); border-color: #bfe7cd; }

.sub-h { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 22px 0 10px; }

.none-row { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 0.88rem; font-weight: 550; }
.none-row .icon { width: 16px; height: 16px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: start; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  background: #fafafd;
}
.disc-field { font-weight: 600; color: var(--text-2); }
.disc-expected { color: var(--faint); text-decoration-color: rgba(185, 28, 28, 0.6); }
.disc-hotel { background: #fff3c4; color: #5c3d02; padding: 1px 6px; border-radius: 5px; font-weight: 600; }

/* ---------- History ---------- */

.history { padding: 22px 24px; }
.history .table-wrap { margin-top: 16px; }
.history-table tbody tr { cursor: pointer; transition: background-color 0.12s; }
.history-table tbody tr:hover { background: #f8f8fd; }
.history-table tbody tr[aria-selected='true'] { background: var(--accent-softer); }
.history-table tbody tr[aria-selected='true'] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.history-table td { padding: 9px 14px; }
.history-table td:nth-child(2) { font-weight: 600; }
.history-table .nowrap { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.history-table .conf-cell { overflow-wrap: anywhere; font-weight: 600; color: var(--text-2); }
.history .empty-state { padding: 18px 2px 4px; }

.call-detail {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  animation: rise 0.25s ease-out;
}
.call-detail h2 { font-size: 1.2rem; margin-top: 3px; }
.detail-grid { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfe; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.call-detail .result-card { box-shadow: none; }
.detail-transcript-wrap .sub-h { margin-top: 0; }
.detail-transcript { max-height: 460px; }

.save-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-color: #f6caca; background: #fffafa; }
.save-error-text { display: flex; gap: 8px; align-items: center; color: var(--red); font-weight: 600; font-size: 0.92rem; }

.app-foot { text-align: center; color: var(--faint); font-size: 0.78rem; padding-top: 4px; }

/* ---------- Responsive ---------- */

@media (min-width: 1100px) {
  .detail-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .detail-transcript-wrap .sub-h { margin-top: 0; }
}

@media (max-width: 1199px) {
  .workspace { grid-template-columns: 320px minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 1023px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .booking-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar-inner { padding: 12px 16px; }
  .brand-sep, .brand-product { display: none; }
  .app { padding: 20px 16px 32px; gap: 18px; }
  .banner { margin: 12px 16px 0; }
  .intro h1 { font-size: 1.4rem; }
  .panel { padding: 16px; border-radius: 16px; }
  .selected-booking { padding: 16px; }
  .sb-hotel { font-size: 1.12rem; }
  .sb-facts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .stage-core { padding: 26px 16px 22px; }
  .transcript-block { padding: 16px 16px 4px; }
  .tip { margin: 12px 16px 16px; }
  .timer-now { font-size: 2.3rem; }
  .segmented button { padding: 7px 11px; font-size: 0.84rem; }
  .btn-call, .btn-hangup { min-width: 0; width: 100%; max-width: 320px; }
  .booking-list { grid-template-columns: minmax(0, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .room-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-row .remove-room { justify-self: end; }
  .history { padding: 16px; }
  .history-table th, .history-table td { padding: 8px 10px; }
  .t-line { max-width: 92%; }
  .result-card { padding: 18px; }
  .conf-no { font-size: 1.6rem; }
  .login-card { padding: 28px 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .stage[data-state='connecting'] .ring-1,
  .stage[data-state='ringing'] .ring-1,
  .stage[data-state='in_call'] .ring-1 { animation: none; opacity: 0.6; transform: scale(1.22); }
  .stage .ring-2 { animation: none !important; opacity: 0 !important; }
}
