:root {
  --night: #120f0d;
  --night-2: #1b1612;
  --ink: #231c18;
  --ink-soft: #6e6258;
  --cream: #f3ebe0;
  --paper: #fff8ef;
  --card: #fff8ef;
  --line: #e2d3c2;
  --brand: #c9784a;
  --brand-dark: #a85b35;
  --brand-soft: #f4e2d2;
  --gold: #e0b56a;
  --gold-soft: #f4e4c0;
  --dark: #120f0d;
  --dark-2: #1b1612;
  --ok: #4c7a52;
  --warn: #b8863b;
  --danger: #b0473f;
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-display: "Cormorant Garamond", "Noto Serif TC", serif;
  --radius: 4px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(201, 120, 74, 0.08), transparent 55%),
    var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.7;
  letter-spacing: 0.01em;
}
::selection { background: var(--gold); color: var(--night); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, .section-title {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.28;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px;
  background: rgba(18, 15, 13, 0.9);
  color: #f6efe6;
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid rgba(224, 181, 106, 0.16);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}
.brand-mark {
  width: 22px; height: 22px;
  color: var(--gold);
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(224, 181, 106, 0.45));
  animation: twinkle 3.6s ease-in-out infinite;
}
.brand-star { color: var(--gold); }
.topnav { display: flex; gap: 26px; font-size: 0.86rem; letter-spacing: 0.08em; }
.topnav a {
  position: relative;
  color: rgba(246, 239, 230, 0.78);
  padding: 4px 0;
}
.topnav a:hover { color: #fff; }
.topnav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.topnav a:hover::after { transform: scaleX(1); }
.admin-link { opacity: 0.55; letter-spacing: 0.04em; }
.nav-toggle {
  display: none; background: none; border: none;
  color: #f6efe6; font-size: 1.35rem; line-height: 1;
}

.app-tabbar { display: none; }

@media (max-width: 760px) {
  .topbar { padding: 12px 16px; }
  .topnav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(18, 15, 13, 0.97);
    flex-direction: column; padding: 8px 20px 20px; gap: 14px;
    display: none; border-bottom: 1px solid rgba(224, 181, 106, 0.16);
  }
  .topnav.open { display: flex; }
  .nav-toggle { display: block; }
}

main { max-width: 1180px; margin: 0 auto; padding: 28px 22px 80px; min-height: 62vh; }
body.is-home main { max-width: none; padding: 0 0 0; min-height: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

.kicker {
  margin: 0 0 12px;
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  color: var(--gold);
  font-weight: 500;
}
.lede { color: var(--ink-soft); max-width: 38em; margin: 10px 0 0; font-size: 0.98rem; }
.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-dark); font-weight: 600; font-size: 0.9rem;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.text-link:hover { color: var(--ink); }

