:root {
  color-scheme: light;
  --page-bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --ink: #17221e;
  --muted: #65746f;
  --line: #d8e2de;
  --header: #0f766e;
  --accent: #2563eb;
  --danger: #b4233c;
  --gold: #b87512;
  --good: #177245;
  --shadow: 0 18px 48px rgba(18, 33, 29, 0.12);
  --shadow-lift: 0 22px 56px rgba(18, 33, 29, 0.16);
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-swift: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 160ms var(--ease-swift);
  --transition-base: 240ms var(--ease-standard);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--page-bg);
  background-size: cover;
  background-position: center;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.loading {
  cursor: progress;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.brand-button,
.nav-link,
.side-action,
.text-button,
.btn,
.auth-panel,
.panel,
.state-card,
.pet-card,
.owner-card,
.stat,
.pet-item,
.modal,
.input,
.select,
textarea.input {
  transition:
    box-shadow var(--transition-base),
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.site-header {
  width: min(1180px, calc(100vw - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-button-panel {
  width: 100%;
  display: grid;
  align-items: stretch;
  gap: 8px;
}

.brand-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-copy {
  min-width: 0;
}

.brand-button strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-button small {
  display: block;
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-email {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-self: start;
  display: block;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--header), var(--gold));
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-mark.image {
  background: #ffffff;
  padding: 3px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.site-nav,
.toolbar,
.actions,
.empty-actions,
.state-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link,
.side-action,
.text-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.nav-link {
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav-link.primary {
  background: var(--ink);
  color: #fff;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}

.btn.primary {
  border-color: var(--header);
  background: var(--header);
  color: #fff;
}

.btn.large {
  min-height: 52px;
  padding: 13px 20px;
  font-size: 16px;
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 18px;
  line-height: 1;
}

.btn.dark {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.btn.ghost.danger {
  background: #fff;
  color: var(--danger);
}

.btn:disabled,
.input:disabled,
.select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.icon-only {
  width: 38px;
  padding: 0;
}

.guest-page,
.qr-page {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding-bottom: 42px;
}

.qr-page {
  padding-top: 24px;
}

.guest-page .site-header,
.qr-page .site-header {
  width: 100%;
}

.guest-hero {
  min-height: min(610px, calc(100vh - 112px));
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: clamp(30px, 6vw, 86px);
  align-items: center;
  padding: clamp(34px, 7vw, 72px) 0 clamp(42px, 7vw, 76px);
}

.guest-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  animation: surface-in 540ms var(--ease-standard) both;
}

.guest-copy h1 {
  max-width: 760px;
  margin: 0;
  color: #17221e;
  font-size: clamp(42px, 5.4vw, 72px);
  font-weight: 920;
  line-height: 1.04;
}

.guest-copy > p {
  max-width: 590px;
  margin: 0;
  color: #53645f;
  font-size: 19px;
  line-height: 1.55;
}

.guest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2px;
}

.guest-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
  padding-top: 12px;
}

.guest-points span {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 9px 0 9px 14px;
  border-left: 3px solid var(--header);
  color: #52635e;
  font-size: 14px;
  font-weight: 820;
  line-height: 1.25;
}

.guest-points span:nth-child(2) {
  border-left-color: #517094;
}

.guest-points span:nth-child(3) {
  border-left-color: var(--gold);
}

.hero-pets {
  position: relative;
  min-width: 0;
  margin: 0;
  align-self: center;
  overflow: hidden;
  animation: hero-pets-in 640ms var(--ease-standard) both 80ms;
}

.hero-pets::before {
  content: "";
  position: absolute;
  inset: 5% 0 3%;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 24%, rgba(15, 118, 110, 0.08), transparent 38%),
    linear-gradient(135deg, rgba(15, 118, 110, 0.04), rgba(81, 112, 148, 0.055)),
    #f9fbfa;
}

.hero-pets img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  padding: clamp(18px, 4vw, 34px);
}

.guest-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.guest-flow article {
  display: grid;
  gap: 10px;
  min-height: 150px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 33, 29, 0.055);
  transform: translateY(0);
  transition:
    transform var(--transition-base),
    border-color var(--transition-fast),
    box-shadow var(--transition-base);
}

.guest-flow article:hover {
  border-color: #bcd1ca;
  box-shadow: 0 18px 36px rgba(18, 33, 29, 0.08);
  transform: translateY(-3px);
}

.guest-flow span {
  color: var(--header);
  font-size: 13px;
  font-weight: 950;
}

.guest-flow h3 {
  margin: 0;
  color: #17221e;
  font-size: 21px;
  line-height: 1.12;
}

.guest-flow p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.guest-footer {
  min-height: 110px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 720px) auto;
  gap: 24px;
  align-items: center;
  padding: 24px 0;
  color: #53645f;
  font-size: 14px;
}

.guest-footer > div {
  display: grid;
  gap: 4px;
}

.guest-footer strong {
  color: #17221e;
  font-size: 18px;
}

.guest-footer nav {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  justify-items: center;
  gap: 8px 16px;
}

.footer-link {
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: #53645f;
  font: inherit;
  line-height: 1.35;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--header);
}

.legal-modal .panel-head h2,
.registration-consent .panel-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.15;
}

