/* SoftSpot original typefaces (from iOS Quicksand OTF pack) */
@font-face {
  font-family: "Quicksand";
  src: url("../assets/fonts/Quicksand-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("../assets/fonts/Quicksand-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("../assets/fonts/Quicksand-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("../assets/fonts/Quicksand-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ss-red: #ff474a;
  --ss-red-dark: #e61417;
  /* Teal-green near SoftSpot blue — calmer than system green */
  --ss-green: #3a7f78;
  --ss-green-dark: #2d6560;
  --ss-green-bright: #4a918a;
  --ss-green-bg: #e6f2f1;
  --ss-blue: #82c2d4;
  --ss-blue-dark: #5c9eb0;
  --ss-blue-bg: #e5f2f5;
  --ss-pet-border: rgba(60, 60, 67, 0.12);
  --ss-white: #ffffff;
  /* ColorGlobal.mainGrayColor = UIColor.darkGray */
  --ss-gray: #555555;
  /* ColorGlobal.lightestGrayColor */
  --ss-light: #d9d9d4;
  --ss-bg: #f2f2f7;
  --ss-text: #555555;
  /* Darker than #8a8a8a for readable secondary copy on light surfaces */
  --ss-muted: #6b6b6b;
  --ss-separator: rgba(85, 85, 85, 0.18);
  --ss-tint: #007aff;
  --phone-w: 420px;
  /* Silver device frame aspect (454×851 @4× → 1816×3404) */
  --phone-h: calc(var(--phone-w) * 851 / 454);
  /* Even L/R; matched to geometric frame hole */
  --frame-inset-l: 3.9648%;
  --frame-inset-t: 1.9976%;
  --frame-inset-r: 3.9648%;
  --frame-inset-b: 2.0564%;
  /* Match punched hole; cqw keeps corners circular */
  --screen-radius: 12.98cqw;
  --island-w: 34%;
  --island-h: 23px;
  --island-top: 6px;
  --safe-top: calc(var(--island-top) + var(--island-h) + 6px);
  --safe-bottom: 28px;
  --login-y: 22px;
  --tab-h: 44px;
  --edge: 14px;
  --nav-edge: 12px;
  --ss-font: "Quicksand", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Compact type scale for phone mock */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-title: 16px;
  --fs-btn: 15px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ss-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse at 30% 10%, rgba(130, 194, 212, 0.18), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(255, 71, 74, 0.08), transparent 45%),
    #1a2a32;
  color: var(--ss-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 16px;
}

.demo-chrome {
  width: min(420px, 100%);
  color: #c5d5db;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.demo-chrome a {
  color: var(--ss-blue);
  font-weight: 600;
  text-decoration: none;
}

.demo-line {
  color: #e8f2f5;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.demo-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(130, 194, 212, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
}

.demo-notes p {
  color: #b7c8ce;
  font-size: 12.5px;
  font-weight: 400;
}

.demo-disclaimer {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(130, 194, 212, 0.18);
  font-size: 12px !important;
}

.demo-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(130, 194, 212, 0.18);
  color: var(--ss-blue);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* ——— Silver iPhone frame (PNG chrome overlay + content clipped to display) ——— */
.iphone-12-pro {
  width: var(--phone-w);
  height: var(--phone-h);
  position: relative;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  flex-shrink: 0;
}

.iphone-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 30;
  /* Smooth chrome when scaled — avoid nearest-neighbor jaggies */
  image-rendering: auto;
  -webkit-user-drag: none;
}

/* App content sits under the bezel; silver PNG covers the seams */
.phone-screen {
  position: absolute;
  left: var(--frame-inset-l);
  top: var(--frame-inset-t);
  right: var(--frame-inset-r);
  bottom: var(--frame-inset-b);
  background: var(--ss-bg);
  border-radius: var(--screen-radius);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  z-index: 1;
  /* No clip-path — it stair-steps against the PNG hole */
  font-size: var(--fs-base);
  line-height: 1.35;
  container-type: size;
  container-name: phone-screen;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Login — one continuous teal wash behind status bar + welcome */
body:not(.is-authenticated) .phone-screen {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(130, 194, 212, 0.5), transparent 52%),
    linear-gradient(180deg, #c5e6ed 0%, #dff0f4 14%, var(--ss-blue-bg) 42%, #fff 78%);
}

body:not(.is-authenticated) .status-bar {
  background: transparent;
  color: var(--ss-text);
}

body:not(.is-authenticated) .app-body {
  background: transparent;
}

/* Status bar — time | Dynamic Island | signal + wifi + battery */
.status-bar {
  height: var(--safe-top);
  min-height: var(--safe-top);
  padding: var(--island-top) 16px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--island-w) minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 6;
  color: var(--ss-text);
  pointer-events: none;
  box-sizing: border-box;
}

.status-time {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  justify-self: start;
  line-height: 1;
  padding-left: 2px;
}

.status-island-gap {
  height: var(--island-h);
  width: 100%;
  /* Reserves the oval between time and icons — frame PNG draws the pill */
  pointer-events: none;
}

.status-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: var(--island-h);
  justify-self: end;
  overflow: visible;
}