.hero {
  background: var(--night);
  color: #f6efe6;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.hero-cinematic {
  position: relative;
  min-height: min(92vh, 920px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 5% -35% 38% -35%;
  opacity: .2;
  background:
    radial-gradient(ellipse at 18% 55%, rgba(255,255,255,.34) 0 7%, transparent 24%),
    radial-gradient(ellipse at 48% 35%, rgba(255,255,255,.22) 0 9%, transparent 27%),
    radial-gradient(ellipse at 78% 62%, rgba(255,255,255,.26) 0 8%, transparent 25%);
  filter: blur(18px);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: cloud-drift 34s linear infinite;
}
.hero-media::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .62;
  background-image:
    radial-gradient(circle at 16% 18%, rgba(255,244,205,.95) 0 1px, transparent 1.7px),
    radial-gradient(circle at 29% 11%, rgba(255,255,255,.8) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 68% 19%, rgba(255,239,185,.9) 0 1px, transparent 1.8px),
    radial-gradient(circle at 84% 12%, rgba(255,255,255,.76) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 74% 31%, rgba(255,239,185,.68) 0 .7px, transparent 1.4px);
  pointer-events: none;
  animation: sky-twinkle 5.8s ease-in-out infinite alternate;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  animation: cinematic-breathe 22s ease-in-out infinite alternate;
}
.living-sky {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.living-sky i {
  position: absolute;
  left: var(--star-x);
  top: var(--star-y);
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 50%;
  background: #fff8dc;
  box-shadow: 0 0 4px rgba(255, 242, 194, .95), 0 0 11px rgba(224, 181, 106, .5);
  opacity: .22;
  animation: living-star var(--star-speed) ease-in-out var(--star-delay) infinite;
}
.living-sky i:nth-child(5n) { background: #e8f2ff; box-shadow: 0 0 5px rgba(216, 235, 255, .9); }
.living-sky i:nth-child(7n) { filter: blur(.35px); }
.sky-meteor {
  position: absolute;
  top: 17%;
  left: 72%;
  width: 82px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 220, .95));
  filter: drop-shadow(0 0 4px rgba(255, 237, 181, .75));
  opacity: 0;
  transform: rotate(-25deg) translate3d(0, 0, 0);
  transform-origin: right center;
  animation: sky-meteor 15s cubic-bezier(.2,.65,.25,1) 5.5s infinite;
}
.hero-veil {
  position: absolute; z-index: 2; inset: 0;
  background:
    linear-gradient(to top, rgba(12, 10, 8, 0.94) 0%, rgba(12, 10, 8, 0.42) 46%, rgba(12, 10, 8, 0.18) 72%, rgba(12, 10, 8, 0.28) 100%),
    linear-gradient(90deg, rgba(12, 10, 8, 0.45) 0%, transparent 48%);
}
.hero-copy {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 22px 72px;
}
.hero-copy h1 {
  font-size: clamp(2.05rem, 5.6vw, 4.35rem);
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.hero-copy h1 span { display: block; }
.hero-brand {
  margin: 18px 0 6px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  color: rgba(246, 239, 230, 0.72);
}
.hero .slogan {
  display: flex; gap: 16px; flex-wrap: wrap;
  color: var(--gold);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.42em;
  margin: 0 0 14px;
  font-size: 0.95rem;
}
.hero .lede { color: #d8cec4; max-width: 28em; }
.hero-cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.scroll-hint {
  position: absolute;
  right: 28px; bottom: 28px;
  z-index: 2;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: rgba(246, 239, 230, 0.7);
}
.scroll-hint::before {
  content: "";
  display: block;
  width: 1px; height: 36px;
  margin: 0 auto 8px;
  background: linear-gradient(to bottom, transparent, var(--gold));
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.btn.secondary {
  background: transparent;
  border-color: rgba(34, 28, 24, 0.28);
  color: var(--ink);
}
.btn.secondary:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.hero .btn.secondary,
.cinematic-band .btn.secondary,
.dark-panel .btn.secondary {
  border-color: rgba(255, 255, 255, 0.42);
  color: #f6efe6;
}
.hero .btn.secondary:hover,
.cinematic-band .btn.secondary:hover,
.dark-panel .btn.secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn.ghost {
  background: transparent;
  color: var(--brand-dark);
  border-color: rgba(168, 91, 53, 0.45);
}
.btn.ghost:hover { background: var(--brand-soft); }
.btn.small { padding: 6px 14px; font-size: 0.82rem; }
.btn.block, form.stack .btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.page-head { margin: 8px 0 28px; max-width: 720px; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0; }
.section-title { font-size: 1.45rem; margin: 0 0 6px; }
.section-sub { color: var(--ink-soft); margin: 0 0 18px; font-size: 0.92rem; }

.ticker {
  overflow: hidden;
  border-block: 1px solid rgba(224, 181, 106, 0.22);
  background: var(--night);
  color: var(--gold-soft);
  padding: 12px 0;
}
.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marquee 32s linear infinite;
  font-size: 0.78rem;
  letter-spacing: 0.38em;
  white-space: nowrap;
}
.ticker span { padding: 0 28px; }

.tonight { padding: 72px 0 24px; }
@media (min-width: 900px) {
  .tonight .animal-grid { grid-template-columns: repeat(4, 1fr); }
}
.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  align-items: end;
  margin-bottom: 28px;
}
.section-head .kicker,
.section-head h2,
.section-head .lede { grid-column: 1; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head .text-link { grid-column: 2; grid-row: 2; }
.home-count { color: var(--ink-soft); font-size: 0.86rem; margin: 0 0 18px; }

.story-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: center;
  padding: 56px 0 24px;
}
.story-split figure {
  margin: 0;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 24px 60px rgba(34, 24, 18, 0.18);
}
.story-split img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.story-split h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0 0 14px; }
.story-split p { color: var(--ink-soft); }
.principle-list {
  list-style: none;
  padding: 18px 0 0;
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}
.principle-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: baseline;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.principle-list strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--ink);
}

