:root {
  --bg-1: #f7efe7;
  --bg-2: #e7ddd3;
  --glow: rgba(255, 90, 60, 0.18);
  --ink: #2a221d;
  --muted: #6b5c54;
  --accent: #ff5a3c;
  --accent-strong: #e34731;
  --accent-soft: #ffe2d9;
  --card: #fff8f2;
  --border: #e7d4c6;
  --shadow: 0 26px 70px rgba(42, 34, 29, 0.18);
}

html[data-theme="dark"] {
  --bg-1: #1c1613;
  --bg-2: #120f0d;
  --glow: rgba(255, 90, 60, 0.12);
  --ink: #f6efe9;
  --muted: #c8b6aa;
  --accent: #ff6f54;
  --accent-strong: #ff5a3c;
  --accent-soft: #3a2a24;
  --card: #201a17;
  --border: #3b302a;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, var(--accent-soft) 0%, var(--bg-1) 40%, var(--bg-2) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Global loading indicator (tied to API requests). */
.global-loading {
  position: fixed;
  inset: 0 0 auto 0;
  height: 8px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .global-loading {
  background: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.global-loading__bar {
  height: 100%;
  width: 55%;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 35%, var(--accent-strong) 65%, transparent 100%);
  transform: translateX(-100%);
  animation: global-loading-slide 0.95s linear infinite;
  box-shadow: 0 0 18px rgba(255, 90, 60, 0.55);
}

html.app-loading .global-loading {
  opacity: 1;
}

@keyframes global-loading-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-loading__bar {
    animation: none;
    transform: translateX(0);
    width: 100%;
    opacity: 0.8;
  }
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto auto;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  gap: 24px;
  position: relative;
  z-index: 1;
  background: rgba(255, 248, 242, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(231, 212, 198, 0.6);
}

html[data-theme="dark"] .site-header {
  background: rgba(32, 26, 23, 0.82);
  border-bottom-color: rgba(59, 48, 42, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255, 90, 60, 0.45));
}

.brand-title {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 22px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.site-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(42, 34, 29, 0.12);
}

.nav-toggle__glyph {
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

.nav-toggle__glyph--close,
.nav-toggle__label--close {
  display: none;
}

.nav-toggle:hover {
  border-color: var(--accent-soft);
  background: rgba(255, 90, 60, 0.08);
}

html[data-theme="dark"] .nav-toggle:hover {
  background: rgba(255, 111, 84, 0.12);
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
}

.nav-button {
  border: 1px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.6);
}

.nav-button--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-link:hover {
  border-color: var(--accent-soft);
  background: rgba(255, 90, 60, 0.08);
}

html[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 111, 84, 0.12);
}

.nav-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lang-switch {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.lang-switch__links {
  display: flex;
  gap: 8px;
}

.lang-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
}

.theme-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(42, 34, 29, 0.12);
}

.site-footer {
  margin-top: auto;
  padding: 12px 32px 22px;
  position: relative;
  z-index: 0;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.footer-link {
  text-decoration: none;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
}

.footer-link:hover {
  border-color: var(--accent-soft);
  background: rgba(255, 90, 60, 0.08);
}

html[data-theme="dark"] .footer-link:hover {
  background: rgba(255, 111, 84, 0.12);
}

.footer-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.policy-document {
  margin: 0 0 14px;
  padding: 20px 22px;
}

.policy-document__heading {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.policy-document__paragraph {
  margin: 8px 0 16px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

.policy-document__paragraph:last-child {
  margin-bottom: 0;
}

.policy-document__link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  margin-left: 6px;
}

.policy-document__link:hover {
  text-decoration: underline;
}

.policy-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.policy-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, var(--card) 100%);
  border-color: rgba(231, 212, 198, 0.9);
}

.policy-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(255, 90, 60, 0.25) 100%);
}

.policy-section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.policy-section__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  background: rgba(255, 90, 60, 0.14);
  border: 1px solid rgba(255, 90, 60, 0.28);
}

.policy-section h2 {
  margin: 0;
  font-size: 22px;
}

.policy-section .lead {
  margin: 0;
}

.policy-section .nav-link {
  display: inline-flex;
  margin-top: 12px;
}

.policy-contact-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.policy-contact-list p {
  margin: 0;
}

.policy-contact-list a {
  color: var(--accent-strong);
}

