.turtle-card img.object-fit-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* turtle detail page: prev/next flank the name like a record navigator (mail-client "next message"
   style) instead of a separate toolbar row competing for attention above the header. */
.turtle-nav-arrow {
    display: inline-block;
    width: 1.4em;
    text-align: center;
    color: #adb5bd;
    text-decoration: none;
    font-size: 1.3rem;
    line-height: 1;
    vertical-align: -1px;
}
.turtle-nav-arrow:hover { color: #198754; }
.turtle-nav-arrow.disabled { color: #dee2e6; pointer-events: none; }
.turtle-jump-box { position: relative; }
.turtle-jump-box .form-control { width: 11em; }

/* settings page: a growing flat list of cards (13+ at last count) badly needed a way to jump
   straight to one instead of scrolling past everything else to find it. */
.settings-toc {
    position: sticky;
    top: 8px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.settings-toc a {
    padding: 3px 10px;
    border-radius: 14px;
    background: #f1f3f5;
    color: #495057;
    font-size: .82rem;
    text-decoration: none;
    white-space: nowrap;
}
.settings-toc a:hover { background: #d1e7dd; color: #0b5d3b; }
.settings-section { margin-bottom: 1.5rem; scroll-margin-top: 56px; }
.settings-section h6 { font-weight: 700; margin-bottom: 6px; }

/* the 卡片/列表 view toggle and the preference switches (显示近期食欲, 按龟龟展示页面的排序, etc.)
   start in their default HTML state and get their real .active/.checked state applied by a script
   at the bottom of the page, reading from localStorage -- by the time that runs the browser has
   often already painted the default state once, so Bootstrap's built-in color/background
   transition plays and reads as an unwanted "entrance animation" on every refresh. These are
   preference toggles, not actions that need transition polish, so it's off entirely. */
[data-view], .form-switch .form-check-input {
    transition: none;
}

.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;
    display: flex;
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
/* icon and label side by side (not stacked) so the bar stays slim -- it sits over every phone
   screenshot, so height matters */
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 0;
    font-size: 1.05em;
    line-height: 1.2;
    text-decoration: none;
    color: #6c757d;
}
.bottom-nav-item span { font-size: .75rem; }
.bottom-nav-item.active { color: #198754; font-weight: 600; }
@media (max-width: 991.98px) {
    body { padding-bottom: 38px; }
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-head {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6c757d;
    padding: 4px 0;
}

.calendar-cell {
    aspect-ratio: 1;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    position: relative;
    background: #fff;
}

.calendar-cell.empty {
    border: none;
    cursor: default;
    background: transparent;
}

.calendar-cell .day-num {
    font-size: 0.85rem;
}

.calendar-cell .day-mark {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.68rem;
    white-space: nowrap;
    color: #495057;
}

.calendar-cell.is-today {
    border: 2px solid #198754;
}
.calendar-cell.is-selected-day {
    box-shadow: 0 0 0 2px #0d6efd inset;
    background-color: #cfe2ff !important;
}

.calendar-cell.status-complete { background: #d1e7dd; }
.calendar-cell.status-missed { background: #f8d7da; }
.calendar-cell.status-pending { background: #fff3cd; }
.calendar-cell.status-future { background: #fff; }
.calendar-cell.status-empty { background: #f8f9fa; }

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
}
.legend-dot.status-complete { background: #d1e7dd; }
.legend-dot.status-missed { background: #f8d7da; }
.legend-dot.status-pending { background: #fff3cd; }

#reminder-banner:empty { display: none; }
/* the banner is now rendered server-side (see reminder_data() / window.INITIAL_REMINDER), so it's
   part of the very first paint -- no entrance animation here on purpose, that would just be a
   different flavor of the same "content visibly settling in after load" problem. */
.reminder-wrap { position: relative; padding-right: 30px; }
.reminder-close { position: absolute; top: 6px; right: 4px; z-index: 2; }
.reminder-reopen { display: block; width: 100%; text-align: left; padding: 4px 10px; border: 1px dashed #adb5bd; border-radius: 6px; background: #f8f9fa; color: #495057; font-size: .85em; }
.reminder-reopen:hover { background: #e9ecef; }

.editable-note { cursor: pointer; border-bottom: 1px dashed #adb5bd; }
.editable-note.empty { color: #adb5bd; }
.editable-note:hover { background: #f1f8f4; }

.paste-zone {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    outline: none;
}
.paste-zone:focus, .paste-zone.drag { border-color: #198754; background: #f0fff4; }

.staged-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 6px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 6px;
}
.staged-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; }
.staged-item.failed { border-color: #dc3545; }

.gallery-card img { aspect-ratio: 1; object-fit: cover; width: 100%; }

.crop-stage { position: relative; display: inline-block; user-select: none; touch-action: none; max-width: 100%; }
.crop-stage img { display: block; max-width: 100%; max-height: 60vh; }
.crop-box {
    position: absolute;
    border: 2px solid #198754;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
}

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w, 180px), 1fr)); gap: 12px; }
.tcard { display: block; text-decoration: none; color: inherit; border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden; background: #fff; }
.tcard:hover { border-color: #198754; color: inherit; }
.tcard.inactive { opacity: .5; }
.timg { position: relative; aspect-ratio: 1; background: #f1f3f5; display: flex; align-items: center; justify-content: center; }
.timg .ph { font-size: 2.2em; }
.timg img { width: 100%; height: 100%; object-fit: cover; }
.toverlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 8px 6px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); }
.tbody { padding: 6px 8px; }
.tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tline { font-size: .78em; color: #6c757d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toverlay .tline { color: #f1f3f5; }
/* healthFieldHtml()'s badges set their own Bootstrap text-color utility classes (meant for a
   light card background), which -- being set directly on the span, not just inherited from
   .tline -- otherwise win over .toverlay .tline above and go near-invisible on the photo
   overlay's dark gradient: same fix as .hue-text just above. */
.toverlay .text-muted { color: #ced4da !important; }
.toverlay .text-danger { color: #ff8a80 !important; }
/* color-hash text (e.g. 饲养箱 name) needs a different lightness depending on background: dark
   text reads fine on the table/card-body's white, but is nearly invisible on the photo overlay's
   dark gradient -- same hue either way, via --hue, so it's still the same color per name. */
.hue-text { color: hsl(var(--hue), 65%, 30%); font-weight: 600; }
.toverlay .hue-text { color: hsl(var(--hue), 90%, 82%); text-shadow: 0 1px 2px rgba(0, 0, 0, .9); }
.tgrid.compact .tline { display: none; }
.ttable th.sortable { cursor: pointer; white-space: nowrap; user-select: none; }
.ttable tbody tr { cursor: pointer; }
.ttable img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.ttable td.wrap { max-width: 260px; }

.feed-rec { padding: 8px 0; border-bottom: 1px solid #dee2e6; line-height: 1.7; }
.enclosure-change-rec { background: #f8f5ff; border-left: 3px solid #6f42c1; padding-left: 8px; }
.poop-thumb { height: 64px; border-radius: 4px; border: 1px solid #dee2e6; vertical-align: middle; }
.poop-zone { display: inline-block; padding: 1px 8px; border: 1px dashed #adb5bd; border-radius: 6px; cursor: pointer; color: #6c757d; outline: none; }
.poop-zone:focus, .poop-zone:hover { border-color: #198754; color: #198754; }
.calendar-cell .day-badges {
    position: absolute;
    top: 2px;
    right: 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    font-size: .62rem;
    line-height: 1.2;
}
.calendar-cell .day-soak { opacity: .8; }
/* at 7 columns per row, a phone-width cell is only ~40px square -- day number + a 3-line badge
   stack (⚠️/💩N/🛁N) + the fed/due fraction genuinely don't all fit and end up overlapping each
   other (verified: the badge stack alone needs ~38px of height in a ~42px cell). Poop/soak/health
   detail is still one tap away (the day's checklist below, or the poop/health pages), so on narrow
   screens the grid keeps just the day number and the fed/due count and drops the rest. */
@media (max-width: 480px) {
    .calendar-cell .day-badges { display: none; }
}
.turtle-row { padding: 2px 0; }
.poop-sub { margin: 2px 0 6px 1.6rem; padding: 6px 8px; background: #f8f9fa; border-radius: 6px; }
.poop-preview { height: 48px; border-radius: 4px; vertical-align: middle; }

/* /feeding/poop photo wall: reuses .tcard/.timg/.toverlay/.tbody/.tline from the roster so the
   overview grid looks the same as the turtle list -- one card per turtle (latest poop); clicking
   one drills into a same-style grid of every record for that turtle. */
/* top-left rather than bottom-left: the note overlay text sits at the bottom of the photo in
   "overlay" text-placement mode, and a bottom-left flag would overlap it */
.poop-flag { position: absolute; top: 6px; left: 6px; font-size: .72em; padding: 1px 7px; border-radius: 10px; font-weight: 600; z-index: 1; }
.poop-flag-white { background: #fff3e0; color: #c05a00; border: 1px solid #fd7e14; }
.poop-flag-inline { font-size: .85em; color: #c05a00; font-weight: 600; }
.poop-tcard.clickable { cursor: pointer; }

/* overview card "stack": the real photo is inset slightly so a plain backer square peeks out from
   behind its bottom-right corner, like a small stack of prints -- entirely within .timg's own box
   (no negative offsets) so it can never spill into a neighboring grid card. Paired with a small
   ×N badge for the exact count, since a peeking corner alone can't distinguish "a few" from "many". */
.poop-tcard.has-stack .timg::before {
    content: ""; position: absolute; right: 0; bottom: 0; width: calc(100% - 3px); height: calc(100% - 3px);
    background: #f1f3f5; border: 1px solid #dee2e6; border-radius: 2px;
}
.poop-tcard.has-stack .timg img { position: absolute; top: 0; left: 0; width: calc(100% - 6px); height: calc(100% - 6px); border: 1px solid #dee2e6; }
.poop-count {
    position: absolute; top: 6px; right: 6px; font-size: .68em; padding: 1px 6px; border-radius: 9px;
    background: rgba(0, 0, 0, .55); color: #fff; font-weight: 600; z-index: 1;
}
.poop-card-note.tline, .tline.poop-card-appetite { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.poop-card-note .editable-note { color: #b02a37; font-weight: 600; }
.poop-card-note .editable-note.empty { color: #9a9a9a; font-weight: 400; }
.toverlay .poop-card-note .editable-note { color: #ffb4a8; text-shadow: 0 1px 2px rgba(0, 0, 0, .9); }
.toverlay .poop-card-note .editable-note.empty { color: #e2e2e2; text-shadow: 0 1px 2px rgba(0, 0, 0, .9); }
.poop-card-note .editable-note input { background: #fff; color: #212529; font-size: inherit; border: 1px solid #adb5bd; border-radius: 3px; padding: 1px 3px; width: 100%; }

.poop-row-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid #dee2e6; }
#poopTable tr.poop-tcard.clickable { cursor: pointer; }
#poopTable tr.poop-tcard.clickable:hover { background: #f8f9fa; }
.poop-zoom { cursor: zoom-in; }
.poop-zoom-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1050; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.poop-zoom-overlay img { max-width: 92vw; max-height: 92vh; object-fit: contain; }
.zoom-status { position: absolute; bottom: 6vh; color: #fff; background: rgba(0,0,0,.65); padding: 6px 16px; border-radius: 16px; font-size: .85rem; cursor: default; }

.temp-popover { position: absolute; background: #fff; border: 1px solid #dee2e6; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.15); padding: 8px; z-index: 5; }

/* expand-in-place: the focused turtle's full history renders in #poopDetail above; the overview
   below it shrinks + dims (instead of disappearing) so the rest of the roster stays visible for
   context and one-click switching, and clicking outside either area collapses back (see poop.html). */
.poop-detail-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #dee2e6; }
.tgrid.poop-muted { --card-w: 92px; opacity: .58; gap: 6px; }
.tgrid.poop-muted .tline { font-size: .85em; }
table.poop-muted { opacity: .58; font-size: .85em; }
.poop-tcard.is-expanded { outline: 2px solid #198754; outline-offset: 1px; }
table.poop-muted tr.is-expanded { outline: 2px solid #198754; outline-offset: -2px; }

.feed-chip.health-chip { border-color: #dc3545; color: #dc3545; }
.feed-chip.health-chip.feed-on { background: #f8d7da; border-color: #dc3545; color: #842029; }
.feed-chip.health-chip.feed-on::before { content: "" !important; }

/* quick-phrase picker: only rendered while a poop_notes editable-note is actively open for
   editing (see edit.js), so it doesn't take up permanent space on a page that's mostly for
   browsing rather than data entry. */
.poop-phrase-picker { margin-top: 4px; }
.poop-phrase-row { margin-top: 2px; line-height: 1.9; }
.poop-phrase-chip {
    display: inline-block; margin: 0 3px 3px 0; padding: 0 7px; font-size: .7rem; line-height: 1.6;
    border: 1px solid #dee2e6; border-radius: 9px; background: #fff; color: #6c757d; cursor: pointer;
}
.poop-phrase-chip:hover { border-color: #198754; color: #198754; }
.poop-phrase-chip.active { background: #d1e7dd; border-color: #198754; color: #0b5d3b; font-weight: 600; }

.tag-chip { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: .78em; line-height: 1.7; white-space: nowrap; }
.tag-chip .tag-x { color: inherit; text-decoration: none; opacity: .6; margin-left: 2px; }
.tag-chip .tag-x:hover { opacity: 1; }
.tag-input { border: 1px dashed #adb5bd; border-radius: 10px; padding: 0 8px; font-size: .85rem; width: 12em; }
.tag-filter { cursor: pointer; border: 1px solid transparent; user-select: none; }
.tag-filter.on { border-color: #212529; box-shadow: 0 0 0 1px #212529; font-weight: 600; }
.tline.tags-line { white-space: normal; }
.tline.tags-line .tag-chip { margin: 0 2px 2px 0; }
.toverlay .tags-line .tag-chip { opacity: .95; }

.group-title { margin: 18px 0 8px; font-weight: 600; }
.group-title:first-child { margin-top: 0; }
tr.group-row td { background: #f1f3f5; font-weight: 600; }

.tcard.inactive { opacity: .55; }
.tcard.inactive .timg img { filter: grayscale(1); }
.badge-inactive { position: absolute; top: 6px; right: 6px; background: #6c757d; color: #fff; font-size: .7em; padding: 1px 6px; border-radius: 4px; }
.ttable tr.inactive-row td { background: #f1f3f5; color: #9aa0a6; }
.ttable tr.inactive-row .name-cell { text-decoration: line-through; }
.ttable tr.inactive-row img { filter: grayscale(1); opacity: .6; }

.selbox { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; accent-color: #198754; pointer-events: none; }
.tcard.selected { outline: 3px solid #198754; }
tr.selected td { background: #d1e7dd !important; }

.hib-chip { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: .78em; line-height: 1.7; white-space: nowrap; font-weight: 600; }
.hib-prep { background: #fff3cd; color: #7a5d00; }
.hib-purge { background: #ffe0cc; color: #8a3b00; }
.hib-start { background: #cfe2ff; color: #0a3d91; }
.hib-end { background: #d1f2eb; color: #0b5d4d; }
.hib-normal { background: #e9ecef; color: #495057; }
.badge-dead { background: #212529 !important; }
.badge-paused { background: #0d6efd !important; }
.badge-health { position: absolute; bottom: 6px; left: 6px; background: #dc3545; color: #fff; font-size: .7em; padding: 1px 6px; border-radius: 4px; }
.nofeed-row .form-check-label { color: #6c757d; }

.wx-day { min-width: 112px; border: 1px solid #dee2e6; border-radius: 8px; padding: 6px 8px; text-align: center; background: #fff; }
.wx-day.wx-ok { background: #e8f5ee; border-color: #b7dfc8; }
.wx-day.wx-caution { background: #fff6dd; border-color: #f1d98c; }
.wx-day.wx-no { background: #fde7e9; border-color: #f0b3b9; }
.wx-text-ok { color: #198754; }
.wx-text-caution { color: #a06a00; }
.wx-text-no { color: #dc3545; }

body[data-role="viewer"] .write-only { display: none !important; }
body[data-beginner-tips="off"] .beginner-hint { display: none !important; }

.turtle-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); gap: 2px 10px; font-size: .85rem; }
.pick-item { display: flex; align-items: center; gap: 5px; margin: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-item input { margin: 0; }
body[data-role="viewer"] .qr-card .paste-zone, body[data-role="viewer"] #qrLabelInput { display: none !important; }

.kpi { background: #fff; border: 1px solid #dee2e6; border-radius: 8px; padding: 6px 10px; height: 100%; }
.kpi-v { font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.kpi-l { font-size: .8rem; color: #495057; }
.lvl { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: .8rem; white-space: nowrap; }
.report-table th.sortable { cursor: pointer; white-space: nowrap; user-select: none; }
.report-table td { font-size: .88rem; }
.advice-cell { min-width: 240px; max-width: 420px; }
.advice-hint { margin: 1px 0 4px 1.6rem; font-size: .78rem; line-height: 1.35; }
.due-chip { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: .72rem; }
.due-yes { background: #d1e7dd; color: #0b5d3b; }
.due-no { background: #e9ecef; color: #6c757d; }

/* today's feed/weigh/soak completion checklist (calendar page), grouped by enclosure so it can be
   scanned the same way the enclosures are physically walked */
#checklist.checklist-loading { opacity: .45; pointer-events: none; transition: opacity .15s; }
.checklist-group { margin-bottom: 10px; }
.checklist-group-head { font-weight: 600; padding: 3px 6px; background: #f8f9fa; border-radius: 4px; display: flex; justify-content: space-between; font-size: .88rem; }
.checklist-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 4px; cursor: pointer; font-size: .85rem; }
.checklist-row:hover { background: #f1f8f4; }
.checklist-row.feed-on { background: #d1e7dd; font-weight: 600; }
.checklist-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.checklist-icons { display: flex; gap: 7px; flex-shrink: 0; }
.chk-group { font-size: .82em; white-space: nowrap; }
/* inline with the 🍖 checkmark, not its own line -- toggling "显示喂食颗数" must not change row
   height (that's what made the list jump on toggle before). Fixed 2-digit-wide and right-aligned
   so the numbers line up down the column instead of each row's width drifting with digit count. */
.chk-delta { display: inline-block; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #6c757d; margin-left: 3px; }
.chk-delta.chk-up { color: #e03131; }    /* 涨 = red, 跌 = green, like a stock ticker */
.chk-delta.chk-down { color: #2f9e44; }
.chk-pellets { display: inline-block; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; color: #6c757d; font-weight: normal; margin-left: 2px; }
.chk { font-weight: 700; margin-left: 1px; }
.chk-ok { color: #198754; }
.chk-due { color: #dc3545; }
.chk-na { color: #ced4da; }

/* compact feeding turtle picker */
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr)); gap: 4px; }
.feed-chip {
    display: flex; align-items: center; gap: 3px; padding: 3px 8px; border: 2px solid #dee2e6; border-radius: 14px;
    font-size: .82rem; cursor: pointer; user-select: none; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-chip:hover { border-color: #198754; }
.feed-chip:focus-visible { outline: 2px solid #0d6efd; outline-offset: 1px; }
.feed-chip.feed-on { background: #d1e7dd; border-color: #198754; color: #0b5d3b; font-weight: 600; box-shadow: 0 1px 3px rgba(25, 135, 84, .35); }
.feed-chip.feed-on::before { content: "✔"; color: #198754; }
/* the ✔ becomes its own flex item and, in .weigh-chip2's column layout, an extra cramped line
   inside the chip's fixed height -- the selected background/border already reads as "selected"
   without it, no need for both. */
.feed-chip.weigh-chip2.feed-on::before { content: none; }
.feed-chip.feed-on .hib-chip { filter: brightness(1.1); }
.feed-chip .hib-chip { padding: 0 5px; font-size: .68rem; line-height: 1.5; }
.feed-chip.weigh-overdue:not(.feed-on) { border-color: #fd7e14; background: #fff8f0; }
/* recently-fed: dim/desaturate instead of changing background, so it still layers correctly with
   .weigh-overdue's own background; makes it easy to skip over already-handled turtles while scanning. */
.feed-chip.fed-recent:not(.feed-on) { opacity: .48; filter: grayscale(.4); }
.feed-chip.fed-recent:not(.feed-on):hover { opacity: .85; filter: none; }
.food-chip { padding: 0 8px; font-size: .78em; }
.food-chip.active { background: #d1e7dd; border-color: #198754; color: #0b5d3b; font-weight: 600; }
.chip-code { font-size: .7rem; opacity: .6; font-weight: 400; margin-left: 1px; }
.feed-chip.feed-on .chip-code { opacity: .8; }
.selected-row { padding: 6px 8px; border: 1px solid #dee2e6; border-radius: 6px; margin-bottom: 4px; background: #f8f9fa; }
/* 喂食/泡澡/体重 used to run together as one undifferentiated block -- a left color bar + faint
   tint per section (matching each section's own emoji/theme) makes it possible to find "the soak
   row" or "the weight box" at a glance instead of reading every line each time. */
.row-block { padding: 4px 6px 4px 8px; border-left: 3px solid transparent; border-radius: 4px; }
.row-block-feed { border-left-color: #fd7e14; background: #fff8f0; }
.row-block-soak { border-left-color: #0dcaf0; background: #eefcff; }
.row-block-weight { border-left-color: #198754; background: #f0f9f4; }

/* weigh chips: two lines (name+code, then weight/trend) instead of the single-line feed chip.
   Fixed height + per-line ellipsis keeps every chip (and so every grid row) the same size,
   regardless of how long a nickname or how wide a weight/delta happens to be. */
.weigh-chip2 { flex-direction: column; align-items: stretch; justify-content: center; gap: 1px; padding: 4px 8px; height: 54px; white-space: normal; }
.weigh-chip2 .wchip-top { display: flex; align-items: baseline; gap: 4px; overflow: hidden; white-space: nowrap; }
.weigh-chip2 .wchip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex-shrink: 1; }
.weigh-chip2 .chip-code, .weigh-chip2 .hib-chip { flex-shrink: 0; }
.weigh-chip2 .wchip-sub { font-size: .72rem; color: #495057; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weigh-chip2.feed-on .wchip-sub { color: #0b5d3b; }
.wchip-delta { font-weight: 600; margin-left: 2px; }
.wchip-delta.up { color: #198754; }
.wchip-delta.down { color: #dc3545; }

/* turtle roster: plain weight text, only "今天" picks up a color when weighed today */
.wtext { font-size: .85em; white-space: nowrap; }
.wtext .wtoday { color: #198754; font-weight: 600; }
.toverlay .wtext .wtoday { color: #6be3a4; }

/* ---- the 记录 button on the feeding page: same flat look as the other buttons, but it says what
   it is about to save and gives feedback while saving ---- */
.rec-bar {
    position: sticky;
    bottom: 0;
    z-index: 1020;
    margin: 0 -.5rem;
    padding: .5rem .5rem .25rem;
    background: #fff;
}
.rec-btn {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: .5rem;
    padding: .35rem .9rem;
    border: 1px solid #198754;
    border-radius: .375rem;
    background: #198754;
    color: #fff;
    font-size: .875rem;
    line-height: 1.5;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent;
}
.rec-btn:not(:disabled):hover { background: #157347; border-color: #146c43; }
.rec-btn:not(:disabled):active { transform: scale(.97); }
.rec-btn:focus-visible { outline: 0; box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .4); }
.rec-btn:disabled { background: #6c757d; border-color: #6c757d; opacity: .65; cursor: not-allowed; }
.rec-main { font-weight: 500; }
.rec-sub { font-size: .75rem; opacity: .85; }
.rec-sub:empty { display: none; }
.rec-spinner {
    display: none;
    align-self: center;
    width: .85rem; height: .85rem;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rec-spin .7s linear infinite;
}
.rec-btn.busy { pointer-events: none; }
.rec-btn.busy .rec-spinner { display: inline-block; }
.rec-btn.done { pointer-events: none; background: #146c43; border-color: #146c43; }
.rec-btn.done .rec-main::before { content: "✓ "; }
.rec-btn.pop { animation: rec-pop .25s ease; }
.rec-btn.shake { animation: rec-shake .4s ease; }
@keyframes rec-pop { 0% { transform: scale(1); } 45% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes rec-spin { to { transform: rotate(360deg); } }
@keyframes rec-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (max-width: 991.98px) {
    /* sit just above the bottom nav so it stays reachable while a long list of rows is open */
    .rec-bar { bottom: calc(38px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #dee2e6; }
    .rec-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .rec-btn, .rec-btn * { animation: none !important; transition: none !important; }
}

/* ---- forum ---- */
.forum-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.forum-tab {
    border: 1px solid #dee2e6; background: #fff; color: #495057; border-radius: 999px;
    padding: .15rem .75rem; font-size: .85rem; text-decoration: none; cursor: pointer;
}
.forum-tab:hover { background: #f1f3f5; color: #212529; }
.forum-tab.active { background: #198754; border-color: #198754; color: #fff; }
.forum-dot {
    position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: #dc3545; color: #fff; font-size: .65rem; line-height: 16px; text-align: center;
}
.nav-dot { position: absolute; top: 4px; margin-left: 22px; width: 7px; height: 7px; border-radius: 50%; background: #dc3545; }
.bottom-nav-item { position: relative; }
.forum-item { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.forum-item-main { min-width: 0; flex: 1; }
.forum-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.forum-title .badge { font-weight: 500; vertical-align: 1px; }
.forum-excerpt { color: #6c757d; font-size: .85rem; margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.forum-meta { color: #868e96; font-size: .75rem; margin-top: .3rem; }
.forum-avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; margin-right: .3rem;
    border-radius: 50%; background: #6c757d; color: #fff; font-size: .7rem; font-weight: 600; vertical-align: middle;
}
.forum-thumb { position: relative; flex: none; width: 76px; height: 76px; border-radius: .375rem; overflow: hidden; background: #f1f3f5; }
.forum-thumb img { width: 100%; height: 100%; object-fit: cover; }
.forum-thumb span { position: absolute; right: 3px; bottom: 3px; background: rgba(0,0,0,.55); color: #fff; font-size: .65rem; padding: 0 5px; border-radius: 8px; }
.forum-unread { background: #f0faf4; border-left: 3px solid #198754; }
.forum-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.forum-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .4rem; }
.forum-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .375rem; cursor: zoom-in; }
.forum-comment { padding: .6rem .75rem; border: 1px solid #e9ecef; border-radius: .375rem; background: #fff; margin-bottom: .5rem; }
.forum-comment.accepted { border-color: #198754; background: #f0faf4; }
.forum-comment.flash { animation: forum-flash 1.8s ease; }
@keyframes forum-flash { 0% { background: #fff3cd; } 100% { background: #fff; } }
.forum-quote { font-size: .8rem; color: #868e96; border-left: 3px solid #dee2e6; padding-left: .5rem; margin-bottom: .3rem; overflow-wrap: anywhere; }
.forum-previews { display: flex; flex-wrap: wrap; gap: .4rem; }
.forum-preview { position: relative; width: 84px; height: 84px; }
.forum-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: .375rem; }
.forum-preview button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: #dc3545; color: #fff; line-height: 1; }
.forum-snap:empty { display: none; }
.forum-snap { border: 1px solid #dee2e6; border-radius: .375rem; padding: .6rem .75rem; background: #fff; }
.forum-snap .fs-sec { margin-top: .5rem; }
.forum-snap .fs-label { font-size: .75rem; color: #868e96; margin-bottom: .15rem; }
.forum-snap .fs-chart { height: 130px; }
.forum-snap .fs-chip { display: inline-block; font-size: .78rem; background: #f1f3f5; border-radius: 999px; padding: 0 .55rem; margin: 0 .3rem .3rem 0; }
.forum-snap .fs-shots { display: flex; flex-wrap: wrap; gap: .5rem; }
.forum-snap .fs-shot img { width: 92px; height: 92px; object-fit: cover; border-radius: .375rem; cursor: zoom-in; display: block; }

.about-page { max-width: 720px; }
.about-page ul { padding-left: 1.2rem; }
.about-page li { margin-bottom: .25rem; }
.site-footer { margin-top: 2rem; text-align: center; font-size: .8rem; }
.site-footer a { color: #868e96; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.forum-list.batch-on .forum-item { cursor: pointer; position: relative; padding-left: 2.2rem; }
.forum-list.batch-on .forum-item::before {
    content: ""; position: absolute; left: .7rem; top: 50%; width: 1rem; height: 1rem; margin-top: -.5rem;
    border: 2px solid #adb5bd; border-radius: 3px; background: #fff;
}
.forum-list.batch-on .forum-item.picked { background: #fff5f5; }
.forum-list.batch-on .forum-item.picked::before { background: #dc3545; border-color: #dc3545; box-shadow: inset 0 0 0 2px #fff; }
.forum-locked { color: #868e96; }

.demo-card { overflow: hidden; }
.demo-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.demo-card-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f1f3f5; font-size: 2rem; }
.demo-grid { font-size: .85rem; }

.profile-avatar { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: #6c757d; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 600; margin: 0 auto; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

img.forum-avatar { object-fit: cover; background: #e9ecef; }
.forum-comment .forum-avatar, .forum-meta .forum-avatar { flex: none; }

.imp-bar { position: sticky; top: 0; z-index: 1100; background: #ffc107; color: #212529; padding: .3rem .75rem; font-size: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
