/* today.css — Today-view appointment list. Uses brand.css tokens.
   Visual cues borrowed from calendar-pwa booking card (gradient bg,
   purple accent border) but in list form. */

body {
  margin: 0;
  font-family: var(--font-body, "Nunito", system-ui, sans-serif);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

.today-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.title-block h1 {
  margin: 0;
  font-family: var(--font-display, "Cera Round", system-ui, sans-serif);
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text);
}
.title-block .muted {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.link-back {
  font-size: 13px;
  color: var(--mid-purple, #C77DFF);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(153, 69, 255, 0.12);
  transition: background 120ms ease;
}
.link-back:hover { background: rgba(153, 69, 255, 0.22); }

.today-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.appt-card {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--border-strong, rgba(248,248,248,0.22));
  background: linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev) 100%);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, border-color 120ms ease;
}
.appt-card:hover {
  border-color: var(--electric, #9945FF);
  transform: translateY(-1px);
}
.appt-card[data-status="cancelled"] {
  opacity: 0.45;
  border-style: dashed;
}

.appt-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-display, "Cera Round", system-ui, sans-serif);
}
.appt-time .h {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: var(--teal, #07EDBE);
}
.appt-time .m {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.appt-body { min-width: 0; }
.appt-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  /* Allow wrap so dog name is visible even on narrow screens */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}
.appt-title .dog {
  color: var(--teal, #07EDBE);
  font-weight: 700;
}
.appt-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.appt-tag {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--mid-purple, #C77DFF);
  background: rgba(153, 69, 255, 0.12);
}
.appt-tag.bt { color: var(--pink, #FF7EC0); background: rgba(255,126,192,0.12); border-color: rgba(255,126,192,0.35); }
.appt-tag.cancel { color: #FFA8D1; background: rgba(255,168,209,0.12); border-color: rgba(255,168,209,0.35); }

.appt-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal, #07EDBE);
  white-space: nowrap;
}

.empty-card {
  padding: 32px 20px;
  text-align: center;
  border-radius: var(--radius-lg, 20px);
  border: 1px dashed var(--border-strong);
  background: var(--bg-elev);
}
.empty-title { font-weight: 700; margin-bottom: 6px; }

.header-actions { display: flex; gap: 8px; }


/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 9, 26, 0.92);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px 20px;
  z-index: 30;
}
.search-card {
  position: relative;
  box-sizing: border-box;
  background: var(--bg-elev, #14122A);
  border: 1px solid var(--border-strong, rgba(248,248,248,0.22));
  border-radius: 22px;
  /* Top padding leaves space for the X chip so the search input
     never sits underneath it. */
  padding: 56px 18px 18px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 80px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.search-card .x-btn {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: none;
  background: rgba(248,248,248,0.10);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#search-input {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  margin: 0 0 14px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg, #0A091A);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}
#search-input:focus { outline: none; border-color: var(--teal, #07EDBE); }
.search-results {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(248,248,248,0.10));
  background: rgba(248, 248, 248, 0.03);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.search-row:hover { border-color: var(--teal); background: rgba(7, 237, 190, 0.06); }
.search-row .name { font-weight: 700; font-size: 15px; }
.search-row .meta { font-size: 12px; color: var(--text-muted); }
.search-empty { padding: 18px 8px; color: var(--text-muted); font-size: 13px; text-align: center; }

[hidden] { display: none !important; }

/* Service-health banner — fires when Stripe/GHL liveness check fails. */
.health-banner {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(248, 0, 165, 0.10);
  border: 1px solid rgba(248, 0, 165, 0.45);
  color: #FFD2E6;
  font-size: 13px;
  line-height: 1.4;
}
.health-banner strong { color: #FFA8D1; font-weight: 800; }

/* ---------- Consults strip: on-call pay link (2026-10-19) ---------- */
.consults { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.section-h {
  margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.consult-card {
  display: grid; gap: 10px; padding: 14px;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--border-strong, rgba(248,248,248,0.22));
  background: linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev) 100%);
}
.consult-head { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center; }
.pkg-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pkg-btn {
  font: inherit; font-weight: 800; color: var(--text); cursor: pointer;
  padding: 10px 6px; border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border-strong, rgba(248,248,248,0.22));
  background: rgba(153, 69, 255, 0.12);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pkg-btn small { font-weight: 700; color: var(--text-muted); font-size: 12px; }
.pkg-btn[aria-pressed="true"] { border-color: var(--teal, #07EDBE); background: rgba(7, 237, 190, 0.14); }
.pkg-btn:focus-visible, .send-btn:focus-visible { outline: 2px solid var(--teal, #07EDBE); outline-offset: 2px; }
.travel-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.travel-row input { width: 18px; height: 18px; accent-color: #07EDBE; }
.send-panel { display: grid; gap: 8px; }
.send-panel textarea {
  font: inherit; font-size: 14px; color: var(--text); background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-strong, rgba(248,248,248,0.22)); border-radius: var(--radius-md, 12px);
  padding: 10px; min-height: 64px; resize: vertical; overflow-wrap: anywhere;
}
.send-btn {
  font: inherit; font-weight: 900; border: 0; cursor: pointer;
  padding: 12px; border-radius: 500px; color: #0A091A; background: var(--teal, #07EDBE);
}
.send-btn[disabled] { opacity: 0.5; cursor: default; }
.send-status { font-size: 13px; color: var(--text-muted); min-height: 1em; }
.send-status.ok { color: var(--teal, #07EDBE); font-weight: 800; }
.send-status.err { color: var(--pink, #FF7EC0); font-weight: 800; }
