:root {
  color-scheme: light;
  --ink: #17342c;
  --ink-soft: #4f665e;
  --forest: #176449;
  --forest-dark: #0d4d36;
  --forest-light: #dcece0;
  --lime: #cde86a;
  --cream: #f7f7ef;
  --paper: #fffef9;
  --mist: #e9eee8;
  --line: rgba(23, 52, 44, 0.12);
  --warm: #f3dfb1;
  --success: #dff2dc;
  --danger: #a63d35;
  --shadow: 0 22px 70px rgba(28, 54, 44, 0.18);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(205, 232, 106, 0.3), transparent 26rem),
    radial-gradient(circle at 92% 84%, rgba(119, 168, 151, 0.28), transparent 30rem),
    #e7ede5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #277bff;
  outline-offset: 3px;
}

[tabindex="-1"]:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

.prototype-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 390px) minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  padding: 24px;
}

.device {
  position: relative;
  grid-column: 2;
  width: 100%;
  height: min(844px, calc(100vh - 48px));
  height: min(844px, calc(100dvh - 48px));
  min-height: 700px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--cream);
  border: 8px solid #17312a;
  border-radius: 42px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.device::before {
  position: absolute;
  z-index: 20;
  top: 9px;
  left: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid #203831;
  border-radius: 50%;
  background: #08130f;
  content: "";
  transform: translateX(-50%);
  pointer-events: none;
}

.app-bar {
  position: relative;
  z-index: 5;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-top) + 5px) 20px 9px;
  background: rgba(247, 247, 239, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--forest);
  border-radius: 12px 12px 12px 4px;
}

