:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ec;
  --primary: #0f172a;
  --primary-soft: #e2e8f0;
  --user: #1d4ed8;
  --user-ink: #ffffff;
  --danger: #b91c1c;
  --success: #166534;
  --radius: 20px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, .24), transparent 35%),
    var(--bg);
  color: var(--ink);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(860px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--panel);
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: 0 0 40px rgba(15, 23, 42, .08);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr minmax(150px, 210px);
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--primary);
  color: white;
}
.brand-mark.large { width: 48px; height: 48px; border-radius: 15px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 2px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
h1 { margin: 0; font-size: 17px; line-height: 1.2; }
.progress-wrap { text-align: right; }
.progress-wrap span { display: block; margin-bottom: 7px; font-size: 11px; color: var(--muted); }
.progress-track { height: 5px; border-radius: 99px; background: #e8edf3; overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: var(--primary); border-radius: inherit; transition: width .25s ease; }

.chat { padding: 28px 20px 160px; overflow-y: auto; }
.message-row { display: flex; gap: 10px; align-items: flex-end; margin: 0 auto 14px; max-width: 720px; }
.user-row { justify-content: flex-end; }
.avatar { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 10px; background: #e2e8f0; font-weight: 800; font-size: 12px; }
.bubble { max-width: min(620px, 84%); padding: 13px 15px; border-radius: 18px; line-height: 1.5; font-size: 15px; white-space: pre-wrap; }
.assistant-bubble { background: #f1f5f9; border-bottom-left-radius: 6px; }
.user-bubble { background: var(--user); color: var(--user-ink); border-bottom-right-radius: 6px; }
.bubble strong { font-weight: 800; }

.composer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
}
#inputHost { max-width: 720px; margin: 0 auto; }
.composer-actions { max-width: 720px; margin: 12px auto 0; display: flex; justify-content: space-between; gap: 10px; }

.label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 7px; }
.text-input, .textarea, .number-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 118px; resize: vertical; }
.text-input:focus, .textarea:focus, .number-input:focus { border-color: #64748b; box-shadow: 0 0 0 3px rgba(100,116,139,.12); }
.input-prefix-wrap { position: relative; }
.input-prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.input-prefix-wrap input { padding-left: 64px; }

.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric-field:first-child { grid-column: 1 / -1; }
.metric-field .label { margin-top: 0; }

.quick-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 9px 12px; font-size: 13px; color: #334155; }
.chip:hover, .chip.active { background: #e2e8f0; border-color: #94a3b8; color: #0f172a; }

.checkbox-row { display: flex; gap: 10px; align-items: flex-start; color: #475569; font-size: 13px; line-height: 1.45; margin-top: 10px; }
.checkbox-row input { margin-top: 2px; }

.button { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 750; transition: transform .08s ease, opacity .15s ease; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { background: var(--primary); color: #fff; }
.button.secondary { background: #edf2f7; color: #334155; }
.button.full { width: 100%; margin-top: 8px; }
.button.booking { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; text-decoration: none; background: var(--primary); color: #fff; border-radius: 12px; padding: 12px 16px; font-weight: 800; }

.field-error { min-height: 18px; margin: 7px auto 0; max-width: 720px; color: var(--danger); font-size: 12px; }
.muted { color: var(--muted); line-height: 1.55; }
.helper { color: var(--muted); font-size: 12px; margin: 7px 2px 0; }

.summary-card { max-width: 620px; background: #fff; border: 1px solid #dbe3ec; border-radius: 16px; padding: 14px; margin-top: 10px; }
.summary-grid { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; font-size: 13px; }
.summary-grid div:nth-child(even) { font-weight: 800; text-align: right; }
.status-good { color: var(--success); font-weight: 800; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .58); backdrop-filter: blur(6px); }
.modal-card { width: min(430px, 100%); background: #fff; border-radius: 24px; padding: 28px; box-shadow: 0 24px 80px rgba(15,23,42,.28); }
.modal-card h2 { margin: 6px 0 10px; font-size: clamp(24px, 5vw, 32px); line-height: 1.12; }

@media (max-width: 640px) {
  .app-shell { box-shadow: none; }
  .topbar { grid-template-columns: auto 1fr; padding: 13px 14px; }
  .progress-wrap { grid-column: 1 / -1; text-align: left; }
  .progress-wrap span { display: none; }
  .chat { padding: 20px 14px 150px; }
  .composer { padding: 12px 14px max(12px, env(safe-area-inset-bottom)); }
  .bubble { max-width: 88%; font-size: 14px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .modal-card { padding: 24px 20px; }
}


.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.icon-button.centered {
  width: 100%;
}

.button-label {
  line-height: 1;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.input-icon-wrap .text-input {
  padding-left: 42px;
}

.summary-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

.button.booking .icon {
  width: 18px;
  height: 18px;
}
