/* Terra Listens embed — styles for frame.html (embed.widget) and
 * live/index.html (embed.fullScreen). Values come from
 * product/embed-widget/design-tokens.json `public` through the generated block;
 * the two breakpoints below are held to the tokens by gen-contract.mjs --check.
 */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("nunito-latin.woff2") format("woff2");
}

/* @contract:begin (generated by Web/embed/tools/gen-contract.mjs — do not edit) */
:root {
  --font: Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --w-regular: 400;
  --w-semibold: 600;
  --w-bold: 700;
  --t-heading: 17px;
  --t-full-heading: 32px;
  --t-section: 13px;
  --t-section-tracking: 0.04em;
  --t-section-transform: uppercase;
  --t-row: 15px;
  --t-caption: 12px;
  --t-stat: 28px;
  --t-full-stat: 44px;
  --t-button: 16px;
  --t-line: 1.35;
  --s-xxs: 2px;
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 24px;
  --s-xxl: 40px;
  --pad-widget: 16px;
  --pad-widget-small: 12px;
  --pad-full: 40px;
  --pad-full-narrow: 16px;
  --r-widget: 14px;
  --r-button: 999px;
  --r-image: 999px;
  --r-pill: 999px;
  --r-card: 12px;
  --z-row-image: 40px;
  --z-full-row-image: 56px;
  --z-row: 52px;
  --z-full-row: 72px;
  --z-button: 44px;
  --z-full-button: 56px;
  --z-live-dot: 8px;
  --z-footer: 36px;
  --full-max: 1200px;
}
[data-theme="light"], [data-theme="auto"] {
  --c-background: #FFFFFF;
  --c-surface-alt: #FFF8EE;
  --c-border: #E8DFD0;
  --c-text-primary: #01333C;
  --c-text-secondary: #4A6870;
  --c-primary: #027996;
  --c-on-primary: #FFFFFF;
  --c-primary-hover: #01617A;
  --c-live: #D93A3A;
  --c-offline: #8A9A9E;
  --c-pill-background: #F2EDE4;
  --c-link: #027996;
  --c-image-fallback: #D9E9EC;
  --c-skeleton: #EFE9DE;
  --c-focus-ring: #027996;
}
[data-theme="dark"] {
  --c-background: #01333C;
  --c-surface-alt: #0A4550;
  --c-border: #1C5A66;
  --c-text-primary: #FFF8EE;
  --c-text-secondary: #B7CDD1;
  --c-primary: #FFC42C;
  --c-on-primary: #01333C;
  --c-primary-hover: #FFD15C;
  --c-live: #FF6B6B;
  --c-offline: #8FA7AC;
  --c-pill-background: #0A4550;
  --c-link: #FFC42C;
  --c-image-fallback: #1C5A66;
  --c-skeleton: #0F4C57;
  --c-focus-ring: #FFC42C;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --c-background: #01333C;
    --c-surface-alt: #0A4550;
    --c-border: #1C5A66;
    --c-text-primary: #FFF8EE;
    --c-text-secondary: #B7CDD1;
    --c-primary: #FFC42C;
    --c-on-primary: #01333C;
    --c-primary-hover: #FFD15C;
    --c-live: #FF6B6B;
    --c-offline: #8FA7AC;
    --c-pill-background: #0A4550;
    --c-link: #FFC42C;
    --c-image-fallback: #1C5A66;
    --c-skeleton: #0F4C57;
    --c-focus-ring: #FFC42C;
  }
}
/* @contract:end */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-weight: var(--w-regular);
  font-size: var(--t-row);
  line-height: var(--t-line);
  color: var(--c-text-primary);
  background: transparent;
}
[data-mode="full"] body { background: var(--c-background); min-height: 100vh; }

a { color: var(--c-link); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--c-focus-ring);
  outline-offset: 2px;
}
.tw-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px;
}
.tw-noscript { margin: 0; padding: var(--pad-widget); }

/* ── card ─────────────────────────────────────────────────────────────── */
.tw {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--c-background);
  border: 1px solid var(--c-border);
  border-radius: var(--r-widget);
  overflow: hidden;
}
.tw-main { flex: 1 1 auto; min-height: 0; }
.tw-content {
  display: flex;
  flex-direction: column;
  gap: var(--s-lg);
  padding: var(--pad-widget);
}
[data-size="small"] .tw-content { padding: var(--pad-widget-small); gap: var(--s-md); }