.status-icons svg {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.status-icons .status-signal {
  width: 17px;
  height: 11px;
}

.status-icons .status-wifi {
  width: 15px;
  height: 11px;
}

.status-icons .status-battery {
  width: 25px;
  height: 12px;
}

.home-indicator {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--safe-bottom);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  z-index: 7;
  pointer-events: none;
}

.home-indicator span {
  width: 36%;
  max-width: 128px;
  height: 5px;
  border-radius: 3px;
  background: #1c1c1e;
  opacity: 0.9;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 10px;
  color: var(--ss-gray);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.login-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.app-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  animation: screenIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active {
  display: flex;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}

/* Welcome / Auth — centered stack; gradient on .phone-screen */
.screen-welcome {
  background: transparent;
  padding: var(--login-y) var(--edge);
  padding-bottom: calc(var(--login-y) + var(--safe-bottom));
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
  box-sizing: border-box;
}

.login-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  width: 100%;
  max-width: 100%;
}

.brand-mark {
  text-align: center;
  margin: 0;
  flex-shrink: 0;
  padding-top: 0;
}

.brand-mark img {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  box-shadow: 0 6px 16px rgba(82, 150, 170, 0.28);
}

.brand-mark h1 {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #2c2c2e;
  letter-spacing: -0.03em;
}

.brand-mark p {
  margin-top: 5px;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  padding: 0 8px;
}

.screen-welcome .login-card {
  margin: 0;
  flex-shrink: 0;
  padding: 16px 14px;
}

.screen-welcome .field label {
  color: #3a3a3c;
  font-weight: 600;
}

.screen-welcome .field input {
  color: #2c2c2e;
  font-weight: 500;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: var(--fs-btn);
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); opacity: 0.92; }

.btn-red,
.btn-green {
  background: var(--ss-green);
  color: #fff;
}
.btn-red:hover,
.btn-green:hover { background: var(--ss-green-dark); }

.btn-blue {
  background: var(--ss-blue);
  color: #fff;
}
.btn-blue:hover { background: var(--ss-blue-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ss-blue-dark);
  border: none;
  font-weight: 500;
  font-size: var(--fs-md);
}

.btn-ghost:active {
  opacity: 0.45;
}

.btn-block { width: 100%; }