.brand__mark svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.prototype-reset {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.12;
  background: rgba(23, 52, 44, 0.06);
  border: 1px solid rgba(23, 52, 44, 0.1);
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.prototype-reset:hover {
  color: var(--forest-dark);
  background: var(--forest-light);
}

.prototype-reset:active {
  transform: translateY(1px);
}

.app-bar__context {
  overflow: hidden;
  font-size: 16px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-bar__spacer,
.app-bar > .icon-button {
  width: 44px;
  flex: 0 0 44px;
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.icon-button:hover {
  background: rgba(23, 52, 44, 0.07);
}

.icon-button svg {
  width: 25px;
  height: 25px;
}

.screen {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen:focus {
  outline: none;
}

.screen-stack {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 18px 28px;
}

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

h1,
h2 {
  margin-bottom: 0;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(30px, 8.7vw, 38px);
}

h2 {
  font-size: 25px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-card {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 24px 22px;
  color: #f9fff9;
  background:
    linear-gradient(155deg, transparent 61%, rgba(205, 232, 106, 0.22) 61.4%, transparent 62.2%),
    linear-gradient(145deg, #0b4b35, #1c7253 65%, #3f846b);
  border-radius: var(--radius-xl);
  box-shadow: 0 14px 30px rgba(20, 85, 61, 0.2);
}

.hero-card::before,
.hero-card::after {
  position: absolute;
  border: 1px solid rgba(222, 244, 195, 0.25);
  border-radius: 50%;
  content: "";
}

.hero-card::before {
  width: 230px;
  height: 230px;
  right: -90px;
  bottom: -95px;
}

.hero-card::after {
  width: 310px;
  height: 310px;
  right: -128px;
  bottom: -131px;
}

.hero-card__copy {
  position: relative;
  z-index: 2;
  max-width: 280px;
}

.hero-card .eyebrow {
  color: var(--lime);
}

.hero-card h1 {
  font-size: clamp(34px, 10vw, 44px);
}

.hero-card p:last-child {
  max-width: 255px;
  margin: 14px 0 0;
  color: rgba(250, 255, 250, 0.75);
  font-size: 15px;
  line-height: 1.42;
}

.hero-bird {
  position: absolute;
  right: 24px;
  bottom: 13px;
  width: 110px;
  height: 110px;
  color: var(--lime);
  transform: rotate(-5deg);
}

.hero-bird > svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.14));
}

.hero-bird__note {
  position: absolute;
  top: -8px;
  right: 3px;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.hero-bird__note--two {
  top: 26px;
  right: -8px;
  font-size: 38px;
}

.primary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.listen-button,
.secondary-button,
.primary-button {
  min-height: 56px;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.listen-button:active,
.secondary-button:active,
.primary-button:active,
.candidate-card:active,
.species-row:active,
.place-row:active {
  transform: scale(0.985);
}

.listen-button {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  color: #fff;
  text-align: left;
  background: var(--forest);
  box-shadow: 0 10px 20px rgba(23, 100, 73, 0.2);
}

.listen-button:hover,
.primary-button:hover {
  background: var(--forest-dark);
}

.listen-button__icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border-radius: 16px;
}

.listen-button svg {
  width: 25px;
  height: 25px;
}

.listen-button strong,
.listen-button small {
  display: block;
}

.listen-button strong {
  font-size: 16px;
}

.listen-button small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 550;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--forest-light);
}

.primary-actions > .secondary-button {
  min-height: 54px;
}

.secondary-button svg {
  width: 23px;
  height: 23px;
}

.secondary-button--plain {
  width: 100%;
  background: var(--forest-light);
}

.text-button {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--forest);
  font-size: 15px;
  font-weight: 750;
  background: transparent;
  border: 0;
  border-radius: 12px;
}

.text-button:hover {
  background: rgba(23, 100, 73, 0.07);
}

.text-button--danger {
  width: 100%;
  margin-top: 12px;
  color: var(--danger);
}

.primary-button {
  width: 100%;
  padding: 14px 18px;
  color: #fff;
  background: var(--forest);
  box-shadow: 0 10px 20px rgba(23, 100, 73, 0.18);
}

.recognition-disclosure {
  margin-top: 10px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: rgba(23, 100, 73, 0.06);
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.45;
}

.recognition-disclosure summary {
  color: var(--forest);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.recognition-disclosure p {
  margin: 8px 0 0;
}

.recognition-disclosure a {
  color: var(--forest);
  font-weight: 750;
}

.recognition-disclosure--demo p {
  margin: 0;
  text-align: center;
}

.upload-gate {
  min-height: 72px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  color: var(--ink);
  text-align: left;
  background: #fff7e7;
  border: 1px solid rgba(166, 110, 44, 0.2);
  border-radius: 16px;
}

.upload-gate--button {
  width: 100%;
}

.upload-gate > svg {
  width: 28px;
  color: #8d542d;
}

.upload-gate strong,
.upload-gate small {
  display: block;
}

.upload-gate .upload-gate__status {
  margin-top: 7px;
  color: #8d542d;
  font-weight: 700;
}

.upload-gate strong {
  font-size: 13px;
}

.upload-gate small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.upload-gate i {
  color: var(--forest);
  font-size: 24px;
  font-style: normal;
}

.bottom-nav {
  position: relative;
  z-index: 6;
  min-height: 68px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 10px var(--safe-bottom);
  background: rgba(255, 254, 249, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-button {
  min-width: 64px;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 10px;
  color: #5e7068;
  background: transparent;
  border: 0;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
}

.nav-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: filter 160ms ease;
}

.nav-button--active {
  color: var(--forest);
}

.nav-button--active svg {
  filter: drop-shadow(0 0 6px rgba(23, 100, 73, 0.28));
}

.center-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 24px 28px;
  text-align: center;
}

.center-copy {
  max-width: 320px;
}

.center-copy > p:last-child,
.center-copy > h1 + p {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
}

.runtime-status {
  display: block;
  margin-top: 12px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

.permission-visual {
  position: relative;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  margin: 30px auto 27px;
}

.permission-visual > span {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--forest);
  border-radius: 34px;
  box-shadow: 0 18px 35px rgba(23, 100, 73, 0.24);
}

.permission-visual svg {
  width: 45px;
  height: 45px;
}

.permission-visual i {
  position: absolute;
  inset: 20px;
  border: 2px solid rgba(23, 100, 73, 0.16);
  border-radius: 50%;
  animation: pulse-ring 2.4s infinite ease-out;
}

.permission-visual i:last-child {
  inset: 0;
  animation-delay: 0.7s;
}

.permission-visual--photo > span {
  background: #3f665c;
}

.permission-visual--location > span {
  background: #b66c36;
  box-shadow: 0 18px 35px rgba(182, 108, 54, 0.24);
}

.bottom-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
}

.bottom-actions--flow {
  margin-top: 4px;
}

.capture-screen {
  min-height: 100%;
}

.capture-screen--photo {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 12px 24px;
}

.camera-view {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  background: #496d5a;
  border-radius: 26px;
}

.camera-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 18, 12, 0.14), transparent 35%, rgba(4, 18, 12, 0.48));
}

