:root {
  --ink: #20232b;
  --muted: #697184;
  --paper: #fffdfa;
  --surface: rgba(255, 255, 255, 0.94);
  --line: #dce2dc;
  --accent: #d629a1;
  --accent-dark: #a8177a;
  --accent-soft: #fff0f8;
  --accent-wash: rgba(214, 41, 161, 0.09);
  --signal: #ef9a22;
  --success: #17845d;
  --shadow: 0 22px 70px rgba(42, 34, 38, 0.1);
  --radius-lg: 16px;
  --radius-md: 10px;
  --font-display: "Avenir Next Condensed", "DIN Condensed", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #fbf4ea;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    linear-gradient(rgba(119, 102, 72, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 102, 72, 0.075) 1px, transparent 1px),
    radial-gradient(circle at 15% 0%, rgba(236, 109, 155, 0.16), transparent 26rem),
    radial-gradient(circle at 89% 6%, rgba(241, 184, 57, 0.12), transparent 24rem),
    #fbf4ea;
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
  transition: background-color 180ms ease;
}

body[data-species="dog"] {
  --accent: #2677c9;
  --accent-dark: #185895;
  --accent-soft: #eef7ff;
  --accent-wash: rgba(38, 119, 201, 0.09);
}

button,
input,
select {
  font: inherit;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.photo-source-button:focus-within {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 2px;
}

.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 24px auto 72px;
}

.hero,
.panel {
  border: 1px solid rgba(211, 219, 213, 0.94);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 234px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.hero::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  content: "";
}

.hero-copy {
  align-self: center;
  padding: 34px 38px 34px 32px;
}

.eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(239, 154, 34, 0.12);
}

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

h1 {
  max-width: 700px;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.038em;
  line-height: 1.02;
}

.hero-intro {
  max-width: 670px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow > span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 6px 10px 6px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 7px;
  color: #454b59;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.workflow b {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
}

.assay-visual {
  position: relative;
  align-self: stretch;
  min-height: 234px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 75% 22%, rgba(255, 255, 255, 0.9), transparent 22%),
    linear-gradient(145deg, var(--accent-soft), #fffdfa 65%);
}