.policy-section--full {
  grid-column: 1 / -1;
}

html[data-theme="dark"] .policy-section {
  background: linear-gradient(180deg, rgba(35, 28, 24, 0.95) 0%, rgba(28, 22, 19, 0.98) 100%);
  border-color: rgba(75, 62, 55, 0.92);
}

html[data-theme="dark"] .policy-section__index {
  color: #ffd9cc;
  background: rgba(255, 111, 84, 0.18);
  border-color: rgba(255, 111, 84, 0.35);
}

.theme-icon__glyph {
  font-size: 14px;
}

html[data-theme="dark"] .theme-icon {
  background: rgba(25, 20, 17, 0.9);
  color: #ffd9cf;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #1c1613;
  color: var(--ink);
  border-color: var(--border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(246, 239, 233, 0.55);
}

html[data-theme="dark"] .list-item,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .activity-item {
  background: #1f1916;
}

html[data-theme="dark"] .profile-item {
  background: rgba(32, 26, 23, 0.9);
  border-color: rgba(59, 48, 42, 0.8);
}

html[data-theme="dark"] .modal-card {
  background: #201a17;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .login-card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .card {
  background: #201a17;
  border-color: var(--border);
}

html[data-theme="dark"] .highlight {
  background: rgba(32, 26, 23, 0.9);
}

html[data-theme="dark"] .modal-close,
html[data-theme="dark"] .icon-button {
  background: #1b1512;
  border-color: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .admin-tab-button {
  background: rgba(32, 26, 23, 0.85);
  border-color: var(--border);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0 24px;
}

.admin-tab-button {
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  line-height: 1;
}

.admin-tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .admin-tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.admin-tab-button .count-badge {
  flex: none;
}

.timeline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.timeline-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.timeline-header-row .modal-section-title {
  margin-bottom: 0;
}

.timeline-add-entry-button {
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: none;
  font-size: 13px;
  white-space: nowrap;
}

.timeline-tab-button {
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  box-shadow: none;
}

.timeline-tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.timeline-tab-button .count-badge {
  flex: none;
}

.mobile-section-tabs {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.mobile-section-tab {
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
  white-space: nowrap;
  width: 100%;
}

.mobile-section-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .timeline-tab-button {
  background: rgba(32, 26, 23, 0.88);
  border-color: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .timeline-tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .mobile-section-tab {
  background: rgba(32, 26, 23, 0.88);
  border-color: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .mobile-section-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#owner-plan-modal .mobile-section-tabs,
#vet-treatment-modal .mobile-section-tabs {
  display: none;
}

#owner-plan-modal .timeline-tabs,
#vet-treatment-modal .timeline-tabs {
  display: flex;
}

@media (max-width: 720px) {
  #owner-plan-modal .mobile-section-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #vet-treatment-modal .mobile-section-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #owner-plan-modal .timeline-tabs,
  #vet-treatment-modal .timeline-tabs {
    display: none;
  }
}

@media (max-width: 640px) {
  #owner-plan-modal .mobile-section-tabs,
  #vet-treatment-modal .mobile-section-tabs {
    grid-template-columns: 1fr;
  }
}

.timeline-empty {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .timeline-empty {
  background: rgba(28, 22, 19, 0.72);
  border-color: rgba(75, 62, 55, 0.9);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.admin-tab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-toolbar input[type="search"] {
  flex: 1;
}

.admin-add-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: transparent;
  font-size: 0;
  line-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.admin-editor-panel {
  display: none;
}

.admin-editor-panel.active {
  display: block;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-item-row__copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.list-item-row__text {
  min-width: 0;
}

.pet-list-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex: none;
  background: rgba(120, 120, 120, 0.12);
}

.list-item-actions {
  position: relative;
}

.icon-button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-strong);
}

.icon-button--danger {
  color: #9c2f2f;
}

.action-menu {
  position: absolute;
  right: 0;
  top: 36px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(42, 34, 29, 0.12);
  padding: 6px;
  display: none;
  z-index: 10;
  min-width: 120px;
}

html[data-theme="dark"] .action-menu {
  background: #201a17;
  border-color: var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .action-menu button {
  color: var(--ink);
}

.action-menu.open {
  display: block;
}

.action-menu button {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.action-menu button:hover {
  background: rgba(255, 90, 60, 0.08);
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 18, 14, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: 24px;
  width: min(92vw, 720px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(22, 18, 14, 0.2);
}

#vet-treatment-modal .modal-card {
  width: min(96vw, 1320px);
}

#owner-plan-modal .modal-card {
  width: min(94vw, 980px);
}

.modal-section-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.modal-subsection-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.modal-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px;
}

#vet-treatment-modal .modal-split {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
}

