*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brown: #473628;
  --cream: #FFF1DF;
  --brown-light: #6b5040;
  --border: #e2d8d0;
  --bg: #f7f2ec;
  --text: #2a1f17;
  --muted: #7a6a5a;
  --success: #15803d;
  --danger: #b91c1c;
}
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--brown);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-decoration: none;
}
.subtitle { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(71,54,40,.08);
  padding: 36px;
  width: 100%;
  max-width: 420px;
}
.form-title { font-size: 18px; font-weight: 700; color: var(--brown); margin-bottom: 6px; }
.form-desc { font-size: 13px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  margin-bottom: 16px;
}
input:focus { border-color: var(--brown); }
.btn {
  width: 100%;
  padding: 12px;
  background: var(--brown);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.btn:hover { background: var(--brown-light); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--brown);
  border: 1.5px solid var(--border);
  margin-top: 12px;
}
.btn-secondary:hover { background: var(--bg); }
.msg {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}
.msg.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; display: block; }
.msg.success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; display: block; }
.page-link { display: block; margin-top: 22px; font-size: 13px; color: var(--brown); text-align: center; }
.helper { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 16px; }
@media (max-width: 480px) { .card { padding: 26px 22px; } }

/* Dashboard styling is scoped so the existing Pet Owner login pages stay unchanged. */
.account-page { display: block; min-height: 100dvh; padding: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
.account-page [hidden] { display: none !important; }
.account-page button, .account-page input, .account-page select, .account-page textarea { font: inherit; }
.account-page button { cursor: pointer; }
.account-page button:disabled { cursor: not-allowed; }
.account-page :focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }
.account-topnav { background: var(--brown); color: var(--cream); }
.account-topnav-inner { min-height: 52px; padding: 7px 24px; display: flex; align-items: center; gap: 16px; }
.account-topnav .topnav-brand { color: var(--cream); text-decoration: none; font-size: 16px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; }
.account-topnav .topnav-divider { color: rgba(255,241,223,.3); }
.account-topnav .topnav-section { color: rgba(255,241,223,.8); font-size: 13px; font-weight: 500; white-space: nowrap; }
.account-topnav .topnav-spacer { flex: 1; }
.account-topnav .topnav-name { color: rgba(255,241,223,.85); font-size: 13px; white-space: nowrap; }
.account-topnav .topnav-logout { background: none; border: 1px solid rgba(255,241,223,.35); border-radius: 6px; padding: 5px 14px; color: var(--cream); font-size: 13px; white-space: nowrap; }
.account-topnav .topnav-logout:hover { background: rgba(255,241,223,.1); }
.account-page .account-shell { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.overview-header h1 { color: var(--brown); font-size: 20px; font-weight: 700; line-height: 1.3; }
.overview-header p { color: var(--muted); font-size: 13px; margin: 4px 0 24px; }
.account-notice { display: none; margin-bottom: 20px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.account-notice.error { display: block; color: var(--danger); background: #fef2f2; border: 1px solid #fecaca; }
.account-notice.success { display: block; color: var(--success); background: #f0fdf4; border: 1px solid #bbf7d0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 4px rgba(71,54,40,.06); padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.stat-value { color: var(--brown); font-size: 30px; font-weight: 800; line-height: 1; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pets-section { padding-bottom: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h2, .section-title, .history-header h4 { color: var(--brown); font-size: 15px; font-weight: 700; }
.account-page .btn { width: auto; min-height: 36px; margin: 0; padding: 8px 14px; border-radius: 8px; font-size: 13px; white-space: nowrap; }
.account-page .btn-secondary { background: #f0ebe5; color: var(--brown); border: 1px solid var(--border); }
.account-page .btn-secondary:hover { background: #e9e1d8; }
.pets-layout { display: grid; grid-template-columns: minmax(240px, 290px) minmax(0, 1fr); gap: 16px; align-items: start; }
.pet-sidebar, .pet-detail { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 4px rgba(71,54,40,.06); }
.pet-sidebar { padding: 18px 12px; }
.sidebar-label { margin: 0 8px 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.archived-label { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.pet-list { display: grid; gap: 2px; }
.pet-list-item { display: flex; align-items: center; text-align: left; width: 100%; gap: 10px; border: 1px solid transparent; border-radius: 8px; background: #fff; padding: 10px; color: var(--text); }
.pet-list-item:hover { background: #faf7f4; }
.pet-list-item.is-selected { background: #f0ebe5; border-color: var(--border); }
.pet-list-initial, .pet-monogram { display: grid; place-items: center; flex-shrink: 0; background: #f0ebe5; color: var(--brown); border-radius: 8px; font-weight: 700; }
.pet-list-initial { width: 36px; height: 36px; font-size: 15px; }
.pet-list-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.pet-list-copy strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-list-copy small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-arrow { color: var(--muted); font-size: 13px; }
.sidebar-footnote { margin: 20px 8px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.inline-state { padding: 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.text-button, .subtle-button, .change-pw-link { border: 0; background: none; color: var(--brown); font-size: 12px; padding: 7px 0; text-decoration: underline; }
.text-button:hover, .subtle-button:hover, .change-pw-link:hover { color: var(--brown-light); }
.account-page .text-button:disabled, .account-page .subtle-button:disabled,
.account-page .change-pw-link:disabled { color: var(--muted); opacity: .6; text-decoration: none; }
.pet-detail { padding: 20px 22px 24px; }
.detail-placeholder { min-height: 245px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; max-width: 380px; margin: auto; }
.placeholder-symbol { font-size: 26px; margin-bottom: 12px; }
.detail-placeholder h3 { color: var(--brown); font-size: 15px; font-weight: 700; }
.detail-placeholder p { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 5px; }
.detail-placeholder .text-button { margin-top: 8px; }
.detail-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.status-badge { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 3px 8px; }
.status-badge.archived { background: #f0ebe5; color: var(--muted); border-color: var(--border); }
.pet-profile { display: flex; align-items: center; gap: 14px; padding: 20px 0; }
.pet-monogram { width: 52px; height: 52px; font-size: 24px; }
.profile-copy { flex: 1; min-width: 0; }
.profile-copy h3 { color: var(--brown); font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.profile-copy p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.profile-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#profile-actions[hidden], #restore-actions[hidden], #history-actions[hidden] { display: none; }
.account-page .profile-actions .btn { min-height: 32px; font-size: 12px; }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.fact { min-width: 0; display: grid; gap: 5px; padding: 14px; border-right: 1px solid var(--border); }
.fact:last-child { border-right: 0; }
.fact-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.fact strong { color: var(--text); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.history-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 28px; }
.history-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.history-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 8px 0 16px; }
.timeline { list-style: none; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.timeline-item { border-bottom: 1px solid #f5f0ea; padding: 14px 16px; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item:hover { background: #faf7f4; }
.timeline-rail { display: none; }
.timeline-body { min-width: 0; }
.timeline-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline-tag { color: var(--brown); background: #f0ebe5; border-radius: 10px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.timeline-meta time { color: var(--muted); font-size: 12px; }
.timeline-summary { color: var(--text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; margin-top: 8px; }
.timeline-notes { color: var(--muted); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 5px; }
.timeline-value { display: inline-block; color: var(--brown); font-size: 13px; font-weight: 700; margin-top: 5px; }
.observation-photos-toggle { display: block; margin-top: 10px; }
.timeline-value + .observation-photos-toggle { margin-top: 14px; }
.observation-photo-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fcfaf8; }
.photo-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--brown); font-size: 12px; }
.photo-count { color: var(--muted); font-weight: 500; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 10px; }
.photo-card { min-width: 0; margin: 0; }
.photo-link { display: block; overflow: hidden; border-radius: 7px; background: #f0ebe5; }
.observation-photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-delete { font-size: 11px !important; }
.photo-upload-field { display: grid; gap: 6px; margin-top: 12px; }
.photo-upload-field label { display: grid; gap: 7px; color: var(--brown); font-size: 12px; font-weight: 700; }
.photo-upload-field input { max-width: 100%; color: var(--text); font-size: 12px; }
.photo-upload-field .field-hint { margin: 0; }
.photo-state { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 8px; overflow-wrap: anywhere; }
.photo-error { color: var(--danger); }
.photo-privacy-note { margin: -7px 0 16px; }
.timeline-empty { padding: 28px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.timeline-empty h5 { color: var(--brown); font-size: 14px; margin-bottom: 4px; }
.timeline-empty p { font-size: 12px; line-height: 1.5; }
.load-more { margin-top: 12px !important; }
.skeleton-stack { display: grid; gap: 10px; padding: 8px; }
.skeleton { height: 48px; border-radius: 8px; background: linear-gradient(90deg, #f0ebe5 25%, #faf7f4 50%, #f0ebe5 75%); background-size: 200% 100%; animation: owner-shimmer 1.5s ease-in-out infinite; }
.timeline-skeleton .skeleton { height: 62px; }
@keyframes owner-shimmer { to { background-position: -200% 0; } }
.account-footer { padding: 8px 0 30px; }
.change-pw-link { color: var(--muted); }
.account-dialog { width: min(100% - 32px, 530px); max-height: min(90dvh, 850px); margin: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow-y: auto; }
.account-dialog::backdrop { background: rgba(0,0,0,.4); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.dialog-heading h2 { color: var(--brown); font-size: 16px; font-weight: 700; }
.close-button { border: 0; background: transparent; color: var(--muted); font-size: 25px !important; line-height: 1; padding: 0 3px; }
.dialog-copy { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 10px 0 20px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field { min-width: 0; margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label, .password-panel label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.optional, .field-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.field-hint { line-height: 1.5; margin-top: 5px; }
.age-hint { margin-top: -2px; }
.account-dialog input, .account-dialog select, .account-dialog textarea { display: block; width: 100%; min-height: 42px; margin: 0; padding: 9px 12px; background: #fff; color: var(--text); border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.account-dialog textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.account-dialog input:focus, .account-dialog select:focus, .account-dialog textarea:focus { border-color: var(--brown); }
.account-dialog select:disabled { background: #f0ebe5; color: var(--muted); }
.password-panel input { margin-bottom: 16px; }
.weight-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { padding: 10px 12px; color: var(--danger); background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; font-size: 12px; line-height: 1.5; margin-bottom: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); padding-top: 18px; }
@media (max-width: 800px) {
  .pets-layout { grid-template-columns: 1fr; }
  .pet-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .account-topnav-inner { padding: 8px 14px; gap: 8px; flex-wrap: wrap; }
  .account-topnav .topnav-brand { font-size: 14px; }
  .account-topnav .topnav-section, .account-topnav .topnav-name { font-size: 11px; }
  .account-topnav .topnav-logout { padding: 5px 9px; font-size: 11px; }
  .account-page .account-shell { padding: 24px 14px; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 26px; }
  .pet-list { grid-template-columns: 1fr; }
  .pet-detail { padding: 18px 14px; }
  .pet-profile { flex-wrap: wrap; }
  .profile-actions { flex-basis: 100%; }
  .profile-facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; border-bottom: 1px solid var(--border); }
  .fact:last-child { border-bottom: 0; }
  .history-header { align-items: flex-start; flex-direction: column; }
  .account-dialog { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
/* Pet Owner account controls */
.ac-panel { margin-top: 8px; padding-bottom: 20px; }
.ac-feedback { color: var(--muted); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.ac-block { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; }
.ac-block h3 { color: var(--brown); font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.ac-block p { color: var(--text); font-size: 13px; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.ac-block p:empty { display: none; }
.ac-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