.legal-modal .panel-head p,
.registration-consent .panel-head p {
  margin: 0;
  color: var(--muted);
}

.legal-content {
  color: var(--ink);
  line-height: 1.62;
}

.legal-content h1,
.legal-content h2,
.legal-content h3,
.legal-content h4 {
  margin: 0 0 10px;
  line-height: 1.2;
}

.legal-content h1 {
  font-size: 28px;
}

.legal-content h2 {
  margin-top: 24px;
  font-size: 21px;
}

.legal-content h3 {
  margin-top: 18px;
  font-size: 17px;
}

.legal-content h4 {
  margin-top: 16px;
  font-size: 15px;
}

.legal-content p,
.legal-content ul,
.legal-content blockquote {
  margin: 0 0 14px;
}

.legal-content ul {
  padding-left: 22px;
}

.legal-content blockquote {
  padding: 10px 14px;
  border-left: 3px solid var(--header);
  background: #f4f8f6;
  color: var(--muted);
}

.legal-content blockquote p:last-child {
  margin-bottom: 0;
}

.legal-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.legal-content a {
  color: var(--header);
  font-weight: 800;
}

.legal-consent-list {
  display: grid;
  gap: 14px;
}

.legal-consent-doc {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.legal-consent-doc details {
  padding: 0;
}

.legal-consent-doc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.legal-consent-doc summary::-webkit-details-marker {
  display: none;
}

.legal-consent-doc summary span {
  display: grid;
  gap: 3px;
}

.legal-consent-doc summary strong {
  color: var(--ink);
}

.legal-consent-doc summary small {
  color: var(--muted);
}

.legal-consent-doc .legal-content {
  max-height: 280px;
  overflow: auto;
  padding: 4px 16px 16px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.legal-check {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 850;
}

.legal-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.nav-link:hover,
.nav-link:focus-visible,
.side-action:hover,
.side-action:focus-visible,
.text-button:hover,
.text-button:focus-visible {
  background: rgba(15, 118, 110, 0.08);
}

.btn:hover:not(:disabled),
.btn:focus-visible {
  box-shadow: 0 12px 24px rgba(18, 33, 29, 0.12);
}

.btn.primary:hover:not(:disabled),
.btn.dark:hover:not(:disabled),
.btn.danger:hover:not(:disabled) {
  box-shadow: 0 16px 28px rgba(18, 33, 29, 0.18);
}

.auth-panel,
.panel,
.state-card,
.pet-card,
.owner-card,
.pet-photo,
.empty-pet,
.stat,
.pet-item {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel:hover,
.panel:hover,
.state-card:hover,
.pet-card:hover,
.owner-card:hover,
.empty-pet:hover,
.stat:hover,
.pet-item:hover {
  border-color: color-mix(in srgb, var(--line) 68%, var(--header));
  box-shadow: 0 16px 32px rgba(18, 33, 29, 0.085);
}

.auth-panel {
  padding: 26px;
  animation: surface-in 620ms var(--ease-standard) both 80ms;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid h2,
.panel h2,
.pet-item h3 {
  margin: 0;
}

.form-grid p,
.panel-head p,
.pet-item p,
.notification p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 7px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field.wide,
.wide {
  grid-column: 1 / -1;
}

.input,
.select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

.input::placeholder,
textarea.input::placeholder {
  color: #8a9994;
  opacity: 1;
}

.input[type="file"] {
  min-height: 48px;
  padding: 0;
  border-style: dashed;
  background: linear-gradient(180deg, #ffffff 0%, #f6faf8 100%);
  color: var(--muted);
  cursor: pointer;
}

.input[type="file"]::file-selector-button {
  min-height: 46px;
  margin: 0 12px 0 0;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #e9f1ee;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.input[type="file"]:hover::file-selector-button {
  background: #dcebe5;
}

.input:focus-visible,
.select:focus-visible,
textarea.input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, white);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea.input {
  min-height: 96px;
  resize: vertical;
}

.debug-code {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e5;
  border: 1px solid #f4d28b;
  color: #7a4b05;
  font-weight: 900;
}

.public-header {
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--header), #1f2937);
  color: #fff;
  box-shadow: var(--shadow);
  animation: surface-in 480ms var(--ease-standard) both;
}

.public-header > div:last-child {
  min-width: 0;
}

.header-logo {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  overflow: hidden;
  flex: 0 0 68px;
  font-weight: 900;
}

.header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  opacity: 0.78;
  font-weight: 800;
}

.public-header h1,
.state-card h1,
.empty-pet h1 {
  margin: 4px 0 0;
  line-height: 1.08;
}

.public-header h1 {
  font-size: clamp(28px, 5vw, 54px);
}

.lost-banner {
  margin-top: 16px;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 8px;
  background: #fff1f3;
  border: 1px solid #ffc7d0;
  color: #74182a;
  box-shadow: var(--shadow);
}

.lost-banner strong {
  display: block;
  font-size: 20px;
}

.lost-banner span {
  display: block;
  margin-top: 4px;
}

.pet-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr) 340px;
  gap: 18px;
  align-items: start;
}

