:root {
  color-scheme: light;
  --ink: #20201f;
  --muted: #62615e;
  --paper: #fffdf8;
  --soft: #f5f7f3;
  --line: #d8ddd2;
  --line-strong: #b9c3b1;
  --sage: #6f8c74;
  --coral: #e86f5e;
  --blue: #577f9f;
  --record: #ff385c;
  --record-dark: #bc1439;
  --shadow: 0 18px 50px rgba(32, 32, 31, 0.1);
}

/* Recording-first iOS library and player */
.library-page {
  min-height: 100svh;
  padding:
    max(10px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(104px, calc(env(safe-area-inset-bottom) + 88px))
    max(16px, env(safe-area-inset-left));
  background: #000000;
  color: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.voice-memos-library {
  display: grid;
  width: min(100%, 680px);
  margin: 0 auto;
  gap: 12px;
}

.library-topbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 50px;
}

.library-topbar h1 {
  margin: 0;
  overflow: hidden;
  color: #f5f5f7;
  font-size: 20px;
  font-weight: 680;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-round-button,
.library-settings-control {
  display: inline-grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #0a84ff;
  box-shadow: none;
  text-decoration: none;
}

.library-back-control::before {
  width: 12px;
  height: 12px;
  border-width: 0 0 2.5px 2.5px;
  transform: translateX(3px) rotate(45deg);
}

.library-settings-control {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.library-settings-glyph {
  display: block;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.library-search-strip input {
  min-height: 38px;
  border-radius: 9px;
  padding-left: 38px;
  background: #1c1c1e;
  font-size: 16px;
}

.library-search-strip::before {
  left: 13px;
  width: 12px;
  height: 12px;
}

.library-search-strip::after {
  left: 24px;
  top: calc(50% + 5px);
}

.library-local-notice {
  padding: 9px 12px;
  border: 0;
  color: rgba(235, 235, 245, 0.58);
  font-size: 13px;
}

.voice-recording-list {
  overflow: hidden;
  border-top: 0.5px solid rgba(84, 84, 88, 0.72);
}

.voice-recording-row {
  display: block;
  padding: 0;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
}

.voice-recording-copy {
  position: relative;
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 3px;
  padding: 10px 42px 10px 12px;
}

.voice-recording-copy strong {
  font-size: 17px;
  font-weight: 620;
  line-height: 1.18;
}

.voice-recording-copy > span:not(.voice-recording-accessory) {
  color: rgba(235, 235, 245, 0.58);
  font-size: 13px;
  line-height: 1.2;
}

.voice-recording-details:empty {
  display: none;
}

.voice-recording-accessory {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 9px;
  height: 9px;
  border-top: 1.8px solid rgba(235, 235, 245, 0.34);
  border-right: 1.8px solid rgba(235, 235, 245, 0.34);
  transform: translateY(-50%) rotate(45deg);
}

.library-record-fab {
  width: 66px;
  height: 66px;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(84, 84, 88, 0.72);
}

.review-space {
  background: #000000;
}

.sound-galaxy-app[data-phase="review"] .review-space {
  grid-template-rows: auto auto auto auto auto auto;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding:
    max(10px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(22px, calc(env(safe-area-inset-bottom) + 16px))
    max(16px, env(safe-area-inset-left));
}

.review-header,
.review-visuals,
.review-playback-controls,
.review-actions,
.review-detections-panel,
.review-draft-status {
  width: min(100%, 680px);
  margin-right: auto;
  margin-left: auto;
}

.review-header { order: 1; }
.review-visuals { order: 2; }
.review-playback-controls { order: 3; }
.review-actions { order: 4; }
.review-detections-panel { order: 5; }
.review-draft-status { order: 6; }

.sound-galaxy-app[data-review-origin="library"] .review-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  grid-template-areas:
    "back title empty"
    "back meta empty";
  align-items: center;
  gap: 2px 6px;
  min-height: 54px;
  padding: 0;
}

.sound-galaxy-app[data-review-origin="library"] .review-library-back {
  grid-area: back;
  width: 44px;
  height: 44px;
  margin: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.sound-galaxy-app[data-review-origin="library"] .review-library-back::before {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0;
  place-items: center;
  color: #0a84ff;
  content: "‹";
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
}

.sound-galaxy-app[data-review-origin="library"] #reviewStepLabel {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"] .review-header h1 {
  grid-area: title;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
}

.sound-galaxy-app[data-review-origin="library"] .review-saved-meta {
  grid-area: meta;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-spectrogram {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
  display: block;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip {
  display: grid;
  grid-template-rows: auto 180px;
}

.review-panel figcaption span {
  color: rgba(235, 235, 245, 0.58);
  letter-spacing: 0;
  text-transform: none;
}

.review-panel figcaption strong {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 12px;
}

#reviewWaveformCanvas,
#reviewSpectrogramCanvas {
  border-color: rgba(84, 84, 88, 0.62);
  border-radius: 4px;
  background: #111113;
}

.review-playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(34px, 11vw, 72px);
  min-height: 76px;
}

.review-playback-controls button {
  border: 0;
  background: transparent;
  color: #f5f5f7;
  cursor: pointer;
}

.review-skip-button {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2.5px solid currentColor !important;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 720;
}

.review-skip-button::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -4px;
  width: 12px;
  height: 12px;
  border-top: 2.5px solid currentColor;
  border-left: 2.5px solid currentColor;
  transform: rotate(-22deg);
}

.review-skip-forward::before {
  right: -4px;
  left: auto;
  border-right: 2.5px solid currentColor;
  border-left: 0;
  transform: rotate(22deg);
}

.review-playback-controls .review-play-button {
  display: grid;
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  background: #f5f5f7;
  color: #000000;
}

.review-playback-controls .review-play-button .review-action-icon {
  width: auto;
  height: auto;
  background: transparent;
  font-size: 25px;
}

.review-playback-controls .review-play-button .review-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.review-actions {
  justify-content: center;
}

.review-actions button {
  min-height: 40px;
  border-radius: 8px;
  font-size: 13px;
}

.sound-galaxy-app[data-review-origin="library"] .review-actions {
  display: flex;
}

.sound-galaxy-app[data-review-origin="library"] #reviewRecordAgainButton {
  min-width: 116px;
  flex: 0 0 auto;
  background: #1c1c1e;
  color: #0a84ff;
}

.review-detections-panel {
  display: grid;
  gap: 0;
  border-top: 0.5px solid rgba(84, 84, 88, 0.72);
}

.review-detections-panel[hidden] {
  display: none;
}

.review-detections-panel > header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
}

.review-detections-panel h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.review-detections-panel header span {
  color: rgba(235, 235, 245, 0.58);
  font-size: 13px;
}

.review-detection-empty {
  margin: 0;
  padding: 16px 0;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
  color: rgba(235, 235, 245, 0.58);
  font-size: 14px;
  line-height: 1.35;
}

.review-detection-row {
  display: grid;
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 0;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
  padding: 7px 0;
  background: transparent;
  color: #f5f5f7;
  cursor: pointer;
  text-align: left;
}

.review-detection-time {
  color: #0a84ff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.review-detection-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.review-detection-copy strong,
.review-detection-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-detection-copy strong {
  font-size: 15px;
  font-weight: 590;
}

.review-detection-copy small,
.review-detection-confidence {
  color: rgba(235, 235, 245, 0.58);
  font-size: 12px;
}

.review-detection-chevron {
  width: 8px;
  height: 8px;
  border-top: 1.5px solid rgba(235, 235, 245, 0.28);
  border-right: 1.5px solid rgba(235, 235, 245, 0.28);
  transform: rotate(45deg);
}

.review-deep-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
}

#deepReviewButton {
  display: grid;
  gap: 2px;
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: #0a84ff;
  cursor: pointer;
  text-align: left;
}

#deepReviewButton span {
  font-size: 15px;
  font-weight: 600;
}

#deepReviewButton small {
  color: rgba(235, 235, 245, 0.5);
  font-size: 11px;
}

#deepReviewButton:disabled {
  cursor: default;
  opacity: 0.44;
}

#deepReviewUpgradeLink {
  color: #0a84ff;
  font-size: 13px;
  text-decoration: none;
}

.deep-review-status {
  min-height: 0;
  margin: 8px 0 0;
  color: rgba(235, 235, 245, 0.58);
  font-size: 12px;
  line-height: 1.35;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="crop"] .review-detections-panel {
  display: none;
}

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"] .review-space {
    gap: 10px;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip {
    grid-template-rows: auto clamp(136px, 22vh, 180px);
  }

  .review-actions {
    display: flex;
    grid-template-columns: none;
  }

  #saveRecordingOnlyButton {
    grid-column: auto;
  }

  .review-playback-controls {
    min-height: 70px;
  }
}