#vet-treatment-modal .vet-treatment-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

#vet-treatment-modal .vet-treatment-panel {
  border: 1px solid rgba(231, 212, 198, 0.92);
  border-right: 1px solid rgba(231, 212, 198, 0.92);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 252, 249, 0.94);
  box-shadow: 0 8px 18px rgba(42, 34, 29, 0.06);
  min-width: 0;
}

#vet-treatment-modal .vet-treatment-panel:last-child {
  border-right: 1px solid rgba(231, 212, 198, 0.92);
}

#vet-treatment-modal .vet-treatment-panel h3 {
  margin: 0;
}

#vet-treatment-modal .vet-treatment-panel .divider {
  margin: 12px 0;
}

#vet-treatment-modal .vet-treatment-panel--timeline #vet-timeline,
#vet-treatment-modal .vet-treatment-panel--timeline #vet-vaccinations {
  max-height: 440px;
  overflow: auto;
  padding-right: 2px;
}

#vet-treatment-modal .vet-treatment-panel--notes #vet-private-notes-text {
  min-height: 320px;
}

@media (min-width: 721px) and (max-width: 1180px) {
  #vet-treatment-modal .modal-card {
    width: min(96vw, 980px);
    padding: 24px;
  }

  #vet-treatment-modal .vet-treatment-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }

  #vet-treatment-modal .vet-treatment-panel--timeline {
    grid-column: 1 / -1;
    order: 1;
  }

  #vet-treatment-modal .vet-treatment-panel--pets {
    order: 2;
  }

  #vet-treatment-modal .vet-treatment-panel--notes {
    order: 3;
  }

  #vet-treatment-modal .vet-treatment-panel--timeline #vet-timeline,
  #vet-treatment-modal .vet-treatment-panel--timeline #vet-vaccinations {
    max-height: 380px;
  }

  #vet-treatment-details {
    grid-template-columns: 1fr;
  }

  #vet-treatment-modal .vet-treatment-panel--notes #vet-private-notes-text,
  #vet-treatment-modal .vet-treatment-panel--notes .note-readonly {
    min-height: 220px;
  }
}

html[data-theme="dark"] .modal-section-title,
html[data-theme="dark"] .modal-subsection-title {
  color: var(--ink);
}

html[data-theme="dark"] #vet-treatment-modal .vet-treatment-layout {
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] #vet-treatment-modal .vet-treatment-panel {
  border-color: rgba(75, 62, 55, 0.92);
  border-right-color: rgba(75, 62, 55, 0.92);
  background: rgba(30, 24, 20, 0.98);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

.pet-timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: 20px;
  align-items: start;
  margin-top: 8px;
}

.pet-summary-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 248, 242, 0.8);
}

.pet-summary-card .profile-grid {
  grid-template-columns: 1fr;
}

.pet-summary-card__image-wrap {
  margin-bottom: 12px;
}

.pet-summary-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.pet-summary-inline__image {
  width: 170px;
}

.pet-summary-image {
  width: 100%;
  height: auto;
  max-height: 220px;
  border-radius: 14px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
  background: rgba(120, 120, 120, 0.12);
}

html[data-theme="dark"] .pet-summary-card {
  background: rgba(28, 22, 19, 0.92);
  border-color: var(--border);
}

#vet-treatment-summary {
  border: 1px solid rgba(231, 212, 198, 0.8);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 250, 246, 0.88);
}

#vet-treatment-summary.has-image {
  grid-template-columns: 1fr;
}

#vet-treatment-summary .pet-summary-inline__image {
  width: 100%;
  margin-bottom: 14px;
}

#vet-treatment-summary .pet-summary-image {
  max-height: 260px;
  aspect-ratio: 1 / 1;
  box-shadow: 0 10px 20px rgba(42, 34, 29, 0.12);
}

#vet-treatment-details {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

#vet-treatment-details .profile-item {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.76);
}

