/* =====================================================================
   Animal Registry — admin UI
   Ocean-themed refresh. Class names & ids are unchanged so the existing
   JavaScript keeps working; this file only touches presentation.
   ===================================================================== */

:root {
    /* ink + neutrals */
    --ink: #102a3c;
    --ink-soft: #2c4456;
    --muted: #6b7f90;
    --line: #e4ecf2;
    --line-strong: #cdd9e3;

    /* ocean brand */
    --brand: #0b87c4;
    --brand-dark: #0a6ea0;
    --brand-deep: #0b2a3f;
    --accent: #19b6b0;          /* teal accent */

    /* surfaces */
    --bg: #eef4f8;
    --bg-tint: #e3eef5;
    --surface: #ffffff;

    /* status */
    --good: #15803d;
    --good-bg: #d9f5e3;
    --good-ink: #14532d;
    --warn-ink: #b45309;
    --bad: #be123c;
    --bad-bg: #ffe1e6;
    --bad-ink: #9f1239;

    /* shape */
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 20px;

    /* shadows */
    --shadow-sm: 0 1px 2px rgba(16, 42, 60, 0.06), 0 1px 3px rgba(16, 42, 60, 0.05);
    --shadow: 0 6px 22px rgba(11, 42, 63, 0.08);
    --shadow-lg: 0 24px 60px rgba(10, 37, 64, 0.30);
    --ring: 0 0 0 3px rgba(11, 135, 196, 0.22);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-color: var(--bg);
    /* soft, layered ocean wash that stays out of the way */
    background-image:
        radial-gradient(900px 500px at 100% -10%, rgba(25, 182, 176, 0.10), transparent 60%),
        radial-gradient(900px 600px at -10% 0%, rgba(11, 135, 196, 0.10), transparent 55%);
    background-attachment: fixed;
}

h1, h2, h3 { letter-spacing: -0.01em; }

a { color: var(--brand-dark); }

.hidden { display: none !important; }