.focus-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 190px;
  height: 190px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  transform: translate(-40%, -56%);
  box-shadow: 0 0 0 999px rgba(5, 21, 14, 0.08);
}

.camera-ready {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: #fff;
  background: rgba(15, 74, 52, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.camera-ready svg {
  width: 16px;
  height: 16px;
}

.camera-hint {
  position: absolute;
  right: 20px;
  bottom: 22px;
  left: 20px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.camera-hint span,
.camera-hint small {
  display: block;
}

.camera-hint span {
  font-weight: 800;
}

.camera-hint small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.8);
}

.capture-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 18px;
  font-size: 12px;
  font-weight: 700;
}

.shutter-button {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 3px solid var(--forest);
  border-radius: 50%;
}

.shutter-button span {
  width: 52px;
  height: 52px;
  background: var(--forest);
  border-radius: 50%;
}

.recording-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.recording-dot {
  width: 9px;
  height: 9px;
  background: #d64c42;
  border-radius: 50%;
  animation: recording-pulse 1.2s infinite;
}

.record-time {
  margin-top: 28px;
  font-variant-numeric: tabular-nums;
  font-size: 64px;
  font-weight: 650;
  letter-spacing: -0.06em;
}

.record-hint {
  max-width: 250px;
  margin: 5px auto 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.4;
}

.waveform {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}

.waveform i {
  width: 4px;
  height: 22px;
  background: var(--forest);
  border-radius: 999px;
  animation: wave 900ms ease-in-out infinite alternate;
}

.waveform i:nth-child(3n) { animation-delay: -300ms; }
.waveform i:nth-child(4n) { animation-delay: -550ms; }
.waveform i:nth-child(5n) { animation-delay: -760ms; }
.waveform i:nth-child(7n) { animation-delay: -140ms; }

.record-screen {
  min-height: 100%;
  gap: 12px;
  padding: 8px 18px 22px;
}

.recording-heading {
  text-align: center;
}

.recording-heading .recording-status {
  justify-content: center;
  margin-top: 0;
}

.recording-heading .record-time {
  margin-top: 8px;
  font-size: 45px;
}

.recording-heading .record-hint {
  max-width: 310px;
}

.waveform--compact {
  height: 58px;
  margin-top: 0;
}

.waveform--compact i {
  animation-name: wave-compact;
}

.spectrogram-card {
  padding: 12px;
  color: #ecfff5;
  background: #0b2520;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(4, 25, 20, 0.18);
}

.spectrogram-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
}

.spectrogram-card__heading strong {
  color: #cde86a;
  font-size: 10px;
}

.spectrogram-card__heading strong[data-strength="weak"] {
  color: #a8b9b2;
}

.spectrogram-card__heading strong[data-strength="strong"] {
  color: #fff2a6;
}

.spectrogram-plot {
  position: relative;
  height: 116px;
  overflow: hidden;
  background: #071916;
  border: 1px solid rgba(205, 232, 106, 0.18);
  border-radius: 11px;
}

.spectrogram-plot canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.spectrogram-axis {
  position: absolute;
  left: 6px;
  padding: 1px 3px;
  color: rgba(235, 255, 246, 0.7);
  background: rgba(7, 25, 22, 0.6);
  border-radius: 4px;
  font-size: 8px;
  pointer-events: none;
}

.spectrogram-axis--high { top: 4px; }
.spectrogram-axis--mid { top: 50%; transform: translateY(-50%); }
.spectrogram-axis--low { bottom: 4px; }

.spectrogram-card > p {
  margin: 7px 2px 0;
  color: rgba(236, 255, 245, 0.68);
  font-size: 9px;
  line-height: 1.35;
}