html[data-theme="dark"] #vet-treatment-summary {
  background: rgba(30, 24, 20, 0.96);
  border-color: rgba(75, 62, 55, 0.92);
}

html[data-theme="dark"] #vet-treatment-details .profile-item {
  background: rgba(40, 31, 27, 0.9);
  border-color: rgba(75, 62, 55, 0.88);
}

html[data-theme="dark"] #vet-treatment-summary .pet-summary-image {
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

#owner-plan-modal .pet-timeline-layout {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

#owner-plan-modal .pet-summary-card {
  background: rgba(255, 252, 249, 0.94);
  border: 1px solid rgba(231, 212, 198, 0.92);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(42, 34, 29, 0.06);
}

#owner-plan-modal .pet-summary-card__image-wrap {
  margin-bottom: 14px;
}

#owner-plan-modal .pet-summary-image {
  max-height: 260px;
  aspect-ratio: 1 / 1;
}

#owner-plan-modal .pet-summary-card .profile-grid {
  gap: 8px;
}

#owner-plan-modal .pet-summary-card .profile-item {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
}

#owner-plan-modal .owner-timeline-column {
  border: 1px solid rgba(231, 212, 198, 0.92);
  border-left: 1px solid rgba(231, 212, 198, 0.92);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 252, 249, 0.94);
  box-shadow: 0 8px 18px rgba(42, 34, 29, 0.06);
  min-width: 0;
}

#owner-plan-modal #owner-timeline {
  gap: 12px;
}

#owner-plan-modal #owner-timeline,
#owner-plan-modal #owner-vaccinations {
  max-height: 440px;
  overflow: auto;
  padding-right: 2px;
}

#owner-plan-modal #owner-timeline .timeline-item {
  padding: 14px 16px;
  border-radius: 14px;
  border-color: rgba(231, 212, 198, 0.85);
  background: rgba(255, 252, 249, 0.92);
  box-shadow: 0 10px 24px rgba(42, 34, 29, 0.06);
}

#owner-plan-modal #owner-timeline .plan-item-list {
  margin-top: 0;
  gap: 8px;
}

#owner-plan-modal #owner-timeline .plan-item-card {
  border: 1px solid rgba(231, 212, 198, 0.75);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.72);
}

#owner-plan-modal #owner-timeline-connection {
  margin: 0 0 12px;
}

html[data-theme="dark"] #owner-plan-modal .pet-summary-card {
  background: rgba(30, 24, 20, 0.98);
  border-color: rgba(75, 62, 55, 0.92);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] #owner-plan-modal .pet-summary-card .profile-item {
  background: rgba(40, 31, 27, 0.9);
  border-color: rgba(75, 62, 55, 0.9);
}

html[data-theme="dark"] #owner-plan-modal #owner-timeline .timeline-item {
  background: rgba(30, 24, 20, 0.97);
  border-color: rgba(75, 62, 55, 0.92);
  box-shadow: none;
}

html[data-theme="dark"] #owner-plan-modal .owner-timeline-column {
  background: rgba(30, 24, 20, 0.98);
  border-color: rgba(75, 62, 55, 0.92);
  border-left-color: rgba(75, 62, 55, 0.92);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] #owner-plan-modal #owner-timeline .plan-item-card {
  background: rgba(39, 31, 26, 0.92);
  border-color: rgba(75, 62, 55, 0.9);
}

.side-panel textarea {
  min-height: 180px;
  margin-bottom: 16px;
}

.note-hint {
  margin: 0 0 12px;
}

#vet-private-notes-text {
  min-height: 240px;
  margin-bottom: 0;
  resize: vertical;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.75);
}

.note-readonly {
  min-height: 240px;
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
  white-space: pre-wrap;
}

html[data-theme="dark"] #vet-private-notes-text {
  background: rgba(28, 22, 19, 0.8);
  border-color: rgba(59, 48, 42, 0.9);
}

html[data-theme="dark"] .note-readonly {
  background: rgba(28, 22, 19, 0.8);
  border-color: rgba(59, 48, 42, 0.9);
}

