:root {
  color-scheme: light;
  --auth-cream: #F7F1E8;
  --auth-glow: #FFFAF0;
  --auth-tan: #EBDCC4;
  --auth-terracotta: #B94727;
  --auth-green: #2F5D4E;
  --auth-text: #2B2A26;
  --auth-label: #3B352B;
  --auth-secondary: #4A4337;
  --auth-tagline: #5A5144;
  --auth-muted: #5E5648;
  --auth-input: #FFFFFF;
  --auth-border: #D4C2A5;
  --auth-placeholder: #766B5A;
  --auth-error: #A32847;
  --auth-disabled: #D8BBA6;
  --auth-disabled-text: #6F5648;
  --auth-card-radius: 28px;
  --auth-control-radius: 14px;
  --lavender-blue: #D2BFA3;
  --peacock-blue: #B94727;
  --dark-blue-green: #2F433B;
  --dark-driftwood: #3B2D23;
  --light-copper: #B94727;
  --ultra-light-mocha: #F7F3EA;
  --content-max: 72rem;
  --content-px: 1.5rem;
  --content-inset: max(var(--content-px), calc((100% - var(--content-max)) / 2 + var(--content-px)));
}

body {
  background-color: var(--ultra-light-mocha);
  color: var(--dark-blue-green);
}

.hidden,
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html.in-onboarding body {
  background-color: var(--backdrop);
}

html.in-onboarding #app-shell {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

html.in-onboarding #bottom-nav,
html.in-onboarding #app-header {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  display: inline-block;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.ui-icon-small {
  width: 0.9rem;
  height: 0.9rem;
}

.ui-icon-large {
  width: 1.5rem;
  height: 1.5rem;
}

.species-icon {
  display: block;
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
}

.species-icon-avatar {
  width: 2.75rem;
  height: 2.75rem;
}

.species-icon-profile,
.ui-icon-profile {
  width: 4.5rem;
  height: 4.5rem;
}

.pet-species-badge,
.pf-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-card {
  isolation: isolate;
}

.auth-views {
  display: grid;
  position: relative;
}

.auth-view {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  visibility: hidden;
}

.auth-view:not(.is-active) {
  position: absolute;
  inset: 0;
  width: 100%;
}

.auth-view.is-active {
  position: relative;
}

.auth-view.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

#auth-screen.is-recovery .sitter-panel {
  display: none;
}

.sitter-panel {
  border-top: 1px solid rgb(47 67 59 / 14%);
}

.sitter-helper {
  color: var(--stitch, #5C4738);
}

@media (prefers-reduced-motion: reduce) {
  .auth-view {
    transition: none;
  }
}

.brand-mark {
  background-color: var(--light-copper);
  box-shadow: 0 10px 20px rgb(193 91 52 / 22%);
}

.login-logo {
  position: relative;
  left: 50%;
  width: 72%;
  max-width: none;
  margin-bottom: 0;
  transform: translateX(-50%);
}

.brand-name,
.dashboard-eyebrow {
  color: var(--peacock-blue);
}

.pet-input {
  border-color: var(--lavender-blue);
  background-color: #fff;
  color: var(--dark-blue-green);
  font-size: 16px;
}

/* Prevent mobile auto-zoom on input focus: enforce 16px minimum */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.pet-input,
.sitter-input,
.pf-input {
  font-size: 16px;
}

@media screen and (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .pet-input,
  .sitter-input,
  .pf-input {
    font-size: 16px !important;
  }
}

:is(input, select, textarea):focus {
  scroll-margin-top: 5rem;
  scroll-margin-bottom: 5rem;
}

.pet-input:focus {
  border-color: var(--peacock-blue);
  box-shadow: 0 0 0 3px rgb(193 91 52 / 16%);
}

.password-toggle.is-visible .show-icon,
.password-toggle .hide-icon {
  display: none;
}

.password-toggle.is-visible .hide-icon {
  display: block;
}

.primary-button {
  background-color: var(--peacock-blue);
}

.primary-button:hover {
  background-color: #A84A27;
}

.primary-button:disabled,
html.website-mode .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto;
}

.secondary-button {
  border-color: var(--lavender-blue);
  background-color: rgb(210 191 163 / 24%);
  color: var(--dark-blue-green);
}

.secondary-button:hover {
  background-color: rgb(210 191 163 / 40%);
}

.sitter-input {
  border-color: var(--lavender-blue);
  background-color: #fff;
  color: var(--dark-blue-green);
}

.status-message {
  /* Success / confirmation: soft brand green so it never reads as an error. */
  border: 1px solid rgb(61 133 88 / 40%);
  background-color: rgb(61 133 88 / 14%);
  color: #1E5133;
}

.status-message-error,
.status-message.is-error {
  border-color: rgb(185 71 39 / 38%);
  background-color: rgb(185 71 39 / 10%);
  color: #8A2F17;
}

/* Sitter guide update status (shown after posting an update). */
#sitter-update-status:not(.sr-only) {
  margin-top: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(61 133 88 / 40%);
  background-color: rgb(61 133 88 / 14%);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #1E5133;
}

#sitter-update-status.is-error:not(.sr-only) {
  border-color: rgb(185 71 39 / 38%);
  background-color: rgb(185 71 39 / 10%);
  color: #8A2F17;
}

.password-rule {
  color: #7A6657;
  transition: color 120ms ease;
}

.password-rule::before {
  content: "○";
  display: inline-block;
  margin-right: 0.5rem;
  width: 0.75rem;
}

.password-rule.is-met {
  color: #4E6B50;
}

.password-rule.is-met::before {
  content: "✓";
  color: #6B8269;
}

.dashboard-add-button {
  border-color: var(--lavender-blue);
  background-color: rgb(210 191 163 / 15%);
  color: var(--dark-blue-green);
}

.dashboard-add-button:hover {
  border-color: var(--peacock-blue);
  background-color: rgb(210 191 163 / 28%);
}

.dashboard-layout {
  justify-content: flex-start;
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.app-header {
  display: none;
}

.app-header.is-visible {
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgb(226 232 240 / 50%);
  background-color: rgb(242 236 228 / 90%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* PWA standalone — always show brand name */
.app-header-brand-name {
  display: inline;
  white-space: nowrap;
}

.account-settings-dialog {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-color: var(--lavender-blue);
  color: var(--dark-blue-green);
}

.account-settings-dialog::backdrop {
  background-color: rgb(59 45 35 / 42%);
  backdrop-filter: blur(3px);
}

.breed-suggestions {
  border-color: var(--lavender-blue);
  background-color: #fff;
  box-shadow: 0 12px 24px rgb(47 67 59 / 12%);
}

.breed-suggestion {
  color: var(--dark-blue-green);
}

.breed-suggestion:hover,
.breed-suggestion.is-active {
  background-color: rgb(210 191 163 / 24%);
}

.species-picker {
  position: relative;
}

.species-picker-trigger {
  display: flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--lavender-blue);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
}

.species-picker-trigger:focus-visible {
  outline: 2px solid var(--peacock-blue);
  outline-offset: 2px;
}

.species-picker-value,
.species-picker-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.species-picker-value .species-icon,
.species-picker-option .species-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.species-picker-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  max-height: 15rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--lavender-blue);
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.25rem;
  box-shadow: 0 12px 24px rgb(47 67 59 / 12%);
}

.species-picker-options.opens-up {
  top: auto;
  bottom: calc(100% + 0.25rem);
}

.species-picker-option {
  min-height: 2.75rem;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.species-picker-option.is-active,
.species-picker-option:not([aria-disabled="true"]):hover {
  background: rgb(210 191 163 / 24%);
}

.species-picker-option[aria-disabled="true"] {
  color: #7A6657;
  cursor: not-allowed;
}

.species-picker-option[aria-disabled="true"] .species-icon {
  opacity: 0.55;
}

.website-install-button {
  display: none;
}

.website-hero {
  display: none;
}

.website-mobile-install {
  display: none;
}

.website-desktop-brand {
  display: none;
}

.install-app-dialog {
  border-color: var(--lavender-blue);
  color: var(--dark-blue-green);
}

.install-app-dialog::backdrop {
  background-color: rgb(59 45 35 / 48%);
  backdrop-filter: blur(4px);
}

#install-app-dialog {
  box-sizing: border-box;
  width: min(calc(100% - 2rem), 28rem);
  max-width: 28rem;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgb(210 191 163 / 70%);
  border-radius: 1.5rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 24px 70px rgb(59 45 35 / 24%);
}

.install-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.install-dialog-eyebrow {
  margin: 0 0 0.4rem;
  color: #A84A27;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#install-app-title {
  margin: 0;
  color: #2F433B;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.install-dialog-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: #EFE9DC;
  color: #5C4738;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.install-dialog-intro {
  margin: 0.8rem 0 1.2rem;
  color: #5C4738;
  font-size: 0.9rem;
  line-height: 1.5;
}

.install-instructions {
  display: grid;
  gap: 0.75rem;
}

.install-instruction {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border: 1px solid #D9C9AE;
  border-radius: 1rem;
  background: #EFE9DC;
  padding: 1rem;
}

.install-instruction-icon {
  display: grid;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 0.75rem;
  background: #E6D7C1;
  color: #A84A27;
}

.install-instruction-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.install-instruction h3 {
  margin: 0 0 0.3rem;
  color: #2F433B;
  font-size: 0.9rem;
  font-weight: 700;
}

.install-instruction p {
  margin: 0;
  color: #5C4738;
  font-size: 0.85rem;
  line-height: 1.5;
}

.install-dialog-note {
  margin: 1rem 0;
  color: #6B5645;
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}

.install-dialog-done {
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.85rem;
  background: #A84A27;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.install-dialog-close:focus-visible,
.install-dialog-done:focus-visible {
  outline: 3px solid var(--peacock-blue);
  outline-offset: 3px;
}

.install-dialog-done:hover {
  background: #A84A27;
}

@media (max-width: 899px) {
  html.website-mode .website-mobile-install {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    width: min(100%, 28rem);
    margin: 1.25rem auto 0;
    border: 1px solid var(--lavender-blue);
    border-radius: 1rem;
    background: rgb(255 255 255 / 80%);
    padding: 1rem;
    color: var(--dark-blue-green);
    font-size: 0.8rem;
    line-height: 1.4;
  }

  html.website-mode #app-shell.is-authenticated .website-mobile-install {
    position: static;
    width: min(calc(100% - 2rem), 28rem);
    flex: 0 0 auto;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgb(47 67 59 / 12%);
  }

  html.website-mode .website-mobile-install .website-install-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0;
    border: 0;
    border-radius: 0.75rem;
    background: var(--peacock-blue);
    padding: 0.65rem 0.8rem;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
  }
}


