:root {
  --bg: #faf8f3;
  --ink: #111114;
  --ink-soft: #1b1a16;
  --gold: #f2b33d;
  --gold-dark: #d99a1f;
  --card: #ffffff;
  --line: #eceae4;
  --muted: #8a8578;
  --green: #1d7a3a;
  --green-bg: #f0fdf4;
  --red: #b3261e;
  --shadow: 0 10px 30px rgba(17, 17, 20, 0.10);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, sans-serif;
  background: #e7e2d6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.phone {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
}
@media (min-width: 560px) {
  body { padding: 22px 0; }
  .phone {
    height: calc(100dvh - 44px);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(17, 17, 20, 0.25);
    overflow: hidden;
  }
}

/* ---------- header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 12px;
  background: var(--ink);
  color: var(--gold);
  font-family: "Archivo Narrow", sans-serif;
  font-weight: 700; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.5px;
}
.brand-name { font-weight: 800; font-size: 16px; line-height: 1.15; }
.brand-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hours-chip {
  flex: 0 0 auto;
  font-size: 11.5px; font-weight: 700;
  background: #fff; border: 1px solid var(--line);
  padding: 6px 9px; border-radius: 999px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- chat ---------- */
.chat {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.msg { max-width: 88%; padding: 11px 13px; border-radius: 18px; font-size: 15px; line-height: 1.45; }
.msg.bot {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(17,17,20,0.04);
}
.msg.user {
  align-self: flex-end;
  background: var(--ink);
  color: #faf8f3;
  border-bottom-right-radius: 6px;
}
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin-bottom: 0; }
.msg .small { font-size: 13px; color: var(--muted); }
.msg.user .small { color: #cfcfd6; }

.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #cfcaba; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 96%; }
.chip {
  appearance: none; border: 1.5px solid var(--ink); background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  transition: transform .05s ease, background .15s ease, opacity .15s;
}
.chip:hover { background: #fdf3d7; }
.chip:active { transform: scale(0.97); }
.chip.gold { background: var(--gold); border-color: var(--gold-dark); }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }
.chips.used .chip { opacity: 0.45; pointer-events: none; }
.chips.used .chip.picked { opacity: 1; background: var(--ink); color: #faf8f3; }

/* time grid */
.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; align-self: stretch; max-width: 100%; }
.time-grid .chip { padding: 9px 4px; text-align: center; font-size: 13.5px; }

/* cards */
.card {
  align-self: stretch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card img.room-photo { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.card-body { padding: 14px 15px 15px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { font-family: "Archivo Narrow", sans-serif; font-size: 21px; font-weight: 700; letter-spacing: 0.2px; }
.badge {
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 5px 8px; border-radius: 999px;
}
.badge.avail { background: var(--green-bg); color: var(--green); border: 1px solid #bbe9c6; }
.badge.pkg { background: #fdf3d7; color: #8a5d00; border: 1px solid #f3d488; }
.card-meta { color: var(--muted); font-size: 13.5px; margin-top: 3px; font-weight: 500; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.price { font-size: 27px; font-weight: 800; }
.price-note { font-size: 13px; color: var(--muted); }
.strike { text-decoration: line-through; color: var(--muted); font-size: 16px; font-weight: 600; }
.pkg-note { margin-top: 8px; font-size: 13px; background: #fdf8ea; border: 1px solid #f3e3ae; border-radius: 10px; padding: 8px 10px; line-height: 1.4; }

.btn {
  appearance: none; border: none; cursor: pointer; font: inherit;
  font-weight: 700; font-size: 15.5px;
  border-radius: 14px; padding: 13px 16px; width: 100%;
  background: var(--gold); color: #1a1405;
  transition: filter .15s ease, transform .05s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.99); }
.btn.dark { background: var(--ink); color: #faf8f3; }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { width: auto; flex: 1; }

/* summary + forms */
.summary-rows { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 2px; }
.summary-rows .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.summary-rows .row span:first-child { color: var(--muted); font-weight: 600; }
.summary-rows .row span:last-child { font-weight: 700; text-align: right; }
.summary-rows .row.total { border-top: 1px dashed var(--line); padding-top: 9px; margin-top: 3px; }
.summary-rows .row.total span:last-child { font-size: 19px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.field label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }
.field input {
  font: inherit; font-size: 15.5px;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 12px; background: #fffdf8; color: var(--ink);
  outline: none;
}
.field input:focus { border-color: var(--gold); }
.field .err { color: var(--red); font-size: 12.5px; font-weight: 600; display: none; }

table.packages { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.packages th, table.packages td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; }
table.packages th:first-child, table.packages td:first-child { text-align: left; }
table.packages th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }

/* confirmation */
.confirm-icon {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--green-bg); border: 2px solid #bbe9c6;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 4px auto 10px;
}
.confirm-icon.pending { background: #fdf8ea; border-color: #f3d488; }
.confirm-icon.expired { background: #fdeeee; border-color: #f3b8b3; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3.5px solid #f3d488; border-top-color: #8a5d00;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

/* ---------- composer ---------- */
.composer {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.composer input {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 11px 15px; background: #fff; color: var(--ink);
  outline: none;
}
.composer input:focus { border-color: var(--gold); }
.mic-btn, .send-btn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; appearance: none;
}
.mic-btn { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.mic-btn.listening { background: #fdeeee; border-color: var(--red); color: var(--red); animation: pulse 1.1s infinite; }
.mic-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179,38,30,0.25); } 50% { box-shadow: 0 0 0 7px rgba(179,38,30,0); } }
.send-btn { background: var(--ink); border: none; color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #faf8f3; font-size: 13.5px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: 88vw; text-align: center; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.date-input-wrap { align-self: stretch; }
.date-input-wrap input[type="date"] {
  font: inherit; font-size: 15px; width: 100%;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff;
}