.pet-photo {
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
}

.pet-photo img,
.pet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pet-photo.placeholder,
.pet-thumb.placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf6f3, #fff8ea);
  color: var(--header);
  font-weight: 950;
}

.paw {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--header);
  color: #fff;
  font-weight: 900;
  font-size: 28px;
}

.thumbs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.pet-card,
.owner-card {
  padding: 20px;
}

.code-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf4f1;
  color: #31433d;
  font-size: 12px;
  font-weight: 850;
}

.badge.good {
  background: #e9f8ef;
  color: #126438;
}

.badge.bad {
  background: #fff1f3;
  color: var(--danger);
}

.badge.warn {
  background: #fff8e5;
  color: #7a4b05;
}

.pet-card h2 {
  margin: 12px 0 16px;
  font-size: clamp(32px, 6vw, 62px);
  line-height: 1;
}

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

.fact {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: #f6faf8;
  border: 1px solid var(--line);
}

.fact span,
.contact-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fact strong,
.contact-row strong,
.contact-row a {
  font-size: 16px;
  font-weight: 850;
  word-break: break-word;
}

.comment {
  margin-top: 14px;
  padding: 14px;
  border-left: 4px solid var(--header);
  background: #fbfdfc;
  border-radius: 8px;
  line-height: 1.5;
}

.comment.small {
  font-size: 14px;
}

.owner-card h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.contact-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.contact-row a {
  color: var(--header);
}

.empty-block,
.empty {
  padding: 18px;
  border-radius: 8px;
  background: #f6faf8;
  color: var(--muted);
}

.empty.large {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-pet {
  margin-top: 18px;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
}

.empty-pet.with-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
  padding-inline: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.empty-pet.with-auth:hover {
  border-color: transparent;
  box-shadow: none;
}

.empty-pet.with-auth .empty-actions,
.empty-pet.with-auth .form-grid {
  width: 100%;
}

.claim-rail {
  display: grid;
  gap: 16px;
  align-self: stretch;
}

.empty-pet-copy {
  min-width: 0;
}

.claim-card {
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--header));
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.04) 52%, #fff 100%);
  box-shadow: 0 18px 42px rgba(18, 33, 29, 0.1);
}

.claim-card-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--header);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.12);
}

.claim-card-mark svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.claim-card strong,
.claim-card span {
  display: block;
}

.claim-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.claim-card span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.claim-button {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  justify-content: space-between;
  padding-inline: 18px;
}

.claim-button span {
  margin: 0;
  color: inherit;
}

.claim-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.claim-form {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.claim-form .empty-actions {
  justify-content: flex-start;
}

.empty-pet h1 {
  margin-top: 12px;
  font-size: clamp(34px, 7vw, 72px);
}

.empty-pet p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.state-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.state-card {
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
}

.state-card.error {
  border-color: #ffc7d0;
}

.loader {
  display: flex;
  gap: 8px;
}

.loader span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--header);
  animation: pulse 0.9s infinite alternate;
}

.loader span:nth-child(2) {
  animation-delay: 0.15s;
}

.loader span:nth-child(3) {
  animation-delay: 0.3s;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 850;
}

.side-nav button.active {
  border-color: #cfe1db;
  background: #edf6f3;
  color: #0b5f58;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.limit-box {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.limit-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.limit-box strong {
  font-size: 24px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

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

.stat {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 18px;
}

.stat span,
.stat small,
.mini-row span,
table small,
.muted {
  color: var(--muted);
}

.stat strong {
  font-size: 42px;
  line-height: 1;
}

.panel {
  padding: 18px;
  animation: surface-in 440ms var(--ease-standard) both;
}

.panel.warning {
  border-color: #f4d28b;
  background: #fff8e5;
  color: #7a4b05;
  font-weight: 850;
}

.panel.danger-zone {
  border-color: #ffc7d0;
}

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

.panel-body {
  display: grid;
  gap: 16px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.74fr);
  gap: 18px;
  align-items: start;
}

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

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

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.mini-row strong,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

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