.visual-wordmark {
  position: absolute;
  top: 18px;
  left: 20px;
  color: color-mix(in srgb, var(--accent) 22%, transparent);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.visual-disc {
  position: absolute;
  top: 72px;
  left: 34px;
  display: grid;
  width: 112px;
  height: 112px;
  place-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(150deg, var(--accent), var(--accent-dark));
  box-shadow: 0 16px 28px color-mix(in srgb, var(--accent) 25%, transparent);
  text-align: center;
}

.visual-disc small {
  font-size: 11px;
  font-weight: 800;
}

.visual-disc strong {
  margin-top: -3px;
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1;
}

.dot-array {
  position: absolute;
  top: 56px;
  right: 24px;
  display: grid;
  grid-template-columns: repeat(6, 13px);
  gap: 9px;
  transform: rotate(-2deg);
}

.dot-array i {
  width: 13px;
  height: 13px;
  border: 1px solid #d9dcda;
  border-radius: 50%;
  background: #e9e9e7;
}

.dot-array i.hot {
  border-color: var(--accent);
  background: var(--accent);
}

.dot-array i.warm {
  border-color: var(--signal);
  background: var(--signal);
}

.visual-species {
  position: absolute;
  right: 18px;
  bottom: 12px;
  color: color-mix(in srgb, var(--accent) 18%, transparent);
  font-family: var(--font-display);
  font-size: 62px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

main {
  margin-top: 14px;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 28px;
  animation: panel-in 280ms cubic-bezier(.2, .75, .3, 1) both;
}

@keyframes panel-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.panel-heading,
.form-toolbar,
.section-heading-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}

.panel h2,
.form-toolbar h2,
.photo-section h2 {
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: -0.018em;
  line-height: 1.2;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.default-badge,
.privacy-note {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
}

.language-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.language-option {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr 22px;
  gap: 12px;
  min-height: 76px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.language-option:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  box-shadow: 0 10px 24px rgba(35, 31, 33, 0.07);
}

.language-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.language-code {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
}

.language-option.active .language-code {
  background: var(--accent);
}

.language-option strong,
.language-option small {
  display: block;
}

.language-option strong {
  font-size: 15px;
}

.language-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.language-check {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  font-size: 12px;
}

.language-option.active .language-check {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.form-toolbar {
  margin-bottom: 22px;
}

.text-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.text-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #424956;
  font-size: 12px;
  font-weight: 800;
}

.field-full {
  grid-column: 1 / -1;
}

.field input,
.field select {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #d8dfd9;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:hover,
.field select:hover {
  border-color: #b9c4bc;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  outline: 0;
}

.section-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.section-heading-row {
  align-items: center;
  margin-bottom: 12px;
}

.photo-section h2 {
  margin-bottom: 0;
}

.photo-picker {
  position: relative;
  display: grid;
  min-height: 250px;
  gap: 15px;
  place-items: center;
  overflow: hidden;
  padding: 22px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: 12px;
  background:
    linear-gradient(135deg, var(--accent-wash), transparent 62%),
    #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.photo-picker:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(45, 37, 42, 0.07);
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.photo-idle {
  display: grid;
  max-width: 600px;
  place-items: center;
  padding: 3px 14px 0;
  text-align: center;
}

.camera-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 22%, transparent);
}

.camera-icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.photo-idle > strong {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 850;
}

.photo-idle > span:not(.camera-icon) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.photo-source-actions {
  display: grid;
  width: min(620px, 100%);
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 10px;
}

.photo-source-button {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 49px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.photo-source-button:hover {
  transform: translateY(-1px);
}

.photo-source-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.photo-source-primary {
  border-color: var(--accent);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 18%, transparent);
}

.photo-source-primary:hover {
  box-shadow: 0 13px 24px color-mix(in srgb, var(--accent) 24%, transparent);
}

.photo-source-secondary {
  color: var(--accent-dark);
  background: #fff;
}

.photo-source-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.photo-empty {
  display: block;
  margin-top: -4px;
  color: var(--muted);
  font-size: 11px;
}

.photo-selected {
  display: grid;
  width: min(620px, 100%);
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 2px 0;
  text-align: left;
}

.preview-frame {
  position: relative;
  display: block;
  width: 116px;
  height: 142px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #eee;
}

.preview-frame.preview-unavailable::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(145deg, var(--accent-soft), #f3f3f1);
  content: "IMG";
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.selected-copy small,
.selected-copy strong,
.selected-copy span {
  display: block;
}

.selected-copy small {
  margin-bottom: 4px;
  color: var(--success);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.selected-copy strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.photo-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hint-icon {
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-dark);
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
}

.form-error {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #f0b9b3;
  border-radius: 8px;
  color: #a43c32;
  background: #fff4f2;
  font-size: 13px;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.actions p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.primary-button {
  display: inline-flex;
  min-height: 45px;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 20%, transparent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 24px color-mix(in srgb, var(--accent) 26%, transparent);
}

.primary-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(25, 27, 32, 0.58);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(15, 16, 19, 0.3);
  animation: modal-in 220ms cubic-bezier(.2, .8, .3, 1) both;
  text-align: center;
}

@keyframes modal-in {
  from {
    transform: translateY(12px) scale(.98);
    opacity: 0;
  }
}

.modal-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-size: 24px;
  font-weight: 900;
}

.modal h2 {
  margin-bottom: 7px;
  font-family: var(--font-display);
  font-size: 26px;
}

.modal p {
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal-close {
  min-width: 120px;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(680px, calc(100% - 22px));
    margin-top: 11px;
  }

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

  .hero-copy {
    padding: 28px 25px 24px;
  }

  .assay-visual {
    min-height: 124px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .visual-wordmark {
    top: 14px;
    left: 22px;
    font-size: 36px;
  }

  .visual-disc {
    top: 45px;
    left: 34px;
    width: 68px;
    height: 68px;
  }

  .visual-disc small {
    font-size: 7px;
  }

  .visual-disc strong {
    font-size: 27px;
  }

  .dot-array {
    top: 25px;
    right: 132px;
    grid-template-columns: repeat(6, 7px);
    gap: 4px;
  }

  .dot-array i {
    width: 7px;
    height: 7px;
  }

  .visual-species {
    right: 16px;
    bottom: 8px;
    font-size: 38px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .language-options {
    grid-template-columns: 1fr;
  }

  .language-option {
    min-height: 67px;
  }
}

@media (max-width: 620px) {
  body {
    background-size: 24px 24px, 24px 24px, auto, auto, auto;
  }

  .page-shell {
    width: min(560px, calc(100% - 16px));
    margin-bottom: 36px;
  }

  .hero,
  .panel {
    border-radius: 12px;
  }

  .hero-copy {
    padding: 24px 20px 22px;
  }

  .assay-visual {
    min-height: 112px;
  }

  .visual-wordmark {
    top: 12px;
    left: 14px;
    font-size: 30px;
  }

  .visual-disc {
    top: 43px;
    left: 30px;
    width: 58px;
    height: 58px;
  }

  .visual-disc small {
    font-size: 6px;
  }

  .visual-disc strong {
    font-size: 23px;
  }

  .dot-array {
    top: 25px;
    right: 104px;
    grid-template-columns: repeat(6, 6px);
    gap: 3px;
  }

  .dot-array i {
    width: 6px;
    height: 6px;
  }

  .visual-species {
    right: 10px;
    bottom: 7px;
    font-size: 32px;
  }

  .eyebrow {
    font-size: 11px;
  }

  h1 {
    font-size: 36px;
  }

  .workflow > span {
    font-size: 11px;
  }

  .panel {
    padding: 20px 16px;
  }

  .panel-heading,
  .form-toolbar,
  .section-heading-row {
    gap: 12px;
  }

  .form-toolbar {
    flex-direction: column;
  }

  .default-badge,
  .privacy-note {
    display: none;
  }

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

  .field-full {
    grid-column: auto;
  }

  .photo-picker {
    min-height: 260px;
    padding: 18px 14px;
  }

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

  .photo-selected {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 0;
  }

  .preview-frame {
    width: 84px;
    height: 108px;
  }

  .actions {
    display: grid;
  }

  .primary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
