@font-face {
  font-family: Fredoka;
  src: url("Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --cream: #f7f4ee;
  --ink: #353337;
  --sage: #92ad9f;
  --sage-dark: #526c5e;
  --coral: #ec4445;
  --muted: #716c6b;
  --line: #c5d0c7;
  --button-ink: #fff;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(#fffdf8, #eeebe4);
  color: var(--ink);
  font:
    400 17px/1.35 Fredoka,
    system-ui,
    sans-serif;
  min-height: 100dvh;
}
button,
input,
a,
label {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  min-height: 44px;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible,
label:focus-within {
  outline: 3px solid var(--sage-dark);
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.65;
}
a {
  color: var(--sage-dark);
}
[hidden] {
  display: none !important;
}
h1,
p {
  margin: 0;
}
h1 {
  font-weight: 400;
  line-height: 1.2;
}
.screen {
  width: min(100%, 460px);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 32px 28px 24px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.text-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  padding: 8px 6px;
  font-size: 16px;
}
.muted {
  color: var(--muted);
}
.coral {
  color: #c72e35;
}
.primary {
  background: var(--coral);
  color: #fff;
  border-radius: 7px;
  min-height: 48px;
  padding: 8px 24px;
  font-size: 24px;
  line-height: 1.2;
  box-shadow: none;
}
.primary:hover:not(:disabled) {
  background: #d6383b;
}
.primary:disabled {
  opacity: 0.55;
}
.subtle {
  font-size: 14px;
  color: var(--muted);
}
.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tabs button {
  font-size: 18px;
  border-bottom: 2px solid transparent;
  padding: 8px 2px;
  min-height: 44px;
}
.tabs .active {
  border-color: var(--ink);
}
.record-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(55px, 10.6dvh, 100px);
  padding-bottom: 16px;
}
.yaffle-mark {
  color: var(--sage);
  width: 60%;
  max-width: 240px;
  height: auto;
  flex-shrink: 0;
}
.record-band {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(100% + 56px);
  height: 88px;
  margin-top: clamp(55px, 15dvh, 150px);
}
.wave {
  position: absolute;
  inset: 12px 0;
  width: 100%;
  height: 64px;
  overflow: visible;
}
.wave path {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
}
.record-button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid #738d7f;
  background: #fffdf9;
  box-shadow: 0 3px 7px #0002;
}
.record-button span {
  display: block;
  width: 35px;
  height: 35px;
  background: var(--sage);
  border-radius: 50%;
}
.record-button.recording span {
  background: var(--coral);
}
.recording ~ * {
  color: var(--coral);
}
.record-copy {
  text-align: center;
  margin-top: 32px;
}
.record-copy h1 {
  font-size: 36px;
  letter-spacing: 0.2px;
}
.record-copy p {
  font-size: 25px;
  color: #625c60;
  margin-top: 12px;
}
.record-copy small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 18px;
}
.record-hint {
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
  min-height: 19px;
}
.timer {
  display: block;
  min-height: 24px;
  font-variant-numeric: tabular-nums;
  color: #b72830;
}
.wordmark {
  color: var(--coral);
  font-size: 28px;
  text-align: center;
  margin-top: auto;
  padding-top: 28px;
}
.wordmark span {
  display: block;
  width: 32px;
  border-bottom: 2px solid var(--coral);
  margin: 2px auto 0;
}
.privacy {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  max-width: 280px;
  margin-top: 12px;
}
.visuals-screen {
  height: 100dvh;
  min-height: 650px;
  display: flex;
  flex-direction: column;
  padding-top: 42px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.transcript-heading {
  text-align: center;
  flex-shrink: 0;
}
.transcript-heading h1 {
  font-size: 29px;
  max-height: 110px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.transcript-heading .subtle {
  margin: 8px 0 0;
  max-height: 52px;
  overflow: auto;
}
.keyword-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px 0 16px;
  flex-shrink: 0;
  max-height: 112px;
  overflow-y: auto;
}
.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.keyword-chip {
  border: 1px solid var(--sage);
  background: #e5ebe4;
  border-radius: 22px;
  padding: 5px 12px;
  color: #405e4c;
  font-size: 16px;
  max-width: 240px;
  overflow-wrap: anywhere;
}
.keyword-chip[aria-pressed="false"] {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  text-decoration: line-through;
}
.keyword-plus {
  font-size: 28px;
  color: var(--sage-dark);
  flex-shrink: 0;
  min-width: 44px;
}
.keyword-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.keyword-form input {
  width: 0;
  min-width: 0;
  flex: 1;
  border: 1px solid var(--sage);
  padding: 8px;
  background: #fff8;
  border-radius: 4px;
  font-size: 16px;
}
.keyword-form button {
  color: var(--sage-dark);
}
.visual-tabs {
  justify-content: center;
  gap: 40px;
}
.results-status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  min-height: 34px;
  max-height: 68px;
  overflow: auto;
  margin: 10px 0;
  flex-shrink: 0;
}
.results-scroll {
  min-height: 100px;
  flex: 1;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: var(--sage) #e4e8e1;
  padding: 0 8px 8px 0;
}
.results-scroll::-webkit-scrollbar {
  width: 7px;
}
.results-scroll::-webkit-scrollbar-track {
  background: #e4e8e1;
  border-radius: 6px;
}
.results-scroll::-webkit-scrollbar-thumb {
  background: var(--sage);
  border-radius: 6px;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.result-card {
  min-width: 0;
  position: relative;
}
.result-tap {
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 1;
  background: #dce3da;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  min-height: 90px;
}
.result-tap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.result-tap:hover img {
  transform: scale(1.035);
}
.result-tap:disabled:after {
  content: "loading…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #f7f4eecc;
  color: var(--ink);
}
.clip-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  color: #fff;
  background: #0009;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
}
.result-source {
  display: block;
  text-align: right;
  font-size: 11px;
  min-height: 24px;
  padding: 4px 0;
  text-decoration: none;
}
.results-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 12px;
  font-size: 16px;
}
.results-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
  flex-shrink: 0;
  gap: 6px;
}
.results-actions .primary {
  min-width: 175px;
}
.upload-label {
  position: relative;
  cursor: pointer;
}
.upload-label input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.results-foot {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.results-foot .text-button {
  font-size: 13px;
}
.results-foot a {
  font-size: 12px;
  text-decoration: none;
}
.compose-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 40px;
}
.aspect-tabs {
  width: 100%;
  margin-bottom: 16px;
}
.preview-stage {
  width: 100%;
  height: min(49dvh, 440px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
}
canvas {
  display: block;
  background: #c5d0c7;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.preview-audio {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 0 10px;
}
.preview-audio button {
  font-size: 13px;
}
.preview-audio span {
  font-size: 12px;
  color: var(--muted);
}
.caption-section {
  text-align: center;
}
.caption-section > label {
  display: block;
  font-size: 23px;
  margin: 4px 0 10px;
}
.caption-section input {
  display: block;
  width: 100%;
  background: transparent;
  border: 1.5px solid #738d7f;
  border-radius: 0;
  min-height: 42px;
  font-size: 18px;
  padding: 8px;
  color: var(--ink);
}
.caption-meta {
  position: relative;
  min-height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.caption-meta > span {
  position: absolute;
  left: 0;
  color: var(--muted);
  font-size: 11px;
}
.caption-meta .text-button {
  font-size: 16px;
}
.compose-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 30px;
}
.compose-actions .primary {
  width: 145px;
}
.share-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 44px;
  gap: 8px;
}
.share-screen h1 {
  font-size: 44px;
  text-align: center;
  line-height: 1.1;
}
.socials {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}
.socials button {
  width: 65px;
  height: 65px;
  min-height: 65px;
  padding: 0;
  opacity: 1;
  color: var(--sage);
}
.socials svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linejoin: round;
}
.socials .solid {
  fill: currentColor;
  stroke: none;
}
.social-note {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0;
}
.download-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  padding-top: 25px;
  width: 100%;
}
.download-actions .primary {
  min-width: 210px;
}
.download-status {
  text-align: center;
  max-width: 100%;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0;
  min-height: 18px;
}
.back-caption {
  font-size: 13px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 15px);
  max-width: min(90vw, 450px);
  padding: 12px 18px;
  background: #353337;
  color: white;
  border-radius: 8px;
  font-size: 15px;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  z-index: 9;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (min-width: 700px) {
  .screen {
    border-inline: 1px solid #d9ddd444;
    box-shadow: 0 0 80px #9991;
  }
  .record-band {
    width: calc(100% + 56px);
  }
  .results-scroll {
    min-height: 220px;
  }
}
@media (max-height: 740px) {
  .record-screen {
    padding-top: 40px;
  }
  .yaffle-mark {
    width: 45%;
  }
  .record-band {
    margin-top: 50px;
  }
  .record-copy {
    margin-top: 20px;
  }
  .record-copy h1 {
    font-size: 32px;
  }
  .record-copy p {
    font-size: 22px;
  }
  .record-hint {
    margin-top: 12px;
  }
  .privacy {
    margin-top: 8px;
  }
  .visuals-screen {
    padding-top: 24px;
  }
  .keyword-row {
    margin: 12px 0 8px;
  }
  .share-screen {
    padding-top: 28px;
  }
  .share-screen h1 {
    font-size: 38px;
  }
  .socials {
    gap: 8px;
    margin-top: 20px;
  }
  .socials button {
    width: 50px;
    height: 50px;
    min-height: 50px;
  }
  .compose-screen {
    padding-top: 24px;
  }
  .preview-stage {
    height: 43dvh;
  }
  .compose-actions {
    padding-top: 16px;
    gap: 6px;
  }
  .download-actions {
    padding-top: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Persistent result scroll indicator, including on phones with overlay scrollbars. */
.results-shell {
  position: relative;
  flex: 1;
  min-height: 100px;
  overflow: hidden;
}
.results-shell .results-scroll {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  scrollbar-gutter: auto;
  padding-right: 16px;
}
.results-shell .results-scroll::-webkit-scrollbar {
  display: none;
}
.results-rail {
  position: absolute;
  right: 1px;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 4px;
  background: #e0e5dd;
  touch-action: none;
  cursor: pointer;
}
.results-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  min-height: 28px;
  background: #829e8d;
  border-radius: 4px;
  touch-action: none;
}
.record-band {
  margin-top: clamp(48px, 13dvh, 135px);
}
.compose-actions {
  padding-top: 20px;
  gap: 12px;
}
.share-screen {
  gap: 5px;
}
@media (max-height: 740px) {
  .record-band {
    margin-top: 45px;
  }
  .compose-actions {
    padding-top: 16px;
    gap: 6px;
  }
}
.keyword-form button {
  min-width: 44px;
}
.result-source {
  min-height: 44px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 12px;
}
.results-foot a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
/* v7.1: clear limits and optional first-party visitor counting. */
.upload-limit {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 8px 24px max(16px, env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--muted);
}
.site-footer .text-button {
  font-size: 13px;
  color: var(--muted);
}
.usage-banner {
  position: fixed;
  z-index: 20;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  padding: 20px;
  background: var(--cream);
  border: 1px solid #8b9f91;
  border-radius: 12px;
  box-shadow: 0 4px 24px #35333722;
  font-size: 14px;
  line-height: 1.45;
}
.usage-banner h2 {
  font-size: 21px;
  font-weight: 500;
  margin: 0 0 8px;
}
.usage-banner p {
  margin-bottom: 8px;
}
.usage-choices {
  display: flex;
  gap: 12px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}
.usage-choices button {
  border: 1px solid var(--sage-dark);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 15px;
  flex: 1;
  white-space: nowrap;
}
.usage-choices button:hover {
  background: #e5ebe4;
}
.usage-banner a {
  font-size: 13px;
}
.usage-banner #usageMessage:empty {
  display: none;
}

.timer {
  min-height: 36px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 500;
}