/* ── header ───────────────────────────────────────────────────────────── */
.tw-head {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  min-width: 0;
}
.tw-heading {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: var(--t-heading);
  font-weight: var(--w-bold);
  line-height: var(--t-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tw-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  padding: var(--s-xxs) var(--s-sm);
  border-radius: var(--r-pill);
  background: var(--c-pill-background);
  color: var(--c-text-primary);
  font-size: var(--t-caption);
  font-weight: var(--w-semibold);
  line-height: var(--t-line);
}
.tw-dot {
  width: var(--z-live-dot);
  height: var(--z-live-dot);
  border-radius: 50%;
  background: var(--c-live);
}
.tw-pill.tw-offline .tw-dot { background: var(--c-offline); }

/* ── live audio ───────────────────────────────────────────────────────── */
.tw-listen {
  width: 100%;
  min-height: var(--z-button);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: var(--s-sm) var(--s-lg);
  border: 0;
  border-radius: var(--r-button);
  background: var(--c-primary);
  color: var(--c-on-primary);
  font: inherit;
  font-size: var(--t-button);
  font-weight: var(--w-bold);
  cursor: pointer;
}
.tw-listen:hover:not(:disabled) { background: var(--c-primary-hover); }
.tw-listen:disabled {
  cursor: default;
  background: var(--c-surface-alt);
  color: var(--c-text-secondary);
}
.tw-glyph { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
.tw-spinner {
  width: 16px; height: 16px; flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tw-spin 800ms linear infinite;
}
.tw-level { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.tw-bar {
  width: 3px; height: 100%;
  background: currentColor;
  border-radius: 1px;
  transform-origin: bottom;
  animation: tw-level 900ms ease-in-out infinite;
}
.tw-bar:nth-child(2) { animation-delay: -300ms; }
.tw-bar:nth-child(3) { animation-delay: -600ms; }
@keyframes tw-spin { to { transform: rotate(360deg); } }
@keyframes tw-level { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ── species today ────────────────────────────────────────────────────── */
.tw-stat { display: flex; align-items: baseline; gap: var(--s-sm); }
.tw-stat-num {
  font-size: var(--t-stat);
  font-weight: var(--w-bold);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tw-stat-label { color: var(--c-text-secondary); font-weight: var(--w-semibold); }

/* ── lists ────────────────────────────────────────────────────────────── */
.tw-list { min-width: 0; }
.tw-section-title {
  margin: 0 0 var(--s-xs);
  font-size: var(--t-section);
  font-weight: var(--w-bold);
  letter-spacing: var(--t-section-tracking);
  text-transform: var(--t-section-transform);
  color: var(--c-text-secondary);
  line-height: var(--t-line);
}
.tw-rows { list-style: none; margin: 0; padding: 0; }
.tw-row {
  display: flex;
  align-items: center;
  gap: var(--s-md);
  height: var(--z-row);
  min-width: 0;
}
.tw-row + .tw-row { border-top: 1px solid var(--c-border); }
.tw-avatar {
  flex: 0 0 auto;
  width: var(--z-row-image);
  height: var(--z-row-image);
  border-radius: var(--r-image);
  overflow: hidden;
  background: var(--c-image-fallback);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-avatar-glyph { width: 60%; height: 60%; fill: var(--c-text-secondary); opacity: .7; }
.tw-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tw-name, .tw-sci { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-name { font-weight: var(--w-semibold); }
.tw-sci { font-size: var(--t-caption); font-style: italic; color: var(--c-text-secondary); }
.tw-when, .tw-count {
  flex: 0 0 auto;
  color: var(--c-text-secondary);
  font-variant-numeric: tabular-nums;
}
.tw-count { color: var(--c-text-primary); font-weight: var(--w-semibold); }
.tw-empty {
  height: var(--z-row);
  display: flex;
  align-items: center;
  color: var(--c-text-secondary);
}
.tw-enter { animation: tw-enter 240ms ease-out; }
@keyframes tw-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── unavailable / error ──────────────────────────────────────────────── */
.tw-gone, .tw-error {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  text-align: center;
  color: var(--c-text-secondary);
}
.tw-gone p, .tw-error p { margin: 0; }

/* ── footer ───────────────────────────────────────────────────────────── */
.tw-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  min-height: var(--z-footer);
  padding: 0 var(--pad-widget);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-alt);
  font-size: var(--t-caption);
  font-weight: var(--w-semibold);
}
[data-size="small"] .tw-footer { padding: 0 var(--pad-widget-small); }
.tw-footer .tw-brand { margin-left: auto; color: var(--c-text-secondary); }
.tw-footer a[hidden] { display: none; }

/* ── skeleton (loading) ───────────────────────────────────────────────── */
.tw-skel {
  display: inline-block;
  background: var(--c-skeleton);
  color: transparent;
  border-radius: var(--r-card);
}
.tw-skel-heading { max-width: 100%; line-height: 1.1; vertical-align: middle; }
.tw-skel-line { height: 12px; width: 55%; }
.tw-skel-pill .tw-pill-text, .tw-skel-pill .tw-dot { visibility: hidden; }
.tw-skel-box, .tw-skel-box:disabled { background: var(--c-skeleton); color: transparent; }
.tw-skel-box * { visibility: hidden; }
.tw-skel-text .tw-section-title, .tw-skel-text .tw-stat-num, .tw-skel-text .tw-stat-label {
  color: transparent;
  background: var(--c-skeleton);
  border-radius: var(--r-card);
}

/* ── two columns ≥ public.breakpoint.twoColumnWidget ──────────────────── */
@media (min-width: 560px) {
  [data-mode="widget"] .tw-content { flex-flow: row wrap; column-gap: var(--s-xl); }
  [data-mode="widget"] .tw-head { order: 1; flex: 1 1 0; }
  [data-mode="widget"] .tw-stat { order: 2; flex: 0 0 auto; align-self: center; }
  [data-mode="widget"] .tw-audio { order: 3; flex: 1 1 100%; }
  [data-mode="widget"] .tw-list { order: 4; flex: 1 1 calc(50% - var(--s-xl)); }
  [data-mode="widget"] .tw-gone, [data-mode="widget"] .tw-error { flex: 1 1 100%; }
}

/* ── full-screen page ─────────────────────────────────────────────────── */
[data-mode="full"] .tw {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}
[data-mode="full"] .tw-content,
[data-mode="full"] .tw-pagefooter {
  width: 100%;
  max-width: var(--full-max);
  margin: 0 auto;
  padding: var(--pad-full-narrow);
}
[data-mode="full"] .tw-content { gap: var(--s-xl); }
.tw-wordmark {
  flex: 1 1 100%;
  align-self: flex-start;
  font-weight: var(--w-bold);
  font-size: var(--t-heading);
  color: var(--c-text-primary);
  text-decoration: none;
}
[data-mode="full"] .tw-heading { font-size: var(--t-full-heading); }
[data-mode="full"] .tw-pill { font-size: var(--t-row); padding: var(--s-xs) var(--s-md); }
[data-mode="full"] .tw-audio { display: flex; justify-content: center; }
[data-mode="full"] .tw-listen { max-width: 420px; min-height: var(--z-full-button); }
[data-mode="full"] .tw-stat-num { font-size: var(--t-full-stat); }
[data-mode="full"] .tw-row { height: var(--z-full-row); gap: var(--s-lg); }
[data-mode="full"] .tw-avatar { width: var(--z-full-row-image); height: var(--z-full-row-image); }
[data-mode="full"] .tw-empty { height: var(--z-full-row); }
[data-mode="full"] .tw-section-title { margin-bottom: var(--s-sm); }
.tw-pagefooter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  border-top: 1px solid var(--c-border);
  font-size: var(--t-caption);
  color: var(--c-text-secondary);
}
.tw-attribution { margin: 0; flex: 1 1 320px; }
.tw-pagefooter .tw-brand { font-weight: var(--w-semibold); }
.tw-visit { font-weight: var(--w-semibold); }

/* ── two columns ≥ public.breakpoint.twoColumnFullPage ────────────────── */
@media (min-width: 900px) {
  [data-mode="full"] .tw-content,
  [data-mode="full"] .tw-pagefooter { padding: var(--pad-full); }
  [data-mode="full"] .tw-content { flex-flow: row wrap; column-gap: var(--s-xxl); }
  [data-mode="full"] .tw-wordmark { order: 0; }
  [data-mode="full"] .tw-head { order: 1; flex: 1 1 0; }
  [data-mode="full"] .tw-stat { order: 2; flex: 0 0 auto; align-self: center; }
  [data-mode="full"] .tw-audio { order: 3; flex: 1 1 100%; }
  [data-mode="full"] .tw-list { order: 4; flex: 1 1 calc(50% - var(--s-xxl)); }
  [data-mode="full"] .tw-gone, [data-mode="full"] .tw-error { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-enter { animation: none; }
  .tw-bar { animation: none; transform: scaleY(.7); }
  .tw-spinner { animation-duration: 2400ms; }
}