@media (min-width: 900px) {
  html:has(#app-shell:not(.is-authenticated)) body {
    background:
      radial-gradient(ellipse at 12% 10%, rgb(193 91 52 / 9%), transparent 32rem),
      var(--ultra-light-mocha);
    color: var(--dark-blue-green);
  }

  html:has(#app-shell:not(.is-authenticated)) #app-shell {
    display: grid;
    width: min(100%, 1280px);
    max-width: none;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    grid-template-rows: auto 1fr auto;
    align-items: start;
    align-content: start;
    justify-content: stretch;
    gap: 2rem 3rem;
    padding: 2rem 3rem;
  }

  html:has(#app-shell:not(.is-authenticated)) #auth-brand-header {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-desktop-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark-blue-green);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-desktop-brand img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
  }

  html:has(#app-shell:not(.is-authenticated)) #auth-brand-header > .login-logo {
    display: none;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-hero {
    display: block;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding-top: 0.25rem;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-browser-tagline {
    display: none;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-kicker {
    color: var(--peacock-blue);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-headline {
    max-width: 15ch;
    margin-top: 0.65rem;
    margin-bottom: 1.5rem;
    color: var(--dark-blue-green);
    font-size: clamp(2.5rem, 4.4vw, 4rem);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.04;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-copy {
    max-width: 38rem;
    margin-top: 0;
    color: rgb(47 67 59 / 82%);
    font-size: 1.1rem;
    line-height: 1.7;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-value {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 38rem;
    margin-top: 1.5rem;
    color: var(--dark-blue-green);
    font-size: 0.95rem;
    line-height: 1.6;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-value + .website-value {
    margin-top: 0.75rem;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-value::before {
    content: "✓";
    display: inline-flex;
    flex: 0 0 1.5rem;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgb(193 91 52 / 13%);
    color: var(--peacock-blue);
    font-weight: 700;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-install-note {
    display: block;
    margin-top: 0.65rem;
    color: rgb(47 67 59 / 72%);
    font-size: 0.8rem;
  }

  html:has(#app-shell:not(.is-authenticated)) .login-logo {
    position: static;
    left: auto;
    width: auto;
    max-width: 200px;
    max-height: 4.5rem;
    transform: none;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-install-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.5rem;
    border: 0;
    border-radius: 0.9rem;
    background: var(--peacock-blue);
    padding: 0.8rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background-color 150ms ease, transform 150ms ease;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-install-button:hover {
    transform: translateY(-1px);
    background: #A84A27;
  }

  html:has(#app-shell:not(.is-authenticated)) .website-install-button:focus-visible {
    outline: 3px solid rgb(193 91 52 / 45%);
    outline-offset: 3px;
  }

  html:has(#app-shell:not(.is-authenticated)) #auth-screen {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: 2rem;
  }

  html:has(#app-shell:not(.is-authenticated)) .auth-card {
    border-color: var(--lavender-blue);
    border-radius: 1.5rem;
    padding-bottom: 2.75rem;
    box-shadow: 0 20px 45px rgb(47 67 59 / 10%);
  }

  html:has(#app-shell:not(.is-authenticated)) .auth-card h2,
  html:has(#app-shell:not(.is-authenticated)) #app-dashboard h2,
  html:has(#app-shell:not(.is-authenticated)) #app-dashboard h3 {
    color: var(--dark-blue-green);
  }

  html:has(#app-shell:not(.is-authenticated)) .pet-input,
  html:has(#app-shell:not(.is-authenticated)) .sitter-input {
    border-color: var(--lavender-blue);
    border-radius: 0.85rem;
    color: var(--dark-blue-green);
  }

  html:has(#app-shell:not(.is-authenticated)) .pet-input:focus,
  html:has(#app-shell:not(.is-authenticated)) .sitter-input:focus {
    border-color: var(--peacock-blue);
    box-shadow: 0 0 0 3px rgb(193 91 52 / 16%);
  }

  html:has(#app-shell:not(.is-authenticated)) .primary-button {
    border-radius: 0.85rem;
    background-color: var(--peacock-blue);
  }

  html:has(#app-shell:not(.is-authenticated)) .primary-button:hover {
    background-color: #A84A27;
  }

  html:has(#app-shell:not(.is-authenticated)) .secondary-button,
  html:has(#app-shell:not(.is-authenticated)) #account-menu-button,
  html:has(#app-shell:not(.is-authenticated)) #toggle-sitter-code-button {
    border-color: var(--lavender-blue);
    background-color: rgb(210 191 163 / 24%);
    color: var(--dark-blue-green);
  }

  html:has(#app-shell:not(.is-authenticated)) .secondary-button:hover,
  html:has(#app-shell:not(.is-authenticated)) #account-menu-button:hover,
  html:has(#app-shell:not(.is-authenticated)) #toggle-sitter-code-button:hover {
    background-color: rgb(210 191 163 / 40%);
  }

  html:has(#app-shell:not(.is-authenticated)) .sitter-panel {
    border-top-color: rgb(47 67 59 / 14%);
  }

  html:has(#app-shell:not(.is-authenticated)) .sitter-helper {
    color: var(--stitch, #5C4738);
  }

  html:has(#app-shell:not(.is-authenticated)) .status-message {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    margin-top: 1rem;
    border: 1px solid rgb(61 133 88 / 40%);
    background-color: rgb(61 133 88 / 14%);
    color: #1E5133;
  }

  html:has(#app-shell:not(.is-authenticated)) .status-message-error {
    border-color: rgb(185 71 39 / 38%);
    background-color: rgb(185 71 39 / 10%);
    color: #8A2F17;
  }

  html:has(#app-shell:not(.is-authenticated)) .dashboard-eyebrow {
    color: var(--peacock-blue);
  }

  html:has(#app-shell:not(.is-authenticated)) .account-settings-dialog,
  html:has(#app-shell:not(.is-authenticated)) .breed-suggestions {
    border-color: var(--lavender-blue);
    color: var(--dark-blue-green);
    box-shadow: 0 16px 36px rgb(47 67 59 / 12%);
  }

  html:has(#app-shell:not(.is-authenticated)) .breed-suggestion:hover,
  html:has(#app-shell:not(.is-authenticated)) .breed-suggestion.is-active {
    background-color: rgb(210 191 163 / 24%);
  }

  html:has(#app-shell:not(.is-authenticated)) .dashboard-add-button {
    border-color: var(--lavender-blue);
    border-radius: 1rem;
    background-color: rgb(210 191 163 / 15%);
    color: var(--dark-blue-green);
  }

  html:has(#app-shell:not(.is-authenticated)) .dashboard-add-button:hover {
    border-color: var(--peacock-blue);
    background-color: rgb(210 191 163 / 28%);
  }

  html:has(#app-shell:not(.is-authenticated)) .install-app-dialog {
    max-width: 28rem;
    border: 1px solid var(--lavender-blue);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 24px 70px rgb(47 67 59 / 24%);
  }

  html:has(#app-shell:not(.is-authenticated)) #app-shell {
    grid-column: 1 / -1;
    grid-row: 2 / span 2;
  }

}

/* Pet profile view */
.pf-section {
  border: 1px solid #D9C9AE;
  border-radius: 1rem;
  background-color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
  scroll-margin-top: 5rem;
}

.pf-section > summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  list-style: none;
}

.pf-section > summary::-webkit-details-marker {
  display: none;
}

.pf-section > summary::after {
  content: '＋';
  margin-left: auto;
  color: #7A6657;
}

.pf-section[open] > summary::after {
  content: '－';
}

.pf-badge-private {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  background-color: rgb(193 91 52 / 16%);
  padding: 0.15rem 0.65rem;
  color: var(--dark-driftwood);
  font-size: 0.75rem;
  font-weight: 700;
}

.pf-body {
  display: grid;
  gap: 1rem;
  border-top: 1px solid #EFE9DC;
  padding: 1.25rem 1.5rem 1.5rem;
}

.pf-field {
  display: block;
  color: #3B2D23;
  font-size: 0.875rem;
  font-weight: 500;
}

.pf-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  border-width: 1px;
  border-radius: 0.75rem;
  padding: 0.6rem 0.9rem;
  font-weight: 400;
  outline: none;
}

.pf-subheading { margin: 0; color: #2F5D4E; font-weight: 700; }
.pf-repeater-list { display: grid; gap: 0.8rem; margin-top: 0.75rem; }
.pf-repeater-empty { margin: 0.5rem 0 0; color: #756758; font-size: 0.875rem; }
.pf-repeat-summary { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-width: 0; }
.pf-repeat-summary span { min-width: 0; overflow-wrap: anywhere; color: #2F5D4E; font-weight: 700; font-size: 0.95rem; }
.pf-repeat-summary button, .pf-time-period button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-width: 48px;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid #D4C2A5;
  border-radius: 12px;
  background: #fff;
  color: #2F5D4E;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-sizing: border-box;
  vertical-align: middle;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.pf-repeat-summary button:hover, .pf-time-period button:hover {
  background-color: #F7F1E8;
  border-color: #B59E7F;
}
.pf-repeat-editor { display: grid; gap: 0.8rem; }
.pf-repeat-summary.hidden, .pf-repeat-editor.hidden, .pf-time-error.hidden { display: none; }
.pf-time-period { display: flex; gap: 0.5rem; }
.pf-time-period button[aria-pressed="true"] { background: #2F5D4E; border-color: #2F5D4E; color: #fff; }
.pf-time-period button:disabled { opacity: 0.55; cursor: default; }
.pf-time-error { margin: 0; color: #9B302D; font-size: 0.8rem; }
.pf-schedule-help { margin: 0; color: #756758; font-size: 0.8rem; line-height: 1.4; }
.pf-repeat-summary button:focus-visible, .pf-time-period button:focus-visible { outline: 3px solid #2F5D4E; outline-offset: 2px; }
.pf-nested-card {
  display: grid;
  min-width: 0;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid #DFD2BE;
  border-radius: 14px;
  background: #FAF6EE;
  box-shadow: 0 1px 2px rgb(47 67 59 / 4%);
}
.pf-nested-card > p { margin: 0; font-size: 0.85rem; color: #756758; }
.pf-nested-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pf-nested-heading h4 { margin: 0; color: #2F5D4E; font-weight: 700; }
.pf-nested-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pf-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0.8rem; }
.pf-repeater-add, .pf-nested-heading button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid #D4C2A5;
  border-radius: 12px;
  background: #fff;
  color: #2F5D4E;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.pf-repeater-add { margin-top: 0.75rem; }
.pf-nested-heading button { font-size: 0.85rem; }
.pf-nested-heading [data-care-collapse] {
  background-color: #FAF6EE;
  border-color: #D4C2A5;
  color: #1F3A2E;
}
.pf-nested-heading [data-care-collapse]:hover {
  background-color: #F3EDE2;
}
.pf-nested-heading [data-care-remove] {
  color: #B84A27;
  border-color: rgba(184, 74, 39, 0.35);
  background-color: rgba(184, 74, 39, 0.06);
}
.pf-nested-heading [data-care-remove]:hover {
  background-color: rgba(184, 74, 39, 0.12);
  border-color: #B84A27;
}
.pf-repeater-add:focus-visible, .pf-nested-heading button:focus-visible { outline: 3px solid #2F5D4E; outline-offset: 2px; }
#pet-profile-form:not(.is-editing) :is([data-care-add], [data-care-remove]) { display: none; }

.pf-pill {
  border-radius: 9999px;
  background-color: rgb(193 91 52 / 12%);
  padding: 0.2rem 0.75rem;
  color: #A84A27;
  font-size: 0.8rem;
  font-weight: 600;
}

:root {
  --pet-card-h: 8.5rem;
}

.pet-scroll {
  overflow-y: auto !important;
}

/* Hidden scrollbar; the list stays scrollable */
.custom-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  .pet-scroll {
    max-height: 340px !important;
  }

  #todo-card {
    height: 340px !important;
  }
}

/* Pet photo gallery and lightbox */
.gallery-tile {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid #D9C9AE;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  cursor: pointer;
}
.gallery-tile-empty {
  border: 2px dashed #B94727;
  color: #B94727;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgb(193 91 52 / 4%);
}
.gallery-tile-empty:hover { background: rgb(193 91 52 / 10%); }
.gallery-tile-locked {
  gap: 0.35rem;
  border: 2px dashed #D2BFA3;
  color: #9C8672;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem;
  background: #F7F3EA;
  cursor: not-allowed;
}
.lightbox-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(0 0 0 / 92%);
}
.lightbox-dialog[open] { display: flex; align-items: center; justify-content: center; }
.lightbox-image { max-width: 90vw; max-height: 78vh; object-fit: contain; border-radius: 0.75rem; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  color: #fff;
  background: rgb(255 255 255 / 15%);
  border-radius: 9999px;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.75rem;
  line-height: 1;
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-footer {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Daily to-do checklist */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid #D9C9AE;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.todo-item input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; accent-color: #B94727; flex-shrink: 0; }
.todo-item:has(input:checked) .todo-item-title { text-decoration: line-through; color: #9C8672; }

/* Vet documents */
.doc-stage {
  position: absolute;
  inset: 0 0 4.5rem 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-stage.hidden, .doc-pdf.hidden { display: none; }
.doc-image { max-width: 96vw; max-height: 100%; object-fit: contain; user-select: none; transform-origin: center; will-change: transform; }
.doc-pdf { width: 94vw; height: calc(100vh - 6.5rem); margin-bottom: 3rem; border: 0; border-radius: 0.75rem; background: #fff; }
.vet-doc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #E3D5BD;
  border-radius: 0.75rem;
  background: rgb(247 243 234 / 60%);
  padding: 0.75rem;
}

.save-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  background: #fff;
  color: #3B2D23;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
  border: 1px solid #D9C9AE;
  transform: translate(-50%, -150%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.save-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.save-toast.save-toast-error {
  border-color: #F87171;
  color: #991B1B;
  background: #FEF2F2;
}
.save-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: #6B8269;
  color: #fff;
  font-size: 0.9rem;
}
.save-toast.save-toast-error .save-toast-icon {
  background: #DC2626;
}

#pet-profile-form:not(.is-editing) .pf-body > .pf-field:not(.is-empty),
#pet-profile-form:not(.is-editing) .pf-body .grid > .pf-field:not(.is-empty),
#pet-profile-form:not(.is-editing) .pf-body .pf-card-grid > .pf-field:not(.is-empty) {
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid #DFD2BE;
  border-radius: 14px;
  background: #FAF6EE;
  box-shadow: 0 1px 2px rgb(47 67 59 / 4%);
}

#pet-profile-form:not(.is-editing) .pf-body .pf-field:not(.is-empty) {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2F5D4E;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#pet-profile-form:not(.is-editing) .pf-body .pf-field:not(.is-empty) > span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2F5D4E;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#pet-profile-form:not(.is-editing) .pf-body :is(input, select, textarea):disabled:not([type="checkbox"]) {
  border-color: transparent;
  background: transparent;
  color: #2B2A26;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  opacity: 1;
  padding-left: 0;
  padding-right: 0;
  resize: none;
  -webkit-appearance: none;
  appearance: none;
}

#pet-profile-form:not(.is-editing) .pf-body :is(input, select, textarea):disabled::placeholder {
  color: transparent;
}

#edit-pet-profile-button:disabled {
  border-color: transparent;
  background: rgb(193 91 52 / 12%);
  cursor: default;
}


/* Profile form alignment (iOS date/select inputs render differently) */
.pf-input {
  min-height: 2.75rem;
  box-sizing: border-box;
  min-width: 0;
  text-align: left;
}

.pf-input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  line-height: 1.5;
}

.pf-input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.5em;
  margin: 0;
  text-align: left;
}

#pet-profile-form:not(.is-editing) .pf-input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}

#pet-profile-form:not(.is-editing) .pf-field.is-empty {
  display: none !important;
}

#pet-profile-form:not(.is-editing) .pf-help-text {
  display: none !important;
}

#pet-profile-form:not(.is-editing) :is([data-calendar-trigger], .pf-calendar-trigger, .date-calendar-trigger) {
  display: none !important;
}

textarea.pf-input {
  min-height: 4.5rem;
  max-height: none;
  overflow-y: auto;
  resize: vertical;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  field-sizing: content;
}

#pet-profile-form:not(.is-editing) textarea.pf-input:disabled {
  height: auto !important;
  min-height: auto;
  max-height: none !important;
  overflow: visible !important;
  white-space: pre-wrap !important;
  word-break: break-word;
  resize: none;
  line-height: 1.5;
}

#pet-profile-form:not(.is-editing) .pf-detail-field {
  height: auto !important;
  min-height: auto;
  max-height: none !important;
  overflow: visible !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
  pointer-events: none;
}

.date-input-wrap { display: flex; align-items: stretch; min-width: 0; gap: 0.4rem; }
.date-input-wrap input { min-width: 0; flex: 1; }
.date-input-wrap input::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
  pointer-events: none;
}
.date-calendar-trigger, .date-calendar button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #D4C2A5;
  border-radius: 12px;
  background: #FFFAF0;
  color: #2F5D4E;
  cursor: pointer;
}
.date-calendar-trigger svg { width: 20px; height: 20px; margin: auto; }
.date-calendar-trigger:disabled { opacity: 0.5; cursor: default; }
.date-calendar {
  box-sizing: border-box;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 20px;
  background: #F7F1E8;
  color: #2F5D4E;
}
.date-calendar::backdrop { background: rgb(43 42 38 / 55%); }
.date-calendar h2 { margin: 0 0 12px; color: #2F5D4E; font-size: 1.4rem; }
.date-calendar-navigation { display: grid; grid-template-columns: 44px minmax(0, 1fr) 80px 44px; gap: 4px; }
.date-calendar-navigation select { min-width: 0; border: 1px solid #D4C2A5; border-radius: 10px; padding: 0 4px; }
.date-calendar-help { margin: 8px 0 4px; font-size: 0.75rem; }
.date-calendar-weekdays, .date-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.date-calendar-weekdays { margin: 6px 0; font-size: 0.7rem; font-weight: 700; }
.date-calendar-days button { min-width: 0; padding: 0; border-color: transparent; background: transparent; }
.date-calendar-days button[aria-pressed="true"] { background: #2F5D4E; color: #fff; }
.date-calendar-days button:disabled { opacity: 0.35; cursor: default; }
.date-calendar-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.date-calendar-actions button { padding: 0 12px; }
.date-calendar :is(button, select):focus-visible, .date-calendar-trigger:focus-visible { outline: 3px solid #2F5D4E; outline-offset: 2px; }

/* Collapsible account settings */
.account-collapse-summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  list-style: none;
}

#account-menu-button { width: 44px; height: 44px; }

.account-collapse-summary::-webkit-details-marker {
  display: none;
}

.account-collapse-summary::after {
  content: '＋';
  color: #7A6657;
}

.account-collapse[open] > .account-collapse-summary::after {
  content: '－';
}

/* Installed app: continue the header color when overscrolling at the top */
html:not(.website-mode) {
  background-color: #F2ECE1;
}

html:not(.website-mode) .app-header.is-visible {
  background-color: #F2ECE1;
  padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
}

.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 60;
  transform: translate(-50%, -150%);
  border-radius: 9999px;
  background: #A84A27;
  padding: 0.35rem 0.9rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.15s, opacity 0.15s;
}

.ptr-indicator.is-visible {
  transform: translate(-50%, 0.75rem);
  opacity: 1;
}

/* ===== Cozy button-box theme ===== */
:root {
  --cream: #FAF6EE;
  --sand: #F3EDE2;
  --parchment: #F3EDE2;
  --nav-parchment: #FAF6EE;
  --forest: #1F2421;
  --forest-green: #1F3A2E;
  --espresso: #1F2421;
  --stitch: #5C4738;
  --terracotta: #B84A27;
  --terracotta-dark: #A83F20;
  --sage: #6B8269;
  --vine: #4E6B50;
  --backdrop: #A5A888;
  --font-heading: 'Fraunces', 'Patrick Hand', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Nunito', system-ui, -apple-system, sans-serif;
  --nav-height: 4.25rem;
}

html,
body {
  overflow-x: clip;
  max-width: 100vw;
}

#app-shell,
#app-dashboard,
#dashboard-home,
#dashboard-overview-grid,
.pack-section,
.pack-list-wrap,
.todays-care {
  overflow-x: clip;
  min-width: 0;
  max-width: 100%;
}

#dashboard-home {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  #dashboard-home {
    padding-bottom: 2rem;
  }
}

html body {
  font-family: var(--font-body);
  color: var(--forest);
}

html body h1,
html body h2,
html body h3,
html body .app-header-brand-name,
html body .pet-card-name,
html body .section-title,
html body .card-title,
html body .font-heading {
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
  color: var(--espresso);
}

/* Soften stark Tailwind neutrals */
html body .bg-white { background-color: #FBF7EE; }
html body .bg-white\/80 { background-color: rgb(251 247 238 / 80%); }
html body .border-slate-100,
html body .border-slate-200,
html body .border-slate-300 { border-color: #D9C9AE; }
html body .text-slate-500 { color: #7A6657; }
html body .text-slate-600 { color: #5C4738; }
html body .text-slate-700,
html body .text-slate-800,
html body .text-slate-900 { color: var(--espresso); }
html body input,
html body select,
html body textarea { background-color: #FBF7EE; color: var(--espresso); }

/* ----- Frame: centered 480px phone column on a sage backdrop ----- */
html,
body {
  overflow-x: clip;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 640px) {
  html body #app-shell.is-authenticated {
    min-height: 100vh;
  }
}

body:has(#app-shell.is-authenticated) { background-color: var(--backdrop); }

html body #app-shell.is-authenticated {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 0 calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 1rem);
  background-color: var(--cream);
  overflow-x: clip;
  box-shadow: 0 0 40px rgb(59 45 35 / 18%);
}

html body #app-shell.is-authenticated #app-dashboard {
  padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
}

.nav-hidden { display: none !important; }

/* ----- Header ----- */
html body .app-header.is-visible {
  margin-bottom: 1rem;
  background-color: var(--nav-parchment);
  border-bottom: 1px solid rgba(47, 93, 78, 0.2);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html body .app-header-brand-name {
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--forest);
}

/* ----- Card with clean subtle green border ----- */
.stitch-card {
  position: relative;
  margin-top: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 16px;
  background-color: var(--kraft);
  border: 1px solid rgba(47, 93, 78, 0.22);
  box-shadow: 0 4px 12px rgb(74 55 40 / 6%);
  color: var(--espresso);
}

.stitch-card::before {
  display: none !important;
}

.card-title {
  font-size: 1.35rem;
  line-height: 1.2;
}

.card-copy {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--stitch);
}

.terracotta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border: 0;
  border-radius: 9999px;
  background-color: var(--terracotta);
  color: var(--cream);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--terracotta), 0 0 0 3.5px rgb(247 243 234 / 70%) inset;
  cursor: pointer;
}

.terracotta-button:hover { background-color: var(--terracotta-dark); }

/* ----- Greeting ----- */
.dashboard-greeting {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.25rem 0.25rem 0;
}

.spool-icon {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--terracotta);
}

.dashboard-greeting-text {
  font-size: 1.6rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.dashboard-subline {
  margin-top: 0.1rem;
  font-size: 0.88rem;
  color: var(--vine, #4E6B50);
  font-weight: 600;
}

/* ----- Today's Care ----- */
.todays-care {
  padding: 1.1rem 1.15rem;
}

.care-button {
  display: none !important;
}

.todays-care-empty {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: var(--stitch);
}

.todays-care-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.todays-care-list.hidden { display: none; }

.todays-care-list > li {
  min-width: 0;
}

.todays-care-list .todo-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.5rem 0.8rem;
  border: 1px solid #D9C9AE;
  border-radius: 14px;
  background-color: var(--parchment);
  color: var(--espresso);
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.todays-care-list[data-filter="undone"] li:has(input:checked) {
  display: none !important;
}

.todays-care-list .todo-item:has(input:checked) {
  background-color: #E2E8DC;
  border-color: #B5C4B0;
}

.todays-care-list .todo-item:has(input:checked) .todo-item-title {
  text-decoration: line-through;
  color: #7A6657;
}

.todays-care-list .todo-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.todo-item-meta {
  font-size: 0.75rem;
  color: var(--stitch);
}

.todays-care-list .todo-item input {
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 6px;
  accent-color: var(--terracotta);
  cursor: pointer;
  flex-shrink: 0;
}

.todo-filter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.todo-filter-pill {
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border: 0;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: transparent;
  color: #6D6559;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.todo-filter-pill:hover:not(.is-active) {
  color: var(--dark-blue-green);
}

.todo-filter-pill.is-active {
  background-color: var(--terracotta);
  color: #fff;
}

.todays-care-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.todays-care-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.todays-care-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.todays-care-summary {
  margin: 0.15rem 0 0;
  color: var(--stitch);
  font-size: 0.8rem;
  font-weight: 700;
}

.todays-care-summary:empty {
  display: none;
}

.todays-care .care-secondary-button {
  min-height: 32px;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--stitch);
  border-radius: 999px;
  background: var(--cream);
  color: var(--forest);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.todays-care .care-secondary-button:hover {
  background: #EFE9DC;
  border-color: #8C735B;
}

.todays-care-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.15rem;
}

.todays-care:has(#todo-items.hidden) .todays-care-filter-row {
  display: none;
}
.todo-item-pet {
  max-width: 7rem;
  overflow: hidden;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #EBDCC4;
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
}
#todo-schedule-warning.sitter-checklist-notice {
  margin: 0.65rem 0 0.25rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(47, 93, 78, 0.22);
  background-color: var(--parchment);
  color: var(--forest);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ----- My Pack ----- */
.pack-section {
  position: relative;
  padding: 0 1.1rem;
}

.pack-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.15rem;
}

.section-title { font-size: 1.7rem; line-height: 1.1; }

.pack-add-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid rgba(47, 93, 78, 0.25);
  border-radius: 9999px;
  background-color: var(--parchment);
  color: var(--espresso);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.pack-add-button:hover { background-color: var(--kraft); }

.pack-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.pet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1rem 0.65rem;
  min-width: 0;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pet-card:hover {
  transform: translateY(-2px);
}

.pet-card:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
}

.pet-card-avatar {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 3.8rem;
  height: 3.8rem;
  overflow: hidden;
  border: 2px solid var(--espresso);
  border-radius: 9999px;
  background-color: var(--parchment);
  color: var(--terracotta);
}

.pet-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-card-avatar .ui-icon,
.pet-card-avatar .species-icon {
  width: 2.1rem;
  height: 2.1rem;
}

.pet-card-body {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-right: 0;
}

.pet-card-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--espresso);
}

.pet-card-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.35rem;
  width: 100%;
  min-width: 0;
}

.pet-card-pills .pill {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--parchment);
  border: 1px solid #D9C9AE;
  color: var(--espresso);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

.pet-card-status,
.pet-card-diet {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2F433B;
}

.pet-card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background-color: #E2E8DC;
  border: 1px solid #C4D3BE;
  color: #2F433B;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-card-status.is-attention {
  background-color: #FCECE8;
  border-color: #F0C4B8;
  color: var(--terracotta);
}

.pet-card-diet { margin-top: 0.15rem; color: var(--stitch); font-weight: 600; font-size: 0.7rem; }

.pet-card-share {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--espresso);
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
}

.pet-card-share .ui-icon {
  box-sizing: content-box;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0.65rem;
  border-radius: 9999px;
  background-color: var(--terracotta);
  color: var(--cream);
  stroke: var(--cream);
  box-shadow: 0 0 0 2px var(--kraft), 0 0 0 3px var(--terracotta);
}

.pet-card-share:hover .ui-icon { background-color: var(--terracotta-dark); }

/* ----- Other views ----- */
.app-view { padding-bottom: 1rem; }
.app-view.hidden { display: none; }

/* ----- Clean green border look for profile sections and dialogs ----- */
html body .pf-section {
  background-color: var(--kraft);
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgb(74 55 40 / 6%);
}

html body .account-settings-dialog,
html body .install-app-dialog {
  background-color: var(--cream);
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 20px;
  color: var(--forest);
}

html body .auth-card {
  background-color: var(--kraft);
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgb(74 55 40 / 6%);
}

html body .primary-button { background-color: var(--terracotta); color: var(--cream); }
html body .primary-button:hover { background-color: var(--terracotta-dark); }

.pf-input:focus-visible,
.terracotta-button:focus-visible,
.primary-button:focus-visible,
.pf-section > summary:focus-visible,
.sitter-pet-header:focus-visible {
  outline: 3px solid var(--forest, #2F433B);
  outline-offset: 2px;
}

.pf-input,
html body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html body select,
html body textarea { border-color: #B59E7F; }

html body input::placeholder,
html body textarea::placeholder {
  color: #766352;
  font-style: italic;
  opacity: 0.85;
}

html body select {
  appearance: none;
  padding-right: 2.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F433B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.9rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
}

.install-dialog-close,
#manage-avatar-button,
.password-toggle,
#copy-generated-sitter-code,
.vet-doc-row button,
.lightbox-close,
.lightbox-nav,
#close-account-settings-button,
#owner-care-log-close-btn,
#close-manage-photos-button,
#close-health-record-btn,
#close-health-passport-btn,
#close-share-sitter-button,
#close-emergency-modal-button,
#close-sitter-account-modal {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ----- Bottom navigation (Icon-Only) ----- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  display: none;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: var(--nav-parchment);
  border-top: 1px solid rgba(47, 93, 78, 0.2);
  box-shadow: 0 -4px 16px rgba(74, 55, 40, 0.06);
}

.bottom-nav.is-visible { display: flex; }

.bottom-nav-tab {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 54px;
  padding: 0.65rem 0.25rem;
  border: 0;
  background: none;
  color: #7A6657;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, transform 0.1s ease;
}

.bottom-nav-tab:hover {
  color: var(--terracotta);
}

.bottom-nav-tab svg {
  width: 1.55rem;
  height: 1.55rem;
  transition: transform 0.15s ease;
}

.bottom-nav-tab.is-active svg {
  transform: scale(1.1);
}

.bottom-nav-tab.is-active {
  color: var(--terracotta);
}

.bottom-nav-tab span:not(.sr-only) {
  display: none !important;
}

.bottom-nav-tab:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: -4px;
  border-radius: 12px;
}

.settings-nav-compat {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 12px !important;
  height: 12px !important;
  opacity: 0.001 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
  background: transparent !important;
  overflow: hidden !important;
  pointer-events: auto !important;
  z-index: 1000 !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Install-prompt style website landing keeps its normal width when signed out */
@media (max-width: 480px) {
  html body #app-shell.is-authenticated { box-shadow: none; }
}

/* ===== Home refinements ===== */
html body .app-header.is-visible {
  background-color: #F7F3EA;
  padding: calc(0.65rem + env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) 0.65rem max(1rem, env(safe-area-inset-left, 0px));
}

html:not(.website-mode),
html:not(.website-mode) .app-header.is-visible { background-color: #F7F3EA; }

html body #app-shell.is-authenticated {
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px + 1.5rem);
}

.bottom-nav {
  padding: 0 env(safe-area-inset-right, 0px) calc(env(safe-area-inset-bottom, 0px) + 12px) env(safe-area-inset-left, 0px);
}

.pack-list-wrap { position: relative; }

.pack-list-wrap > .vine {
  display: none;
  top: 0;
  bottom: 0;
  height: 100%;
}

.pack-list-wrap:has(.pet-card) > .vine { display: block; }
.pack-list-wrap > .vine-left { left: -1rem; }
.pack-list-wrap > .vine-right { right: -1rem; }

.pet-card-body { padding-right: 0; }

.pet-manage-menu {
  position: absolute;
  right: 0;
  z-index: 40;
  width: 15rem;
  margin-top: 0.4rem;
  padding: 0.4rem;
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 14px;
  background-color: var(--cream);
  box-shadow: 0 8px 20px rgb(74 55 40 / 18%);
}

.pet-manage-menu.hidden { display: none; }

.pet-manage-menu button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--espresso);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.pet-manage-menu button:hover:not(:disabled) { background-color: var(--parchment); }
.pet-manage-menu button:disabled { opacity: 0.55; cursor: default; }
.pet-manage-menu button + button { color: #991b1b; }

/* ===== Vine graphics disabled for visual clarity ===== */
.vine,
.vine-backdrop,
.vine-left,
.vine-right,
.pack-list-wrap > .vine {
  display: none !important;
}

html body #app-shell.is-authenticated #app-dashboard { position: relative; z-index: 1; }

html body .app-header.is-visible { background-color: rgb(247 243 234 / 94%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html:not(.website-mode) .app-header.is-visible { background-color: rgb(247 243 234 / 94%); }
.bottom-nav { background-color: rgb(242 236 225 / 94%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ===== Edit toggle and edit mode ===== */
.pet-edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 1.1rem;
  border: 1.5px solid var(--terracotta);
  border-radius: 9999px;
  background-color: var(--cream);
  color: var(--terracotta-dark);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.pet-edit-toggle.is-done {
  border-color: var(--forest);
  background-color: var(--forest);
  color: var(--cream);
}

.pet-edit-toggle .ui-icon { stroke: currentColor; }

.pet-edit-banner {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--terracotta);
  border-radius: 12px;
  background-color: rgb(193 91 52 / 12%);
  color: var(--terracotta-dark);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.pet-edit-banner.hidden { display: none; }

#pet-profile-form.is-editing .pf-section {
  border: 1.5px solid var(--terracotta);
}

#pet-profile-form.is-editing .pf-section > summary::after,
#pet-profile-form.is-editing .pf-section[open] > summary::after {
  content: '';
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C15B34' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 20 4-.8L19 8.2a2.1 2.1 0 0 0-3-3L5 16.2 4 20Z'/%3E%3Cpath d='m14.5 6.7 2.8 2.8'/%3E%3C/svg%3E") center / contain no-repeat;
}

#pet-profile-form.is-editing > div:first-child {
  border: 1.5px solid var(--terracotta);
}

.remove-pet-link {
  min-height: 44px;
  padding: 0 1rem;
  border: 0;
  background: none;
  color: #b42318;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

html body .remove-pet-dialog { padding: 0; }

/* ===== Crop photo dialog ===== */
.crop-dialog {
  width: calc(100% - 2rem);
  max-width: 24rem;
  padding: 0;
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 20px;
  background-color: var(--cream);
  color: var(--espresso);
}

.crop-dialog::backdrop { background-color: rgb(59 45 35 / 55%); }

.crop-body { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; }
.crop-title { font-size: 1.5rem; line-height: 1.1; }
.crop-hint { margin-top: -0.5rem; font-size: 0.85rem; color: var(--stitch); }

.crop-stage {
  position: relative;
  width: var(--crop-stage, 280px);
  height: var(--crop-stage, 280px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background-color: var(--espresso);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.crop-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: center;
  pointer-events: none;
}

.crop-mask {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--crop-diameter, 232px);
  height: var(--crop-diameter, 232px);
  transform: translate(-50%, -50%);
  border: 2px solid var(--cream);
  border-radius: 9999px;
  box-shadow: 0 0 0 999px rgb(47 67 59 / 55%);
  pointer-events: none;
}

.crop-zoom { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; font-weight: 700; }
.crop-zoom input { flex: 1; min-height: 44px; accent-color: var(--terracotta); }
.crop-error { font-size: 0.85rem; color: #b42318; }
.crop-error.hidden { display: none; }
.crop-actions { display: flex; justify-content: flex-end; gap: 0.75rem; }

.crop-actions button {
  min-height: 44px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 9999px;
  font-weight: 700;
  cursor: pointer;
}

.crop-cancel { background: none; color: var(--stitch); }
.crop-save { background-color: var(--terracotta); color: var(--cream); }
.crop-save:disabled { opacity: 0.6; }

/* ===== Sitter Magic Links, Care Log & Sitter View ===== */
.sitter-link-row,
.care-log-entry {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  border: 1px solid #D2BFA3;
  border-radius: 14px;
  background-color: #FAF7F1;
}

.sitter-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.sitter-status-badge.is-active {
  background-color: rgb(47 67 59 / 12%);
  color: #2F433B;
}
.sitter-status-badge.is-disabled {
  background-color: rgb(100 116 139 / 14%);
  color: #475569;
}
.sitter-status-badge.is-expired {
  background-color: rgb(180 35 24 / 12%);
  color: #b42318;
}

.sitter-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
.sitter-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sitter-switch-track {
  position: relative;
  width: 2.65rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: #CBD5E1;
  transition: background-color 180ms ease;
}
.sitter-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 4px);
  height: calc(1.5rem - 4px);
  border-radius: 9999px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 22%);
  transition: transform 180ms ease;
}
.sitter-switch input:checked + .sitter-switch-track {
  background-color: #2F433B;
}
.sitter-switch input:checked + .sitter-switch-track::after {
  transform: translateX(1.15rem);
}
.sitter-switch input:focus-visible + .sitter-switch-track {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.care-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background-color: rgb(47 67 59 / 10%);
  color: #2F433B;
  font-size: 0.72rem;
  font-weight: 700;
}
.care-live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background-color: #16a34a;
}
.care-live-badge:not([data-status="live"]) .care-live-dot { background-color: #9a6b22; }

.sitter-terms-gate p { margin: 14px 0; line-height: 1.5; color: #3B352B; }
.sitter-terms-gate a { color: #2F5D4E; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.sitter-terms-gate :is(a, button):focus-visible { outline: 3px solid #2F5D4E; outline-offset: 2px; }

.care-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #DFD2BE;
  border-radius: 14px;
  background: #FAF6EE;
  box-shadow: 0 1px 2px rgb(47 67 59 / 4%);
}
.care-log-filters label {
  flex: 1 1 12rem;
  min-width: 0;
  color: #2F5D4E;
  font-size: 0.8rem;
  font-weight: 700;
}
.care-log-filters select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #D4C2A5;
  border-radius: 10px;
  background: #fff;
}
.care-secondary-button, .sitter-link-action, .account-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid #D4C2A5;
  border-radius: 12px;
  background: #FAF6EE;
  color: #2F5D4E;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  vertical-align: middle;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.care-secondary-button:hover, .sitter-link-action:hover, .account-logout-button:hover {
  background-color: #F7F1E8;
  border-color: #B59E7F;
}
.care-secondary-button { margin-top: 0.75rem; }
.sitter-link-action { font-size: 0.85rem; }
.sitter-link-delete, .account-logout-button { color: #9B302D; }
.sitter-manage-dialog {
  box-sizing: border-box;
  width: min(calc(100% - 2rem), 28rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.5rem;
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 20px;
  background: #F7F1E8;
  color: #2F5D4E;
}
.sitter-manage-dialog::backdrop { background: rgb(43 42 38 / 55%); }
.sitter-manage-dialog h2 { margin: 0; color: #2F5D4E; font-size: 1.5rem; }
.sitter-manage-dialog p { margin: 0.75rem 0 0; line-height: 1.5; }
.sitter-manage-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; margin-top: 1.25rem; }
.sitter-confirm-delete { min-height: 44px; padding: 0.5rem 1rem; border: 0; border-radius: 10px; background: #9B302D; color: #fff; font-weight: 700; cursor: pointer; }
.sitter-manage-error { color: #9B302D; }
.sitter-manage-dialog button:focus-visible { outline: 3px solid #2F5D4E; outline-offset: 2px; }
.account-logout-button { width: 100%; }
.account-policy-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.75rem; }
.account-policy-links a { min-height: 44px; display: inline-flex; align-items: center; color: #2F5D4E; font-weight: 700; text-decoration: underline; }
:is(.care-log-filters select, .care-secondary-button, .sitter-link-action, .account-logout-button, .account-policy-links a, .account-collapse-summary):focus-visible {
  outline: 3px solid #2F5D4E;
  outline-offset: 2px;
}

.sitter-emergency-banner {
  padding: 1rem 1.15rem;
  border: 1.5px solid #FECACA;
  border-radius: 18px;
  background-color: #FEF2F2;
  box-shadow: 0 1px 2px rgb(180 35 24 / 6%);
}

.sitter-quick-chip {
  padding: 0.35rem 0.75rem;
  border: 1px solid #D2BFA3;
  border-radius: 9999px;
  background-color: #FAF7F1;
  color: #2F433B;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease;
}
.sitter-quick-chip:hover {
  background-color: #EFE9DC;
}

.sitter-header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 1.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgb(210 191 163 / 45%);
  background-color: rgb(247 243 234 / 90%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

html body #sitter-emergency-dialog {
  box-sizing: border-box;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 0;
}
.sitter-emergency-header { padding: 1.5rem 1.5rem 1rem; }
.sitter-emergency-body { display: grid; gap: 1rem; padding: 0 1.5rem 1.5rem; }
.sitter-emergency-card {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #DFD2BE;
  border-radius: 14px;
  background: #FAF6EE;
  box-shadow: 0 1px 2px rgb(47 67 59 / 4%);
  overflow-wrap: anywhere;
}
.sitter-emergency-card h3 { margin: 0 0 0.25rem; color: #2F5D4E; font-weight: 700; }
.sitter-pet-switcher {
  display: none !important;
}
.sitter-pet-card { scroll-margin-top: 9rem; min-width: 0; }
.sitter-task-pet { display: inline-block; margin-bottom: 0.25rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: #EBDCC4; color: #2F5D4E; font-size: 0.75rem; font-weight: 800; }
.sitter-checklist-notice { margin-top: 0.5rem; color: #2B2A26; font-size: 0.875rem; line-height: 1.5; }
.sitter-pet-header { cursor: pointer; list-style: none; min-height: 44px; }
.sitter-pet-header::-webkit-details-marker { display: none; }
.sitter-pet-header::after { content: '+'; color: #2F5D4E; font-size: 1.5rem; }
.sitter-pet-details[open] > .sitter-pet-header::after { content: '−'; }
.sitter-pet-sections { display: grid; gap: 1rem; margin-top: 1rem; min-width: 0; }
.sitter-detail-field,
.pf-detail-field {
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid #DFD2BE;
  border-radius: 14px;
  background: #FAF6EE;
  box-shadow: 0 1px 2px rgb(47 67 59 / 4%);
}
.sitter-detail-label,
.pf-detail-field > span {
  display: block;
  color: #2F5D4E;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sitter-detail-value,
.pf-detail-field .pf-input {
  margin-top: 0.25rem;
  color: #2B2A26;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.sitter-quick-chip { min-height: 44px; }

/* Login and legal screens */
body:has(#app-shell:not(.is-authenticated)), body.legal-page {
  background: radial-gradient(ellipse at 50% 12%, var(--auth-glow), transparent 34rem), var(--auth-cream);
  color: var(--auth-text);
  font-family: Nunito, sans-serif;
}

html body #app-shell:not(.is-authenticated) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: max(36px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
}

#app-shell:not(.is-authenticated) #auth-brand-header {
  width: 100%;
  max-width: 380px;
  margin: 0 auto 24px;
  text-align: center;
}

#app-shell:not(.is-authenticated) .login-logo {
  position: static;
  width: 160px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  transform: none;
  animation: auth-logo-in .5s ease-out both;
}

#app-shell:not(.is-authenticated) .website-browser-tagline {
  display: block;
  margin: 10px 0 0;
  color: var(--auth-tagline);
  font-size: 15px;
  font-weight: 600;
}

html body #app-shell:not(.is-authenticated) #auth-screen {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 0;
  z-index: 1;
}

html body #app-shell:not(.is-authenticated) .auth-card,
.legal-card {
  position: relative;
  border: 0;
  border-radius: var(--auth-card-radius);
  padding: 26px 22px;
  background: var(--auth-tan);
  box-shadow: 0 20px 36px -16px rgba(120,74,36,.4), 0 3px 8px rgba(120,74,36,.12), inset 0 1px 0 rgba(255,255,255,.45);
}

html body #app-shell:not(.is-authenticated) .auth-card {
  animation: auth-card-in .55s .3s ease-out both;
}

.auth-card::before, .legal-card::before, .website-logo-patch::before {
  display: none !important;
}
.auth-card .auth-views, .legal-card > * { position: relative; z-index: 1; }
.login-view, .sitter-access-view { display: flex; flex-direction: column; gap: 14px; }
.login-view h2, .sitter-access-view h2 {
  margin: 0;
  color: var(--auth-green) !important;
  font: 400 27px/1.2 "Patrick Hand", cursive;
}
.login-view label, .sitter-access-view label {
  display: block;
  margin-bottom: 6px;
  color: var(--auth-label);
  font-size: 14px;
  font-weight: 800;
}
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.auth-label-row label { margin: 0; }
.auth-input-wrap { position: relative; }
html body #app-shell:not(.is-authenticated) .auth-card input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-control-radius);
  background: var(--auth-input);
  color: var(--auth-text);
  font: 600 16px Nunito, sans-serif;
}
html body #app-shell:not(.is-authenticated) .auth-card input::placeholder { color: var(--auth-placeholder); opacity: 1; }
html body #app-shell:not(.is-authenticated) .auth-card input:focus {
  outline: none;
  border-color: var(--auth-green);
  box-shadow: 0 0 0 4px rgba(47,93,78,.2);
}
html body #app-shell:not(.is-authenticated) .auth-input-wrap input { padding: 0 50px 0 44px; }
html body #app-shell:not(.is-authenticated) .sitter-access-view input { padding: 0 14px; }
.auth-input-icon, .auth-email-valid {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  pointer-events: none;
}
.auth-input-icon { left: 14px; color: var(--auth-muted); }
.auth-email-valid { right: 15px; color: var(--auth-green); }
.auth-email-valid.hidden, .auth-error.hidden { display: none; }
.auth-password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--auth-green);
  border-radius: 10px;
}
.auth-text-link, .sitter-legal a, .legal-card a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--auth-green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-text-link { font-size: 14px; }
.auth-back { align-self: flex-start; gap: 4px; }
.auth-back svg, .auth-error svg { width: 18px; height: 18px; flex: none; }
.auth-error { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; color: var(--auth-error); font-size: 13px; font-weight: 700; }
.auth-primary, .auth-outline, .auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border-radius: var(--auth-control-radius);
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 800;
  transition: background-color .2s, box-shadow .2s, filter .2s, transform .1s;
}
.auth-primary { border: 0; background: var(--auth-terracotta); color: white; box-shadow: 0 6px 12px rgba(185,71,39,.2); }
.auth-google { border: 1.5px solid var(--auth-border); background: #fff; color: var(--auth-text); font-family: Nunito, sans-serif; }
.auth-google-icon { width: 20px; height: 20px; flex: none; }
.auth-google:not(:disabled):hover { background: #faf8f4; }
.auth-google:disabled { opacity: .65; cursor: wait; }
.auth-primary:not(:disabled):hover { filter: brightness(.93); }
.auth-primary:disabled { background: var(--auth-disabled); color: var(--auth-disabled-text); box-shadow: none; cursor: not-allowed; }
.auth-primary:not(:disabled):active, .auth-outline:active, .install-banner-action:active { transform: scale(.98); }
.auth-primary.is-loading::before { content: ""; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: auth-spin .8s linear infinite; }
html body #app-shell:not(.is-authenticated) .auth-outline { border: 1.5px solid var(--auth-green); background: transparent; color: var(--auth-green); }
html body #app-shell:not(.is-authenticated) .auth-outline:hover { background: rgba(47,93,78,.08); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--auth-muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--auth-border); }
.terms-loading { text-align: center; color: var(--auth-text); }
.terms-dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-card-radius);
  padding: 28px;
  background: var(--auth-tan);
  color: var(--auth-text);
  box-shadow: 0 20px 36px -16px rgba(120,74,36,.4);
}
.terms-dialog::backdrop { background: rgba(43,42,38,.55); }
.terms-dialog h2 { color: var(--auth-green); font: 400 27px/1.2 "Patrick Hand", cursive; }
.terms-dialog p { margin: 12px 0; line-height: 1.5; }
.terms-agreement { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; line-height: 1.5; }
.terms-agreement input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--auth-green); }
.terms-agreement a { color: var(--auth-green); font-weight: 700; text-decoration: underline; }
.terms-dialog :is(button, input, a):focus-visible { outline: 3px solid var(--auth-green); outline-offset: 2px; }
.terms-dialog .auth-outline { border: 1.5px solid var(--auth-green); background: transparent; color: var(--auth-green); }
.terms-dialog .hidden { display: none; }
.terms-dialog #terms-signout { margin-top: 8px; }
.auth-footer, .sitter-caption { text-align: center; color: var(--auth-secondary); font-size: 13px; }
.sitter-access-help { color: var(--auth-secondary); font-size: 15px; line-height: 1.5; }
.sitter-legal { color: var(--auth-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.sitter-legal a { display: inline-flex; min-width: 44px; justify-content: center; }
.sitter-caption { margin: 0; }
#app-shell:not(.is-authenticated) .auth-card button:focus-visible,
#app-shell:not(.is-authenticated) .auth-card a:focus-visible,
.install-banner button:focus-visible, .legal-card a:focus-visible {
  outline: 3px solid var(--auth-green);
  outline-offset: 2px;
}
#app-shell:not(.is-authenticated) #auth-alert { max-width: 380px; color: var(--auth-text); }
#app-shell:not(.is-authenticated) #auth-alert.status-message-error { color: var(--auth-error); }
.auth-decoration, .hero-decoration {
  position: absolute;
  width: 120px;
  height: 120px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  opacity: .1;
  pointer-events: none;
}
.auth-decoration-top { top: 5%; left: -38px; color: var(--auth-terracotta); transform: rotate(-20deg); }
.auth-decoration-bottom { right: -40px; bottom: 5%; color: var(--auth-green); transform: rotate(20deg); }
#app-shell.is-authenticated .auth-decoration, #app-shell.is-authenticated .website-hero { display: none; }
.install-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  border-top: 1px solid #E4D3B8;
  background: #FFFBF4;
  box-shadow: 0 -4px 16px rgba(120,74,36,.08);
  color: var(--auth-text);
  font-size: 14px;
  font-weight: 700;
}
.install-banner[hidden], body:has(#app-shell.is-authenticated) .install-banner { display: none; }
body:has(#app-shell:not(.is-authenticated)):has(#install-banner:not([hidden])) { display: flex; flex-direction: column; min-height: 100dvh; }
html body:has(#install-banner:not([hidden])) #app-shell:not(.is-authenticated) { flex: 1; min-height: 0; }
.install-banner-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--auth-green); color: var(--auth-cream); }
.install-banner-copy { flex: 0 1 420px; }
.install-banner-action { min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--auth-terracotta); color: white; font-weight: 800; }
.install-banner-action:hover { filter: brightness(.93); }
.install-banner-dismiss { display: grid; place-items: center; width: 44px; height: 44px; color: var(--auth-green); }
.install-banner-dismiss svg { width: 20px; height: 20px; }
.legal-page { min-height: 100dvh; padding: 36px 20px; }
.legal-card { max-width: 640px; margin: 0 auto; padding: 32px; }
.legal-card h1 { color: var(--auth-green); font: 600 32px Fredoka, sans-serif; }
.legal-card a { margin-top: 24px; }
.legal-card:is(.terms-card, .privacy-card) { box-sizing: border-box; max-width: 880px; padding: clamp(24px, 5vw, 56px); }
:is(.bbp-terms, .bbp-privacy) { color: var(--auth-text); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
:is(.bbp-terms, .bbp-privacy) h1 { margin: 0; font-size: clamp(27px, 5vw, 36px); line-height: 1.2; }
:is(.bbp-terms, .bbp-privacy) .subtitle { margin: 8px 0 32px; color: var(--auth-muted); font-size: 14px; font-weight: 700; }
:is(.bbp-terms, .bbp-privacy) h2 { margin: 38px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--auth-border); color: var(--auth-green); font-size: 19px; line-height: 1.35; scroll-margin-top: 20px; }
:is(.bbp-terms, .bbp-privacy) h3 { margin: 24px 0 8px; color: var(--auth-label); font-size: 17px; line-height: 1.4; }
:is(.bbp-terms, .bbp-privacy) p { margin: 0 0 16px; }
:is(.bbp-terms, .bbp-privacy) ul { margin: 12px 0 20px; padding-left: 24px; }
:is(.bbp-terms, .bbp-privacy) li { margin-bottom: 10px; }
.legal-card :is(.bbp-terms, .bbp-privacy) a { display: inline; min-height: 0; margin: 0; color: var(--auth-green); text-decoration: underline; text-underline-offset: 3px; }
:is(.bbp-terms, .bbp-privacy) :is(.terms-toc, .privacy-toc) { display: grid; gap: 2px 24px; padding: 0; list-style: none; }
:is(.bbp-terms, .bbp-privacy) :is(.terms-toc, .privacy-toc) li { margin: 0; }
.legal-card :is(.bbp-terms, .bbp-privacy) :is(.terms-toc, .privacy-toc) a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; font-size: 14px; line-height: 1.4; }

.sitter-status-badge {
  border: 0;
  background: #E8E2D6;
  color: #5C4738;
  cursor: default;
}
.sitter-status-badge:hover { background: #E8E2D6; }
.sitter-emergency-subcard {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid #D2BFA3;
  border-radius: 12px;
  background: #FFFCF6;
}
.sitter-emergency-subcard h4 {
  margin: 0 0 0.2rem;
  color: #2F433B;
  font-size: 0.85rem;
  font-weight: 800;
}
.sitter-emergency-alert {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid #C97758;
  border-radius: 12px;
  background: #FFF0E8;
  color: #542718;
}
.sitter-emergency-alert .font-semibold { color: #542718; }
.sitter-emergency-alert a { color: #8F301D; }

.sitter-update-card { padding: 0; overflow: hidden; }
.sitter-update-summary {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
}
.sitter-update-summary::-webkit-details-marker { display: none; }
.sitter-update-summary-copy { display: block; margin-top: 0.2rem; color: var(--stitch); font-size: 0.8rem; }
.sitter-update-summary-action { display: flex; align-items: center; gap: 0.5rem; color: var(--forest); font-size: 0.85rem; font-weight: 800; white-space: nowrap; }
.sitter-update-summary-action span { font-size: 1.25rem; transition: transform 160ms ease; }
.sitter-update-card[open] .sitter-update-summary-action span { transform: rotate(45deg); }
.sitter-update-body {
  position: relative;
  z-index: 1;
  margin: 0 0.6rem 0.6rem;
  padding: 1rem;
  border: 1px solid rgb(92 71 56 / 18%);
  border-radius: 14px;
  background: rgb(247 243 234 / 78%);
}
.sitter-pet-toggle-fieldset { min-width: 0; border: 0; padding: 0; }
.sitter-pet-toggle-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sitter-pet-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border: 1px solid #B59E7F;
  border-radius: 999px;
  background: var(--cream);
  color: var(--forest);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}
.sitter-pet-toggle:has(input:checked) { border-color: var(--forest); background: #DCE3D5; }
.sitter-pet-toggle input { width: 1rem; height: 1rem; margin: 0 0.45rem 0 0; accent-color: var(--forest); }
.sitter-photo-remove { min-height: 44px; padding: 0.45rem 0.8rem; color: #8F2727; font-weight: 800; text-decoration: underline; }
.sitter-photo-preview { max-width: 12rem; max-height: 12rem; border: 1px solid #B59E7F; border-radius: 14px; object-fit: cover; box-shadow: 0 4px 12px rgb(47 67 59 / 12%); }
.sitter-emergency-banner button,
.sitter-update-summary,
.sitter-update-body button[type="submit"] { min-height: 44px; }
dialog button[aria-label^="Close"],
#close-account-settings-button,
#close-share-sitter-button,
#lightbox-delete,
#remove-pet-photo-button { min-width: 44px; min-height: 44px; }

@media (min-width: 768px) {
  html.website-mode #app-shell.is-authenticated > .vine-backdrop { max-width: 72rem; }
  html.website-mode body #app-shell.is-authenticated {
    max-width: 72rem;
    padding: 4.25rem 1.5rem 2rem;
  }
  html.website-mode body #app-shell.is-authenticated #app-dashboard { padding: 0; }
  html.website-mode body .app-header.is-visible { top: 4.1rem; margin-bottom: 1.25rem; }
  html.website-mode #dashboard-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: 1.5rem;
  }
  html.website-mode #dashboard-overview-grid > .mt-6 { margin-top: 1rem; }
  html.website-mode #dashboard-overview-grid #pets-section { padding: 0; }
  html.website-mode .pack-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  html.website-mode .bottom-nav {
    top: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    max-width: none;
    min-height: 4rem;
    justify-content: center;
    transform: none;
    padding: 0.35rem 1rem;
    border-top: 0;
    border-bottom: 1px solid rgba(47, 93, 78, 0.2);
  }
  html.website-mode .bottom-nav { gap: 1.25rem; }
  html.website-mode .bottom-nav-tab { flex: 0 0 auto; flex-direction: column; gap: 0.2rem; min-width: 6rem; }
  html.website-mode .bottom-nav-tab svg { width: 1.3rem; height: 1.3rem; }
  /* Web view (wider browser windows) shows a label under each icon; phones keep icons only. */
  html.website-mode .bottom-nav-tab span.bottom-nav-label {
    display: block !important;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
  }
  /* Each sitter page is a two-column grid on wider screens. */
  #sitter-content .sitter-page:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 1.5rem;
  }
  #sitter-content .sitter-page > * { margin-top: 0; }
  #sitter-content .sitter-page > :is(.sitter-emergency-banner, section[aria-labelledby="sitter-guides-heading"]),
  #sitter-page-emergency > * { grid-column: 1 / -1; }
  /* A card with no partner beside it uses the full width instead of leaving a gap. */
  #sitter-page-guides:not(:has(#sitter-special-note-section:not(.hidden))) > .todays-care,
  #sitter-page-update:has(#sitter-recent-logs-section.hidden) > #sitter-update-section { grid-column: 1 / -1; }
  #sitter-page-update:has(#sitter-recent-logs-section.hidden) > #sitter-update-section { max-width: 48rem; }
  #sitter-pets-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
  #sitter-pets-container > :not(:first-child) { margin-top: 0; }
}

@media (min-width: 1024px) {
  html.website-mode body #app-shell.is-authenticated { max-width: 80rem; }
  html.website-mode #app-shell.is-authenticated > .vine-backdrop { max-width: 80rem; }
}

@media (min-width: 900px) {
  html.website-mode body:has(#app-shell.is-authenticated) {
    background: var(--cream);
  }

  html.website-mode body #app-shell.is-authenticated {
    max-width: 80rem;
    padding: 0 2rem 3rem;
    box-shadow: none;
  }

  html.website-mode body .app-header.is-visible {
    top: 0;
    min-height: 4.5rem;
    margin-bottom: 2rem;
    padding: 0.75rem 0;
  }

  html.website-mode .bottom-nav {
    top: 0.75rem;
    bottom: auto;
    left: calc(50% + 2.5rem);
    width: auto;
    min-height: 0;
    padding: 0;
    gap: 0.75rem;
    transform: translateX(-50%);
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html.website-mode .bottom-nav-tab {
    min-width: 5.5rem;
    min-height: 3.25rem;
    padding: 0.4rem 0.85rem;
    border-radius: 12px;
    font-size: 0.875rem;
  }

  html.website-mode .bottom-nav-tab:hover,
  html.website-mode .bottom-nav-tab.is-active {
    background: var(--parchment);
  }

  html.website-mode #dashboard-overview-grid {
    grid-template-columns: minmax(19rem, 0.8fr) minmax(0, 1.2fr);
    gap: 2rem;
  }

  html.website-mode #dashboard-overview-grid > .mt-6 { margin-top: 1rem; }
  html.website-mode #dashboard-overview-grid:has(#todays-care.hidden) > .mt-6 { grid-column: 1 / -1; }
  html.website-mode .pack-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
  html.website-mode .pet-card { margin-top: 0.75rem; }

  html.website-mode #pet-profile-form:not(.hidden) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
  }

  html.website-mode #pet-profile-form > * { min-width: 0; margin-top: 0; }
  html.website-mode #pet-profile-form > :not(.pf-section),
  html.website-mode #pet-profile-form > .pf-section[open] { grid-column: 1 / -1; }

  html.website-mode #links-view:not(.hidden) {
    display: grid;
    grid-template-columns: minmax(18rem, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: 1.5rem;
  }

  html.website-mode #links-view > .dashboard-greeting { grid-column: 1 / -1; }
  html.website-mode #links-view > .stitch-card { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.bbp-terms .callout { margin: 20px 0; padding: 16px 18px; border-left: 4px solid var(--auth-green); border-radius: 0 12px 12px 0; background: rgba(255,250,240,.7); }
.privacy-table-wrap { max-width: 100%; margin: 16px 0; overflow-x: auto; }
.privacy-table-wrap:focus-visible { outline: 3px solid var(--auth-green); outline-offset: 2px; }
.bbp-privacy table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; }
.bbp-privacy th, .bbp-privacy td { border: 1px solid var(--auth-border); padding: 10px 12px; text-align: left; vertical-align: top; }
.bbp-privacy th { background: var(--auth-green); color: white; }
.bbp-privacy tr:nth-child(even) { background: rgba(255,250,240,.6); }
.bbp-privacy .privacy-table-hint { color: var(--auth-secondary); font-size: 14px; }
@media (min-width: 700px) {
  :is(.bbp-terms, .bbp-privacy) :is(.terms-toc, .privacy-toc) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 760px) { .bbp-privacy .privacy-table-hint { display: none; } }
@keyframes auth-logo-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes auth-card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }

@media (min-width: 900px) {
  html body:has(#app-shell:not(.is-authenticated)) { background: var(--auth-cream); }
  html body #app-shell:not(.is-authenticated) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 0;
    align-items: center;
    padding: 0;
  }
  html #app-shell:not(.is-authenticated) #auth-brand-header { display: none; }
  html #app-shell:not(.is-authenticated) .auth-decoration { display: none; }
  html #app-shell:not(.is-authenticated) .website-hero {
    position: relative;
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    align-self: stretch;
    overflow: hidden;
    min-height: 100dvh;
    padding: 64px 72px;
    background: var(--auth-green);
  }
  html body:has(#install-banner:not([hidden])) #app-shell:not(.is-authenticated) .website-hero { min-height: 0; }
  .website-hero-content { position: relative; z-index: 1; width: 100%; max-width: 460px; margin: 0 auto; }
  .website-logo-patch { position: relative; width: fit-content; padding: 32px 48px; border-radius: 30px; background: var(--auth-cream); box-shadow: 0 16px 32px rgba(0,0,0,.2); }
  .website-logo-patch::before { border-radius: 23px; }
  .website-logo-patch img { width: 160px; height: auto; animation: auth-logo-in .5s ease-out both; }
  html .website-headline { max-width: none; margin: 36px 0 18px; color: var(--auth-cream); font: 600 46px/1.12 Fredoka, sans-serif; letter-spacing: 0; }
  html .website-copy { color: rgba(247,241,232,.86); font-size: 18px; font-weight: 600; line-height: 1.5; }
  .hero-decoration { width: 160px; height: 160px; color: var(--auth-cream); opacity: .15; }
  .hero-decoration-top { top: -50px; right: -45px; transform: rotate(20deg); }
  .hero-decoration-bottom { bottom: -50px; left: -45px; transform: rotate(-20deg); }
  html body #app-shell:not(.is-authenticated) #auth-screen { grid-column: 2; grid-row: 1; max-width: 400px; margin: auto; padding: 20px; }
  html body #app-shell:not(.is-authenticated) .auth-card { padding: 30px 28px; }
  #app-shell:not(.is-authenticated) #auth-alert { grid-column: 2; grid-row: 2; margin: 0 auto 20px; }
}

/* ─── Button Box Pets Cozy Craft & UI Enhancements ─── */
.pill-terracotta {
  background-color: #F3DFD6;
  color: #8E4328;
  border: 1px solid #DFB7A6;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.25;
}

.pill-sage {
  background-color: #E0E7DF;
  color: #2B3A2E;
  border: 1px solid #BDCBBF;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.25;
}

.pill-amber {
  background-color: #F4E8CD;
  color: #7A5418;
  border: 1px solid #DFC996;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.25;
}

.pill-cream {
  background-color: #F7F3EA;
  color: #2C2722;
  border: 1px solid #D8CEBC;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.25;
}

.pet-must-know {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.pet-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(47, 93, 78, 0.2);
}

.pet-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem;
  min-height: 44px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #D4C2A5;
  background: #FAF7F1;
  color: #2F433B;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.pet-quick-btn:hover {
  background: #FFFFFF;
  border-color: #B56345;
  color: #B56345;
}

.pet-quick-btn-sos {
  background: #FFF0E8;
  border-color: #DFB7A6;
  color: #8E4328;
}

.pet-quick-btn-sos:hover {
  background: #F3DFD6;
  border-color: #B56345;
  color: #8E4328;
}

.sitter-masked-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  background: #F4EFE4;
  border: 1px solid rgba(47, 93, 78, 0.2);
}

.sitter-masked-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2F433B;
}

.sitter-masked-btn {
  font-size: 0.75rem;
  font-weight: 700;
  color: #B56345;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0.25rem 0.5rem;
  min-height: 36px;
}

.sitter-masked-btn:hover {
  color: #8E4328;
}

.sitter-lost-pet-card {
  margin-top: 0.5rem;
  padding: 1rem;
  border: 1px solid #DFB7A6;
  border-radius: 14px;
  background: #FFF8F5;
}

.sitter-lost-pet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sitter-lost-pet-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #8E4328;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sitter-copy-alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  min-height: 36px;
  border-radius: 9999px;
  border: 1px solid #B56345;
  background: #B56345;
  color: #FDFBF7;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}

.sitter-copy-alert-btn:hover {
  background: #9D4E33;
}

.sitter-copy-alert-btn:active {
  transform: scale(0.97);
}

.sitter-lost-pet-body {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #3B2D23;
}

.bbp-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  background: #323E35;
  color: #F9F6F0;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(44, 39, 34, 0.25);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.bbp-toast.hidden {
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
}

.vine-left, .vine-right {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 18px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 5;
  background-repeat: repeat-y;
  background-size: 18px 96px;
}

.vine-left {
  left: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='96' viewBox='0 0 18 96'%3E%3Cpath d='M6 0 C8 24, 4 48, 6 72 C7 84, 6 90, 6 96' stroke='%236B7062' stroke-width='1.1' fill='none'/%3E%3Cpath d='M6 22 C11 18, 15 19, 14 23 C13 26, 9 25, 6 22 Z' fill='none' stroke='%236B7062' stroke-width='1'/%3E%3Cpath d='M6 54 C11 50, 15 51, 14 55 C13 58, 9 57, 6 54 Z' fill='none' stroke='%236B7062' stroke-width='1'/%3E%3Cpath d='M6 82 C10 79, 13 80, 12 83 C11 85, 8 84, 6 82 Z' fill='none' stroke='%236B7062' stroke-width='1'/%3E%3C/svg%3E");
}

.vine-right {
  right: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='96' viewBox='0 0 18 96'%3E%3Cpath d='M12 0 C10 24, 14 48, 12 72 C11 84, 12 90, 12 96' stroke='%236B7062' stroke-width='1.1' fill='none'/%3E%3Cpath d='M12 18 C7 14, 3 15, 4 19 C5 22, 9 21, 12 18 Z' fill='none' stroke='%236B7062' stroke-width='1'/%3E%3Cpath d='M12 50 C7 46, 3 47, 4 51 C5 54, 9 53, 12 50 Z' fill='none' stroke='%236B7062' stroke-width='1'/%3E%3Cpath d='M12 78 C8 75, 5 76, 6 79 C7 81, 10 80, 12 78 Z' fill='none' stroke='%236B7062' stroke-width='1'/%3E%3C/svg%3E");
}

@media (min-width: 900px) {
  .vine-left, .vine-right {
    opacity: 0.45;
    width: 24px;
    background-size: 24px 128px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app-shell:not(.is-authenticated) .login-logo, #app-shell:not(.is-authenticated) .auth-card,
  .website-logo-patch img, .auth-primary.is-loading::before { animation: none; }
  #app-shell:not(.is-authenticated) #auth-screen *, .install-banner * {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Calendar View & Day Bubbles ===== */
.cal-day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.25rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
  background: transparent;
  border: 1px solid transparent;
}
.cal-day-cell:hover {
  background-color: #EFE9DC;
}
.cal-day-cell.is-selected {
  background-color: var(--terracotta);
  color: #fff !important;
  font-weight: 700;
}
.cal-day-cell.is-selected .cal-day-name,
.cal-day-cell.is-selected .cal-day-num {
  color: #fff !important;
}
.cal-day-cell.is-today:not(.is-selected) {
  border-color: var(--terracotta);
}
.cal-day-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #8C735B;
}
.cal-day-num {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.15rem;
  color: #3B2D23;
}
.cal-day-dots {
  display: flex;
  gap: 2px;
  margin-top: 0.25rem;
  min-height: 4px;
}
.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--terracotta);
}
.cal-day-cell.is-selected .cal-dot {
  background-color: #fff;
}

