:root {
  --bg: #fff5eb;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: linear-gradient(135deg, #ffd8c8, #fff0ca 54%, #d8f5eb);
  --text: #31241c;
  --muted: #77665d;
  --accent: #ff7a59;
  --accent-dark: #9b4d2f;
  --accent-soft: #ffb89f;
  --mint: #83d7ba;
  --sky: #8ecdf7;
  --lemon: #ffd56b;
  --heading-strong: #2f221b;
  --heading-soft: #45332a;
  --border: rgba(168, 120, 96, 0.14);
  --shadow: 0 28px 80px rgba(123, 88, 63, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 183, 140, 0.34), transparent 28%),
    radial-gradient(circle at bottom left, rgba(131, 215, 186, 0.24), transparent 32%),
    linear-gradient(180deg, #fff8f2 0%, #ffeede 100%);
  min-height: 100vh;
  position: relative;
}

body.is-photo-preview-open .site-header {
  visibility: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.5;
}

.bg-orb-a {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 122, 89, 0.38), transparent 70%);
}

.bg-orb-b {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(131, 215, 186, 0.28), transparent 70%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(155, 77, 47, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 77, 47, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 75%);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 12px 6px;
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
  z-index: 20;
}

.brand-wrap {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
}

.brand {
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--heading-strong);
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-left: 2px;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  overflow: visible;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.6);
  backdrop-filter: blur(8px);
}

.nav a {
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  transition: 160ms ease;
}

.nav a:hover,
.nav-dropdown summary:hover {
  color: var(--text);
  background: rgba(255, 122, 89, 0.1);
}

.nav-dropdown {
  position: relative;
  z-index: 30;
}

.nav-dropdown summary {
  list-style: none;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 180px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.95);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}

.nav-dropdown-menu a {
  padding: 10px 12px;
  border-radius: 14px;
}

.nav-dropdown-menu a:hover {
  background: rgba(131, 215, 186, 0.12);
}

.nav-account-dropdown summary {
  color: var(--heading-soft);
  font-weight: 600;
  background: rgba(255, 251, 246, 0.38);
  border: 1px solid rgba(168, 120, 96, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.nav-account-summary {
  min-width: 82px;
  max-width: 148px;
  overflow: hidden;
}

.nav-account-summary-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.nav-account-summary-label {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
}

.nav-account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 213, 107, 0.34), rgba(131, 215, 186, 0.28));
  color: rgba(155, 77, 47, 0.82);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
  border: 1px solid rgba(168, 120, 96, 0.08);
}

.nav-account-summary-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.1;
}

.nav-account-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(123, 88, 63, 0.42);
  border-bottom: 2px solid rgba(123, 88, 63, 0.42);
  transform: rotate(45deg) translateY(-1px);
  flex: 0 0 auto;
  margin-left: 2px;
}

.nav-account-dropdown[open] .nav-account-summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.nav-account-menu {
  min-width: 176px;
  padding: 12px;
  gap: 8px;
}

.nav-account-form {
  margin: 0;
}

.nav-account-menu-link,
.nav-account-menu-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(168, 120, 96, 0.1);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.58);
  color: var(--muted);
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.nav-account-menu-link:hover,
.nav-account-menu-link:focus-visible,
.nav-account-menu-button:hover,
.nav-account-menu-button:focus-visible {
  background: rgba(255, 122, 89, 0.08);
  color: var(--text);
  border-color: rgba(255, 122, 89, 0.12);
  outline: none;
}

.nav-account-menu-button-danger {
  color: #b95a36;
  background: rgba(255, 122, 89, 0.06);
}

.nav-account-menu-button-danger:hover,
.nav-account-menu-button-danger:focus-visible {
  color: #9f4525;
  background: rgba(255, 122, 89, 0.14);
  border-color: rgba(255, 122, 89, 0.16);
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 6px 12px 40px;
  position: relative;
  z-index: 1;
}

.hero,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr);
  gap: 16px;
  padding: 22px 26px;
  margin-bottom: 18px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 188px;
}

.hero-copy-inner {
  max-width: 560px;
  display: grid;
  gap: 8px;
}

.hero-copy h1:not(.hero-title) {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.06;
  margin-bottom: 0;
  max-width: 11ch;
  letter-spacing: -0.03em;
  color: var(--heading-strong);
}

