:root {
  color-scheme: light;
  --ink: #203d2c;
  --muted: #526558;
  --green: #285940;
  --green-dark: #1d4731;
  --paper: #f7f9f3;
  --line: #e0e8dc;
  --pale: #e9f2e1;
  --white: #fff;
  --shadow: 0 8px 24px #203d2c08;
  font-family: ui-rounded, "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .56; }
a, .link { color: var(--green-dark); }
:focus-visible { outline: 3px solid #ad6b30; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.1; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.25rem, 4.6vw, 3.9rem); font-weight: 780; }
h2 { font-size: 1.5rem; }
p { line-height: 1.55; overflow-wrap: anywhere; }
small { font-size: .84rem; }
.muted { color: var(--muted); }
.icon { width: 1.35em; height: 1.35em; flex: none; vertical-align: middle; }
.kicker { display: inline-flex; align-items: center; gap: .55rem; color: #47644d; text-transform: uppercase; font-size: .73rem; font-weight: 800; letter-spacing: .14em; line-height: 1.55; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: #d78d3b; flex: none; }
.brand { display: flex; align-items: center; gap: .73rem; }
.brand img { border-radius: 12px; flex: none; }
.brand strong { display: block; font-size: 1.55rem; line-height: 1; letter-spacing: -.07em; font-weight: 850; }
.brand-dot { color: #a35f2a; }
.brand small { display: block; margin-top: .28rem; font-size: .59rem; font-weight: 800; letter-spacing: .2em; color: var(--muted); }
.button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid transparent; border-radius: .72rem; padding: .64rem .88rem;
  font-weight: 740; font-size: .88rem; min-height: 41px; text-align: center; line-height: 1.24;
}
.primary { color: white; background: var(--green); }
.primary:hover { background: var(--green-dark); }
.secondary { background: #f1f6ee; color: var(--green-dark); border-color: #e0eadd; }
.secondary:hover { background: #e1efd9; }
.link { background: transparent; text-decoration: underline; text-underline-offset: .18em; padding-inline: .4rem; }
.link:hover, .icon-button:hover { background: #e9f2e1; }
.danger { background: #fff0e9; color: #8f3623; justify-self: start; }
.danger:hover { background: #ffe1d3; }
.icon-button { background: transparent; color: var(--green); width: 41px; padding: 0; flex: none; }
.actions, .pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.stack { display: grid; gap: .9rem; }
label { display: grid; gap: .34rem; color: var(--ink); font-weight: 720; font-size: .9rem; }
input, select, textarea {
  padding: .64rem .72rem; min-height: 42px; border: 1px solid #cbd9c9; border-radius: .6rem;
  background: var(--white); color: var(--ink); width: 100%; min-width: 0;
}
input:disabled, select:disabled { background: #f2f6ee; }
input[type="checkbox"] { width: 1.15rem; min-height: auto; height: 1.15rem; accent-color: var(--green); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: .55rem; }
.fields-two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; }
.form-error { background: #fff0eb; color: #852c1b; padding: .64rem .75rem; border-radius: .55rem; }
.field-hint { color: var(--muted); font-size: .88rem; }
.loading { padding: 2rem; text-align: center; }
.startup-error { max-width: 35rem; margin: 4rem auto; }
.mini-icon { width: 2.55rem; height: 2.55rem; display: inline-grid; place-items: center; flex: none; border-radius: .82rem; color: var(--green); background: #edf3e8; font-size: 1.07rem; }
.green { background: #e9f3e1; color: #305d3c; }
.yellow { background: #fdf0c9; color: #765522; }
.peach { background: #fbe9df; color: #804a34; }

.auth-layout { min-height: 100svh; display: grid; grid-template-columns: minmax(0,1.14fr) minmax(0,1fr); }
.auth-story { padding: clamp(1.6rem, 5.5vw, 5.5rem); background: radial-gradient(ellipse at 80% 23%, #f1f7db, transparent 49%), #e4f0d8; display: flex; flex-direction: column; justify-content: center; gap: clamp(1.3rem, 3.7vh, 3rem); }
.auth-copy h1 { font-size: clamp(2.7rem, 5.9vw, 5.7rem); line-height: .98; margin: .7rem 0 .95rem; }
.auth-copy h1 span { color: #a35f2a; }
.auth-copy p { font-size: 1.09rem; max-width: 28rem; color: #3f5a45; }
.auth-illustration { width: min(100%, 440px); height: auto; align-self: center; }
.auth-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-pills span { display: inline-flex; align-items: center; gap: .35rem; background: #f5f9ec; padding: .45rem .7rem; border-radius: 2rem; font-size: .83rem; font-weight: 740; }
.auth-side { display: grid; align-items: center; justify-items: center; padding: clamp(1.3rem, 4.5vw, 4.3rem); }
.auth-card { background: white; border: 1px solid var(--line); border-radius: 1.6rem; box-shadow: var(--shadow); padding: clamp(1.35rem, 3.5vw, 2.55rem); width: min(100%, 31rem); }
.auth-card h2 { font-size: clamp(1.9rem, 3.3vw, 2.55rem); margin: .8rem 0 .5rem; }
.auth-card form { margin-top: 1.2rem; }
.auth-card form .primary { justify-content: space-between; padding-inline: 1rem; }
.auth-switch { margin-top: .75rem; font-size: .89rem; color: var(--muted); }

.app-shell { display: grid; grid-template-columns: 224px minmax(0,1fr); min-height: 100svh; }
.sidebar {
  position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 1.65rem;
  background: white; border-right: 1px solid var(--line); padding: 1.6rem .9rem 1rem; overflow-y: auto;
}
.sidebar .brand { margin: 0 .5rem; }
.family-label { display: grid; gap: .3rem; padding: .75rem .8rem; border-radius: .8rem; background: #f4f7ee; overflow-wrap: anywhere; }
.family-label span { color: var(--muted); font-size: .67rem; letter-spacing: .13em; font-weight: 800; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav button { display: flex; gap: .65rem; align-items: center; min-height: 45px; width: 100%; padding: .6rem .7rem; border-radius: .65rem; border: 0; background: transparent; color: #425c49; text-align: left; font-weight: 700; font-size: .9rem; }
.sidebar nav button:hover { background: #f2f6ee; }
.sidebar nav button[aria-current] { background: #e7f0de; color: #234b33; }
.account { margin-top: auto; display: flex; gap: .55rem; align-items: center; padding-top: .85rem; border-top: 1px solid var(--line); }
.account div { min-width: 0; }
.account strong, .account small { display: block; overflow-wrap: anywhere; }
.account small { color: var(--muted); font-size: .74rem; }
.account .icon-button { margin-left: auto; }
.initial { display: inline-grid; place-items: center; min-width: 2.1rem; min-height: 2.1rem; padding: .2rem; background: #f9e8cd; color: #7b4d24; border-radius: 50%; font-weight: 800; }
.main { padding: clamp(1.05rem, 3vw, 2.6rem); width: 100%; max-width: 1440px; margin: 0 auto; }
.welcome { position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(200px,.69fr); align-items: center; gap: .5rem; background: linear-gradient(117deg,#e5f0dc 37%,#f0f5d9); border: 1px solid #dae8d3; border-radius: 1.35rem; padding: clamp(1.3rem, 3.6vw, 2.8rem); overflow: hidden; min-height: 218px; }
.welcome h1 { margin: .42rem 0 .55rem; }
.welcome p { max-width: 28rem; color: #3f5a45; }
.welcome .button { margin-top: 1rem; }
.welcome-art { width: min(100%, 365px); height: auto; justify-self: end; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; margin: 1rem 0; }
.stats article { display: flex; align-items: center; gap: .65rem; background: white; border: 1px solid var(--line); border-radius: .95rem; padding: clamp(.7rem, 2vw, 1.03rem); }
.stats strong { display: block; font-size: 1.5rem; line-height: 1.05; }
.stats article div span { display: block; color: var(--muted); margin-top: .25rem; font-size: .83rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(255px,1fr); align-items: start; gap: 1rem; }
.dashboard-aside { display: grid; gap: 1rem; }
.panel { background: white; border: 1px solid var(--line); border-radius: 1.08rem; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem; }
.panel-head h2 { margin-top: .18rem; }
.panel-head select { width: auto; max-width: 100%; }
.empty { display: grid; justify-items: center; gap: .52rem; padding: 1.55rem 1.2rem 2rem; text-align: center; }
.empty p { color: var(--muted); max-width: 22rem; font-size: .89rem; }
.empty .button { margin-top: .25rem; }
.pet-list { padding: 0 .75rem .75rem; }
.pet-row { display: flex; width: 100%; align-items: center; gap: .65rem; background: transparent; border: 0; padding: .58rem .44rem; text-align: left; border-radius: .65rem; color: var(--ink); }
.pet-row:hover { background: #f0f6ed; }
.pet-row > span:nth-child(2) { flex: 1; overflow-wrap: anywhere; }
.pet-row strong, .pet-row small { display: block; }
.pet-row small, .list-row small, .routine-row small { color: var(--muted); }
.animal-avatar { display: inline-grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: .85rem; background: #edf3dc; font-size: 1.6rem; flex: none; }
.animal-avatar.peach { background: #fce9de; }
.progress-card { border-radius: 1rem; padding: 1.05rem 1.2rem; background: #fbf0d0; border: 1px solid #f1e4bc; }
.progress-card .kicker { color: #6f552a; }
.progress-card h2 { margin: .28rem 0 .55rem; font-size: 1.28rem; }
.progress-card p { font-size: .89rem; color: #5f512f; }
progress { width: 100%; height: .5rem; accent-color: var(--green); border: 0; border-radius: 1rem; overflow: hidden; background: #e8dbb7; }
progress::-webkit-progress-bar { background: #e8dbb7; }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.timeline, .list { padding: 0 1.15rem .55rem; }
.routine-row, .list-row { display: flex; align-items: center; gap: .65rem; min-width: 0; border-top: 1px solid var(--line); padding: .8rem 0; }
.routine-row time { font-size: .91rem; font-weight: 800; color: var(--green); min-width: 3rem; font-variant-numeric: tabular-nums; }
.routine-copy, .list-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.routine-copy span, .routine-copy small, .list-row small { display: block; margin-top: .15rem; }
.routine-copy > span { color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; gap: .28rem; padding: .35rem .53rem; border-radius: 2rem; font-size: .78rem; font-weight: 780; color: #2d603f; background: #eaf5e2; white-space: nowrap; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin: .2rem 0 1.3rem; }
.section-head h1 { margin: .36rem 0 .45rem; }
.section-head p { color: var(--muted); }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr)); gap: 1rem; }
.pet-card, .pet-summary, .push-card { padding: 1.25rem; }
.pet-card h2 { margin: .75rem 0 .32rem; }
.pet-card .notes, .push-card p { margin: .7rem 0; }
.notes { white-space: pre-wrap; color: var(--muted); margin-top: .3rem; font-size: .9rem; }
.pet-summary, .push-card { display: flex; align-items: start; gap: .85rem; }
.pet-summary { margin-bottom: 1rem; }
.pagination { padding: 0 1.1rem 1rem; }
.invite-alert { margin-bottom: .8rem; border-radius: .7rem; background: #fff1d3; padding: .2rem .75rem; }

dialog { width: min(92vw, 34rem); max-height: 88svh; border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.25rem; color: var(--ink); box-shadow: 0 18px 75px #142d2570; }
dialog::backdrop { background: #203a2db0; }
dialog header { display: flex; align-items: center; gap: .75rem; justify-content: space-between; margin-bottom: .7rem; }
dialog > p, dialog > label { margin-bottom: .7rem; }
#toast { position: fixed; z-index: 5; inset: auto 1rem 1rem auto; background: #224a34; color: white; padding: .78rem 1rem; border-radius: .75rem; max-width: min(33rem,calc(100% - 2rem)); box-shadow: 0 8px 30px #1a322b44; }

@media (max-width: 1030px) {
  .app-shell { grid-template-columns: 184px minmax(0,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-aside { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
}
@media (max-width: 720px) {
  .app-shell, .auth-layout { display: block; }
  .auth-story { padding: 1.3rem; gap: .85rem; }
  .auth-story h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); }
  .auth-illustration { width: 230px; max-width: 65%; margin-top: -.75rem; }
  .auth-pills { display: none; }
  .auth-side { padding: 1rem 1rem 1.7rem; }
  .sidebar { position: relative; height: auto; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .55rem; padding: .65rem; border: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0; }
  .family-label { display: none; }
  .account { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; }
  .account > div { display: none; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; gap: .18rem; overflow-x: auto; padding: .18rem; }
  .sidebar nav button { flex: 1 0 auto; width: auto; min-height: 44px; padding: .45rem; font-size: .78rem; justify-content: center; }
  .main { padding: .85rem; }
  .welcome { min-height: 0; grid-template-columns: minmax(0,1fr) minmax(90px,.4fr); padding: 1rem; }
  .welcome h1 { font-size: clamp(1.9rem, 8vw, 3rem); }
  .welcome p { font-size: .87rem; }
}
@media (max-width: 440px) {
  .sidebar nav button { flex-direction: column; gap: .22rem; padding: .3rem; font-size: .69rem; }
  .stats { gap: .35rem; }
  .stats article { align-items: start; flex-direction: column; padding: .65rem; gap: .45rem; }
  .stats .mini-icon { width: 1.9rem; height: 1.9rem; font-size: .9rem; }
  .stats article div span { font-size: .76rem; }
  .dashboard-aside { grid-template-columns: 1fr; }
  .routine-row { display: grid; grid-template-columns: 3rem minmax(0,1fr) auto; gap: .45rem; }
  .routine-row .mini-icon { display: none; }
  .routine-row time { min-width: 0; }
  .routine-row .button { padding-inline: .49rem; }
  .welcome-art { align-self: end; }
}
.routine-actions { display: grid; justify-items: end; gap: .15rem; }
.routine-actions .link { min-height: 32px; }
@media (max-width: 440px) {
  .routine-actions .button { max-width: 6.3rem; }
}
.brand strong { font-size: 1.34rem; letter-spacing: -.055em; }
@media (min-width: 721px) and (max-width: 1030px) {
  .sidebar .brand strong { font-size: 1.05rem; }
  .sidebar .brand img { width: 34px; height: 34px; }
  .sidebar .brand { gap: .45rem; }
}

.pet-photo { object-fit: cover; }
.pet-card .animal-avatar, .pet-summary .animal-avatar { width: 4.5rem; height: 4.5rem; font-size: 2rem; }
.archived-pets { margin-top: 1.25rem; }
.archived-pets h2 { margin-bottom: .75rem; }
.account-profile { min-width: 0; display: flex; align-items: center; text-align: left; gap: .55rem;
  border: 0; border-radius: .65rem; background: transparent; color: var(--ink); padding: .25rem; }
.account-profile:hover { background: var(--pale); }
.account-profile > span:nth-child(2) { min-width: 0; }
.profile-password { margin-top: .7rem; }
.preference-card { margin-top: 1rem; padding: 1.25rem; max-width: 38rem; }
.preference-card h2 { margin-bottom: .85rem; }
.preference-types, .routine-fields { display: grid; gap: .62rem; border: 1px solid var(--line); border-radius: .8rem; min-width: 0; margin: 0; padding: .7rem .85rem .85rem; }
.preference-types legend, .routine-fields legend { font-weight: 750; padding: 0 .28rem; }
.routine-fields .link { justify-self: start; }
.planned-group, .catalog-group { margin: .35rem 0 .85rem; }
.planned-group h3, .catalog-group h3 { font-size: 1.02rem; margin: 0 0 .45rem; }
.catalog-actions { flex: 0 0 auto !important; display: grid; justify-items: end; }
.catalog-actions .link { min-height: 30px; }
@media (max-width: 720px) {
  .account-profile > span:nth-child(2) strong { display: none; }
  .account-profile > span:nth-child(2) small { font-size: .68rem; max-width: 3.2rem; }
}