#vet-private-notes-text:focus {
  outline: 2px solid rgba(255, 90, 60, 0.4);
  outline-offset: 2px;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.note-footer .status {
  margin-top: 0;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 720px) {
  #owner-plan-modal .pet-timeline-layout {
    grid-template-columns: 1fr;
  }
  #owner-plan-modal [data-owner-modal-panel] {
    grid-column: 1 / -1;
    width: 100%;
  }
  .modal-split {
    grid-template-columns: 1fr;
  }
  #vet-treatment-modal .vet-treatment-layout {
    grid-template-columns: 1fr;
    border: 0;
    background: transparent;
    gap: 10px;
  }
  #vet-treatment-modal .vet-treatment-panel {
    border: 1px solid rgba(231, 212, 198, 0.88);
    border-right: 1px solid rgba(231, 212, 198, 0.88);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 252, 249, 0.92);
  }
  #vet-treatment-modal [data-vet-modal-panel] {
    grid-column: 1 / -1;
    width: 100%;
  }
  html[data-theme="dark"] #vet-treatment-modal .vet-treatment-panel {
    border-color: rgba(75, 62, 55, 0.92);
    border-right-color: rgba(75, 62, 55, 0.92);
    background: rgba(30, 24, 20, 0.98);
  }
  #vet-treatment-modal .vet-treatment-panel--timeline #vet-timeline,
  #vet-treatment-modal .vet-treatment-panel--timeline #vet-vaccinations {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  #owner-plan-modal #owner-timeline,
  #owner-plan-modal #owner-vaccinations {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .pet-timeline-layout {
    grid-template-columns: 1fr;
  }
  #owner-plan-modal .pet-summary-card {
    position: static;
    padding: 14px;
  }
  #owner-plan-modal .owner-timeline-column {
    border-left: 1px solid rgba(231, 212, 198, 0.92);
    border-top: 1px solid rgba(231, 212, 198, 0.88);
    padding: 14px;
  }
  html[data-theme="dark"] #owner-plan-modal .owner-timeline-column {
    border-top-color: rgba(75, 62, 55, 0.92);
  }
  #owner-plan-modal .pet-summary-image {
    max-height: 240px;
  }
  .pet-summary-inline {
    grid-template-columns: 1fr;
  }
  #vet-treatment-summary.has-image {
    grid-template-columns: 1fr;
  }
  .pet-summary-inline__image {
    width: min(100%, 260px);
  }
  #vet-treatment-summary .pet-summary-inline__image {
    max-width: none;
    margin-inline: 0;
  }
  #vet-treatment-modal .modal-card {
    width: min(94vw, 720px);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.page {
  flex: 1;
  padding: 0 32px 48px;
  position: relative;
  z-index: 1;
  animation: fade-rise 0.6s ease-out;
}

h1,
h2,
h3 {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  letter-spacing: -0.01em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
  padding: 48px 0 32px;
}

.hero--full {
  grid-template-columns: minmax(0, 1fr);
}

.hero-title {
  font-size: clamp(32px, 4vw, 46px);
  margin: 12px 0 12px;
}

.hero-copy .lead {
  max-width: 520px;
}


.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(255, 90, 60, 0.12);
  color: var(--accent-strong);
  font-weight: 700;
}

.hero-highlights {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.highlight {
  background: rgba(255, 248, 242, 0.8);
  border: 1px solid rgba(231, 212, 198, 0.7);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 18px 40px rgba(42, 34, 29, 0.08);
}

.highlight h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  border: 1px solid rgba(231, 212, 198, 0.8);
  box-shadow: var(--shadow);
}

.auth-page {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0 48px;
  gap: 12px;
}

.auth-card {
  width: min(520px, 100%);
}

.role-switch {
  display: inline-flex;
  gap: 8px;
  margin: 12px 0 20px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(244, 120, 80, 0.2);
}

html[data-theme="dark"] .role-switch {
  background: rgba(25, 20, 17, 0.85);
  border-color: rgba(255, 111, 84, 0.3);
}

.role-switch__button {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: #6a4a3c;
  cursor: pointer;
}

html[data-theme="dark"] .role-switch__button {
  color: rgba(246, 239, 233, 0.7);
}

.role-switch__button.active {
  background: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .role-switch__button.active {
  background: var(--accent);
  color: #fff;
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0 12px;
}

.page-hero__copy {
  max-width: 620px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 700;
}

.stat-chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 90, 60, 0.14);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.profile-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-item {
  background: rgba(255, 248, 242, 0.8);
  border: 1px solid rgba(231, 212, 198, 0.7);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.profile-item span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.profile-item strong {
  font-size: 14px;
  font-weight: 700;
  word-break: break-all;
}

.profile-feedback-history-header {
  margin-top: 18px;
}

#profile-feedback-panel {
  position: fixed;
  right: 24px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: min(460px, calc(100vw - 48px));
  max-height: min(72vh, 680px);
  overflow-y: auto;
  z-index: 930;
}

