/* Layout and tokens adapted from codex-pet-share (MIT). See THIRD_PARTY.md. */
@font-face { font-family: "Cabinet Grotesk"; font-style: normal; font-weight: 300; font-display: swap; src: url("/fonts/cabinet-grotesk-300.woff2") format("woff2"); }
@font-face { font-family: "Cabinet Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/cabinet-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Cabinet Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/cabinet-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Cabinet Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/cabinet-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "Cabinet Grotesk"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/cabinet-grotesk-800.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/jetbrains-mono-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/jetbrains-mono-600.woff2") format("woff2"); }


:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-warm: #f0efeb;
  --surface-soft: #eae9e4;
  --nav-bg: rgba(246, 245, 242, 0.82);
  --nav-action-bg: rgba(255, 255, 255, 0.8);
  --nav-action-bg-hover: #ffffff;
  --noise-opacity: 0.028;
  --noise-blend: multiply;

  --ink: #16130e;
  --foreground: #221f19;
  --muted: #6d685e;
  --subtle: #a09a8e;

  --border: #e5e2db;
  --border-soft: #edebe5;
  --border-strong: #d1ccc1;

  --accent: #c76a04;
  --accent-deep: #9a5203;
  --accent-soft: #f9eedd;
  --accent-glow: rgba(199, 106, 4, 0.16);
  --accent-ink: #4a2a02;
  --danger: #d92d20;
  --danger-bg: transparent;
  --danger-bg-hover: #fff3f0;
  --danger-border: #e6b5aa;
  --danger-border-hover: #9f2f22;
  --danger-fg: #9f2f22;
  --danger-fg-hover: #7f1d1d;
  --primary-bg: var(--ink);
  --primary-bg-hover: #2b2620;
  --primary-fg: #f6f5f2;
  --terminal-bg: #161310;
  --terminal-border: #2e2921;
  --terminal-fg: #ece6da;
  --terminal-prompt: #f0a03c;

  --tile-grid: rgba(176, 168, 152, 0.35);
  --tile-bg: #ffffff;
  --stage-checker-a: #ffffff;
  --stage-checker-b: #f6f4f0;
  --preview-surface: #ffffff;
  --preview-halo: rgba(226, 221, 210, 0.7);
  --preview-soft-top: #fefdf9;
  --preview-ground: rgba(22, 19, 14, 0.07);
  --floating-control-bg: rgba(255, 255, 255, 0.92);
  --floating-control-bg-hover: #ffffff;
  --rail-bg: rgba(255, 255, 255, 0.72);
  --inset-highlight: rgba(255, 255, 255, 0.55);

  --font-sans: "Cabinet Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-display: "Clash Display", "Cabinet Grotesk", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 26px;

  --shadow-sm: 0 1px 2px rgba(22, 19, 14, 0.05);
  --shadow-md: 0 10px 24px -12px rgba(22, 19, 14, 0.14);
  --shadow-lg: 0 28px 64px -28px rgba(22, 19, 14, 0.2);
  --shadow-modal: 0 60px 120px -40px rgba(22, 19, 14, 0.34);
  --ring: 0 0 0 3px var(--accent-glow);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-swift: cubic-bezier(0.32, 0.72, 0, 1);

  color: var(--foreground);
  background: var(--bg);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss03", "cv01";
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] {
  --bg: #0c0c0e;
  --surface: #141417;
  --surface-warm: #19191d;
  --surface-soft: #202025;
  --nav-bg: rgba(12, 12, 14, 0.84);
  --nav-action-bg: rgba(25, 25, 29, 0.8);
  --nav-action-bg-hover: #202025;
  --noise-opacity: 0.07;
  --noise-blend: screen;

  --ink: #f4f1e8;
  --foreground: #e8e5dc;
  --muted: #a09c92;
  --subtle: #6c6961;

  --border: #29292f;
  --border-soft: #202026;
  --border-strong: #3b3b44;

  --accent: #f5a83c;
  --accent-deep: #fcc06a;
  --accent-soft: rgba(245, 168, 60, 0.13);
  --accent-glow: rgba(245, 168, 60, 0.22);
  --accent-ink: #ffd699;
  --danger: #fb7185;
  --danger-bg: rgba(251, 113, 133, 0.08);
  --danger-bg-hover: rgba(251, 113, 133, 0.14);
  --danger-border: rgba(251, 113, 133, 0.24);
  --danger-border-hover: rgba(251, 113, 133, 0.42);
  --danger-fg: #fda4af;
  --danger-fg-hover: #ffe4e6;
  --primary-bg: var(--ink);
  --primary-bg-hover: #ffffff;
  --primary-fg: #131313;
  --terminal-bg: #0e0d0b;
  --terminal-border: #2b2822;
  --terminal-fg: #e8e3d6;
  --terminal-prompt: #fbb64b;

  --tile-grid: rgba(214, 205, 180, 0.14);
  --tile-bg: #131316;
  --stage-checker-a: #17171b;
  --stage-checker-b: #1c1c21;
  --preview-surface: #17171b;
  --preview-halo: rgba(84, 82, 74, 0.4);
  --preview-soft-top: #1d1d22;
  --preview-ground: rgba(0, 0, 0, 0.3);
  --floating-control-bg: rgba(22, 22, 26, 0.92);
  --floating-control-bg-hover: #202025;
  --rail-bg: rgba(20, 20, 24, 0.74);
  --inset-highlight: rgba(255, 255, 255, 0.07);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 10px 24px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 64px -28px rgba(0, 0, 0, 0.7);
  --shadow-modal: 0 60px 120px -42px rgba(0, 0, 0, 0.85);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/assets/noise.svg");
  opacity: var(--noise-opacity);
  mix-blend-mode: var(--noise-blend);
}