/* Month Grid */
.cal-month-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease;
  color: #3B2D23;
  border: 1px solid transparent;
}
.cal-month-cell:hover:not(.is-empty) {
  background-color: #EFE9DC;
}
.cal-month-cell.is-selected {
  background-color: var(--terracotta);
  color: #fff;
}
.cal-month-cell.is-today:not(.is-selected) {
  border-color: var(--terracotta);
}
.cal-month-cell.is-empty {
  cursor: default;
  opacity: 0.3;
}

/* Health Passport Printable View */
@media print {
  html, body {
    background: #fff !important;
    color: #000 !important;
    height: auto !important;
    overflow: visible !important;
  }
  body > *:not(#health-passport-dialog) {
    display: none !important;
  }
  #health-passport-dialog {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    background: #fff !important;
  }
  #health-passport-dialog::backdrop {
    display: none !important;
  }
  #health-passport-dialog > div {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  #print-health-passport-btn,
  #close-health-passport-btn {
    display: none !important;
  }
}

/* ===== Full-Page Stepped Onboarding Flow ===== */
html.in-onboarding .bottom-nav,
body.in-onboarding .bottom-nav {
  display: none !important;
}

#add-pet-form.onboarding-flow-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
  min-height: auto;
  margin: 1.5rem auto 3rem;
  padding: 1.5rem;
  background-color: var(--cream);
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(47, 67, 59, 0.08);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  #add-pet-form.onboarding-flow-container {
    max-width: 100%;
    margin: 0.5rem auto 2rem;
    padding: 1.25rem 1rem;
    border-radius: 20px;
  }
}