.profile-feedback-fab {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 940;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid var(--accent);
  line-height: 1;
}

.card,
.panel {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  max-width: 520px;
  margin: 64px auto 0;
}

.lead {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-family: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

label .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

label .label-row > span {
  margin-bottom: 0;
}

.birth-year-age-display {
  display: block;
  margin-top: 6px;
  font-family: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  min-height: 16px;
}

.field-flag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  background: rgba(255, 90, 60, 0.12);
  color: var(--accent);
}

.field-flag.optional {
  background: rgba(120, 120, 120, 0.15);
  color: var(--muted);
}

input,
textarea,
button {
  font-family: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  accent-color: var(--accent);
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
}

button {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(255, 90, 60, 0.24), 0 0 34px rgba(255, 90, 60, 0.18);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--accent);
}

button.danger-action {
  color: #9c2f2f;
  border-color: #9c2f2f;
}

.confirm-dialog__card {
  width: min(92vw, 520px);
}

.confirm-dialog__title {
  margin: 0 0 10px;
}

.confirm-dialog__message {
  margin: 0 0 8px;
}

.confirm-dialog__details {
  margin: 0 0 18px;
  color: #9c2f2f;
  font-weight: 600;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button {
  background: #fff;
  box-shadow: none;
  position: relative;
  color: var(--accent-strong);
  font-size: 14px;
  line-height: 1;
}

.icon-button::before {
  content: "✎";
}

.icon-button::before {
  content: "\270E";
}

.icon-button svg {
  display: none;
}

.modal-close {
  color: var(--accent-strong);
  background: #fff;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.link-button {
  margin-top: 12px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.auth-alt {
  margin-top: 18px;
  text-align: center;
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 24px;
}

.owner-main {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.owner-main__left {
  display: grid;
  gap: 24px;
}

.vet-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.manager-tools {
  margin-bottom: 24px;
}

.manager-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.vet-shell__left,
.vet-shell__right {
  display: grid;
  gap: 24px;
}

.list,
.timeline,
.careplan,
  .medications,
  .activity {
  display: grid;
  gap: 12px;
}

  .list-item,
  .timeline-item,
  .activity-item {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fdfbf7;
    color: var(--ink);
  }

.compact-list {
  gap: 8px;
}

.compact-list .list-item {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.compact-list .checkbox-item {
  gap: 8px;
}

.compact-list input[type="checkbox"] {
  transform: scale(0.9);
}

.compact-list .list-item:last-child {
  border-bottom: 0;
}

.admin-owner-picker {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  background: var(--card);
}

.admin-owner-picker .list-item {
  padding: 8px 6px;
}

.admin-owner-picker .checkbox-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

.admin-owner-picker input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0 0;
  transform: none;
}

.admin-owner-picker .checkbox-item > span {
  min-width: 0;
  line-height: 1.2;
}

/* Owner clinic access list: more compact than other "compact-list" uses. */
#owner-clinic-list.compact-list {
  gap: 4px;
}

#owner-clinic-list.compact-list .list-item {
  padding: 6px 8px 6px 2px;
}

#owner-clinic-list.compact-list .checkbox-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

#owner-clinic-list.compact-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0 2px;
  justify-self: start;
  transform: none;
}

#owner-clinic-list.compact-list .checkbox-item > span {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: inherit;
  color: inherit;
  line-height: 1.15;
  display: block;
  text-align: left;
}

  .checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
  }

.timeline-item h4 {
  margin: 0 0 8px;
  font-family: "Fira Sans", "Trebuchet MS", sans-serif;
}

.timeline-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.timeline-item__header h4 {
  margin: 0;
}

.divider {
  height: 1px;
  background: var(--border);
}

.form-section {
  border-radius: 14px;
  padding: 12px;
  background: #f7f4ee;
}

html[data-theme="dark"] .form-section {
  background: rgba(28, 22, 19, 0.92);
  border: 1px solid var(--border);
}