.btn-apple-pay {
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-apple-pay:hover { background: #000; }

.or-divider {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--ss-muted);
  margin: 0 0 10px;
}

.screen-login {
  background: var(--ss-bg);
  padding: 8px var(--edge) 16px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px;
  box-shadow: 0 1px 0 var(--ss-separator);
  margin-top: 0;
}

.login-card h2 {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.login-card .hint {
  font-size: var(--fs-sm);
  color: var(--ss-muted);
  margin-bottom: 12px;
  font-weight: 400;
}

.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ss-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 400;
  outline: none;
  background: var(--ss-bg);
  color: var(--ss-text);
  letter-spacing: -0.01em;
}

.field input:focus {
  box-shadow: 0 0 0 3px rgba(130, 194, 212, 0.45);
}

/* Brand line — larger SoftSpot mark; login teal wash once logged in */
.nav-brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px var(--edge) 10px;
  background: rgba(249, 249, 249, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-shrink: 0;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.nav-brand span {
  font-size: 20px;
  font-weight: 700;
  color: var(--ss-text);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* Auth chrome — same teal top wash as login .phone-screen (status + logo strip) */
body.is-authenticated {
  /* One paint for status + brand / chat-header so the join reads continuous */
  --ss-auth-chrome-h: calc(var(--safe-top) + 56px);
  --ss-auth-chrome:
    radial-gradient(ellipse at 20% 0%, rgba(130, 194, 212, 0.5), transparent 52%),
    linear-gradient(180deg, #c5e6ed 0%, #dff0f4 40%, var(--ss-blue-bg) 100%);
}

body.is-authenticated .status-bar {
  color: var(--ss-text);
  background-color: #c5e6ed;
  background-image: var(--ss-auth-chrome);
  background-size: 100% var(--ss-auth-chrome-h);
  background-position: top center;
  background-repeat: no-repeat;
}

body.is-authenticated .nav-brand-bar {
  padding: 2px var(--edge) 14px;
  background-color: var(--ss-blue-bg);
  background-image: var(--ss-auth-chrome);
  background-size: 100% var(--ss-auth-chrome-h);
  background-position: 0 calc(-1 * var(--safe-top));
  background-repeat: no-repeat;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.is-authenticated .nav-brand span {
  color: var(--ss-text);
}

body.is-authenticated .nav-brand img {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  background: #fff;
}

/* Thread header replaces brand bar — continue the same wash under status */
body.is-authenticated .chat-header {
  color: var(--ss-text);
  background-color: var(--ss-blue-bg);
  background-image: var(--ss-auth-chrome);
  background-size: 100% calc(var(--safe-top) + 100%);
  background-position: 0 calc(-1 * var(--safe-top));
  background-repeat: no-repeat;
}

body.is-authenticated .live-pill {
  background: rgba(85, 85, 85, 0.12);
  color: var(--ss-text);
}

body.is-authenticated .live-pill.ended {
  background: rgba(85, 85, 85, 0.18);
}

body.is-authenticated .chat-header .end-chat {
  color: var(--ss-text);
  background: rgba(85, 85, 85, 0.12);
}

/* Main shell — translucent nav + tab bars */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px var(--edge) 8px;
  background: rgba(249, 249, 249, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ss-separator);
  flex-shrink: 0;
  min-height: 36px;
  position: relative;
  z-index: 2;
  gap: 8px;
}

.nav-bar h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: static;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-align: left;
  color: var(--ss-text);
}

/* Old centering spacers — collapse leading ones so title hugs --edge */
.nav-bar > .nav-side:first-child {
  display: none;
}

.nav-side {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--ss-blue-dark);
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
  flex-shrink: 0;
}

.nav-btn.back {
  padding-left: 0;
  color: var(--ss-blue-dark);
  max-width: 42%;
}

.nav-btn.back svg {
  flex-shrink: 0;
  width: 10px;
  height: 16px;
}

.nav-btn.icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: var(--ss-blue-dark);
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-btn.icon:active {
  opacity: 0.5;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px var(--edge) 72px;
  background: var(--ss-bg);
}

#screen-flow .scroll {
  padding-bottom: 96px;
}

.flow-cta {
  position: sticky;
  bottom: 8px;
  z-index: 3;
  margin-top: 12px;
  padding-top: 8px;
  background: linear-gradient(180deg, transparent, var(--ss-bg) 28%);
}

.flow-cta .btn {
  margin-bottom: 6px;
}

.flow-cta .payments-note {
  margin: 0;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 4px;
  align-content: start;
  border-top: 0.5px solid var(--ss-separator);
  background: rgba(249, 249, 249, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-shrink: 0;
  min-height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 4px var(--edge) var(--safe-bottom);
  border-bottom-left-radius: var(--screen-radius);
  border-bottom-right-radius: var(--screen-radius);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.tab {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  color: var(--ss-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.02em;
  padding: 2px 2px 0;
  min-width: 0;
  height: var(--tab-h);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.tab .glyph {
  width: 28px;
  height: 25px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.tab .glyph svg {
  width: 24px;
  height: 24px;
  display: block;
}

.tab.active {
  color: var(--ss-green-bright);
}

.tab:active {
  opacity: 0.55;
}

.section-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--ss-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 18px 0 8px 2px;
  text-align: left;
}

.section-label:first-child {
  margin-top: 4px;
}

.visit-card,
.plan-card,
.pet-card,
.activity-card,
.faq-card,
.notif-card {
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  box-shadow: 0 0.5px 0 var(--ss-separator);
  -webkit-tap-highlight-color: transparent;
}

.visit-card:active,
.plan-card:active,
.pet-card:active {
  transform: scale(0.985);
  opacity: 0.92;
}

.visit-card .row,
.pet-card .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.visit-card h3,
.plan-card h3,
.pet-card h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.visit-card p,
.plan-card p,
.pet-card p {
  font-size: var(--fs-sm);
}

.visit-card p,
.plan-card p,
.pet-card p,
.activity-card p,
.notif-card p,
.faq-card p {
  font-size: 13px;
  color: var(--ss-muted);
  margin-top: 3px;
  font-weight: 400;
  line-height: 1.35;
}

.view-more-link {
  display: inline-block;
  margin: 2px 0 4px 2px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ss-green);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.view-more-link:hover {
  color: var(--ss-green-dark);
}

.view-more-link:active {
  opacity: 0.7;
}

.badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ss-blue-bg);
  color: var(--ss-blue-dark);
  white-space: nowrap;
}

.badge.red,
.badge.green,
.badge.confirmed {
  background: var(--ss-green-bg);
  color: var(--ss-green-dark);
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0.5px 0 var(--ss-separator);
  -webkit-tap-highlight-color: transparent;
}

.settings-link:active {
  opacity: 0.85;
}

.settings-link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-link-text strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.settings-link-text span {
  font-size: 13px;
  color: var(--ss-muted);
  font-weight: 400;
}

.settings-link .chevron {
  color: #c7c7cc;
  flex-shrink: 0;
}

.payments-note {
  font-size: 12px;
  color: var(--ss-muted);
  margin: -6px 0 10px 2px;
  font-weight: 400;
}

.plan-card-active {
  box-shadow: 0 0 0 2px var(--ss-green-bright);
  background: var(--ss-green-bg);
}

#screen-flow,
#screen-payments,
#screen-visit-detail {
  padding-bottom: var(--safe-bottom);
}

#screen-flow .scroll,
#screen-payments .scroll {
  padding-bottom: 28px;
}

.flow-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px 0;
  background: rgba(249, 249, 249, 0.92);
  flex-shrink: 0;
}