/* --- buttons ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    padding: 9px 17px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                box-shadow 0.15s ease, transform 0.05s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(10, 110, 160, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #0a78ac 0%, #095a86 100%); }
.btn-primary:disabled { opacity: 0.55; cursor: default; box-shadow: none; transform: none; }

.btn-ghost {
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: #f4f8fb; border-color: #b9c8d4; color: var(--ink); }
.btn-ghost:disabled { opacity: 0.55; cursor: default; }

.btn-secondary {
    background: #eaf5fb;
    color: var(--brand-dark);
    border-color: #bfe0f0;
}
.btn-secondary:hover { background: #ddeef8; border-color: #a6d3ea; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: 7px; }

/* --- auth gate -------------------------------------------------------- */
.auth-overlay {
    position: fixed;
    inset: 0;
    /* Opaque: the app behind it must be completely hidden until a PIN is
       entered. A translucent tint would leak the whole site through. */
    background:
        radial-gradient(1100px 700px at 80% -10%, rgba(25, 182, 176, 0.45), transparent 60%),
        linear-gradient(160deg, #06202f 0%, #0b4d72 55%, #0b87c4 120%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
}
.auth-card {
    background: var(--surface);
    border-radius: var(--r-xl);
    padding: 36px 32px 32px;
    width: min(92vw, 392px);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: pop-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pop-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
.auth-card::before {
    content: "🐾";
    display: block;
    font-size: 2.1rem;
    margin-bottom: 6px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 800; }
.auth-card p { color: var(--muted); margin: 0 0 22px; font-size: 0.92rem; }
.auth-card input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 1.25rem;
    letter-spacing: 0.35em;
    text-align: center;
    margin-bottom: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-card input::placeholder { letter-spacing: normal; }
.auth-card input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.auth-card .btn { width: 100%; padding: 12px; font-size: 1rem; }
.error-text {
    color: var(--bad-ink);
    background: var(--bad-bg);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    margin-top: 14px;
    font-size: 0.88rem;
    font-weight: 500;
}

/* --- shell + sidebar -------------------------------------------------- */
.shell { display: flex; align-items: stretch; min-height: 100vh; }
.shell[hidden] { display: none; }

/* Sidebar shows for every authenticated user (Animals + Animal upload);
   manager-only items are revealed separately via body.is-manager below. */
.sidebar { display: none; }
.sidebar:not([hidden]) {
    display: flex;
    flex-direction: column;
    width: 244px;
    flex: 0 0 244px;
    background: linear-gradient(185deg, #0b2a3f 0%, #0d3a55 60%, #0c4564 100%);
    color: #e2eef6;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 4px 10px 20px;
    color: #fff;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #c4dbeb;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    text-align: left;
    padding: 11px 13px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
/* Manager-only entries (Screened requests, Settings) hide for employees. */
.nav-item[data-manager-only] { display: none; }
body.is-manager .nav-item[data-manager-only] { display: flex; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.nav-item.active { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 18px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.nav-ico { font-size: 1.02rem; width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(11, 42, 63, 0.6);
}
.sidebar-foot { margin-top: auto; padding: 14px 6px 4px; }
.sidebar-foot .role-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #eaf4fb;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* --- layout ----------------------------------------------------------- */
.app { flex: 1 1 auto; max-width: 1120px; margin: 0 auto; padding: 0 24px 72px; width: 100%; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 0 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}
.topbar-title h1 { margin: 0; font-size: 1.62rem; font-weight: 800; }
.topbar-title p { margin: 5px 0 0; color: var(--muted); font-size: 0.92rem; max-width: 60ch; }
.topbar-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.venue-pick {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.venue-pick select {
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.92rem;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.venue-pick select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.venue-pick select:disabled { opacity: 0.7; cursor: default; background: #f4f8fb; }

/* --- cards ------------------------------------------------------------ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px 26px;
    margin-top: 22px;
    box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 6px; font-size: 1.18rem; font-weight: 700; }
.hint { color: var(--muted); font-size: 0.88rem; line-height: 1.6; margin: 0 0 12px; }
.hint code {
    background: var(--bg-tint);
    color: var(--brand-dark);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 0.85em;
}
.hint strong { color: var(--ink-soft); }

/* --- forms ------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.form-grid label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.label-note {
    margin-left: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-dark);
    background: var(--bg-tint);
    padding: 1px 7px;
    border-radius: 999px;
    vertical-align: middle;
}
/* Auto-generated slug: visibly read-only so nobody tries to type in it. */
.form-grid input#f-slug[readonly] {
    background: #f1f6f9;
    color: var(--muted);
    cursor: default;
    font-variant-ligatures: none;
}
.form-grid input#f-slug[readonly]:focus { border-color: var(--line-strong); box-shadow: none; }
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="password"],
.form-grid select,
.form-grid textarea,
#settings-form input[type="password"],
#settings-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.94rem;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-grid input::placeholder, .form-grid textarea::placeholder { color: #9fb1bf; }
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
#settings-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--ring);
}
.form-grid input[type="file"] {
    width: 100%;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--muted);
}
.form-grid input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.form-grid input[type="file"]::file-selector-button:hover { background: #f4f8fb; border-color: #b9c8d4; }
.form-grid textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.field-wide { grid-column: 1 / -1; }

.checkbox-field { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-soft);
}
.checkbox-field input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--brand);
    cursor: pointer;
}
.photo-field {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r);
    background: linear-gradient(180deg, #f7fbfd 0%, #f1f7fb 100%);
}
.photo-preview {
    width: 104px; height: 104px;
    border-radius: var(--r);
    object-fit: cover;
    background: var(--bg-tint);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    display: none;
}
.photo-preview.has-image { display: block; }
.photo-field-body { flex: 1 1 240px; min-width: 0; }
.field-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.photo-field-body label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin: 8px 0 5px; }

.message { margin-top: 14px; font-size: 0.9rem; font-weight: 500; }
.message.success { color: var(--good); }
.message.error { color: var(--bad-ink); }

/* --- table ------------------------------------------------------------ */
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: middle; }
.table th {
    background: var(--bg-tint);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.table th:first-child { border-top-left-radius: var(--r-sm); }
.table th:last-child { border-top-right-radius: var(--r-sm); }
.table tbody td { border-bottom: 1px solid var(--line); }
.table tbody tr { transition: background-color 0.12s ease; }
.table tbody tr:hover td { background: #f6fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.thumb {
    width: 54px; height: 54px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px; height: 54px;
    border-radius: 10px;
    border: 1px dashed var(--line-strong);
    color: #9fb1bf;
    font-size: 0.66rem;
    text-align: center;
    background: #f8fbfc;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.4;
}
.badge-on { background: var(--good-bg); color: var(--good-ink); }
.badge-off { background: #eaf0f4; color: var(--ink-soft); }

/* --- toggle switch ---------------------------------------------------- */
.switch { position: relative; display: inline-block; width: 44px; height: 25px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--line-strong);
    border-radius: 999px;
    transition: background-color 0.18s ease;
}
.switch .slider::before {
    content: "";
    position: absolute;
    height: 19px; width: 19px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(16, 42, 60, 0.3);
    transition: transform 0.18s ease;
}
.switch input:checked + .slider { background: #16a34a; }
.switch input:checked + .slider::before { transform: translateX(19px); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }
.switch input:disabled + .slider { opacity: 0.5; cursor: default; }

/* --- role badge / pending tag / flag badge ---------------------------- */
.role-badge {
    display: inline-flex;
    align-items: center;
    background: #dcf0fb;
    color: #075985;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-flag { background: var(--bad-bg); color: var(--bad-ink); }
.pending-tag {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    background: #fef0cd;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
}

/* --- approvals queue -------------------------------------------------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head-controls { display: flex; align-items: center; gap: 8px; }
.search-input {
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.9rem;
    min-width: 220px;
    background: var(--surface);
}
.search-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.card-head-controls select {
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--surface);
    cursor: pointer;
}
.card-head-controls select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.approvals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-top: 14px; }
.approval-card {
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.approval-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.approval-card.flagged { border-color: #f3a7b3; box-shadow: 0 0 0 1px #f3a7b3 inset; }
.approval-card.flagged:hover { box-shadow: 0 0 0 1px #f3a7b3 inset, var(--shadow); }
.approval-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-tint); display: block; }
.approval-body { padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; }
.approval-title { font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
.approval-meta { color: var(--muted); font-size: 0.82rem; }
.approval-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.approval-flag {
    background: var(--bad-bg);
    color: var(--bad-ink);
    border-radius: var(--r-sm);
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.45;
    font-weight: 500;
}
.approval-trace {
    color: var(--muted);
    font-size: 0.73rem;
    word-break: break-word;
    background: #f6fafc;
    border-radius: 7px;
    padding: 6px 8px;
}
.approval-actions { margin-top: 9px; display: flex; gap: 8px; }

/* --- settings --------------------------------------------------------- */
.settings-status {
    background: linear-gradient(180deg, #f6fbfd 0%, #eef6fb 100%);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 14px 16px;
    margin: 6px 0 18px;
    font-size: 0.9rem;
    line-height: 1.75;
}
.settings-status strong { color: var(--ink-soft); }
.settings-status .warn { color: var(--warn-ink); font-weight: 600; }
#s-clear-key { color: var(--bad-ink); font-weight: 600; text-decoration: none; }
#s-clear-key:hover { text-decoration: underline; }

/* --- camera capture --------------------------------------------------- */
.camera-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #000;
    display: flex;
    flex-direction: column;
}
.camera-stage {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#camera-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.camera-error {
    position: absolute;
    left: 16px; right: 16px; bottom: 16px;
    background: rgba(185, 28, 28, 0.92);
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    text-align: center;
}
.camera-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px calc(18px + env(safe-area-inset-bottom, 0px));
    background: #0a0a0a;
}
.camera-btn { min-width: 76px; }
.camera-shutter {
    width: 68px; height: 68px;
    border-radius: 50%;
    border: 5px solid #fff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    flex: 0 0 auto;
}
.camera-shutter:active { transform: scale(0.94); background: #e5e7eb; }
body.camera-open { overflow: hidden; }

/* --- responsive ------------------------------------------------------- */
@media (max-width: 640px) {
    .app { padding: 0 16px 56px; }
    .topbar-title h1 { font-size: 1.4rem; }
    .shell { flex-direction: column; }
    .sidebar:not([hidden]) {
        width: auto; flex: none; min-height: 0; position: static; flex-direction: row;
        flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 16px;
    }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .nav-item { flex: 1 1 auto; justify-content: center; padding: 10px 12px; }
    .sidebar-brand { width: 100%; padding-bottom: 8px; }
    .nav-item.active::before { display: none; }
    .nav-badge { margin-left: 6px; }
    .sidebar-foot { margin: 0 0 0 auto; padding: 0; }

    .card { padding: 18px 16px; }
    .topbar { padding: 16px 0; }
    .topbar-controls { width: 100%; }
    .venue-pick { flex: 1 1 auto; }

    /* Prevent iOS from zooming the viewport when focusing a control. */
    .form-grid input, .form-grid select, .form-grid textarea,
    #settings-form input, #settings-form select, .search-input,
    .auth-card input, #f-category-custom { font-size: 16px; }

    .search-input { width: 100%; min-width: 0; }
    .card-head { gap: 10px; }
    .card-head-controls { width: 100%; }

    .photo-field { flex-direction: column; align-items: stretch; text-align: left; }
    .photo-preview { width: 100%; height: 200px; }
    .photo-actions .btn { flex: 1 1 auto; }

    /* Animal list: turn the wide table into stacked cards. */
    .table { margin-top: 12px; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tbody tr {
        border: 1px solid var(--line);
        border-radius: var(--r-sm);
        margin-bottom: 12px;
        padding: 6px 14px;
        background: var(--surface);
    }
    .table tbody td {
        border-bottom: 1px solid var(--line);
        padding: 10px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        text-align: right;
    }
    .table tbody tr td:last-child { border-bottom: 0; }
    .table tbody td::before {
        content: attr(data-label);
        font-size: 0.74rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
        text-align: left;
        flex: 0 0 auto;
    }
    .table tbody tr:hover td { background: transparent; }
    .thumb, .thumb-empty { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