.form-list {
  display: grid;
  gap: 10px;
}

#vet-plan-list textarea[name="details"] {
  min-height: 120px;
  resize: vertical;
}

.plan-item-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.plan-item-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.plan-item-card {
  display: grid;
  gap: 6px;
}

.plan-item-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-item-card__details {
  white-space: pre-wrap;
}

.plan-item-card__dates {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 90, 60, 0.28);
  background: rgba(255, 90, 60, 0.12);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.plan-item-card__issued {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(106, 74, 60, 0.78);
  font-weight: 500;
}

html[data-theme="dark"] .plan-item-card__dates {
  border-color: rgba(255, 111, 84, 0.42);
  background: rgba(255, 111, 84, 0.18);
  color: #ffd9cc;
}

html[data-theme="dark"] .plan-item-card__issued {
  color: rgba(246, 239, 233, 0.62);
}

html[data-theme="dark"] input[type="date"] {
  color-scheme: dark;
}

html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
  opacity: 0.9;
  cursor: pointer;
}

html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.hidden {
  display: none;
}

.error {
  margin-top: 12px;
  color: #9c2f2f;
  font-weight: 600;
}

.status {
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
}

.connection-status {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(120, 120, 120, 0.22);
  background: rgba(120, 120, 120, 0.12);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.55);
  flex: none;
}

.connection-status[data-state="reconnecting"] {
  border-color: rgba(255, 90, 60, 0.25);
  background: rgba(255, 90, 60, 0.12);
  color: var(--accent-strong);
}

.connection-status[data-state="reconnecting"]::before {
  background: var(--accent);
}

.connection-status[data-state="offline"] {
  border-color: rgba(156, 47, 47, 0.3);
  background: rgba(156, 47, 47, 0.14);
  color: #9c2f2f;
}