button,
input,
a {
  font: inherit;
}

button,
a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}

a {
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* Frame */
[hidden] { display: none !important; }
body > * { position: relative; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: middle; }
.srOnly, .skipLink:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skipLink:focus { position: fixed; top: 10px; left: 80px; z-index: 300; background: var(--surface); padding: 12px; }
.appSidebar { position: fixed; inset: 0 auto 0 0; width: 68px; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 14px; z-index: 120; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.sidebarBrand { display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.brandMark { display: block; width: 40px; height: 40px; object-fit: contain; clip-path: inset(9%); transform: scale(1.2); }
.brandWordmark { font-family: var(--font-mono); font-weight: 500; font-size: 21px; color: var(--ink); letter-spacing: -.7px; }
.brandWordmark::before { content: '$ '; color: var(--accent); }
.sidebarSectionLabel, .sidebarNavLabel, .appSidebar .brandWordmark { display: none; }
.sidebarNav { display: grid; justify-items: center; gap: 4px; }
.sidebarNavItem { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--muted); }
.sidebarNavItem:hover { color: var(--ink); background: var(--surface-soft); }
.sidebarNavItem.active { background: var(--accent-soft); color: var(--accent-ink); }
.sidebarBottom { display: grid; justify-items: center; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.iconButton { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.iconButton:hover { color: var(--ink); border-color: var(--border-strong); }
.appTopbar, .sidebarBackdrop { display: none; }
.appCanvas { margin-left: 68px; min-width: 0; position: relative; }
.appContent { width: min(1320px, 100% - 56px); margin: 0 auto; padding: 22px 0 96px; }
.siteFooter { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 56px; padding: 20px 0; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); }
.siteFooter > :first-child { font-family: var(--font-mono); }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--foreground); padding: 0 16px; font-family: var(--font-sans); font-size: 13px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; transition: background 180ms, border-color 180ms, transform 120ms; }
.btn:hover:not(:disabled) { border-color: var(--ink); background: var(--surface); color: var(--ink); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { border-color: var(--primary-bg); background: var(--primary-bg); color: var(--primary-fg); }
.btn.primary:hover { background: var(--primary-bg-hover); color: var(--primary-fg); }
.btn.full { display: flex; width: 100%; min-height: 46px; font-size: 15px; }
input { min-width: 0; color: var(--foreground); background: var(--surface); }
input::placeholder { color: var(--subtle); }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.copyStatus { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; padding: 12px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); font-size: 14px; }
.copyStatus:empty { display: none; }

/* Gallery */
.galleryTools { display: grid; gap: 16px; padding: 32px 0 16px; }
.galleryToolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; align-items: center; }
.searchField { height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); }
.searchField .icon { width: 18px; height: 18px; }
.searchField:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.searchField input { width: 100%; height: 100%; outline: none; border: 0; background: transparent; font-size: 16px; }
.galleryToolbar > .btn { height: 52px; padding: 0 24px; font-size: 14px; }
.galleryControlRow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.sortPill { display: inline-flex; align-items: center; justify-content: center; padding: 8px 18px; border-radius: 999px; background: var(--ink); color: var(--primary-fg); font-family: var(--font-mono); font-size: 12px; }
.resultBar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 10px 0; border-top: 1px solid var(--border-soft); color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.resultBar h1 { font: inherit; margin: 0; }
.galleryTopPagination { display: flex; justify-content: flex-end; margin: 12px 0 20px; }
.paginationControls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 26px; }
.galleryTopPagination .paginationControls { margin-top: 0; }
.paginationJump { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface-soft) 72%, transparent); font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.paginationJump label { padding-left: 9px; font-size: 11px; }
.paginationJump input { width: 56px; height: 28px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-mono); font-size: 12px; text-align: center; }
.paginationJump .btn { min-height: 28px; padding: 0 12px; font-size: 12px; }
.galleryGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 14px; }
.petCard { display: flex; flex-direction: column; min-width: 0; min-height: 340px; height: 100%; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); transition: border-color 180ms, box-shadow 180ms; }
.petCard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.petCardPreview, .detailPreview { display: grid; place-items: center; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 82%, var(--preview-ground), transparent 60%), conic-gradient(var(--stage-checker-b) 25%, transparent 0 50%, var(--stage-checker-b) 0 75%, transparent 0); background-size: auto, 18px 18px; background-color: var(--stage-checker-a); }
.petCardPreview { height: 189px; border-radius: 19px 19px 0 0; border-bottom: 1px solid var(--border-soft); padding: 8px 18px; }
.petCardPreview img { display: block; max-width: 100%; width: auto; height: 172px; object-fit: contain; }
.petCardBody { display: grid; align-content: start; gap: 10px; flex: 1; padding: 10px 18px 16px; min-height: 191px; color: inherit; }
.petCardBody h2 { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 18px; font-weight: 600; line-height: 1.18; letter-spacing: -.025em; color: var(--ink); }
.cardCode { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.petCardDescription { margin: 2px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.petCardDescription strong { font-weight: 400; }
.petCardActions { display: flex; align-items: center; gap: 14px; padding: 10px 18px 12px; border-top: 1px solid var(--border-soft); }
.petCardActions a, .petCardActions button { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.petCardActions a:hover, .petCardActions button:hover { color: var(--ink); }
.petCardActions .icon { width: 13px; height: 13px; }
.imageFallback { font-size: 13px; color: var(--muted); padding: 16px; }
.emptyState { display: grid; justify-items: center; text-align: center; align-content: center; min-height: 350px; gap: 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.emptyState > .icon { width: 30px; height: 30px; color: var(--subtle); }
.emptyState h2 { font-size: 19px; font-weight: 600; margin: 0; }
.emptyState p { color: var(--muted); margin: 0; font-size: 15px; }

/* Detail and registration */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 26px; padding: 28px; }
.detailLayout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 18px; align-items: start; padding-top: 32px; }
.detailHero { display: grid; gap: 28px; padding: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; }
.detailHeader { display: grid; gap: 14px; min-width: 0; }
.detailHeader > * { margin: 0; }
.detailSpecimen { font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.detailSpecimen strong { color: var(--ink); font-weight: 500; }
.detailHeader h1 { font-size: clamp(36px, 5.3vw, 72px); font-weight: 600; letter-spacing: -.055em; line-height: 1.05; overflow-wrap: anywhere; }
.detailHeader > p:last-child { color: var(--muted); font-size: 17px; }
.detailPreview { height: 450px; border-radius: 20px; border: 1px solid var(--border-soft); }
.detailPreview img { position: absolute; width: 100%; height: 100%; padding: 32px; object-fit: contain; }
.detailActions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.detailActions > span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.installPanel { display: grid; gap: 20px; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(140deg, color-mix(in srgb, var(--accent-soft) 25%, transparent), transparent 55%), var(--surface); box-shadow: var(--shadow-lg); }
.installPanel header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.installPanel header h2 { font-family: var(--font-mono); font-size: 13px; font-weight: 500; white-space: nowrap; margin: 0; }
.installPanel header p { color: var(--muted); font-size: 13px; margin: 0; }
.importNote { color: var(--muted); font-size: 13px; margin: -8px 0 0; }
.codePanel { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-warm); }
.codePanel code { display: block; background: var(--terminal-bg); color: var(--terminal-fg); padding: 20px 16px; border-radius: 14px; font-family: var(--font-mono); font-size: 19px; overflow-wrap: anywhere; }
.codePanel .btn { justify-self: end; }
.voiceList { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 14px; margin: 0; }
.voiceList > div { padding: 17px; }
.voiceList > div + div { border-left: 1px solid var(--border-soft); }
.voiceList dt { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.voiceList dd { margin: 0; font-size: 14px; }
.soulPanel { grid-column: 1 / -1; }
.soulPanel > header { display: flex; align-items: center; justify-content: space-between; }
.soulPanel h2 { font-size: 16px; font-weight: 600; }
.soulPanel pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.9 var(--font-sans); margin: 16px 0 0; }
.formLayout { padding-top: 32px; }
.formHeader { margin-bottom: 30px; }
.formHeader h1 { font-size: 48px; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; margin: 14px 0; }
.formHeader > p:last-child { font-size: 16px; color: var(--muted); }
.registrationLayout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 18px; max-width: 1100px; }
.registrationCard > label { font-size: 16px; font-weight: 600; }
.fieldHelp { font-size: 14px; color: var(--muted); margin: 10px 0 18px; }
.registrationCard input[type=url] { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; font-size: 15px; }
.registrationCard input[aria-invalid=true] { border-color: var(--danger); }
.honey { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.formStatus { font-size: 14px; min-height: 22px; line-height: 1.6; margin: 15px 0; color: var(--muted); }
.formStatus.is-error { color: var(--danger); }
.registrationNote { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 22px 0 0; }
.previewCard { border-top: 1px solid var(--border); padding-top: 20px; margin-bottom: 24px; }
.previewCard h2 { font-size: 22px; font-weight: 600; }
.previewCard > p { color: var(--muted); font-size: 14px; }
.previewCard details { border-top: 1px solid var(--border-soft); padding-top: 15px; font-size: 14px; }
.previewCard pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; max-height: 300px; overflow: auto; }
.helpPanel h2 { font-size: 22px; font-weight: 600; }
.helpPanel ol { padding-left: 22px; }
.helpPanel li { padding-left: 8px; margin: 22px 0; }
.helpPanel li strong { font-size: 15px; }
.helpPanel p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.errorPanel { margin-top: 54px; min-height: 380px; display: grid; align-content: center; justify-items: center; gap: 14px; text-align: center; }
.errorPanel h1 { font-size: 30px; line-height: 1.4; margin: 0; }
.errorPanel > p { color: var(--muted); margin: 0; }
.errorPanel > div { display: flex; gap: 12px; margin-top: 15px; }

@media (max-width: 1000px) {
  .appTopbar { display: flex; align-items: center; gap: 14px; height: 60px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--nav-bg); position: sticky; top: 0; z-index: 100; }
  .appTopbar .iconButton { width: 38px; height: 38px; }
  .topbarBrand { display: flex; align-items: center; gap: 10px; flex: 1; }
  .topbarBrand .brandMark { width: 36px; height: 36px; }
  .appTopbar .brandWordmark { font-size: 20px; }
  .appSidebar { width: min(288px, calc(100vw - 48px)); background: var(--surface); transform: translateX(-104%); transition: transform 240ms var(--ease-swift); box-shadow: var(--shadow-modal); }
  .appSidebar .brandWordmark { display: inline; }
  .sidebarBrand { justify-content: start; gap: 10px; margin: 0 4px 18px; }
  .sidebarSectionLabel, .sidebarNavLabel { display: inline; }
  .sidebarSectionLabel { padding: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--subtle); }
  .sidebarNav { justify-items: stretch; }
  .sidebarNavItem { width: 100%; justify-content: start; gap: 12px; padding: 0 12px; }
  .sidebarBackdrop { position: fixed; inset: 0; z-index: 110; background: #0007; }
  .menuOpen { overflow: hidden; }
  .menuOpen .appSidebar { transform: translateX(0); }
  .menuOpen .sidebarBackdrop { display: block; }
  .appCanvas { margin-left: 0; }
  .appContent { width: calc(100% - 28px); padding: 14px 0 64px; }
  .detailLayout { grid-template-columns: 1fr; }
  .detailHero { padding: 28px; }
  .detailHeader h1 { font-size: 48px; }
  .installPanel { grid-row: 2; }
  .registrationLayout { gap: 14px; }
}
@media (max-width: 680px) {
  .galleryToolbar { grid-template-columns: 1fr; gap: 10px; }
  .galleryToolbar > .btn { height: 44px; }
  .galleryTools { padding-top: 30px; }
  .galleryControlRow > .btn { height: 36px; }
  .resultBar > span { display: none; }
  .galleryTopPagination { margin: 26px 0 20px; }
  .paginationControls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .paginationJump { grid-column: 1 / -1; grid-row: 1; justify-content: space-between; padding: 5px; }
  .paginationJump label { display: none; }
  .paginationJump input { width: 56px; }
  .paginationControls > .btn { height: 36px; }
  .galleryGrid { grid-template-columns: 1fr; }
  .petCardBody { min-height: 170px; }
  .detailLayout, .formLayout { padding-top: 18px; }
  .detailHero, .panel { padding: 22px; border-radius: 22px; }
  .detailHero { gap: 22px; }
  .detailHeader h1 { font-size: 36px; }
  .detailHeader > p:last-child { font-size: 16px; }
  .detailPreview { height: 320px; }
  .detailPreview img { padding: 22px; }
  .installPanel header { flex-direction: column; gap: 8px; }
  .soulPanel { grid-column: auto; }
  .formHeader h1 { font-size: 36px; }
  .registrationLayout { grid-template-columns: 1fr; }
  .emptyState { padding: 30px 18px; }
  .emptyState p { font-size: 14px; }
  .errorPanel h1 { font-size: 24px; }
  .errorPanel > div { flex-direction: column; }
  .siteFooter { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