.live-detections {
  min-height: 250px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(29, 62, 51, 0.06);
}

.live-detections__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.live-detections__heading h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.prototype-chip {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #735124;
  background: #f8e8c9;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-detections__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
}

.live-detections__empty {
  min-height: 152px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--ink-soft);
  text-align: center;
  background: var(--mist);
  border-radius: 17px;
}

.live-detections__empty span {
  color: var(--forest);
  font-size: 30px;
  font-weight: 850;
}

.live-detections__empty p {
  max-width: 235px;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.live-detection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #f5f6f0;
  border: 1px solid transparent;
  border-radius: 16px;
  transition: border-color 180ms ease, background 180ms ease;
}

.live-detection--active {
  background: #edf6e8;
  border-color: rgba(23, 100, 73, 0.24);
}

.live-detection__bird {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  object-fit: cover;
  border-radius: 12px;
}

.live-detection strong,
.live-detection span {
  display: block;
}

.live-detection strong {
  font-size: 14px;
}

.live-detection span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.live-detection > i {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}

.live-detection > i b {
  width: 3px;
  height: 8px;
  background: #9aaba4;
  border-radius: 999px;
}

.live-detection--active > i b {
  background: var(--forest);
  animation: detection-bars 520ms ease-in-out infinite alternate;
}

.live-detection--active > i b:nth-child(2) { animation-delay: -250ms; }
.live-detection--active > i b:nth-child(3) { animation-delay: -390ms; }

.audio-summary {
  padding-bottom: 24px;
}

.diagnostic-card {
  padding: 15px;
  color: var(--ink);
  text-align: left;
  background: #fff7e7;
  border: 1px solid rgba(166, 110, 44, 0.22);
  border-radius: 20px;
}

.diagnostic-card__heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diagnostic-card__heading > span {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #b66c36;
  border-radius: 13px;
}

.diagnostic-card__heading svg {
  width: 21px;
  height: 21px;
}

.diagnostic-card h2 {
  margin: 1px 0 0;
  font-size: 17px;
}

.diagnostic-card > p,
.diagnostic-card > small {
  display: block;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.diagnostic-fields {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.diagnostic-fields label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

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

.diagnostic-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.diagnostic-consent input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--forest);
}

.diagnostic-actions {
  display: grid;
  gap: 6px;
  margin-top: 13px;
}

.diagnostic-actions .primary-button,
.diagnostic-actions .secondary-button {
  min-height: 48px;
  font-size: 12px;
}

.unknown-screen .diagnostic-card {
  width: 100%;
  margin: 18px 0;
}

.summary-detections {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.summary-detection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.summary-detection--selected {
  background: #f5faef;
  border-color: rgba(23, 100, 73, 0.28);
}

.summary-detection__toggle {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 3px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
}

.summary-check {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #e2e7e1;
  border: 1px solid rgba(23, 52, 44, 0.12);
  border-radius: 8px;
}

.summary-detection--selected .summary-check {
  background: var(--forest);
  border-color: var(--forest);
}

.summary-check svg {
  width: 16px;
  height: 16px;
}

.summary-detection__bird {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  object-fit: cover;
  border-radius: 12px;
}

.bird-thumbnail--fallback {
  color: var(--paper);
  background: linear-gradient(145deg, var(--forest), #579170);
}

.bird-thumbnail--fallback svg {
  width: 64%;
  height: 64%;
  fill: currentColor;
}

.summary-detection__toggle strong,
.summary-detection__toggle small {
  display: block;
}

.summary-detection__toggle strong {
  font-size: 14px;
}

.summary-detection__toggle small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-detection__change {
  padding: 8px 6px;
  color: var(--forest);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.summary-place {
  border-radius: 18px;
}

.prototype-disclaimer {
  margin: -2px 6px 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.primary-button:disabled {
  color: rgba(255, 255, 255, 0.7);
  background: #789086;
  box-shadow: none;
  cursor: not-allowed;
}

.primary-button--stop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.stop-square {
  width: 13px;
  height: 13px;
  background: currentColor;
  border-radius: 3px;
}

.processing-screen {
  justify-content: center;
}

.processing-orbit {
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  margin-bottom: 32px;
}

.processing-orbit > span {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--forest);
  border-radius: 50%;
}

.processing-orbit svg {
  width: 40px;
  height: 40px;
}

.processing-orbit i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  background: var(--lime);
  border: 3px solid var(--cream);
  border-radius: 50%;
  transform-origin: -64px 0;
  animation: orbit 2s linear infinite;
}

.processing-orbit i:nth-child(2) { animation-delay: -0.65s; }
.processing-orbit i:nth-child(3) { animation-delay: -1.3s; }

.processing-cancel {
  margin-top: 30px;
}

.result-screen {
  padding-top: 0;
}

.result-visual {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  background: #dce9dd;
  border-radius: var(--radius-xl);
}

.result-visual img,
.observation-card__image img,
.collection-card > img,
.collection-card__bird {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.result-chip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--ink);
  background: rgba(255, 254, 249, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 850;
}

.result-chip svg {
  width: 16px;
  height: 16px;
  color: var(--forest);
}

.result-copy {
  padding: 0 4px;
}

.result-copy h1 {
  font-size: 39px;
}

.latin-name {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 14px;
  font-style: italic;
}

.result-clue,
.bird-fact {
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.48;
}

.section-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}

.candidate-list,
.species-list,
.place-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.candidate-card,
.species-row,
.place-row {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(29, 62, 51, 0.04);
}

.candidate-card img,
.species-row img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
}

