:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --border: #d2d2d7;
  --accent: #0071e3;
  --accent-pressed: #0058b8;
  --ok: #248a3d;
  --warn: #b25000;
  --err: #d70015;
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.nav .brand {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}

header.nav nav a {
  margin-left: 24px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}

main { padding: 0 24px 96px; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
}

.wrap-wide { max-width: 980px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 88px 0 56px;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 16px;
}

.hero .sub {
  font-size: 22px;
  color: var(--text-soft);
  margin: 0 auto 36px;
  max-width: 540px;
  font-weight: 400;
}

@media (max-width: 600px) {
  .hero { padding: 56px 0 36px; }
  .hero h1 { font-size: 38px; }
  .hero .sub { font-size: 18px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 980px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 80ms ease, transform 80ms ease;
}
.btn:hover { background: var(--accent-pressed); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn.ghost:hover { background: var(--accent); color: #fff; }

.btn.danger { background: transparent; color: var(--err); border: 1px solid var(--border); }
.btn.danger:hover { background: #fff5f6; }

.btn.small { padding: 8px 16px; font-size: 13px; }

/* ---------- Form ---------- */
form .field { margin-bottom: 18px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 80ms ease, box-shadow 80ms ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) { .row { grid-template-columns: 1fr; } }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 14px 0;
}
.consent input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* ---------- Cards / sections ---------- */
.card {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.card.flat { background: #fff; border: 1px solid var(--border); }

h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 12px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 18px 0 8px;
}

p { margin: 0 0 12px; }

.muted { color: var(--text-soft); font-size: 14px; }

.center { text-align: center; }

/* ---------- "How it works" tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0 56px;
}
.tile { background: var(--bg-soft); border-radius: var(--radius); padding: 24px; }
.tile .num {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tile h3 { margin: 0 0 6px; font-size: 18px; }
.tile p { font-size: 14px; color: var(--text-soft); margin: 0; }

@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr; }
}

/* ---------- Example conversation ---------- */
.example-section {
  background: var(--bg-soft);
  padding: 96px 24px;
  margin: 64px 0;
}

.example-inner {
  max-width: 520px;
  margin: 0 auto;
}

.example-intro {
  text-align: center;
  margin-bottom: 56px;
}
.example-intro h2 {
  font-size: 44px;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.1;
}
.example-intro .muted {
  font-size: 18px;
  color: var(--text-soft);
  margin: 0;
}

.convo {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.convo-label {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
  margin: 0 0 20px;
}

/* In the example, "in" (Gabe → person) is on the LEFT.
   "out" (the person → Gabe) is on the RIGHT. */
.convo .msg.in { justify-content: flex-start; }
.convo .msg.in .bubble {
  background: #fff;
  color: var(--text);
  border-bottom-left-radius: 6px;
}
.convo .msg.out { justify-content: flex-end; }
.convo .msg.out .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.convo .bubble {
  font-size: 16px;
  line-height: 1.5;
  padding: 14px 18px;
  border-radius: 22px;
  max-width: 84%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.convo-aside {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.convo-aside-label {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
}
.convo-aside .msg { justify-content: center; }
.convo-aside .msg .bubble {
  background: #fff;
  color: var(--text);
  border-radius: 22px;
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.55;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.convo-aside .msg .bubble em {
  display: block;
  color: var(--text-soft);
  font-style: normal;
  margin-top: 6px;
}

.example-cta {
  text-align: center;
  margin-top: 64px;
}

/* ---------- Notices ---------- */
.notice {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin: 14px 0;
  background: var(--bg-soft);
  color: var(--text);
}
.notice.ok    { background: #e8f5ec; color: var(--ok); }
.notice.warn  { background: #fff3e0; color: var(--warn); }
.notice.error { background: #ffeaec; color: var(--err); }

/* ---------- Pills / status ---------- */
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-soft);
  color: var(--text-soft);
}
.pill.sent      { background: #e6f0ff; color: #0040a4; }
.pill.reminded  { background: #fff3e0; color: var(--warn); }
.pill.responded { background: #e8f5ec; color: var(--ok); }
.pill.escalated { background: #ffeaec; color: var(--err); }
.pill.pending   { background: #fff3e0; color: var(--warn); }
.pill.confirmed { background: #e8f5ec; color: var(--ok); }

/* ---------- Dashboard ---------- */
.senior-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 80ms ease;
}
.senior-row:hover { background: #ececef; }
.senior-row.selected { background: #ddeafd; }
.senior-row .name { font-weight: 500; }
.senior-row .meta { font-size: 13px; color: var(--text-soft); }

.transcript {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 4px;
  background: #fff;
  border-radius: var(--radius-sm);
}
.msg { display: flex; }
.msg .bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.msg.out { justify-content: flex-end; }
.msg.out .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.in  .bubble { background: #ececef; color: var(--text); border-bottom-left-radius: 6px; }

/* ---------- Per-slot check-in time pickers ---------- */
.time-pickers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.time-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.time-slot-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-soft);
}
.time-slot input[type="time"] {
  width: auto;
  border: none;
  padding: 4px 6px;
  font-size: 15px;
  font-weight: 500;
  background: transparent;
}
.time-slot input[type="time"]:focus {
  outline: none;
  box-shadow: none;
}

.danger-zone {
  border: 1px solid #fecaca;
  background: #fff5f6;
}
.danger-zone h3 { color: var(--err); }

/* ---------- Curious Gabe toggle + biography ---------- */
.cgabe-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.cgabe-text { flex: 1; }

.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d2d2d7;
  border-radius: 999px;
  transition: background 150ms ease;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 26px;
  width: 26px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 150ms ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.bio-group {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.bio-group summary {
  cursor: pointer;
  font-size: 15px;
  list-style: none;
  padding: 4px 0;
}
.bio-group summary::-webkit-details-marker { display: none; }
.bio-group summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--text-soft);
  transition: transform 100ms ease;
}
.bio-group[open] summary::before { transform: rotate(90deg); }

.bio-entry {
  margin: 14px 4px 6px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: 10px;
}
.bio-q {
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
  margin-bottom: 6px;
}
.bio-a {
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.bio-date {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}
footer a { color: var(--text-soft); margin: 0 8px; }

.compliance {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 24px auto;
  max-width: 540px;
  text-align: center;
}