.onboarding-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(217, 201, 174, 0.7);
  width: 100%;
  box-sizing: border-box;
  padding-top: max(0.5rem, env(safe-area-inset-top));
}

#onboarding-step-back-btn,
#cancel-add-pet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--stitch);
  border-radius: 9999px;
  background-color: var(--cream);
  color: var(--forest);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

#onboarding-step-back-btn:hover,
#cancel-add-pet-button:hover {
  background-color: var(--parchment);
  color: var(--terracotta);
}

#onboarding-step-counter {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--forest);
}

.onboarding-top-bar > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.onboarding-top-bar > div > div {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.onboarding-pill {
  width: 28px;
  height: 4px;
  border-radius: 9999px;
  background-color: #D9C9AE;
  transition: background-color 0.2s ease;
}

.onboarding-pill.is-active {
  background-color: var(--terracotta);
}

.onboarding-mascot-header {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0.75rem 0;
}

.onboarding-mascot-frame {
  position: relative;
  width: 100%;
  max-width: 260px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #FAF6EE;
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 20px;
  padding: 0.5rem;
  overflow: hidden;
}

@media (min-height: 700px) {
  .onboarding-mascot-frame {
    height: 110px;
    max-width: 280px;
  }
}

.mascot-artwork-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mascot-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--terracotta);
}

