/* Self-hosted: no external request, no CSP change. Both files are variable fonts covering the
   whole weight range used here; unicode-range splits Latin from Latin Extended-A (Hungarian ő/ű etc). */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Work Sans'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('fonts/worksans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('fonts/worksans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Palette */
  --ink: #1c2e23;
  --ink-soft: #5a6a56;
  --ink-faint: #616b5d; /* 4.5:1 on the page, card and sunk panel (PLAN §22); was #8c9787 */
  --bg: #f5f1e6;
  --surface: #ffffff;
  --surface-sunk: #eee8d8;
  --border: #ded4b9;
  --forest-900: #0f251c;
  --forest-800: #163527;
  --forest-700: #1c4335;
  --forest-600: #255545;
  --forest-500: #2e6b57;
  --forest-tint: #e3ece3;
  --amber-700: #a97a2c;
  --amber-600: #c4933b;
  --amber-500: #d9a441;
  --amber-tint: #f8ebce;
  --success: #3f8f5f; --success-tint: #e1f0e4;
  --warning: #c57a22; --warning-tint: #faebd3;
  --danger: #b14a38;  --danger-tint: #f5deda;
  --info: #3b7fa6;    --info-tint: #dcebf2;
  /* Text on white, the page and the colour's own tint: the fill colours above stay for dots, borders and fills. */
  --success-text: #34774f; --warning-text: #985e1a; --danger-text: #a84635; --info-text: #336e90;
  /* The focus ring (3:1 on every surface) and the border that shows where an input is (3:1 on a card). */
  --focus: #ac7c22;
  --border-input: #9f894b;

  /* Older names kept so every existing page inherits the palette without a rewrite. */
  --text: var(--ink);
  --muted: var(--ink-soft);
  --card: var(--surface);
  --tint: var(--amber-500);
  --tint-text: #8a6424; /* links and badges: 4.5:1 also on --amber-tint; --amber-700 stays for gradients */
  --ok: var(--success);
  --bad: var(--danger);
  --info-bg: var(--info-tint);
  --radius: 14px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; }
h1 { font-size: 1.9rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
a { color: var(--tint-text); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 4px;
}
/* Skip link (PLAN §22): the first thing Tab reaches, hidden until it has the focus. */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: .6rem 1rem; border-radius: 0 0 10px 10px; background: var(--surface); color: var(--ink); font-weight: 700; }
.skip-link:focus { top: 0; outline: 2.5px solid var(--focus); outline-offset: 2px; }
main[tabindex="-1"]:focus { outline: none; }
.notice[data-error-summary]:focus { outline: 2.5px solid var(--focus); outline-offset: 2px; }
code { background: var(--surface-sunk); padding: 0 .3em; border-radius: 4px; }

/* Topbar */
.topbar { background: linear-gradient(155deg, var(--forest-800), var(--forest-700)); border-bottom: 1px solid var(--forest-900); padding-inline: 20px; }
.topbar-inner { max-width: 1440px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff; text-decoration: none; }
.brand::before {
  content: "🦒"; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; font-size: 16px;
  border-radius: 10px; background: linear-gradient(155deg, var(--amber-500), var(--amber-700)); flex: none;
}
.brand span { color: #a9c2ae; font-weight: 600; font-family: var(--font-body); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; margin-left: 1px; }
.menu { display: flex; flex-wrap: wrap; gap: 2px; margin-left: 8px; }
.menu a { display: flex; align-items: center; gap: 7px; padding: .5rem .8rem; border-radius: 999px; color: #c9d6c7; text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .15s, color .15s; }
.menu a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.menu a[aria-current="page"] { background: var(--forest-500); color: #fff; }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-user-link { display: flex; align-items: center; gap: 9px; text-decoration: none; padding: 4px 10px 4px 4px; border-radius: 999px; transition: background .15s; }
.top-user-link:hover { background: rgba(255, 255, 255, .1); }
.top-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--amber-500), var(--amber-700)); color: var(--forest-900); font-weight: 700; font-size: .85rem;
}
.top-user-text { line-height: 1.25; }
.top-user-text b { display: block; font-size: .82rem; font-weight: 600; color: #fff; }
.top-user-text span { font-size: .68rem; color: #9fb49c; text-transform: uppercase; letter-spacing: .05em; }
.logout { margin: 0; }
.logout .button-link { color: #9fb49c; }
.logout .button-link:hover { color: #fff; }

/* Logged-out pages (login, setup): a centred card on the forest background, no top bar. */
.auth-body { background: var(--forest-900); }
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(217, 164, 65, .16), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(60, 122, 97, .35), transparent 46%),
    linear-gradient(160deg, var(--forest-900), var(--forest-700) 60%, var(--forest-600));
}
.auth-page::before {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 72%);
}
.auth-wrap { position: relative; width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.auth-wrap.wide { max-width: 480px; }
.auth-card {
  width: 100%; background: var(--surface); border-radius: 22px; padding: 36px 32px 30px;
  box-shadow: 0 4px 10px rgba(15, 37, 28, .1), 0 20px 44px -18px rgba(0, 0, 0, .45);
}
@media (max-width: 420px) { .auth-card { padding: 28px 20px 24px; } }
.auth-mark {
  width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(155deg, var(--amber-500), var(--amber-700));
  display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 18px;
}
.auth-card h1 { font-size: 1.85rem; margin: 0 0 4px; }
.auth-lead { color: var(--ink-soft); font-size: .92rem; margin: 0 0 22px; }
.auth-card .notice { margin-bottom: 16px; }
.auth-form { gap: 16px; }
.auth-form label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); gap: 6px; }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"] {
  font-size: .97rem; padding: .75rem .9rem; color: var(--ink); text-transform: none; letter-spacing: normal;
}
.auth-form .button { width: 100%; justify-content: center; padding: .8rem; font-size: .97rem; margin-top: 4px; }
.auth-form .hint { margin-top: -8px; }
.auth-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.auth-foot { margin: 0; text-align: center; font-size: .84rem; color: rgba(239, 233, 216, .8); }
.auth-brand { margin: 0; text-align: center; color: rgba(239, 233, 216, .75); line-height: 1.3; }
.auth-brand b { display: block; font-family: var(--font-display); font-size: 1.1rem; color: #fff; }
.auth-brand span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }

.page { max-width: 1440px; margin: 0 auto; padding: 28px 20px 120px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.card.narrow { max-width: 520px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid .card { margin-bottom: 0; }
.grid + .card { margin-top: 16px; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 4px; font-weight: 600; }
.form input[type="text"], .form input[type="email"], .form input[type="password"] {
  font: inherit; padding: .6rem .75rem; border: 1.5px solid var(--border-input); border-radius: 9px; background: var(--surface); width: 100%; transition: border-color .15s;
}
.form input:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px var(--forest-tint); }
.form fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: grid; gap: 6px; }
.form legend { font-weight: 700; padding: 0 4px; font-family: var(--font-display); }
.form label.check { display: flex; gap: .5rem; align-items: baseline; font-weight: 400; }
.actions { display: flex; align-items: center; gap: 1rem; }