.flow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d1d6;
}

.flow-dot.active {
  background: var(--ss-green-bright);
  transform: scale(1.15);
}

.flow-dot.done {
  background: var(--ss-green);
}

.flow-hint {
  font-size: 14px;
  color: var(--ss-muted);
  margin-bottom: 12px;
  line-height: 1.35;
}

.pet-pick.selected,
.vet-card.selected,
.service-card.selected,
.plan-card-active {
  box-shadow: 0 0 0 2px var(--ss-green-bright);
  background: var(--ss-green-bg);
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.field select {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 17px;
  background: var(--ss-bg);
  color: var(--ss-text);
  outline: none;
  appearance: none;
}

.date-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.date-chip {
  flex: 0 0 auto;
  border: none;
  background: #fff;
  border-radius: 20px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ss-text);
  cursor: pointer;
}

.date-chip.selected {
  background: var(--ss-blue);
  color: #fff;
}

.slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.slot-chip {
  border: none;
  background: #fff;
  border-radius: 10px;
  padding: 14px 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ss-text);
  cursor: pointer;
}

.slot-chip.selected {
  background: var(--ss-blue);
  color: #fff;
}

.slot-chip.disabled,
.slot-chip:disabled {
  opacity: 0.28;
  cursor: default;
}

.vet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.vet-card {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

.vet-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.vet-info h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.vet-info p {
  font-size: 13px;
  color: var(--ss-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.vet-years {
  color: var(--ss-blue-dark) !important;
  font-weight: 600 !important;
}

.vet-bio {
  margin-top: 4px !important;
}

.plan-card .price {
  font-size: 22px;
  font-weight: 700;
  color: var(--ss-green-dark);
  margin-top: 6px;
  letter-spacing: -0.03em;
}

.plan-card ul {
  margin-top: 8px;
  padding-left: 16px;
  font-size: 13px;
  color: var(--ss-muted);
  font-weight: 400;
}

.plan-card li { margin-bottom: 3px; }

.plan-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.plan-actions .btn {
  flex: 1;
  padding: 11px;
  font-size: 15px;
  border-radius: 10px;
}

.pet-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  border: none;
  background: var(--ss-blue-bg);
}

.pet-card .info { flex: 1; }

/* Chat — Messages-like bubbles */
.chat-header {
  background: var(--ss-blue);
  color: #fff;
  padding: 6px var(--edge) 12px;
  flex-shrink: 0;
}

.chat-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.live-pill {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 8px;
  border-radius: 999px;
}

.chat-header .sub {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 400;
  margin-top: 2px;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--ss-bg);
}

.bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.bubble .meta {
  font-size: 11px;
  margin-top: 3px;
  opacity: 0.65;
  font-weight: 400;
}

.bubble.user {
  align-self: flex-end;
  background: var(--ss-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.vet {
  align-self: flex-start;
  background: #e9e9eb;
  color: var(--ss-text);
  border: none;
  border-bottom-left-radius: 4px;
}

.bubble.system {
  align-self: center;
  background: transparent;
  color: var(--ss-muted);
  font-size: 12px;
  padding: 4px 8px;
  text-align: center;
  max-width: 90%;
}

.chat-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 16px 8px;
  background: rgba(249, 249, 249, 0.94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 0.5px solid var(--ss-separator);
}

.chat-compose input {
  flex: 1;
  border: 0.5px solid var(--ss-separator);
  border-radius: 20px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  background: #fff;
  min-height: 36px;
}

.chat-compose .btn.send {
  border-radius: 50%;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Account */
.profile-head {
  text-align: center;
  padding: 8px 0 12px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ss-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 600;
  margin: 0 auto 10px;
  letter-spacing: -0.02em;
}

.detail-rows {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0.5px 0 var(--ss-separator);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--ss-separator);
  font-size: var(--fs-sm);
  letter-spacing: -0.01em;
}

.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--ss-text); font-weight: 500; }
.detail-row span:last-child {
  font-weight: 400;
  text-align: right;
  color: var(--ss-muted);
  font-size: var(--fs-sm);
}

/* Pet info rows — smaller than account/settings rows */
#screen-pet-detail .detail-row {
  font-size: var(--fs-xs);
  padding: 8px 12px;
}
#screen-pet-detail .detail-row span:last-child {
  font-size: var(--fs-xs);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  background: rgba(44, 44, 46, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.toast.show { opacity: 1; }

.empty {
  text-align: center;
  color: var(--ss-muted);
  font-size: 15px;
  padding: 28px 12px;
  font-weight: 400;
}

/* Screens without tab bar — avoid extra bottom padding on login (causes scroll) */
#screen-pet-detail {
  padding-bottom: var(--safe-bottom);
}