.mascot-fallback .species-icon-avatar {
  width: 3.2rem;
  height: 3.2rem;
}

/* Onboarding Step Container */
.onboarding-step {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.75rem 0;
  width: 100%;
  box-sizing: border-box;
}

.onboarding-step h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--forest);
  margin: 0;
  text-align: center;
}

.onboarding-step p {
  font-size: 0.88rem;
  color: #5C5549;
  margin: 0.25rem 0 0;
  text-align: center;
}

/* Step 1 Species Grid */
[role="radiogroup"][aria-label="Pet species selection"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.species-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  border-radius: 18px;
  border: 1px solid rgba(47, 93, 78, 0.22);
  background-color: #FAF6EE;
  color: var(--espresso);
  cursor: pointer;
  transition: all 0.15s ease;
}

.species-card:hover {
  background-color: var(--parchment);
}

.species-card.is-selected {
  border-color: var(--terracotta) !important;
  border-style: solid !important;
  border-width: 2px !important;
  background-color: #FDF3EF !important;
  color: var(--terracotta) !important;
  box-shadow: 0 0 0 1px var(--terracotta);
}

.species-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
}

/* Step 2 & 3 Grids */
#onboarding-step-2 fieldset {
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

#onboarding-step-2 .grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

#onboarding-step-2 .grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