.hero-kicker {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-title {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.1;
  margin-bottom: 0;
  letter-spacing: -0.02em;
  font-weight: 650;
  max-width: 14ch;
  color: var(--heading-strong);
}

.hero-description {
  font-size: 14px;
  line-height: 1.58;
  max-width: 36ch;
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

h1,
h2 {
  margin: 0;
  color: var(--heading-strong);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  line-height: 1.12;
  color: #3a2b22;
  letter-spacing: -0.02em;
}

h2 {
  font-weight: 700;
  line-height: 1.12;
}

.title-row,
.card-top,
.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

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

.timeline-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.timeline-title-group strong {
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.lead {
  color: var(--muted);
  line-height: 1.68;
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.home-stat-pills {
  display: none;
}

.home-stat-pill {
  min-height: 0;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(132, 84, 61, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 242, 0.88));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7b6257;
  font-size: 13px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 6px 14px rgba(122, 63, 34, 0.04);
}

.home-stat-pill strong {
  color: var(--heading-strong);
  font-size: 14px;
  line-height: 1;
}

.home-stat-pill:nth-child(1) {
  background: linear-gradient(180deg, rgba(255, 245, 238, 0.96), rgba(255, 250, 246, 0.9));
}

.home-stat-pill:nth-child(2) {
  background: linear-gradient(180deg, rgba(255, 249, 236, 0.96), rgba(255, 252, 245, 0.9));
}

.home-stat-pill:nth-child(3) {
  background: linear-gradient(180deg, rgba(247, 252, 239, 0.96), rgba(255, 252, 245, 0.9));
}

.home-stat-pill:nth-child(4) {
  background: linear-gradient(180deg, rgba(241, 250, 247, 0.96), rgba(255, 251, 246, 0.9));
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: stretch;
}

.stat-card {
  background: var(--surface-strong);
  border-radius: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(122, 63, 34, 0.08);
  min-height: 0;
  display: grid;
  align-content: center;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.button-primary,
.button-secondary,
.text-link,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-primary,
.button-secondary {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, #ff7a59, #ff9d5c);
  box-shadow: 0 14px 30px rgba(255, 122, 89, 0.26);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 251, 246, 0.75);
  border: 1px solid var(--border);
}

.text-link {
  color: var(--accent-dark);
  font-weight: 700;
}

.pill {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 122, 89, 0.12);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill-compact {
  min-height: 26px;
  padding: 0 10px;
  font-size: 11px;
  line-height: 1;
  background: linear-gradient(180deg, rgba(255, 122, 89, 0.16), rgba(255, 122, 89, 0.12));
  border: 1px solid rgba(255, 122, 89, 0.18);
  color: #7a3f22;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid > .panel {
  margin-bottom: 0;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.detail-top-section {
  margin-bottom: 18px;
}

.cat-detail-mobile-identity {
  display: none;
}

.panel {
  padding: 28px;
  margin-bottom: 18px;
  min-width: 0;
}

.dashboard-panel {
  height: 720px;
  display: flex;
  flex-direction: column;
}

.dashboard-panel .section-head {
  margin-bottom: 24px;
}

.dashboard-scroll-shell {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.dashboard-scroll-shell::-webkit-scrollbar {
  width: 8px;
}

.dashboard-scroll-shell::-webkit-scrollbar-track {
  background: rgba(168, 120, 96, 0.08);
  border-radius: 999px;
}

.dashboard-scroll-shell::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 89, 0.35);
  border-radius: 999px;
}

.dashboard-scroll-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 122, 89, 0.5);
}

.detail-card-primary {
  height: 580px;
  display: flex;
  flex-direction: column;
}

.detail-card-primary .lead {
  max-width: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-bottom: 0;
}

.detail-card-primary .title-row {
  margin-top: 8px;
}

.detail-card-secondary {
  height: 580px;
  display: flex;
  flex-direction: column;
}

.detail-card-secondary .section-head {
  margin-bottom: 12px;
}

.detail-card-secondary .chart {
  flex: 0 0 auto;
}

.detail-card-secondary .table-scroll-shell {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.cats-section-head {
  margin-bottom: 20px;
}

.page-section-head {
  margin-bottom: 24px;
}

.section-head-copy {
  min-width: 0;
}

.section-head-copy .lead {
  margin-bottom: 0;
}

.section-head-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: center;
}

.section-head > h2 {
  line-height: 1;
}

.section-head-events {
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-list {
  display: grid;
  gap: 12px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.compact-grid {
  grid-template-columns: 1fr;
}

.dashboard-scroll-shell .compact-grid {
  align-content: start;
}

.cat-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  position: relative;
  overflow: hidden;
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(122, 63, 34, 0.1);
}

.card-cover-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cat-name {
  font-size: 18px;
  font-weight: 580;
  color: #4f3b31;
  letter-spacing: -0.015em;
}

.title-row h1 {
  color: var(--heading-soft);
}

.cat-avatar {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-dark);
  background: linear-gradient(135deg, rgba(255, 213, 107, 0.45), rgba(142, 205, 247, 0.42));
}

.cat-photo,
.detail-hero-photo,
.photo-card img {
  display: block;
  object-fit: cover;
}

.cat-photo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.detail-hero-photo {
  width: 100%;
  max-height: 220px;
  margin-bottom: 14px;
  border-radius: 22px;
}

.card-visual,
.card-visual-meta,
.tag-row,
.field-row {
  display: flex;
  gap: 8px;
}

.card-visual {
  justify-content: space-between;
  align-items: flex-start;
}

.card-visual-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cat-card-accent {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--lemon), var(--mint), var(--sky));
}

.card-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(131, 215, 186, 0.16);
  color: #2d6a59;
  font-size: 12px;
  font-weight: 700;
}

.info-pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  font-size: 13px;
}

.info-pairs span {
  color: var(--muted);
}

.info-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(168, 120, 96, 0.1);
}

.info-item strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.showcase-card {
  gap: 12px;
}

.cat-card-actions {
  margin-top: -36px;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}

.feature-card {
  gap: 12px;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(131, 215, 186, 0.15);
}

.status-watch {
  background: var(--lemon);
  box-shadow: 0 0 0 5px rgba(255, 213, 107, 0.2);
}

.status-sick {
  background: #ff8e8e;
  box-shadow: 0 0 0 5px rgba(255, 142, 142, 0.16);
}

.status-adopted {
  background: var(--sky);
  box-shadow: 0 0 0 5px rgba(142, 205, 247, 0.18);
}

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

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.timeline-list li {
  border-left: 4px solid var(--accent);
  border: 1px solid rgba(132, 84, 61, 0.12);
  padding: 4px 12px 4px 16px;
  min-width: 0;
  transition: transform 180ms ease, box-shadow 180ms ease;
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 22px rgba(122, 63, 34, 0.05);
}

.timeline-list li:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 16px 28px rgba(122, 63, 34, 0.08);
}

.dashboard-timeline-list li {
  padding: 14px 16px 14px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.dashboard-timeline-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(122, 63, 34, 0.1);
}

.home-mobile-switch {
  display: none;
}

.cat-detail-mobile-switch,
.cat-detail-mobile-panels {
  display: none;
}

.cat-detail-switch-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.cat-detail-switch-button.is-active {
  color: var(--heading-strong);
  background: rgba(255, 251, 246, 0.92);
  box-shadow: 0 10px 24px rgba(122, 63, 34, 0.08);
}

.home-switch-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.home-switch-button.is-active {
  color: var(--heading-strong);
  background: rgba(255, 251, 246, 0.92);
  box-shadow: 0 10px 24px rgba(122, 63, 34, 0.08);
}

.home-panel.is-active {
  display: flex;
}

