/* PAWFIZ — design system */
:root {
  --bg: #FFF4EA;
  --surface: #FFFBF7;
  --surface-2: #FBEDE1;
  --ink: #1D1712;
  --ink-2: #5C4F46;
  --muted: #7C6B5F;
  --line: #F3E2D4;
  --brand: #E8650F;
  --brand-ink: #B14A05;
  --brand-soft: #FDE6D3;
  --logo: #1D1712;
  --dot: #F2801F;
  --danger: #CF3A2C;
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --shadow-1: 0 1px 2px rgba(120, 66, 24, .04), 0 8px 24px rgba(160, 92, 40, .07);
  --shadow-2: 0 2px 6px rgba(120, 66, 24, .06), 0 16px 38px rgba(160, 92, 40, .13);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --nav-h: 88px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.i { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
#view { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 28px); }
.screen { max-width: 760px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 18px 0; animation: enter .38s var(--ease) both; }
.screen.flush { padding-top: 0; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.no-nav #view { padding-bottom: 32px; }
.no-nav .nav { display: none; }

.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 6px; }
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar.big h1 { font-size: 28px; letter-spacing: -.02em; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background .2s, transform .15s; position: relative; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .badge-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 15px; flex: none; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }

.logo { font-weight: 800; font-size: 27px; letter-spacing: -.045em; color: var(--logo); line-height: 1; display: inline-flex; align-items: baseline; }
.logo b { color: var(--dot); }
.logo.xl { font-size: 54px; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line); display: flex; justify-content: center;
}
.nav-in { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 560px; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); transition: color .2s; }
.nav a .i { width: 24px; height: 24px; transition: transform .25s var(--ease); }
.nav a.on { color: var(--brand); }
.nav a.on .i { transform: translateY(-1px) scale(1.06); }

