:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18211c;
  background: #f4f7f5;
  line-height: 1.5;
  --ink: #18211c;
  --muted: #58665f;
  --surface: #fff;
  --line: #d7e0da;
  --accent: #245c45;
  --accent-dark: #174331;
  --soft: #e9f3ed;
  --warn: #7a4f00;
  --error: #8a1f1f;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
input,
select,
textarea {
  min-height: 44px;
}
button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
}
button:hover {
  background: var(--accent-dark);
}
button.secondary {
  background: #eef3f0;
  color: var(--ink);
  border: 1px solid var(--line);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
a {
  color: var(--accent-dark);
}
:focus-visible {
  outline: 3px solid #e0a100;
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -5rem;
  background: #fff;
  padding: 0.7rem 1rem;
  z-index: 10;
}
.skip-link:focus {
  top: 0.75rem;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  background: #163c2d;
  color: #fff;
}
.topbar h1 {
  margin: 0.1rem 0;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
}
.topbar .subtle {
  color: #dce9e1;
  max-width: 52rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
}
.subtle,
.help {
  color: var(--muted);
}
.context-card {
  display: flex;
  flex-direction: column;
  min-width: 14rem;
  gap: 0.15rem;
  background: #fff;
  color: var(--ink);
  padding: 0.8rem 1rem;
  border-radius: 10px;
}
.pill,
.state-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: var(--soft);
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.state-label.warning {
  background: #fff1cf;
  color: var(--warn);
}
.section-nav {
  position: sticky;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  contain: inline-size;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem clamp(0.75rem, 4vw, 3rem);
}
.section-nav a {
  white-space: nowrap;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
  border-radius: 7px;
}
.section-nav a:focus-visible,
.section-nav a:hover {
  background: var(--soft);
}
.status,
.errors {
  margin: 1rem clamp(1rem, 4vw, 3rem);
  padding: 0.75rem 1rem;
  border-radius: 8px;
}
.status {
  background: #e8f4ec;
  border: 1px solid #bbd9c5;
}
.errors {
  background: #fff0f0;
  border: 1px solid #e4b2b2;
  color: var(--error);
}
.layout {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 3rem) 3rem;
  align-items: start;
}
.queue-panel {
  position: sticky;
  top: 4.4rem;
}
.workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
.panel {
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1rem, 2vw, 1.35rem);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.panel h2 {
  margin: 0.05rem 0 0.4rem;
  font-size: 1.25rem;
}
.panel-heading > button {
  flex-shrink: 0;
  white-space: nowrap;
}
form + form {
  margin-top: 1.3rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
legend {
  font-weight: 800;
  margin-bottom: 0.65rem;
}
.form-grid {
  display: grid;
  gap: 0.8rem;
}
.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.span-two {
  grid-column: 1 / -1;
}
label {
  display: grid;
  gap: 0.25rem;
  font-weight: 650;
  min-width: 0;
}
label small,
.help {
  font-weight: 400;
  font-size: 0.86rem;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #aebbb3;
  border-radius: 7px;
  padding: 0.55rem 0.65rem;
  background: #fff;
  color: var(--ink);
}
textarea {
  resize: vertical;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 600;
  margin: 0.45rem 0;
}
.checkbox input {
  width: 1.2rem;
  min-height: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
}
.sensitive-choice {
  padding: 0.6rem;
  border: 1px solid #e5d09d;
  border-radius: 8px;
  background: #fffaf0;
}
.actions,
.action-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.form-state {
  font-size: 0.86rem;
  color: var(--muted);
}
.story-intake {
  background: linear-gradient(135deg, #fffdf7, #edf5ef);
  border-color: #c9d9ce;
}
.story-lead {
  max-width: 72ch;
  font-size: 1.03rem;
  line-height: 1.55;
}
.voice-actions button:first-child {
  min-width: 10rem;
}
#voice-playback {
  width: 100%;
  margin-top: 0.9rem;
}
.transcript-review {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.current-data,
.result-box {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.proposal-card + .proposal-card {
  border-top: 1px solid var(--line);
  margin-top: 0.8rem;
  padding-top: 0.8rem;
}
.proposal-card p {
  margin: 0.35rem 0;
}
.current-data:empty {
  display: none;
}
.animal-list {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.animal-list button {
  width: 100%;
  text-align: left;
  background: #f4f8f5;
  color: var(--ink);
  border: 1px solid var(--line);
}
.animal-list button[aria-current="true"] {
  border-color: var(--accent);
  background: var(--soft);
}
.animal-list small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.empty {
  color: var(--muted);
  font-style: italic;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  font-size: 0.8rem;
  background: #eef3f0;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  font-size: 0.85rem;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .queue-panel {
    position: static;
  }
  .topbar {
    flex-direction: column;
  }
  .context-card {
    width: 100%;
  }
}
@media (max-width: 600px) {
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
  .span-two {
    grid-column: auto;
  }
  .panel-heading {
    flex-direction: column;
  }
  .section-nav {
    padding-inline: 0.5rem;
  }
  .layout {
    padding-inline: 0.65rem;
  }
  .status,
  .errors {
    margin-inline: 0.65rem;
  }
  .topbar {
    padding-inline: 0.85rem;
  }
  .actions > button,
  .action-grid > button {
    flex: 1 1 100%;
  }
}
@media (max-width: 320px) {
  .panel {
    padding: 0.8rem;
  }
  .section-nav a {
    padding: 0.4rem 0.5rem;
  }
  .topbar h1 {
    font-size: 1.55rem;
  }
}

/* Critterfolio application visual system */
:root {
  --cream: #f6f1e7;
  --cream-deep: #eadfc9;
  --forest: #173f33;
  --forest-2: #245c45;
  --gold: #d5a447;
  --ink-soft: #384a41;
}
body {
  background: radial-gradient(circle at 85% -10%, #efe0b9 0, transparent 28rem), var(--cream);
}
.brand-title {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.brand-title img,
.brand-lockup img {
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}
.header-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}
.quiet-button {
  background: #eef4ef !important;
  color: var(--forest) !important;
  border: 1px solid #b8cabf !important;
}
.trust-ribbon {
  margin: 1rem clamp(1rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: #fffaf0;
  border: 1px solid #dfcca1;
  border-radius: 12px;
  color: var(--forest);
}
.trust-ribbon a {
  font-weight: 800;
}
.supporter-invite {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(135deg, #fffaf0, #edf4ee);
}
.button-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}
.button-link.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--forest);
}
.emergency-panel {
  border-color: #c8b273;
  background: linear-gradient(180deg, #fff, #fffaf0 160%);
}
.animal-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0;
}
.animal-pick {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.55rem;
  background: #fff;
}
.qr-result {
  text-align: center;
}
.qr-art {
  max-width: 420px;
  margin: 0.8rem auto;
}
.qr-art svg {
  width: 100%;
  height: auto;
  display: block;
}
.qr-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.danger-button {
  background: #7d2727;
}
.qr-trademark-note {
  font-size: 0.7rem;
  color: var(--muted);
}
.app-footer,
.public-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem clamp(1rem, 4vw, 3rem);
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--muted);
}
.app-footer nav a,
.public-footer a {
  margin-right: 0.7rem;
}
.release-note {
  font-size: 0.78rem;
}
.public-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  background: var(--forest);
  color: #fff;
}
.public-topbar a {
  color: #fff;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 900;
  font-size: 1.2rem;
  text-decoration: none;
}
.public-topbar nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.story-shell {
  width: min(920px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
  display: grid;
  gap: 1.2rem;
}
.story-hero,
.privacy-hero,
.supporter-hero,
.story-card,
.dedication-card,
.trust-card,
.privacy-boundary,
.legal-note {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.2rem, 4vw, 2.4rem);
  box-shadow: 0 10px 30px rgba(23, 63, 51, 0.06);
}
.story-hero,
.privacy-hero,
.supporter-hero {
  background: linear-gradient(135deg, #fffaf0, #edf4ee);
}
.story-hero h1,
.privacy-hero h1,
.supporter-hero h1 {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1.02;
  margin: 0.2rem 0 1rem;
  letter-spacing: -0.035em;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
}
.dedication-card {
  border-color: #d7bd7a;
  background: linear-gradient(180deg, #fff, #fffaf0);
}
.signature {
  font-family: Georgia, serif;
  font-size: 1.25rem;
}
.legal-note {
  background: #fff7df;
}
.privacy-boundary {
  border-left: 5px solid var(--gold);
}
.supporter-placeholder {
  padding: 1rem;
  border: 1px dashed #b9c5bd;
  border-radius: 10px;
  color: var(--muted);
}
body[data-visibility="sunlight"] {
  --ink: #000;
  --muted: #202020;
  --surface: #fff;
  --line: #111;
  background: #fff;
  color: #000;
}
body[data-visibility="sunlight"] .panel,
body[data-visibility="sunlight"] .status,
body[data-visibility="sunlight"] .current-data,
body[data-visibility="sunlight"] .result-box {
  box-shadow: none;
  border-width: 2px;
  background: #fff;
}
body[data-visibility="sunlight"] .topbar {
  background: #000;
  color: #fff;
}
body[data-visibility="sunlight"] button {
  border: 2px solid #000;
  font-weight: 900;
}
body[data-visibility="sunlight"] .subtle,
body[data-visibility="sunlight"] .help,
body[data-visibility="sunlight"] .form-state {
  color: #111;
}
body[data-visibility="sunlight"] input,
body[data-visibility="sunlight"] select,
body[data-visibility="sunlight"] textarea {
  border: 2px solid #000;
  background: #fff;
}
@media (max-width: 760px) {
  .trust-ribbon {
    grid-template-columns: 1fr;
  }
  .supporter-invite {
    align-items: stretch;
    flex-direction: column;
  }
  .public-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .story-shell {
    width: min(100% - 1.2rem, 920px);
  }
}
@media print {
  .section-nav,
  .header-actions,
  .trust-ribbon,
  .supporter-invite,
  .app-footer,
  #status,
  #errors {
    display: none !important;
  }
  .panel {
    box-shadow: none;
  }
}

/* Handheld intrinsic-width containment */
.layout,
.queue-panel,
.workspace,
.panel,
.panel > *,
form,
fieldset {
  min-width: 0;
  max-width: 100%;
}
.panel,
.current-data,
.result-box,
.help,
.subtle {
  overflow-wrap: anywhere;
}
.section-nav {
  width: 100%;
  max-width: 100vw;
  overscroll-behavior-inline: contain;
}
@media (max-width: 600px) {
  .layout {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace,
  .panel {
    width: 100%;
  }
}

/* Animal-photo identity surface */
.animal-summary-grid {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}
.profile-photo-shell {
  width: 112px;
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}
.profile-photo-shell img,
.photo-card img,
.photo-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
}
.photo-panel {
  background: linear-gradient(135deg, #fffdf7, #eef6f0);
}
.photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}
.photo-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}
.photo-picker input {
  margin-top: 0.25rem;
}
.photo-preview-wrap {
  width: min(100%, 360px);
  aspect-ratio: 4 / 3;
  margin: 1rem 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.photo-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.photo-card img {
  aspect-ratio: 4 / 3;
}
.photo-card-meta {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
}
.photo-card-meta strong {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .animal-summary-grid {
    grid-template-columns: 84px minmax(0, 1fr);
  }
  .profile-photo-shell {
    width: 84px;
    border-radius: 18px;
  }
  .photo-picker-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Humane, progressive animal profile */
.profile-home {
  border-color: #c9d9ce;
  background: linear-gradient(145deg, #fffdf7, #f3f8f4);
  padding: clamp(1.1rem, 3vw, 2rem);
}
.profile-home .animal-summary-grid {
  grid-template-columns: clamp(96px, 18vw, 160px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 1.6rem);
}
.profile-home .profile-photo-shell {
  width: clamp(96px, 18vw, 160px);
  border-radius: 24px;
}
.profile-home #animal-heading {
  font-size: clamp(1.8rem, 5vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.profile-story {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}
.profile-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.62rem 0.85rem;
  border: 1px solid #bfd0c5;
  border-radius: 999px;
  background: #fff;
  color: var(--forest);
  font-weight: 800;
  text-decoration: none;
}
.profile-actions a:hover,
.profile-actions a:focus-visible {
  background: var(--soft);
}
.profile-glance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.glance-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem;
  background: rgba(255, 255, 255, 0.82);
}
.glance-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}
.glance-card p,
.glance-card ul {
  margin: 0.25rem 0 0.7rem;
  color: var(--ink-soft);
}
.glance-card ul {
  padding-left: 1.1rem;
}
.glance-card a {
  font-weight: 800;
}
.advanced-details {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf8;
  padding: 0.8rem;
}
.advanced-details > summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--forest);
}
.advanced-details[open] > summary {
  margin-bottom: 0.8rem;
}
.more-tools {
  background: #f7faf8;
}
.more-tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}
.more-tool-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-weight: 750;
  text-decoration: none;
}
.advanced-panel {
  display: none;
  scroll-margin-top: 4.8rem;
}
.advanced-panel:target {
  display: block;
}
.quick-uncertainty {
  align-self: end;
}
@media (max-width: 700px) {
  .profile-glance {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-actions a {
    flex: 1 1 auto;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .profile-home .animal-summary-grid {
    grid-template-columns: 84px minmax(0, 1fr);
  }
  .profile-home .profile-photo-shell {
    width: 84px;
    border-radius: 18px;
  }
  .profile-home #animal-heading {
    font-size: clamp(1.6rem, 9vw, 2.3rem);
  }
  .profile-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

.auth-gate {
  max-width: 880px;
  margin: 1.25rem auto 2rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1.4rem 2rem;
  align-items: start;
}
.auth-copy h2 {
  margin: 0.2rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.98;
}
.auth-copy .lede {
  font-size: 1.1rem;
  line-height: 1.55;
}
.auth-form {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}
.auth-existing {
  grid-column: 2;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.auth-links {
  grid-column: 1 / -1;
  margin: 0;
}
@media (max-width: 700px) {
  .auth-gate {
    grid-template-columns: 1fr;
  }
  .auth-existing {
    grid-column: 1;
  }
}