.timeline-list li > span,
.timeline-list li > p,
.timeline-list li > small {
  overflow-wrap: anywhere;
}

.timeline-meta,
.timeline-description,
.timeline-association {
  display: block;
}

.timeline-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.timeline-description {
  margin: 10px 0 0;
  line-height: 1.65;
}

.timeline-association {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.photo-timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 220px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.photo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.photo-tab-shell {
  display: grid;
  gap: 16px;
}

.section-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.photo-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.photo-tab-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 214, 223, 0.6), rgba(255, 241, 205, 0.65));
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.photo-tab-button {
  min-height: 42px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.photo-tab-button {
  cursor: pointer;
}

#photo-scope-cat:checked ~ .photo-tab-switch label[for="photo-scope-cat"],
#photo-scope-family:checked ~ .photo-tab-switch label[for="photo-scope-family"] {
  color: #7c3f26;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(255, 122, 89, 0.12);
}

.photo-tab-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 122, 89, 0.14);
  color: var(--accent-dark);
  font-size: 12px;
}

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

#photo-scope-cat:checked ~ .photo-tab-panel-cat,
#photo-scope-family:checked ~ .photo-tab-panel-family {
  display: block;
}

.photo-month-group + .photo-month-group {
  margin-top: 18px;
}

.photo-empty-state {
  display: grid;
  gap: 6px;
  padding: 20px 2px 4px;
  color: var(--muted);
}

.photo-empty-state p {
  margin: 0;
}

.photo-month-title {
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-card {
  margin: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--border);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.photo-card:hover,
.photo-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(122, 63, 34, 0.1);
}

.timeline-photo-card {
  scroll-snap-align: start;
  position: relative;
}

.photo-date-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(49, 36, 28, 0.78);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
}

.photo-preview-trigger {
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.photo-preview-trigger img {
  display: block;
}

.photo-card figcaption {
  display: grid;
  gap: 3px;
}

.media-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.media-actions form {
  margin: 0;
}

.photo-card strong {
  font-size: 15px;
  line-height: 1.35;
}

.photo-card span {
  color: var(--muted);
  font-size: 12px;
}

.photo-preview-modal[hidden] {
  display: none;
}

.photo-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.photo-preview-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(39, 26, 20, 0.72);
  backdrop-filter: blur(8px);
}

.photo-preview-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 720px);
  display: grid;
  gap: 10px;
}

.photo-preview-close {
  justify-self: end;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.94);
  color: var(--accent-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.photo-preview-image {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 18px 48px rgba(49, 36, 28, 0.22);
}

.danger-button,
.inline-delete {
  border: none;
  cursor: pointer;
  font: inherit;
}

.danger-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #ff6b72, #d94d58);
  box-shadow: 0 10px 20px rgba(217, 77, 88, 0.2);
}

.inline-delete {
  padding: 0;
  color: #c24a52;
  background: transparent;
  font-weight: 700;
  opacity: 0.16;
  transition: opacity 140ms ease, color 140ms ease;
}

.data-table tr:hover .inline-delete,
.data-table tr:focus-within .inline-delete,
.photo-card:hover .inline-delete,
.photo-card:focus-within .inline-delete,
.timeline-list li:hover .inline-delete,
.timeline-list li:focus-within .inline-delete {
  opacity: 1;
}

.inline-delete:hover,
.inline-delete:focus-visible {
  color: #a83e46;
  opacity: 1;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
  margin-top: 18px;
}

.inline-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.custom-select {
  position: relative;
}

.inline-form select,
.stack-form input,
.stack-form select,
.stack-form textarea,
.stack-form button {
  width: 100%;
  font: inherit;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.74);
}

.inline-form-compact select {
  width: auto;
  min-width: 128px;
  min-height: 42px;
  padding: 0 42px 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 242, 0.82));
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.inline-form-compact select:focus {
  outline: none;
  border-color: rgba(255, 122, 89, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 3px rgba(255, 122, 89, 0.08);
}

.inline-form-compact select.inline-select-tight {
  min-width: 0;
  width: auto;
}

.inline-form-compact select.inline-select-event {
  min-width: 92px;
}

.inline-form-compact select.inline-select-range {
  min-width: 70px;
}

.custom-select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.custom-select-trigger {
  min-height: 42px;
  padding: 0 36px 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 242, 0.82));
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid rgba(123, 88, 63, 0.78);
  border-bottom: 1.5px solid rgba(123, 88, 63, 0.78);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
  transition: transform 160ms ease;
}

.custom-select.is-open .custom-select-trigger::after {
  transform: translateY(-20%) rotate(225deg);
}

.custom-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(255, 122, 89, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 3px rgba(255, 122, 89, 0.08);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 252, 247, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  z-index: 30;
}

.custom-select[hidden],
.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: none;
  background: rgba(255, 122, 89, 0.1);
}

.custom-select-option.is-selected {
  background: rgba(255, 122, 89, 0.14);
  color: var(--accent-dark);
}

.field-row > label {
  flex: 1;
}