/* ---------- Type & sections ---------- */
.hello h1 { font-size: clamp(23px, 6.6vw, 30px); font-weight: 700; letter-spacing: -.02em; }
.hello p { color: var(--ink-2); margin-top: 2px; }
.sec { margin-top: 26px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.sec-h h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sec-h a, .link { color: var(--brand); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.sec-h a .i { width: 16px; height: 16px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px;
  border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; font-size: 15px;
  transition: transform .15s, background .2s, box-shadow .2s; box-shadow: 0 6px 16px rgba(29, 23, 18, .18);
}
.btn:hover { background: var(--brand-ink); }
.btn:active { transform: scale(.97); }
.btn .i { width: 20px; height: 20px; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: #E8ECE9; }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: none; }
.btn.outline { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.row-btns { display: flex; gap: 10px; margin-top: 18px; }
.row-btns .btn { flex: 1; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: 16px; }
.press { transition: transform .18s var(--ease), box-shadow .2s; }
.press:active { transform: scale(.98); }
@media (hover: hover) { .press:hover { box-shadow: var(--shadow-2); } }

.tile { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.tile .i { width: 22px; height: 22px; }
.tile.sm { width: 38px; height: 38px; border-radius: 12px; }
.tile.sm .i { width: 19px; height: 19px; }
.tile.lg { width: 58px; height: 58px; border-radius: 18px; }
.tile.lg .i { width: 27px; height: 27px; }
.t-teal { background: #E4F3EE; color: #2C8C72; } .t-blue { background: #E7F0FB; color: #3478D4; }
.t-coral { background: #FDECEA; color: #E0564B; } .t-amber { background: #FDF3E1; color: #D2861A; }
.t-violet { background: #F0EDFB; color: #7A5FD0; } .t-green { background: #E6F5EA; color: #3A9A58; }
.t-red { background: #FDE7E6; color: #D63B33; } .t-gray { background: #EFF1F2; color: #66737A; }

/* pet cards */
.pets-row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 4px 18px 10px; scrollbar-width: none; }
.pets-row::-webkit-scrollbar { display: none; }
.pet-card { scroll-snap-align: start; flex: 0 0 min(64%, 250px); overflow: hidden; display: block; }
.pet-card .photo { aspect-ratio: 4 / 3.3; position: relative; overflow: hidden; background: var(--surface-2); }
.pet-card .photo img, .pet-card .photo .ph { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
@media (hover: hover) { .pet-card:hover .photo img { transform: scale(1.04); } }
.pet-card .body { padding: 12px 14px 14px; }
.pet-card h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.pet-card .meta { color: var(--muted); font-size: 14px; }
.pet-card.gone .photo img { filter: grayscale(.55) brightness(1.04); }
.pets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.pets-grid .pet-card { flex: none; }
.ph { display: grid; place-items: center; background: linear-gradient(135deg, #E9F3F0, #EEF3FA); color: #9DB8B0; }
.ph .i { width: 40%; height: 40%; max-width: 64px; max-height: 64px; stroke-width: 1.2; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.pill .i { width: 15px; height: 15px; }
.pill.green { background: #E6F5EA; color: #2E8A4C; } .pill.amber { background: #FDF3E1; color: #B8730F; }
.pill.red { background: #FDE7E6; color: #C7352E; } .pill.muted { background: #F0EDFB; color: #6C55B8; }
.pill.blue { background: #E7F0FB; color: #2F6BBE; } .pill.gray { background: #EFF1F2; color: #5D6A71; }
.pill.plain { margin-top: 0; padding: 4px 10px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; align-items: center; gap: 10px; padding: 12px; }
.stat b { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--ink-2); }
.stat .tile { width: 40px; height: 40px; border-radius: 12px; }
@media (max-width: 420px) { .stat { gap: 8px; padding: 11px 10px; } .stat .tile { width: 34px; height: 34px; border-radius: 11px; } .stat .tile .i { width: 18px; height: 18px; } .stat span { font-size: 11.5px; } .stat b { font-size: 20px; } }
@media (max-width: 370px) { .stat { flex-direction: column; align-items: flex-start; gap: 6px; } }

/* list rows */
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 13px; padding: 12px 14px; width: 100%; text-align: left; }
.row .txt { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { color: var(--muted); font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s.wrap { white-space: normal; }
.row .chev { color: #B3BDC1; width: 18px; height: 18px; }
.row .end { text-align: right; font-size: 13px; color: var(--muted); flex: none; }
.row .end.red { color: var(--danger); font-weight: 600; }
.row .end.brand { color: var(--brand); font-weight: 600; }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #C9D3D0; display: grid; place-items: center; flex: none; transition: all .2s var(--ease); color: transparent; }
.check .i { width: 16px; height: 16px; stroke-width: 3; }
.check:hover { border-color: var(--brand); }
.check.on { background: var(--brand); border-color: var(--brand); color: #fff; animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.18); } }

/* ---------- Pet profile ---------- */
.hero { position: relative; margin: 0 -18px; }
.hero .photo { aspect-ratio: 16 / 12; max-height: 52vh; width: 100%; overflow: hidden; background: var(--surface-2); }
.hero .photo img, .hero .photo .ph { width: 100%; height: 100%; object-fit: cover; }
.hero.gone .photo img { filter: grayscale(.5); }
.hero .bar { position: absolute; top: calc(var(--safe-t) + 10px); left: 12px; right: 12px; display: flex; justify-content: space-between; }
.glass { background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.hero .cam { position: absolute; right: 14px; bottom: 44px; color: #fff; background: var(--brand); box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
.pet-head { position: relative; margin: -30px -18px 0; background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 20px 18px 0; }
.pet-head .name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pet-head h1 { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.pet-head .meta { color: var(--ink-2); margin-top: 4px; }
.status-btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 10px 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: #E6F5EA; color: #2E8A4C; flex: none; }
.status-btn.gone { background: #F0EDFB; color: #6C55B8; }
.status-btn .i { width: 16px; height: 16px; }

.tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 14px -18px 0; padding: 8px 18px; background: rgba(247, 248, 246, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 9px; border-radius: 999px; font-weight: 600; font-size: 13.5px; flex: 1 0 auto; text-align: center; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; position: relative; }
.tabs a.on { background: var(--brand-soft); color: var(--brand-ink); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fact { padding: 12px; }
.fact span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.fact b { display: block; font-size: 15px; font-weight: 650; margin-top: 2px; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 550; overflow-wrap: anywhere; }
.note { background: #FFF9EE; border-radius: var(--r-md); padding: 14px 16px; color: #6E5525; font-size: 14.5px; display: flex; gap: 10px; }
.note .i { color: #D2861A; width: 20px; height: 20px; margin-top: 1px; }
.note.memorial { background: #F4F1FC; color: #5A4A93; }
.note.memorial .i { color: #7A5FD0; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button, .quick a { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); text-align: center; padding: 6px 2px; border-radius: var(--r-md); transition: background .2s; }
.quick button:hover, .quick a:hover { background: var(--surface-2); }
.quick .tile { width: 54px; height: 54px; border-radius: 50%; }

/* health history (vertical line) */
.hist { position: relative; display: flex; flex-direction: column; }
.hist-i { display: grid; grid-template-columns: 58px 1fr; gap: 8px; position: relative; }
.hist-i .when { font-size: 12.5px; color: var(--muted); padding-top: 16px; line-height: 1.25; position: relative; padding-left: 16px; }
.hist-i .when::before { content: ""; position: absolute; left: 2px; top: 20px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hist-i::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 1.5px; background: var(--line); }
.hist-i:first-child::before { top: 22px; }
.hist-i:last-child::before { bottom: calc(100% - 22px); }
.hist-i > * { min-width: 0; }
.hist-i .row { margin: 5px 0; }

/* timeline */
.tl-month { font-size: 13px; font-weight: 700; color: var(--brand-ink); text-transform: uppercase; letter-spacing: .07em; margin: 22px 0 10px 40px; }
.tl-month:first-child { margin-top: 6px; }
.tl-year { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); margin: 26px 0 4px; }
.tl { position: relative; }
.tl::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--brand-soft), #F7D5BC 20%, #F7D5BC 80%, var(--brand-soft)); border-radius: 2px; }
.tl-i { position: relative; padding-left: 40px; margin-bottom: 12px; animation: enter .45s var(--ease) both; }
.tl-i .node { position: absolute; left: 4px; top: 14px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--bg); }
.tl-i .node .i { width: 13px; height: 13px; stroke-width: 2.3; }
.tl-card { display: block; padding: 13px 44px 13px 15px; }
.tl-hide { position: absolute; right: 6px; top: 6px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: none; padding: 0; color: var(--muted); }
.tl-hide .i, .tl-hide svg { width: 16px; height: 16px; }
.tl-hide:active { background: rgba(0,0,0,.06); }
.tl-card .d { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tl-card h3 { font-size: 15.5px; font-weight: 650; margin-top: 1px; }
.tl-card p { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-card.upcoming { background: transparent; box-shadow: inset 0 0 0 1.5px dashed var(--line); border: 1.5px dashed #CFDAD6; }
.tl-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; margin-top: 10px; }
.tl-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.tl-photos.one { grid-template-columns: 1fr; }
.tl-photos.one img { aspect-ratio: 16 / 10; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); transition: all .2s; }
.chip.on { background: var(--brand); color: #fff; box-shadow: none; }
.chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin-left: -6px; }

/* search */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; padding: 0 16px; box-shadow: inset 0 0 0 1px var(--line); }
.search .i { color: var(--muted); width: 19px; height: 19px; }
.search input { flex: 1; border: 0; background: transparent; height: 46px; font: inherit; outline: 0; color: var(--ink); min-width: 0; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.mem-card { overflow: hidden; display: block; position: relative; }
.mem-card .photo { aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface-2); }
.mem-card:nth-child(4n+1) .photo, .mem-card:nth-child(4n+4) .photo { aspect-ratio: 1; }
.mem-card .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
@media (hover: hover) { .mem-card:hover .photo img { transform: scale(1.04); } }
.mem-card .cap { padding: 10px 12px 12px; }
.mem-card .cap b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.mem-card .cap span { font-size: 12.5px; color: var(--muted); }
.mem-card .count { position: absolute; top: 10px; right: 10px; background: rgba(27, 42, 51, .55); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; display: flex; gap: 4px; align-items: center; backdrop-filter: blur(6px); }
.mem-card .count .i { width: 13px; height: 13px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r-md); overflow: hidden; }
.photo-grid button { aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.photo-grid button:hover img { transform: scale(1.05); }
.photo-grid .add { display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); }

.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel button { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 4.2; max-height: 62vh; }
.carousel img { width: 100%; height: 100%; object-fit: cover; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #CFD8D5; transition: all .25s; }
.dots i.on { background: var(--brand); width: 18px; border-radius: 3px; }

/* documents */
.doc-ico { width: 52px; height: 58px; border-radius: 14px; display: grid; place-items: center; flex: none; position: relative; }
.doc-ico .i { width: 25px; height: 25px; }
.doc-ico small { position: absolute; bottom: 6px; font-size: 8.5px; font-weight: 800; letter-spacing: .04em; }
.doc-view { background: #fff; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); padding: 22px 20px; font-size: 14px; }
.doc-view .hd { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.doc-frame { width: 100%; height: 60vh; border: 0; border-radius: var(--r-md); background: var(--surface-2); }

/* weight chart */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ln { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.4s var(--ease) .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .ar { fill: url(#wg); opacity: 0; animation: fade .8s .5s forwards; }
@keyframes fade { to { opacity: 1; } }
.chart .pt { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.chart .lb { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.big-num { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: #B8730F; } .delta.down { color: #2E8A4C; }

/* ---------- Sheets ---------- */
#layer { position: relative; z-index: 100; }
.sheet-wrap { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(20, 32, 38, .38); opacity: 0; transition: opacity .28s; }
.sheet {
  position: relative; width: 100%; max-width: 620px; max-height: 92dvh; background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .34s var(--ease); padding-bottom: var(--safe-b);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .12);
}
.sheet-wrap.in .backdrop { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; }
.sheet-wrap.out .backdrop { opacity: 0; }
.sheet-wrap.out .sheet { transform: translateY(100%); }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: var(--r-xl); max-height: 88dvh; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .3s var(--ease), opacity .25s; }
  .sheet-wrap.in .sheet { opacity: 1; }
  .sheet-wrap.out .sheet { transform: translateY(24px) scale(.98); opacity: 0; }
  .grab { display: none; }
}
.grab { width: 40px; height: 5px; border-radius: 3px; background: #DDE3E0; margin: 9px auto 0; flex: none; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 4px 22px; flex: none; }
.sheet-h h2 { font-size: 19px; font-weight: 700; }
.sheet-b { padding: 8px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-sm .sheet-b { padding-top: 14px; }
.menu { display: flex; flex-direction: column; }
.menu-i { display: flex; align-items: center; gap: 14px; padding: 14px 6px; font-weight: 600; font-size: 15.5px; border-radius: 12px; }
.menu-i:hover { background: var(--surface-2); }
.menu-i .i { color: var(--ink-2); }
.menu-i.danger, .menu-i.danger .i { color: var(--danger); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; font-weight: 600; text-align: center; transition: transform .15s, background .2s; line-height: 1.2; }
.action:hover { background: #EBEFEC; }
.action:active { transform: scale(.96); }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.form .full { grid-column: 1 / -1; }
.form h3 { grid-column: 1 / -1; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field label b { color: var(--danger); }
.field small { font-size: 12.5px; color: var(--muted); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent;
  border-radius: var(--r-sm); padding: 12px 14px; min-height: 48px; outline: 0; transition: border-color .2s, background .2s; -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238A969C' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field textarea { resize: vertical; min-height: 84px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14.5px; }
.toggle small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { width: 46px; height: 28px; border-radius: 999px; background: #CFD8D5; position: relative; transition: background .2s; flex: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .22s var(--ease); }
.toggle input:checked + i { background: var(--brand); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.reveal { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.reveal[hidden] { display: none; }
.upload { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.upload label.drop { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm); border: 1.5px dashed #C6D3CE; color: var(--brand-ink); font-weight: 600; font-size: 14.5px; cursor: pointer; flex: 1; min-width: 150px; justify-content: center; }
.upload label.drop:hover { background: var(--brand-soft); }
.upload input { display: none; }
.thumbs { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumbs .th { position: relative; width: 70px; height: 70px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; text-align: center; padding: 4px; color: var(--ink-2); }
.thumbs .th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumbs .th button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; z-index: 1; }
.thumbs .th button .i { width: 13px; height: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick-in { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px transparent; font-weight: 600; font-size: 14.5px; line-height: 1; color: var(--ink-2); transition: background .2s, box-shadow .2s, color .2s; }
.pick-in:not(:has(.pick-ph)) { padding-left: 14px; }
.pick-ph { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.pick-ph.ph { display: grid; place-items: center; }
.pick-ph.ph .i { width: 18px; height: 18px; }
.pick-ok { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: transparent; box-shadow: inset 0 0 0 1.5px #C9D3D0; flex: none; transition: all .2s; }
.pick-ok .i { width: 13px; height: 13px; stroke-width: 3; }
.pick input:checked + .pick-in { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1.5px var(--brand); }
.pick input:checked + .pick-in .pick-ok { background: var(--brand); color: #fff; box-shadow: none; }
.pick input:focus-visible + .pick-in { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.pick:active .pick-in { transform: scale(.97); }
.err { color: var(--danger); font-size: 14px; font-weight: 500; min-height: 0; grid-column: 1 / -1; }
.form-foot { grid-column: 1 / -1; margin-top: 8px; position: sticky; bottom: -22px; background: linear-gradient(transparent, #fff 30%); padding: 14px 0 4px; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.auth-hero { position: relative; padding: calc(var(--safe-t) + 54px) 26px 64px; text-align: center; background: linear-gradient(180deg, #FBD9BE 0%, #FEEBDC 65%, #FFF4EA 100%); overflow: hidden; }
.auth-hero .paws { position: absolute; inset: 0; pointer-events: none; color: #F6C7A2; }
.auth-hero .paws .i { position: absolute; width: 34px; height: 34px; stroke-width: 1.4; animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(6deg); } }
.auth-hero p { color: var(--ink-2); margin-top: 10px; font-size: 17px; }
.auth-hero p.en { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.auth-body { flex: 1; width: 100%; max-width: 440px; margin: -26px auto 0; padding: 0 22px 32px; position: relative; }
.auth-card { background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: 24px 20px; }
.auth-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-card .form { margin-top: 18px; }
.demo { margin-top: 22px; text-align: center; }
.demo p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.demo .who { display: flex; gap: 10px; justify-content: center; }
.demo .who button { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 14px; }
.demo .who .avatar { width: 32px; height: 32px; font-size: 13px; }
.alt { text-align: center; margin-top: 18px; color: var(--ink-2); font-size: 14.5px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; grid-column: 1 / -1; }
.seg button { padding: 9px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Toast / lightbox / misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 90px); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 18px; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; width: max-content; line-height: 1.35; transition: all .3s var(--ease); z-index: 200; box-shadow: var(--shadow-2); max-width: calc(100% - 32px); }
.toast .i { width: 18px; height: 18px; color: #F9B98A; }
.toast.err .i { color: #FF9C93; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.lightbox { position: fixed; inset: 0; background: #0D1418; z-index: 150; display: flex; flex-direction: column; animation: fade .25s forwards; opacity: 0; }
.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-t) + 8px) 10px 8px 18px; color: #fff; font-size: 14px; }
.lightbox .icon-btn { color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.lightbox .lb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox .lb-track::-webkit-scrollbar { display: none; }
.lightbox .lb-track div { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; padding: 10px; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 6px; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .tile { margin: 0 auto 12px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: linear-gradient(120deg, #FDE9DA, #FFF3E8); font-size: 14px; color: var(--ink-2); }
.banner .i { color: var(--logo); }
.banner b { color: var(--ink); }
.code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 30px; font-weight: 700; letter-spacing: .2em; text-align: center; padding: 18px; background: var(--brand-soft); border-radius: var(--r-md); color: var(--brand-ink); }
.split { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .split.two { grid-template-columns: 1fr 1fr; align-items: start; }
  .facts { grid-template-columns: repeat(3, 1fr); }
}
.mt { margin-top: 14px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 26px; }
.center { text-align: center; }
.space-use { margin: 22px 4px 0; display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.space-bar { height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.space-bar i { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--muted) 55%, transparent); }
.foot-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 30px 0 4px; }
.foot-note .logo { font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .chart .ln { stroke-dashoffset: 0; } .chart .ar { opacity: 1; }
}

/* ---------- PAWFIZ v0.3: purchase, transfer ---------- */
.price-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; background: var(--brand-soft); border-radius: var(--r-sm); font-size: 13px; color: var(--brand-ink); line-height: 1.4; }
.price-note .i { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.buy { text-align: center; padding: 18px 12px 20px; border-radius: var(--r-lg); background: linear-gradient(160deg, #FDEADB, #FFF6EE); }
.buy .price { margin-top: 10px; }
.buy .price b { display: block; font-size: 44px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.05; }
.buy .price span { font-size: 14px; color: var(--ink-2); }
/* Subscription screen (store apps) */
.auth-body:has(.sub-card) { margin-top: 0; padding-top: calc(var(--safe-t) + 28px); }
.sub-card { text-align: center; padding: 30px 22px 24px; background: linear-gradient(170deg, #FDEADB 0%, #FFF6EE 38%, #fff 70%); }
.sub-card h2 { margin-top: 14px; font-size: 24px; }
.sub-card > .muted { max-width: 32ch; margin: 6px auto 0; }
.sub-price { margin-top: 20px; }
.sub-price b { display: block; font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: var(--ink); }
.sub-price span { font-size: 14px; color: var(--ink-2); }
.sub-trial { margin-top: 10px; display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 13.5px; }
.sub-trial:empty { display: none; }
.sub-card .perks { text-align: left; }
.sub-card .err { margin-top: 14px; }
.sub-fine { margin-top: 12px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.sub-links, .alt:has([data-delete-account]) { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sub-links .link { font-size: 13px; }
.perks { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 550; }
.perks.left { text-align: left; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.trf-banner { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; margin-top: 18px; background: linear-gradient(120deg, #E8650F, #F4924A); color: #fff; border-radius: var(--r-lg); box-shadow: 0 10px 26px rgba(37, 99, 201, .28); }
.trf-banner img { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; flex: none; border: 2px solid rgba(255,255,255,.5); }
.trf-banner .txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.trf-banner .txt b { display: block; font-size: 15.5px; }
.trf-banner .go { background: #fff; color: var(--brand-ink); font-weight: 700; font-size: 13.5px; padding: 9px 14px; border-radius: 999px; flex: none; }
.trf-hero { position: relative; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 4 / 3.4; background: var(--surface-2); }
.trf-hero img { width: 100%; height: 100%; object-fit: cover; }
.trf-hero .tag { position: absolute; left: 14px; top: 14px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); color: var(--brand-ink); font-weight: 700; font-size: 12.5px; padding: 6px 12px 6px 9px; border-radius: 999px; display: flex; gap: 6px; align-items: center; }
.trf-hero .tag .i { width: 15px; height: 15px; }
.from { display: flex; gap: 12px; align-items: center; }
.from .avatar { background: #FDF3E1; color: #B8730F; }
.welcome .burst { width: 120px; height: 120px; margin: 6px auto 0; border-radius: 50%; padding: 5px; background: conic-gradient(#E8650F, #F4924A, #FBD3B4, #E8650F); animation: pop .6s var(--ease); }
.welcome .burst img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #fff; }

/* boot splash */
.boot { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; }
.boot-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: rot .8s linear infinite; }

/* password show/hide */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 50px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.pw-eye:hover { color: var(--ink); background: rgba(0, 0, 0, .04); }
.pw-eye .i { width: 20px; height: 20px; }

.rescue { text-align: center; color: var(--ink-2); display: grid; gap: 12px; justify-items: center; padding: 0 24px; }

.lb-del { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); margin-right: 6px; }
.lb-del .i { width: 17px; height: 17px; }
.lb-del:hover { background: rgba(224, 86, 75, .85); }
.lightbox .lb-bar { gap: 6px; }

.sheet-wrap { z-index: 160; }

/* ---------- memory viewer (immersive) ---------- */
.mv { min-height: 100dvh; background: var(--bg); animation: fade .35s forwards; opacity: 0; }
.mv-hero { position: relative; height: min(78dvh, 720px); background: #10181D; overflow: hidden; }
@media (min-width: 760px) { .mv-hero { max-width: 760px; margin: 0 auto; border-radius: 0 0 32px 32px; } }
.mv-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mv-track::-webkit-scrollbar { display: none; }
.mv-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; padding: 0; }
.mv-slide img { width: 100%; height: 100%; object-fit: cover; animation: mv-zoom 9s ease-out both; }
@keyframes mv-zoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.mv-empty { height: 100%; display: grid; place-items: center; background: linear-gradient(160deg, #E8650F, #F9B98A); color: rgba(255, 255, 255, .8); }
.mv-empty .i { width: 72px; height: 72px; stroke-width: 1.2; }
.mv-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8, 14, 18, .45) 0%, rgba(8, 14, 18, 0) 22%, rgba(8, 14, 18, 0) 48%, rgba(8, 14, 18, .82) 100%); }
.mv-top { position: absolute; top: calc(var(--safe-t) + 12px); left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; }
.mv-glass { background: rgba(255, 255, 255, .18); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.mv-edit { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px 0 13px; border-radius: 999px; font-weight: 600; font-size: 14.5px; }
.mv-edit .i { width: 17px; height: 17px; }
.mv-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 22px 26px; color: #fff; pointer-events: none; animation: enter .6s var(--ease) .1s both; }
.mv-kicker { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .78); margin-bottom: 8px; }
.mv-cap h1 { font-size: clamp(30px, 8.5vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.mv-cap p { margin-top: 10px; font-size: 15px; color: rgba(255, 255, 255, .88); font-weight: 500; }
.mv-sep { margin: 0 8px; opacity: .6; }
.mv-dots { display: flex; gap: 6px; margin-top: 16px; }
.mv-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .45); transition: all .3s var(--ease); }
.mv-dots i.on { width: 20px; background: #fff; }
.mv-body { max-width: 680px; margin: 0 auto; padding: 28px 24px 56px; }
.mv-story { font-size: 18.5px; line-height: 1.7; color: var(--ink); white-space: pre-line; letter-spacing: -.005em; }
.mv-pets { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.mv-pets a { display: inline-flex; align-items: center; gap: 9px; padding: 5px 16px 5px 5px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); font-weight: 600; font-size: 14.5px; }
.mv-pets img, .mv-pets .ph { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.mv-grid { margin-top: 30px; columns: 2; column-gap: 10px; }
.mv-grid button { display: block; width: 100%; margin-bottom: 10px; break-inside: avoid; border-radius: 18px; overflow: hidden; padding: 0; }
.mv-grid img { width: 100%; height: auto; display: block; transition: transform .5s var(--ease); }
.mv-grid button:hover img { transform: scale(1.03); }

/* ---------- memory edit ---------- */
.me-screen .topbar h1 { font-size: 17px; }
.me-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.me-ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.me-ph img { width: 100%; height: 100%; object-fit: cover; }
.me-ph.cover { grid-column: span 2; grid-row: span 2; box-shadow: 0 0 0 3px var(--brand); }
.me-badge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; gap: 5px; align-items: center; background: rgba(255, 255, 255, .92); color: var(--brand-ink); font-size: 12px; font-weight: 700; padding: 5px 10px 5px 8px; border-radius: 999px; }
.me-badge .i { width: 13px; height: 13px; fill: currentColor; }
.me-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(16, 24, 29, .62); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.me-x .i { width: 15px; height: 15px; stroke-width: 2.4; }

/* home: pets in pages of 4 */
@media (min-width: 640px) { .pet-page { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- photo crop ---------- */
/* the photo frame shrinks on short screens so Annuler / Valider always stay visible */
.crop { position: relative; width: min(100%, max(180px, calc((92dvh - 300px) * var(--a, 1.333)))); margin: 0 auto; overflow: hidden; border-radius: 18px; background: #10181D; touch-action: none; cursor: grab; user-select: none; }
.crop:active { cursor: grabbing; }
.crop img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; opacity: 0; transition: opacity .2s; pointer-events: none; }
.crop.ready img { opacity: 1; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent 33.2%, rgba(255,255,255,.35) 33.3%, rgba(255,255,255,.35) 33.5%, transparent 33.6%, transparent 66.5%, rgba(255,255,255,.35) 66.6%, rgba(255,255,255,.35) 66.8%, transparent 66.9%),
  linear-gradient(0deg, transparent 33.2%, rgba(255,255,255,.35) 33.3%, rgba(255,255,255,.35) 33.5%, transparent 33.6%, transparent 66.5%, rgba(255,255,255,.35) 66.6%, rgba(255,255,255,.35) 66.8%, transparent 66.9%); }
.crop-ring { position: absolute; top: 50%; left: 50%; height: 92%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 0 0 9999px rgba(8,14,18,.28); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); }
.crop-zoom .i:first-child { width: 16px; height: 16px; }
.crop-zoom .i:last-child { width: 24px; height: 24px; }
.crop-zoom input { flex: 1; accent-color: var(--brand); height: 28px; }

/* timeline moment page */
.moment-h { display: flex; gap: 14px; align-items: center; }
.moment-h h1 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.moment-h p { margin-top: 2px; }

/* ---------- lost-pet notice ---------- */
.lost-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r-md); background: #FFF1F0; color: #B42E28; box-shadow: inset 0 0 0 1.5px #F6C9C5; }
.lost-btn > .i:first-child { width: 26px; height: 26px; flex: none; }
.lost-btn > .i:last-child { width: 18px; height: 18px; margin-left: auto; opacity: .7; }
.lost-btn span { font-size: 13.5px; color: #8E3A35; }
.lost-btn b { display: block; font-size: 15.5px; color: #B42E28; }
.wiz-dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 18px; }
.wiz-dots i { width: 26px; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.wiz-dots i.on { background: #D93832; }
.wiz-q { font-size: 21px; font-weight: 750; letter-spacing: -.015em; line-height: 1.25; margin-bottom: 6px; }
.wiz-help { font-size: 14px; margin-bottom: 14px; }
.wiz-sub { font-weight: 650; font-size: 14px; color: var(--ink-2); margin: 16px 0 8px; }
.wiz-q + .field, .wiz-q + .checks { margin-top: 14px; }
.wiz-photos { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.wiz-ph { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--surface-2); padding: 0; }
.wiz-ph img { width: 100%; height: 100%; object-fit: cover; }
.wiz-ph span { display: grid; place-items: center; gap: 6px; height: 100%; color: var(--brand); font-weight: 600; font-size: 14px; }
.wiz-ph em { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--ink); }
.wiz-ph em .i { width: 16px; height: 16px; }
.wiz-build { display: grid; place-items: center; gap: 14px; padding: 60px 0; color: var(--ink-2); }
.lost-preview { width: 100%; border-radius: 16px; box-shadow: var(--shadow-2); }
.lost-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.lost-actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--r-md); background: var(--surface-2); font-weight: 650; font-size: 13.5px; text-align: center; }
.lost-actions button small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.lost-actions .i { width: 22px; height: 22px; color: var(--ink-2); }
.lost-actions button:disabled { opacity: .5; }
.checks .chip { box-shadow: inset 0 0 0 1px var(--line); }
.checks .chip .i { width: 14px; height: 14px; }

.lost-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; margin-top: 16px; }
.lost-pick button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; font-weight: 650; font-size: 14.5px; border-radius: var(--r-md); }
.lost-pick img, .lost-pick .ph { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #F6C9C5; transition: transform .2s var(--ease); }
.lost-pick button:active img { transform: scale(.95); }

/* ---------- videos ---------- */
.photo-grid button, .mv-grid button, .th, .mv-slide { position: relative; }
.vid-badge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 999px; background: rgba(12, 18, 22, .62); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); pointer-events: none; }
.vid-badge .i { width: 13px; height: 13px; }
.vid-badge.big { left: 50%; bottom: auto; top: calc(var(--safe-t) + 70px); transform: translateX(-50%); font-size: 12.5px; padding: 6px 12px 6px 9px; }
.th .vid-badge { left: 4px; bottom: 4px; padding: 2px 6px; }
.mv-video { width: 100%; height: 100%; object-fit: cover; background: #10181D; }
.lightbox video { max-width: 100%; max-height: calc(100dvh - 120px); border-radius: 6px; background: #000; }
.lost-mini { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 10px; font-size: 13.5px; font-weight: 600; color: #B42E28; border-radius: var(--r-sm); }
.lost-mini .i { width: 16px; height: 16px; }
.lost-mini:hover { background: #FFF1F0; }

.mem-card .photo { position: relative; }

.mem-card .photo .ph { width: 100%; height: 100%; }

/* ---------- share a memory ---------- */
.mv-acts { display: flex; gap: 8px; align-items: center; }
.sh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sh-row.three { grid-template-columns: repeat(3, 1fr); }
.sh-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 0 0 1.5px transparent; text-align: left; transition: box-shadow .2s, background .2s; }
.sh-opt .i { width: 22px; height: 22px; color: var(--brand); margin-bottom: 4px; }
.sh-opt b { font-size: 15px; font-weight: 700; }
.sh-opt small { font-size: 12.5px; color: var(--muted); }
.sh-opt.on, .sh-style.on { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.sh-style { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: var(--r-md); background: var(--surface-2); font-weight: 650; font-size: 13.5px; box-shadow: inset 0 0 0 1.5px transparent; }
.sh-style i { width: 42px; height: 42px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); position: relative; }
.sh-style i::after { content: ''; position: absolute; left: 9px; right: 9px; bottom: 9px; height: 5px; border-radius: 3px; background: var(--a); }
.sh-rec { display: grid; place-items: center; }
.sh-rec canvas { height: min(52vh, 440px); aspect-ratio: 9 / 16; border-radius: 16px; box-shadow: var(--shadow-2); background: #000; }
.sh-prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 16px; }
.sh-prog i { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.sh-preview { display: block; margin: 0 auto; width: 100%; border-radius: 16px; box-shadow: var(--shadow-2); background: #000; }
.sh-preview.story { width: auto; height: min(56vh, 480px); max-width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.sh-preview.square { max-width: 420px; }

/* ---------- alimentation ---------- */
.card.diet { display: flex; gap: 12px; align-items: flex-start; padding: 14px; text-align: left; width: 100%; }
.card.diet .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card.diet .t { font-weight: 700; font-size: 15.5px; }
.card.diet .k { font-size: 13px; color: var(--muted); }
.card.diet .dose { font-size: 14.5px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.card.diet .s { font-size: 13px; color: var(--muted); }
.card.diet .chev { align-self: center; }
.card.diet.off { opacity: .7; }
.diet-empty { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; color: var(--ink-2); font-size: 14.5px; }
.diet-past { margin-top: 10px; }
.diet-past summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; padding: 6px 0; }

/* ---------- répétition & notifications ---------- */
.rep-custom { display: grid; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.rep-custom[hidden] { display: none; }
.rep-every { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.rep-every input { width: 72px; text-align: center; }
.rep-every select { flex: 1; }
.rep-every input, .rep-every select { height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font: inherit; color: var(--ink); }
.rep-days small { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.rep-days > div { display: flex; gap: 6px; }
.rep-days[hidden] { display: none; }
.day { flex: 1; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: grid; place-items: center; height: 40px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.day input:checked + span { background: var(--brand); color: #fff; box-shadow: none; }
.day input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.rep-sum { font-size: 14px; font-weight: 650; color: var(--brand-ink); min-height: 1em; }
.rep-sum:empty { display: none; }
.notif-i { width: 13px !important; height: 13px !important; vertical-align: -2px; opacity: .55; }
.notif-dev { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.notif-dev > span { flex: 1; min-width: 0; }
.notif-dev > .i { width: 22px; height: 22px; flex: none; color: var(--brand); }
.notif-dev > .i.ok { color: #1E9E6A; }
.prof-empty { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; font-size: 14px; color: var(--ink-2); }

/* weight input with its kg | lb switch */
.w-in { position: relative; }
.field .w-in input:not([type=checkbox]):not([type=radio]) { padding-right: 104px; }
.unit-sw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.unit-sw button { min-width: 40px; padding: 6px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.unit-sw button.on { background: var(--brand); color: #fff; }
.unit-sw.head { position: static; transform: none; }
.w-unit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* memorial bookmark */
.mem-prev { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; justify-items: center; padding: 4px 18px 0; }
.mem-prev figure { margin: 0; width: 100%; max-width: 150px; text-align: center; }
.mem-prev img { width: 100%; aspect-ratio: 5 / 14; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-2); background: var(--surface-2); display: block; }
.mem-prev figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.mem-actions { margin-top: 18px; }
.mem-help { font-size: 12.5px; text-align: center; margin-top: 10px; line-height: 1.45; }
.mem-form h3 { margin-top: 22px; }
.mem-photos { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; grid-column: 1 / -1; }
.mem-photos button, .mem-photos .add { flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; padding: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--brand); }
.mem-photos button img { width: 100%; height: 100%; object-fit: cover; }
.mem-photos button.on { box-shadow: 0 0 0 3px var(--brand); }
.mem-form .checks { grid-column: 1 / -1; }
.mem-sw { width: 16px; height: 16px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.mem-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 13px; border-radius: var(--r-md); background: #F4F1FC; color: #5A4A93; font-weight: 700; }
.mem-btn .i { color: #7A5FD0; }

/* ---------- Warm theme: peach daylight, cream cards, black pills, floating nav ---------- */
html { background: #FFF0E3; }
body { background: transparent; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 46% at 88% -6%, #FBCFA9 0%, rgba(251, 207, 169, 0) 72%),
    radial-gradient(80% 40% at 0% 104%, #FAD4B6 0%, rgba(250, 212, 182, 0) 74%),
    #FFF4EA;
}
::selection { background: #FBCFA9; color: var(--ink); }
:focus-visible { outline-color: var(--ink); }
input, textarea { caret-color: var(--brand); }

/* type: lighter headings, like the reference */
h1, h2, h3, .topbar h1, .sec-h h2, .pet-head h1, .pet-card h3, .hello h1, .sheet-h h2 { font-weight: 600; }
.topbar.big h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.hello h1 { font-size: clamp(27px, 7.6vw, 34px); letter-spacing: -.025em; }
.pet-head h1 { font-size: 34px; letter-spacing: -.025em; }
.sec-h h2 { font-size: 20px; color: var(--ink-2); font-weight: 500; }
.big-num, .tl-year { font-weight: 600; }
.stat b { font-weight: 600; }
.logo { font-weight: 700; }

/* floating pill nav */
.nav {
  left: 14px; right: 14px; bottom: calc(var(--safe-b) + 12px); height: 64px; padding: 5px;
  max-width: 560px; margin: 0 auto; border: 1px solid rgba(255, 255, 255, .7); border-radius: 999px;
  background: rgba(244, 228, 214, .82); box-shadow: 0 12px 30px rgba(140, 78, 30, .18);
}
.nav-in { height: 100%; gap: 2px; }
.nav a { border-radius: 999px; font-size: 11px; font-weight: 500; color: var(--ink-2); transition: background .25s var(--ease), color .2s; min-width: 0; }
.nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nav a .i { width: 22px; height: 22px; stroke-width: 1.7; }
.nav a.on { background: #FBD6BA; color: var(--brand-ink); }
.nav a.on .i { transform: none; }

/* cards: translucent cream with a white edge */
.card { background: rgba(255, 251, 247, .74); border-radius: 26px; box-shadow: var(--shadow-1), inset 0 0 0 1px rgba(255, 255, 255, .75); }
.auth-card, .sheet { background: #FFFAF5; }
.row { padding: 14px 16px; }
.row .chev { color: #C2AE9F; }

/* buttons: black is the main action */
.btn { background: var(--ink); box-shadow: 0 8px 20px rgba(29, 23, 18, .18); font-weight: 500; }
.btn:hover { background: #3A2F27; }
.btn.ghost { background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px #EAD6C6; }
.btn.ghost:hover { background: #fff; }
.btn.soft { background: var(--brand-soft); }
.btn.soft:hover { background: #FBD6BA; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #B02D21; }
.btn.outline { color: var(--ink); box-shadow: inset 0 0 0 1px #DDC6B4; }
.btn.outline:hover { background: rgba(255, 255, 255, .6); }
.sec-h a, .link, .row .end.brand, .tl-month { color: var(--brand-ink); }
.icon-btn { background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); }
.icon-btn:hover { background: #fff; }
.sheet .icon-btn { background: var(--surface-2); box-shadow: none; }
.avatar { background: #FBD6BA; }
.icon-btn .badge-dot { border-color: #FFF4EA; }

/* round peach icon tiles with dark line icons */
.tile, .tile.sm, .tile.lg, .stat .tile, .quick .tile { border-radius: 50%; }
.t-teal, .t-blue, .t-coral, .t-amber, .t-violet, .t-gray {
  background: radial-gradient(circle at 32% 28%, #FFF3E8, #FBDCC5); color: #3A2C22;
}
.t-red { background: radial-gradient(circle at 32% 28%, #FFEDE8, #FBD0C6); color: #B62E22; }
.t-green { background: radial-gradient(circle at 32% 28%, #F1F8E8, #D7EDC5); color: #3D7A2E; }
.tile .i { stroke-width: 1.7; }

/* status colours, warmed */
.pill.blue, .pill.muted { background: #FDE6D3; color: #9A4105; }
.pill.gray { background: #F3E7DD; color: #5C4F46; }
.pill.amber { background: #FDEBCF; color: #8F5A08; }
.pill.green, .status-btn { background: #E4F1D8; color: #35702A; }
.status-btn.gone, .note.memorial, .mem-btn { background: #F3E7DD; color: #5C4F46; }
.note.memorial .i, .mem-btn .i { color: #5C4F46; }
.note { background: rgba(255, 239, 217, .85); color: #6B4A18; }
.ph { background: linear-gradient(135deg, #FDE9DA, #FBD6BA); color: #D9A27C; }

/* black segmented pills */
.seg { background: rgba(255, 255, 255, .72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); }
.seg button.on { background: var(--ink); color: #fff; box-shadow: none; }
.tabs { background: rgba(255, 244, 234, .92); gap: 4px; }
.tabs a { font-weight: 500; }
.tabs a.on { background: var(--ink); color: #fff; }
.chip { background: rgba(255, 255, 255, .72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); font-weight: 500; }
.chip.on { background: var(--ink); }
.day input:checked + span, .unit-sw button.on { background: var(--ink); }
.dots i { background: #E8D2C0; }
.dots i.on { background: var(--ink); }

/* pet page sits on the page background, not a solid sheet */
.pet-head { background: linear-gradient(#FFF4EA 44px, rgba(255, 244, 234, 0) 130px); }
.hero .cam { background: var(--ink); }
.tl-i .node { box-shadow: 0 0 0 4px #FFF4EA; }
.tl-card.upcoming { border-color: #E8CDB8; }

/* fields */
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { border-radius: 16px; }
.action { background: rgba(251, 237, 225, .7); }
.action:hover { background: #FBE3D1; }
.grab { background: #EAD6C6; }
.backdrop { background: rgba(58, 34, 18, .36); }
.check { border-color: #DCC5B3; }

.auth { background: transparent; }

/* ---------- Line theme: peach gradient, fine dark outlines, round icon buttons, black pill nav ---------- */
:root { --stroke: 1.5px solid #2B231D; --line: #E4CDBB; }
body::before {
  background: linear-gradient(158deg, #F9C9A4 0%, #FDE3CF 26%, #FFF5EC 52%, #FFE7D4 78%, #FBD3B4 100%);
}
h1, h2, h3, .topbar h1, .sec-h h2, .pet-card h3, .sheet-h h2 { font-weight: 600; letter-spacing: -.01em; }
.topbar.big h1 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.sec-h h2 { color: var(--ink); font-size: 19px; font-weight: 600; }
.muted, .row .s, .meta { font-weight: 400; }

/* every container is a fine outline, no soft shadow */
.card { background: rgba(255, 255, 255, .5); border: var(--stroke); border-radius: 26px; box-shadow: none; }
.press:hover { box-shadow: none; }
@media (hover: hover) { .press:hover { background: rgba(255, 255, 255, .78); } }
.icon-btn, .sheet .icon-btn { width: 48px; height: 48px; background: transparent; border: var(--stroke); box-shadow: none; }
.icon-btn:hover { background: rgba(255, 255, 255, .7); }
.avatar { width: 50px; height: 50px; background: #FFE2CC; border: var(--stroke); color: var(--ink); }
.avatar.lg { width: 84px; height: 84px; }

/* tiles: white circles with a dark line icon; health colours stay */
.tile, .t-teal, .t-blue, .t-coral, .t-amber, .t-violet, .t-gray { background: #fff; color: var(--ink); }
.t-red { background: #fff; color: #B62E22; }
.t-green { background: #fff; color: #35702A; }

/* tags are outlined */
.pill, .pill.green, .pill.amber, .pill.red, .pill.muted, .pill.blue, .pill.gray, .status-btn, .status-btn.gone {
  background: transparent; border: 1.5px solid currentColor;
}
.pill.gray, .pill.muted, .pill.blue { color: var(--ink); }

/* buttons */
.btn { min-height: 54px; box-shadow: none; }
.btn.sm { min-height: 42px; }
.btn.ghost, .btn.outline, .btn.soft { background: transparent; color: var(--ink); border: var(--stroke); box-shadow: none; }
.btn.ghost:hover, .btn.outline:hover, .btn.soft:hover { background: rgba(255, 255, 255, .7); }
.sec-h a, .link { color: var(--ink); border: var(--stroke); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; gap: 4px; }
.sec-h a .i { width: 14px; height: 14px; }

/* segmented controls, chips, tabs: outlined pills */
.seg { background: transparent; border: var(--stroke); box-shadow: none; }
.chip { background: transparent; border: var(--stroke); box-shadow: none; }
.chip.on { background: var(--ink); color: #fff; }
.tabs { background: rgba(255, 236, 220, .94); gap: 6px; }
.tabs a { flex: 0 0 auto; padding: 8px 14px; border: var(--stroke); }
.tabs a.on { background: var(--ink); }

/* nav: white outlined pill, the current page grows into a black pill with its name */
.nav { background: rgba(255, 255, 255, .92); border: var(--stroke); box-shadow: 0 10px 24px rgba(120, 66, 24, .14); padding: 4px; }
.nav-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.nav a { flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--ink); transition: background .25s; }
.nav a.on { background: #FBC9A2; color: var(--ink); }

/* home */
.hello h1 { font-size: clamp(24px, 6.8vw, 30px); font-weight: 600; letter-spacing: -.01em; }

/* pet cards: photo inset in its outlined frame */
.pet-card { padding: 7px; }
.pet-card .photo { border-radius: 20px; }
.pet-card .body { padding: 10px 7px 8px; }

/* pet page: photo in a framed card, name shouted */
.hero { margin: calc(var(--safe-t) + 10px) 0 0; }
.hero .photo { border-radius: 30px; border: var(--stroke); }
.hero .bar { top: 12px; }
.glass { background: rgba(255, 255, 255, .88); border: var(--stroke); box-shadow: none; }
.hero .cam { bottom: 14px; }
.pet-head { margin: 0; padding: 18px 2px 0; background: none; border-radius: 0; }
.pet-head h1 { font-size: 36px; font-weight: 800; text-transform: uppercase; letter-spacing: -.005em; }
.quick .tile { background: #fff; border: var(--stroke); }
.fact b { font-size: 16px; font-weight: 600; }
.hist-i .when::before { background: var(--ink); box-shadow: none; }
.hist-i::before { background: #2B231D; width: 1px; }
.tl::before { background: #2B231D; width: 1px; }

/* notes, forms, sheets */
.note, .banner, .note.memorial, .mem-btn { background: rgba(255, 255, 255, .5); color: var(--ink-2); border: var(--stroke); border-radius: 22px; }
.note .i, .note.memorial .i, .mem-btn .i, .banner .i { color: var(--ink); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .toggle, .search { background-color: transparent; border: var(--stroke); box-shadow: none; }
.field input:not([type=checkbox]):not([type=radio]), .field select { border-radius: 999px; padding-left: 18px; }
.field textarea, .toggle { border-radius: 22px; }
.field input:focus, .field select:focus, .field textarea:focus { background-color: #fff; border-color: var(--ink); }
.sheet { background: #FFF8F1; border: var(--stroke); border-bottom: 0; box-shadow: none; }
.action { background: transparent; border: var(--stroke); border-radius: 22px; }
.action:hover { background: #fff; }
.auth-card { background: rgba(255, 255, 255, .55); border: var(--stroke); box-shadow: none; }
.auth-hero { background: none; }
.chart .ln { stroke: var(--ink); }
.chart .pt { stroke: var(--brand); }

/* selected and main actions: peach fill, dark outline and text */
:root { --pick: #FBC9A2; }
.btn, .seg button.on, .chip.on, .tabs a.on, .day input:checked + span, .unit-sw button.on, .hero .cam, .toast {
  background: var(--pick); color: var(--ink); border: var(--stroke); box-shadow: none;
}
.btn:hover { background: #F9B98A; }
.btn.danger { background: var(--danger); color: #fff; border: 0; }
.btn.danger:hover { background: #B02D21; }
.nav a.on { background: var(--pick); }
.dots i.on { background: var(--brand); }
.toast .i, .toast.err .i { color: var(--ink); }
.btn .spin { border-color: rgba(29, 23, 18, .25); border-top-color: var(--ink); }
.btn.danger .spin { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
.icon-btn:empty { border: 0; background: none; }
.logo b { color: #35702A; }

/* memories: two offset columns of tall and square photos, no empty space */
.brick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.brick-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.brick .mem-card .photo { aspect-ratio: 3 / 4; }
.brick-col .mem-card:nth-child(even) .photo { aspect-ratio: 1; }
.brick-col:last-child .mem-card:nth-child(odd) .photo { aspect-ratio: 1; }
.brick-col:last-child .mem-card:nth-child(even) .photo { aspect-ratio: 3 / 4; }

/* add circles: same look in the Santé sections and the photo tabs */
.hs-add .tile, .photo-grid .add .tile { position: relative; overflow: visible; }
.hs-add .tile::after, .photo-grid .add .tile::after { content: "+"; position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--pick); border: 1.5px solid #2B231D; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1; }

.photo-grid .add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.photo-grid .add .tile { width: 54px; height: 54px; background: #fff; border: var(--stroke); }

/* dropdowns: the app's own list, in the app's colors */
.sel-wrap { display: block; position: relative; flex: 1 1 auto; min-width: 0; }
.sel-wrap select { width: 100%; }
.sel-hit { position: absolute; inset: 0; width: 100%; background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.sel-hit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.pick-list button { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; width: 100%; min-height: 50px; padding: 10px 18px; border: var(--stroke); border-radius: 999px; background: transparent; color: var(--ink); font-size: 15px; font-weight: 500; text-align: left; overflow-wrap: anywhere; }
.pick-list button.on { background: var(--pick); font-weight: 600; }
.pick-list .i { width: 18px; height: 18px; flex: none; }

/* dates and times: the app's own calendar */
.sel-wrap input { width: 100%; }
.cal-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-t { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; color: var(--ink); background: none; }
.cal-t .i { width: 16px; height: 16px; }
.cal-w, .cal-d { display: grid; grid-template-columns: repeat(7, 1fr); justify-items: center; }
.cal-w { margin-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal-d { margin-top: 6px; row-gap: 4px; }
.cal-d button { width: 44px; height: 44px; max-width: 100%; border-radius: 50%; background: none; color: var(--ink); font-size: 15px; font-weight: 500; }
.cal-d button.now { border: var(--stroke); }
.cal-d button.on { background: var(--pick); border: var(--stroke); font-weight: 700; }
.cal-d button:disabled { color: var(--line); }
.cal-f { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.cal-years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.cal-years button, .cal-times button { min-height: 44px; border: var(--stroke); border-radius: 999px; background: none; color: var(--ink); font-size: 14.5px; font-weight: 500; }
.cal-years button.on, .cal-times button.on { background: var(--pick); font-weight: 700; }
.cal-times { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cal-times button { padding: 0; font-size: 13.5px; }

/* health tab: one section per kind of information, its circle adds */
.hs-list { display: flex; flex-direction: column; gap: 12px; }
.hs { padding: 14px 16px; }
.hs-h { display: flex; align-items: center; gap: 14px; }
.hs-h h2 { font-size: 17px; font-weight: 600; }
.hs-add { flex: none; background: none; padding: 0; }
.hs .tile { width: 54px; height: 54px; background: #fff; border: var(--stroke); }
.hs-none { font-size: 14px; margin-top: 10px; }
.hs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 0; margin-top: 8px; border-top: 1px solid var(--line); background: none; color: inherit; text-align: left; }
.hs-row + .hs-row { margin-top: 0; }
.hs-row .chev { flex: none; }
.vet-row { gap: 12px; }
.vet-row + .vet-row { margin-top: 0; }
.vet-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; padding: 0; color: inherit; text-align: left; }
.vet-check { flex: none; width: 26px; height: 26px; border-radius: 8px; border: var(--stroke); background: #fff; display: grid; place-items: center; padding: 0; color: #fff; }
.vet-check.on { background: var(--ink); }
.vet-check svg { width: 16px; height: 16px; stroke-width: 2.6; }
.vet-main { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.hs-more { display: inline-flex; margin-top: 6px; }
.hs-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.hs-foot .hs-more { margin-top: 0; }
a.fact { color: inherit; text-decoration: none; }
.fact .fact-d { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.hs-row .txt { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.hs-row .t { font-weight: 600; font-size: 15px; }
.hs-row .s { color: var(--muted); font-size: 13.5px; }

/* reading an entry */
.view-edit { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.view-kv { padding-bottom: 8px; }

/* pet pages as plain words on one line, a thin line and a small mark on the current page */
.pet-head .tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 12px 0 0; padding: 0; overflow: visible; background: none; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.pet-head .tabs a { flex: none; padding: 13px 0 12px; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 14.5px; font-weight: 500; letter-spacing: -.005em; }
.pet-head .tabs a.on { background: none; color: var(--ink); font-weight: 600; }
.pet-head .tabs a.on::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 28px; height: 3px; margin-left: -14px; border-radius: 3px 3px 0 0; background: var(--ink); }
@media (max-width: 350px) { .pet-head .tabs a { font-size: 13px; } }

/* a section that opens with a small arrow beside its name */
.fold > summary { list-style: none; cursor: pointer; justify-content: flex-start; gap: 8px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .i { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.fold[open] > summary .i { transform: rotate(180deg); }