.bento {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  padding: 36px 0 12px;
}
.bento-item {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 26px 22px 24px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.bento-item:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}
.bento-item.wide {
  grid-column: 1 / 2; grid-row: 1 / 3; min-height: 354px;
  background:
    linear-gradient(165deg, rgba(18, 15, 13, 0.35), rgba(18, 15, 13, 0.82)),
    url("/images/stars-texture.jpg") center/cover;
  color: #f6efe6;
  border-color: transparent;
}
.bento-item.wide h3 { font-size: 2rem; }
.bento-num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold);
  letter-spacing: 0.12em;
}
.bento-item h3 { margin: 18px 0 8px; font-size: 1.28rem; }
.bento-item p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.bento-item.wide p { color: #d8cec4; }

.cinematic-band {
  position: relative;
  min-height: min(78vh, 760px);
  display: flex;
  align-items: flex-end;
  margin-top: 56px;
  overflow: hidden;
}
.cinematic-band img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 62% 34%;
}
.cinematic-band .band-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12, 10, 8, 0.9) 0%, rgba(12, 10, 8, 0.2) 55%, rgba(12, 10, 8, 0.15) 100%);
}
.cinematic-band .band-copy {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 22px 64px;
  color: #f6efe6;
}
.cinematic-band h2 { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0 0 10px; }
.cinematic-band .lede { color: #d8cec4; margin-bottom: 18px; max-width: 28em; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 20px 0 30px; }
.pillar-card { text-align: left; padding: 22px 18px; }
.pillar-num {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.pillar-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.pillar-card p { margin: 0; font-size: 0.82rem; color: var(--ink-soft); }

.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.filter-toggle { display: none; }
.filter-more { display: contents; }
.filters input[type="text"], .filters select {
  padding: 10px 12px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
}
.filters input[type="text"] { flex: 1 1 220px; }

.animal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.animal-card {
  overflow: hidden; padding: 0;
  display: flex; flex-direction: column;
  background: var(--paper);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.animal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(34, 24, 18, 0.12);
}
.photo-wrap { position: relative; }
.animal-card .photo {
  width: 100%; aspect-ratio: 4/5;
  object-fit: cover;
  background: var(--brand-soft);
  filter: saturate(0.92) contrast(1.04);
}
.animal-card:hover .photo { filter: saturate(1.05) contrast(1.06); }
.kind-chip {
  position: absolute;
  left: 10px; top: 10px;
  background: rgba(18, 15, 13, 0.72);
  color: var(--gold-soft);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  backdrop-filter: blur(8px);
}
.animal-card .photo.placeholder,
.detail-photo .photo.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 2rem; color: var(--brand);
  aspect-ratio: 4/5;
}
.photo.placeholder .placeholder-label { font-size: 0.74rem; color: var(--brand-dark); font-weight: 600; }
.animal-card .body { padding: 14px 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.animal-card h3 { margin: 0; font-size: 1.02rem; }
.animal-card .meta { font-size: 0.8rem; color: var(--ink-soft); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid rgba(168, 91, 53, 0.28);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.error-state { text-align: center; padding: 24px; color: var(--danger); background: #fbeceb; border-radius: var(--radius); }
.stale-banner { background: #fbf1de; color: var(--warn); border-radius: var(--radius); padding: 8px 14px; font-size: 0.82rem; margin-bottom: 14px; }

.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 22px; align-items: center; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 32px; }
.detail-grid .section-title { font-size: clamp(1.55rem, 3vw, 2.15rem); }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-photo { border-radius: 2px; overflow: hidden; box-shadow: 0 18px 40px rgba(34, 24, 18, 0.12); }
.detail-photo img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.bio-box {
  background: var(--brand-soft);
  border-left: 3px solid var(--gold);
  border-radius: 0;
  padding: 16px 18px;
  margin: 16px 0;
  font-size: 0.98rem;
  font-family: var(--font-serif);
  line-height: 1.8;
}
.field-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0; font-size: 0.88rem; }
.field-list div span { color: var(--ink-soft); display: block; font-size: 0.72rem; letter-spacing: 0.12em; }

.journey-track { display: grid; gap: 16px; margin: 18px 0; }
.act-card {
  border-left: 2px solid var(--gold);
  padding: 18px 20px;
  background: var(--paper);
}
.act-card h3 { margin: 0 0 8px; font-size: 1.02rem; color: var(--brand-dark); }
.act-card p { margin: 0; font-size: 0.95rem; }
.journey-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.journey-progress span { flex: 1; height: 2px; background: var(--line); }
.journey-progress span.done { background: var(--gold); }

form.stack { display: grid; gap: 12px; max-width: 480px; }
form.stack .btn { width: max-content; }
form.stack label { font-size: 0.85rem; color: var(--ink-soft); display: grid; gap: 4px; }
form.stack input, form.stack select, form.stack textarea {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font: inherit; background: rgba(255,255,255,.88);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
form.stack input:focus, form.stack select:focus, form.stack textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(201,120,74,.11); background: #fff; }
form.stack textarea { resize: vertical; min-height: 70px; }

.dark-panel {
  position: relative;
  background: var(--night) url("/images/stars-texture.jpg") center/cover;
  color: #f6efe6;
  border-radius: 2px;
  padding: 36px 28px;
  margin: 28px 0;
  overflow: hidden;
}
.dark-panel::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(12, 10, 8, 0.72);
}
.dark-panel > * { position: relative; z-index: 1; }
.dark-panel h3 { margin-top: 0; color: var(--gold); font-size: 1.45rem; }

.hospital-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 16px 0; }
.hospital-card h3 { margin: 0 0 4px; }
.hospital-card p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }

.voucher-result { margin-top: 14px; padding: 14px; border-radius: var(--radius); }
.voucher-result.unused { background: #eaf3e8; color: var(--ok); }
.voucher-result.redeemed { background: #f2e6df; color: var(--brand-dark); }
.voucher-result.error { background: #fbeceb; color: var(--danger); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.tabs button.active { background: var(--night); color: #fff; border-color: var(--night); }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; background: var(--paper); overflow: hidden; }
table.admin-table th, table.admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.admin-table th { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.status-pill { padding: 2px 10px; border-radius: 999px; font-size: 0.74rem; background: var(--line); }
.status-pill.approved, .status-pill.published, .status-pill.done, .status-pill.redeemed { background: #dcefdc; color: var(--ok); }
.status-pill.rejected, .status-pill.cancelled, .status-pill.expired { background: #f6dbd8; color: var(--danger); }
.status-pill.in_progress, .status-pill.scheduled, .status-pill.contacted { background: #fbeccb; color: var(--warn); }

.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.guide-block { margin-bottom: 22px; }
.guide-block h3 { color: var(--brand-dark); }
.guide-block summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 600; color: var(--brand-dark); list-style: none; }
.guide-block summary::-webkit-details-marker { display: none; }
.guide-block summary::after { content: "+"; display: grid; place-items: center; width: 30px; aspect-ratio: 1; border-radius: 50%; background: var(--brand-soft); font-size: 1.15rem; transition: transform .25s ease, background .25s ease; }
.guide-block[open] summary::after { transform: rotate(45deg); background: var(--gold-soft); }
.guide-content { margin-top: 18px; animation: guide-open .28s cubic-bezier(.2,.72,.25,1) both; }

.page-visual, .content-poster { position: relative; overflow: hidden; background: var(--night); color: #f6efe6; }
.page-visual { min-height: 300px; margin: -28px -22px 24px; display: flex; align-items: flex-end; }
.page-visual img, .content-poster img { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: cinematic-breathe 24s ease-in-out infinite alternate; }
.page-visual::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 4% -40% 35%;
  opacity: .16;
  background:
    radial-gradient(ellipse at 20% 55%, rgba(255,255,255,.42) 0 8%, transparent 25%),
    radial-gradient(ellipse at 55% 35%, rgba(255,255,255,.28) 0 10%, transparent 28%),
    radial-gradient(ellipse at 84% 62%, rgba(255,255,255,.32) 0 8%, transparent 24%);
  filter: blur(16px);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: cloud-drift 38s linear infinite;
}
.content-poster::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .72;
  background-image:
    radial-gradient(circle at 13% 20%, rgba(255,246,208,.95) 0 1px, transparent 1.8px),
    radial-gradient(circle at 35% 12%, rgba(255,255,255,.8) 0 .8px, transparent 1.5px),
    radial-gradient(circle at 64% 22%, rgba(255,236,170,.9) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 88% 16%, rgba(255,255,255,.75) 0 .8px, transparent 1.5px);
  pointer-events: none;
  animation: sky-twinkle 6.4s ease-in-out infinite alternate-reverse;
}
.page-visual::after, .content-poster::after { content: ""; position: absolute; z-index: 2; inset: 0; background: linear-gradient(to top, rgba(12,10,8,.88), rgba(12,10,8,.08) 72%); }
.page-visual-copy, .poster-copy { position: relative; z-index: 3; padding: 28px 22px; }
.page-visual .page-head { margin: 0; }
.page-visual .lede { color: #e6ddd3; }
.content-poster { min-height: calc(100svh - 150px); margin: -28px -22px -80px; display: flex; align-items: flex-end; }
.poster-copy { max-width: 34rem; padding-bottom: 72px; }
.poster-copy h1 { margin: 0 0 12px; font-size: clamp(2rem, 6vw, 4rem); line-height: 1.2; }
.poster-copy p:last-child { color: #e6ddd3; }
.health-card { position: relative; margin: 0 auto 24px; padding: 22px; max-width: 620px; overflow: hidden; background: linear-gradient(145deg, rgba(255,248,239,.98), rgba(247,233,218,.95)); border: 1px solid rgba(201,120,74,.25); border-radius: 22px; box-shadow: 0 18px 48px rgba(54,38,28,.12); }
.health-card::before { content: ""; position: absolute; width: 180px; height: 180px; right: -86px; top: -96px; border-radius: 50%; background: radial-gradient(circle, rgba(224,181,106,.28), transparent 68%); pointer-events: none; }
.health-card > * { position: relative; }
.health-card-head, .prevention-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.health-card h2 { margin: 0; }
.pet-qr { width: 76px; aspect-ratio: 1; padding: 8px; background: repeating-conic-gradient(#120f0d 0 25%, #fff8ef 0 50%) 50% / 16px 16px; border: 5px solid #fff8ef; outline: 1px solid var(--line); }
.pet-qr span { display: block; width: 22px; aspect-ratio: 1; background: var(--paper); border: 5px solid var(--night); }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 22px 0; }
.identity-grid div { font-weight: 600; }
.identity-grid span, .prevention-row span:first-child { display: block; margin-bottom: 3px; color: var(--ink-soft); font-size: .72rem; }
.record-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.record-tabs button { appearance: none; margin-bottom: -1px; padding: 10px 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-soft); font-weight: 600; transition: color .2s ease, border-color .2s ease; }
.record-tabs button.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.record-panel { display: flex; align-items: flex-start; gap: 10px; min-height: 70px; padding: 16px 2px 10px; color: var(--ink-soft); }
.record-panel strong { color: var(--ink); font-size: .9rem; }
.record-panel p { margin: 2px 0 0; font-size: .78rem; line-height: 1.5; }
.record-dot { width: 8px; aspect-ratio: 1; margin-top: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(224,181,106,.16); }
.record-panel-enter { animation: record-panel-enter .24s ease both; }
.prevention-row { padding-top: 18px; }
.feature-note { max-width: 620px; margin: 0 auto 24px; }
.feature-note h2 { font-size: 1.3rem; }
.feature-note p { color: var(--ink-soft); }
.reminder-card { max-width: 620px; margin: 0 auto 24px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--night); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); z-index: 50;
}
.toast.error { background: var(--danger); }

.reveal-ready { opacity: 0; transform: translateY(16px); transition: opacity .5s ease var(--reveal-delay, 0ms), transform .55s cubic-bezier(.2,.72,.25,1) var(--reveal-delay, 0ms); }
.reveal-ready.is-visible { opacity: 1; transform: translateY(0); }

@keyframes record-panel-enter { from { opacity: .15; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes guide-open { from { opacity: .2; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cloud-drift { from { transform: translate3d(-5%, 0, 0); } to { transform: translate3d(28%, -2%, 0); } }
@keyframes sky-twinkle { 0% { opacity: .36; filter: brightness(.86); } 38% { opacity: .72; filter: brightness(1.12); } 70% { opacity: .48; filter: brightness(.94); } 100% { opacity: .82; filter: brightness(1.2); } }
@keyframes living-star {
  0%, 100% { opacity: .18; transform: scale(.72); }
  42% { opacity: .92; transform: scale(1.18); }
  63% { opacity: .38; transform: scale(.9); }
}
@keyframes sky-meteor {
  0%, 70%, 100% { opacity: 0; transform: rotate(-25deg) translate3d(0, 0, 0) scaleX(.35); }
  72% { opacity: .9; }
  78% { opacity: 0; transform: rotate(-25deg) translate3d(-190px, 80px, 0) scaleX(1); }
}
@keyframes cinematic-breathe { from { transform: scale(1.005); } to { transform: scale(1.035); } }

.sitefooter {
  position: relative;
  color: #d8cec4;
  font-size: 0.84rem;
  background: var(--night) url("/images/stars-texture.jpg") center/cover;
  border-top: 1px solid rgba(224, 181, 106, 0.18);
  overflow: hidden;
}
.sitefooter::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(12, 10, 8, 0.78);
}
.footer-inner {
  position: relative; z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 22px 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}
.footer-brand strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: #f6efe6;
  letter-spacing: 0.12em;
  margin: 8px 0 8px;
}
.footer-brand p { margin: 0; color: var(--gold); letter-spacing: 0.18em; }
.footer-links { display: grid; gap: 8px; align-content: start; }
.footer-links a:hover { color: var(--gold); }
.footer-meta { color: rgba(216, 206, 196, 0.8); }
.footer-meta a:hover { color: var(--gold); }
.footer-tagline { margin-top: 6px; color: var(--gold); font-weight: 600; }

.principle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.principle-grid .card { text-align: center; border-color: var(--gold); color: var(--ink); font-size: 1.05rem; padding: 18px 14px; }

.spinner-row { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.spinner-row::before {
  content: "★";
  display: block;
  color: var(--gold);
  font-size: 1.35rem;
  margin-bottom: 8px;
  animation: twinkle 1.4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 900px) {
  .story-split { grid-template-columns: 1fr; gap: 24px; }
  .story-split img { aspect-ratio: 16/10; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento-item.wide { grid-column: 1 / -1; grid-row: auto; min-height: 220px; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .section-head { grid-template-columns: 1fr; }
  .section-head .text-link { grid-column: 1; grid-row: auto; }
  .scroll-hint { display: none; }
}

@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .hero-copy { padding: 40px 18px 48px; }
  .animal-card .photo { aspect-ratio: 4/3; }
  .filters input[type="text"] { flex: 1 1 100%; }
  .filters select { flex: 1 1 calc(50% - 8px); min-width: 0; }
  details.card summary { white-space: normal; display: block; }
}

/* Capacitor iOS App layer: the public website keeps its existing layout. */
body.native-app {
  --app-top: calc(46px + env(safe-area-inset-top));
  --app-bottom: calc(72px + env(safe-area-inset-bottom));
  background: #f7efe5;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.native-app .grain { opacity: 0.035; }
body.native-app .topbar {
  position: fixed;
  inset: 0 0 auto;
  height: var(--app-top);
  padding: env(safe-area-inset-top) 18px 0;
  background: rgba(18, 15, 13, 0.94);
  border-bottom-color: rgba(224, 181, 106, 0.12);
  z-index: 60;
}
body.native-app .topbar .brand { margin: auto; font-size: 1rem; }
body.native-app .topbar .brand-mark { width: 19px; height: 19px; }
body.native-app .topnav,
body.native-app .nav-toggle,
body.native-app .sitefooter { display: none !important; }
body.native-app main {
  width: 100%;
  max-width: none;
  min-height: 100svh;
  padding: calc(var(--app-top) + 20px) 16px calc(var(--app-bottom) + 28px);
}
body.native-app.is-home main { padding: var(--app-top) 0 var(--app-bottom); }

body.native-app .app-tabbar {
  position: fixed;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  inset: auto 0 0;
  min-height: var(--app-bottom);
  padding: 8px 8px env(safe-area-inset-bottom);
  background: rgba(255, 248, 239, 0.93);
  border-top: 1px solid rgba(98, 74, 58, 0.12);
  box-shadow: 0 -10px 30px rgba(54, 38, 28, 0.08);
  backdrop-filter: blur(22px) saturate(1.35);
  z-index: 70;
}
body.native-app .app-tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 52px;
  color: #8b7e73;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.15;
  transition: color .2s ease, transform .2s ease;
}
body.native-app .app-tabbar a.active { color: var(--brand-dark); transform: translateY(-1px); }
body.native-app .app-tabbar a:active { transform: scale(.92); }
body.native-app .app-tabbar a.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(224, 181, 106, .8);
}
body.native-app .tab-icon { font-family: var(--font-sans); font-size: 1.38rem; line-height: 1.2; }

body.native-app .hero-cinematic { min-height: calc(100svh - var(--app-top)); border-radius: 0; }
body.native-app .hero-copy { display: none; }
body.native-app .hero-media img { object-position: 58% 48%; }
body.native-app .hero-veil {
  background:
    linear-gradient(to top, rgba(12, 10, 8, .78) 0%, rgba(12, 10, 8, .28) 46%, rgba(12, 10, 8, .1) 72%, rgba(12, 10, 8, .18) 100%),
    linear-gradient(90deg, rgba(12, 10, 8, .14) 0%, transparent 48%);
}
body.native-app .hero-copy .kicker {
  display: none;
}
body.native-app .hero-copy .kicker,
body.native-app .hero-copy h1,
body.native-app .hero-brand,
body.native-app .hero .slogan,
body.native-app .hero-copy .lede {
  width: 62%;
  max-width: 250px;
  margin-left: auto;
  text-align: right;
}
body.native-app .hero-copy h1 {
  font-size: clamp(.92rem, 4.3vw, 1.2rem);
  line-height: 1.34;
}
body.native-app .hero-copy h1 span { white-space: normal; overflow-wrap: anywhere; }
body.native-app .hero-brand { margin-top: 12px; margin-bottom: 3px; font-size: .68rem; }
body.native-app .hero .slogan { justify-content: flex-end; gap: 8px; margin-bottom: 9px; font-size: .64rem; }
body.native-app .hero-copy .lede { margin-top: 6px; font-size: .68rem; line-height: 1.65; }
body.native-app .hero-cta { margin-top: 14px; gap: 9px; }
body.native-app .hero-cta .btn { padding: 10px 17px; font-size: .78rem; }
body.native-app .cinematic-band .kicker,
body.native-app .cinematic-band h2,
body.native-app .cinematic-band .lede {
  width: 64%;
  max-width: 260px;
  margin-left: auto;
  text-align: right;
}
body.native-app .cinematic-band img { object-position: 50% 34%; }
body.native-app .cinematic-band .kicker { font-size: .58rem; }
body.native-app .cinematic-band h2 { font-size: clamp(1.25rem, 5.5vw, 1.65rem); line-height: 1.35; }
body.native-app .cinematic-band .lede { font-size: .7rem; line-height: 1.65; }
body.native-app .scroll-hint,
body.native-app .ticker { display: none; }
body.native-app .page-visual { margin: -20px -16px 20px; min-height: 270px; }
body.native-app .content-poster { margin: -20px -16px calc(-1 * (var(--app-bottom) + 28px)); min-height: calc(100svh - var(--app-top) - var(--app-bottom)); }
body.native-app .search-visual img { object-position: 50% 44%; }
body.native-app .medical-visual img { object-position: 52% 48%; }
body.native-app .support-visual img { object-position: 50% 78%; }
body.native-app .health-card { margin-inline: -2px; padding: 18px; }
body.native-app .card { border-radius: 20px; box-shadow: 0 12px 34px rgba(71,49,35,.08); }
body.native-app form.stack input,
body.native-app form.stack select,
body.native-app form.stack textarea { min-height: 48px; font-size: 16px; }
body.native-app .identity-grid { grid-template-columns: 1fr; }
body.native-app .wrap { padding: 0 16px; }
body.native-app .tonight { padding-top: 30px; }
body.native-app .story-split,
body.native-app .bento,
body.native-app .cinematic-break { display: none; }
body.native-app .animal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
body.native-app .animal-card { border-radius: 18px; overflow: hidden; box-shadow: 0 8px 24px rgba(71, 49, 35, .08); }
body.native-app .animal-card .photo-wrap {
  display: grid;
  place-items: center;
  height: clamp(190px, 54vw, 230px);
  overflow: hidden;
  background: linear-gradient(145deg, #eadfd2, #f8eee3);
}
body.native-app .animal-card .photo {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}
body.native-app .animal-card .photo.placeholder { aspect-ratio: auto; }
body.native-app .animal-card .body { padding: 11px; }
body.native-app .animal-card h3 { font-size: .92rem; }
body.native-app .animal-card .meta { font-size: .72rem; }
body.native-app .animal-card .tag-row { gap: 4px; }
body.native-app .animal-card .tag { padding: 2px 6px; font-size: .63rem; }
body.native-app .filters {
  position: sticky;
  top: calc(var(--app-top) + 8px);
  z-index: 20;
  margin: 0 -4px 18px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 248, 239, .9);
  box-shadow: 0 8px 26px rgba(72, 50, 36, .08);
  backdrop-filter: blur(18px);
}
body.native-app .filters input[type="text"] { flex-basis: 100%; border-radius: 12px; }
body.native-app .filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 600;
}
body.native-app .filter-toggle::before { content: "⌁"; margin-right: 5px; }
body.native-app .filter-more {
  display: none;
  flex: 1 1 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
body.native-app .filter-more.open { display: grid; animation: app-page-enter .22s ease both; }
body.native-app .filter-more select { width: 100%; min-width: 0; border-radius: 10px; }
body.native-app .filters .btn { flex: 0 0 auto; border-radius: 12px; }
body.native-app .detail-grid { gap: 18px; }
body.native-app .detail-photo { margin: 0 -16px; }
body.native-app .detail-photo img,
body.native-app .detail-photo .placeholder { border-radius: 0 0 24px 24px; }
body.native-app .toast { bottom: calc(var(--app-bottom) + 60px); }
body.native-app #app.page-enter { animation: app-page-enter .34s cubic-bezier(.2,.72,.25,1) both; }

@keyframes app-page-enter {
  from { opacity: .25; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.music-control {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 13px;
  color: #fff7ed;
  background: rgba(24, 18, 15, .78);
  border: 1px solid rgba(255, 239, 215, .28);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(20, 13, 9, .2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
}
.music-control[hidden] { display: none; }
.music-control-label { font-size: .72rem; letter-spacing: .08em; }
.music-control-bars { display: flex; align-items: center; gap: 2px; height: 14px; }
.music-control-bars i { display: block; width: 2px; height: 5px; background: currentColor; border-radius: 3px; }
.music-control.playing .music-control-bars i { animation: music-bar .8s ease-in-out infinite alternate; }
.music-control.playing .music-control-bars i:nth-child(2) { animation-delay: -.3s; }
.music-control.playing .music-control-bars i:nth-child(3) { animation-delay: -.55s; }
body.native-app .music-control {
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(var(--app-bottom) + 58px);
}
.lyrics-stage {
  position: fixed;
  z-index: 58;
  top: 92px;
  left: 50%;
  width: min(88vw, 720px);
  height: 168px;
  transform: translateX(-50%);
  overflow: hidden;
  padding: 0 14px;
  text-align: center;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}
.lyrics-stage[hidden] { display: none; }
.lyrics-track {
  padding: 63px 0 84px;
  will-change: transform;
  transition: transform .82s cubic-bezier(.22,.68,.2,1);
}
.lyrics-line {
  margin: 0;
  min-height: 42px;
  padding: 8px 14px;
  color: #fffaf0;
  font-family: var(--font-serif);
  font-size: clamp(.78rem, 3.4vw, .98rem);
  line-height: 1.55;
  letter-spacing: .06em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
  opacity: .28;
  transform: scale(.94);
  transition: opacity .55s ease, transform .55s ease, color .55s ease;
}
.lyrics-line.is-past { opacity: .18; }
.lyrics-line.is-active {
  color: #fffdf7;
  opacity: 1;
  transform: scale(1.06);
  font-weight: 600;
}
.lyrics-line.is-future { opacity: .42; }
body.native-app .lyrics-stage { top: calc(var(--app-top) + 18px); width: 92vw; height: 176px; }
@keyframes music-bar {
  from { height: 4px; opacity: .65; }
  to { height: 14px; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-mark, .spinner-row::before, .ticker-track { animation: none; }
  .animal-card, .bento-item, .btn { transition: none; }
  body.native-app #app.page-enter, .guide-content, .record-panel-enter { animation: none; }
  .reveal-ready { opacity: 1; transform: none; transition: none; }
  .hero-media::before, .hero-media::after, .page-visual::before, .content-poster::before,
  .hero-media img, .page-visual img, .content-poster img { animation: none; }
  .living-sky i, .sky-meteor { animation: none; }
  .living-sky i { opacity: .48; transform: none; }
  .sky-meteor { display: none; }
  .music-control-bars i { animation: none !important; }
  .lyrics-track { transition: none; }
  .lyrics-line { transition: none; }
}
