:root {
  --primary: #2F80ED;
  --secondary: #56CCF2;
  --text: #3d4a5c;
  --muted: #8a97a8;
  --line: #d9e2ec;
  --bg: #eef3f8;
  --font: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { height: auto; min-height: 100%; }
body.book-app {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 16px;
}
.book-shell {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(20, 40, 80, .12);
  min-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
}
.book-head {
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--secondary) 70%, var(--primary)));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.book-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.book-brand img {
  height: 46px; max-width: 150px; object-fit: contain;
  background: rgba(0,0,0,.25); border-radius: 8px; padding: 2px 6px;
}
.book-mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 800;
}
.book-brand__name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.book-brand__sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.book-web {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  background: #fff;
  border: 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.book-web:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .24);
}
.book-web__icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0f172a, #1e293b);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.book-steps { display: flex; gap: 6px; flex-shrink: 0; }
.dot {
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.25); font-size: 13px; font-weight: 700;
}
.dot.is-active { background: rgba(0,0,0,.28); }
.dot.is-done { background: rgba(255,255,255,.55); color: #0b2a4a; }

.book-main {
  padding: 28px 22px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.book-title {
  margin: 0 0 22px; text-align: center; font-size: 1.55rem; font-weight: 600; color: #6b7788;
}
.book-body {
  flex: 1;
}
.book-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap;
}
.btn {
  border: 0; border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer;
}
.btn.primary { background: #111827; color: #fff; margin-left: auto; }
.btn.primary:hover { background: #000; }
.btn.ghost { background: #eef2f6; color: #334155; }
.btn.backend {
  background: color-mix(in srgb, var(--primary) 85%, white);
  color: #fff; text-decoration: none; font-size: 13px; padding: 8px 12px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn.portal {
  background: color-mix(in srgb, var(--primary) 12%, #fff);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  text-decoration: none; font-size: 13px; padding: 8px 12px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
}
.btn.portal:hover {
  background: color-mix(in srgb, var(--primary) 18%, #fff);
}
.btn.web {
  background: #fff;
  color: #0f172a;
  border: 1px solid var(--line);
  text-decoration: none; font-size: 13px; padding: 7px 12px 7px 7px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
.btn.web:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn.web .book-web__icon {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; color: #4b5563; }
.input, .select {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; font: inherit; background: #fff; color: #111827;
}
.input:focus, .select:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, white); border-color: var(--primary); }

.cat-list { display: grid; gap: 8px; }
.cat-item {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff;
}
.cat-item__head {
  width: 100%; border: 0; background: #f7fafc; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font: inherit; font-weight: 700; color: #1f2937; cursor: pointer; text-align: left;
}
.cat-item__head:hover { background: #eef5ff; }
.cat-item.is-open .cat-item__head { background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); }
.cat-item__chevron { transition: transform .18s ease; opacity: .7; }
.cat-item.is-open .cat-item__chevron { transform: rotate(180deg); }
.cat-item__body { display: none; padding: 8px; border-top: 1px solid var(--line); }
.cat-item.is-open .cat-item__body { display: grid; gap: 6px; }
.svc-option {
  width: 100%; text-align: left; border: 1px solid transparent; background: #fff;
  border-radius: 7px; padding: 10px 12px; font: inherit; cursor: pointer;
}
.svc-option:hover { background: #f8fafc; border-color: var(--line); }
.svc-option.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, white);
  box-shadow: inset 3px 0 0 var(--primary);
}
.svc-option strong { display: block; font-size: 14px; }
.svc-option span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 12px; cursor: pointer; font: inherit; font-size: 13px;
}
.chip.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.summary {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  display: grid; gap: 8px;
}
.summary div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.summary strong { color: #111827; }
.svc-price {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 8%, white);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, white);
  font-size: 0.95rem;
}
.muted { color: var(--muted); }
.success-box { text-align: center; padding: 24px 10px; }
.success-box h2 { margin: 0 0 8px; color: #111827; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .duo { grid-template-columns: 1fr; } }
.doctor-box {
  margin-top: 16px; padding: 14px; border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--primary) 35%, white);
  background: color-mix(in srgb, var(--primary) 7%, white);
}
.doctor-box.is-hidden { display: none; }
.branch-box {
  margin-bottom: 16px; padding: 14px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, white);
  background: color-mix(in srgb, var(--primary) 5%, white);
}
.branch-box.is-hidden { display: none; }
.branch-box--info { border-style: dashed; }
.branch-fixed { font-size: 1rem; padding: 6px 0 2px; }
.branch-place {
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.35;
}
.branch-success {
  margin: 8px 0 4px;
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.4;
}
.branch-success span { color: var(--muted); font-weight: 500; }
.select--doctor { font-weight: 600; min-height: 48px; border-width: 2px; border-color: var(--primary); }
.select--branch { font-weight: 600; min-height: 44px; }
.maps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 16px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--primary) 40%, #fff);
  background: #fff;
  color: var(--primary);
  text-decoration: none;
}
.maps-btn:hover { background: color-mix(in srgb, var(--primary) 8%, #fff); }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.date-when {
  margin: -4px 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.date-when.muted { font-weight: 500; }
.date-when--ready { color: var(--primary); }
.hint-wa {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.hint-wa strong { color: var(--text); display: block; margin-bottom: 4px; }
.hint-wa code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--primary);
  font-weight: 700;
}
.info-card {
  text-align: left; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-top: 14px;
}
.info-card ul { margin: 8px 0 18px; padding-left: 18px; }
.info-card .btn.primary {
  display: inline-flex; margin: 8px 0 0; width: 100%; justify-content: center;
  min-height: 48px; font-size: 15px; box-shadow: 0 8px 18px rgba(17,24,39,.18);
}
.choice-pill {
  border: 1.5px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  background: #fff; border-radius: 12px; padding: 12px 16px;
  font: inherit; font-weight: 700; cursor: pointer; color: var(--text);
  box-shadow: 0 2px 0 rgba(15,23,42,.04);
}
.choice-pill.is-active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 28%, transparent);
}
.book-foot a { color: inherit; font-weight: 700; }
.foot-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.foot-links a:not(.btn) { color: var(--primary); font-weight: 600; text-decoration: none; font-size: 13px; }
.site-credit--on-dark,
.is-on-dark.site-credit,
[data-site-credit].is-on-dark {
  color: rgba(255, 255, 255, 0.82);
}
.site-credit--on-dark a,
.is-on-dark .site-credit__made {
  color: #fff;
}