.pet-item {
  overflow: hidden;
}

.pet-thumb {
  aspect-ratio: 16 / 10;
  background: #edf6f3;
}

.pet-item-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.pet-item h3 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.05;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.attach-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
}

.actions.compact {
  gap: 6px;
}

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

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

.toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  font-weight: 800;
}

.toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

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

.notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notification.unread {
  border-color: #bfdbfe;
  background: #f1f7ff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.modal {
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid #dbe2df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  animation: modal-in 260ms var(--ease-standard) both;
}

.modal.modal--legal {
  width: min(1320px, calc(100vw - 24px));
  max-height: min(92vh, calc(100vh - 36px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal.modal--legal > .legal-modal,
.modal.modal--legal > .registration-consent {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modal.modal--legal .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.modal .panel-head,
.modal .panel-body {
  padding: 18px;
}

.modal .panel-head {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.scanner-panel {
  display: grid;
  gap: 14px;
}

.scanner-frame {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 390px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: #0f172a;
}

.scanner-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-target {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.26);
}

.scanner-tools {
  display: grid;
  grid-template-columns: minmax(150px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.scanner-file-button {
  position: relative;
  overflow: hidden;
  justify-content: center;
}

.scanner-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scanner-manual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 8px;
  background: #0f3f3a;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 850;
  animation: toast-in 280ms var(--ease-standard) both;
}

.toast.error {
  background: var(--danger);
}

@keyframes pulse {
  from {
    opacity: 0.3;
    transform: translateY(0);
  }

  to {
    opacity: 1;
    transform: translateY(-5px);
  }
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-pets-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    transform: translateY(20px) scale(0.98);
  }

  to {
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1100px) {
  .guest-hero,
  .split {
    grid-template-columns: 1fr;
  }

  .guest-hero {
    min-height: auto;
  }

  .guest-copy {
    min-height: auto;
  }

  .hero-pets {
    width: min(720px, 100%);
    justify-self: center;
  }

  .pet-layout {
    grid-template-columns: 1fr 1fr;
  }

  .owner-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-nav button {
    text-align: center;
  }

  .sidebar-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

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

  .guest-flow {
    grid-template-columns: 1fr;
  }

  .guest-footer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .guest-footer nav {
    justify-content: flex-start;
    justify-items: start;
  }
}

@media (max-width: 720px) {
  .guest-page,
  .qr-page {
    width: min(calc(100% - 20px), 1180px);
    padding-bottom: 24px;
    overflow-x: hidden;
  }

  .qr-page {
    padding-top: 14px;
  }

  .site-header,
  .topbar,
  .public-header,
  .lost-banner,
  .empty-pet,
  .notification {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav,
  .toolbar,
  .empty-actions,
  .state-actions {
    width: 100%;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-nav .nav-link,
  .toolbar .btn,
  .empty-actions .btn,
  .state-actions .btn {
    flex: 1 1 auto;
  }

  .guest-hero {
    gap: 18px;
    padding-top: 10px;
  }

  .guest-copy {
    min-height: auto;
    gap: 15px;
  }

  .guest-copy h1 {
    font-size: clamp(34px, 10vw, 46px);
    overflow-wrap: anywhere;
  }

  .guest-copy > p {
    font-size: 16px;
  }

  .guest-actions .btn {
    width: 100%;
  }

  .guest-points {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .guest-points span {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .hero-pets {
    width: min(560px, 100%);
  }

  .guest-flow {
    padding-top: 18px;
  }

  .guest-footer nav {
    grid-template-columns: 1fr;
  }

  .footer-link {
    text-align: left;
  }

  .attach-row,
  .pet-layout,
  .facts,
  .grid.two,
  .toggle-grid,
  .mini-row,
  .scanner-tools,
  .scanner-manual {
    grid-template-columns: 1fr;
  }

  .public-header {
    min-height: auto;
  }

  .empty-pet.with-auth {
    grid-template-columns: 1fr;
  }

  .claim-card {
    padding: 20px;
  }

  .main {
    padding: 16px;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 10px;
  }

  .site-nav {
    gap: 8px;
  }

  .nav-link {
    padding: 8px 9px;
    font-size: 15px;
  }

  .guest-copy h1 {
    font-size: 34px;
    line-height: 1.08;
  }
}