.candidate-card strong,
.candidate-card small,
.species-row strong,
.species-row small,
.place-row strong,
.place-row small {
  display: block;
}

.candidate-card strong,
.species-row strong,
.place-row strong {
  font-size: 15px;
}

.candidate-card small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.candidate-card > i,
.species-row > i,
.place-row > i,
.meta-row--button > i,
.note-details summary > i {
  padding-right: 5px;
  color: var(--ink-soft);
  font-size: 25px;
  font-style: normal;
  font-weight: 400;
}

.unknown-screen,
.error-screen {
  justify-content: center;
}

.unknown-visual,
.error-visual,
.saved-recording-visual {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  color: var(--forest);
  background: var(--forest-light);
  border-radius: 46px 46px 46px 16px;
}

.unknown-visual svg,
.error-visual > svg,
.saved-recording-visual > svg {
  width: 68px;
  height: 68px;
  fill: currentColor;
}

.unknown-visual span,
.error-visual span,
.saved-recording-visual span {
  position: absolute;
  right: -2px;
  bottom: -4px;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border: 4px solid var(--cream);
  border-radius: 50%;
  font-size: 23px;
  font-weight: 850;
}

.error-visual > svg,
.saved-recording-visual > svg {
  width: 56px;
  height: 56px;
  fill: none;
}

.saved-recording-visual span {
  color: var(--ink);
  background: var(--lime);
}

.saved-recording-visual span svg {
  width: 25px;
  height: 25px;
}

.search-field {
  position: relative;
  display: block;
}

.search-field input {
  width: 100%;
  min-height: 52px;
  padding: 13px 44px 13px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 16px;
}

.search-field input::placeholder {
  color: #65756d;
}

.search-field > span:last-child {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--ink-soft);
  font-size: 24px;
  transform: translateY(-55%);
  pointer-events: none;
}

.species-row {
  min-height: 66px;
}

.species-row img {
  width: 54px;
  height: 54px;
}

.species-row__bird {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.species-search-status {
  margin: 8px 14px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.species-row small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
}

.observation-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(29, 62, 51, 0.07);
}

.observation-card__image {
  position: relative;
  height: 235px;
}