#onboarding-step-3 .grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

#onboarding-step-3 .grid-cols-2 > div {
  min-width: 0;
}

.choice-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.75rem 0.5rem;
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 14px;
  background-color: #FAF6EE;
  color: var(--forest);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  min-width: 0;
}

.choice-tile:hover {
  background-color: var(--parchment);
}

.choice-tile:has(:checked) {
  border-color: var(--terracotta) !important;
  border-style: solid !important;
  border-width: 2px !important;
  background-color: #FDF3EF !important;
  color: var(--terracotta) !important;
}

/* Inputs & Labels */
.onboarding-step label.block,
.onboarding-step legend {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.4rem;
}

.onboarding-step input.pet-input {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1.5px solid var(--stitch);
  background-color: #FAF6EE;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.onboarding-step input.pet-input:focus {
  border-color: var(--terracotta);
  outline: none;
  box-shadow: 0 0 0 3px rgba(184, 74, 39, 0.2);
}

/* Step 4 Photo Upload */
label[for="pet-photo"] {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0.5rem auto;
  text-align: center;
  width: 100%;
}

label[for="pet-photo"] > span:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 9999px;
  border: 2px solid rgba(47, 93, 78, 0.22);
  background-color: rgba(239, 233, 220, 0.6);
  overflow: hidden;
  margin: 0 auto;
}