.avatar-form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.avatar-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.helper-text {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.subtle-actions {
  margin-top: 18px;
}


.subtle-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.subtle-link:hover {
  color: var(--accent-dark);
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.table-actions form {
  margin: 0;
}

.table-action-link,
.table-action-button {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.table-action-link {
  color: #84543d;
  background: linear-gradient(180deg, rgba(255, 241, 232, 0.92), rgba(255, 248, 242, 0.98));
  border: 1px solid rgba(132, 84, 61, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.table-action-link:hover {
  color: #5e3a2a;
  background: linear-gradient(180deg, rgba(255, 233, 219, 0.98), rgba(255, 246, 238, 1));
  border-color: rgba(132, 84, 61, 0.3);
}

.table-action-button {
  opacity: 1;
  color: #c24a52;
  background: rgba(255, 107, 114, 0.1);
}

.table-action-button:hover,
.table-action-button:focus-visible {
  color: #a83e46;
  background: rgba(255, 107, 114, 0.16);
}

.timeline-page-title-main,
.timeline-section-copy {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.timeline-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.timeline-page-filter-form,
.timeline-inline-filter-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.timeline-page-filter-form select.inline-select-event,
.timeline-inline-filter-form select.inline-select-event {
  width: auto;
  min-width: 118px;
  max-width: 140px;
}

.timeline-page-filter-form select.timeline-time-range-select,
.timeline-inline-filter-form select.timeline-time-range-select {
  width: auto;
  min-width: 104px;
  max-width: 124px;
}

.admin-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-danger-zone {
  border-color: rgba(217, 77, 88, 0.16);
  background: rgba(255, 245, 246, 0.72);
}

.form-panel > h1 {
  margin-bottom: 20px;
}

.stack-form {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: auto;
}

.stack-form button {
  background: linear-gradient(135deg, #ff7a59, #ff9d5c);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 14px 26px rgba(255, 122, 89, 0.24);
}

.auth-page {
  min-height: calc(100vh - 150px);
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 120px 0 56px;
}

.auth-panel {
  margin-bottom: 0;
  padding: 32px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 243, 0.88)),
    rgba(255, 252, 247, 0.9);
}

.auth-panel-single {
  width: min(100%, 560px);
}

.auth-panel-head {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.auth-panel-head-compact {
  margin-bottom: -6px;
}

.auth-panel-head h2 {
  margin-bottom: 0;
}

.auth-form {
  max-width: none;
}

.auth-lead {
  margin-top: 8px;
  max-width: none;
  color: rgba(119, 102, 93, 0.88);
  font-size: 14px;
  line-height: 1.6;
}

.auth-register-note {
  margin-top: 6px;
  color: #9a5a3a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.auth-method-nav {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.72);
}

.auth-method-link {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.auth-method-link:hover,
.auth-method-link:focus-visible {
  color: var(--text);
  background: rgba(255, 122, 89, 0.08);
  outline: none;
}

.auth-method-link.is-active {
  color: var(--heading-soft);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.auth-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-inline-action {
  margin: -6px 0 2px;
  text-align: right;
}

.auth-field-link {
  color: rgba(119, 102, 93, 0.9);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.auth-field-link:hover,
.auth-field-link:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
  outline: none;
}

.auth-secondary-action {
  margin: 12px 0 0;
  text-align: center;
}

.auth-secondary-action a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-secondary-action a:hover,
.auth-secondary-action a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.auth-followup-form {
  margin-top: 18px;
  padding-top: 6px;
}

.auth-inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.auth-inline-control input {
  width: 100%;
}

.auth-inline-button {
  min-height: 48px;
  padding: 0 16px;
  background: rgba(255, 122, 89, 0.08) !important;
  color: var(--accent-dark) !important;
  border: 1px solid rgba(255, 122, 89, 0.22) !important;
  border-radius: 16px;
  box-shadow: none !important;
  cursor: pointer;
  white-space: nowrap;
}

.auth-inline-button:hover,
.auth-inline-button:focus-visible {
  background: rgba(255, 122, 89, 0.14) !important;
  color: var(--heading-soft) !important;
  border-color: rgba(255, 122, 89, 0.34) !important;
  outline: none;
}

.auth-inline-button:disabled {
  background: rgba(255, 122, 89, 0.08) !important;
  color: rgba(119, 102, 93, 0.72) !important;
  border-color: rgba(255, 122, 89, 0.18) !important;
  cursor: not-allowed;
}

.auth-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 107, 114, 0.1);
  border: 1px solid rgba(217, 77, 88, 0.18);
  color: #b3454d;
  font-size: 14px;
}

.auth-success {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(131, 215, 186, 0.14);
  border: 1px solid rgba(77, 163, 128, 0.2);
  color: #2f7a5c;
  font-size: 14px;
}

.account-panel {
  padding: 28px;
}

.account-panel-head {
  margin-bottom: 20px;
}

.account-section-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.68);
}

.account-section-link {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.account-section-link:hover,
.account-section-link:focus-visible {
  color: var(--text);
  background: rgba(255, 122, 89, 0.08);
  outline: none;
}

.account-section-link.is-active {
  color: var(--heading-soft);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.account-section-note {
  margin: 0;
  max-width: none;
  color: rgba(119, 102, 93, 0.88);
  font-size: 13px;
  line-height: 1.5;
}

.account-inline-action {
  margin: -6px 0 4px;
  text-align: right;
}

.account-inline-action a {
  color: rgba(119, 102, 93, 0.9);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.account-inline-action a:hover,
.account-inline-action a:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
  outline: none;
}

.account-form {
  max-width: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

.table-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.table-scroll-shell {
  max-height: 280px;
  overflow-y: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.action-cell {
  text-align: right;
}

.data-table th {
  color: var(--accent-dark);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: rgba(255, 248, 242, 0.96);
  backdrop-filter: blur(8px);
}

.chart {
  min-height: 220px;
  margin-top: 8px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 122, 89, 0.12), rgba(131, 215, 186, 0.04)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  padding: 14px;
  position: relative;
}

.chart svg {
  width: 100%;
  height: 100%;
}

.chart-point {
  cursor: pointer;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: 120ms ease;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(49, 36, 28, 0.92);
  color: white;
  font-size: 12px;
  box-shadow: 0 12px 24px rgba(49, 36, 28, 0.22);
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .site-header,
  .section-head,
  .hero,
  .two-col {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-header {
    padding: 18px 16px 8px;
    gap: 14px;
  }

  .page {
    padding: 10px 16px 40px;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .brand {
    font-size: 28px;
  }

  .brand-subtitle {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .hero-copy h1:not(.hero-title),
  .hero-title {
    font-size: 32px;
  }

  .hero-title {
    font-size: 22px;
    max-width: none;
  }

  .nav {
    width: 100%;
    padding: 8px;
    border-radius: 24px;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .nav a,
  .nav-dropdown summary,
  .nav-account-dropdown summary {
    min-height: 44px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .nav > a,
  .nav > .nav-dropdown {
    flex: 0 0 auto;
    min-width: 0;
  }

  .nav > a {
    text-align: center;
    justify-content: center;
  }

  .nav-account-dropdown {
    width: auto;
    margin-left: auto;
    z-index: 45;
  }

  .nav-account-dropdown summary {
    width: auto;
    min-width: 0;
    padding: 8px 10px;
    gap: 8px;
    justify-content: flex-start;
  }

  .nav-account-summary {
    min-width: 0;
    max-width: none;
  }

  .nav-account-summary-copy {
    display: block;
  }

  .nav-account-summary-label {
    display: none;
  }

  .nav-account-summary-name {
    font-size: 14px;
    line-height: 1;
  }

  .nav-account-summary::after {
    width: 7px;
    height: 7px;
    margin-left: 0;
    border-right-width: 1.5px;
    border-bottom-width: 1.5px;
    opacity: 0.7;
  }

  .nav-account-avatar {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .nav-dropdown-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    border-radius: 18px;
    box-shadow: none;
  }

  .nav-account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: max-content;
    min-width: 136px;
    max-width: min(180px, calc(100vw - 56px));
    margin-top: 0;
    padding: 8px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    background: rgba(255, 252, 247, 0.98);
  }

  .nav-account-menu-link,
  .nav-account-menu-button {
    min-height: 36px;
    padding: 8px 10px;
    justify-content: center;
    text-align: center;
  }

  .hero {
    gap: 10px;
    padding: 16px 14px;
  }

  .hero-copy {
    min-height: 0;
    gap: 12px;
  }

  .hero-copy-inner,
  .hero-description {
    max-width: none;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-actions .button-primary,
  .hero-actions .button-secondary {
    width: 100%;
  }

  .home-hero {
    margin-bottom: 6px;
  }

  .home-hero-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .home-hero-actions {
    gap: 6px;
    margin-top: 2px;
  }

  .home-hero-actions .button-primary {
    min-height: 42px;
  }

  .home-hero-actions .button-secondary,
  .home-stats {
    display: none;
  }

  .home-stat-pills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .home-stat-pill {
    min-width: 0;
    justify-content: center;
    padding: 8px 10px;
    gap: 4px;
    font-size: 11px;
  }

  .home-stat-pill strong {
    font-size: 12px;
  }

  .home-mobile-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 8px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 251, 246, 0.68);
    backdrop-filter: blur(8px);
  }

  .home-switch-button {
    min-height: 36px;
    padding: 0 10px;
  }

  .inline-form-compact select,
  .custom-select-trigger,
  .custom-select-option {
    font-size: 16px;
  }

  .cat-detail-mobile-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 4px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 251, 246, 0.68);
    backdrop-filter: blur(8px);
  }

  .cat-detail-switch-button {
    min-height: 32px;
    min-width: 0;
    padding: 0 4px;
    font-size: 12px;
    white-space: nowrap;
  }

  .cat-detail-mobile-panels {
    display: block;
    margin-top: 0;
  }

  .detail-top-section {
    display: none;
  }

  .cat-detail-mobile-identity {
    display: flex;
    margin: -2px 0 2px;
  }

  .cat-detail-mobile-identity-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 14px;
    border: 1px solid rgba(168, 120, 96, 0.16);
    border-radius: 999px;
    background: rgba(255, 252, 247, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    color: var(--heading-soft);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
  }

  .cat-detail-mobile-panel {
    display: none;
    min-height: 640px;
    max-height: 640px;
    margin-bottom: 0;
    padding: 10px 14px 14px;
  }

  .cat-detail-mobile-panel.is-active {
    display: flex;
    flex-direction: column;
  }

  .cat-detail-mobile-panel-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
  }

  .cat-detail-mobile-panel .section-head,
  .cat-detail-mobile-panel .section-head-events {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin-bottom: 10px;
  }

  .cat-detail-mobile-panel .section-head h2,
  .cat-detail-mobile-panel .section-head-events .section-head-copy > h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    color: var(--heading-soft);
  }

  .cat-detail-mobile-panel .section-head-tools .inline-form-compact select,
  .cat-detail-mobile-panel .section-head-tools .text-link {
    font-size: 12px;
  }

  .cat-detail-mobile-panel .section-head-tools {
    width: auto;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .cat-detail-mobile-panel .section-head-tools .inline-form-compact select,
  .cat-detail-mobile-panel .section-head-tools .text-link {
    font-size: 12px;
  }

  .cat-detail-mobile-panel .section-head-tools .inline-form-compact select {
    min-height: 38px;
    padding: 0 36px 0 14px;
  }

  .cat-detail-mobile-panel .chart {
    min-height: 150px;
    margin-top: 6px;
    padding: 10px 10px 6px;
  }

  .cat-detail-mobile-panel .chart svg {
    display: block;
  }

  .cat-detail-mobile-panel .timeline-list {
    margin: 0;
  }

  .cat-detail-mobile-panel .timeline-title-group strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .cat-detail-mobile-panel .timeline-meta,
  .cat-detail-mobile-panel .timeline-association {
    font-size: 11px;
    line-height: 1.4;
  }

  .cat-detail-mobile-panel .timeline-description {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
  }

  .cat-detail-mobile-panel .timeline-list,
  .cat-detail-mobile-panel .photo-empty-state {
    padding-bottom: 4px;
  }

  .cat-detail-photo-timeline {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-columns: auto;
    overflow-x: visible;
    gap: 10px;
    padding-bottom: 0;
  }

  .cat-detail-desktop-only {
    display: none;
  }

  .home-dashboard {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .home-panel {
    display: none;
    min-height: 0;
    margin-bottom: 0;
    padding: 12px 14px 14px;
  }

  .home-panel.is-active {
    display: flex;
  }

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

  .home-panel .section-head > h2,
  .home-panel .section-head > .home-mobile-section-label,
  .home-panel .section-head > .text-link {
    min-width: 0;
  }

  .home-panel .section-head > .text-link {
    flex-shrink: 0;
    font-size: 13px;
    white-space: nowrap;
  }

  .home-panel .section-head > .home-mobile-section-title {
    display: none;
  }

  .home-panel .section-head > .home-mobile-section-label {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--heading-strong);
  }

  .cat-grid,
  .compact-grid,
  .field-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dashboard-scroll-shell .compact-grid {
    gap: 10px;
  }

  .auth-page {
    min-height: auto;
    padding: 4px 0 24px;
  }

  .auth-panel {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .account-panel {
    padding: 24px 18px;
  }

  .auth-panel-head {
    margin-bottom: 14px;
  }

  .account-section-nav {
    border-radius: 22px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .photo-timeline {
    grid-auto-columns: 88%;
  }

  .timeline-page-head {
    gap: 12px;
    align-items: flex-start;
  }

  .timeline-page-title-row {
    width: 100%;
  }

  .timeline-page-add-link {
    display: none;
  }

  .timeline-page-title-main,
  .timeline-section-copy {
    flex-wrap: wrap;
    gap: 10px;
  }

  .timeline-list .timeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .timeline-list .timeline-title-group {
    flex: 1;
    min-width: 0;
  }

  .timeline-list .table-actions {
    margin-top: 2px;
    align-self: flex-start;
  }

  .detail-card-primary,
  .detail-card-secondary,
  .dashboard-panel {
    height: auto;
  }

  .detail-top-section > .panel,
  .detail-card-primary,
  .detail-card-secondary {
    width: 100%;
    min-width: 0;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-panel .section-head {
    margin-bottom: 12px;
  }

  .dashboard-scroll-shell {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0;
  }

  .dashboard-scroll-shell .cat-card,
  .dashboard-timeline-list li {
    padding: 14px;
  }

  .dashboard-scroll-shell .cat-card {
    gap: 8px;
  }

  .dashboard-scroll-shell .card-summary {
    display: block;
    overflow: visible;
    line-height: 1.5;
  }

  .dashboard-scroll-shell .cat-name {
    font-size: 18px;
  }

  .dashboard-scroll-shell .tag-row {
    gap: 8px;
  }

  .dashboard-scroll-shell .mini-tag {
    min-height: 24px;
    padding: 0 9px;
    font-size: 11px;
  }

  .dashboard-timeline-list li > p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    margin-top: 8px;
  }

  .detail-card-primary .title-row,
  .detail-card-secondary .section-head,
  .section-head-events {
    gap: 10px;
  }

  .detail-card-primary .title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .detail-card-secondary .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .detail-hero-photo {
    max-height: 200px;
    max-width: 100%;
    margin-bottom: 12px;
    border-radius: 18px;
  }

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

  .title-row h1 {
    font-size: 20px;
    line-height: 1.15;
  }

  .detail-card-primary .title-row h1 {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
  }

  .detail-card-primary .title-row .pill {
    flex: 0 0 auto;
    order: 0;
  }

  .detail-card-primary .title-row h1 {
    order: 1;
  }

  .meta-grid > span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.55;
  }

  .lead {
    font-size: 13px;
    line-height: 1.6;
  }

  .section-head {
    gap: 12px;
    align-items: flex-start;
  }

  .section-head-copy,
  .section-head-copy .lead,
  .section-head > h2 {
    min-width: 0;
  }

  .section-head-tools {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .detail-card-secondary .section-head-tools {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    min-width: 0;
    flex: 1;
  }

  .detail-card-secondary .section-head-tools > *,
  .detail-card-secondary .section-head-tools .inline-form {
    width: auto;
    min-width: 0;
  }

  .detail-card-secondary .section-head-tools .inline-form-compact select {
    width: auto;
  }

  .detail-card-secondary .section-head > h2 {
    flex: 0 1 auto;
    font-size: 18px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .detail-card-primary .title-row .pill {
    min-height: 28px;
    padding: 0 11px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .detail-card-secondary .section-head-tools .inline-form-compact select,
  .detail-card-secondary .section-head-tools .text-link {
    font-size: 13px;
  }

  .detail-card-secondary .section-head-tools .inline-form {
    flex: 0 0 auto;
  }

  .detail-card-secondary .section-head-tools .text-link {
    margin-left: auto;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .section-head > h2 {
    line-height: 1.1;
  }

  .chart {
    min-height: 180px;
    padding: 12px;
  }

  .chart text {
    font-size: 10px;
  }

  .table-scroll-shell {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    margin-top: 10px;
  }

  .data-table {
    min-width: 560px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 10px;
    white-space: nowrap;
  }

  .weight-table-shell {
    max-height: 300px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .weight-data-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  .weight-data-table th,
  .weight-data-table td {
    padding: 9px 4px;
    font-size: 11px;
  }

  .weight-data-table th {
    font-size: 12px;
    letter-spacing: 0.04em;
  }

  .weight-data-table th:nth-child(1),
  .weight-data-table td:nth-child(1) {
    width: 37%;
  }

  .weight-data-table th:nth-child(2),
  .weight-data-table td:nth-child(2) {
    width: 22%;
  }

  .weight-data-table th:nth-child(4),
  .weight-data-table td:nth-child(4) {
    width: 10%;
  }

  .weight-data-table th:nth-child(5),
  .weight-data-table td:nth-child(5) {
    width: 31%;
  }

  .weight-data-table th,
  .weight-data-table td {
    white-space: nowrap;
    text-align: center;
  }

  .weight-data-table th:nth-child(1),
  .weight-data-table td:nth-child(1) {
    text-align: left;
    padding-left: 8px;
  }

  .weight-data-table th:nth-child(2),
  .weight-data-table td:nth-child(2) {
    text-align: left;
    padding-left: 4px;
  }

  .weight-data-table td:nth-child(4) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
  }

  .weight-data-table .table-actions {
    gap: 4px;
    justify-content: center;
    width: 100%;
  }

  .weight-data-table .table-action-link,
  .weight-data-table .table-action-button {
    min-height: 22px;
    padding: 0 6px;
    font-size: 10px;
  }

  .inline-delete {
    opacity: 1;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 16px 12px 8px;
  }

  .page {
    padding: 10px 12px 32px;
  }

  .panel,
  .auth-panel,
  .account-panel {
    padding: 16px 12px;
  }

  .cat-detail-mobile-panel {
    min-height: 600px;
    max-height: 600px;
    padding: 10px 12px 12px;
  }

  .cat-detail-mobile-identity-pill {
    min-height: 26px;
    padding: 0 12px;
    font-size: 14px;
  }

  .cat-detail-switch-button {
    font-size: 11px;
    letter-spacing: 0;
  }

  .cat-detail-mobile-panel .section-head h2,
  .cat-detail-mobile-panel .section-head-events .section-head-copy > h2 {
    font-size: 15px;
  }

  .cat-detail-mobile-panel .section-head-tools .inline-form-compact select,
  .cat-detail-mobile-panel .section-head-tools .text-link {
    font-size: 11px;
  }

  .cat-detail-mobile-panel .section-head-tools .inline-form-compact select {
    min-height: 36px;
    padding: 0 32px 0 12px;
  }

  .cat-detail-mobile-panel .chart {
    min-height: 136px;
    padding: 8px 8px 4px;
  }

  .cat-detail-mobile-panel .timeline-title-group strong {
    font-size: 13px;
  }

  .cat-detail-mobile-panel .timeline-meta,
  .cat-detail-mobile-panel .timeline-association {
    font-size: 10px;
  }

  .cat-detail-mobile-panel .timeline-description {
    font-size: 12px;
  }

  .timeline-list .timeline-title-group strong {
    font-size: 13px;
  }

  .timeline-list .timeline-meta,
  .timeline-list .timeline-association {
    font-size: 10px;
  }

  .timeline-list .timeline-description {
    font-size: 12px;
  }

  .title-row h1 {
    font-size: 19px;
  }

  .detail-card-primary .title-row .pill {
    font-size: 10px;
  }

  .meta-grid > span {
    font-size: 13px;
  }

  .lead {
    font-size: 12px;
  }

  .detail-card-secondary .section-head > h2 {
    font-size: 17px;
  }

  .detail-card-secondary .section-head-tools .inline-form-compact select,
  .detail-card-secondary .section-head-tools .text-link {
    font-size: 12px;
  }

  .chart text {
    font-size: 9px;
  }

  .weight-data-table th {
    font-size: 11px;
  }

  .weight-data-table td {
    font-size: 10px;
  }

  .weight-data-table .table-action-link,
  .weight-data-table .table-action-button {
    font-size: 9px;
  }

  .home-stat-pills {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-top: 6px;
  }

  .home-stat-pill {
    padding: 7px 8px;
    gap: 3px;
    font-size: 10px;
  }

  .home-stat-pill strong {
    font-size: 11px;
  }

  .auth-page {
    padding: 2px 0 20px;
  }

  .auth-panel {
    border-radius: 20px;
  }

  .auth-panel-head {
    gap: 8px;
    margin-bottom: 12px;
  }

  .auth-panel-head h2 {
    font-size: 18px;
    line-height: 1.15;
  }

  .auth-register-note {
    font-size: 13px;
    line-height: 1.5;
  }

  .auth-form {
    gap: 10px;
  }

  .stack-form label {
    gap: 6px;
    font-size: 14px;
    line-height: 1.35;
  }

  .stack-form input,
  .stack-form select,
  .stack-form textarea,
  .stack-form button {
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
    font-size: 16px;
    line-height: 1.35;
    padding: 11px 13px;
    border-radius: 14px;
  }

  .stack-form input,
  .stack-form select,
  .stack-form textarea {
    background: rgba(255, 255, 255, 0.86);
  }

  .stack-form input::placeholder,
  .stack-form textarea::placeholder {
    color: rgba(119, 102, 93, 0.72);
  }

  .stack-form input[type="date"],
  .stack-form input[type="datetime-local"] {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }

  .stack-form input[type="date"]::-webkit-date-and-time-value,
  .stack-form input[type="datetime-local"]::-webkit-date-and-time-value {
    text-align: left;
    min-height: 1.2em;
  }

  .stack-form input[type="date"]::-webkit-datetime-edit,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    padding: 0;
  }

  .stack-form input[type="date"]::-webkit-datetime-edit-fields-wrapper,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
  .stack-form input[type="date"]::-webkit-datetime-edit-text,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-text,
  .stack-form input[type="date"]::-webkit-datetime-edit-year-field,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-year-field,
  .stack-form input[type="date"]::-webkit-datetime-edit-month-field,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-month-field,
  .stack-form input[type="date"]::-webkit-datetime-edit-day-field,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-day-field,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
  .stack-form input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
    min-width: 0;
  }

  .stack-form textarea {
    min-height: 104px;
    padding-top: 14px;
    padding-bottom: 14px;
    resize: vertical;
  }

  .stack-form button {
    min-height: 50px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .auth-secondary-action {
    margin-top: 10px;
  }

  .timeline-page-head {
    gap: 10px;
    margin-bottom: 18px;
  }

  .timeline-page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .timeline-page-title-row h1,
  .timeline-section-copy h2 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
  }

  .timeline-page-title-main,
  .timeline-section-copy {
    flex-wrap: wrap;
    gap: 8px;
  }

  .timeline-page-add-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
    margin-right: 6px;
    min-height: 34px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
  }

  .timeline-page-filter-form,
  .timeline-inline-filter-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
  }

  .timeline-page-filter-form .custom-select,
  .timeline-inline-filter-form .custom-select,
  .timeline-page-filter-form .timeline-time-range-select + .custom-select,
  .timeline-inline-filter-form .timeline-time-range-select + .custom-select {
    width: auto;
    max-width: 110px;
  }

  .timeline-page-filter-form .custom-select-trigger,
  .timeline-inline-filter-form .custom-select-trigger {
    width: auto !important;
    min-width: 0;
    max-width: 110px;
    justify-content: flex-start;
    padding-right: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 700;
  }

  .timeline-page-filter-form .custom-select-menu,
  .timeline-inline-filter-form .custom-select-menu {
    min-width: 136px !important;
  }

  .timeline-page-filter-form select.inline-select-event,
  .timeline-inline-filter-form select.inline-select-event,
  .timeline-page-filter-form select.timeline-time-range-select,
  .timeline-inline-filter-form select.timeline-time-range-select {
    width: auto;
    min-width: 0;
    max-width: 110px;
    min-height: 34px;
    padding: 0 30px 0 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
  }

  .timeline-list .timeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .timeline-list .timeline-title-group {
    flex: 1;
    min-width: 0;
  }

  .timeline-list .table-actions {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 0;
  }

  .timeline-list .table-action-link,
  .timeline-list .table-action-button {
    min-height: 22px;
    padding: 0 7px;
    font-size: 10px;
    flex: 0 0 auto;
  }

  .timeline-list .timeline-title-group strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .timeline-list .timeline-meta,
  .timeline-list .timeline-association {
    font-size: 11px;
    line-height: 1.4;
  }

  .timeline-list .timeline-description {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
  }

  .timeline-list {
    gap: 12px;
    max-height: min(68dvh, 760px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
  }

  .timeline-list::-webkit-scrollbar {
    width: 6px;
  }

  .timeline-list::-webkit-scrollbar-track {
    background: rgba(168, 120, 96, 0.08);
    border-radius: 999px;
  }

  .timeline-list::-webkit-scrollbar-thumb {
    background: rgba(255, 122, 89, 0.28);
    border-radius: 999px;
  }

  .timeline-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 122, 89, 0.42);
  }

  .timeline-list li {
    border-radius: 22px;
    border: 1px solid rgba(132, 84, 61, 0.12);
    border-left: 5px solid var(--accent);
    padding-right: 14px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.72),
      0 10px 22px rgba(122, 63, 34, 0.05);
  }

  .brand-wrap {
    gap: 6px;
  }

  .brand {
    font-size: 26px;
  }

  .nav {
    padding: 6px;
    gap: 6px;
    border-radius: 20px;
  }

  .nav > a,
  .nav > .nav-dropdown {
    flex: 0 0 auto;
  }

  .nav a,
  .nav-dropdown summary,
  .nav-account-dropdown summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
  }

  .nav-account-dropdown summary {
    justify-content: flex-start;
    padding: 10px 10px;
    min-height: 42px;
    align-items: center;
  }

  .hero {
    padding: 14px 12px;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 18px;
    line-height: 1.18;
  }

  .home-panel {
    padding: 10px 12px 12px;
  }

  .home-panel .section-head {
    margin-bottom: 8px;
  }

  .home-panel .section-head > .home-mobile-section-label {
    font-size: 14px;
  }

  .home-panel .section-head > .text-link {
    font-size: 12px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .section-head,
  .title-row,
  .timeline-head,
  .photo-section-head,
  .admin-card-head,
  .auth-panel-head,
  .auth-field-head {
    display: grid;
    gap: 10px;
  }

  .section-head-tools,
  .action-row {
    justify-content: stretch;
  }

  .weight-kg-column {
    display: none;
  }

  .family-photos-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .cats-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .cats-section-head > *,
  .family-photos-head > * {
    width: auto;
  }

  .cats-section-head h1,
  .family-photos-head h1 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
  }

  .cats-section-head .text-link,
  .family-photos-head .text-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
  }

  .family-members-grid {
    max-height: min(68dvh, 760px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
    align-content: start;
    gap: 10px;
  }

  .family-members-grid::-webkit-scrollbar {
    width: 6px;
  }

  .family-members-grid::-webkit-scrollbar-track {
    background: rgba(168, 120, 96, 0.08);
    border-radius: 999px;
  }

  .family-members-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 122, 89, 0.28);
    border-radius: 999px;
  }

  .family-members-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 122, 89, 0.42);
  }

  .section-head-tools > *,
  .action-row > * {
    width: 100%;
  }

  .cat-card,
  .dashboard-timeline-list li,
  .photo-card {
    border-radius: 18px;
  }

  .family-members-grid .cat-card {
    gap: 5px;
    padding: 12px;
  }

  .cats-section-head {
    margin-bottom: 6px;
  }

  .family-members-grid .card-visual,
  .family-members-grid .card-visual-meta {
    gap: 8px;
  }

  .family-members-grid .cat-photo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .family-members-grid .cat-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 20px;
  }

  .family-members-grid .pill {
    min-height: 24px;
    padding: 0 10px;
    font-size: 11px;
  }

  .family-members-grid .cat-name {
    font-size: 17px;
    line-height: 1.1;
  }

  .family-members-grid .card-summary {
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .family-members-grid .info-pairs {
    gap: 6px;
    font-size: 11px;
  }

  .family-members-grid .info-item {
    gap: 3px;
    padding: 7px 9px;
    border-radius: 10px;
  }

  .family-members-grid .info-item strong {
    font-size: 13px;
    line-height: 1.2;
  }

  .family-members-grid .info-item span {
    font-size: 11px;
    line-height: 1.1;
  }

  .family-members-grid .cat-card-actions {
    margin-top: 4px;
    justify-content: flex-end;
  }

  .family-members-grid .table-action-link,
  .family-members-grid .table-action-button {
    min-height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }

  .family-photo-timeline {
    grid-auto-columns: minmax(132px, 156px);
    gap: 10px;
  }

  .family-photo-card {
    gap: 6px;
    padding: 8px;
  }

  .family-photo-card .photo-date-badge {
    top: 8px;
    left: 8px;
    min-height: 22px;
    padding: 0 9px;
    font-size: 10px;
  }

  .family-photo-card .photo-preview-trigger img {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
  }

  .family-photo-card figcaption {
    gap: 2px;
  }

  .family-photo-card strong {
    font-size: 12px;
    line-height: 1.3;
  }

  .family-photo-card span {
    font-size: 11px;
  }

  .family-photo-card .media-actions {
    margin-top: 4px;
  }

  .family-photo-card .table-action-link,
  .family-photo-card .table-action-button {
    min-height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }

  .cat-card-actions {
    margin-top: -38px;
  }
}