.button {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; background: var(--amber-500);
  color: var(--forest-900); border: 0; border-radius: 999px; padding: .65rem 1.3rem; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.button:hover { background: var(--amber-600); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .5; cursor: default; }
.button-link { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: .4rem .6rem; }
.button-link:hover { color: var(--text); text-decoration: underline; }

.notice { border-radius: 10px; padding: .7rem 1rem; margin: 0 0 16px; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice-success { background: var(--success-tint); color: #1e5c37; }
.notice-error { background: var(--danger-tint); color: #7a2a1c; }
.notice-info { background: var(--info-tint); color: #1f4d7a; }

.muted { color: var(--muted); }
.ok { color: var(--success-text); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.badge { display: inline-block; background: var(--amber-tint); color: var(--tint-text); border-radius: 999px; padding: 0 .55rem; font-size: .8rem; font-weight: 700; }
.nowrap { white-space: nowrap; }
.plain { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .3rem; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Semantic pills — reusable status chips, used by the Animals tiles and elsewhere. */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: .15rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; line-height: 1.5; }
.pill-success { background: var(--success-tint); color: #1e6b41; }
.pill-warning { background: var(--warning-tint); color: var(--warning-text); }
.pill-danger { background: var(--danger-tint); color: var(--danger-text); }
.pill-info { background: var(--info-tint); color: var(--info-text); }
.pill-neutral { background: var(--surface-sunk); color: var(--muted); }

/* Zoo editor */
.crumbs { margin: 0 0 .25rem; font-size: .9rem; }
.page-head .muted { margin: .1rem 0 0; }
.card.narrow-wide { max-width: 760px; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 20px; border-bottom: 1px solid var(--border); }
.tabs a { padding: .55rem 1rem; border-radius: 8px 8px 0 0; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--text); background: var(--surface-sunk); }
.tabs a[aria-current="page"] { color: var(--forest-600); border-bottom-color: var(--amber-500); }
.editor h2 { margin: 1.4rem 0 .3rem; }
.editor h2:first-child { margin-top: 0; }
.form select, .form textarea, .form input[type="url"], .form input[type="time"] {
  font: inherit; padding: .55rem .65rem; border: 1.5px solid var(--border-input); border-radius: 9px; background: var(--surface); width: 100%; transition: border-color .15s;
}
.form textarea { resize: vertical; }
.form input[type="color"] { width: 4rem; height: 2.4rem; padding: 2px; border: 1.5px solid var(--border-input); border-radius: 9px; background: var(--surface); }
.form select:focus, .form textarea:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px var(--forest-tint); }
.form .short { max-width: 7rem; }
.form .medium { max-width: 22rem; }
.hint { color: var(--muted); font-size: .9rem; font-weight: 400; margin: 0; }
.req { color: var(--bad); }
/* A grid label would put the "*" on its own row under the label text: keep them on one line, field below. */
.form label:has(> .req) { grid-template-columns: max-content 1fr; column-gap: 4px; }
.form label:has(> .req) > :not(.req) { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; }
.field-label { font-weight: 600; }
.lang-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.form label.lang { display: grid; grid-template-columns: 2.2rem 1fr; align-items: start; gap: 6px; font-weight: 400; }
.lang-tag { font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface-sunk); border-radius: 6px; text-align: center; padding: .55rem 0; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.inline-fields > label { flex: 0 1 auto; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.rows { display: grid; gap: 12px; counter-reset: row; }
.row-card { counter-increment: row; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.row-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-title { font-weight: 700; font-family: var(--font-display); }
.row-number::before { content: counter(row); }
.row-buttons { display: flex; gap: 4px; }
.icon-button { font: inherit; width: 2.1rem; height: 2.1rem; border: 1.5px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s; }
.icon-button:hover { background: var(--surface-sunk); border-color: var(--ink-faint); }
.icon-button.danger:hover { background: var(--danger-tint); color: var(--bad); border-color: #e0a99e; }
.button-secondary { font: inherit; font-weight: 600; background: var(--surface); color: var(--text); border: 1.5px solid var(--border); border-radius: 999px; padding: .5rem 1.1rem; cursor: pointer; transition: background .15s, border-color .15s; }
.button-secondary:hover { background: var(--surface-sunk); border-color: var(--ink-faint); }
.button-secondary:disabled { opacity: .5; cursor: default; }
.button-secondary.small { padding: .25rem .75rem; font-size: .85rem; }
.weekend { display: grid; gap: 8px; }
.weekend-fields { display: none; }
.weekend:has(input[type="checkbox"]:checked) .weekend-fields { display: flex; }

/* Save bar: a real bottom app bar, fixed to the viewport on every editor page. */
.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--forest-800); color: #fff;
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 -8px 24px rgba(15, 37, 28, .18); margin: 0;
}
.save-bar .button { order: 2; }
.save-bar .muted { color: #c9d6c7; order: 1; }
.save-status { display: flex; align-items: center; gap: 9px; font-size: .85rem; color: #c9d6c7; order: 0; flex-basis: 100%; }
@media (min-width: 620px) { .save-status { flex-basis: auto; margin-right: auto; } }
.save-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.save-bar.is-dirty .save-status { color: #fff; font-weight: 600; }
.save-bar.is-dirty .save-status::before { background: var(--amber-500); }

/* Animals */
.animals-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.animals-toolbar .muted b { color: var(--text); font-variant-numeric: tabular-nums; }
.animals-toolbar > p { margin: 0; }
.toolbar-actions { display: flex; gap: 8px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.search-box input[type="search"], .form .search-box input[type="search"] {
  font: inherit; padding: .55rem .7rem .55rem 2.1rem; border: 1.5px solid var(--border-input); border-radius: 999px; background: var(--surface); width: 100%;
}
.search-box input[type="search"]:focus, .form .search-box input[type="search"]:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px var(--forest-tint); }

.animals-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .animals-grid { grid-template-columns: 1fr; } }

.catalog-pane {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  display: grid; grid-template-rows: auto auto auto 1fr; gap: 12px; overflow: hidden;
  position: sticky; top: 16px; max-height: calc(100vh - 32px);
}
@media (max-width: 900px) { .catalog-pane { position: static; max-height: min(70vh, 560px); } }
.catalog-pane h2 { font-size: 1.05rem; margin: 0; }
.catalog-pane .hint { margin-top: -8px; }
/* min-height: 0 overrides a grid item's default of sizing to its content — without it this list
   would just grow past the panel's max-height instead of stopping at its row and scrolling. */
.catalog-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; transition: background .15s; }
.cat-item:hover { background: var(--surface-sunk); }
.cat-emoji {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 15px; background: var(--surface-sunk); border: 2px solid var(--g, var(--border));
}
.cat-name { flex: 1; min-width: 0; }
.cat-name b { display: block; font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-name span { display: block; font-size: .72rem; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-add {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--forest-500); background: transparent; color: var(--forest-600);
  display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.cat-add:hover { background: var(--forest-tint); }
.cat-item.is-added { opacity: .55; }
.cat-item.is-added .cat-add { border-color: var(--success); color: var(--success-text); background: var(--success-tint); cursor: default; }
.cat-item.flash { animation: cat-flash .9s ease; }
@keyframes cat-flash { 0% { background: var(--amber-tint); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .cat-item.flash { animation: none; } }

/* Animal tiles pack into a grid while collapsed; an expanded one (its body visible) takes the
   full row so its form fields have room, like a card that grows in place. */
.zoo-pane .rows[data-rows="animals"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-items: start; }
.zoo-pane .rows[data-rows="animals"] > .row-card:has(.tile-body:not([hidden])) { grid-column: 1 / -1; }
.tile-head-row { display: flex; align-items: center; gap: 8px; min-width: 0; position: relative; }
.tile-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; text-align: left; background: none; border: 0; padding: 2px; cursor: pointer; border-radius: 8px; }
.tile-toggle:hover { background: var(--surface-sunk); }
.tile-name-wrap { flex: 1; min-width: 0; }
.tile-name { display: block; font-size: .95rem; font-weight: 700; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tile-chevron { flex: none; color: var(--ink-faint); transition: transform .15s; }
[aria-expanded="false"] .tile-chevron { transform: rotate(-90deg); }
.tile-head-row .row-tools { flex: none; justify-content: flex-end; }
.tile-head-row .row-tools .row-title { display: none; }
.tile-body { padding-top: 4px; display: grid; gap: 12px; }
.tile-body[hidden] { display: none; } /* beats .tile-body's own display:grid, which ties with the UA [hidden] rule */
.animal-tile { border-color: var(--border); }

/* A building's icon: a fixed symbol (tropical/aquarium/…), so it keeps its small round badge. */
.building-card { border-color: var(--forest-500); background: var(--forest-tint); }
.building-card .tile-emoji {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--forest-600); color: #fff; border: 2.5px solid var(--forest-600);
}
.building-card .tile-body { background: var(--surface); border-radius: 10px; padding: 12px; }

/* An animal's photo swatch — no icon: the species' own photo, or a soft tint of its group colour
   when none has been uploaded yet. Collapsed, it becomes the whole card's fixed-size background
   (same height for every tile, whatever text a given animal happens to have); expanded, it shrinks
   to a small thumbnail in the header row. */
.tile-swatch {
  width: 44px; height: 44px; border-radius: 10px; flex: none; background-size: cover; background-position: center;
  background-color: var(--surface-sunk);
  background-image: linear-gradient(165deg, var(--g, var(--ink-faint)), color-mix(in srgb, var(--g, var(--ink-faint)) 55%, black));
}
.animal-tile .tile-toggle[aria-expanded="false"] {
  display: block; padding: 0; height: 156px; border-radius: 10px; overflow: hidden; position: relative;
}
.animal-tile .tile-toggle[aria-expanded="false"] .tile-swatch { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.animal-tile .tile-toggle[aria-expanded="false"] .tile-chevron { display: none; }
.animal-tile .tile-toggle[aria-expanded="false"] .tile-name-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px;
  background: linear-gradient(to top, rgba(15, 37, 28, .88), rgba(15, 37, 28, 0));
}
.animal-tile .tile-toggle[aria-expanded="false"] .tile-name { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
/* The move/remove buttons float over the photo instead of squeezing into the same row as the name —
   that squeeze was pushing them out past the card's right edge. */
.animal-tile:has(.tile-toggle[aria-expanded="false"]) .row-tools {
  position: absolute; top: 8px; right: 8px; z-index: 2; gap: 4px;
}
.animal-tile:has(.tile-toggle[aria-expanded="false"]) .row-tools .icon-button {
  background: rgba(255, 255, 255, .92); border-color: transparent; backdrop-filter: blur(2px);
}
.animal-tile:has(.tile-toggle[aria-expanded="false"]) .row-tools .icon-button:hover { background: #fff; }

.unavailable { display: grid; gap: 8px; }
.unavailable-fields { display: none; }
.unavailable:has(input[type="checkbox"]:checked) .unavailable-fields { display: block; }
/* An animal's places 2 and 3 (PLAN §28): the tick opens the place's fields; the third offers itself once the second is used. */
.more-place { display: grid; gap: 8px; }
.more-place-fields { display: none; gap: 8px; padding-left: 12px; border-left: 3px solid var(--border); }
.more-place:has(> .check input:checked) > .more-place-fields { display: grid; }
.more-place:not(:has(> .check input:checked)) + .more-place:not(:has(> .check input:checked)) { display: none; }
.more-place-note { display: none; }
.tile-body:has(.more-place > .check input:checked) > .more-place-note { display: block; }

/* Species and groups */
fieldset.bare { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
fieldset.bare:disabled { opacity: .85; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 0; }
.filter-bar .muted { margin-left: auto; }
.form input[type="search"] { font: inherit; padding: .5rem .6rem; border: 1.5px solid var(--border-input); border-radius: 9px; background: var(--surface); }
td em { color: var(--muted); font-style: italic; }

/* Species list: toolbar, "still to do" chips, photo-card tiles. */
.species-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.species-toolbar .search-box { flex: 1 1 280px; max-width: 420px; }
.pill-select {
  font: inherit; padding: .5rem 2rem .5rem .9rem; border: 1.5px solid var(--border-input); border-radius: 999px; background: var(--surface);
  max-width: 100%; min-width: 0;
}
.pill-select:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px var(--forest-tint); }
.toolbar-clear { font-size: .9rem; }
.todo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.todo-chips a {
  display: inline-flex; align-items: center; gap: 7px; padding: .38rem .85rem; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: .88rem; color: var(--ink-soft); background: var(--surface); border: 1.5px solid var(--border);
  transition: background .15s, border-color .15s, color .15s;
}
.todo-chips a:hover { border-color: var(--ink-faint); color: var(--ink); }
.todo-chips a b { font-variant-numeric: tabular-nums; font-weight: 700; padding: 0 .45rem; border-radius: 999px; background: var(--surface-sunk); color: var(--ink); }
.todo-chips a.chip-todo b { background: var(--warning-tint); color: var(--warning-text); }
.todo-chips a.chip-done b { background: var(--success-tint); color: #1e6b41; }
.todo-chips a[aria-current="true"] { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.todo-chips a[aria-current="true"] b { background: rgba(255, 255, 255, .18); color: #fff; }

.species-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.species-tile {
  display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.species-tile:hover { border-color: var(--ink-faint); box-shadow: 0 6px 18px rgba(15, 37, 28, .1); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .species-tile:hover { transform: none; } }
.species-photo, .species-hero { position: relative; display: block; width: 100%; height: 140px; border-radius: 0; }
.species-photo-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.species-photo-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; min-width: 0;
  background: linear-gradient(to top, rgba(15, 37, 28, .88), rgba(15, 37, 28, 0)); color: #fff;
}
.species-photo-caption b, .species-photo-caption h1, .species-photo-caption em { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.species-photo-caption b { font-family: var(--font-display); font-size: 1.02rem; }
/* The species page's name is its h1 (PLAN §22), drawn like the tiles' captions. */
.species-photo-caption h1 { margin: 0; font-size: 1.02rem; line-height: 1.3; color: inherit; }
.species-photo-caption em { font-size: .78rem; color: #dfe7dc; }
.species-body { display: grid; gap: 8px; padding: 11px 12px 12px; min-width: 0; flex: 1; align-content: start; }
.species-body .tile-badges { margin: 0; min-height: 1.4rem; }
.species-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .76rem; color: var(--ink-soft); }
.species-meta span { white-space: nowrap; }
.species-meta .faint { color: var(--ink-faint); }
.species-hint { margin-top: 16px; }
.empty-state { text-align: center; padding: 40px 22px; }

/* IUCN status badge, coloured like the Red List scale. */
.iucn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.1rem; padding: .1rem .4rem; border-radius: 6px;
  font-size: .72rem; font-weight: 800; letter-spacing: .03em; background: rgba(255, 255, 255, .92); color: var(--ink);
}
.iucn-lc { background: #d7ecd9; color: #1e6b41; }
.iucn-nt { background: #e6efc9; color: #56701c; }
.iucn-vu { background: #fbecc2; color: #8a6300; }
.iucn-en { background: #f9d9bd; color: #9a4b0f; }
.iucn-cr { background: #f3c9c1; color: #8f2b1a; }
.iucn-ew, .iucn-ex { background: #2a2a2a; color: #fff; }

/* Facts meter: a styled <progress>, so no width has to be set from a style attribute. */
.meter-row { display: flex; align-items: center; gap: 9px; }
.meter { flex: 1; min-width: 0; height: 7px; border: 0; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; appearance: none; -webkit-appearance: none; }
.meter::-webkit-progress-bar { background: var(--surface-sunk); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--amber-500); border-radius: 999px; }
.meter::-moz-progress-bar { background: var(--amber-500); border-radius: 999px; }
.meter.is-full::-webkit-progress-value { background: var(--success); }
.meter.is-full::-moz-progress-bar { background: var(--success); }
.meter-label { font-size: .76rem; color: var(--ink-soft); white-space: nowrap; }
.meter-label b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Species page: sticky summary + checklist on the left, the form's sections as cards on the right. */
.species-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .species-layout { grid-template-columns: minmax(0, 1fr); } }
.species-side {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  position: sticky; top: 16px; min-width: 0;
}
/* A sticky panel taller than the window would keep its bottom (e.g. the programs day preview) out of reach: it scrolls
   inside itself instead, above the fixed save bar. */
@media (min-width: 901px) { .species-side { max-height: calc(100vh - 110px); overflow-y: auto; overscroll-behavior: contain; } }
@media (max-width: 900px) { .species-side { position: static; } }
.species-hero { height: 190px; }
.species-hero .species-photo-caption b, .species-hero .species-photo-caption h1 { font-size: 1.3rem; }
.side-block { padding: 14px 16px; display: grid; gap: 8px; min-width: 0; }
.side-block + .side-block { border-top: 1px solid var(--border); }
.side-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.side-meta code { font-size: .78rem; overflow-wrap: anywhere; }
.side-zoos { margin: 0; font-size: .88rem; }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.05rem; margin: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.checklist a:hover { background: var(--surface-sunk); }
.checklist a > span:last-child { min-width: 0; }
.checklist b { display: block; font-size: .88rem; }
.checklist b + span { display: block; font-size: .76rem; color: var(--ink-soft); }
.check-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; border: 2px solid var(--border); color: var(--ink-faint);
}
.check-done .check-dot { background: var(--success); border-color: var(--success); color: #fff; }
.check-todo .check-dot { background: var(--warning-tint); border-color: var(--warning); color: var(--warning-text); }
.check-optional .check-dot { border-style: dashed; }

.species-main { min-width: 0; }
.species-form fieldset.bare, .section-form fieldset.bare { gap: 18px; }
.species-form .form-section, .section-form .form-section { margin: 0; display: grid; gap: 12px; scroll-margin-top: 16px; }
.species-form .form-section h2, .section-form .form-section h2 { margin: 0; }
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill[hidden] { display: none; } /* .pill's own display ties with the UA [hidden] rule */

/* Photo upload card (photo-upload.js): preview + map-pin preview, drop zone, status line. */
.photo-upload { display: grid; gap: 12px; }
.photo-previews { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.photo-frame, .pin-frame { margin: 0; display: grid; gap: 6px; min-width: 0; }
.photo-frame { flex: 1 1 260px; max-width: 420px; }
.photo-frame img, .photo-empty {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--border);
  background-color: var(--surface-sunk);
}
.photo-empty { display: flex; align-items: center; justify-content: center; gap: 8px; height: auto; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.photo-empty span { font-size: 1.8rem; }
/* Species pictures: the app shows them 3:4 on the tiles and the animal's page alike, so the preview crops the same way. */
.photo-upload.is-portrait .photo-frame { flex: 0 1 240px; }
.photo-upload.is-portrait .photo-frame img, .photo-upload.is-portrait .photo-empty { aspect-ratio: 3 / 4; }
.photo-frame img[hidden], .photo-empty[hidden], .pin-sample img[hidden], .pin-sample span[hidden] { display: none; }
.photo-frame figcaption, .pin-frame figcaption { font-size: .78rem; color: var(--ink-soft); min-height: 1.2em; }
.pin-frame { justify-items: center; }
.pin-sample {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--g, var(--border)); box-shadow: 0 2px 8px rgba(15, 37, 28, .25); background-image: none; background-color: var(--surface);
}
.pin-sample img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin-sample span { font-size: 30px; }
.photo-drop {
  display: grid; gap: 6px; padding: 14px 16px; border: 2px dashed var(--border); border-radius: 12px; background: var(--bg);
  transition: border-color .15s, background .15s;
}
.photo-drop.is-over { border-color: var(--forest-500); background: var(--forest-tint); }
.photo-drop-title { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.photo-choose { position: relative; display: inline-flex; align-items: center; }
.photo-choose:focus-within { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.photo-upload.is-busy .photo-choose { opacity: .5; pointer-events: none; }
.photo-drop .meter { width: 100%; flex: none; }
.photo-drop .meter[hidden] { display: none; }
.photo-status { margin: 0; font-size: .88rem; min-height: 1.2em; }
.photo-status.is-error { color: var(--danger); font-weight: 600; }
.photo-status.is-success { color: #1e6b41; font-weight: 600; }
.photo-actions { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-actions:empty { display: none; }
.photo-actions .button-secondary[hidden] { display: none; }
.photo-credit { display: grid; gap: 6px; padding-top: 4px; border-top: 1px solid var(--surface-sunk); }
.photo-credit[hidden] { display: none; }
.photo-status.is-warning { color: var(--warning-text); font-weight: 600; }
.photo-frame.is-map img, .photo-frame.is-map .photo-empty { object-fit: contain; background-color: var(--surface-sunk); }
/* Compact: staff cards and the map sidebar — a small preview beside a slimmer drop zone. */
.photo-upload.is-compact { grid-template-columns: 132px minmax(0, 1fr); align-items: start; gap: 10px 14px; }
.photo-upload.is-compact .photo-previews { grid-row: span 2; }
.photo-upload.is-compact .photo-frame { flex: none; width: 132px; }
.photo-upload.is-compact .photo-frame img, .photo-upload.is-compact .photo-empty { aspect-ratio: 1; font-size: .8rem; flex-direction: column; gap: 2px; text-align: center; }
.photo-upload.is-compact.is-portrait .photo-frame img, .photo-upload.is-compact.is-portrait .photo-empty { aspect-ratio: 3 / 4; }
.photo-upload.is-compact .photo-empty span { font-size: 1.4rem; }
.photo-upload.is-compact .photo-drop { padding: 10px 12px; }
.photo-upload.is-compact .photo-drop .hint { font-size: .8rem; }
@media (max-width: 520px) { .photo-upload.is-compact { grid-template-columns: minmax(0, 1fr); } .photo-upload.is-compact .photo-previews { grid-row: auto; } }
.map-side .photo-upload.is-compact { grid-template-columns: minmax(0, 1fr); }
.map-side .photo-upload.is-compact .photo-previews { grid-row: auto; }
.map-side .photo-upload.is-compact .photo-frame { width: 100%; }
.map-side .photo-upload.is-compact .photo-frame img { aspect-ratio: auto; max-height: 160px; }
.staff-photo, .map-replace { display: grid; gap: 8px; }
.staff-avatar [hidden] { display: none; }
.map-upload-empty .photo-upload { max-width: 560px; margin: 18px auto 0; text-align: left; }
.notice-warning { background: var(--warning-tint); color: #7a4a12; }
/* Programs: schedule rows (days + times) inside a program tile; special events that are over are greyed. */
.schedule { display: grid; gap: 8px; }
.schedule p { margin: 0; }
.schedule-rows { display: grid; gap: 8px; }
.schedule-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--surface-sunk); min-width: 0; }
.schedule-times { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; min-width: 0; }
.compact-chips { gap: 5px; }
.compact-chips .chip-check span { padding: .25rem .55rem; font-size: .82rem; }
.compact-chips .chip-check input:checked + span::before { content: none; }
.schedule-row .icon-button:disabled { visibility: hidden; }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.issue-list a { display: block; padding: 6px 8px; border-radius: 8px; background: var(--warning-tint); color: #7a4a12; font-size: .82rem; text-decoration: none; line-height: 1.35; }
.issue-list a:hover { text-decoration: underline; }
.day-preview { display: grid; gap: 8px; }
.side-subtitle { font-size: .82rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin: 4px 0 0; }
.day-picker { display: flex; align-items: center; gap: 6px; }
.day-picker input[type="date"] { flex: 1; min-width: 0; font: inherit; padding: .35rem .5rem; border: 1.5px solid var(--border-input); border-radius: 8px; background: var(--surface); }
.day-status { margin: 0; font-size: .88rem; }
.day-open { color: #1e6b41; font-weight: 600; }
.day-closed { color: var(--danger); font-weight: 600; }
.preview-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .86rem; }
.preview-list li { min-width: 0; overflow-wrap: anywhere; }
.preview-list b { font-variant-numeric: tabular-nums; margin-right: 4px; }
.preview-list li.is-outside { color: var(--ink-soft); }
.preview-list li .pill { margin-left: 6px; font-size: .68rem; padding: 0 .45rem; }
.week-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.week-day { width: 100%; display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 6px; align-items: baseline; text-align: left; font: inherit; font-size: .8rem; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; }
.week-day:hover { background: var(--surface-sunk); }
.week-day[aria-current="date"] { background: var(--forest-tint); }
.week-day span { font-variant-numeric: tabular-nums; color: var(--ink-soft); overflow-wrap: anywhere; min-width: 0; }
.special-tile.is-past { opacity: .6; }
.special-tile.is-past:hover, .special-tile.is-past:focus-within { opacity: 1; }
.past-events { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-sunk); }
.legacy-images { display: grid; gap: 12px; }
.legacy-images h2, .legacy-images p { margin: 0; }
.legacy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.legacy-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; border-radius: 10px; background: var(--bg); min-width: 0; }
.legacy-list li > span:first-child { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.map-check-pins { display: grid; gap: 6px; margin: 0 0 12px; font-size: .88rem; }
.is-checking-pins .map-pin { outline: 3px dashed var(--warning); outline-offset: 3px; }

/* Zoo section pages: the side panel's header is the zoo in its own main colour. */
.zoo-hero { height: 130px; }
.zoo-hero .species-photo-caption b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.zoo-hero .species-photo-caption em { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zoo-hero-accent { width: 22px; height: 22px; border-radius: 50%; background: var(--g, var(--amber-500)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.section-tile .tile-toggle { align-items: center; }
.tile-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--surface-sunk);
}
.tile-sub { display: block; font-size: .82rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub:empty { display: none; }
.section-tile .tile-badges:not(:has(.pill:not([hidden]))) { display: none; }

/* Checkboxes shown as toggle chips (weekdays, languages). */
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.form label.chip-check { display: inline-flex; position: relative; font-weight: 600; }
.chip-check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-check span {
  padding: .4rem .9rem; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-soft);
  font-size: .88rem; transition: background .15s, border-color .15s, color .15s;
}
.chip-check:hover span { border-color: var(--ink-faint); }
.chip-check input:checked + span { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.chip-check input:checked + span::before { content: "✓ "; }
.chip-check input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }

.colour-pickers { display: flex; flex-wrap: wrap; gap: 12px; }
.form label.colour-picker {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
}
.colour-picker input[type="color"] { width: 3rem; height: 3rem; border-radius: 10px; cursor: pointer; }
.colour-picker b { display: block; font-size: .92rem; }
.colour-picker b + span { font-size: .78rem; color: var(--ink-soft); font-weight: 400; }
.link-button { text-decoration: none; align-self: end; margin-bottom: 4px; }

/* Contact and web fields with a leading symbol. */
.icon-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.form label.icon-field { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.icon-field-symbol {
  width: 42px; height: 42px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--surface-sunk); font-size: 18px; font-weight: 800; color: var(--ink-soft);
}
.icon-field-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.icon-field-body input { width: 100%; }
.form .icon-field-body input[type="email"] { font: inherit; padding: .55rem .65rem; border: 1.5px solid var(--border-input); border-radius: 9px; }
.social-facebook .icon-field-symbol { background: #e3ebf7; color: #1877f2; font-family: Georgia, serif; }
.social-instagram .icon-field-symbol { background: #f8e1ec; color: #c13584; }
.social-youtube .icon-field-symbol { background: #f9dcdc; color: #d62828; font-size: 14px; }
.social-tiktok .icon-field-symbol { background: #e6e6e6; color: #111; }

/* Opening hours: the seasons across the year, drawn as SVG (attributes, not styles, so the CSP allows it). */
.year-timeline { width: 100%; display: block; border-radius: 6px; background: var(--surface-sunk); }
.year-grid { stroke: var(--surface); stroke-width: 1; }
.year-gap { fill: var(--danger-tint); stroke: var(--danger); stroke-width: 1; stroke-dasharray: 3 2; }
/* Month letters under the bars; the months are not equally long, but close enough to read the bars by. */
.year-months { display: grid; grid-template-columns: repeat(12, 1fr); font-size: .68rem; color: var(--ink-faint); text-align: center; margin-top: -4px; }
.year-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .8rem; }
.year-legend li { display: flex; align-items: center; gap: 7px; min-width: 0; }
.year-legend li > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.year-legend .muted { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

.app-buttons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.app-buttons li { padding: .3rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 600; border: 1.5px solid var(--forest-500); color: var(--forest-600); background: var(--forest-tint); }
.app-buttons li.is-hidden { border-style: dashed; border-color: var(--border); color: var(--ink-faint); background: none; opacity: .75; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fact-list { display: grid; gap: 12px; }
.fact-list .field { padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.fact-list .field.is-missing { background: #fdf8ec; border-color: #ecd9ae; }
.field-label .pill { margin-left: 6px; vertical-align: 1px; }
.danger-zone { margin-top: 18px; }

/* Groups: tiles on the left (groups inside a main group indented), the app's two-level list on the right. */
.groups-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .groups-grid { grid-template-columns: minmax(0, 1fr); } .groups-preview { order: -1; } }
.groups-pane { min-width: 0; }
.groups-pane .animals-toolbar .hint { flex: 1 1 320px; }
.group-tile { transition: margin-left .15s, border-color .15s; }
.group-tile.is-sub { margin-left: 32px; border-left: 3px solid var(--border); }
@media (max-width: 600px) { .group-tile.is-sub { margin-left: 16px; } }
.group-dot {
  width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--g, var(--ink-faint));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35);
}
.group-tile.is-sub .group-dot { width: 30px; height: 30px; }
.group-dot.small { width: 14px; height: 14px; box-shadow: none; }
.group-tile .tile-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.group-tile .tile-name > span { overflow: hidden; text-overflow: ellipsis; }
.group-other-name { font-family: var(--font-body); font-weight: 400; font-size: .82rem; color: var(--ink-faint); }
.faint-pill { color: var(--ink-faint); }
.icon-button:disabled { opacity: .4; cursor: not-allowed; }
.icon-button:disabled:hover { background: var(--surface); border-color: var(--border); color: inherit; }

.groups-preview { grid-template-rows: auto auto 1fr auto; }
.group-tree, .group-tree ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.group-tree { overflow-y: auto; min-height: 0; }
.group-tree ul { margin: 2px 0 6px 7px; padding-left: 14px; border-left: 2px solid var(--surface-sunk); }
.group-tree-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 9px; padding: 4px 6px; border-radius: 8px; }
.group-tree-item > ul { grid-column: 1 / -1; }
.group-tree-item.is-main > .group-tree-name { font-weight: 700; font-family: var(--font-display); }
.group-tree-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.group-tree-count { font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 .5rem; border-radius: 999px; background: var(--surface-sunk); }
.group-tree-count.is-empty { background: var(--warning-tint); color: var(--warning-text); }
.group-tree-problem { background: var(--danger-tint); color: #7a2a1c; border-radius: 8px; padding: 6px 8px; font-size: .84rem; margin-top: 6px; }

/* Staff: person cards packed in a grid; an open one takes the whole row for its fields. */
.staff-list .rows[data-rows="staff"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.staff-list .rows[data-rows="staff"] > .row-card:has(.tile-body:not([hidden])) { grid-column: 1 / -1; }
.staff-tile { --role: var(--forest-600); --role-tint: var(--forest-tint); border-top: 4px solid var(--role); }
.staff-tile.role-director { --role: #876529; --role-tint: var(--amber-tint); }
.staff-tile.role-worker { --role: var(--info-text); --role-tint: var(--info-tint); }
.staff-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--role-tint) center / cover no-repeat; color: var(--role); border: 2.5px solid var(--role);
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
}
.staff-tile .tile-toggle { align-items: center; }
/* Closed: a centred portrait card, the move/remove buttons floating in its top corner so they don't
   squeeze the name (the same overflow the animal tiles had); the top padding keeps the avatar clear of them. */
.staff-tile .tile-toggle[aria-expanded="false"] { flex-direction: column; justify-content: center; gap: 8px; padding: 30px 4px 6px; text-align: center; }
.staff-tile .tile-toggle[aria-expanded="false"] .tile-name-wrap { width: 100%; }
.staff-tile .tile-toggle[aria-expanded="false"] .tile-badges { justify-content: center; }
.staff-tile .tile-toggle[aria-expanded="false"] .tile-chevron { display: none; }
.staff-tile:has(.tile-toggle[aria-expanded="false"]) .row-tools { position: absolute; top: -4px; right: -4px; z-index: 2; }
.staff-tile:has(.tile-toggle[aria-expanded="false"]) .icon-button { width: 1.8rem; height: 1.8rem; font-size: .8rem; }
.staff-title { display: block; font-size: .8rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.pill-role { background: var(--role-tint); color: var(--role); }
.staff-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.staff-list .rows + p { margin-top: 12px; }

/* Map editor: sidebar (progress, search, pins by kind) left, the map right; both fit the window
   above the save bar and scroll inside themselves. Every scrolling child sets min-height: 0. */
.map-layout {
  display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: stretch;
  height: calc(100vh - 110px); min-height: 520px;
}
@media (max-width: 900px) { .map-layout { grid-template-columns: minmax(0, 1fr); height: auto; } }
.map-side-pane {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-height: 0; min-width: 0;
}
@media (max-width: 900px) { .map-side-pane { max-height: 70vh; } }
.map-progress { padding: 14px 16px 10px; display: grid; gap: 6px; background: var(--forest-tint); border-bottom: 1px solid var(--border); }
.map-progress-row { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 3.2rem; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; }
.map-progress-row b { text-align: right; font-variant-numeric: tabular-nums; }
.map-progress .meter { height: 9px; background: var(--surface); }
.map-progress .meter::-webkit-progress-bar { background: var(--surface); }
.map-side-tools { padding: 12px 16px; display: grid; gap: 9px; border-bottom: 1px solid var(--border); }
.todo-chips.small { margin: 0; gap: 6px; }
.todo-chips button {
  font: inherit; display: inline-flex; align-items: center; gap: 7px; padding: .3rem .75rem; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .84rem; color: var(--ink-soft); background: var(--surface); border: 1.5px solid var(--border);
}
.todo-chips button b { font-variant-numeric: tabular-nums; padding: 0 .45rem; border-radius: 999px; background: var(--surface-sunk); color: var(--ink); }
.todo-chips button.chip-todo b { background: var(--warning-tint); color: var(--warning-text); }
.todo-chips button[aria-pressed="true"] { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.todo-chips button[aria-pressed="true"] b { background: rgba(255, 255, 255, .18); color: #fff; }
.form label.small-check { font-size: .84rem; color: var(--ink-soft); }
.map-side { overflow-y: auto; min-height: 0; padding: 4px 12px 16px; }
.pin-section { padding: 12px 4px 4px; display: grid; gap: 8px; }
.pin-section + .pin-section { border-top: 1px solid var(--border); margin-top: 8px; }
.pin-section h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1rem; margin: 0; }
.pin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pin-item { display: flex; align-items: center; gap: 6px; border-radius: 10px; padding: 2px 4px 2px 2px; min-width: 0; transition: background .15s; }
.pin-item:hover { background: var(--surface-sunk); }
.pin-item.selected { background: var(--amber-tint); box-shadow: inset 0 0 0 2px var(--amber-500); }
.pin-item.is-filtered { display: none; }
.pin-pick {
  flex: 1; min-width: 0; font: inherit; text-align: left; background: none; border: 0; cursor: pointer; color: inherit;
  display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 8px;
}
.pin-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 17px;
  background-color: var(--surface-sunk); background-size: cover; background-position: center; border: 2.5px solid var(--g, var(--border));
}
.pin-avatar.area { border-radius: 9px; background: var(--forest-600); border-color: var(--forest-600); color: #fff; }
.pin-avatar.service { background: var(--info-tint); border-color: #9cc3dc; font-size: 16px; }
.pin-text { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.pin-text b { flex-basis: 100%; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-sub { font-size: .74rem; color: var(--ink-soft); }
.pin-state.pill { font-size: .68rem; padding: 0 .5rem; }
.service-pin { padding: 2px 6px 2px 2px; gap: 6px; border-radius: 10px; }
.service-pin.selected { background: var(--amber-tint); border-color: var(--amber-500); }
.service-pin.is-filtered { display: none; }
.pin-item-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.service-pin .tile-body { padding: 4px 6px 10px; gap: 10px; }
.service-pin .rows, .pin-section .rows { gap: 6px; }
.pin-section .lang-pair { grid-template-columns: minmax(0, 1fr); }

.map-main { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; min-height: 0; min-width: 0; }
@media (max-width: 900px) { .map-main { height: 75vh; } }
.map-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.map-zoom { display: flex; gap: .3rem; align-items: center; }
.map-zoom-label { min-width: 3.2rem; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.map-hint { flex: 1; min-width: 0; padding: .45rem .9rem; border-radius: 999px; background: var(--surface-sunk); color: var(--ink-soft); font-size: .88rem; }
.map-hint.is-active { background: var(--amber-tint); color: var(--tint-text); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--amber-500); }
.map-stage-wrap { overflow: auto; min-height: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunk); }
.map-stage { position: relative; display: inline-block; line-height: 0; vertical-align: top; }
.map-stage.placing { cursor: crosshair; }
.map-stage.placing img { outline: 3px dashed var(--amber-500); outline-offset: -3px; }
.map-stage img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.map-pin {
  position: absolute; transform: translate(-50%, -50%); width: 32px; height: 32px; border-radius: 50%;
  background: #fff center / cover no-repeat; border: 3px solid var(--g, rgba(0, 0, 0, .55)); box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; cursor: grab; touch-action: none;
}
.map-pin.photo { width: 36px; height: 36px; }
.map-pin.service { width: 26px; height: 26px; font-size: 13px; background: var(--info-tint); border: 2px solid #2a6ca0; }
.map-pin.area { width: 38px; height: 38px; border-radius: 10px; font-size: 19px; background: var(--forest-600); border-color: #fff; }
.map-pin.selected { border-color: var(--amber-500); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 7px var(--amber-500); transform: translate(-50%, -50%) scale(1.3); z-index: 2; }
@media (prefers-reduced-motion: no-preference) { .map-pin.selected { animation: pin-pulse 1.4s ease-in-out infinite; } }
@keyframes pin-pulse { 50% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 11px rgba(217, 164, 65, .35); } }
.empty-icon { font-size: 2.6rem; margin: 0 0 .25rem; line-height: 1; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); }
tr.inactive td { color: var(--muted); }

/* Dashboard: the user's modules in a two-column grid; lists and link rows take the full width. */
.dash-head { align-items: center; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 860px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-grid .card { margin: 0; min-width: 0; display: grid; gap: 12px; align-content: start; }
.dash-grid .card h2 { margin: 0; }
.dash-module.is-wide { grid-column: 1 / -1; }
/* A narrow module without a partner spans the row and spreads out: facts in a row, main groups side by side. */
@media (min-width: 860px) {
  .dash-module.is-alone .facts { grid-template-columns: repeat(4, max-content minmax(0, 1fr)); gap: .35rem 1rem; }
  .dash-module.is-alone .dash-groups { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 32px; align-items: start; }
}
.dash-module .facts { margin: 0; }
.dash-actions { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.dash-head-action { margin-left: auto; text-decoration: none; }
.dash-zoos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 8px; }
.dash-zoo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; height: 100%; }
.dash-zoo:hover { border-color: var(--ink-faint); background: var(--bg); }
.dash-zoo-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--g, var(--forest-600)); }
.dash-zoo-text { flex: 1; min-width: 0; display: grid; }
.dash-zoo-text b { font-family: var(--font-display); overflow-wrap: anywhere; line-height: 1.25; }
.dash-zoo-text .muted { font-size: .8rem; }
.dash-zoo-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.dash-links { display: grid; gap: 12px; }
.dash-links-zoo h3 { margin: 0 0 6px; font-size: .95rem; }
.dash-link-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-link { display: inline-flex; align-items: center; gap: 6px; padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.dash-link:hover { border-color: var(--forest-500); background: var(--forest-tint); }
.dash-setup { gap: 8px; }
.dash-setup-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.form label.dash-setup-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.dash-setup-check input { margin-top: .3rem; accent-color: var(--forest-600); }
.dash-setup-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.dash-setup-check > span { display: grid; gap: 2px; min-width: 0; }
.dash-setup-check .muted { font-size: .86rem; }
.dash-setup-row:has(input:not(:checked)) { opacity: .65; }
.dash-meter { display: inline-flex; align-items: center; gap: 6px; min-width: 7rem; }
.dash-meter .meter { flex: 1; min-width: 3rem; }
.dash-meter b { font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-stats td, .dash-stats th { white-space: nowrap; }
.dash-stats td:first-child { white-space: normal; min-width: 10rem; }
.dash-stats .dash-total td { border-top: 2px solid var(--border); }
/* Phone: each zoo becomes a small card of label/value rows instead of a table that scrolls sideways. */
@media (max-width: 700px) {
  .dash-stats, .dash-stats tbody, .dash-stats tr, .dash-stats td { display: block; }
  .dash-stats thead { display: none; }
  .dash-stats tbody { display: grid; gap: 10px; }
  .dash-stats tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
  .dash-stats td:first-child, .dash-stats td:nth-child(n+6) { grid-column: 1 / -1; }
  .dash-stats td, .dash-stats .dash-total td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; white-space: normal; }
  .dash-stats td[data-label]::before { content: attr(data-label); color: var(--ink-soft); font-size: .85rem; }
  /* The row's name: a zoo in the dashboard and the owner's usage page, an animal in a zoo's App visitors tab. */
  .dash-stats td.dash-stats-zoo, .dash-stats td.dash-stats-name { min-width: 0; padding-bottom: 6px; font-weight: 600; }
  .dash-stats .dash-meter { flex: 0 1 12rem; }
}
.dash-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dash-groups ul { list-style: none; margin: 2px 0 4px 7px; padding-left: 14px; border-left: 2px solid var(--surface-sunk); display: grid; gap: 2px; }
.dash-group { display: flex; align-items: center; gap: 8px; font-size: .9rem; min-width: 0; }
.dash-group .group-tree-count { margin-left: auto; }
.dash-group .dash-zoo-dot { width: 11px; height: 11px; }
.dash-activity-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px 24px; }
.dash-activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dash-activity li { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px; font-size: .88rem; }
.dash-activity-when { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-activity-what { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .dash-activity li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.dash-checklists { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px 24px; align-items: start; }
.dash-checklist { display: grid; gap: 8px; min-width: 0; }
.dash-checklist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.dash-checklist-head > b { flex: 1 1 12rem; font-family: var(--font-display); min-width: 0; overflow-wrap: anywhere; }
.dash-checklist-head .dash-meter { flex: 0 1 11rem; }
.dash-all-done { margin: 0; color: #1e6b41; font-weight: 600; }

/* Languages page (PLAN §14) */
.form .tiny { max-width: 5.5rem; }
.language-row .inline-fields { align-items: center; }
.language-code { display: inline-flex; align-items: baseline; gap: 6px; min-width: 9rem; font-weight: 600; }
.language-code code { font-size: .9rem; }
.language-row .hint { margin: 0; }
.plain-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 8px; font-size: .9rem; }
.language-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 14px; }
.language-chips .hint { margin-right: 4px; }
.chip-link { display: inline-flex; align-items: center; padding: .2rem .7rem; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); font-size: .85rem; font-weight: 600; text-decoration: none; }
.chip-link:hover { border-color: var(--forest-500); background: var(--forest-tint); }
.chip-link.is-on { background: var(--forest-600); border-color: var(--forest-600); color: #fff; }
.lang-tag.is-required { color: var(--ink); }
.lang-pair.is-many { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Translate page (PLAN §14) */
.translate-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.translate-filter > label { flex: 0 1 auto; }
.translate-summary { margin: 0 0 12px; }
.translate-rows { display: grid; gap: 10px; }
.translate-row { margin: 0; display: grid; gap: 8px; padding: 12px 16px; }
.translate-row.is-missing { border-color: var(--amber-500); }
.translate-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.translate-row-head > b { overflow-wrap: anywhere; }
.translate-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 8px 14px; }
.translate-source { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 6px; align-items: start; min-width: 0; }
.translate-source p { margin: 0; padding: .5rem .7rem; border-radius: 10px; background: var(--surface-sunk); overflow-wrap: anywhere; }
.translate-overview { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 6px 16px; }
.translate-overview a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; color: inherit; text-decoration: none; min-width: 0; }
.translate-overview a:hover { background: var(--surface-sunk); }
.translate-overview a > b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dash-translations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px 24px; }
.dash-translation h3 { margin: 0 0 6px; font-size: .95rem; }
.dash-translation-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dash-translation-parts li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; min-width: 0; }
.dash-translation-parts a { min-width: 0; overflow-wrap: anywhere; }
.dash-translation-parts .dash-meter { flex: 0 0 13rem; }
.dash-translation h3::first-letter { text-transform: uppercase; }

/* ---------------------------------------------------------------- App users and coupons (PLAN §15.4) */
.badge-ok { background: var(--success-tint); color: var(--success-text); }
.badge-muted { background: var(--surface-sunk); color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }
.form input[type="number"], .form input[type="date"] { font: inherit; padding: .5rem .6rem; border: 1.5px solid var(--border-input); border-radius: 9px; background: var(--surface); color: var(--text); }
.form input[type="number"]:focus, .form input[type="date"]:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px var(--forest-tint); }
.app-users-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.app-users-filter label { display: grid; gap: 4px; font-weight: 600; min-width: 0; }
.app-users-filter input, .app-users-filter select { font: inherit; padding: .5rem .6rem; border: 1.5px solid var(--border-input); border-radius: 9px; background: var(--surface); color: var(--text); min-width: 0; }
.app-users-filter input[type="search"] { width: min(22rem, 100%); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; }
.inline-actions .muted { font-size: .88rem; }
.button-secondary.danger { color: var(--danger); border-color: #e0a99e; }
.button-secondary.danger:hover { background: var(--danger-tint); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head-actions a.button-secondary { text-decoration: none; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.app-user-grid, .coupons-grid { align-items: start; }
.coupons-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.app-user-grid h2, .coupons-grid h2 { margin-top: 0; }

.page-foot { max-width: 1440px; margin: 0 auto; padding: 0 20px 28px; font-size: .8rem; color: var(--ink-faint); }

/* App visitors / Most wanted (PLAN §18): name with a bar under it; the account's list in a dialog. */
.visitors-grid { align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.visitors-grid h2 { margin-top: 0; }
.wanted-table td:first-child, .wanted-table th[scope="row"] { min-width: 12rem; }
/* Row labels are header cells for screen readers (PLAN §22), drawn like ordinary cells. */
.wanted-table th[scope="row"] { font-size: inherit; color: inherit; font-weight: inherit; }
.wanted-name { display: block; }
.wanted-bar { display: block; width: 100%; margin-top: 4px; height: 5px; }

/* App usage (PLAN §5): the period chips, the bar under every name, and the three small tables side by side. */
.usage-periods { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.usage-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 18px; }
.usage-columns h2, .card > h2:first-child { margin-top: 0; }
/* A zoo's App visitors tab puts the usage part under a second heading, below the cards it does not belong to. */
.usage-head { margin-top: 2rem; }
.usage-head h2 { margin: 0; }
.wanted-table .meter { display: block; width: 100%; margin-top: 4px; height: 5px; }
.text-button { background: none; border: 0; padding: 0; font: inherit; color: var(--forest-600); text-decoration: underline; cursor: pointer; }
.list-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border: 1px solid var(--border); border-radius: 14px; padding: 20px; background: var(--surface); color: var(--ink); }
.list-dialog::backdrop { background: rgb(15 37 28 / .45); }
.list-dialog h2 { margin: 0 2.5rem 12px 0; }
.dialog-close { float: right; }

/* A group's background image, inside its row on the Groups page: the preview keeps the app tile's 3:4 shape. */
.group-image { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--surface-sunk); }
.group-image h3 { margin: 0; font-size: .95rem; }
.group-image .photo-upload.is-compact .photo-frame img,
.group-image .photo-upload.is-compact .photo-empty { aspect-ratio: 3 / 4; }

/* Article links (PLAN §20): the address with its "Read the page" button, and the short source/date pair. */
.article-address { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.article-address label { min-width: 0; }
.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
[data-article-status] { min-height: 1.2em; margin-top: -6px; }
[data-article-status].is-error { color: var(--danger); font-weight: 600; }
[data-article-status].is-done { color: #1e6b41; font-weight: 600; }

/* A zoo's accessibility ticks (PLAN §25): two or three columns of checkboxes. */
.access-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 20px; margin-bottom: 14px; }

/* A zoo's own pictures of its own animals (PLAN §24): one card per animal, three upload cards inside it. */
.animal-photo-list { display: grid; gap: 14px; }
.animal-photo-card > .pin-item-row { gap: 10px; }
.animal-photo-card .pin-text { flex: 1; }
.animal-photo-card .pin-text .muted { font-size: .74rem; }

/* A species' two extra pictures (PLAN §23), side by side under the main photo. */
.extra-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.extra-photo { display: grid; gap: 8px; min-width: 0; }
.extra-photo h3 { margin: 0; font-size: .95rem; }

/* QR codes tab (PLAN §21.7 #3): a code, what it opens, its address, and the SVG download. */
.qr-print-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.qr-print-form label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.qr-list { display: grid; gap: 10px; }
.qr-row { grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; }
.qr-code { width: 96px; background: #fff; }
.qr-code svg { display: block; width: 100%; height: auto; }
.qr-code-large { width: 14rem; max-width: 100%; margin: 12px 0; }
/* Recovery codes of two-step sign-in */
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 8px; }
.recovery-codes code { font-size: 1.05rem; letter-spacing: .04em; }
.qr-text { min-width: 0; display: grid; gap: 2px; }
.qr-text b { display: flex; align-items: center; gap: 6px; }
.qr-text code { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .qr-row { grid-template-columns: 72px minmax(0, 1fr); }
  .qr-code { width: 72px; }
  .qr-row .button-secondary { grid-column: 1 / -1; justify-self: start; }
}

/* Badge sets page: each set's species as a scrollable list of ticks. */
.badge-set-species { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.badge-set-list { max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; min-height: 0; }
.badge-set-list .check[hidden] { display: none; }
.badge-set-list .check:has(input:checked) { font-weight: 600; }