#pet-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--forest);
}

#pet-photo-placeholder svg {
  width: 32px;
  height: 32px;
}

#pet-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Step 4 Review Card */
.onboarding-review-card {
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 16px;
  background-color: #FAF6EE;
  padding: 1rem;
  margin-top: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.onboarding-review-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

#review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 2px solid var(--forest);
  background-color: #F3EDE2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

#review-pet-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--forest);
  margin: 0;
}

#review-pet-subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  color: #7D7263;
  margin: 0.15rem 0 0;
}

#review-pet-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(217, 201, 174, 0.6);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--forest);
}

/* Onboarding Bottom Bar */
.onboarding-bottom-bar {
  padding-top: 1rem;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
}

.onboarding-bottom-bar button.terracotta-button {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  background-color: var(--terracotta);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(184, 74, 39, 0.25);
  transition: all 0.15s ease;
}

.onboarding-bottom-bar button.terracotta-button:hover {
  background-color: var(--terracotta-dark);
  transform: translateY(-1px);
}

.onboarding-bottom-bar button.hidden {
  display: none !important;
}

/* ----- Pet Profile Top Bar ----- */
.pet-profile-top-bar {
  padding-top: max(0.6rem, env(safe-area-inset-top));
}

/* ----- Pet Profile Floating Action Bar (Edit Mode) ----- */
#pet-profile-action-bar.pet-profile-floating-bar {
  transition: all 0.2s ease-in-out;
}