.book-foot {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; background: #fafbfc;
}
.book-foot .site-credit {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
}
.book-foot .site-credit a { color: inherit; font-weight: 700; text-decoration: none; }
.book-foot .site-credit a:hover { text-decoration: underline; text-underline-offset: 2px; }
.site-credit__brand { display: inline-flex; align-items: center; text-decoration: none; }
.book-foot .site-credit__logo {
  height: 24px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  margin-right: 10px;
}
.credit-heart {
  color: #e11d48;
  font-weight: 800;
  margin: 0 1px;
  display: inline-block;
}
.btn.install {
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .35);
  font-size: 13px;
  line-height: 1.35;
}
.pwa-banner[hidden] { display: none !important; }
.pwa-banner__text { flex: 1; min-width: 0; }
.pwa-banner__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pwa-banner__btn {
  border: 0;
  background: var(--primary, #2F80ED);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 36px;
}
.pwa-banner__btn[hidden] { display: none !important; }
.pwa-banner__close {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.75);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
}

@media (max-width: 640px) {
  body.book-app {
    padding: 0;
    place-items: stretch;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .book-shell {
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .book-head { flex-direction: column; align-items: flex-start; }
  .book-title { font-size: 1.25rem; margin-bottom: 14px; }
  .book-main { padding: 18px 16px 14px; }
  .book-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