#screen-welcome {
  padding-bottom: calc(var(--login-y) + var(--safe-bottom));
}

#screen-pet-detail .scroll {
  padding-bottom: 24px;
}

.embed-mode,
.embed-mode body {
  /* Match portfolio page — never paint black letterboxing around the phone */
  background: #ffffff !important;
  padding: 0;
  margin: 0;
  min-height: 100%;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.embed-mode html {
  overflow: hidden;
  height: 100%;
  width: 100%;
  background: #ffffff !important;
  color-scheme: only light;
}

.embed-mode body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.embed-mode .demo-chrome { display: none; }

/* Phone fills the iframe 1:1 — parent sets the large size */
.embed-mode {
  --phone-w: 100%;
  --phone-h: 100%;
}

.embed-mode .iphone-12-pro {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background: transparent !important;
}

@media (max-width: 380px) {
  :root {
    --phone-w: min(320px, 90vw);
  }
}

@media (min-width: 720px) {
  :root {
    --phone-w: 420px;
  }
}

/* Service type + booking */
.service-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 10px;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.service-card h3 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: 4px; }
.service-card p { font-size: var(--fs-sm); color: var(--ss-muted); }

.pay-row-editable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.icon-btn {
  border: none;
  background: var(--ss-green-bg);
  color: var(--ss-green-dark);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Chat shell */
.chat-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-shell .chat-header { flex-shrink: 0; }
.chat-shell .chat-thread { flex: 1; min-height: 0; }
.chat-history-list { flex: 1; overflow-y: auto; padding: 12px var(--edge) 18px; background: var(--ss-bg); }
.chat-history-item {
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-family: inherit;
  cursor: pointer;
}
.chat-history-item.locked { opacity: 0.95; }
.chat-history-item h3 { font-size: 15px; font-weight: 700; color: var(--ss-text); }
.chat-history-item p { font-size: 12px; color: var(--ss-muted); margin-top: 3px; }

.recent-chat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 0.5px 0 var(--ss-separator);
  -webkit-tap-highlight-color: transparent;
}

.recent-chat-card:active { opacity: 0.85; }

.recent-chat-card .info {
  flex: 1;
  min-width: 0;
}

.recent-chat-card h3 {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ss-text);
}

.recent-chat-card p {
  font-size: var(--fs-xs);
  color: var(--ss-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-ended-banner {
  background: #fff3cd;
  color: #856404;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px 12px;
}
.chat-compose.locked { opacity: 0.45; pointer-events: none; }
.chat-compose .attach {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--ss-green-bg);
  color: var(--ss-green-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.btn.send { background: var(--ss-green) !important; }
.bubble img.chat-img {
  display: block;
  max-width: 160px;
  border-radius: 12px;
  margin-bottom: 4px;
}
.image-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 0.5px solid var(--ss-separator);
}
.image-picker button {
  border: none;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--ss-bg);
}
.image-picker img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; }
.chat-header .end-chat {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.22);
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
}
.live-pill.ended { background: rgba(0,0,0,0.25); }
.date-chip.selected, .slot-chip.selected {
  background: var(--ss-green);
  color: #fff;
}