#pet-profile-form.is-editing {
  padding-bottom: 6rem;
}

#pet-profile-form.is-editing #pet-profile-action-bar.pet-profile-floating-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0 auto;
  max-width: 640px;
  background-color: rgba(250, 246, 238, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(47, 93, 78, 0.22);
  box-shadow: 0 -4px 20px rgba(31, 36, 33, 0.12);
  padding: 0.75rem 1rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0.75rem));
  box-sizing: border-box;
}

@media (min-width: 640px) {
  #pet-profile-form.is-editing #pet-profile-action-bar.pet-profile-floating-bar {
    border-radius: 20px 20px 0 0;
    border-left: 1px solid rgba(47, 93, 78, 0.22);
    border-right: 1px solid rgba(47, 93, 78, 0.22);
  }
}

html.in-pet-editing #bottom-nav {
  display: none !important;
}

/* ----- Time Scroll Picker ----- */
.time-scroll-picker-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.time-scroll-picker {
  display: inline-flex;
  align-items: center;
  border: 1px solid #D4C2A5;
  border-radius: 0.75rem;
  background-color: #FFFFFF;
  padding: 0.25rem 0.5rem;
  box-shadow: 0 1px 3px rgba(31, 36, 33, 0.06);
  font-family: inherit;
  min-height: 44px;
  box-sizing: border-box;
}

.time-scroll-select {
  border: none;
  background: transparent;
  color: #1F2421;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.25rem 0.25rem;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-align: center;
  min-width: 2.25rem;
  min-height: 38px;
}

.time-scroll-select:focus-visible {
  outline: 2px solid #B84A27;
  border-radius: 0.375rem;
}

.time-scroll-separator {
  color: #756758;
  font-weight: 700;
  padding: 0 0.2rem;
  user-select: none;
}

/* ----- Sitter Special Note Card ----- */
.sitter-special-note-card {
  background: linear-gradient(180deg, #FDFBF7 0%, #F5EFE6 100%);
  border: 1px solid rgba(47, 93, 78, 0.22);
  border-radius: 1.25rem;
  padding: 1rem 1.15rem;
}

.sitter-special-note-card #sitter-special-note-heading {
  font-family: var(--font-display, 'Fraunces', serif);
  color: var(--forest, #1F3A2E);
  font-weight: 700;
}

.sitter-special-note-text {
  color: var(--ink, #1F2421);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.sitter-special-note-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sitter-note-toggle {
  margin-top: 0.5rem;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #A84A27;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----- Sitter Fast-Navigation Bottom Bar ----- */
.sitter-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  display: flex;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  background-color: rgb(242 236 225 / 94%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(47, 93, 78, 0.2);
  box-shadow: 0 -4px 16px rgba(74, 55, 40, 0.08);
  padding: 0 env(safe-area-inset-right, 0px) calc(env(safe-area-inset-bottom, 0px) + 8px) env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}

.sitter-bottom-nav.hidden {
  display: none !important;
}

/* The update form has its own page, so it is always open and not foldable. */
#sitter-page-update .sitter-update-summary { cursor: default; }
#sitter-page-emergency .sitter-emergency-body { padding: 0; }
#sitter-page-update .sitter-update-summary-action { display: none; }

/* Sitters see a short label under each icon so the three pages are easy to find. */
.sitter-bottom-nav .bottom-nav-tab {
  gap: 0.2rem;
  padding-top: 0.55rem;
  padding-bottom: 0.45rem;
}

.sitter-bottom-nav .bottom-nav-tab span:not(.sr-only) {
  display: block !important;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

body.has-sitter-nav main {
  padding-bottom: 5.5rem;
}

body.has-sitter-nav .bbp-toast {
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  .sitter-bottom-nav {
    border-radius: 1.25rem 1.25rem 0 0;
    border-left: 1px solid rgba(47, 93, 78, 0.2);
    border-right: 1px solid rgba(47, 93, 78, 0.2);
  }
}

/* ----- Calendar Event Type Display Toggles ----- */
.cal-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(47, 93, 78, 0.25);
  background-color: #FAF7F1;
  color: #554436;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cal-filter-chip:hover {
  background-color: #F0E8DC;
  border-color: #2F5D4E;
}

.cal-filter-chip.is-active {
  background-color: #1F3A2E;
  border-color: #1F3A2E;
  color: #FAF6EE;
  box-shadow: 0 1px 3px rgba(31, 58, 46, 0.2);
}

.cal-filter-chip:focus-visible {
  outline: 2px solid #B84A27;
  outline-offset: 2px;
}

/* ----- Calendar Categorical Tags (Clean, Emoji-Free) ----- */
.cal-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
}

.cal-cat-meal {
  background-color: #EBF4F0;
  color: #1F3A2E;
  border: 1px solid #C4DDD2;
}

.cal-cat-medication {
  background-color: #FDF2EC;
  color: #B84A27;
  border: 1px solid #F3CFBE;
}

.cal-cat-routine {
  background-color: #F5EFE6;
  color: #6C5543;
  border: 1px solid #D9C9AE;
}

.cal-cat-health {
  background-color: #EEF4F8;
  color: #235473;
  border: 1px solid #C1D8E7;
}

/* ----- Care Log Entry Actions & Delete Button ----- */
.care-log-entry-delete {
  font-size: 0.75rem;
  font-weight: 600;
  color: #8C735B;
  padding: 0.2rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.14s ease;
}

.care-log-entry-delete:hover {
  color: #B84A27;
  border-color: rgba(184, 74, 39, 0.3);
  background-color: rgba(184, 74, 39, 0.06);
}

.care-log-entry-delete:focus-visible {
  outline: 2px solid #B84A27;
  outline-offset: 1px;
}

/* ----- Onboarding Interactive Mascot / PFP Upload Frame ----- */
button.onboarding-mascot-frame {
  font-family: inherit;
  border-width: 1.5px;
  border-style: solid;
  border-color: rgba(47, 93, 78, 0.25);
  background-color: #FAF6EE;
}

button.onboarding-mascot-frame:hover {
  background-color: #F5EFE6;
  border-color: #2F5D4E;
}

button.onboarding-mascot-frame:active {
  transform: scale(0.98);
}

/* Narrower desktop windows: keep the labelled navigation clear of the logo text. */
@media (min-width: 900px) and (max-width: 1099px) {
  html.website-mode .bottom-nav { gap: 0.25rem; }
  html.website-mode .bottom-nav-tab { min-width: 4.75rem; padding-left: 0.55rem; padding-right: 0.55rem; }
}

/* On-screen keyboard (js/keyboard.js sets html.keyboard-open while it is open). */
/* iPhones can't keep a bar pinned on top of the keyboard while the page scrolls (it bounces
   and covers the field being typed in), so the Save/Cancel bar steps aside while typing.
   It returns when the keyboard closes, and the Done button at the top still saves. */
html.keyboard-open #pet-profile-form.is-editing #pet-profile-action-bar.pet-profile-floating-bar {
  display: none;
}
@media (max-width: 640px) {
  /* Give the sign-in form the room while typing; the logo returns when the keyboard closes. */
  html.keyboard-open #auth-brand-header { display: none; }
  /* The tab bar would sit behind the keyboard anyway. */
  html.keyboard-open .bottom-nav { visibility: hidden; }
}

/* Updates posted for several pets list the pets under the title. */
.care-log-pets {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #3F5A4E;
}

/* Sign in with Apple: black button with white logo, as Apple's guidelines ask. */
.auth-google.auth-apple { border-color: #000; background: #000; color: #fff; }
.auth-google.auth-apple:not(:disabled):hover { background: #1f1f1f; }

/* Desktop login: the headline and intro sit on the green panel, so they must be light. */
@media (min-width: 900px) {
  html:has(#app-shell:not(.is-authenticated)) .website-hero .website-headline { color: var(--auth-cream); }
  html:has(#app-shell:not(.is-authenticated)) .website-hero .website-copy { color: rgba(247,241,232,.86); }
}

/* Startup loading screen (only while a saved sign-in is restored; see js/display-mode.js). */
#session-splash { display: none; }
/* Hide everything behind it, including parts that set their own visibility. */
html.restoring-session body:has(#session-splash) > *:not(#session-splash),
html.restoring-session body:has(#session-splash) > *:not(#session-splash) * { visibility: hidden !important; }
html.restoring-session #session-splash {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; overflow: hidden;
  padding: 24px; background: var(--auth-cream); font-family: Nunito, sans-serif; text-align: center;
}
.session-splash-logo { width: 168px; height: auto; }
.session-splash-dots { display: flex; gap: 10px; }
.session-splash-dots span {
  position: relative; width: 12px; height: 12px; border-radius: 50%;
  background: var(--auth-terracotta); animation: session-splash-bob 1.1s ease-in-out infinite;
}
.session-splash-dots span:nth-child(2) { background: var(--auth-green); animation-delay: .15s; }
.session-splash-dots span:nth-child(3) { animation-delay: .3s; }
/* Four little thread holes, like a sewn button. */
.session-splash-dots span::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; opacity: .9;
  background: radial-gradient(circle, var(--auth-cream) 0.9px, transparent 1.1px) 0 0 / 3px 3px;
}
@keyframes session-splash-bob { 0%, 100% { transform: translateY(0); opacity: .55; } 40% { transform: translateY(-7px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .session-splash-dots span { animation: none; opacity: .8; } }
.session-splash-text { margin: 0; color: var(--auth-secondary); font-size: 15px; font-weight: 700; }
.session-splash-slow { display: none; max-width: 280px; }
html.startup-slow .session-splash-slow { display: block; }
.session-splash-slow p { margin: 0 0 12px; color: var(--auth-secondary); font-size: 14px; line-height: 1.5; }
.session-splash-slow button {
  min-height: 44px; padding: 10px 22px; border: 0; border-radius: var(--auth-control-radius);
  background: var(--auth-terracotta); color: #fff; font: 800 15px Nunito, sans-serif;
}
.session-splash-deco { position: absolute; width: 170px; height: 170px; color: var(--auth-terracotta); opacity: .07; }
.session-splash-deco-top { top: -40px; right: -50px; transform: rotate(20deg); }
.session-splash-deco-bottom { bottom: -40px; left: -50px; transform: rotate(-20deg); }