.observation-card__bird {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.observation-card__source {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 10px;
  color: var(--ink);
  background: rgba(255, 254, 249, 0.9);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  backdrop-filter: blur(8px);
}

.card-change {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 44px;
  padding: 8px 11px;
  color: var(--ink);
  background: rgba(255, 254, 249, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 850;
}

.observation-card__body {
  padding: 20px;
}

.observation-card__body h1 {
  font-size: 34px;
}

.bird-fact {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.observation-meta {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.meta-row,
.note-details summary {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  text-align: left;
  list-style: none;
}

.meta-row + .meta-row,
.note-details {
  border-top: 1px solid var(--line);
}

.meta-row--button {
  background: transparent;
  border: 0;
}

.meta-row small,
.meta-row strong,
.note-details small,
.note-details strong {
  display: block;
}

.meta-row small,
.note-details small {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.meta-row strong,
.note-details strong {
  font-size: 14px;
}

.meta-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--forest-light);
  border-radius: 11px;
  font-size: 19px;
}

.meta-icon svg {
  width: 18px;
  height: 18px;
}

.note-details summary {
  cursor: pointer;
}

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

.note-details textarea {
  width: calc(100% - 28px);
  min-height: 88px;
  margin: 0 14px 14px;
  padding: 12px;
  resize: vertical;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 15px;
  line-height: 1.4;
}

.collection-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.collection-heading h1 {
  font-size: 38px;
}

.collection-stats {
  display: flex;
  gap: 7px;
}

.collection-stats > span {
  min-width: 57px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 8px;
  background: var(--forest-light);
  border-radius: 13px;
}

.collection-stats strong {
  font-size: 20px;
  line-height: 1;
}

.collection-stats small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

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

.collection-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(29, 62, 51, 0.06);
}

.collection-card > img,
.collection-card__bird {
  height: 130px;
}

.collection-card__bird {
  display: grid;
  place-items: center;
  border-radius: 0;
}

.collection-card > div {
  padding: 11px;
}

.collection-card__source {
  color: var(--forest);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.collection-card h2 {
  margin-top: 4px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.collection-card p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.empty-collection {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 15px;
  text-align: center;
}

.empty-collection > div {
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: var(--forest);
  background: var(--forest-light);
  border-radius: 38px 38px 38px 12px;
}

.empty-collection svg {
  width: 64px;
  height: 64px;
  fill: currentColor;
}

.empty-collection p {
  max-width: 285px;
  margin: 12px 0 24px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}

.achievements-heading > p:last-child {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.achievements-heading h1 {
  font-size: 38px;
}

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

.achievement-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(29, 62, 51, 0.06);
}

.achievement-card__icon {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--forest-light);
  border-radius: 24px 24px 24px 9px;
}

.achievement-card__icon svg {
  width: 36px;
  height: 36px;
}

.achievement-card__icon > span {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: var(--clay);
  border: 3px solid var(--paper);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.achievement-card h2 {
  margin-top: 3px;
  font-size: 19px;
}

.achievement-card > div:last-child > p:last-child {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.4;
}

.achievement-card--locked {
  opacity: 0.62;
  box-shadow: none;
}

.profile-screen {
  gap: 14px;
}

.profile-card {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(29, 62, 51, 0.06);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px 4px;
}

.profile-identity h1 {
  font-size: 31px;
}

.profile-identity p:last-child {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--forest);
  border: 6px solid var(--lime);
  border-radius: 50%;
  font-size: 28px;
  font-weight: 900;
}

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

.profile-stats > div {
  min-width: 0;
  padding: 10px 5px;
  text-align: center;
  background: var(--forest-light);
  border-radius: 14px;
}

.profile-stats strong,
.profile-stats small {
  display: block;
}

.profile-stats strong {
  font-size: 21px;
}

.profile-stats small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.2;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form > div > p:last-child,
.profile-empty p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.profile-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 15px;
  font-weight: 600;
}

.profile-email {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.form-error:empty {
  display: none;
}

.profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px;
  text-align: center;
}

.profile-empty > svg {
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  color: var(--forest);
}

.profile-empty .primary-button {
  margin-top: 20px;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
}

.install-card,
.profile-sync {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.install-card > svg,
.profile-sync > svg {
  width: 27px;
  height: 27px;
  color: var(--forest);
}

.install-card strong,
.install-card small,
.profile-sync strong,
.profile-sync small {
  display: block;
}

.install-card small,
.profile-sync small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.install-card .secondary-button {
  grid-column: 1 / -1;
  min-height: 46px;
}

.install-card--ready {
  background: var(--success);
}

.install-guide ol {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.install-guide > a {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--forest);
  font-weight: 750;
}

.install-guide__notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--forest-dark);
  background: var(--success);
  font-weight: 700;
}

.profile-actions {
  display: grid;
  gap: 5px;
}

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

.recovery-card small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.recovery-card code {
  padding: 10px;
  overflow-wrap: anywhere;
  color: var(--forest-dark);
  background: var(--forest-light);
  border-radius: 12px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
}

.profile-loading {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  text-align: center;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 5px solid var(--forest-light);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.gratitude-medal {
  background: #8d542d;
}

.achievement-card--locked .achievement-card__icon {
  color: var(--ink-soft);
  background: #eef0eb;
}

.empty-achievements {
  padding: 36px 22px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.empty-achievements > div {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--forest);
  background: var(--forest-light);
  border-radius: 24px;
}

.empty-achievements svg {
  width: 36px;
  height: 36px;
}

.empty-achievements p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.status-banner {
  min-height: 66px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 17px;
}

.status-banner > svg {
  width: 24px;
  height: 24px;
}

.status-banner strong,
.status-banner span {
  display: block;
}

.status-banner strong {
  font-size: 13px;
}

.status-banner span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.status-banner button {
  min-height: 44px;
  padding: 7px 8px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.58);
  border: 0;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
}

.status-banner--success {
  background: var(--success);
}

.status-banner--warm {
  background: var(--warm);
}

.sheet-backdrop {
  position: absolute;
  z-index: 30;
  inset: 0;
  background: rgba(8, 28, 21, 0.48);
  animation: fade-in 180ms ease-out both;
}

.bottom-sheet {
  position: absolute;
  z-index: 31;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: calc(100% - 52px);
  overflow-y: auto;
  padding: 11px 20px calc(var(--safe-bottom) + 14px);
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px rgba(4, 29, 20, 0.2);
  animation: sheet-in 240ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 17px;
  background: #c5ccc8;
  border-radius: 99px;
}

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

.sheet-heading .icon-button {
  margin-top: -5px;
}

.place-sheet-title {
  margin: 16px 0 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.place-row {
  min-height: 58px;
  padding: 8px 10px;
  box-shadow: none;
}

.place-row > span:first-child {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--forest-light);
  border-radius: 12px;
}

.place-row svg {
  width: 19px;
  height: 19px;
}

.place-row small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.sheet-footnote {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.celebration-sheet,
.registration-sheet {
  padding: 28px 24px calc(var(--safe-bottom) + 18px);
  text-align: center;
}

.celebration-sheet > p:not(.eyebrow),
.registration-sheet > p:not(.eyebrow) {
  margin: 12px auto 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.46;
}

.achievement-medal,
.registration-icon {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  margin: 0 auto 19px;
  color: var(--paper);
  background: var(--forest);
  border: 8px solid var(--lime);
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(23, 100, 73, 0.24);
}

.achievement-medal > svg {
  width: 54px;
  height: 54px;
  fill: currentColor;
}

.achievement-medal > span {
  position: absolute;
  right: -5px;
  bottom: -2px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border: 3px solid var(--paper);
  border-radius: 50%;
  font-weight: 900;
}

.confetti i {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 7px;
  height: 14px;
  background: var(--lime);
  border-radius: 3px;
  animation: confetti 900ms ease-out both;
}

.confetti i:nth-child(2) { margin-left: 45px; background: #f0b76b; animation-delay: 80ms; }
.confetti i:nth-child(3) { margin-left: -55px; background: #6fa6a4; animation-delay: 130ms; }
.confetti i:nth-child(4) { margin-left: 80px; background: #a9cc56; animation-delay: 200ms; }
.confetti i:nth-child(5) { margin-left: -88px; background: #e98c72; animation-delay: 250ms; }
.confetti i:nth-child(6) { margin-left: 20px; background: #6f8fb4; animation-delay: 310ms; }

.registration-icon {
  color: var(--forest);
  background: var(--forest-light);
  border-color: #eaf3e7;
}

.registration-icon svg {
  width: 47px;
  height: 47px;
}

.saved-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  color: var(--forest-dark);
  background: var(--success);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 750;
}

.saved-proof svg {
  width: 18px;
  height: 18px;
}

.toast {
  position: absolute;
  z-index: 50;
  right: 18px;
  bottom: calc(74px + var(--safe-bottom));
  left: 18px;
  padding: 12px 15px;
  color: #fff;
  text-align: center;
  background: rgba(18, 43, 35, 0.94);
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  font-size: 13px;
  font-weight: 700;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.qa-panel {
  position: fixed;
  z-index: 70;
  top: 24px;
  bottom: 24px;
  left: max(24px, calc(50% - 580px));
  width: min(320px, calc(100vw - 48px));
  overflow-y: auto;
  padding: 20px;
  background: rgba(255, 254, 249, 0.96);
  border: 1px solid rgba(23, 52, 44, 0.1);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.qa-mode .qa-panel {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.qa-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qa-panel__heading h2 {
  font-size: 28px;
}

.qa-panel__close {
  margin: -7px -8px 0 0;
}

.qa-panel__intro {
  margin: 10px 0 16px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.qa-scenarios {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.qa-scenario {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.qa-scenario strong,
.qa-scenario span {
  display: block;
}

.qa-scenario strong {
  font-size: 13px;
}

.qa-scenario span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.3;
}

.qa-scenario--active {
  background: var(--forest-light);
  border-color: rgba(23, 100, 73, 0.35);
  box-shadow: inset 3px 0 var(--forest);
}

.qa-state {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 10px;
  background: #eff1ed;
  border-radius: 11px;
  font-size: 11px;
}

.qa-state strong {
  overflow: hidden;
  color: var(--forest);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-log {
  margin-top: 10px;
  font-size: 11px;
}

.qa-log summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}

.qa-log ol {
  max-height: 150px;
  overflow: auto;
  margin: 4px 0 0;
  padding-left: 22px;
}

.qa-log li {
  margin-bottom: 7px;
  color: var(--ink-soft);
  line-height: 1.25;
}

.qa-log code {
  display: block;
  color: var(--ink);
  font-size: 10px;
}

.qa-log__ignored {
  opacity: 0.55;
}

.qa-launcher {
  position: fixed;
  right: 28px;
  bottom: 28px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(23, 52, 44, 0.24);
  font-size: 12px;
  font-weight: 800;
}

.qa-launcher span {
  color: var(--lime);
  font-size: 19px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: -1px !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes pulse-ring {
  from { opacity: 0.6; transform: scale(0.75); }
  to { opacity: 0; transform: scale(1.12); }
}

@keyframes recording-pulse {
  50% { opacity: 0.35; transform: scale(0.8); }
}

@keyframes wave {
  0% { height: 18px; opacity: 0.5; }
  100% { height: 110px; opacity: 1; }
}

@keyframes wave-compact {
  0% { height: 10px; opacity: 0.45; }
  100% { height: 48px; opacity: 1; }
}

@keyframes detection-bars {
  from { height: 7px; }
  to { height: 24px; }
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(64px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(64px) rotate(-360deg); }
}

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

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes confetti {
  from { opacity: 1; transform: translateY(25px) rotate(0); }
  to { opacity: 0; transform: translateY(135px) rotate(280deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .prototype-layout {
    grid-template-columns: 1fr;
  }

  .device {
    grid-column: 1;
  }

  .qa-mode .device {
    transform: translateX(165px);
  }

  .qa-panel {
    left: 18px;
  }
}

@media (max-width: 600px) {
  body {
    background: var(--cream);
  }

  .prototype-layout {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .device {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .device::before,
  .qa-launcher,
  .qa-panel {
    display: none;
  }

  .qa-mode .device {
    transform: none;
  }

  .app-bar {
    padding-top: calc(var(--safe-top) + 4px);
  }
}

@media (max-width: 370px) {
  .app-bar {
    gap: 7px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .prototype-reset {
    max-width: 132px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 10px;
  }

  .screen-stack {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-card {
    min-height: 285px;
    padding: 22px 19px;
  }

  .hero-card h1 {
    font-size: 35px;
  }

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

  .listen-button {
    min-height: 72px;
  }

  .secondary-button {
    min-height: 52px;
  }

  .result-visual {
    min-height: 275px;
  }

  .review-screen .observation-card__image {
    height: 205px;
  }
}

@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;
  }
}