/* Explore and shared Apple-style navigation */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-nav-icon--explore,
.native-tab-icon--explore {
  position: relative;
  width: 23px;
  height: 23px;
  box-sizing: border-box;
  border: 1.8px solid currentColor;
  border-radius: 50%;
  background: transparent;
}
.app-nav-icon--explore::before,
.native-tab-icon--explore::before {
  content: "";
  position: absolute;
  inset: 3.5px;
  clip-path: polygon(50% 0, 73% 43%, 50% 100%, 27% 57%);
  transform: rotate(38deg);
  border: 0;
  background: currentColor;
}
.app-nav-icon--explore::after,
.native-tab-icon--explore::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  transform: translate(-50%, -50%);
  border: 1.2px solid currentColor;
  border-radius: 50%;
  background: #18181b;
}
.global-record-action,
.app-nav-record.global-record-action {
  position: fixed;
  z-index: 120;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(62px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-height: 58px !important;
  margin: 0;
  border: 0;
  border-radius: 999px !important;
  background: #ff3b30 !important;
  color: white !important;
  box-shadow: 0 10px 30px rgba(255, 59, 48, 0.34), 0 2px 8px rgba(0,0,0,.45);
  text-decoration: none;
}
.global-record-action > span:first-child,
.app-nav-record.global-record-action .app-nav-record-dot { width: 22px; height: 22px; border: 3px solid white; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 5px white; }
.native-tab-bar {
  position: fixed; z-index: 110; right: 0; bottom: 0; left: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(50px + env(safe-area-inset-bottom));
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  border-top: .5px solid rgba(84,84,88,.72); background: rgba(24,24,27,.9);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
}
.native-tab-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; color: rgba(235,235,245,.58); font: 590 10px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif; text-decoration: none; }
.native-tab-bar a.active { color: #0a84ff; }
.native-tab-icon { display: block; width: 22px; height: 20px; box-sizing: border-box; color: currentColor; }
.native-tab-icon--library { border: 1.8px solid currentColor; border-radius: 4px; background: linear-gradient(currentColor,currentColor) 50% 34%/12px 1.5px no-repeat,linear-gradient(currentColor,currentColor) 50% 67%/12px 1.5px no-repeat; }
.native-tab-icon--settings { width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 50%; background: radial-gradient(circle,transparent 0 4px,currentColor 4.5px 5.5px,transparent 6px); }
.library-page { padding-bottom: max(118px, calc(env(safe-area-inset-bottom) + 100px)); }
.library-topbar-spacer { width: 34px; height: 34px; }

.explore-native-page,
.public-playback-page { min-height: 100dvh; margin: 0; overflow-x: hidden; background: #000; color: #f5f5f7; font-family: -apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui,sans-serif; }
.explore-native-page { height: auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.explore-native-page button,
.public-playback-page button { font: inherit; }
.explore-native-shell { width: min(760px,100%); box-sizing: border-box; margin: 0 auto; padding: max(22px,env(safe-area-inset-top)) 16px max(148px,calc(env(safe-area-inset-bottom) + 130px)); }
.explore-native-header h1 { margin: 14px 0 12px; font-size: clamp(34px,9vw,44px); line-height: 1; letter-spacing: -.045em; }
.explore-search { position: relative; display: block; }
.explore-search span::before { content: ""; position: absolute; z-index: 1; top: 14px; left: 13px; width: 12px; height: 12px; border: 1.8px solid #8e8e93; border-radius: 50%; }
.explore-search span::after { content: ""; position: absolute; z-index: 1; top: 26px; left: 25px; width: 7px; height: 1.8px; transform: rotate(45deg); background: #8e8e93; }
.explore-search input { width: 100%; height: 42px; box-sizing: border-box; border: 0; border-radius: 11px; padding: 0 14px 0 38px; background: #1c1c1e; color: #fff; font-size: 17px; outline: none; }
.explore-group-scroller { margin: 15px -16px 5px; overflow-x: auto; scrollbar-width: none; }
.explore-group-scroller::-webkit-scrollbar { display: none; }
.explore-group-scroller > div { display: flex; gap: 8px; width: max-content; padding: 0 16px 10px; }
.explore-group-scroller button { min-height: 34px; border: 0; border-radius: 999px; padding: 0 15px; background: #1c1c1e; color: #d1d1d6; font-size: 14px; font-weight: 650; }
.explore-group-scroller button.active { background: #f5f5f7; color: #111; }
.explore-status { margin: 24px 0; border-radius: 14px; padding: 18px; background: #1c1c1e; color: #aeaeb2; text-align: center; font-size: 14px; }
.explore-status[hidden] { display: none; }
.explore-section { margin-top: 25px; }
.explore-section[hidden] { display: none; }
.explore-section > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.explore-section h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.explore-section header span { color: #8e8e93; font-size: 12px; }
.explore-featured-scroller { display: flex; gap: 13px; margin: 0 -16px; padding: 0 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.explore-featured-scroller::-webkit-scrollbar { display: none; }
.explore-featured-tile { position: relative; flex: 0 0 min(72vw,290px); height: 218px; overflow: hidden; border-radius: 16px; background: #1c1c1e; scroll-snap-align: start; }
.explore-featured-tile > img { width: 100%; height: 100%; object-fit: cover; opacity: .78; }
.explore-featured-tile::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent,rgba(0,0,0,.88)); pointer-events: none; }
.explore-featured-tile > button:not(.explore-row-play) { position: absolute; z-index: 2; inset: auto 44px 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; padding: 15px; background: transparent; color: white; text-align: left; }
.explore-featured-tile button span { color: #ff9f0a; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.explore-featured-tile button strong { max-width: 210px; overflow: hidden; font-size: 19px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.explore-featured-tile button em { color: #d1d1d6; font-size: 13px; font-style: normal; }
.explore-featured-tile .explore-row-play { position: absolute; z-index: 3; right: 12px; bottom: 13px; }
.explore-recording-list { overflow: hidden; border-radius: 13px; background: #1c1c1e; }
.explore-recording-row { display: grid; grid-template-columns: 54px minmax(0,1fr) 42px; align-items: center; gap: 11px; min-height: 72px; margin-left: 12px; border-bottom: .5px solid rgba(84,84,88,.64); }
.explore-recording-row:last-child { border-bottom: 0; }
.explore-recording-row > img { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; background: #2c2c2e; }
.explore-row-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; border: 0; padding: 10px 0; background: transparent; color: white; text-align: left; }
.explore-row-copy strong,.explore-row-copy span,.explore-row-copy em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explore-row-copy strong { font-size: 16px; }
.explore-row-copy span { color: #d1d1d6; font-size: 13px; }
.explore-row-copy em { color: #8e8e93; font-size: 11px; font-style: normal; }
.explore-row-play,.mini-player-toggle,.public-transport button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #2c2c2e; color: #0a84ff; }
.explore-row-play::before,.mini-player-toggle::before,.public-transport button::before { content: ""; display: block; width: 0; height: 0; margin: auto; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; transform: translateX(1px); }
.explore-mini-player { position: fixed; z-index: 115; right: 8px; bottom: calc(51px + env(safe-area-inset-bottom)); left: 8px; display: grid; grid-template-columns: 42px minmax(0,1fr) 38px; align-items: center; gap: 9px; height: 58px; box-sizing: border-box; border-bottom: .5px solid rgba(84,84,88,.8); border-radius: 12px 12px 0 0; padding: 8px 10px; background: rgba(35,35,38,.96); box-shadow: 0 -8px 30px rgba(0,0,0,.28); backdrop-filter: blur(20px); }
.explore-mini-player[hidden] { display: none; }
.explore-mini-player img { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; }
.mini-player-copy { display: flex; flex-direction: column; min-width: 0; border: 0; padding: 0; background: none; color: white; text-align: left; }
.mini-player-copy strong,.mini-player-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player-copy span { color: #8e8e93; font-size: 12px; }
.explore-mini-player.playing .mini-player-toggle::before,.public-transport button.playing::before { width: 11px; height: 13px; border: 0; transform: none; background: linear-gradient(90deg,currentColor 0 35%,transparent 35% 65%,currentColor 65%); }

.public-playback-shell { width: min(720px,100%); box-sizing: border-box; margin: 0 auto; padding: max(10px,env(safe-area-inset-top)) 16px max(40px,env(safe-area-inset-bottom)); }
.public-playback-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; }
.public-playback-nav a { color: #0a84ff; text-decoration: none; font-size: 17px; }
.public-playback-nav a span { font-size: 31px; vertical-align: -2px; }
.public-playback-nav h1 { margin: 0; font-size: 17px; }
.public-playback-message { margin: 30vh auto 0; color: #8e8e93; text-align: center; }
.public-playback-identity { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center; margin: 20px 0; }
.public-playback-identity img { width: 92px; height: 92px; border-radius: 15px; object-fit: cover; }
.public-playback-identity span { color: #ff9f0a; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.public-playback-identity h2 { margin: 4px 0; font-size: 25px; line-height: 1.05; }
.public-playback-identity p,.public-playback-identity small { display: block; margin: 0; color: #aeaeb2; }
.public-playback-views { display: flex; gap: 4px; overflow-x: auto; padding: 3px; border-radius: 10px; background: #1c1c1e; }
.public-playback-views button { flex: 1 0 auto; min-height: 31px; border: 0; border-radius: 8px; padding: 0 10px; background: transparent; color: #aeaeb2; font-size: 12px; }
.public-playback-views button.active { background: #3a3a3c; color: white; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.public-visual-stage { position: relative; height: min(52vw,310px); min-height: 220px; margin: 12px 0; overflow: hidden; border-radius: 16px; background: #05070a; }
.public-visual-stage canvas { width: 100%; height: 100%; }
.public-visual-stage > span { position: absolute; top: 11px; left: 12px; color: rgba(235,235,245,.5); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.public-transport { margin: 8px 0 26px; }
.public-transport input { width: 100%; accent-color: #ff453a; }
.public-transport > div { display: grid; grid-template-columns: 1fr 50px 1fr; align-items: center; margin-top: 8px; color: #8e8e93; font-size: 12px; font-variant-numeric: tabular-nums; }
.public-transport button { justify-self: center; width: 46px; height: 46px; background: #f5f5f7; color: #111; }
.public-transport span:last-child { text-align: right; }
.public-detail-section { margin-top: 16px; overflow: hidden; border-radius: 14px; padding: 16px; background: #1c1c1e; }
.public-detail-section > header { display: flex; justify-content: space-between; align-items: baseline; }
.public-detail-section h3 { margin: 0 0 12px; font-size: 19px; }
.public-detail-section header span { color: #8e8e93; }
.public-detection-list article { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: .5px solid rgba(84,84,88,.6); }
.public-detection-list article em { grid-column: 1 / -1; color: #8e8e93; font-size: 12px; font-style: normal; }
.public-analysis-summary p { color: #aeaeb2; line-height: 1.45; }
.public-analysis-summary button { width: 100%; min-height: 46px; border: 0; border-radius: 11px; background: #0a84ff; color: #fff; font-weight: 700; }
.public-analysis-summary #publicReanalyzeStatus { color: #ff9f0a; font-size: 13px; }

@media (max-width: 390px) {
  .explore-native-shell { padding-right: 12px; padding-left: 12px; }
  .explore-group-scroller,.explore-featured-scroller { margin-right: -12px; margin-left: -12px; }
  .explore-group-scroller > div,.explore-featured-scroller { padding-right: 12px; padding-left: 12px; }
  .explore-recording-row { grid-template-columns: 50px minmax(0,1fr) 38px; gap: 9px; }
  .explore-recording-row > img { width: 50px; height: 50px; }
  .public-playback-identity { grid-template-columns: 76px 1fr; }
  .public-playback-identity img { width: 76px; height: 76px; }
}

.contribution-public-preview { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin: 14px 0; border-radius: 14px; padding: 12px; background: rgba(255,255,255,.07); }
.contribution-public-preview img { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; }
.contribution-public-preview div { display: flex; flex-direction: column; min-width: 0; }
.contribution-public-preview strong,.contribution-public-preview span,.contribution-public-preview em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contribution-public-preview span { color: rgba(235,235,245,.7); font-size: 13px; }
.contribution-public-preview em { color: rgba(235,235,245,.45); font-size: 11px; font-style: normal; }
.contribution-location-consent,.contribution-confirmation { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; border-radius: 12px; padding: 12px; background: rgba(255,255,255,.06); }
.contribution-location-consent input,.contribution-confirmation input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: #0a84ff; }
.contribution-location-consent span { display: flex; flex-direction: column; }
.contribution-location-consent em { margin-top: 2px; color: rgba(235,235,245,.56); font-size: 12px; font-style: normal; line-height: 1.3; }

/* Voice Memos-style saved recording playback. Keep this last in the cascade. */
.review-playback-time {
  order: 3;
  display: block;
  width: min(100%, 680px);
  margin: 2px auto 0;
  color: #f5f5f7;
  text-align: center;
  font-size: clamp(38px, 11vw, 54px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.review-playback-time[hidden] {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
  width: min(100%, 760px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip {
  display: block;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip figcaption {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
  width: 100%;
  height: clamp(240px, 42vh, 360px);
  border: 0;
  border-radius: 0;
  background: #26262c;
  cursor: grab;
  touch-action: pan-y;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas:active {
  cursor: grabbing;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls {
  order: 4;
  min-height: 94px;
  gap: clamp(42px, 14vw, 86px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-actions {
  order: 5;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-detections-panel {
  order: 6;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-draft-status {
  order: 7;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-play-button {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #f5f5f7;
  color: #000;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-play-button .review-action-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  background: transparent;
  color: #000;
  font-size: 28px;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-play-button .review-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"] .review-space {
    gap: 14px;
    padding-right: 0;
    padding-left: 0;
  }

  .sound-galaxy-app[data-review-origin="library"] .review-header,
  .sound-galaxy-app[data-review-origin="library"] .review-playback-controls,
  .sound-galaxy-app[data-review-origin="library"] .review-actions,
  .sound-galaxy-app[data-review-origin="library"] .review-detections-panel,
  .sound-galaxy-app[data-review-origin="library"] .review-draft-status,
  .sound-galaxy-app[data-review-origin="library"] .review-playback-time {
    width: calc(100% - 24px);
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="crop"] .review-visuals {
    width: calc(100% - 24px);
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
    height: 100%;
  }
}

/* Keep playback controls last in the cascade. */
.review-playback-views {
  order: 2;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
  order: 3;
  height: 250px;
  min-height: 250px;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip,
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-time {
  order: 4;
  margin-top: 0;
  font-size: clamp(38px, 10vw, 50px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls {
  order: 5;
  min-height: 78px;
  gap: clamp(42px, 14vw, 84px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-actions { order: 6; }
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-detections-panel { order: 7; }
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-draft-status { order: 8; }

.review-skip-button,
.voice-recording-skip {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  min-width: 58px;
  place-items: center;
  border: 0 !important;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #f5f5f7;
  box-shadow: none;
}

.review-skip-button::before,
.review-skip-forward::before,
.voice-recording-skip::before,
.voice-recording-skip-back::before,
.voice-recording-skip-forward::before {
  display: none;
  content: none;
}

.review-skip-arrow,
.voice-recording-skip-arrow {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-2px);
}

.review-skip-value,
.voice-recording-skip-value {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #000;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.voice-recording-skip-arrow { font-size: 48px; }
.voice-recording-skip-value { width: 26px; height: 26px; font-size: 11px; }

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"] .review-space { gap: 10px; }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
    width: 100%;
    height: 238px;
    min-height: 238px;
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas { height: 100%; }
  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls { min-height: 72px; }
}

/* Library organization and recording actions. */
.library-smart-collections {
  display: grid;
  min-height: 34px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: #1c1c1e;
}

.library-smart-collections button {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  background: transparent;
  color: #8e8e93;
  box-shadow: none;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.library-smart-collections button.active {
  background: #3a3a3c;
  color: #f5f5f7;
}

.voice-recording-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.voice-recording-header .voice-recording-copy {
  min-width: 0;
  padding-right: 8px;
}

.voice-recording-accessories {
  display: grid;
  grid-template-columns: 38px 38px;
  align-items: start;
  padding: 9px 4px 0 0;
}

.voice-recording-favorite,
.voice-recording-menu {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  min-width: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #0a84ff;
  box-shadow: none;
}

.voice-recording-favorite::before {
  content: "\2606";
  font-size: 23px;
  line-height: 1;
}

.voice-recording-favorite.active::before {
  content: "\2605";
}

.voice-recording-menu {
  top: auto;
  right: auto;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
  font-size: 0;
}

.voice-recording-menu span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.voice-recording-details {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.voice-recording-details > span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 2px;
  margin-left: 8px;
  border-radius: 50%;
  background: #636366;
  vertical-align: middle;
}

.voice-recording-analysis {
  color: #8e8e93;
}

.voice-recording-analysis::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #636366;
  vertical-align: 1px;
}

.voice-recording-analysis.is-cloud {
  color: #30d158;
}

.voice-recording-analysis.is-cloud::before {
  background: #30d158;
}

.voice-recording-analysis.is-device {
  color: #64d2ff;
}

.voice-recording-analysis.is-device::before {
  background: #64d2ff;
}

.voice-recording-analysis.is-processing {
  color: #ffd60a;
}

.voice-recording-analysis.is-processing::before {
  background: #ffd60a;
}

.library-filter-empty {
  border-top: 0;
}

.library-action-feedback {
  color: #f5f5f7;
}

.library-action-sheet,
.library-rename-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #f5f5f7;
}

.library-action-sheet::backdrop,
.library-rename-dialog::backdrop {
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(5px);
}

.library-action-sheet-panel {
  position: fixed;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left));
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}

.library-action-sheet-panel header,
.library-action-list,
.library-action-cancel {
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: rgba(36, 36, 38, 0.98);
}

.library-action-sheet-panel header {
  display: grid;
  gap: 3px;
  padding: 12px 16px;
  text-align: center;
}

.library-action-sheet-panel header strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-action-sheet-panel header span {
  color: #8e8e93;
  font-size: 12px;
}

.library-action-list {
  display: grid;
}

.library-action-list button,
.library-action-cancel {
  display: grid;
  min-height: 52px;
  border: 0;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
  border-radius: 0;
  padding: 0 16px;
  background: transparent;
  color: #f5f5f7;
  box-shadow: none;
  font: inherit;
  font-size: 17px;
  text-align: left;
}

.library-action-list button {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.library-action-list button:last-child {
  border-bottom: 0;
}

.library-action-list button.destructive {
  color: #ff453a;
}

.library-action-cancel {
  place-items: center;
  border-bottom: 0;
  border-radius: 12px;
  color: #0a84ff;
  font-weight: 650;
  text-align: center;
}

.library-action-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  color: currentColor;
}

.library-action-icon--star::before {
  content: "\2606";
  font-size: 25px;
  line-height: 24px;
}

.library-action-icon--rename::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  width: 16px;
  height: 4px;
  border: 2px solid currentColor;
  border-radius: 1px;
  transform: rotate(-42deg);
}

.library-action-icon--review::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.library-action-icon--review::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 1px;
  width: 22px;
  height: 2px;
  background: currentColor;
}

.library-action-icon--export::before {
  content: "\2191";
  position: absolute;
  top: -5px;
  left: 5px;
  font-size: 24px;
}

.library-action-icon--export::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 1px;
  left: 2px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.library-action-icon--delete::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 11px;
  height: 14px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}

.library-action-icon--delete::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.library-rename-dialog {
  display: none;
  place-items: center;
  padding: 20px;
}

.library-rename-dialog[open] {
  display: grid;
}

.library-rename-dialog form {
  display: grid;
  width: min(100%, 320px);
  gap: 16px;
  border-radius: 12px;
  padding: 20px;
  background: #1c1c1e;
}

.library-rename-dialog h2 {
  margin: 0;
  font-size: 19px;
  text-align: center;
}

.library-rename-dialog input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #48484a;
  border-radius: 8px;
  padding: 0 10px;
  background: #2c2c2e;
  color: #f5f5f7;
  font: inherit;
  font-size: 16px;
}

.library-rename-dialog form > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.library-rename-dialog button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #2c2c2e;
  color: #0a84ff;
  box-shadow: none;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
}

.library-rename-dialog button[type="submit"] {
  background: #0a84ff;
  color: #fff;
}

@media (width <= 390px) {
  .voice-recording-accessories {
    grid-template-columns: 36px 36px;
  }

  .voice-recording-favorite,
  .voice-recording-menu {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .library-smart-collections button {
    padding: 0 4px;
    font-size: 11px;
  }
}

/* Phase-correct recorder actions: one record control before capture, one stop control during capture. */
.sound-galaxy-app[data-phase="recording"] > .global-record-action,
.sound-galaxy-app[data-phase="review"] > .global-record-action,
.sound-galaxy-app[data-phase="analyzing"] > .global-record-action,
.sound-galaxy-app[data-phase="result"] > .global-record-action {
  display: none !important;
}

.recording-hud .stop-button {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  min-width: 66px;
  min-height: 66px;
  place-items: center;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #ff453a;
  color: transparent;
  font-size: 0;
  line-height: 0;
  box-shadow:
    0 12px 34px rgba(255, 69, 58, 0.38),
    0 0 0 6px rgba(255, 69, 58, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.28);
}

.recording-hud .stop-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(70, 0, 0, 0.22);
  transform: translate(-50%, -50%);
}

.recording-hud .stop-button:active:not(:disabled) {
  transform: scale(0.94);
  background: #ff3b30;
}

.recording-hud .stop-button:disabled {
  opacity: 0.68;
}

.review-navigation-bar #saveRecordingOnlyButton.review-save-action {
  width: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0a84ff;
  box-shadow: none;
  font-size: 17px;
  font-weight: 650;
}

@media (width <= 560px) {
  .recording-hud .stop-button {
    width: 62px;
    height: 62px;
    min-width: 62px;
    min-height: 62px;
  }

  .recording-hud .stop-button::before {
    width: 20px;
    height: 20px;
    border-radius: 4px;
  }
}

/* Definitive phone layout overrides. Keep these last in the cascade. */
@media (width <= 560px) {
  .sound-galaxy-app[data-phase="recording"] .live-detection-visual,
  .sound-galaxy-app[data-phase="recording"] .analysis-status.is-live-detection {
    display: none !important;
  }

  .sound-galaxy-app[data-phase="recording"] .live-detection-dock {
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 138px);
    left: max(12px, env(safe-area-inset-left));
    gap: 4px;
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(5, 8, 9, 0.78);
  }

  .sound-galaxy-app[data-phase="recording"] .recording-hud,
  .sound-galaxy-app[data-phase="recording"] .recording-settings-inline-toggle,
  .sound-galaxy-app[data-phase="recording"] .field-pair-toggle {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px);
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-space {
    gap: 8px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-header span {
    display: none;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-header h1 {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
    font-size: 30px;
    font-weight: 720;
    line-height: 1.05;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-visuals {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto;
    gap: 7px;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-panel {
    display: grid;
    gap: 4px;
    overflow: hidden;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-panel-clip {
    grid-template-rows: 22px 132px;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-panel-spectrogram {
    grid-template-rows: 20px 96px;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] #reviewWaveformCanvas,
  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] #reviewSpectrogramCanvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 8px;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-panel figcaption {
    min-height: 20px;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-playback-controls {
    min-height: 64px;
    gap: clamp(34px, 12vw, 62px);
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-actions button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border-radius: 10px;
  }
}

/* Phone recorder cleanup: visualization first, one detection surface, controls last. */
@media (width <= 560px) {
  .sound-galaxy-app[data-phase="recording"] .live-detection-visual,
  .sound-galaxy-app[data-phase="recording"] .analysis-status.is-live-detection {
    display: none !important;
  }

  .sound-galaxy-app[data-phase="recording"] .live-detection-dock {
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 138px);
    left: max(12px, env(safe-area-inset-left));
    gap: 4px;
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(5, 8, 9, 0.78);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  }

  .sound-galaxy-app[data-phase="recording"] .live-detection-dock-header {
    min-height: 34px;
  }

  .sound-galaxy-app[data-phase="recording"] .live-detection-card-row:empty {
    display: none;
  }

  .sound-galaxy-app[data-phase="recording"] .recording-hud {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px);
  }

  .sound-galaxy-app[data-phase="recording"] .recording-settings-inline-toggle,
  .sound-galaxy-app[data-phase="recording"] .field-pair-toggle {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px);
  }
}

/* Compact non-destructive clip editor. */
@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-space {
    gap: 8px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .sound-galaxy-app[data-review-step="crop"] .review-header span {
    display: none;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-header h1 {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
    font-size: 30px;
    font-weight: 720;
    line-height: 1.05;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-visuals {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto;
    gap: 7px;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-panel {
    display: grid;
    gap: 4px;
    overflow: hidden;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-panel-clip {
    grid-template-rows: 22px 142px;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-panel-spectrogram {
    grid-template-rows: 20px 104px;
  }

  .sound-galaxy-app[data-review-step="crop"] #reviewWaveformCanvas,
  .sound-galaxy-app[data-review-step="crop"] #reviewSpectrogramCanvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 8px;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-panel figcaption {
    min-height: 20px;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-playback-controls {
    min-height: 64px;
    gap: clamp(34px, 12vw, 62px);
  }

  .sound-galaxy-app[data-review-step="crop"] .review-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sound-galaxy-app[data-review-step="crop"] .review-actions button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border-radius: 10px;
  }

  .review-detections-panel {
    margin-top: 6px;
  }
}

/* iOS-style swipe action for device recordings. */
.voice-recording-row {
  position: relative;
  overflow: hidden;
  background: #ff453a;
}

.voice-recording-swipe-content {
  position: relative;
  z-index: 2;
  background: #000;
  touch-action: pan-y;
  transition: transform 220ms cubic-bezier(0.22, 0.72, 0.2, 1);
  will-change: transform;
}

.voice-recording-swipe-content.is-dragging {
  transition: none;
}

.voice-recording-delete-action {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  width: 92px;
  min-width: 92px;
  place-content: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 8px;
  background: #ff453a;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.voice-recording-delete-action[hidden] {
  display: none;
}

.voice-recording-delete-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 22px;
  margin: 0 auto;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.voice-recording-delete-icon::before {
  content: "";
  position: absolute;
  top: -6px;
  left: -4px;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.voice-recording-delete-icon::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 5px;
  width: 7px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.voice-recording-row.deleting .voice-recording-swipe-content {
  opacity: 0.44;
  pointer-events: none;
}

/* Final playback view and transport overrides. */
.review-playback-views {
  order: 2;
  display: grid;
  width: min(calc(100% - 24px), 520px);
  min-height: 34px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin: 0 auto;
  padding: 2px;
  border-radius: 8px;
  background: #1c1c1e;
}

.review-playback-views[hidden] {
  display: none;
}

.review-playback-views button {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  background: transparent;
  color: #8e8e93;
  box-shadow: none;
  font-size: 12px;
  font-weight: 650;
}

.review-playback-views button.active {
  background: #3a3a3c;
  color: #f5f5f7;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
  order: 3;
  height: 250px;
  min-height: 250px;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip,
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-time {
  order: 4;
  margin-top: 0;
  font-size: clamp(38px, 10vw, 50px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls {
  order: 5;
  min-height: 78px;
  gap: clamp(42px, 14vw, 84px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-actions {
  order: 6;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-detections-panel {
  order: 7;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-draft-status {
  order: 8;
}

.review-skip-button,
.voice-recording-skip {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  min-width: 58px;
  place-items: center;
  border: 0 !important;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #f5f5f7;
  box-shadow: none;
}

.review-skip-button::before,
.review-skip-forward::before,
.voice-recording-skip::before,
.voice-recording-skip-back::before,
.voice-recording-skip-forward::before {
  display: none;
  content: none;
}

.review-skip-arrow,
.voice-recording-skip-arrow {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-2px);
}

.review-skip-value,
.voice-recording-skip-value {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #000;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.voice-recording-skip-arrow {
  font-size: 48px;
}

.voice-recording-skip-value {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"] .review-space {
    gap: 10px;
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
    width: 100%;
    height: 238px;
    min-height: 238px;
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
    height: 100%;
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls {
    min-height: 72px;
  }
}

/* Voice Memos-style expandable Library rows. */
.voice-recording-copy {
  width: 100%;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  color: #f5f5f7;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.voice-recording-copy:hover,
.voice-recording-copy:focus-visible {
  background: rgba(255, 255, 255, 0.035);
}

.voice-recording-menu {
  position: absolute;
  top: 14px;
  right: 12px;
  color: #0a84ff;
  font-size: 18px;
  line-height: 1;
}

.voice-recording-row.expanded .voice-recording-copy {
  min-height: 68px;
  padding-bottom: 4px;
}

.voice-recording-row.expanded .voice-recording-details {
  display: none;
}

.voice-recording-expanded {
  display: grid;
  gap: 6px;
  padding: 5px 12px 10px;
}

.voice-recording-expanded[hidden] {
  display: none;
}

.voice-recording-scrubber {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #f5f5f7;
  cursor: pointer;
}

.voice-recording-timing {
  display: flex;
  justify-content: space-between;
  color: #8e8e93;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.voice-recording-controls {
  display: grid;
  min-height: 60px;
  grid-template-columns: repeat(4, minmax(48px, 1fr));
  align-items: center;
  justify-items: center;
}

.voice-recording-advanced-analysis {
  display: grid;
  width: 100%;
  min-height: 50px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(10, 132, 255, 0.52);
  border-radius: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.24), rgba(10, 132, 255, 0.08));
  color: #f5f5f7;
  cursor: pointer;
  text-align: left;
}

.voice-recording-advanced-analysis::after {
  content: "›";
  color: #63b5ff;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.voice-recording-advanced-analysis strong,
.voice-recording-advanced-analysis small {
  grid-column: 1;
}

.voice-recording-advanced-analysis strong {
  font-size: 15px;
}

.voice-recording-advanced-analysis small {
  color: rgba(235, 235, 245, 0.68);
  font-size: 12px;
}

.voice-recording-advanced-analysis:hover,
.voice-recording-advanced-analysis:focus-visible {
  border-color: #63b5ff;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.36), rgba(10, 132, 255, 0.14));
}

.voice-recording-advanced-analysis:disabled {
  border-color: rgba(142, 142, 147, 0.34);
  background: rgba(142, 142, 147, 0.12);
  color: rgba(235, 235, 245, 0.58);
  cursor: default;
}

.voice-recording-controls button,
.voice-recording-detail-link {
  display: grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f5f5f7;
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
}

.voice-recording-detail-link {
  color: #0a84ff;
}

.voice-recording-detail-link::before {
  content: "";
  width: 26px;
  height: 26px;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 4px);
  clip-path: polygon(0 42%, 8% 42%, 8% 22%, 16% 22%, 16% 8%, 24% 8%, 24% 34%, 32% 34%, 32% 0, 40% 0, 40% 26%, 48% 26%, 48% 12%, 56% 12%, 56% 38%, 64% 38%, 64% 18%, 72% 18%, 72% 4%, 80% 4%, 80% 32%, 88% 32%, 88% 22%, 96% 22%, 96% 42%, 100% 42%, 100% 58%, 96% 58%, 96% 78%, 88% 78%, 88% 68%, 80% 68%, 80% 96%, 72% 96%, 72% 82%, 64% 82%, 64% 62%, 56% 62%, 56% 88%, 48% 88%, 48% 74%, 40% 74%, 40% 100%, 32% 100%, 32% 66%, 24% 66%, 24% 92%, 16% 92%, 16% 78%, 8% 78%, 8% 58%, 0 58%);
}

.voice-recording-skip {
  position: relative;
  border: 2px solid #f5f5f7 !important;
  font-size: 13px;
  font-weight: 750;
}

.voice-recording-skip::before {
  content: "";
  position: absolute;
  top: -6px;
  width: 11px;
  height: 8px;
  border-top: 2px solid currentColor;
}

.voice-recording-skip-back::before {
  left: 3px;
  border-left: 2px solid currentColor;
  transform: rotate(-24deg);
}

.voice-recording-skip-forward::before {
  right: 3px;
  border-right: 2px solid currentColor;
  transform: rotate(24deg);
}

.voice-recording-play {
  color: #f5f5f7;
  font-size: 30px;
  line-height: 1;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(111, 140, 116, 0.08), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 68%, #f7fbff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

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

.sound-galaxy-app {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 56, 92, 0.22), transparent 30%),
    radial-gradient(circle at 74% 68%, rgba(99, 181, 255, 0.14), transparent 26%),
    linear-gradient(180deg, #182022 0%, #070b0c 100%);
  color: #ffffff;
  isolation: isolate;
  touch-action: manipulation;
}

.record-launch,
.recording-space,
.analysis-space,
.review-space,
.result-space {
  position: absolute;
  inset: 0;
}

.app-nav {
  position: absolute;
  z-index: 90;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  height: calc(49px + env(safe-area-inset-bottom));
  padding:
    0 max(8px, env(safe-area-inset-right))
    env(safe-area-inset-bottom)
    max(8px, env(safe-area-inset-left));
  border-top: 0.5px solid rgba(84, 84, 88, 0.72);
  background: rgba(28, 28, 30, 0.86);
  box-shadow: none;
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

.app-nav button,
.app-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 49px;
  border: 0;
  border-radius: 0;
  padding: 6px 8px;
  background: transparent;
  color: rgba(235, 235, 245, 0.56);
  cursor: pointer;
  font-size: 10px;
  font-weight: 590;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.sound-galaxy-app[data-phase="analyzing"] .app-nav,
.sound-galaxy-app[data-phase="review"] .app-nav,
.sound-galaxy-app[data-phase="result"] .app-nav {
  display: none;
}

.app-nav a:hover {
  background: transparent;
  color: #0a84ff;
}

.app-nav button:hover {
  background: transparent;
  color: #0a84ff;
}

.app-nav-item {
  flex-direction: column;
  gap: 4px;
}

.app-nav-item.active {
  color: #0a84ff;
}

.app-nav-item.active .app-nav-icon--settings {
  background-color: rgba(10, 132, 255, 0.14);
  box-shadow: 0 0 18px rgba(10, 132, 255, 0.22);
}

.app-nav-icon {
  display: block;
  width: 25px;
  height: 23px;
  box-sizing: border-box;
  color: currentColor;
}

.app-nav-icon--library {
  width: 22px;
  height: 20px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  background:
    linear-gradient(currentColor, currentColor) 50% 33% / 12px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 66% / 12px 1.6px no-repeat;
}

.app-nav-icon--settings {
  width: 23px;
  height: 23px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background:
    radial-gradient(circle, transparent 0 4px, currentColor 4.4px 5.8px, transparent 6.2px),
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 100% / 2px 5px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) 0 50% / 5px 2px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) 100% 50% / 5px 2px no-repeat;
}

.app-nav-label {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav-record {
  position: relative;
  flex-direction: column;
  gap: 2px;
  min-height: 49px !important;
  margin-top: 0;
  border-radius: 0 !important;
  background: transparent !important;
  color: #ff453a !important;
  box-shadow: none;
  font-size: 10px !important;
  font-weight: 590 !important;
}

.app-nav-record-dot {
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 69, 58, 0.18);
  box-shadow: inset 0 0 0 6px currentColor;
}

.app-nav-record:active {
  transform: translateY(1px) scale(0.99);
}

.site-page {
  min-height: 100dvh;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(92px, calc(env(safe-area-inset-bottom) + 76px))
    max(16px, env(safe-area-inset-left));
  background: #000000;
  color: #f5f5f7;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
}

.page-shell {
  display: grid;
  gap: 18px;
  width: min(100%, 1080px);
  margin: 0 auto;
}

.page-hero {
  display: grid;
  gap: 6px;
  padding: 2px 0 4px;
}

.page-hero h1 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, system-ui, sans-serif;
  font-size: clamp(34px, 8vw, 44px);
  font-weight: 760;
  line-height: 1.06;
  letter-spacing: 0;
}

.page-hero p {
  max-width: 48ch;
  margin: 0;
  color: rgba(235, 235, 245, 0.62);
  font-size: 17px;
  line-height: 1.38;
}

.page-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.page-summary-card,
.page-card {
  border: 0;
  border-radius: 12px;
  background: #1c1c1e;
  box-shadow: none;
}

.page-summary-card {
  padding: 16px;
}

.page-summary-card span {
  color: rgba(235, 235, 245, 0.58);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.page-summary-card strong {
  display: block;
  margin-top: 8px;
  color: #f5f5f7;
  font-size: 28px;
  font-weight: 700;
}

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

.page-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.species-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: 18px;
  align-items: center;
}

.species-hero-copy {
  display: grid;
  gap: 10px;
}

.species-hero-copy h1 {
  margin: 0;
  font-size: clamp(34px, 8vw, 58px);
  line-height: 0.95;
}

.species-hero-copy p {
  margin: 0;
}

.species-hero-art {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #1c1c1e;
}

.species-hero-art img {
  display: block;
  width: 100%;
  min-height: 240px;
  object-fit: cover;
}

.page-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.page-card header h2 {
  margin: 0;
  color: #f5f5f7;
  font-size: 20px;
  font-weight: 700;
}

.page-card header span,
.page-card .meta,
.page-note {
  color: rgba(235, 235, 245, 0.58);
  font-size: 13px;
}

.page-search {
  width: 100%;
  max-width: 420px;
}

.page-search input {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: #2c2c2e;
  color: #f5f5f7;
  font: inherit;
}

.page-search input::placeholder {
  color: rgba(235, 235, 245, 0.42);
}

.site-page input,
.site-page textarea,
.site-page select {
  border-color: transparent;
  background: #2c2c2e;
  color: #f5f5f7;
}

.site-page input::placeholder,
.site-page textarea::placeholder {
  color: rgba(235, 235, 245, 0.42);
}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  height: calc(49px + env(safe-area-inset-bottom));
  padding:
    0 max(8px, env(safe-area-inset-right))
    env(safe-area-inset-bottom)
    max(8px, env(safe-area-inset-left));
  border-top: 0.5px solid rgba(84, 84, 88, 0.72);
  border-radius: 0;
  background: rgba(28, 28, 30, 0.86);
  box-shadow: none;
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

.tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  border-radius: 0;
  color: rgba(235, 235, 245, 0.56);
  text-decoration: none;
  font-size: 10px;
  font-weight: 590;
  gap: 2px;
  -webkit-tap-highlight-color: transparent;
}

.tab-bar a::before {
  display: block;
  width: 25px;
  height: 23px;
  color: currentColor;
  box-sizing: border-box;
}

.tab-bar a[href="/library.html"]::before {
  content: "";
  width: 22px;
  height: 20px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  background:
    linear-gradient(currentColor, currentColor) 50% 33% / 12px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 66% / 12px 1.6px no-repeat;
}

.tab-bar a[href="/"]::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 69, 58, 0.18);
  box-shadow: inset 0 0 0 6px currentColor;
}

.tab-bar a[href="/profile.html"]::before {
  content: "";
  width: 23px;
  height: 23px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background:
    radial-gradient(circle, transparent 0 4px, currentColor 4.4px 5.8px, transparent 6.2px),
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 100% / 2px 5px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) 0 50% / 5px 2px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) 100% 50% / 5px 2px no-repeat;
}

.tab-bar a span {
  font-size: 10px;
  line-height: 1.05;
}

.tab-bar a.active {
  background: transparent;
  color: #0a84ff;
}

.tab-bar a[href="/"] {
  color: #ff453a;
}

.page-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.page-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.page-item-preview {
  margin: 0;
}

.page-item-preview img {
  display: block;
  width: 100%;
  max-height: 176px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.8);
}

.page-item header {
  display: grid;
  gap: 4px;
}

.page-item strong {
  color: #ffffff;
  font-size: 17px;
}

.page-item p {
  margin: 0;
  color: rgba(236, 250, 252, 0.64);
  line-height: 1.45;
}

.page-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-item-actions a,
.page-item-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: #ffffff;
  cursor: pointer;
  font-weight: 820;
  text-decoration: none;
  color: #091012;
}

.page-item-actions .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.page-item-actions .danger {
  background: #ff453a;
  color: #ffffff;
}

.page-item-actions span.secondary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

.profile-page .page-list {
  grid-template-columns: 1fr;
  gap: 16px;
}

.profile-page .page-item {
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-page .account-item {
  display: grid;
  gap: 14px;
}

.profile-page .account-state-message {
  max-width: 520px;
  margin: 0;
  color: rgba(236, 250, 252, 0.7);
  font-size: 16px;
}

.profile-page .account-state-message[hidden] {
  display: none;
}

.profile-page #accountDeletionItem {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.profile-page .account-auth-intro {
  display: grid;
  gap: 7px;
  max-width: 520px;
  padding: 0;
}

.account-status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 25px;
  box-sizing: border-box;
  border: 1px solid rgba(151, 221, 178, 0.3);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(112, 225, 162, 0.1);
  color: rgba(215, 255, 230, 0.92);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
}

.account-status-pill--signed-in {
  align-self: start;
  border-color: rgba(126, 231, 255, 0.28);
  background: rgba(126, 231, 255, 0.1);
  color: rgba(215, 250, 255, 0.95);
}

.profile-page .account-signed-in-summary {
  display: grid;
  max-width: 520px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(126, 231, 255, 0.15), transparent 42%),
    rgba(255, 255, 255, 0.045);
}

.profile-page .account-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(126, 231, 255, 0.36);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(126, 231, 255, 0.26), rgba(112, 225, 162, 0.18));
  color: #f3feff;
  font-size: 21px;
  font-weight: 850;
}

.profile-page .account-signed-in-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.profile-page .account-signed-in-copy strong {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 17px;
}

.profile-page .account-signed-in-copy p:last-child {
  color: rgba(236, 250, 252, 0.64);
}

.profile-page .account-offline-actions {
  display: flex;
  max-width: 520px;
}

.profile-page .account-offline-actions .secondary,
.profile-page .account-session-actions .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

.profile-page .account-session-actions {
  display: flex;
  max-width: 520px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.profile-page .account-session-actions p {
  flex: 1 1 230px;
  color: rgba(236, 250, 252, 0.56);
  font-size: 13px;
}

.account-auth-kicker,
.social-signin-title {
  margin: 0;
  color: rgba(151, 221, 178, 0.9);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.profile-page .account-auth-intro h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(24px, 5vw, 34px);
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.profile-page .account-auth-intro p {
  max-width: 460px;
  color: rgba(236, 250, 252, 0.66);
}

.profile-page .social-signin-stack {
  display: grid;
  gap: 10px;
  max-width: 520px;
  padding: 18px;
  border: 1px solid rgba(174, 244, 201, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(99, 224, 164, 0.17), transparent 42%),
    rgba(255, 255, 255, 0.045);
}

.profile-page .account-auth-notice {
  min-height: 20px;
  max-width: 520px;
  margin: 2px 0 0;
  color: rgba(220, 246, 231, 0.78);
}

.social-signin-grid {
  display: grid;
  gap: 9px;
}

.profile-page .social-signin-button {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 0 14px;
  color: #111214;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.profile-page .social-signin-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.24);
}

.profile-page .social-signin-button:focus-visible,
.profile-page .account-create-button:focus-visible {
  outline: 3px solid rgba(130, 232, 180, 0.75);
  outline-offset: 3px;
}

.profile-page .social-signin-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.social-signin-button--google {
  background: #ffffff;
}

.social-signin-button--apple {
  background: #f3f4f5;
}

.social-signin-mark {
  display: block;
  width: 25px;
  height: 25px;
}

.social-signin-mark--google {
  overflow: visible;
}

.social-signin-mark--apple {
  color: #111214;
}

.social-signin-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: rgba(236, 250, 252, 0.44);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.social-signin-divider::before,
.social-signin-divider::after {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  content: "";
}

.account-email-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.profile-page .account-email-actions .secondary,
.profile-page .account-create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}

.profile-page .account-email-actions .secondary {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.profile-page .account-create-button {
  border: 1px solid rgba(132, 239, 181, 0.52);
  background: rgba(112, 225, 162, 0.14);
  color: #d8ffe7;
}

.profile-page .account-email-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  max-width: 520px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.profile-page .account-email-form-heading {
  display: grid;
  gap: 5px;
  margin-bottom: 3px;
}

.profile-page .account-email-form-heading strong {
  color: #ffffff;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.profile-page .account-email-form label {
  color: rgba(236, 250, 252, 0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-page .account-email-form input {
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 0 14px;
  background: rgba(3, 12, 16, 0.55);
  color: #ffffff;
  font: inherit;
}

.profile-page .account-email-form input::placeholder {
  color: rgba(236, 250, 252, 0.38);
}

.profile-page .account-email-form input:focus {
  border-color: rgba(130, 232, 180, 0.78);
  outline: 3px solid rgba(130, 232, 180, 0.16);
}

.profile-page .account-email-form button[type="submit"] {
  min-height: 50px;
  margin-top: 5px;
  border-radius: 10px;
  background: #d8ffe7;
  color: #092015;
  font-size: 15px;
}

@media (width <= 420px) {
  .profile-page .social-signin-stack {
    padding: 14px;
  }

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

  .profile-page .account-email-form {
    padding: 14px;
  }

  .profile-page .account-signed-in-summary {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .profile-page .account-avatar {
    width: 48px;
    height: 48px;
  }

  .profile-page .account-status-pill--signed-in {
    grid-column: 2;
  }
}

.species-asset-card {
  border-left: 4px solid rgba(126, 215, 255, 0.72);
}

.library-recording-card {
  border-left: 4px solid rgba(255, 88, 116, 0.72);
}

.library-page {
  padding:
    max(18px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(132px, calc(env(safe-area-inset-bottom) + 112px))
    max(22px, env(safe-area-inset-left));
}

.voice-memos-library {
  width: min(100%, 620px);
  gap: 14px;
}

.library-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
}

.library-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-round-button,
.library-select-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: #1c1c1e;
  color: #f5f5f7;
  text-decoration: none;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.library-back-control::before {
  content: "";
  width: 15px;
  height: 15px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translateX(3px) rotate(45deg);
}

.library-search-control::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid currentColor;
  border-radius: 999px;
}

.library-search-control::after {
  content: "";
  width: 9px;
  height: 3px;
  margin-left: -4px;
  margin-top: 18px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.library-select-button {
  width: auto;
  min-width: 92px;
  padding: 0 22px;
  font: inherit;
  font-size: 17px;
  font-weight: 520;
  cursor: pointer;
}

.library-title-bar {
  padding-top: 12px;
}

.library-title-bar h1 {
  font-size: clamp(40px, 10vw, 52px);
  font-weight: 790;
  line-height: 0.96;
}

.library-search-strip {
  position: relative;
}

.library-search-strip::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(235, 235, 245, 0.46);
  border-radius: 999px;
  transform: translateY(-58%);
  pointer-events: none;
}

.library-search-strip::after {
  content: "";
  position: absolute;
  left: 28px;
  top: calc(50% + 6px);
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: rgba(235, 235, 245, 0.46);
  transform: rotate(45deg);
  pointer-events: none;
}

.library-search-strip input {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px 0 42px;
  background: #1c1c1e;
  color: #f5f5f7;
  font: inherit;
  font-size: 18px;
}

.library-search-strip input::placeholder {
  color: rgba(235, 235, 245, 0.46);
}

.library-list-shell {
  min-height: 48px;
}

.voice-recording-list {
  display: grid;
}

.library-local-notice {
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
  color: rgba(235, 235, 245, 0.58);
  font-size: 15px;
}

.voice-recording-row {
  display: grid;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.72);
}

.voice-recording-row[hidden] {
  display: none;
}

.voice-recording-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.voice-recording-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.voice-recording-copy strong {
  overflow: hidden;
  color: #f5f5f7;
  font-size: 23px;
  font-weight: 690;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-recording-copy span,
.voice-times {
  color: rgba(235, 235, 245, 0.58);
  font-size: 18px;
  line-height: 1.15;
}

.voice-recording-more {
  color: #0a84ff;
  font-size: 30px;
  font-weight: 700;
  line-height: 0.7;
  text-decoration: none;
}

.voice-recording-expanded {
  display: grid;
  gap: 12px;
}

.voice-waveform {
  display: flex;
  align-items: center;
  height: 54px;
  gap: 2px;
  overflow: hidden;
}

.voice-waveform span {
  flex: 1 0 3px;
  min-width: 2px;
  border-radius: 999px;
  background: rgba(235, 235, 245, 0.78);
}

.voice-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(235, 235, 245, 0.26);
  overflow: hidden;
}

.voice-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f5f5f7;
}

.voice-times {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.voice-toolbar {
  display: grid;
  grid-template-columns: 48px 1fr 72px 1fr 48px;
  align-items: center;
  justify-items: center;
  gap: 12px;
  min-height: 74px;
}

.voice-waveform-icon {
  width: 29px;
  height: 32px;
  background:
    linear-gradient(#0a84ff, #0a84ff) 0 50% / 3px 18px no-repeat,
    linear-gradient(#0a84ff, #0a84ff) 7px 50% / 3px 27px no-repeat,
    linear-gradient(#0a84ff, #0a84ff) 14px 50% / 3px 20px no-repeat,
    linear-gradient(#0a84ff, #0a84ff) 21px 50% / 3px 30px no-repeat,
    linear-gradient(#0a84ff, #0a84ff) 28px 50% / 3px 16px no-repeat;
}

.voice-play-control {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  color: #f5f5f7;
  position: relative;
}

.voice-play-control::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 20px;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 24px solid currentColor;
}

.voice-skip-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border: 3px solid #f5f5f7;
  border-radius: 999px;
  color: #f5f5f7;
  font-size: 13px;
  font-weight: 780;
}

.voice-trash-control {
  width: 25px;
  height: 30px;
  border: 2px solid #0a84ff;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  position: relative;
}

.voice-trash-control::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -8px;
  width: 30px;
  height: 2px;
  border-radius: 999px;
  background: #0a84ff;
}

.voice-trash-control::after {
  content: "";
  position: absolute;
  left: 8px;
  top: -13px;
  width: 8px;
  height: 5px;
  border: 2px solid #0a84ff;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.library-record-fab {
  position: fixed;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
  z-index: 24;
  width: 78px;
  height: 78px;
  border: 4px solid #1c1c1e;
  border-radius: 999px;
  background: #ff453a;
  box-shadow:
    0 0 0 3px rgba(84, 84, 88, 0.72),
    0 18px 46px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  -webkit-tap-highlight-color: transparent;
}

.contribution-feed {
  display: grid;
  gap: 10px;
}

.contribution-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.contribution-card > img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}

.contribution-card-body {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 0;
}

.contribution-card header {
  display: grid;
  gap: 3px;
}

.contribution-card strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.contribution-card header span {
  color: rgba(236, 250, 252, 0.58);
  font-size: 12px;
  font-weight: 720;
}

.contribution-card p {
  margin: 0;
  color: rgba(236, 250, 252, 0.64);
  line-height: 1.42;
}

.taxonomy-plate-section {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 190, 103, 0.12), transparent 30%),
    rgba(255, 255, 255, 0.045);
}

.taxonomy-plate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 12px;
}

.taxonomy-plate-card {
  position: relative;
  align-content: start;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 190, 103, 0.06)),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.taxonomy-plate-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
}

.taxonomy-plate-preview {
  padding: 10px 10px 6px;
  border: 1px solid rgba(120, 94, 58, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.18), transparent 48%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 8px),
    rgba(0, 0, 0, 0.18);
}

.taxonomy-plate-preview img {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: none;
  border-radius: 6px;
  object-fit: contain;
  mix-blend-mode: normal;
  background: transparent;
}

.taxonomy-plate-card header,
.taxonomy-plate-card p,
.taxonomy-plate-card .page-item-actions {
  position: relative;
  z-index: 1;
}

.taxonomy-plate-card header span {
  color: rgba(255, 190, 103, 0.82);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.taxonomy-plate-card strong {
  font-family: Georgia, "Times New Roman", serif;
}

.taxonomy-plate-card p {
  color: rgba(236, 250, 252, 0.62);
  font-size: 13px;
}

.taxonomy-plate-card .page-item-actions a {
  border-radius: 8px;
  background: #ffffff;
}

.taxonomy-plate-card .page-item-actions .secondary {
  min-height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
}

.library-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.library-card img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}

.library-copy {
  display: grid;
  gap: 6px;
}

.library-copy strong {
  font-size: 18px;
}

.library-copy .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (width <= 720px) {
  .site-page {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(94px, calc(env(safe-area-inset-bottom) + 80px))
      max(12px, env(safe-area-inset-left));
  }

  .page-shell {
    gap: 14px;
  }

  .page-hero {
    gap: 6px;
  }

  .page-hero h1 {
    font-size: clamp(30px, 10vw, 42px);
    line-height: 0.98;
  }

  .page-hero p {
    font-size: 15px;
    line-height: 1.42;
  }

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

  .page-summary-card,
  .page-card {
    border-radius: 18px;
  }

  .page-summary-card {
    padding: 14px;
  }

  .page-summary-card strong {
    margin-top: 6px;
    font-size: 24px;
  }

  .page-card {
    gap: 12px;
    padding: 14px;
  }

  .page-card header {
    display: grid;
    justify-content: stretch;
    gap: 8px;
  }

  .page-card header h2 {
    font-size: 18px;
  }

  .page-search {
    max-width: none;
  }

  .page-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .page-item {
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
  }

  .page-item strong,
  .library-copy strong {
    font-size: 16px;
  }

  .page-item p {
    line-height: 1.38;
  }

  .page-item-actions {
    gap: 6px;
  }

  .page-item-actions a,
  .page-item-actions button,
  .page-item-actions .secondary {
    min-height: 44px;
    padding: 0 12px;
    font-size: 14px;
  }

  .library-card {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 10px;
  }

  .library-card img {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .empty-state {
    padding: 14px;
    border-radius: 16px;
  }

  .tab-bar {
    left: 0;
    right: 0;
    bottom: 0;
    gap: 0;
    height: calc(49px + env(safe-area-inset-bottom));
    padding:
      0 max(8px, env(safe-area-inset-right))
      env(safe-area-inset-bottom)
      max(8px, env(safe-area-inset-left));
    border-radius: 0;
  }

  .tab-bar a {
    min-height: 49px;
    border-radius: 0;
    font-size: 10px;
  }

  .methods-panel {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    width: auto;
    padding: 14px;
  }

  .methods-visual {
    min-height: 116px;
  }

  .methods-card-grid,
  .methods-view-grid {
    grid-template-columns: 1fr;
  }

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

@media (width <= 420px) {
  .page-summary-grid {
    grid-template-columns: 1fr;
  }

  .page-card header {
    gap: 6px;
  }

  .page-note {
    font-size: 12px;
  }

  .page-item-actions a,
  .page-item-actions button,
  .page-item-actions .secondary {
    flex: 1 1 auto;
    justify-content: center;
  }

  .methods-module-grid {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(185, 195, 177, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
}

.sound-galaxy-app[data-phase="recording"] .app-nav,
.sound-galaxy-app[data-phase="review"] .app-nav,
.sound-galaxy-app[data-phase="analyzing"] .app-nav {
  display: none;
}

.methods-panel {
  position: absolute;
  z-index: 10;
  top: max(62px, calc(env(safe-area-inset-top) + 56px));
  right: max(14px, env(safe-area-inset-right));
  display: none;
  width: min(390px, calc(100vw - 28px));
  max-height: calc(100svh - 88px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 12, 13, 0.88);
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.34);
  color: #ffffff;
  backdrop-filter: blur(20px);
}

.sound-galaxy-app[data-methods-panel="open"] .methods-panel {
  display: block;
}

.sound-galaxy-app[data-phase="recording"] .methods-panel,
.sound-galaxy-app[data-phase="review"] .methods-panel,
.sound-galaxy-app[data-phase="analyzing"] .methods-panel {
  display: none;
}

.recording-library-panel {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 12;
  display: none;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(8, 12, 13, 0.86);
  color: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.sound-galaxy-app[data-recording-library="open"] .recording-library-panel {
  display: grid;
  gap: 12px;
}

.recording-library-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recording-library-panel header span {
  color: rgba(126, 215, 255, 0.78);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 860;
}

.recording-library-intro {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.recording-library-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.recording-library-tabs button {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.recording-library-tabs button.active {
  background: linear-gradient(180deg, rgba(126, 215, 255, 0.24), rgba(255, 255, 255, 0.12));
  color: #ffffff;
}

.recording-library-sections {
  display: grid;
}

.recording-library-section {
  display: grid;
  gap: 10px;
}

.recording-library-panel header button,
.recording-library-item button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 820;
}

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

.recording-library-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.recording-library-item strong {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 15px;
}

.recording-library-item span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 720;
}

.recording-library-item button {
  justify-self: start;
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
}

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

.animal-library-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.animal-library-item img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}

.animal-library-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.animal-library-copy strong {
  color: #ffffff;
  font-size: 15px;
}

.animal-library-copy span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 720;
}

.animal-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.animal-library-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(126, 215, 255, 0.95);
  color: #101617;
  cursor: pointer;
  font-weight: 820;
}

.animal-library-actions .ghost {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.84);
}

.methods-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.methods-panel header span,
.methods-panel dt {
  color: rgba(255, 255, 255, 0.58);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 850;
}

.methods-panel header button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.methods-panel h1 {
  margin: 8px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 500;
  line-height: 0.98;
}

.methods-visual {
  position: relative;
  min-height: 138px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid rgba(126, 215, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(126, 215, 255, 0.1), transparent 44%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 28px),
    radial-gradient(circle at 68% 48%, rgba(255, 56, 128, 0.18), transparent 28%),
    #020607;
}

.methods-visual::before,
.methods-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.methods-visual::before {
  background:
    linear-gradient(90deg, rgba(101, 226, 255, 0.78) 0 3px, transparent 3px 7px) 12px 18px / 12px 90px repeat-y,
    linear-gradient(90deg, rgba(50, 156, 255, 0.28), transparent 38%) 0 0 / 100% 100%;
  opacity: 0.86;
}

.methods-visual::after {
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.24) 39%, transparent 40% 100%),
    linear-gradient(20deg, transparent 0 48%, rgba(126, 215, 255, 0.18) 49%, transparent 50% 100%);
}

.methods-wave-line {
  position: absolute;
  left: 22px;
  right: 42%;
  top: 44%;
  height: 2px;
  background: linear-gradient(90deg, rgba(126, 215, 255, 0.18), rgba(126, 215, 255, 0.95), rgba(255, 94, 160, 0.7));
  box-shadow: 0 0 18px rgba(126, 215, 255, 0.72);
}

.methods-waterfall-stack {
  position: absolute;
  left: 22px;
  top: 22px;
  width: 118px;
  height: 94px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, rgba(80, 210, 255, 0.18) 0 3px, transparent 3px 8px),
    linear-gradient(90deg, rgba(94, 223, 255, 0.88), rgba(13, 39, 68, 0.44), transparent);
  filter: blur(0.2px);
}

.methods-orbit-node {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff4f9a;
  box-shadow: 0 0 18px rgba(255, 79, 154, 0.78);
}

.methods-orbit-node.node-a {
  right: 30%;
  top: 28%;
  width: 26px;
  height: 26px;
}

.methods-orbit-node.node-b {
  right: 18%;
  top: 54%;
  background: #33d5c2;
  box-shadow: 0 0 18px rgba(51, 213, 194, 0.78);
}

.methods-orbit-node.node-c {
  right: 10%;
  top: 26%;
  width: 12px;
  height: 12px;
  background: #ffc15e;
  box-shadow: 0 0 16px rgba(255, 193, 94, 0.78);
}

.methods-panel p,
.methods-panel dd {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

.methods-panel dl {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

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

.methods-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.methods-card-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(126, 215, 255, 0.12);
  color: rgba(126, 215, 255, 0.9);
  font-size: 12px;
  font-weight: 900;
}

.methods-panel dt,
.methods-panel dd {
  margin: 0;
}

.methods-section {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.methods-section h2 {
  margin: 0;
  color: rgba(126, 215, 255, 0.88);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.methods-section p {
  margin: 0;
}

.methods-view-grid,
.methods-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

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

.methods-view-grid article,
.methods-module-grid article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.methods-view-grid i,
.methods-module-grid i {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(126, 215, 255, 0.12);
  color: rgba(126, 215, 255, 0.94);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.methods-view-grid strong,
.methods-module-grid strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.methods-view-grid span,
.methods-module-grid span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  line-height: 1.35;
}

.methods-reference-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.methods-reference-list a {
  color: rgba(126, 215, 255, 0.95);
  text-decoration-color: rgba(126, 215, 255, 0.38);
  text-underline-offset: 3px;
}

.methods-panel .methods-note {
  margin-bottom: 0;
  color: rgba(126, 215, 255, 0.84);
}

.record-launch {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(104px, calc(env(safe-area-inset-bottom) + 88px))
    max(18px, env(safe-area-inset-left));
}

.record-launch::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, transparent, #000 16%, #000 82%, transparent);
  opacity: 0.55;
  pointer-events: none;
}

.record-launch::after {
  content: "";
  position: absolute;
  inset: 12% -18% -24%;
  background:
    radial-gradient(ellipse at 50% 54%, rgba(255, 56, 92, 0.23), transparent 34%),
    radial-gradient(ellipse at 72% 68%, rgba(72, 182, 212, 0.14), transparent 31%),
    linear-gradient(180deg, transparent 0%, rgba(3, 8, 9, 0.58) 82%);
  pointer-events: none;
}

.capture-console {
  position: relative;
  z-index: 9;
  display: grid;
  width: min(100%, 780px);
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-bottom: 0;
}

.capture-source {
  position: relative;
  display: flex;
  min-height: 82px;
  align-items: flex-start;
  justify-content: center;
}

.recording-upload-button {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 6;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 12px;
  font-weight: 840;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  touch-action: manipulation;
}

.recording-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.recording-upload-button span {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.recording-upload-button:hover,
.recording-upload-button:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.15);
}

.capture-core {
  position: relative;
  z-index: 30;
  display: grid;
  min-height: 0;
  place-items: center;
  align-content: center;
  gap: 22px;
}

.capture-mode-row {
  width: 100%;
  display: grid;
  gap: 12px;
  justify-items: center;
  justify-content: center;
}

.sentry-button {
  display: inline-flex;
  width: clamp(220px, 31vmin, 318px);
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.16), transparent 32%), linear-gradient(145deg, #2d6ce8 0%, #1c4ab0 100%);
  color: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  font-size: 16px;
  font-weight: 840;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow:
    0 18px 70px rgba(29, 74, 176, 0.3),
    0 0 0 12px rgba(44, 107, 232, 0.1),
    0 0 0 24px rgba(44, 107, 232, 0.03),
    inset 0 2px 2px rgba(255, 255, 255, 0.16);
}

.sentry-button .capture-mode-icon {
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sentry-button .capture-mode-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sentry-button.is-active,
.sentry-button[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 22px 80px rgba(44, 107, 232, 0.45),
    0 0 0 12px rgba(44, 107, 232, 0.18),
    0 0 0 24px rgba(44, 107, 232, 0.05),
    inset 0 2px 2px rgba(255, 255, 255, 0.24);
}

.capture-controls {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.record-button {
  position: relative;
  z-index: 40;
  display: grid;
  width: clamp(220px, 31vmin, 318px);
  aspect-ratio: 1;
  place-items: center;
  align-content: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.24), transparent 23%),
    linear-gradient(145deg, #ff6079 0%, #ff315f 48%, #b8113a 100%);
  color: #ffffff;
  box-shadow:
    0 26px 92px rgba(255, 56, 92, 0.34),
    0 0 0 15px rgba(255, 56, 92, 0.1),
    0 0 0 30px rgba(255, 56, 92, 0.035),
    inset 0 2px 2px rgba(255, 255, 255, 0.28),
    inset 0 -16px 34px rgba(66, 0, 21, 0.22);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  text-transform: uppercase;
  font-size: clamp(34px, 5.5vmin, 50px);
  font-weight: 900;
  letter-spacing: 0;
}

.record-button::before {
  content: "";
  position: absolute;
  inset: -46px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: inherit;
  opacity: 0.8;
  pointer-events: none;
}

.record-button span {
  width: 72px;
  max-width: 27%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 46px rgba(255, 255, 255, 0.64);
}

.sentry-button,
.recording-settings-toggle,
.recording-settings-panel button,
.recording-settings-panel input,
.recording-settings-panel select,
.capture-console button,
.capture-console [role="button"] {
  position: relative;
  z-index: 12;
  pointer-events: auto;
  touch-action: manipulation;
}

.capture-source > .recording-upload-button {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}

#loadTestAudioButton {
  right: 104px;
}

.record-button,
.sentry-button {
  z-index: 40;
}

.stop-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.recording-space,
.analysis-space,
.review-space,
.result-space {
  display: none;
}

.recording-space {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 14%, rgba(87, 127, 159, 0.08), transparent 28%),
    linear-gradient(180deg, #091012 0%, #040708 100%);
}

.recording-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  min-height: 46px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 12px;
  font-weight: 840;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.recording-settings-toggle .recording-settings-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 13px;
  line-height: 1;
  flex: 0 0 auto;
  background: rgba(126, 215, 255, 0.12);
  color: rgba(126, 231, 255, 0.94);
}

.recording-settings-toggle.is-open {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.42);
}

.recording-settings-dock {
  position: relative;
  display: inline-flex;
}

.recording-settings-inline-toggle {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 65;
  align-items: center;
  justify-content: center;
}

.recording-settings-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  width: min(92vw, 720px);
  max-height: min(76vh, 700px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(24, 30, 31, 0.97), rgba(8, 12, 13, 0.97));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.recording-settings-panel > * {
  min-width: 0;
  max-width: 100%;
  order: 8;
}

.recording-settings-panel > .recording-settings-header {
  grid-column: 1 / -1;
  order: 0;
}

.recording-settings-panel > .settings-mode-panel {
  grid-column: 1 / -1;
  order: 1;
}

.recording-settings-panel > .mic-selector-wrap {
  grid-column: 1 / -1;
  order: 6;
}

.recording-settings-panel > .auto-capture-panel {
  order: 2;
}

.recording-settings-panel > .filter-pack-wrap {
  order: 3;
}

.recording-settings-panel > .target-animal-panel {
  grid-column: 1 / -1;
  order: 4;
}

.recording-settings-panel > .input-gain-wrap {
  order: 6;
}

.recording-settings-panel > .input-agc-label {
  align-self: end;
  order: 6;
}

.recording-settings-panel > .advanced-audio-toggle {
  grid-column: 1 / -1;
  order: 5;
}

.recording-settings-panel > .advanced-audio-profile {
  order: 6;
}

.recording-settings-panel > .region-prior-panel {
  grid-column: 1 / -1;
  order: 7;
}

.recording-settings-panel > .analysis-tool-panel,
.recording-settings-panel > .recording-settings-warning {
  grid-column: 1 / -1;
}

.recording-settings-shared {
  position: fixed;
  z-index: 96;
  right: auto;
  bottom: calc(69px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
}

.recording-settings-shared.is-live {
  top: max(70px, calc(env(safe-area-inset-top) + 62px));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: auto;
  max-height: none;
  transform: none;
}

.recording-settings-panel[data-settings-mode="automatic"] .settings-manual-only,
.recording-settings-panel[data-advanced-audio="closed"] .settings-advanced-control {
  display: none !important;
}

.recording-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recording-settings-header > div:first-child {
  display: grid;
  gap: 2px;
}

.recording-settings-header > div:first-child span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 680;
}

.recording-settings-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.recording-settings-header strong {
  font-size: 18px;
  font-weight: 860;
  letter-spacing: -0.02em;
}

.recording-settings-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 780;
}

.recording-settings-reset {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: rgba(126, 231, 255, 0.86);
  cursor: pointer;
  font-size: 11px;
  font-weight: 780;
}

.settings-mode-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(126, 231, 255, 0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(126, 231, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.settings-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: start;
  gap: 5px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
}

.settings-mode-options button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.settings-mode-options button.active {
  background: rgba(126, 231, 255, 0.2);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(126, 231, 255, 0.34);
}

.settings-mode-copy {
  display: grid;
  align-content: center;
  gap: 3px;
}

.settings-mode-copy strong {
  color: #ffffff;
  font-size: 13px;
}

.settings-mode-copy p,
.settings-mode-copy em {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.settings-mode-copy em {
  color: rgba(126, 231, 255, 0.78);
}

@media (min-width: 561px) {
  .recording-settings-panel[data-settings-mode="automatic"] {
    grid-template-columns: minmax(0, 1fr);
    width: min(92vw, 560px);
    gap: 10px;
    padding: 16px;
  }

  .recording-settings-panel[data-settings-mode="automatic"] .settings-mode-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .recording-settings-panel[data-settings-mode="automatic"] .settings-mode-options {
    width: 100%;
  }
}

.auto-capture-panel {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 14px;
  background: rgba(126, 231, 255, 0.08);
}

.auto-capture-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.auto-capture-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #7ee7ff;
}

.auto-capture-toggle span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auto-capture-toggle strong {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

.auto-capture-toggle em {
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-style: normal;
  font-weight: 680;
  line-height: 1.3;
}

.target-animal-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 16px;
  padding: 12px;
  background: rgba(126, 231, 255, 0.08);
}

.target-animal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.target-animal-header span {
  color: rgba(126, 231, 255, 0.84);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.target-animal-header strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.2;
}

.target-animal-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 6px;
}

.target-animal-row button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 11px;
  font-weight: 840;
}

.target-animal-row button.active {
  border-color: rgba(126, 231, 255, 0.62);
  background: rgba(126, 231, 255, 0.22);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.target-animal-status {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  line-height: 1.35;
}

.region-prior-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(126, 231, 255, 0.1);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(7, 18, 21, 0.94), rgba(3, 8, 10, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(126, 231, 255, 0.04),
    0 18px 42px rgba(0, 0, 0, 0.2);
}

.region-prior-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.region-prior-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.region-prior-header span {
  color: rgba(126, 231, 255, 0.76);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.region-prior-header strong {
  overflow-wrap: normal;
  color: rgba(241, 252, 255, 0.94);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 690;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.region-location-pill {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 56, 92, 0.22);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 56, 92, 0.07);
  color: rgba(239, 251, 255, 0.82);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 690;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.region-location-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff385c;
  box-shadow: 0 0 9px rgba(255, 56, 92, 0.58);
}

.region-location-pill span {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.region-location-pill[data-location-state="locating"] i {
  background: #f8f1e7;
  box-shadow: 0 0 10px rgba(248, 241, 231, 0.58);
  animation: region-location-pulse 900ms ease-in-out infinite alternate;
}

.region-location-pill[data-location-state="manual"] {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.67);
}

.region-location-pill[data-location-state="manual"] i {
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

@keyframes region-location-pulse {
  from { opacity: 0.45; transform: scale(0.78); }
  to { opacity: 1; transform: scale(1.16); }
}

.region-prior-header button,
.region-map-reset {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 11px;
  font-weight: 820;
}

.region-map-reset:focus-visible {
  outline: 2px solid rgba(126, 231, 255, 0.86);
  outline-offset: 2px;
}

.region-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.region-map-toolbar > span {
  color: rgba(198, 230, 236, 0.54);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.region-map {
  --region-accent: #ff385c;
  --region-accent-rgb: 255, 56, 92;
  position: relative;
  width: 100%;
  height: auto;
  min-height: 320px;
  aspect-ratio: 1.5;
  overflow: hidden;
  border: 1px solid rgba(126, 231, 255, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at 68% 24%, rgba(126, 231, 255, 0.12), transparent 48%),
    radial-gradient(circle at 22% 78%, rgba(255, 56, 92, 0.045), transparent 42%),
    linear-gradient(150deg, #08161a, #061014 58%, #020507);
  box-shadow:
    inset 0 1px 0 rgba(248, 241, 231, 0.08),
    inset 0 -32px 54px rgba(0, 0, 0, 0.38),
    0 16px 38px rgba(var(--region-accent-rgb), 0.055);
  isolation: isolate;
}

.region-map[data-map-view="detail"] {
  aspect-ratio: 1.5;
}

.region-map[data-map-view="world"] {
  min-height: 0;
  aspect-ratio: 2.5;
}

.region-map::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(126, 231, 255, 0.035), transparent 24%),
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 4, 6, 0.5) 100%);
  content: "";
  pointer-events: none;
}

.region-map-world-artwork {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  pointer-events: none;
  filter: contrast(1.12) brightness(1.02) saturate(1.15);
  transform: scale(1.015);
  transition: opacity 320ms ease, filter 420ms ease, transform 440ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.region-map[data-map-view="world"] .region-map-world-artwork {
  opacity: 0.97;
  transform: scale(1);
}

.region-map-artwork {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  pointer-events: none;
  filter: contrast(1.14) saturate(0.16) brightness(0.72);
  transform: scale(1.055);
  transition: opacity 360ms ease, filter 560ms ease, transform 620ms cubic-bezier(0.2, 0.78, 0.2, 1);
}

.region-map[data-map-view="detail"] .region-map-artwork {
  opacity: 1;
  filter: contrast(1.18) saturate(1.15) brightness(1.03);
  transform: scale(1);
}

.region-map-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.region-world-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  transform-origin: var(--region-focus-x, 50%) var(--region-focus-y, 50%);
  transition: opacity 280ms ease, filter 340ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.region-map-world-vector {
  display: none;
  fill: transparent;
  stroke: transparent;
  stroke-linejoin: round;
  stroke-width: 0.42;
  vector-effect: non-scaling-stroke;
  transition: opacity 220ms ease;
}

.region-map[data-map-view="detail"] .region-map-world-vector {
  opacity: 0;
  pointer-events: none;
}

.region-map.is-zooming-to-detail .region-world-map {
  opacity: 0;
  filter: blur(2.5px) brightness(1.2);
  transform: scale(2.65);
}

.region-map.is-detail-arriving .region-map-artwork {
  animation: region-terrain-arrive 610ms cubic-bezier(0.16, 0.82, 0.22, 1) both;
}

.region-map.is-detail-arriving .region-map-markers {
  animation: region-border-arrive 460ms 120ms ease both;
}

.region-map.is-leaving-detail .region-map-artwork,
.region-map.is-leaving-detail .region-world-map {
  opacity: 0;
  filter: blur(2px) brightness(0.76);
  transform: scale(0.94);
}

.region-map.is-world-arriving .region-world-map {
  animation: region-world-arrive 440ms cubic-bezier(0.16, 0.82, 0.22, 1) both;
}

@keyframes region-terrain-arrive {
  from { opacity: 0; filter: blur(3px) contrast(1.02) saturate(0.12) brightness(1); transform: scale(1.12); }
  to { opacity: 1; filter: contrast(1.32) saturate(0.72) brightness(0.84); transform: scale(1); }
}

@keyframes region-border-arrive {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes region-world-arrive {
  from { opacity: 0; filter: blur(2px); transform: scale(0.86); }
  to { opacity: 1; filter: none; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .region-map-artwork,
  .region-world-map,
  .region-map-region-aura,
  .region-location-pill i {
    animation: none !important;
    transition: none !important;
  }
}

.region-map[data-map-view="detail"] .region-map-ocean,
.region-map[data-map-view="detail"] .region-map-lines,
.region-map[data-map-view="detail"] .region-map-land,
.region-map[data-map-view="detail"] .region-map-world-labels,
.region-map[data-map-view="detail"] .region-map-ranges,
.region-map[data-map-view="detail"] .region-map-pulse {
  opacity: 0;
  pointer-events: none;
}

.region-map-world-labels {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.region-map[data-map-view="world"] .region-map-world-labels {
  opacity: 1;
  pointer-events: auto;
}

.region-map-world-label {
  cursor: pointer;
  outline: none;
}

.region-map-world-label rect {
  fill: rgba(3, 10, 12, 0.58);
  stroke: rgba(126, 231, 255, 0.14);
  stroke-width: 0.55;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.42));
  transition: fill 160ms ease, stroke 160ms ease;
}

.region-map-world-label text {
  fill: rgba(232, 249, 252, 0.9);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.018em;
  pointer-events: none;
  text-transform: uppercase;
}

.region-map-world-label:hover rect,
.region-map-world-label:focus rect {
  fill: rgba(35, 8, 16, 0.82);
  stroke: rgba(255, 56, 92, 0.76);
}

.region-map-ocean {
  fill: rgba(3, 5, 6, 0.88);
}

.region-map[data-map-view="world"] .region-map-ocean {
  fill: rgba(1, 7, 10, 0.16);
}

.region-map-lines path {
  display: none;
}

.region-map-continent {
  fill: none;
  stroke: transparent;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-width: 0.62;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px rgba(126, 231, 255, 0.12));
  opacity: 0;
  transition: filter 160ms ease, opacity 160ms ease, stroke 160ms ease, stroke-width 160ms ease, transform 160ms ease;
}

.region-map-continent[data-map-continent] {
  cursor: pointer;
  pointer-events: auto;
}

.region-map-ranges path {
  display: none;
}

.region-map-pulse {
  fill: rgba(255, 255, 255, 0);
  opacity: 0;
  stroke: rgba(255, 255, 255, 0);
  stroke-width: 8;
  transition: opacity 160ms ease, fill 160ms ease, stroke 160ms ease;
}

.region-map[data-active-continent="north_america"] .region-map-pulse--north-america,
.region-map[data-active-continent="europe"] .region-map-pulse--europe {
  fill: rgba(255, 255, 255, 0.96);
  opacity: 0.9;
  stroke: rgba(255, 255, 255, 0.16);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.52));
}

.region-map[data-map-view="world"] .region-map-continent {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0.62;
  filter: none;
  opacity: 0;
}

.region-map[data-map-view="world"] .region-map-continent:hover {
  fill: rgba(255, 56, 92, 0.055);
  stroke: transparent;
  opacity: 1;
}

.region-map[data-map-view="world"][data-active-continent="north_america"] .region-map-continent--north-america,
.region-map[data-map-view="world"][data-active-continent="south_america"] .region-map-continent--south-america,
.region-map[data-map-view="world"][data-active-continent="europe"] .region-map-continent--europe,
.region-map[data-map-view="world"][data-active-continent="africa"] .region-map-continent--africa,
.region-map[data-map-view="world"][data-active-continent="asia"] .region-map-continent--asia,
.region-map[data-map-view="world"][data-active-continent="australia"] .region-map-continent--australia {
  fill: rgba(255, 56, 92, 0.07);
  stroke: rgba(255, 56, 92, 0.96);
  stroke-width: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 56, 92, 0.4));
  opacity: 1;
  transform: translateY(-1px);
}

.region-map-marker {
  cursor: pointer;
  outline: none;
}

.region-map-region-hit {
  fill: rgba(255, 255, 255, 0.001);
  stroke: none;
  pointer-events: all;
}

.region-map-region-aura {
  fill: transparent;
  stroke: transparent;
  stroke-linejoin: round;
  stroke-width: 0.85;
  opacity: 0;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  filter: blur(0.75px) drop-shadow(0 0 3px rgba(var(--region-accent-rgb), 0.42));
  transition: fill 180ms ease, opacity 180ms ease, stroke-width 180ms ease;
}

.region-map-region-shape {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0.38;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: none;
  transition: fill 180ms ease, stroke 180ms ease, stroke-width 180ms ease, filter 180ms ease;
}

.region-map-region-shape.is-fallback-cell {
  stroke-dasharray: 1.4 1.2;
  stroke-opacity: 0.58;
}

.region-map-marker:hover .region-map-region-shape,
.region-map-marker:focus .region-map-region-shape {
  fill: rgba(var(--region-accent-rgb), 0.06);
  stroke: transparent;
  filter: none;
}

.region-map-marker:hover .region-map-region-aura,
.region-map-marker:focus .region-map-region-aura {
  fill: rgba(var(--region-accent-rgb), 0.035);
  stroke: transparent;
  opacity: 0.32;
}

.region-map-marker.active .region-map-region-shape {
  fill: rgba(var(--region-accent-rgb), 0.11);
  stroke: var(--region-accent);
  stroke-width: 0.72;
  filter:
    drop-shadow(0 0 3px rgba(var(--region-accent-rgb), 0.95))
    drop-shadow(0 0 9px rgba(var(--region-accent-rgb), 0.5));
}

.region-map-marker.active .region-map-region-aura {
  fill: rgba(var(--region-accent-rgb), 0.05);
  opacity: 0.54;
  stroke-width: 1.25;
  animation: region-selection-breathe 2.8s ease-in-out infinite;
}

.region-map-marker-hit {
  fill: rgba(126, 231, 255, 0.001);
  stroke: none;
}

.region-map-marker-dot {
  display: none;
}

.region-map-marker-label {
  fill: rgba(223, 244, 248, 0.86);
  stroke: rgba(5, 8, 9, 0.96);
  stroke-width: 0.58px;
  paint-order: stroke;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 2.2px;
  font-weight: 650;
  letter-spacing: 0.015em;
  opacity: 0.62;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.region-map-marker:hover .region-map-marker-dot,
.region-map-marker:focus .region-map-marker-dot,
.region-map-marker.active .region-map-marker-dot {
  display: none;
}

.region-map-marker.active .region-map-marker-label {
  fill: var(--region-accent);
  font-size: 2.45px;
  font-weight: 740;
  opacity: 1;
}

@keyframes region-selection-breathe {
  0%, 100% { opacity: 0.54; filter: blur(0.8px) drop-shadow(0 0 3px rgba(var(--region-accent-rgb), 0.42)); }
  50% { opacity: 0.92; filter: blur(1px) drop-shadow(0 0 8px rgba(var(--region-accent-rgb), 0.82)); }
}

.region-map-marker:hover .region-map-marker-label,
.region-map-marker:focus .region-map-marker-label {
  opacity: 1;
}

.region-prior-status {
  margin: 0;
  color: rgba(188, 222, 228, 0.5);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 590;
  letter-spacing: 0.025em;
  line-height: 1.3;
  text-transform: uppercase;
}

.recording-settings-panel[hidden] {
  display: none !important;
}

.recording-settings-panel[hidden] * {
  display: none !important;
}

.recording-settings-dock > .recording-settings-panel {
  position: absolute;
  right: auto;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
}

.recording-settings-overlay {
  position: absolute;
  top: max(62px, calc(max(16px, env(safe-area-inset-top)) + 48px));
  right: max(16px, env(safe-area-inset-right));
  z-index: 70;
}

.field-pair-toggle {
  position: absolute;
  z-index: 66;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: none;
  min-height: 40px;
  min-width: 64px;
  border: 1px solid rgba(126, 231, 255, 0.28);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(10, 22, 24, 0.68);
  color: rgba(230, 251, 255, 0.94);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.sound-galaxy-app[data-view="field"] .field-pair-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.field-pair-toggle.is-active {
  border-color: rgba(126, 231, 255, 0.62);
  background: rgba(29, 84, 91, 0.72);
  color: #ffffff;
}

.sound-galaxy-app:not([data-view="field"]) .field-pair-panel {
  display: none !important;
}

.field-pair-panel {
  position: absolute;
  z-index: 76;
  top: calc(max(16px, env(safe-area-inset-top)) + 52px);
  left: max(16px, env(safe-area-inset-left));
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(6, 12, 13, 0.86);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(20px);
  color: #ffffff;
}

.field-pair-panel[hidden],
.field-pair-panel[hidden] * {
  display: none !important;
}

.field-pair-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.field-pair-panel header div {
  display: grid;
  gap: 3px;
}

.field-pair-panel header span {
  color: rgba(126, 231, 255, 0.82);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-pair-panel header strong {
  font-size: 15px;
  line-height: 1.2;
}

.field-pair-panel header button,
.field-pair-actions button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.field-pair-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.38;
}

.field-capture-status {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(126, 231, 255, 0.14);
  border-radius: 12px;
  background: rgba(126, 231, 255, 0.07);
  color: rgba(232, 252, 255, 0.82);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.34;
}

.field-capture-status strong {
  color: #ffffff;
  font-size: 12px;
  font-weight: 880;
}

.field-capture-status span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 680;
}

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

.field-pair-actions button {
  padding: 0 8px;
}

.field-pair-actions button:first-child {
  border-color: rgba(126, 231, 255, 0.36);
  background: rgba(126, 231, 255, 0.14);
}

.field-pair-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(126, 231, 255, 0.92);
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
}

.field-pair-peer-list {
  display: grid;
  gap: 6px;
}

.field-pair-peer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.field-pair-peer span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
}

.recording-settings-warning {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 760;
}

.analysis-tool-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(2, 6, 7, 0.34);
}

.analysis-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analysis-tool-header span {
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.analysis-export-button {
  min-height: 30px;
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(126, 231, 255, 0.08);
  color: rgba(221, 250, 255, 0.92);
  cursor: pointer;
  font-size: 10px;
  font-weight: 820;
}

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

.analysis-module-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.analysis-module-card strong,
.analysis-module-card span,
.analysis-module-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-module-card strong {
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 840;
}

.analysis-module-card span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  line-height: 1.3;
}

.analysis-module-card small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
  font-weight: 820;
}

.analysis-timeline-mini {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  overflow: hidden;
  border-radius: 999px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.05);
}

.analysis-timeline-event {
  height: 18px;
  min-width: 5px;
  border-radius: 999px;
  opacity: 0.9;
}

.sound-galaxy-app[data-phase="recording"] .record-launch,
.sound-galaxy-app[data-phase="review"] .record-launch,
.sound-galaxy-app[data-phase="analyzing"] .record-launch,
.sound-galaxy-app[data-phase="result"] .record-launch {
  display: none;
}

.sound-galaxy-app[data-phase="recording"] .record-launch *,
.sound-galaxy-app[data-phase="review"] .record-launch *,
.sound-galaxy-app[data-phase="analyzing"] .record-launch *,
.sound-galaxy-app[data-phase="result"] .record-launch * {
  display: none !important;
}

.sound-galaxy-app[data-phase="recording"] .recording-space,
.sound-galaxy-app[data-phase="review"] .review-space,
.sound-galaxy-app[data-phase="analyzing"] .analysis-space,
.sound-galaxy-app[data-phase="result"] .result-space {
  display: block;
}

/* Any saved-result deep link starts in the analysis shell before the recorder
   bundle runs, preventing the default Record page from flashing on iOS. */
.result-viewer-boot .sound-galaxy-app .record-launch,
.result-viewer-boot .sound-galaxy-app .recording-space,
.result-viewer-boot .sound-galaxy-app .review-space,
.result-viewer-boot .sound-galaxy-app .result-space {
  display: none !important;
}

.result-viewer-boot .sound-galaxy-app .analysis-space {
  display: block !important;
}

.sound-galaxy-app[data-phase="recording"] {
  background: #05080a;
}

.view-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #070b0c;
  opacity: 0;
  pointer-events: none;
  cursor: grab;
  touch-action: none;
  transition: opacity 160ms ease;
}

.view-canvas.active {
  opacity: 1;
  pointer-events: auto;
}

.view-canvas.active.is-dragging {
  cursor: grabbing;
}

.recording-hud {
  position: absolute;
  z-index: 60;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: end;
  gap: 10px;
}

.recording-duration {
  display: grid;
  max-width: min(260px, calc(100vw - 118px));
  gap: 7px;
}

#recordingTimer,
.analysis-status,
.view-switcher,
.recording-view-bar,
.live-detection-visual {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 16, 17, 0.56);
  backdrop-filter: blur(16px);
}

#recordingTimer {
  display: inline-flex;
  min-width: 78px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.recording-duration-notice {
  margin: 0;
  border: 1px solid rgba(255, 214, 10, 0.35);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(34, 28, 3, 0.9);
  color: #fff2a8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.3;
}

.recording-duration-notice[data-level="urgent"],
.recording-duration-notice[data-level="limit"] {
  border-color: rgba(255, 69, 58, 0.5);
  background: rgba(54, 10, 8, 0.92);
  color: #ffd2cf;
}

.recording-duration-notice[hidden] {
  display: none;
}

.stop-button,
.secondary-button,
.record-again-button,
#generateAnimalButton,
#generateButton {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 780;
}

.stop-button {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #15191a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.analysis-status {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: min(520px, calc(100vw - 32px));
  min-height: 42px;
  transform: translateX(-50%);
  display: none;
  border-radius: 999px;
  padding: 11px 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 720;
}

.analysis-status.is-active {
  display: block;
}

.analysis-status.is-live-detection {
  border-color: rgba(126, 215, 255, 0.22);
  background: rgba(4, 8, 9, 0.66);
  color: rgba(222, 249, 255, 0.86);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26);
}

.live-detection-dock {
  position: absolute;
  z-index: 62;
  right: max(16px, env(safe-area-inset-right));
  top: calc(max(16px, env(safe-area-inset-top)) + 126px);
  bottom: auto;
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 8, 9, 0.58);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.recording-view-bar {
  position: absolute;
  z-index: 72;
  top: auto;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px);
  left: max(16px, env(safe-area-inset-left));
  display: inline-flex;
  max-width: calc(100vw - 32px);
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  transform: none;
}

.recording-view-bar button {
  min-width: 58px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.recording-view-bar button.active {
  background: #ffffff;
  color: #101617;
}

.spectrogram-dimension-selector {
  position: absolute;
  z-index: 74;
  top: calc(max(16px, env(safe-area-inset-top)) + 62px);
  right: max(16px, env(safe-area-inset-right));
  display: none;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(3, 8, 9, 0.72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.sound-galaxy-app[data-phase="recording"][data-view="spectrogram"] .spectrogram-dimension-selector--live,
.sound-galaxy-app[data-phase="recording"][data-view="spectrogram3d"] .spectrogram-dimension-selector--live,
.sound-galaxy-app[data-phase="result"][data-result-view="spectrogram"] .spectrogram-dimension-selector--result,
.sound-galaxy-app[data-phase="result"][data-result-view="spectrogram3d"] .spectrogram-dimension-selector--result {
  display: flex;
}

.galaxy-style-selector {
  position: absolute;
  z-index: 74;
  top: calc(max(16px, env(safe-area-inset-top)) + 62px);
  right: max(16px, env(safe-area-inset-right));
  display: none;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 12, 13, 0.76);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.waveform-style-selector {
  position: absolute;
  z-index: 74;
  top: calc(max(16px, env(safe-area-inset-top)) + 62px);
  right: max(16px, env(safe-area-inset-right));
  display: none;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(126, 231, 255, 0.22);
  border-radius: 999px;
  background: rgba(5, 11, 15, 0.78);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.sound-galaxy-app[data-phase="recording"][data-view="waveform"] .waveform-style-selector--live,
.sound-galaxy-app[data-phase="result"][data-result-view="waveform"] .waveform-style-selector--result {
  display: flex;
}

.waveform-style-selector button {
  min-width: 52px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.waveform-style-selector button.active {
  background: rgba(126, 231, 255, 0.94);
  color: #071014;
}

.waveform-style-selector--result {
  top: max(154px, calc(env(safe-area-inset-top) + 140px));
}

.sound-galaxy-app[data-phase="recording"][data-view="galaxy"] .galaxy-style-selector--live,
.sound-galaxy-app[data-phase="result"][data-result-view="recording"] .galaxy-style-selector--result {
  display: flex;
}

.galaxy-style-selector button {
  min-width: 48px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.galaxy-style-selector button.active {
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
}

.galaxy-style-selector--result {
  /* Saved-result headers include Back, Play, and a timeline. Keep the Galaxy
     choice below that shared header instead of covering its Play control. */
  top: max(154px, calc(env(safe-area-inset-top) + 140px));
}

.spectrogram-dimension-selector button {
  min-width: 44px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 850;
  touch-action: manipulation;
}

.spectrogram-dimension-selector button.active {
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
}

.spectrogram-dimension-selector--result {
  top: max(154px, calc(env(safe-area-inset-top) + 140px));
}

.live-detection-visual {
  position: absolute;
  z-index: 57;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  width: min(356px, calc(100vw - 32px));
  min-height: 96px;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  overflow: hidden;
  border-color: rgba(126, 215, 255, 0.2);
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 18%, var(--live-detection-color, rgba(126, 215, 255, 0.2)), transparent 28%),
    rgba(4, 8, 9, 0.68);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.36);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.live-detection-visual.is-interactive {
  cursor: pointer;
  touch-action: manipulation;
}

.live-detection-visual.is-interactive:hover {
  border-color: rgba(126, 231, 255, 0.56);
  transform: translateY(-1px);
}

.live-detection-visual.is-interactive:focus-visible {
  outline: 2px solid rgba(126, 231, 255, 0.94);
  outline-offset: 3px;
}

.live-detection-visual-image {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 2px solid var(--live-detection-color, rgba(126, 215, 255, 0.72));
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.live-detection-visual-image[hidden] {
  display: none;
}

.live-detection-visual:has(.live-detection-visual-image[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.live-detection-visual-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.live-detection-visual-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.live-detection-visual-copy span,
.live-detection-visual-copy strong,
.live-detection-visual-copy em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-detection-visual-copy span {
  color: rgba(126, 215, 255, 0.88);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.live-detection-visual-copy strong {
  color: rgba(255, 255, 255, 0.96);
  font-size: 15px;
  font-weight: 900;
}

.live-detection-visual-copy em {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.live-detection-dock[hidden],
.live-detection-panel[hidden] {
  display: none;
}

.live-detection-dock-header,
.live-detection-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-detection-dock-header span,
.live-detection-panel-header span {
  color: rgba(126, 215, 255, 0.86);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.live-detection-dock-header strong,
.live-detection-panel-header strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-detection-dock-header button,
.live-detection-panel-header button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}

.live-detection-card-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 2px 2px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
}

.live-detection-card-row::-webkit-scrollbar {
  display: none;
}

.live-detection-card {
  position: relative;
  display: grid;
  flex: 0 0 min(300px, calc(100vw - 54px));
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "thumb title"
    "thumb meta"
    "thumb desc";
  align-items: center;
  min-height: 66px;
  gap: 5px 9px;
  padding: 6px 8px 6px 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  appearance: none;
  scroll-snap-align: start;
  text-align: left;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.live-detection-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--live-detection-color, #63b5ff);
}

.live-detection-thumb,
.sentry-detection-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 42% 32%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(145deg, rgba(126, 215, 255, 0.22), rgba(255, 56, 92, 0.14));
  color: #ffffff;
}

.live-detection-thumb {
  grid-area: thumb;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid var(--live-detection-color, rgba(126, 215, 255, 0.72));
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 22px rgba(0, 0, 0, 0.28);
  font-size: 20px;
  font-weight: 920;
  cursor: zoom-in;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.live-detection-thumb:disabled {
  cursor: default;
}

.live-detection-thumb:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.live-detection-thumb img,
.sentry-detection-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(1.04);
}

.live-detection-card strong,
.live-detection-card span,
.live-detection-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-detection-card strong {
  grid-area: title;
  font-size: 13px;
  font-weight: 880;
}

.live-detection-card span {
  display: block;
  grid-area: meta;
  color: rgba(222, 249, 255, 0.86);
  font-size: 11px;
  font-weight: 740;
}

.live-detection-card small {
  grid-area: desc;
  justify-self: start;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
}

.live-detection-card--empty {
  flex-basis: min(320px, calc(100vw - 54px));
  min-height: 62px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.live-detection-panel {
  position: absolute;
  z-index: 66;
  top: calc(max(16px, env(safe-area-inset-top)) + 126px);
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  width: min(380px, calc(100vw - 32px));
  max-height: min(460px, calc(100dvh - 164px));
  gap: 10px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 10, 11, 0.86);
  box-shadow: 0 26px 76px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
}

.live-detection-panel-header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.live-detection-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.live-detection-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 160ms ease;
}

.live-detection-focus-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-areas:
    "image copy"
    "actions actions";
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left-color: var(--live-detection-color, rgba(126, 215, 255, 0.62));
  border-radius: 8px;
  padding: 9px;
  background:
    radial-gradient(circle at 12% 18%, var(--live-detection-color, rgba(126, 215, 255, 0.18)), transparent 26%),
    rgba(255, 255, 255, 0.065);
}

.live-detection-focus-image {
  grid-area: image;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  overflow: hidden;
  border: 2px solid var(--live-detection-color, rgba(126, 215, 255, 0.72));
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 32%, rgba(255, 255, 255, 0.22), transparent 26%),
    linear-gradient(145deg, rgba(126, 215, 255, 0.2), rgba(255, 56, 92, 0.16));
  color: rgba(255, 255, 255, 0.94);
  font-size: 28px;
  font-weight: 920;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.live-detection-focus-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.live-detection-focus-copy {
  grid-area: copy;
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: center;
}

.live-detection-focus-copy span,
.live-detection-focus-copy em,
.live-detection-focus-copy small,
.live-detection-focus-copy p,
.live-detection-focus-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-detection-focus-copy span {
  color: rgba(126, 215, 255, 0.82);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.live-detection-focus-copy strong {
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 880;
  white-space: nowrap;
}

.live-detection-focus-copy em,
.live-detection-focus-copy small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.live-detection-focus-copy p {
  display: -webkit-box;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.live-detection-focus-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 7px;
}

.live-detection-focus-actions button {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-detection-focus-actions button + button {
  border: 1px solid rgba(126, 215, 255, 0.36);
  background: rgba(126, 215, 255, 0.14);
  color: #dffaff;
}

.live-detection-panel-meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.live-detection-history {
  display: grid;
  max-height: 260px;
  gap: 6px;
  overflow: auto;
}

.live-detection-history-row,
.live-detection-history-empty {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-left-color: var(--live-detection-color, rgba(255, 255, 255, 0.25));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
}

.live-detection-history-row strong,
.live-detection-history-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-detection-history-row strong {
  font-size: 12px;
  font-weight: 820;
}

.live-detection-history-row span,
.live-detection-history-empty {
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
}

@media (width <= 760px) {
  .live-detection-dock {
    top: calc(max(8px, env(safe-area-inset-top)) + 104px);
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    display: block;
    padding: 6px 7px;
    border-radius: 999px;
    background: rgba(4, 8, 9, 0.7);
  }

  .live-detection-dock-header {
    gap: 8px;
  }

  .live-detection-dock-header span {
    display: none;
  }

  .live-detection-dock-header strong {
    font-size: 12px;
  }

  .live-detection-dock-header button {
    min-height: 28px;
    border-radius: 999px;
  }

  .live-detection-card-row {
    display: none;
  }

  .live-detection-card {
    flex-basis: min(286px, calc(100vw - 42px));
  }

  .live-detection-focus-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .live-detection-focus-image {
    width: 60px;
    height: 60px;
  }

  .live-detection-panel {
    top: calc(max(8px, env(safe-area-inset-top)) + 146px);
    left: 8px;
    right: 8px;
    bottom: auto;
    width: auto;
    max-height: min(390px, calc(100dvh - max(8px, env(safe-area-inset-top)) - 126px));
  }
}

.sound-galaxy-app[data-view="field"] .live-detection-dock {
  top: calc(max(16px, env(safe-area-inset-top)) + 126px);
  bottom: auto;
}

.sound-galaxy-app[data-view="field"] .live-detection-panel {
  top: max(16px, env(safe-area-inset-top));
}

.waterfall-hover-tooltip {
  position: fixed;
  z-index: 14;
  display: grid;
  gap: 4px;
  min-width: 180px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(8, 12, 13, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.waterfall-hover-tooltip strong {
  font-size: 12px;
  font-weight: 860;
}

.waterfall-hover-tooltip span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.35;
}

/* The live recorder is intentionally a four-instrument strip. */
.recording-view-bar [data-view-button="galaxy"],
.view-switcher [data-view-button="galaxy"] { order: 1; }
.recording-view-bar [data-view-button="orbit"],
.view-switcher [data-view-button="orbit"] { order: 2; }
.recording-view-bar [data-view-button="waveform"],
.view-switcher [data-view-button="waveform"] { order: 3; }
.recording-view-bar [data-view-button="spectrogram"],
.view-switcher [data-view-button="spectrogram"] { order: 4; }

.view-switcher {
  position: absolute;
  z-index: 60;
  left: auto;
  right: calc(max(16px, env(safe-area-inset-right)) + 170px);
  top: max(16px, env(safe-area-inset-top));
  bottom: auto;
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
}

.view-switcher button {
  min-width: 62px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.view-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.view-label {
  white-space: nowrap;
}

.view-switcher button.active {
  background: #ffffff;
  color: #111617;
}

.sound-galaxy-app[data-phase="recording"] .view-switcher {
  display: none;
}

.recording-hud,
.recording-hud *,
.view-switcher,
.view-switcher *,
.recording-view-bar,
.recording-view-bar *,
.live-detection-visual,
.live-detection-visual *,
.live-detection-dock,
.live-detection-dock *,
.live-detection-panel,
.live-detection-panel *,
.recording-settings-inline-toggle,
.recording-settings-inline-toggle *,
.galaxy-style-selector,
.galaxy-style-selector *,
.waveform-style-selector,
.waveform-style-selector *,
.recording-settings-overlay,
.recording-settings-overlay *,
.review-actions,
.review-actions *,
.result-view-switcher,
.result-view-switcher *,
.result-overlay > *,
.record-button,
.sentry-button,
.recording-upload-button,
.app-nav,
.app-nav * {
  pointer-events: auto;
}

.recording-hud,
.view-switcher,
.recording-view-bar,
.live-detection-visual,
.live-detection-dock,
.live-detection-panel,
.recording-settings-inline-toggle,
.galaxy-style-selector button,
.waveform-style-selector button,
.review-actions button,
.result-view-switcher button,
.result-overlay button,
.record-button,
.sentry-button,
.recording-upload-button,
.app-nav a,
.app-nav button {
  touch-action: manipulation;
}

.recording-hud,
.view-switcher,
.recording-view-bar,
.live-detection-visual,
.live-detection-dock,
.live-detection-panel,
.recording-settings-inline-toggle,
.galaxy-style-selector,
.waveform-style-selector,
.recording-settings-overlay,
.review-actions,
.result-view-switcher,
.result-overlay {
  isolation: isolate;
  transform: translateZ(0);
}

.analysis-space {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #070b0c;
  color: #ffffff;
}

.analysis-pipeline-strip {
  position: absolute;
  z-index: 3;
  top: max(58px, calc(env(safe-area-inset-top) + 16px));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  width: min(680px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 8px 12px;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 13, 0.58);
  backdrop-filter: blur(18px);
}

.analysis-pipeline-strip[hidden],
.analysis-step-feed[hidden] {
  display: none !important;
}

#analysisPipelineStatus {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 720;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#analysisPipelineProgress {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.63);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sound-galaxy-app[data-phase="analyzing"] .analysis-space {
  display: block;
}

.logo-wave-spinner {
  --spinner-bar: 7px;
  --spinner-gap: 4px;
  --spinner-height: 68px;
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--spinner-bar);
  align-items: center;
  gap: var(--spinner-gap);
  min-height: var(--spinner-height);
  color: rgba(255, 251, 241, 0.96);
}

.logo-wave-spinner span {
  width: var(--spinner-bar);
  height: var(--bar-height, 24px);
  border-radius: 999px;
  background: var(--bar-color, linear-gradient(180deg, rgba(255, 251, 241, 0.98) 0 58%, rgba(126, 215, 255, 0.94) 100%));
  box-shadow:
    0 0 16px rgba(126, 215, 255, 0.18),
    0 0 1px rgba(255, 255, 255, 0.86);
  transform-origin: center;
  animation: logoWavePulse 1.08s ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

.logo-wave-spinner span:nth-child(1) {
  --bar-height: 13px;
  --bar-color: linear-gradient(180deg, #7cff57, #35d95f);
  --delay: -700ms;
}

.logo-wave-spinner span:nth-child(2) {
  --bar-height: 20px;
  --bar-color: linear-gradient(180deg, #9bff4f, #4fe063);
  --delay: -650ms;
}

.logo-wave-spinner span:nth-child(3) {
  --bar-height: 31px;
  --bar-color: linear-gradient(180deg, #bdff49, #72e35e);
  --delay: -600ms;
}

.logo-wave-spinner span:nth-child(4) {
  --bar-height: 45px;
  --bar-color: linear-gradient(180deg, #d8ff49, #a5df55);
  --delay: -550ms;
}

.logo-wave-spinner span:nth-child(5) {
  --bar-height: 58px;
  --bar-color: linear-gradient(180deg, #f0ff52, #d5d64b);
  --delay: -500ms;
}

.logo-wave-spinner span:nth-child(6) {
  --bar-height: 68px;
  --bar-color: linear-gradient(180deg, #fff15d, #edbd48);
  --delay: -450ms;
}

.logo-wave-spinner span:nth-child(7) {
  --bar-height: 62px;
  --bar-color: linear-gradient(180deg, #ffe25a, #f4a944);
  --delay: -400ms;
}

.logo-wave-spinner span:nth-child(8) {
  --bar-height: 56px;
  --bar-color: linear-gradient(180deg, #ffd159, #f49a40);
  --delay: -350ms;
}

.logo-wave-spinner span:nth-child(9) {
  --bar-height: 51px;
  --bar-color: linear-gradient(180deg, #ffc058, #ef8d3c);
  --delay: -300ms;
}

.logo-wave-spinner span:nth-child(10) {
  --bar-height: 43px;
  --bar-color: linear-gradient(180deg, #ffb25a, #e77e38);
  --delay: -250ms;
}

.logo-wave-spinner span:nth-child(11) {
  --bar-height: 35px;
  --bar-color: linear-gradient(180deg, #ffa557, #df7135);
  --delay: -200ms;
}

.logo-wave-spinner span:nth-child(12) {
  --bar-height: 28px;
  --bar-color: linear-gradient(180deg, #ff9854, #d76432);
  --delay: -150ms;
}

.logo-wave-spinner span:nth-child(13) {
  --bar-height: 22px;
  --bar-color: linear-gradient(180deg, #ff8c50, #ce5b31);
  --delay: -100ms;
}

.logo-wave-spinner span:nth-child(14) {
  --bar-height: 17px;
  --bar-color: linear-gradient(180deg, #ff804d, #c8522f);
  --delay: -50ms;
}

.logo-wave-spinner span:nth-child(15) {
  --bar-height: 12px;
  --bar-color: linear-gradient(180deg, #ff774b, #c34d2e);
  --delay: 0ms;
}

#analysisGalaxyCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(6, 12, 14, 0.92), rgba(3, 7, 8, 1)),
    #070b0c;
}

.analysis-overlay {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  align-items: end;
  padding:
    0
    max(14px, env(safe-area-inset-right))
    max(18px, calc(env(safe-area-inset-bottom) + 12px))
    max(14px, env(safe-area-inset-left));
  pointer-events: none;
}

.analysis-card {
  display: grid;
  gap: 8px;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 16px;
  max-height: min(31svh, 248px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(18, 30, 32, 0.86), rgba(5, 10, 11, 0.78));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.analysis-recovery-actions {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.analysis-recovery-button {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 780;
  cursor: pointer;
}

.analysis-recovery-button--secondary {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.analysis-recovery-button--primary {
  border: 1px solid rgba(255, 108, 101, 0.72);
  background: #ff453a;
  color: #ffffff;
}

.analysis-recovery-button--upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(126, 215, 255, 0.72);
  background: linear-gradient(135deg, #1597cf, #6e5ce6);
  color: #ffffff;
  text-decoration: none;
}

.analysis-recovery-button--signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-decoration: none;
}

.analysis-recovery-button:focus-visible {
  outline: 3px solid rgba(126, 215, 255, 0.82);
  outline-offset: 2px;
}

.analysis-recovery-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.sound-galaxy-app[data-analysis="error"] .analysis-card {
  max-height: min(46svh, 390px);
  overflow: auto;
  border-color: rgba(255, 69, 58, 0.42);
  pointer-events: auto;
}

.sound-galaxy-app[data-analysis-access="upgrade"] .analysis-card {
  gap: 7px;
  max-height: min(38svh, 320px);
  border-color: rgba(126, 215, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(15, 34, 38, 0.94), rgba(5, 13, 15, 0.9));
}

.sound-galaxy-app[data-analysis-access="upgrade"] .analysis-kicker {
  color: #8fdbff;
}

.sound-galaxy-app[data-analysis-access="upgrade"] #loadingStatus {
  font-size: clamp(21px, 5.6vw, 27px);
  line-height: 1.06;
}

.sound-galaxy-app[data-analysis-access="upgrade"] .loading-progress {
  color: rgba(255, 255, 255, 0.78);
}

.sound-galaxy-app[data-analysis="error"] .analysis-recovery-actions {
  display: grid;
}

.sound-galaxy-app[data-analysis="error"] .analysis-rail {
  display: none;
}

.sound-galaxy-app[data-analysis="error"] .analysis-pipeline-strip {
  border-color: rgba(255, 69, 58, 0.32);
  background: rgba(45, 10, 8, 0.7);
}

.analysis-kicker {
  color: rgba(126, 215, 255, 0.82);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 920;
  letter-spacing: 0.12em;
}

#loadingStatus {
  margin: 0;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(18px, 4.6vw, 24px);
  line-height: 1.08;
  font-weight: 860;
}

#loadingProgress {
  margin: 0;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.28;
  min-height: 16px;
}

.analysis-rail {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.analysis-rail span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(126, 215, 255, 0.05), rgba(126, 215, 255, 0.9), rgba(255, 88, 116, 0.75));
  box-shadow: 0 0 24px rgba(126, 215, 255, 0.38);
  animation: analysisRail 1.7s ease-in-out infinite;
}

.analysis-candidates {
  margin: 0;
  max-width: 100%;
  min-height: 18px;
  overflow: hidden;
  color: rgba(126, 215, 255, 0.9);
  font-size: 11px;
  font-weight: 840;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-step-feed {
  display: grid;
  gap: 6px;
  max-height: 82px;
  overflow-y: auto;
  padding-right: 2px;
  margin-top: 2px;
}

.analysis-step-feed::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.analysis-step-item {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(6, 11, 12, 0.44);
  backdrop-filter: blur(12px);
}

.analysis-step-item--current {
  border-color: rgba(126, 215, 255, 0.44);
  background: rgba(16, 34, 39, 0.46);
}

.analysis-step-time {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  font-weight: 800;
  text-transform: uppercase;
}

.analysis-step-text {
  color: rgba(226, 233, 235, 0.9);
  font-size: 11px;
  line-height: 1.28;
  font-weight: 760;
  text-wrap: balance;
  word-break: break-word;
}

@keyframes loadingBeat {
  0%,
  100% {
    transform: translateY(0) scale(0.82);
    opacity: 0.45;
  }

  45% {
    transform: translateY(-4px) scale(1.18);
    opacity: 1;
  }
}

@keyframes logoWavePulse {
  0%,
  100% {
    transform: scaleY(0.72);
    opacity: 0.58;
  }

  45% {
    transform: scaleY(1.12);
    opacity: 1;
  }

  70% {
    transform: scaleY(0.92);
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-wave-spinner span {
    animation: none;
    opacity: 0.88;
    transform: none;
  }
}

@keyframes analysisRail {
  0% {
    transform: translateX(-110%);
  }

  55% {
    transform: translateX(95%);
  }

  100% {
    transform: translateX(180%);
  }
}

.review-space {
  padding:
    max(10px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 12%, rgba(126, 215, 255, 0.16), transparent 26%),
    radial-gradient(circle at 78% 72%, rgba(255, 56, 92, 0.18), transparent 28%),
    #050708;
  color: #ffffff;
}

.sound-galaxy-app[data-phase="review"] .review-space {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 7px;
}

.review-header {
  display: grid;
  gap: 2px;
  padding-right: 86px;
}

.review-library-back {
  width: fit-content;
  margin-bottom: 6px;
  color: rgba(126, 215, 255, 0.92);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.review-library-back::before {
  content: "‹";
  margin-right: 5px;
  font-size: 18px;
  line-height: 0;
  vertical-align: -1px;
}

.review-saved-meta {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.review-header span {
  color: rgba(126, 215, 255, 0.78);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 860;
}

.review-header h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
  line-height: 0.95;
}

.sound-galaxy-app[data-review-origin="library"] .review-header h1 {
  font-family: inherit;
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 760;
  line-height: 1.05;
}

.review-visuals {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 0.46fr) minmax(0, 0.54fr);
  gap: 9px;
}

.review-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}

.review-panel-clip {
  grid-template-rows: auto minmax(0, 1fr);
}

.review-panel-spectrogram {
  grid-template-rows: auto minmax(0, 1fr);
}

.review-panel figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.review-panel figcaption span {
  color: rgba(126, 215, 255, 0.82);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.review-panel figcaption strong {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
}

#reviewWaveformCanvas,
#reviewSpectrogramCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(4, 8, 9, 0.86);
  touch-action: none;
}

.review-trim-controls {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.review-trim-controls label {
  display: grid;
  gap: 5px;
  color: rgba(255, 255, 255, 0.66);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 850;
}

.review-trim-controls input[type="range"] {
  width: 100%;
  accent-color: var(--record);
}

.review-actions {
  display: flex;
  max-width: 720px;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 60;
}

.review-actions button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 860;
  font-size: 14px;
  white-space: nowrap;
}

.review-action-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.review-action-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.review-actions button[hidden],
.review-header [hidden] {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas,
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewSpectrogramCanvas {
  touch-action: pan-y;
}

.review-draft-status {
  min-height: 18px;
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.review-play-button {
  flex: 0 0 58px;
  width: 58px;
  padding: 0;
  background: rgba(126, 215, 255, 0.16);
  color: #ffffff;
}

.review-play-button .review-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.review-play-button .review-action-icon {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
}

#reviewRecordAgainButton,
#saveRecordingOnlyButton {
  flex: 0 1 178px;
  min-width: 136px;
}

#analyzeSelectionButton {
  flex: 0 1 210px;
  min-width: 150px;
}

.review-play-button.playing {
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
}

.review-play-button.playing .review-action-icon {
  background: rgba(5, 8, 9, 0.1);
}

@media (max-height: 700px) {
  .review-space {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sound-galaxy-app[data-phase="review"] .review-space {
    gap: 6px;
  }

  .review-header h1 {
    font-size: clamp(23px, 6.5vw, 32px);
  }

  .review-panel figcaption {
    min-height: 22px;
  }

  .review-actions button {
    min-height: 46px;
    font-size: 14px;
  }

  .review-visuals {
    grid-template-rows: minmax(120px, 0.7fr) minmax(160px, 1fr);
    gap: 7px;
  }

  .review-panel-clip {
    grid-template-rows: auto minmax(120px, min(22vh, 170px));
  }

  .review-panel-spectrogram {
    grid-template-rows: auto minmax(160px, min(30vh, 230px));
  }
}

@media (width <= 560px) {
  .review-space {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding:
      max(12px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      calc(max(18px, env(safe-area-inset-bottom)) + 18px)
      max(14px, env(safe-area-inset-left));
  }

  .sound-galaxy-app[data-phase="review"] .review-space {
    display: grid;
    grid-template-rows: auto auto auto auto;
    align-content: start;
    gap: 9px;
  }

  .review-header {
    padding-right: 0;
  }

  .review-header span {
    font-size: 11px;
  }

  .review-header h1 {
    font-size: clamp(28px, 9vw, 38px);
    line-height: 0.96;
  }

  .review-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    max-width: none;
    gap: 7px;
  }

  .review-actions button {
    min-height: 46px;
    padding: 0 10px;
    font-size: 14px;
    line-height: 1.05;
  }

  .review-action-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    font-size: 11px;
  }

  .review-play-button {
    width: 54px;
    min-width: 54px;
    padding: 0;
  }

  #saveRecordingOnlyButton {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  #reviewRecordAgainButton,
  #analyzeSelectionButton,
  #saveRecordingOnlyButton {
    min-width: 0;
  }

  .review-draft-status {
    min-height: 0;
    font-size: 11.5px;
    line-height: 1.25;
  }

  .review-visuals {
    gap: 9px;
    grid-template-rows: auto auto;
  }

  .review-panel {
    gap: 6px;
    grid-template-rows: auto auto;
  }

  .review-panel-clip {
    grid-template-rows: auto clamp(112px, 20vh, 146px);
  }

  .review-panel-spectrogram {
    grid-template-rows: auto clamp(156px, 30vh, 218px);
  }

  .review-panel figcaption {
    min-height: 22px;
  }

  .review-panel figcaption strong {
    padding: 4px 8px;
    font-size: 10.5px;
  }

  #reviewWaveformCanvas,
  #reviewSpectrogramCanvas {
    border-radius: 10px;
  }
}

#reviewRecordAgainButton {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
}

#analyzeSelectionButton {
  background: rgba(255, 255, 255, 0.94);
  color: #111617;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
}

#saveRecordingOnlyButton {
  background: rgba(126, 215, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

.result-space {
  overflow: hidden;
  background: #050708;
  color: #ffffff;
}

#resultGalaxyCanvas,
.result-analysis-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #050708;
  will-change: transform;
}

/* Result Galaxy uses the same direct-manipulation contract as Live Record.
   Without this, iOS treats a finger drag as a page gesture before the canvas
   receives pointer movement. */
#resultGalaxyCanvas {
  cursor: grab;
  touch-action: none;
}

#resultGalaxyCanvas.is-dragging {
  cursor: grabbing;
}

.result-analysis-canvas {
  display: block;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.result-analysis-canvas.active {
  opacity: 1;
  visibility: visible;
}

.sound-galaxy-app[data-result-view="waveform"] #resultGalaxyCanvas,
.sound-galaxy-app[data-result-view="waterfall"] #resultGalaxyCanvas,
.sound-galaxy-app[data-result-view="spectrogram"] #resultGalaxyCanvas,
.sound-galaxy-app[data-result-view="spectrogram3d"] #resultGalaxyCanvas {
  display: none;
}

/* Analysis can still be pending while the saved recording is fully viewable.
   Never replace or hide the user's selected view just because detections are
   still arriving. */
.sound-galaxy-app[data-detection-state="waiting"] .result-mode-panel,
.sound-galaxy-app[data-detection-state="waiting"] .result-overlay,
.sound-galaxy-app[data-detection-state="waiting"] .animal-result-panel,
.sound-galaxy-app[data-detection-state="waiting"] .contribution-result-panel,
.sound-galaxy-app[data-detection-state="waiting"] .sentry-detections-panel {
  display: none !important;
}

.sound-galaxy-app[data-detection-state="media"] .animal-result-panel,
.sound-galaxy-app[data-detection-state="media"] .contribution-result-panel,
.sound-galaxy-app[data-detection-state="media"] .sentry-detections-panel {
  display: none !important;
}

.result-detection-loading {
  position: absolute;
  z-index: 64;
  inset: 0;
  display: none;
  align-items: end;
  justify-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(76px, calc(env(safe-area-inset-bottom) + 64px))
    max(14px, env(safe-area-inset-left));
  pointer-events: none;
}

.sound-galaxy-app[data-detection-state="waiting"] .result-detection-loading {
  display: grid;
}

.result-detection-notice {
  display: grid;
  gap: 8px;
  width: min(440px, 100%);
  padding: 14px;
  border: 1px solid rgba(126, 215, 255, 0.2);
  border-radius: 12px;
  background:
    radial-gradient(circle at 16% 18%, rgba(126, 215, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(14, 23, 25, 0.9), rgba(5, 9, 10, 0.78));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(20px);
  pointer-events: auto;
}

.media-recognition-panel {
  position: absolute;
  z-index: 66;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 82px));
  display: grid;
  gap: 6px;
  width: min(440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(7, 10, 12, 0.88);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.media-recognition-panel[hidden] {
  display: none !important;
}

.media-recognition-panel span {
  color: rgba(126, 215, 255, 0.86);
  font-size: 10px;
  font-weight: 920;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.media-recognition-panel strong {
  font-size: 17px;
  line-height: 1.1;
}

.media-recognition-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1.35;
}

.result-detection-kicker {
  color: rgba(126, 215, 255, 0.82);
  font-size: 10px;
  font-weight: 920;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-detection-notice strong {
  color: rgba(255, 255, 255, 0.96);
  font-size: 22px;
  line-height: 1.1;
}

.result-detection-notice p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 680;
}

.result-detection-progress {
  --spinner-height: 46px;
  --spinner-bar: 4px;
  --spinner-gap: 4px;
  justify-self: start;
  margin-top: 4px;
}

.enable-notifications-button {
  justify-self: start;
  min-height: 38px;
  border: 1px solid rgba(126, 215, 255, 0.36);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(126, 215, 255, 0.15);
  color: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  font-size: 12px;
  font-weight: 860;
}

.enable-notifications-button:disabled {
  opacity: 0.7;
  cursor: default;
}

.detection-notification-status {
  min-height: 16px;
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.58) !important;
}

.result-view-switcher {
  position: absolute;
  z-index: 60;
  left: max(10px, env(safe-area-inset-left));
  top: max(58px, calc(env(safe-area-inset-top) + 44px));
  bottom: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: min(620px, calc(100vw - 20px));
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 12, 13, 0.62);
  backdrop-filter: blur(18px);
}

.result-view-switcher button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.result-view-switcher button.active,
.result-view-switcher button:hover {
  border-color: rgba(126, 231, 255, 0.72);
  background: rgba(126, 231, 255, 0.2);
  color: #ffffff;
}

.result-waveform-scrubber {
  position: absolute;
  z-index: 61;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 58px);
  left: max(20px, env(safe-area-inset-left));
  height: 38px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  padding: 0;
  background: rgba(5, 9, 10, 0.68);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  cursor: ew-resize;
  touch-action: none;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.result-waveform-scrubber canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.result-waveform-scrubber span {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(5, 9, 10, 0.66);
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.result-overlay {
  position: absolute;
  z-index: 55;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    max(10px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

.result-overlay > * {
  pointer-events: auto;
}

.result-top-overlay {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
}

.result-mode-panel {
  display: none;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 7px;
  width: fit-content;
  max-width: min(100%, 560px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.result-mode-button {
  position: relative;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 820;
  cursor: pointer;
}

.result-mode-button.active,
.result-mode-button:hover {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sound-galaxy-app[data-library-view="library"] .result-top-overlay {
  display: grid;
  grid-template-columns: max-content min-content;
  gap: 8px;
  align-items: center;
}

.sound-galaxy-app[data-library-view="library"] .result-mode-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: center;
  width: min(520px, calc(100% - 12px));
  padding: 4px;
  gap: 4px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(17, 20, 27, 0.72);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
}

.sound-galaxy-app[data-library-view="library"] .result-mode-button {
  min-width: 0;
  min-height: 34px;
  padding: 0 5px;
  border-color: transparent;
  font-size: 9.5px;
  line-height: 1.08;
  text-wrap: balance;
}

.sound-galaxy-app[data-library-view="library"] .result-mode-button.active {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.18);
}

.library-back-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  font-size: 12px;
  font-weight: 790;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sound-galaxy-app[data-library-view="library"] .result-top-overlay .library-back-button {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

.sound-galaxy-app[data-library-view="library"] .result-action-row,
.sound-galaxy-app[data-library-view="library"] .animal-result-panel,
.sound-galaxy-app[data-library-view="library"] .contribution-result-panel {
  display: none;
}

.result-play-button {
  position: relative;
  z-index: 4;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.24), transparent 36%),
    rgba(255, 255, 255, 0.92);
  color: #111617;
  box-shadow:
    0 12px 34px rgba(255, 255, 255, 0.2),
    0 0 0 10px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 11px;
  font-weight: 820;
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.result-play-button.playing {
  width: 36px;
  height: 36px;
  background: rgba(255, 56, 92, 0.9);
  color: #ffffff;
  box-shadow:
    0 12px 34px rgba(255, 56, 92, 0.36),
    0 0 0 10px rgba(255, 56, 92, 0.08);
}

.result-play-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.play-glyph {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 11px solid currentColor;
}

.result-play-button span:last-child {
  display: none;
}

.result-play-button.playing .play-glyph {
  width: 11px;
  height: 13px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(90deg, currentColor 0 36%, transparent 36% 64%, currentColor 64% 100%);
}

.record-again-button {
  min-width: 0;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111617;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sentry-detections-panel {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 78px);
  left: max(16px, env(safe-area-inset-left));
  z-index: 4;
  display: grid;
  gap: 9px;
  max-height: min(44svh, 360px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(18, 24, 24, 0.92), rgba(5, 7, 8, 0.84)),
    rgba(5, 7, 8, 0.82);
  color: #ffffff;
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.sentry-live-panel {
  top: auto;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 108px);
  left: max(14px, env(safe-area-inset-left));
  right: auto;
  z-index: 8;
  width: min(420px, calc(100vw - 28px));
  max-height: min(34svh, 252px);
}

.sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) {
  right: auto;
  width: min(420px, calc(100vw - 28px));
  max-height: min(34svh, 280px);
}

.sentry-detections-panel[hidden] {
  display: none;
}

.sentry-live-panel[hidden] {
  pointer-events: none;
}

.sentry-detections-panel header {
  display: grid;
  gap: 2px;
}

.sentry-panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sentry-live-header-row,
.sentry-result-header-row {
  align-items: center;
}

.sentry-live-header-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.sentry-panel-header-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sentry-live-title {
  gap: 1px;
}

.sentry-live-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sentry-live-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #62f5c8;
  box-shadow: 0 0 0 4px rgba(98, 245, 200, 0.12);
}

.sentry-live-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sentry-result-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.detection-sheet-toggle {
  min-height: 30px;
  border: 1px solid rgba(126, 215, 255, 0.38);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(126, 215, 255, 0.13);
  color: #d8f5ff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 880;
  line-height: 1;
  white-space: nowrap;
}

.sentry-config-button {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}

.detection-sheet-toggle:focus-visible,
.sentry-config-button:focus-visible {
  outline: 2px solid rgba(126, 215, 255, 0.9);
  outline-offset: 2px;
}

.sentry-live-control {
  min-height: 30px;
  min-width: 66px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sentry-live-control.is-paused {
  border-color: rgba(255, 56, 92, 0.7);
  background: rgba(255, 56, 92, 0.2);
}

.sentry-live-control:focus-visible {
  outline: 2px solid rgba(126, 215, 255, 0.9);
  outline-offset: 2px;
}

.sentry-live-config-summary,
.sentry-result-profile {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  line-height: 1.35;
  min-height: 12px;
  max-width: 42ch;
}

.sentry-detections-panel:not(.sentry-live-panel) .sentry-result-profile,
.sentry-detections-panel:not(.sentry-live-panel) .animal-detection-timeline,
.sentry-detections-panel:not(.sentry-live-panel) .sentry-config-button {
  display: none !important;
}

.sound-galaxy-app[data-detection-state="none"] .sentry-detections-panel:not(.sentry-live-panel) .sentry-result-profile {
  display: block !important;
}

.sound-galaxy-app[data-detection-state="none"] .sentry-detections-panel:not(.sentry-live-panel) {
  gap: 5px;
  max-height: 132px;
  padding: 10px 12px;
}

.sound-galaxy-app[data-detection-state="none"] .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-summary,
.sound-galaxy-app[data-detection-state="none"] .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-list,
.sound-galaxy-app[data-detection-state="none"] .sentry-detections-panel:not(.sentry-live-panel) .detection-sheet-toggle {
  display: none !important;
}

.sentry-console-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.sentry-console-metrics div {
  min-width: 0;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.075);
}

.sentry-console-metrics span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sentry-console-metrics strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.sentry-live-stream {
  overflow: auto;
  grid-template-columns: 1fr;
  max-height: 118px;
  padding-right: 2px;
  scrollbar-width: thin;
}

.sentry-console-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  line-height: 1.35;
}

.sentry-live-galaxy-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.sentry-live-band-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}

.sentry-live-band-fill {
  position: absolute;
  inset: 0 100% 0 0;
  border-radius: inherit;
  background: rgba(126, 215, 255, 0.82);
  transition: inset 140ms ease;
}

.sentry-detections-panel header span {
  color: rgba(126, 215, 255, 0.82);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.sentry-detections-panel header strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.animal-detection-timeline {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  border: 1px solid rgba(126, 215, 255, 0.18);
  border-radius: 8px;
  padding: 10px 8px 8px;
  background:
    linear-gradient(180deg, rgba(126, 215, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.18);
}

.animal-detection-timeline[hidden] {
  display: none;
}

.animal-detection-waveform-rail {
  position: absolute;
  right: 10px;
  bottom: 19px;
  left: 10px;
  display: grid;
  grid-template-columns: repeat(42, minmax(2px, 1fr));
  align-items: center;
  gap: 2px;
  height: 32px;
  pointer-events: none;
}

.animal-detection-waveform-rail i {
  display: block;
  height: var(--bar-height, 44%);
  border-radius: 999px;
  background: rgba(126, 215, 255, var(--bar-alpha, 0.34));
  box-shadow: 0 0 10px rgba(126, 215, 255, 0.16);
}

.animal-detection-marker-layer {
  position: relative;
  height: 92px;
}

.animal-detection-marker {
  position: absolute;
  top: 0;
  display: grid;
  width: min(96px, 30vw);
  min-width: 0;
  justify-items: center;
  gap: 2px;
  transform: translateX(-50%);
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.animal-detection-marker::after {
  content: "";
  width: 1px;
  height: 23px;
  margin-top: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(126, 215, 255, 0));
}

.animal-detection-marker:focus-visible {
  outline: 2px solid rgba(126, 215, 255, 0.82);
  outline-offset: 4px;
}

.animal-detection-marker-thumb {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 42% 30%, rgba(255, 255, 255, 0.18), transparent 26%),
    linear-gradient(145deg, rgba(126, 215, 255, 0.22), rgba(255, 56, 92, 0.14));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 900;
}

.animal-detection-marker--primary .animal-detection-marker-thumb {
  width: 52px;
  height: 52px;
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow:
    0 0 0 1px rgba(126, 215, 255, 0.18),
    0 14px 34px rgba(0, 0, 0, 0.4);
}

.animal-detection-marker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.94) contrast(1.05);
}

.animal-detection-marker-label,
.animal-detection-marker-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animal-detection-marker-label {
  font-size: 10.5px;
  font-weight: 880;
}

.animal-detection-marker-meta {
  color: rgba(126, 215, 255, 0.84);
  font-size: 9.5px;
  font-weight: 850;
}

.sentry-detection-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 2px 2px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.sentry-detections-panel .sentry-detection-list {
  display: flex !important;
}

.sentry-detection-list::-webkit-scrollbar {
  display: none;
}

.species-review-loading-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  min-height: 180px;
  align-items: center;
  border: 1px solid rgba(126, 215, 255, 0.18);
  border-radius: 12px;
  padding: 14px;
  background:
    radial-gradient(circle at 18% 24%, rgba(126, 215, 255, 0.22), transparent 34%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.034));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.species-review-loading-visual {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 999px;
  background: rgba(126, 215, 255, 0.08);
}

.species-review-loading-visual span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.95), rgba(126, 215, 255, 0.72) 34%, rgba(255, 56, 92, 0.58) 76%);
  box-shadow:
    0 0 0 0 rgba(126, 215, 255, 0.28),
    0 0 28px rgba(126, 215, 255, 0.26);
  animation: species-review-pulse 1.45s ease-in-out infinite;
}

.species-review-loading-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.species-review-loading-copy strong {
  font-size: 18px;
  line-height: 1.12;
}

.species-review-loading-copy span {
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 690;
  line-height: 1.35;
}

.species-review-loading-card ol {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.species-review-loading-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 780;
}

.species-review-loading-card li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(126, 215, 255, 0.88);
  box-shadow: 0 0 14px rgba(126, 215, 255, 0.42);
}

@keyframes species-review-pulse {
  0%,
  100% {
    transform: scale(0.86);
    opacity: 0.76;
    box-shadow:
      0 0 0 0 rgba(126, 215, 255, 0.24),
      0 0 22px rgba(126, 215, 255, 0.22);
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
    box-shadow:
      0 0 0 16px rgba(126, 215, 255, 0),
      0 0 38px rgba(126, 215, 255, 0.38);
  }
}

@keyframes detectionLoadingSweep {
  0% {
    transform: translateX(-42%);
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateX(210%);
    opacity: 0.45;
  }
}

.sentry-detection-card {
  display: grid;
  flex: 0 0 min(318px, calc(100vw - 54px));
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb title"
    "thumb evidence";
  align-items: center;
  gap: 5px 10px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 8px 6px 6px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  scroll-snap-align: start;
}

.sentry-detection-card--primary {
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas:
    "thumb title"
    "thumb evidence";
  background:
    radial-gradient(circle at 24% 28%, rgba(126, 215, 255, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.052));
}

.sentry-detection-card--primary .sentry-detection-thumb {
  grid-area: thumb;
}

.sentry-detection-card--primary > strong {
  grid-area: title;
  font-size: 16px;
}

.sentry-detection-card--primary > span {
  grid-area: meta;
}

.sentry-detection-card--primary .sentry-detection-scientific {
  grid-area: scientific;
}

.sentry-detection-card--primary .sentry-detection-evidence {
  grid-area: evidence;
}

.sentry-detection-card--primary .sentry-detection-actions {
  grid-area: actions;
}

.sentry-detection-thumb {
  width: 50px;
  height: 50px;
  border-radius: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.sentry-detection-thumb--fallback {
  border: 1px solid rgba(126, 215, 255, 0.22);
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.2), transparent 26%),
    linear-gradient(145deg, rgba(126, 215, 255, 0.26), rgba(38, 58, 64, 0.72));
  color: rgba(255, 255, 255, 0.92);
  font-family: Inter, sans-serif;
  font-size: 24px;
  font-weight: 920;
}

.sentry-detection-thumb--acoustic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgba(126, 215, 255, 0.24);
  background:
    radial-gradient(circle at 42% 30%, rgba(126, 215, 255, 0.18), transparent 48%),
    rgba(7, 15, 17, 0.9);
}

.sentry-detection-thumb--acoustic i,
.species-detail-acoustic-mark i {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a9ddff, #9c6ff2);
  box-shadow: 0 0 10px rgba(126, 215, 255, 0.3);
}

.sentry-detection-thumb--acoustic i:nth-child(1),
.sentry-detection-thumb--acoustic i:nth-child(5) {
  height: 14px;
}

.sentry-detection-thumb--acoustic i:nth-child(2),
.sentry-detection-thumb--acoustic i:nth-child(4) {
  height: 24px;
}

.sentry-detection-thumb--acoustic i:nth-child(3) {
  height: 34px;
}

.sentry-detection-card strong {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentry-detection-scientific {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-style: italic;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentry-detection-card span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 720;
}

.sentry-detection-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentry-detection-evidence {
  grid-area: evidence;
  justify-self: end;
  max-width: 100%;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentry-detection-card button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.sentry-detection-card button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-card--primary {
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas:
    "thumb title"
    "thumb evidence";
  gap: 8px 12px;
}

.sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-scientific,
.sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-meta,
.sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-actions {
  display: none;
}

.sentry-detection-card--live {
  flex: initial;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "thumb title"
    "thumb meta"
    "trail trail"
    "actions actions";
  align-items: center;
  gap: 5px 8px;
  padding: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.055);
  scroll-snap-align: none;
}

.sentry-live-prediction-card {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 7px 10px;
  padding: 10px;
}

.sentry-detection-card--live .sentry-detection-thumb {
  grid-area: thumb;
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 19px;
}

.sentry-detection-card--live > strong {
  grid-area: title;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.sentry-detection-card--live .sentry-detection-meta {
  grid-area: meta;
}

.sentry-detection-card--live > span {
  grid-area: trail;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentry-detection-card--live .sentry-detection-evidence {
  justify-self: stretch;
  text-align: left;
}

.sentry-detection-card--live .sentry-detection-actions {
  grid-area: actions;
}

.sentry-detection-card--live button {
  min-height: 28px;
}

.sentry-detection-actions,
.sentry-detection-card--live .sentry-detection-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.sentry-detection-card--live .sentry-detection-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sentry-action-button {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sentry-galaxy-focus-button {
  background: rgba(126, 215, 255, 0.16) !important;
  color: #d7fdff !important;
  border: 1px solid rgba(126, 215, 255, 0.44) !important;
}

.species-detail-panel {
  display: grid;
  gap: 12px;
  min-height: 0;
  border: 1px solid rgba(126, 215, 255, 0.22);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(12, 18, 18, 0.96), rgba(4, 7, 8, 0.94)),
    rgba(4, 7, 8, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.species-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  padding: 8px;
  background:
    radial-gradient(circle at 18% 22%, rgba(126, 215, 255, 0.14), transparent 42%),
    rgba(255, 255, 255, 0.055);
}

.species-detail-result-image {
  display: block;
  width: 100%;
  height: clamp(148px, 24svh, 240px);
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
}

.species-detail-gallery {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 42% 32%, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(145deg, rgba(126, 215, 255, 0.22), rgba(255, 56, 92, 0.14));
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  font-weight: 900;
}

.species-detail-gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.species-detail-gallery-track::-webkit-scrollbar {
  display: none;
}

.species-detail-gallery-slide.species-detail-image {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  margin: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.species-detail-gallery-dots {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 50%;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}

.species-detail-gallery-dots button {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.species-detail-gallery-dots button[aria-current="true"] {
  width: 18px;
  border-radius: 999px;
  background: #ffffff;
}

.species-detail-gallery-count {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.64);
  color: #ffffff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 850;
}

.species-detail-image {
  display: grid;
  aspect-ratio: 1.12;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 42% 32%, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(145deg, rgba(126, 215, 255, 0.22), rgba(255, 56, 92, 0.14));
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 900;
}

.species-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.species-detail-hero-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.species-detail-acoustic-mark {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(126, 215, 255, 0.2);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 42%, rgba(126, 215, 255, 0.18), transparent 48%),
    rgba(5, 11, 13, 0.86);
}

.species-detail-acoustic-mark i {
  width: 4px;
}

.species-detail-acoustic-mark i:nth-child(1),
.species-detail-acoustic-mark i:nth-child(7) {
  height: 20px;
}

.species-detail-acoustic-mark i:nth-child(2),
.species-detail-acoustic-mark i:nth-child(6) {
  height: 36px;
}

.species-detail-acoustic-mark i:nth-child(3),
.species-detail-acoustic-mark i:nth-child(5) {
  height: 52px;
}

.species-detail-acoustic-mark i:nth-child(4) {
  height: 68px;
}

.species-detail-hero-copy span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 850;
}

.species-detail-hero-copy strong {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.05;
}

.species-detail-hero-copy em {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.species-detail-panel[hidden] {
  display: none;
}

.species-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.species-detail-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.species-detail-header span {
  color: rgba(126, 215, 255, 0.82);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.species-detail-header strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.12;
}

.species-detail-header em {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-style: italic;
}

.species-detail-close {
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.species-detail-confidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.07);
}

.species-detail-confidence span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
}

.species-detail-confidence strong {
  color: #ffffff;
  font-size: 18px;
}

.species-detail-intro,
.species-detail-caution,
.species-detail-grid p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
}

.species-detail-intro {
  color: rgba(255, 255, 255, 0.86);
}

.species-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.species-detail-grid section {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.species-detail-grid h3 {
  margin: 0;
  color: rgba(126, 215, 255, 0.82);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.species-detail-caution {
  border-left: 2px solid rgba(255, 193, 94, 0.72);
  padding-left: 10px;
  color: rgba(255, 255, 255, 0.72);
}

.species-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.species-detail-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.species-detail-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.live-detection-detail-modal {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  align-items: end;
  padding:
    max(18px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(12px);
}

.live-detection-detail-modal[hidden] {
  display: none;
}

.live-detection-detail-sheet {
  width: min(620px, 100%);
  max-height: min(78dvh, 720px);
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 12px;
  color: #ffffff;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.live-detection-detail-model {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 561px) {
  .live-detection-detail-modal {
    align-items: center;
  }
}

@media (width <= 560px) {
  .live-detection-detail-modal {
    padding: max(64px, env(safe-area-inset-top)) 0 0;
  }

  .live-detection-detail-sheet {
    width: 100%;
    max-height: calc(100dvh - max(64px, env(safe-area-inset-top)));
    padding:
      14px
      max(14px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
  }

  .species-detail-hero {
    align-items: stretch;
  }

  .species-detail-gallery {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .live-detection-detail-sheet .species-detail-grid {
    grid-template-columns: 1fr;
  }
}

.species-content-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.species-content-feedback-modal[hidden] {
  display: none;
}

.species-content-feedback-sheet {
  display: grid;
  width: min(480px, 100%);
  gap: 12px;
  border: 1px solid rgba(126, 215, 255, 0.22);
  border-radius: 8px;
  padding: 14px;
  background: rgba(7, 13, 14, 0.96);
  color: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

.species-content-feedback-sheet header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.species-content-feedback-sheet header div {
  display: grid;
  gap: 3px;
}

.species-content-feedback-sheet header span,
.species-content-feedback-sheet label {
  color: rgba(126, 215, 255, 0.82);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.species-content-feedback-sheet header strong {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.15;
}

.species-content-feedback-sheet header button {
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  font-size: 22px;
}

.species-content-feedback-sheet label {
  display: grid;
  gap: 6px;
}

.species-content-feedback-sheet select,
.species-content-feedback-sheet textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  resize: vertical;
}

.species-content-feedback-sheet footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.species-content-feedback-sheet footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.35;
}

.species-content-feedback-sheet footer button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.94);
  color: #101617;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.sentry-live-empty-state,
.sentry-live-overflow {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.sentry-live-overflow {
  min-height: 28px;
  border-style: solid;
  background: rgba(255, 255, 255, 0.055);
  font-size: 11px;
}

.sentry-detection-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.add-animal-button {
  min-width: 0;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 8, 9, 0.72);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.share-contribution-button {
  min-width: 0;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  border: 1px solid rgba(126, 215, 255, 0.24);
  background: rgba(8, 12, 13, 0.76);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sound-galaxy-app[data-has-recording="false"] .add-animal-button {
  display: none;
}

.sound-galaxy-app[data-has-recording="false"] .share-contribution-button {
  display: none;
}

.animal-result-panel,
.capture-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032)),
    rgba(5, 10, 11, 0.78);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.result-timeline-readout {
  max-width: min(420px, calc(100vw - 92px));
  display: grid;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(5, 8, 9, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.result-meta,
.result-timeline {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.result-timeline {
  color: rgba(255, 255, 255, 0.95);
  font-size: 9px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.result-action-row {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 6px;
  max-width: min(420px, 100%);
  width: fit-content;
  justify-self: end;
}

.result-action-row button {
  min-height: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  font-size: 10px;
  border-radius: 999px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.animal-result-panel,
.capture-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.animal-result-panel {
  position: absolute;
  z-index: 4;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: none;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
  background: rgba(8, 12, 13, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  backdrop-filter: blur(18px);
}

.contribution-result-panel {
  position: absolute;
  z-index: 4;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: none;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
  background: rgba(8, 12, 13, 0.78);
  border: 1px solid rgba(126, 215, 255, 0.14);
  color: #ffffff;
  backdrop-filter: blur(18px);
}

.sound-galaxy-app[data-has-recording="true"][data-animal-panel="open"] .animal-result-panel {
  display: grid;
}

.sound-galaxy-app[data-has-recording="true"][data-contribution-panel="open"] .contribution-result-panel {
  display: grid;
}

.animal-panel-header span,
.app-header span,
.result-toolbar span,
.label-field {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.animal-panel-header h1,
.app-header h1 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.animal-result-panel .animal-panel-header h1,
.animal-result-panel .label-field,
.animal-result-panel .camera-tile strong {
  color: #ffffff;
}

.animal-result-panel .animal-panel-header span,
.animal-result-panel .label-field,
.animal-result-panel .camera-tile small,
.animal-result-panel .status-line {
  color: rgba(255, 255, 255, 0.66);
}

.contribution-result-panel .animal-panel-header h1,
.contribution-result-panel .label-field,
.contribution-result-panel .panel-copy,
.contribution-result-panel .status-line {
  color: rgba(255, 255, 255, 0.72);
}

.contribution-result-panel .animal-panel-header span {
  color: rgba(126, 215, 255, 0.82);
}

.animal-result-panel input[type="text"] {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.contribution-result-panel input[type="text"],
.contribution-result-panel textarea,
.contribution-result-panel select {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.contribution-result-panel textarea {
  min-height: 102px;
  resize: vertical;
}

.contribution-result-panel select {
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 8px;
}

.animal-result-panel input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.animal-result-panel .camera-tile {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(circle at 24% 20%, rgba(232, 111, 94, 0.16), transparent 34%),
    rgba(255, 255, 255, 0.06);
}

.animal-preview-frame,
.specimen-frame {
  display: grid;
  margin: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.animal-preview-frame {
  min-height: 176px;
  padding: 8px;
}

.animal-preview-frame[hidden] {
  display: none;
}

.animal-preview-frame img,
.specimen-frame img {
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.animal-preview-frame img {
  width: 100%;
  max-height: 218px;
}

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

input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: none;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.22);
}

input[type="text"]:focus {
  border-color: rgba(126, 215, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(126, 215, 255, 0.12);
}

textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: none;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.22);
  font: inherit;
}

textarea:focus,
select:focus {
  border-color: rgba(126, 215, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(126, 215, 255, 0.12);
}

.camera-tile {
  position: relative;
  display: grid;
  min-height: 220px;
  padding: 24px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 20%, rgba(232, 111, 94, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-align: center;
}

.camera-tile.compact {
  min-height: 96px;
  padding: 12px;
}

.camera-tile input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.camera-tile strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #ffffff;
  text-transform: none;
  font-size: 20px;
  font-weight: 780;
}

.camera-tile small {
  color: rgba(255, 255, 255, 0.64);
  text-transform: none;
  font-size: 14px;
  font-weight: 650;
}

.camera-icon,
.spark-icon {
  display: inline-block;
  flex: none;
}

.camera-icon {
  width: 42px;
  height: 34px;
  border: 2px solid var(--sage);
  border-radius: 7px;
}

.camera-icon::before {
  display: block;
  width: 13px;
  height: 13px;
  margin: 9px auto 0;
  border: 2px solid var(--sage);
  border-radius: 50%;
  content: "";
}

.spark-icon {
  width: 16px;
  height: 16px;
  border-top: 2px solid currentColor;
  transform: rotate(-38deg);
}

.spark-icon::before {
  display: block;
  width: 5px;
  height: 5px;
  margin: -6px 0 0 11px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.secondary-button {
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.status-line {
  min-height: 22px;
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.status-line[data-tone="error"] {
  color: #a43d32;
}

.status-line[data-tone="success"] {
  color: #3d744e;
}

/* ── Mic selector ─────────────────────────────────────────── */
.mic-selector-wrap {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 10px;
  width: min(100%, 560px);
}

.mic-selector-label {
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.mic-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: min(100%, 560px);
}

.input-gain-wrap {
  display: grid;
  gap: 7px;
  width: 100%;
}

.input-gain-label {
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 830;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input-gain-slider {
  display: block;
  width: 100%;
  min-width: 0;
  accent-color: var(--record);
}

.filter-pack-wrap {
  display: grid;
  gap: 9px;
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 14px;
  background: rgba(126, 231, 255, 0.06);
}

.filter-pack-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.filter-pack-heading strong {
  color: #ffffff;
  font-size: 12px;
}

.filter-pack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.filter-pack-grid button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: 9px;
  font-weight: 780;
}

.filter-pack-grid button span {
  color: rgba(126, 231, 255, 0.84);
  font-size: 15px;
  line-height: 1;
}

.filter-pack-grid button.active {
  border-color: rgba(126, 231, 255, 0.62);
  background: rgba(126, 231, 255, 0.2);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.filter-pack-description {
  min-height: 30px;
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10.5px;
  line-height: 1.35;
}

.advanced-audio-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
  cursor: pointer;
  text-align: left;
}

.advanced-audio-toggle span {
  grid-column: 1;
  grid-row: 1;
  font-size: 12px;
  font-weight: 820;
}

.advanced-audio-toggle em {
  grid-column: 1;
  grid-row: 2;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-style: normal;
}

.advanced-audio-toggle::after {
  content: "⌄";
  grid-column: 2;
  grid-row: 1 / span 2;
  color: rgba(126, 231, 255, 0.82);
  font-size: 18px;
  transition: transform 150ms ease;
}

.advanced-audio-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.advanced-audio-profile {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.sentry-sensitivity-wrap {
  display: grid;
  gap: 7px;
  width: 100%;
  margin-bottom: 8px;
}

.sentry-sensitivity-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.filter-pack-label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 830;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sentry-sensitivity-label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 830;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-pack-select {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0 34px 0 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 760;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  cursor: pointer;
}

.filter-pack-select:focus {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.sentry-sensitivity-slider {
  width: 100%;
  accent-color: var(--record);
}

.sentry-sensitivity-value {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 840;
  letter-spacing: 0.02em;
}

.sentry-sensitivity-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.35;
}

.input-agc-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 760;
}

.input-agc-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.mic-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.mic-option[aria-checked="true"] {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

.mic-option-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 140ms ease;
}

.mic-option[aria-checked="true"] .mic-option-dot {
  background: var(--record);
  box-shadow: 0 0 6px rgba(255, 56, 92, 0.7);
}

/* ── Pointing tip ─────────────────────────────────────────── */
.pointing-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(5, 10, 11, 0.56);
  backdrop-filter: blur(18px);
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.18;
  max-width: min(88vw, 430px);
  text-align: center;
  pointer-events: none;
}

.pointing-tip-icon {
  flex: none;
  width: 22px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  position: relative;
}

/* little mic dot at bottom of phone icon */
.pointing-tip-icon::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--record);
  box-shadow: 0 0 5px rgba(255, 56, 92, 0.8);
}

/* arrow pointing downward from the phone icon */
.pointing-tip-icon::before {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid rgba(255, 255, 255, 0.5);
}

@media (width <= 560px) {
  .pointing-tip {
    font-size: 12px;
    padding: 9px 14px;
  }
}

/* ── Animal layout ────────────────────────────────────────── */
.animal-page {
  min-height: 100vh;
  padding: 0;
  background: #000000;
  color: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
}

.animal-flow {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 28px;
  min-height: 100vh;
  padding:
    max(24px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(108px, calc(env(safe-area-inset-bottom) + 92px))
    max(18px, env(safe-area-inset-left));
}

.animal-flow .capture-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

.animal-flow .result-panel {
  padding: 14px;
}

.animal-flow .app-header span,
.animal-flow .result-toolbar span,
.animal-flow .label-field {
  color: rgba(236, 250, 252, 0.66);
}

.animal-flow .app-header h1 {
  margin: 0;
  color: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, system-ui, sans-serif;
  font-size: clamp(34px, 8vw, 44px);
  font-weight: 760;
  line-height: 1.06;
}

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

.result-panel {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.result-toolbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.specimen-frame {
  min-height: 0;
  padding: 18px;
}

.specimen-frame img {
  width: min(100%, 760px);
  max-height: calc(100vh - 126px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

@media (width <= 920px) {
  .animal-flow {
    grid-template-columns: 1fr;
  }

  .animal-flow {
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(104px, calc(env(safe-area-inset-bottom) + 88px))
      max(14px, env(safe-area-inset-left));
  }

  .animal-result-panel {
    top: max(14px, env(safe-area-inset-top));
    max-height: 42svh;
  }
}

@media (width <= 560px) {
  .sound-galaxy-app {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
  }

  .recording-space {
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100svh;
    background: #05080a;
  }

  .app-nav {
    right: 0;
    left: 0;
    max-width: none;
  }

  .app-nav button,
  .app-nav a {
    min-width: 0;
    padding: 0 10px;
  }

  .capture-console {
    gap: 12px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .capture-source {
    min-height: 48px;
  }

  .capture-core {
    gap: 18px;
  }

  .capture-controls {
    min-height: 0;
  }

  .record-button {
    width: min(68vw, 252px);
    font-size: 34px;
    box-shadow:
      0 24px 74px rgba(255, 56, 92, 0.3),
      0 0 0 12px rgba(255, 56, 92, 0.1),
      0 0 0 24px rgba(255, 56, 92, 0.035),
      inset 0 2px 2px rgba(255, 255, 255, 0.28),
      inset 0 -16px 34px rgba(66, 0, 21, 0.22);
  }

  .record-button::before {
    inset: -30px;
  }

  .record-button span {
    width: 58px;
  }

  .recording-settings-dock > .recording-settings-toggle {
    display: none;
  }

  .recording-settings-dock > .recording-settings-panel {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 0;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px);
    left: 0;
    z-index: 90;
    width: auto;
    max-width: none;
    max-height: none;
    overflow-y: auto;
    transform: none;
  }

  .recording-settings-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .recording-settings-shared,
  .recording-settings-shared.is-live {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 0;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px);
    left: 0;
    width: auto;
    max-width: none;
    max-height: none;
    overflow-y: auto;
    transform: none;
  }

  .recording-settings-shared.is-live {
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 132px);
  }

  .settings-mode-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .settings-mode-copy {
    padding: 0 2px;
  }

  .recording-settings-panel > .recording-settings-header,
  .recording-settings-panel > .mic-selector-wrap,
  .recording-settings-panel > .target-animal-panel,
  .recording-settings-panel > .region-prior-panel,
  .recording-settings-panel > .analysis-tool-panel,
  .recording-settings-panel > .recording-settings-warning {
    grid-column: 1;
  }

  .recording-settings-header strong {
    font-size: 17px;
  }

  .region-map {
    width: calc(100% + 20px);
    height: auto;
    min-height: 0;
    margin-inline: -10px;
    aspect-ratio: 1.5;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    touch-action: manipulation;
  }

  .region-map[data-map-view="world"] {
    aspect-ratio: 2.5;
  }

  .region-prior-panel {
    gap: 8px;
    width: calc(100% + 28px);
    max-width: none;
    margin-inline: -14px;
    padding: 10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .region-prior-header button,
  .region-map-reset {
    min-height: 44px;
    padding: 0 14px;
    font-size: 12px;
  }

  .region-location-pill {
    min-height: 40px;
    padding: 0 12px;
    font-size: 10px;
  }

  .region-map-toolbar {
    min-height: 44px;
    gap: 8px;
  }

  .region-map-toolbar > span {
    max-width: 58%;
    font-size: 10px;
    line-height: 1.25;
  }

  .region-map-region-shape {
    fill: transparent;
    stroke: transparent;
    stroke-width: 0.42;
  }

  .region-map-marker.active .region-map-region-shape {
    fill: rgba(255, 56, 92, 0.11);
    stroke-width: 0.78;
  }

  .region-map-marker-label {
    font-size: 2.3px;
    stroke-width: 0.62px;
  }

  .region-map-marker.active .region-map-marker-label {
    font-size: 2.55px;
  }

  .region-prior-status {
    font-size: 10px;
  }

  .filter-pack-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mic-selector {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mic-option {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: flex-start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #loadTestAudioButton {
    display: none;
  }

  .recording-hud {
    left: max(14px, env(safe-area-inset-left));
    right: auto;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px);
    justify-content: flex-start;
    gap: 8px;
  }

  .recording-settings-inline-toggle {
    top: auto;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px);
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 999px;
    gap: 0;
  }

  .recording-settings-inline-toggle .recording-settings-text {
    display: none;
  }

  .recording-settings-inline-toggle .recording-settings-icon {
    width: 100%;
    height: 100%;
    border: 0;
    font-size: 15px;
    line-height: 1;
  }

  .field-pair-toggle {
    top: auto;
    left: auto;
    right: calc(max(16px, env(safe-area-inset-right)) + 52px);
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px);
    min-width: 58px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 12px;
  }

  .recording-view-bar {
    display: none;
  }

  .recording-view-bar button {
    flex: 1;
    min-width: 0;
    min-height: 36px;
    padding: 0 4px;
    font-size: 10.5px;
  }

  .live-detection-visual {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    top: calc(max(8px, env(safe-area-inset-top)) + 164px);
    bottom: auto;
    width: auto;
    min-height: 78px;
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 8px 10px 8px 8px;
    border-radius: 12px;
  }

  .live-detection-visual-image {
    width: 56px;
    height: 56px;
  }

  .live-detection-visual-copy strong {
    font-size: 13px;
  }

  .live-detection-visual-copy em {
    font-size: 11px;
  }

  .field-pair-panel {
    top: max(16px, env(safe-area-inset-top));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 132px);
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    width: auto;
    align-content: start;
    overflow: auto;
  }

  .recording-settings-overlay {
    top: max(16px, env(safe-area-inset-top));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 132px);
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    width: auto;
    max-height: none;
  }

  .analysis-status {
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 132px);
    max-width: none;
    min-height: 0;
    transform: none;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 12px;
  }

  .view-switcher {
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    justify-content: stretch;
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(4, 8, 9, 0.82);
    box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
  }

  .sound-galaxy-app[data-phase="recording"] .view-switcher {
    display: flex;
  }

  .view-switcher .view-icon {
    display: none;
  }

  .view-switcher button {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 0 2px;
    font-size: 9.2px;
  }

  .result-view-switcher {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    top: max(58px, calc(env(safe-area-inset-top) + 44px));
    bottom: auto;
    max-width: none;
    justify-content: stretch;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 3px;
    padding: 4px;
  }

  .sound-galaxy-app[data-phase="result"] .result-overlay {
    padding-bottom: 58px;
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }

  .result-view-switcher button {
    flex: 1;
    min-width: 0;
    min-height: 30px;
    padding: 0 5px;
    font-size: 10px;
  }

  .contribution-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .contribution-card > img {
    width: 72px;
    height: 72px;
  }

  .sentry-live-panel {
    top: auto;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 116px);
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    width: auto;
    max-width: none;
    max-height: min(42svh, 310px);
    padding: 9px;
  }

  .sentry-live-control {
    min-width: 68px;
    font-size: 10px;
    min-height: 28px;
  }

  .sentry-live-stream {
    max-height: 17svh;
  }

  .animal-detection-timeline {
    min-height: 104px;
    padding: 8px 7px 6px;
  }

  .animal-detection-marker-layer {
    height: 80px;
  }

  .animal-detection-marker {
    width: min(84px, 28vw);
  }

  .animal-detection-marker-thumb {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .animal-detection-marker--primary .animal-detection-marker-thumb {
    width: 42px;
    height: 42px;
  }

  .animal-detection-marker-label {
    font-size: 9.5px;
  }

  .animal-detection-marker-meta {
    font-size: 9px;
  }

  .sentry-console-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sentry-console-metrics div {
    padding: 5px 6px;
  }

  .sentry-console-metrics span {
    font-size: 8px;
  }

  .sentry-console-metrics strong {
    font-size: 11px;
  }

  .sentry-live-config-summary,
  .sentry-console-hint {
    display: none;
  }

  .sentry-detection-card--live {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 7px;
  }

  .sentry-detection-card--live .sentry-detection-thumb {
    font-size: 16px;
  }

  .sentry-detection-card--live > strong {
    font-size: 12px;
  }

  .sentry-detection-card--live .sentry-detection-meta,
  .sentry-detection-card--live > span {
    font-size: 10px;
  }

  .sentry-detection-card--live button {
    min-height: 27px;
    padding: 0 6px;
    font-size: 10px;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) {
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 104px);
    left: max(8px, env(safe-area-inset-left));
    z-index: 62;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, auto) minmax(0, 1fr);
    align-content: start;
    max-height: min(46dvh, 430px);
    overflow-y: auto;
    padding: 10px;
    border-radius: 12px;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel[data-species-detail="open"]:not(.sentry-live-panel) {
    top: max(62px, calc(env(safe-area-inset-top) + 62px));
    max-height: none;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel[data-species-detail="open"]:not(.sentry-live-panel) > .sentry-panel-header-row,
  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel[data-species-detail="open"]:not(.sentry-live-panel) > .sentry-result-profile,
  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel[data-species-detail="open"]:not(.sentry-live-panel) > .sentry-detection-summary,
  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel[data-species-detail="open"]:not(.sentry-live-panel) > .animal-detection-timeline,
  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel[data-species-detail="open"]:not(.sentry-live-panel) > .sentry-detection-list {
    display: none !important;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel[data-species-detail="open"]:not(.sentry-live-panel) .species-detail-panel {
    min-height: 100%;
    overflow: auto;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-list {
    display: flex !important;
    width: 100%;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .species-review-loading-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    min-height: 260px;
    text-align: center;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .species-review-loading-copy span {
    max-width: 30ch;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .species-review-loading-card ol {
    width: min(100%, 280px);
    justify-self: center;
    text-align: left;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-card {
    flex-basis: min(306px, calc(100vw - 42px));
    padding: 12px;
    border-radius: 12px;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-card--primary {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-thumb {
    width: 52px;
    height: 52px;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-card--primary > strong {
    font-size: 14px;
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .species-detail-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .species-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .species-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) {
    top: auto;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 108px);
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    max-height: 58px;
    overflow: hidden;
    padding: 9px 12px;
    border-radius: 999px;
  }

  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-result-profile,
  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-summary,
  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .animal-detection-timeline,
  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-detection-list,
  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .species-detail-panel {
    display: none !important;
  }

  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-panel-header-row {
    align-items: center;
  }

  .sound-galaxy-app[data-phase="result"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) .sentry-panel-header-row > div:first-child {
    display: none;
  }

  .result-play-button {
    width: 36px;
    height: 36px;
  }

  .result-play-button.playing {
    width: 36px;
    height: 36px;
  }

  .result-timeline-readout {
    max-width: none;
  }

  .result-action-row {
    max-width: min(100%, 340px);
    width: fit-content;
    gap: 4px;
  }

  .result-action-row button {
    min-height: 28px;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 9.5px;
  }

  .animal-result-panel {
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 62px);
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: min(68svh, 620px);
    padding: 14px;
  }

  .contribution-result-panel {
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 62px);
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: min(72svh, 660px);
    padding: 14px;
  }

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

  .result-toolbar .secondary-button,
  .animal-flow button,
  #generateAnimalButton {
    width: 100%;
  }
}

@media (hover: none) and (pointer: coarse) {
  .region-map-marker:hover .region-map-marker-label {
    opacity: 0.68;
  }

  .region-map-marker.active .region-map-marker-label,
  .region-map-marker:focus .region-map-marker-label {
    opacity: 1;
  }
}

@media (max-height: 560px) and (pointer: coarse) {
  .recording-settings-panel,
  .recording-settings-shared,
  .recording-settings-shared.is-live {
    grid-template-columns: minmax(0, 1fr);
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 66px);
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-width: none;
    max-height: none;
    padding: 10px;
    border-radius: 16px;
    overflow-y: auto;
    transform: none;
  }

  .region-map {
    height: auto;
    min-height: 220px;
    aspect-ratio: 1.55;
  }
}

/* Keep recording-first overrides last in the cascade. */
.library-page {
  min-height: 100svh;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(104px, calc(env(safe-area-inset-bottom) + 88px)) max(16px, env(safe-area-inset-left));
  background: #000;
  color: #f5f5f7;
}

.voice-memos-library {
  display: grid;
  width: min(100%, 680px);
  margin: 0 auto;
  gap: 12px;
}

.library-topbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 50px;
}

.library-topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 680;
  line-height: 1.1;
  text-align: center;
}

.library-round-button,
.library-settings-control {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #0a84ff;
  box-shadow: none;
}

.library-search-strip input {
  min-height: 38px;
  border-radius: 9px;
  padding-left: 38px;
  background: #1c1c1e;
  font-size: 16px;
}

.library-local-notice {
  padding: 9px 12px;
  border: 0;
  font-size: 13px;
}

.voice-recording-list {
  border-top: 0.5px solid rgba(84, 84, 88, 0.72);
}

.voice-recording-row {
  display: block;
  gap: 0;
  padding: 0;
}

.voice-recording-copy {
  position: relative;
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 3px;
  padding: 10px 42px 10px 12px;
}

.voice-recording-copy strong {
  font-size: 17px;
  font-weight: 620;
}

.voice-recording-copy > span:not(.voice-recording-accessory) {
  font-size: 13px;
}

.library-record-fab {
  width: 66px;
  height: 66px;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(84, 84, 88, 0.72);
}

.review-space {
  background: #000;
}

.sound-galaxy-app[data-phase="review"] .review-space {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(22px, calc(env(safe-area-inset-bottom) + 16px)) max(16px, env(safe-area-inset-left));
}

.review-header,
.review-visuals,
.review-playback-controls,
.review-actions,
.review-detections-panel,
.review-draft-status {
  width: min(100%, 680px);
  margin-right: auto;
  margin-left: auto;
}

.sound-galaxy-app[data-review-origin="library"] .review-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  grid-template-areas: "back title empty" "back meta empty";
  align-items: center;
  min-height: 54px;
  padding: 0;
}

.sound-galaxy-app[data-review-origin="library"] #reviewStepLabel {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"] .review-library-back {
  grid-area: back;
  width: 44px;
  height: 44px;
  margin: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.sound-galaxy-app[data-review-origin="library"] .review-header h1 {
  grid-area: title;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
}

.sound-galaxy-app[data-review-origin="library"] .review-saved-meta {
  grid-area: meta;
  margin: 0;
  font-size: 12px;
  text-align: center;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-spectrogram {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
  display: block;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip {
  grid-template-rows: auto 180px;
}

.review-playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(34px, 11vw, 72px);
  min-height: 76px;
}

.review-actions {
  display: flex;
  justify-content: center;
}

.sound-galaxy-app[data-review-origin="library"] .review-actions {
  display: flex;
  grid-template-columns: none;
}

.sound-galaxy-app[data-review-origin="library"] #reviewRecordAgainButton {
  min-width: 116px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #1c1c1e;
  color: #0a84ff;
}

.sound-galaxy-app[data-review-origin="library"] #saveRecordingOnlyButton {
  display: none;
}

.review-navigation-spacer {
  width: 44px;
  min-width: 44px;
}

.review-decision-hint {
  width: min(100%, 560px);
  margin: -2px auto 2px;
  color: rgba(255, 255, 255, 0.56);
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
}

.review-decision-hint a {
  margin-left: 4px;
  color: #64d2ff;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.sound-galaxy-app[data-review-origin="library"] .review-decision-hint {
  display: none;
}

.sound-galaxy-app[data-review-origin="new"] .review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 560px);
  gap: 10px;
}

.sound-galaxy-app[data-review-origin="new"] .review-actions #saveRecordingOnlyButton,
.sound-galaxy-app[data-review-origin="new"] .review-actions #analyzeSelectionButton,
.sound-galaxy-app[data-review-origin="new"] .review-actions #discardRecordingButton {
  grid-column: auto;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}

.sound-galaxy-app[data-review-origin="new"] .review-actions #discardRecordingButton {
  grid-column: 1 / -1;
  min-height: 44px;
  border: 1px solid rgba(255, 69, 58, 0.5);
  background: transparent;
  color: #ff6961;
}

.sound-galaxy-app[data-review-origin="library"] #discardRecordingButton {
  display: none;
}

.sound-galaxy-app[data-review-origin="new"] .review-actions #reviewRecordAgainButton {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
}

.sound-galaxy-app[data-review-origin="new"] .review-actions #analyzeSelectionButton {
  background: #f5f5f7;
  color: #101112;
}

.sound-galaxy-app[data-review-origin="new"] .review-actions #saveRecordingOnlyButton {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1c1c1e;
  color: #f5f5f7;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="crop"] .review-detections-panel,
.review-detections-panel[hidden],
.review-deep-review-row[hidden] {
  display: none;
}

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"] .review-space {
    grid-template-rows: auto auto auto auto auto auto;
    gap: 10px;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip {
    grid-template-rows: auto clamp(136px, 22vh, 180px);
  }

  .review-actions {
    display: flex;
    grid-template-columns: none;
  }

  #saveRecordingOnlyButton {
    grid-column: auto;
  }
}

/* Final saved-player overrides. */
.review-playback-time {
  order: 3;
  display: block;
  width: min(100%, 680px);
  margin: 2px auto 0;
  color: #f5f5f7;
  text-align: center;
  font-size: clamp(38px, 11vw, 54px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.review-playback-time[hidden] {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
  display: block;
  width: min(100%, 760px);
  height: 330px;
  min-height: 330px;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip {
  display: block;
  height: 100%;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip figcaption {
  display: none;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
  width: 100%;
  height: clamp(240px, 42vh, 360px);
  border: 0;
  border-radius: 0;
  background: #26262c;
  cursor: grab;
  touch-action: pan-y;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas:active {
  cursor: grabbing;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls {
  order: 4;
  min-height: 94px;
  gap: clamp(42px, 14vw, 86px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-actions {
  order: 5;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-detections-panel {
  order: 6;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-draft-status {
  order: 7;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-play-button {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #f5f5f7;
  color: #000;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-play-button .review-action-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  background: transparent;
  color: #000;
  font-size: 28px;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-play-button .review-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"] .review-space {
    gap: 14px;
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
    width: 100%;
    height: 300px;
    min-height: 300px;
  }

  .sound-galaxy-app[data-review-origin="library"] .review-header,
  .sound-galaxy-app[data-review-origin="library"] .review-playback-controls,
  .sound-galaxy-app[data-review-origin="library"] .review-actions,
  .sound-galaxy-app[data-review-origin="library"] .review-detections-panel,
  .sound-galaxy-app[data-review-origin="library"] .review-draft-status,
  .sound-galaxy-app[data-review-origin="library"] .review-playback-time {
    width: calc(100% - 24px);
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
    height: 100%;
  }
}

/* Final Library row override. */
.library-page .voice-recording-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
}

.library-page .voice-recording-header .voice-recording-copy {
  min-width: 0;
  padding: 10px 8px 10px 12px;
}

.library-page .voice-recording-menu {
  position: relative;
  top: auto;
  right: auto;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
  font-size: 0;
  line-height: 1;
}

.library-page .voice-recording-details {
  display: flex;
}

/* Actual final playback controls. */
.review-playback-views { order: 2; }

.review-playback-views { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.review-playback-views button:disabled {
  opacity: 0.34;
  color: #636366;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
  order: 3;
  height: 250px;
  min-height: 250px;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-panel-clip,
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] #reviewWaveformCanvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-time {
  order: 4;
  margin-top: 0;
  font-size: clamp(38px, 10vw, 50px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls {
  order: 5;
  min-height: 78px;
  gap: clamp(42px, 14vw, 84px);
}

.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-actions { order: 6; }
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-detections-panel { order: 7; }
.sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-draft-status { order: 8; }

.review-skip-button,
.voice-recording-skip {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  min-width: 58px;
  place-items: center;
  border: 0 !important;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #f5f5f7;
  box-shadow: none;
}

.review-skip-button::before,
.review-skip-forward::before,
.voice-recording-skip::before,
.voice-recording-skip-back::before,
.voice-recording-skip-forward::before {
  display: none;
  content: none;
}

.review-skip-arrow,
.voice-recording-skip-arrow {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-2px);
}

.review-skip-value,
.voice-recording-skip-value {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #000;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.voice-recording-skip-arrow { font-size: 48px; }
.voice-recording-skip-value { width: 26px; height: 26px; font-size: 11px; }

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="review"] .review-space { gap: 10px; }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-visuals {
    width: 100%;
    height: 238px;
    min-height: 238px;
  }

  .sound-galaxy-app[data-review-origin="library"][data-review-step="preview"] .review-playback-controls { min-height: 72px; }
}

/* Final canonical Apple-style 15-second transport controls. */
.review-skip-button,
.voice-recording-skip {
  display: grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: visible;
  border: 0 !important;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #f5f5f7;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.voice-recording-skip {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-basis: 44px;
}

.review-skip-button::before,
.review-skip-forward::before,
.voice-recording-skip::before,
.voice-recording-skip-back::before,
.voice-recording-skip-forward::before {
  display: none !important;
  content: none !important;
}

.apple-skip-icon {
  display: block;
  width: 44px;
  height: 44px;
  overflow: visible;
  color: inherit;
  pointer-events: none;
}

.voice-recording-skip .apple-skip-icon {
  width: 40px;
  height: 40px;
}

.apple-skip-arc,
.apple-skip-arrowhead {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.apple-skip-number {
  fill: currentColor;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 6.5px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.review-skip-button:active,
.voice-recording-skip:active {
  opacity: 0.58;
  transform: scale(0.94);
}

.review-skip-button:focus-visible,
.voice-recording-skip:focus-visible {
  outline: 2px solid #0a84ff;
  outline-offset: 3px;
}

.review-playback-controls {
  flex-direction: column;
  gap: 8px;
  min-height: 94px;
}

.review-playback-readout {
  color: rgba(235, 235, 245, 0.62);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* Canonical Explore recording viewer header. */
.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-overlay {
  padding-top: max(18px, calc(env(safe-area-inset-top) + 10px));
}

.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-top-overlay {
  display: grid;
  grid-template-areas:
    "back modes play"
    "timeline timeline timeline";
  grid-template-columns: max-content minmax(240px, 520px) 44px;
  gap: 6px 10px;
  align-items: center;
  width: 100%;
}

.sound-galaxy-app[data-phase="result"][data-library-view="library"] .library-back-button {
  grid-area: back;
  min-height: 44px;
}

.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-mode-panel {
  grid-area: modes;
  width: 100%;
  max-width: 520px;
  min-height: 44px;
  margin: 0;
  justify-self: center;
}

.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-mode-button {
  min-height: 36px;
}

.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-play-button,
.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-play-button.playing {
  grid-area: play;
  width: 44px;
  height: 44px;
}

.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-timeline-readout {
  grid-area: timeline;
  justify-self: center;
  width: min(360px, 100%);
}

@media (width <= 560px) {
  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-overlay {
    padding-top: max(64px, calc(env(safe-area-inset-top) + 10px));
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-top-overlay {
    grid-template-columns: max-content minmax(0, 1fr) 44px;
    gap: 5px 6px;
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .library-back-button {
    max-width: 104px;
    padding-inline: 10px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-mode-panel {
    min-height: 44px;
    padding: 3px;
    gap: 2px;
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-mode-button {
    min-height: 38px;
    padding-inline: 2px;
    font-size: 8.5px;
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-timeline-readout {
    width: min(276px, 100%);
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) {
    top: max(164px, calc(env(safe-area-inset-top) + 110px));
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) {
    top: auto;
  }
}

@media (width <= 350px) {
  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-top-overlay {
    grid-template-areas:
      "back . play"
      "modes modes modes"
      "timeline timeline timeline";
    grid-template-columns: max-content minmax(0, 1fr) 44px;
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-mode-panel {
    max-width: none;
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-mode-button {
    min-height: 38px;
    font-size: 9px;
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) {
    top: max(212px, calc(env(safe-area-inset-top) + 158px));
  }

  .sound-galaxy-app[data-phase="result"][data-library-view="library"][data-detection-sheet="collapsed"] .result-space > .sentry-detections-panel:not(.sentry-live-panel) {
    top: auto;
  }
}

/* Consumer release surface: keep the capable internals, present only the
   recording controls that are complete and useful today. */
.recording-space [data-view-button="field"],
.recording-space .field-pair-toggle,
.recording-space .field-pair-panel,
.result-space .add-animal-button,
.result-space .share-contribution-button,
.result-space .animal-result-panel,
.result-space .contribution-result-panel {
  display: none !important;
}

.result-action-row {
  grid-template-columns: repeat(2, minmax(0, auto));
}

/* Every completed Galaxy uses the same low-profile, swipeable detection rail
   as live recording. Library and Explore never fork into separate result UIs. */
.sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) {
  top: auto;
  right: 0;
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + 92px);
  left: 0;
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) > .sentry-panel-header-row,
.sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) > .sentry-result-profile,
.sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) > .sentry-detection-summary,
.sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) > .animal-detection-timeline {
  display: none !important;
}

.sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) .sentry-detection-list {
  display: flex !important;
  width: 100%;
  gap: 10px;
  overflow-x: auto;
  padding: 4px max(14px, env(safe-area-inset-left)) 10px;
  scroll-padding-inline: max(14px, env(safe-area-inset-left));
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.sound-galaxy-app[data-phase="result"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) .saved-detection-card {
  flex: 0 0 min(300px, calc(100vw - 54px));
  scroll-snap-align: center;
}

/* Every saved Galaxy—whether opened from Live Record, Library, or Explore—uses
   the same thumb-reachable view bar and never exposes internal render modes. */
.sound-galaxy-app[data-phase="result"] .result-view-switcher {
  top: auto;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  width: auto;
  max-width: none;
  justify-content: stretch;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(4, 8, 9, 0.82);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.sound-galaxy-app[data-phase="result"] .result-view-switcher button {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  font-size: 9.2px;
  font-weight: 850;
}

.sound-galaxy-app[data-phase="result"] .result-view-switcher button.active {
  background: #ffffff;
  color: #111617;
}

.sound-galaxy-app[data-phase="result"] .result-overlay {
  padding-bottom: calc(62px + env(safe-area-inset-bottom));
}

/* Keep the two end-of-recording actions in the upper, non-interactive Galaxy
   space. The transport owns the bottom rail, so sharing that area made Done
   and New Recording look like they were underneath the waveform scrubber. */
.sound-galaxy-app[data-phase="result"]:not([data-library-view="library"]) .result-action-row {
  position: absolute;
  z-index: 62;
  top: calc(max(10px, env(safe-area-inset-top)) + 72px);
  right: auto;
  bottom: auto;
  left: max(16px, env(safe-area-inset-left));
  justify-self: auto;
}

/* Library used to pin this rail with a top offset, which overrode the shared
   low carousel and made the same detection cards sit far higher than a newly
   completed Advanced result. */
.sound-galaxy-app[data-phase="result"][data-library-view="library"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) {
  top: auto;
}

/* The direct Advanced result has no Library header above it, so its carousel
   can sit closer to the waveform scrubber without leaving a dead vertical gap. */
.sound-galaxy-app[data-phase="result"]:not([data-library-view="library"]) .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) {
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + 74px);
}

.sound-galaxy-app[data-phase="result"] .result-mode-panel {
  display: none !important;
}

.result-action-row .result-library-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111617;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.sound-galaxy-app[data-library-view="library"] .result-library-button {
  display: none;
}

.sound-galaxy-app[data-detection-state="waiting"] .result-overlay {
  display: flex !important;
}

.sound-galaxy-app[data-detection-state="waiting"] .result-detection-loading {
  align-items: center;
  padding-bottom: max(96px, calc(env(safe-area-inset-bottom) + 88px));
}

.result-detection-notice .enable-notifications-button,
.result-detection-notice .detection-notification-status {
  display: none !important;
}

.review-visuals {
  grid-template-columns: minmax(0, 1fr);
}

.review-decision-hint {
  order: 5;
}

.review-detections-panel {
  order: 6;
}

.review-draft-status {
  order: 7;
}

@media (width <= 560px) {
  .sound-galaxy-app[data-dev-tools="true"] #loadTestAudioButton {
    display: inline-flex;
  }

  .recording-settings-dock > .recording-settings-toggle {
    position: fixed;
    z-index: 70;
    top: max(18px, env(safe-area-inset-top));
    left: max(18px, env(safe-area-inset-left));
    display: inline-flex;
    min-height: 42px;
    padding: 0 13px;
  }

  .sound-galaxy-app[data-phase="recording"] .analysis-status {
    top: max(12px, env(safe-area-inset-top));
    bottom: auto;
  }

  .live-detection-visual {
    top: calc(max(8px, env(safe-area-inset-top)) + 72px);
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-visuals {
    height: 446px !important;
    min-height: 446px;
    grid-template-rows: 152px 284px;
    gap: 10px;
    margin-bottom: 64px;
  }

  .sound-galaxy-app[data-phase="review"][data-review-step="crop"] .review-panel-spectrogram {
    grid-template-rows: 28px 250px;
    min-height: 284px;
  }

  .result-action-row .result-library-button {
    min-height: 28px;
    padding: 0 11px;
    font-size: 9.5px;
  }

  .sound-galaxy-app[data-phase="result"][data-detection-state="none"] .result-space > .sentry-detections-panel:not(.sentry-live-panel):not([data-species-detail="open"]) {
    max-height: 132px;
    padding: 10px 12px;
  }

  .saved-detection-card {
    flex-basis: min(300px, calc(100vw - 54px));
  }
}