.connection-status[data-state="offline"]::before {
  background: #9c2f2f;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}

.timeline-entry-meta {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
  background: rgba(120, 120, 120, 0.12);
  color: var(--muted);
}

.pill.active {
  background: rgba(255, 90, 60, 0.16);
  color: var(--accent-strong);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #9c2f2f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.count-badge.hidden {
  display: none;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-field {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 10px;
  align-items: center;
}

.phone-field__country {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
}

html[data-theme="dark"] .phone-field__country {
  background: #1c1613;
  color: var(--ink);
  border-color: var(--border);
}

.phone-field__local {
  width: 100%;
}

html[data-theme="dark"] .icon-button {
  background: #1b1512;
  border-color: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .modal-close {
  background: #1b1512;
  border-color: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .login-card {
  background: #201a17;
  border-color: var(--border);
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "toggle toggle"
      "nav nav";
    align-items: center;
    padding: 16px 18px;
    gap: 14px 12px;
    backdrop-filter: none;
    background: rgba(255, 248, 242, 0.92);
  }
  html[data-theme="dark"] .site-header {
    background: rgba(32, 26, 23, 0.95);
  }
  .brand {
    grid-area: brand;
    min-width: 0;
  }
  .brand-logo {
    width: 56px;
    height: 56px;
  }
  .brand-title {
    font-size: 18px;
  }
  .brand-subtitle {
    display: none;
  }
  .site-nav {
    grid-area: nav;
    display: none;
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .nav-link {
    width: 100%;
    text-align: left;
  }
  .site-footer {
    padding: 8px 18px 18px;
  }
  .site-footer__nav {
    justify-content: stretch;
  }
  .footer-link {
    width: 100%;
    text-align: center;
  }
  .policy-meta {
    gap: 6px;
  }
  .policy-document {
    padding: 16px;
  }
  .policy-document__heading {
    font-size: 16px;
  }
  .policy-document__paragraph {
    font-size: 14px;
  }
  .policy-sections {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .policy-section h2 {
    font-size: 20px;
  }
  .lang-switch {
    grid-area: actions;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .nav-toggle {
    grid-area: toggle;
    width: 100%;
    display: inline-flex;
  }
  .nav-toggle__state:focus + .nav-toggle {
    outline: 2px solid rgba(255, 90, 60, 0.5);
    outline-offset: 2px;
  }
  .nav-toggle__state:checked + .nav-toggle .nav-toggle__glyph--menu,
  .nav-toggle__state:checked + .nav-toggle .nav-toggle__label--menu {
    display: none;
  }
  .nav-toggle__state:checked + .nav-toggle .nav-toggle__glyph--close,
  .nav-toggle__state:checked + .nav-toggle .nav-toggle__label--close {
    display: inline;
  }
  .nav-toggle__state:checked ~ .site-nav {
    display: flex;
  }
  .page {
    padding: 0 18px 36px;
  }
  .card,
  .panel {
    box-shadow: 0 18px 44px rgba(42, 34, 29, 0.12);
  }
  html[data-theme="dark"] .card,
  html[data-theme="dark"] .panel {
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  }
  body::before {
    opacity: 0.55;
  }
  .icon-button,
  .theme-icon,
  .admin-add-button,
  .modal-close {
    width: 40px;
    height: 40px;
  }
  .theme-icon__glyph {
    font-size: 16px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .owner-main {
    grid-template-columns: 1fr;
  }
  .vet-shell {
    grid-template-columns: 1fr;
  }
  .manager-grid {
    grid-template-columns: 1fr;
  }
  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 90, 60, 0.45) transparent;
    padding-bottom: 8px;
  }
  .admin-tabs::-webkit-scrollbar {
    height: 6px;
  }
  .admin-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 90, 60, 0.45);
    border-radius: 999px;
  }
  .admin-tab-button {
    flex: 0 0 auto;
    min-height: 40px;
  }
  #profile-feedback-panel {
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-height: min(68vh, 560px);
  }
  .profile-feedback-fab {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

.feedback-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.feedback-message {
  margin: 8px 0 0;
  white-space: pre-wrap;
  line-height: 1.4;
}

.feedback-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.feedback-status-chip--new {
  background: rgba(255, 90, 60, 0.15);
  color: var(--accent-strong);
  border-color: rgba(255, 90, 60, 0.32);
}

.feedback-status-chip--read {
  background: rgba(120, 120, 120, 0.14);
  color: var(--muted);
  border-color: rgba(120, 120, 120, 0.28);
}

.feedback-status-chip--resolved {
  background: rgba(34, 143, 93, 0.14);
  color: #228f5d;
  border-color: rgba(34, 143, 93, 0.3);
}

.feedback-admin-row {
  display: grid;
  gap: 8px;
}

.feedback-reply {
  border-left: 3px solid rgba(255, 90, 60, 0.45);
  background: rgba(255, 90, 60, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 2px;
}

.feedback-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-reply-edit {
  flex: none;
}

#admin-feedback-reply-modal .modal-card {
  width: min(92vw, 720px);
}

#admin-feedback-reply-message {
  min-height: 180px;
  resize: vertical;
}

.feedback-reply-composer {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.feedback-reply-input {
  min-height: 72px;
  resize: vertical;
}

.feedback-reply-composer button {
  justify-self: start;
}

.feedback-reply-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-identity {
  min-width: 0;
}

.feedback-identity .meta {
  margin-top: 2px;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

html[data-theme="dark"] .feedback-status-chip--resolved {
  color: #6ad6a2;
  border-color: rgba(106, 214, 162, 0.4);
  background: rgba(106, 214, 162, 0.12);
}

html[data-theme="dark"] .feedback-reply {
  border-left-color: rgba(255, 111, 84, 0.55);
  background: rgba(255, 111, 84, 0.12);
}

@media (max-width: 420px) {
  .site-header {
    padding: 12px 14px;
    gap: 12px 10px;
  }
  .brand-title {
    font-size: 16px;
  }
  .nav-link {
    padding: 9px 12px;
  }
  .page {
    padding: 0 12px 32px;
  }
  .admin-tabs {
    gap: 8px;
    padding: 12px 0 18px;
  }
  .admin-tab-button {
    padding: 9px 12px;
    font-size: 13px;
  }
  .admin-toolbar {
    flex-wrap: wrap;
  }
  .admin-toolbar input[type="search"] {
    flex: 1 1 100%;
  }
  .phone-field {
    grid-template-columns: 1fr;
  }
  .timeline-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .timeline-add-entry-button {
    width: 100%;
  }
  .plan-item-date-row {
    grid-template-columns: 1fr;
  }
  .admin-owner-picker {
    max-height: 180px;
  }
  .modal-overlay {
    padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
      calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  }
  .modal-card {
    padding: 22px 18px;
  }
}
