/* =========================================
   6. COMPENDIUM ACCORDION & GRID ENGINE
   ========================================= */
.compendium-category summary {
    background: #2a2a2a;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 2px solid #8b0000;
    margin-bottom: 10px;
}

.grid-carousel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 30px; 
}

.compendium-grid {
    display: flex; /* Switched to flex to hold the pages horizontally */
    gap: 20px; /* Space between pages */
    width: 100%;
    /* Exactly a 5x3 page's own height (3 x 54px cards + 2 x 10px gap = 182,
       + 2 x 5px grid padding = 192) - not a guessed number. Page height never
       varies with item count, since grid-template-rows is fixed at 3 rows
       regardless of how many cells are filled, so this is precise for every
       grid-layout subsection, not just one. Was 290px, which left ~100px of
       dead space under every grid page - invisible until something sat right
       below it, which is what made the gap above the fish detail panel obvious.
       Row layout already overrides this to 0 below; that override is unaffected. */
    min-height: 192px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 5px;
    
    /* Prepares the UI for mobile touch scrolling later */
    scroll-snap-type: x mandatory; 
}

/* The individual 5x3 pages inside the track */
.compendium-page {
    display: grid;
    /* 5 across, 3 down - the same shape as the compendium page in game, so the
       player reads across their screen and across this without translating. */
    grid-template-columns: repeat(5, 82px);
    grid-template-rows: repeat(3, 54px);

    gap: 10px;
    flex: 0 0 auto; /* Forces the page to never shrink or stretch */
    scroll-snap-align: start; /* Snaps perfectly to the left edge when swiping */
}

/* Equipment page in game: 4 across, 5 down. */
.compendium-page.page-grid4 {
    grid-template-columns: repeat(4, 82px);
    grid-template-rows: repeat(5, 54px);
}

/* 5 rows instead of 3: (5 x 54px cards + 4 x 10px gap) + 2 x 5px grid padding.
   Width is also capped to one page (4 x 82px cards + 3 x 10px gap + 2 x 5px
   padding = 368px) - the 5-across pages happen to fill the sidebar almost
   exactly so the next page's edge never peeks past overflow-x:hidden, but a
   4-across page is narrower and left uncapped the first column of page 2 sat
   in that leftover space, looking like 5 columns instead of 4. */
.compendium-grid.layout-grid4 { min-height: 300px; width: 368px; max-width: 100%; }

/* Left/Right Nav Arrows */
.nav-arrow {
    position: absolute;
    background: #333;
    color: white;
    border: 1px solid #555;
    height: 40px;
    width: 30px;
    cursor: pointer;
    z-index: 10;
    font-size: 16px;
}
.nav-arrow:hover { background: #555; }
.left-arrow { left: 0; }
.right-arrow { right: 0; }

/* =========================================
   7. ANIMAL CARDS & STATE STYLING
   ========================================= */
.animal-card {
    /* Without this a card is content-box, so its 5px padding and 2px border
       add 14px OUTSIDE the grid column and every card renders --card-w + 14.
       The whole --card-w derivation at the bottom of this file - including
       --sidebar-width - assumes a card is exactly --card-w wide, so the fifth
       card of a row was pushed past the track and clipped while the carousel
       still paged by five. 2026-08-19: "some cards that are meant to display 5
       only show 4 but still scroll 5." */
    box-sizing: border-box;
    /* Fixed: Lightened the brown so it doesn't look completely black */
    background: #3d3126; 
    border: 2px solid #5c4e40;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5px;
    user-select: none; 
    transition: all 0.1s ease;
}

.card-title {
    font-size: 10px;
    line-height: 1.15;
    /* `word-wrap: break-word` only breaks a word that has nowhere else to go,
       and it measures against the longest WORD - so "BINOCULARS" and
       "CATTLEMAN REVOLVER" still pushed a few pixels past a card that is now
       exactly --card-w rather than --card-w + 14. `anywhere` also lets the
       browser count the break opportunity when sizing, which is the half that
       was missing. */
    word-wrap: break-word;
    overflow-wrap: anywhere;
    overflow: hidden;
    color: #e0d8c0; /* Ensures text is visible */
}

.state-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 10px;
    font-weight: bold;
}

/* State 1: None (Default) */
.animal-card[data-state="none"] {
    opacity: 0.6;
}

/* State 2: Tracking (Yellow Border) */
.animal-card[data-state="tracking"] {
    border-color: #f1c40f;
    background: #4a3c2e; /* Lightens up slightly when active */
    opacity: 1;
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}
.animal-card[data-state="tracking"] .state-indicator::after {
    content: '🎯';
}

/* State 3: Completed (Faded, Green Check) */
.animal-card[data-state="completed"] {
    border-color: #2e8b57;
    opacity: 0.4;
}
.animal-card[data-state="completed"] .state-indicator::after {
    content: '✓';
    color: #2e8b57;
}

/* State 4: Both (Yellow Border AND Green Check) */
.animal-card[data-state="both"] {
    border-color: #f1c40f;
    opacity: 1;
}
.animal-card[data-state="both"] .state-indicator::after {
    content: '✓🎯';
}

/* Card variants */
.animal-card { font-family: inherit; }
.animal-card:focus-visible { outline: 2px solid #f1c40f; outline-offset: 2px; }

.animal-card.card-missable {
    border-color: #b71c1c;
    background: #4a2a26;
}

.warning-badge {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: #b71c1c;
    color: #fff;
    font-size: 6px;
    letter-spacing: 0.5px;
    padding: 1px 0;
}
.animal-card.card-missable .card-title { margin-top: 8px; }

/* 2026-08-12: "The card should also display the reward not just the item
   your fetching" - a second, quieter line under the name. Same size class as
   card-count, which already proves a second line fits a 54px card without
   the title getting crowded out. */
.card-reward {
    margin-top: 2px;
    color: #9a927f;
    font-size: 8px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Unique reward outranks plain missable as the headline fact - gold instead
   of the red "you can lose this" badge, same corner. */
.warning-badge.badge-unique { background: #c8a951; color: #241d15; }

/* Nothing to draw on the map for this one - don't let it look trackable. */
.animal-card.no-map-data {
    border-style: dashed;
    border-color: #6b6b6b;
}
.animal-card.no-map-data .card-title { color: #9a927f; font-style: italic; }

/* Crafted items (trapper clothing, satchels, talismans, pamphlets...) never
   have a location - that's a fact about the item, not a gap, so it does not
   get the dashed "nobody has filled this in yet" treatment. 2026-08-12:
   "remove the dotted outline... I don't know maybe it's nice to visually
   convey they don't have a location" - a small corner tick reads as "made",
   distinct from the no-map-data dashed border, without borrowing its meaning. */
.animal-card.craft-only {
    position: relative;
}
.animal-card.craft-only::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent #4a4335 transparent transparent;
}

/* Occupies its slot but says nothing else - the point is the position, not
   the card. 2026-08-12: "it needs to show a blank card with a lock... because
   the ordering is important for keeping track of what's what." */
.animal-card.card-locked {
    background: #2a2420;
    border-style: dashed;
    border-color: #4a4335;
    cursor: default;
    opacity: 0.55;
}
.card-lock-icon { font-size: 16px; opacity: 0.7; }

.grid-empty { color: #ffab00; padding: 10px; font-size: 12px; }
.cat-count { float: right; color: #9a927f; font-weight: normal; font-size: 12px; }

/* ---- Taxonomy navigation (Track view) ---------------------------------- */

#taxonomy-search {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    margin-bottom: 10px;
    background: #262626;
    border: 1px solid #4a4a4a;
    color: #e0d8c0;
    font-family: inherit;
    font-size: 12px;
}

/* Search results - one row per matching ITEM, above the section accordion.
   See setupSearch in js/trackView.js for why the box does both jobs. */
.taxonomy-results {
    list-style: none;
    margin: 0 0 10px 0;
    padding: 0;
    /* Long result sets scroll inside the list rather than pushing the whole
       accordion off screen - on a phone the sidebar IS the screen. */
    max-height: 45vh;
    overflow-y: auto;
    border: 1px solid #4a4a4a;
    background: #202020;
}
.taxonomy-results[hidden] { display: none; }

.ts-hit {
    display: flex;
    align-items: stretch;
    gap: 6px;
    border-bottom: 1px solid #333;
}
.ts-hit:last-child { border-bottom: none; }

.ts-go {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    padding: 7px 9px;
    background: none;
    border: none;
    /* The row is the tap target, so it must not be narrower than the text. */
    text-align: left;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}
.ts-go:hover { background: #2c2c2c; }

.ts-name { font-size: 12px; color: #e0d8c0; }
.ts-meta { font-size: 9px; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.5px; }

/* Same red the map and the cards use for a missable - see MISSABLE_COLOUR. */
.ts-missable .ts-name { color: #ff8a8a; }

.ts-track {
    align-self: center;
    margin: 0 8px 0 0;
    padding: 5px 10px;
    white-space: nowrap;
}

/* Already tracked / done, so the button reads as a state rather than an offer. */
.ts-hit[data-state="tracking"] .ts-track { border-color: #c8a951; color: #c8a951; }
.ts-hit[data-state="completed"] .ts-track { border-color: #4a7c4a; color: #7cc47c; }

.ts-empty, .ts-more {
    padding: 8px 9px;
    font-size: 10px;
    opacity: 0.6;
    font-style: italic;
}

/* Brief highlight on the card a search result jumped to, so the eye can find
   it in a 15-card page without the row having to scroll to the very top. */
@keyframes card-found-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 169, 81, 0); }
    30%      { box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.85); }
}
.animal-card.card-found { animation: card-found-pulse 1.6s ease-in-out; }

.tx-section { margin-bottom: 6px; }
.tx-section[hidden], .tx-group[hidden], .tx-subsection[hidden] { display: none; }

.tx-section > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2a2a;
    padding: 9px 10px;
    cursor: pointer;
    border-bottom: 2px solid #8b0000;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}
.tx-section-name { flex: 1; }

.tx-group { padding: 6px 0 2px 0; }
.tx-group-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #8a7f6d;
    padding: 6px 4px 4px;
}

.tx-subsection { margin: 0 0 2px 6px; }
.tx-subsection > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    background: #212121;
    border-left: 2px solid #5c4e40;
    font-size: 12px;
}
.tx-subsection > summary:hover { background: #2b2b2b; }
.tx-label { flex: 1; }
.cat-count { color: #9a927f; font-size: 11px; font-variant-numeric: tabular-nums; }

/* Declared in the taxonomy but with no data behind it. Must never look
   tickable - it's a gap in the data, not something the player missed. */
.tx-subsection.is-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #1c1c1c;
    border-left: 2px solid #333;
    font-size: 12px;
    color: #6a6a6a;
}
.tx-pending {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6a5f4d;
    border: 1px solid #3a3228;
    padding: 1px 5px;
}

.grid-carousel-wrapper.single-page .nav-arrow { display: none; }
.grid-carousel-wrapper.single-page { padding: 0 6px; }

.taxonomy-orphans {
    font-size: 11px;
    color: #c8a951;
    background: #2a2416;
    border-left: 3px solid #c8a951;
    padding: 8px 10px;
    margin-top: 10px;
    line-height: 1.5;
}
.taxonomy-orphans[hidden] { display: none; }

/* Short lists are a single row in game (legendary animals, fish, horses). */
.compendium-page.page-row {
    grid-template-columns: repeat(5, 82px);
    grid-template-rows: 54px;
}
.compendium-grid.layout-row { min-height: 0; }

/* ---- Detail panel (horses) --------------------------------------------- */

.animal-card.is-expandable.is-selected {
    outline: 2px solid #c8a951;
    outline-offset: 1px;
}

.tx-detail {
    margin: 8px 6px 4px;
    padding: 10px 12px;
    background: #1c1c1c;
    border-left: 3px solid #c8a951;
    font-size: 12px;
}
.tx-detail[hidden] { display: none; }

.dp-head { display: flex; align-items: center; margin-bottom: 8px; }
.dp-name {
    flex: 1;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 12px;
}
.dp-close { background: none; border: none; color: #999; cursor: pointer; font-size: 14px; }

.dp-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.dp-check { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.dp-check input { accent-color: #8b0000; cursor: pointer; }
.dp-field-label { color: #8a7f6d; min-width: 52px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

/* Bonding is 0-4 and reads as a filled meter, not a number field - it's a
   level you climb, and the shape should say so at a glance. */
.dp-bond { display: flex; gap: 3px; }
.dp-bond-step {
    width: 24px;
    height: 22px;
    background: #262626;
    border: 1px solid #4a4a4a;
    color: #6a6a6a;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
}
.dp-bond-step.is-set { background: #4a3c2e; border-color: #c8a951; color: #e0d8c0; }
.dp-bond-step.is-current { box-shadow: inset 0 0 0 1px #c8a951; }
.dp-bond-note { color: #c8a951; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }

.dp-pins { color: #8a8a8a; font-size: 11px; }

.dp-coat-select {
    background: #262626;
    color: #e0d8c0;
    border: 1px solid #4a4a4a;
    padding: 3px 6px;
    font-family: inherit;
    font-size: 12px;
}
.dp-acquire { color: #c0b8a0; margin: 4px 0 8px; line-height: 1.5; }
.dp-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-stat {
    display: flex;
    gap: 6px;
    background: #262626;
    border: 1px solid #3a3a3a;
    padding: 3px 8px;
}
.dp-stat-name { color: #8a7f6d; text-transform: capitalize; font-size: 11px; }
.dp-stat-value { color: #e0d8c0; font-variant-numeric: tabular-nums; }

/* Says why it's empty. An empty dropdown would read as "this horse has no
   coats" rather than "nobody has typed them in yet". */
.dp-pending {
    color: #8a7f6d;
    background: #221f18;
    border: 1px dashed #3a3228;
    padding: 8px 10px;
    line-height: 1.5;
    font-size: 11px;
}

/* A real fact about the recipe (bought consumables it also needs, where the
   pamphlet is obtained), not a gap - solid border, not dashed, so it doesn't
   read as the same "nobody filled this in" message as .dp-pending. */
.dp-note {
    color: #9a927f;
    background: #1c1a17;
    border: 1px solid #3a3228;
    padding: 7px 9px;
    margin-top: 6px;
    line-height: 1.5;
    font-size: 11px;
}

/* One pip per compendium task. The game shows an entry as half-filled when you
   have done some but not all of them; done/not-done alone loses that. */
.card-tasks { display: flex; gap: 3px; margin-top: 3px; }
.task-dot {
    width: 7px;
    height: 7px;
    border: 1px solid #6a6250;
    background: transparent;
    border-radius: 50%;
}
.task-dot.is-done { background: #c8a951; border-color: #c8a951; }

/* Same fact as the pips, for entries with too many units to draw them. */
.task-tally {
    color: #6a6250;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.task-tally.is-done { color: #c8a951; }

.dp-progress {
    color: #8a7f6d;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    margin-right: 8px;
}
.dp-progress.is-complete { color: #c8a951; }
.dp-tasks { display: flex; flex-direction: column; gap: 2px; margin-bottom: 9px; }

/* One line per task, its boxes ranged right so every line's boxes start from
   the same edge and the column reads as a tally rather than a form. A task done
   N times is one line with N boxes, not N labelled rows. */
.dp-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px solid #262320;
}
.dp-task:last-child { border-bottom: none; }
.dp-task-name { flex: 1; color: #c0b8a0; font-size: 11px; }
.dp-task-tally {
    color: #6a6250;
    font-size: 10px;
    margin-left: 6px;
    font-variant-numeric: tabular-nums;
}
.dp-task-boxes { display: flex; gap: 3px; }
.dp-task-box {
    width: 14px;
    height: 14px;
    padding: 0;
    background: #262626;
    border: 1px solid #4a4a4a;
    cursor: pointer;
}
.dp-task-box:hover { border-color: #8a7f6d; }
.dp-task-box.is-done { background: #c8a951; border-color: #c8a951; }

/* One row per material a recipe needs. Same visual language as .dp-task above -
   a tally you tick off, not a settings dialog - because it is the same gesture.
   The box is deliberately identical: ticking a pelt and ticking a compendium
   task are the same kind of act. */
.dp-mats { margin: 6px 0; }
.dp-mat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #262320;
}
.dp-mat:last-child { border-bottom: none; }
.dp-part-box {
    width: 14px;
    height: 14px;
    padding: 0;
    flex: none;
    background: #262626;
    border: 1px solid #4a4a4a;
    cursor: pointer;
}
.dp-part-box:hover { border-color: #8a7f6d; }
.dp-part-box.is-done { background: #c8a951; border-color: #c8a951; }
.dp-part-boxes { display: flex; gap: 3px; flex: none; }
.dp-mat-name { flex: 1; color: #c0b8a0; font-size: 11px; }
.dp-mat-part { flex: 1; color: #6a6250; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.dp-mat-tag {
    flex: none;
    color: #8a7f6d;
    border: 1px solid #3a3228;
    padding: 1px 4px;
    font-size: 9px;
    letter-spacing: 1px;
}
.dp-mat-tag.is-missable { color: #d08a70; border-color: #5a3020; }
.dp-mat-tag.badge-unique { color: #241d15; background: #c8a951; border-color: #c8a951; }
/* The highest-value thing this panel can say: the item you want needs an animal
   you can no longer get. It gets the loudest treatment on the row. */
.dp-mat-tag.is-lost { color: #e08070; border-color: #7a2020; background: #3a1010; }
.dp-mat-map {
    flex: none;
    background: #262626;
    border: 1px solid #4a4a4a;
    color: #c0b8a0;
    padding: 2px 7px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
}
.dp-mat-map:hover { background: #4a3c2e; border-color: #c8a951; color: #e0d8c0; }

/* One block per requirement: what it wants and how many, then one .dp-mat line
   per animal that can supply it. Single-candidate requirements use the same
   shape, so "how many do I need" is always in the same place. */
.dp-mat-group { margin: 4px 0; }
.dp-mat-group.is-met .dp-mat-group-label { color: #7a8a5a; }
.dp-mat-group-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #6a6250;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 0 2px;
}
.dp-mat-tally { font-variant-numeric: tabular-nums; color: #8a7f6d; }
.dp-mat-any { color: #4a453c; letter-spacing: 0.5px; }
.dp-mat-group .dp-mat { padding-left: 10px; }

/* The MATERIAL's own row - "Snake Skin", not twelve snakes. This is the line
   the recipe is actually asking for, so it reads at full strength and the
   species underneath are dimmed and folded away. */
.dp-mat-head { padding-left: 0; }
.dp-mat-head .dp-mat-name {
    color: #d8cfb4;
    font-size: 12px;
    letter-spacing: 0.3px;
}
.dp-mat-group.is-met .dp-mat-head .dp-mat-name { color: #8fa06a; }

/* Folded by default. `summary` is the only affordance that says the species
   are still there, so it must not look like a heading you cannot click. */
.dp-mat-sources > summary {
    cursor: pointer;
    padding: 2px 0 2px 10px;
    color: #5c5648;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    list-style: none;
}
.dp-mat-sources > summary::-webkit-details-marker { display: none; }
.dp-mat-sources > summary::before {
    content: '▸ ';
    display: inline-block;
    width: 10px;
    transition: transform 0.12s ease;
}
.dp-mat-sources[open] > summary::before { transform: rotate(90deg); }
.dp-mat-sources > summary:hover { color: #a89b7e; }
.dp-mat-sources .dp-mat { padding-left: 20px; }
.dp-mat-sources .dp-mat-name { color: #8a8270; }

/* The lit ingredient. Only ever one at a time, so this can be loud. */
.dp-mat-map.is-lit {
    background: #c8a951;
    border-color: #c8a951;
    color: #241d15;
}
.dp-mat-map.is-lit:hover { background: #d8b961; color: #241d15; }

/* The favourite star. Off it is nearly invisible - it is an opt-in highlight,
   not a control competing with the item's name for attention. */
.dp-fav {
    flex: none;
    background: none;
    border: none;
    color: #3a3630;
    font-size: 13px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}
.dp-fav:hover { color: #8a7f6d; }
.dp-fav.is-on { color: #c8a951; }

/* Having every material is not owning the coat - you still have to walk to the
   trapper and pay. So this announces the fact and offers the tick, rather than
   silently flipping "crafted" and dropping the item out of the hunt list before
   you have been. 2026-08-10: "when you've checked all the boxes for
   materials it doesn't mark as crafted." */
.dp-ready {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0;
    padding: 6px 8px;
    background: #1e2416;
    border: 1px solid #4a5a30;
    color: #a8c070;
    font-size: 11px;
}
.dp-show-range {
    background: #262626;
    border: 1px solid #4a4a4a;
    color: #c0b8a0;
    padding: 4px 9px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    margin-top: 8px;
}
.dp-show-range:hover { background: #4a3c2e; border-color: #c8a951; color: #e0d8c0; }

/* Range controls, now inside the fish's own detail panel rather than a separate
   sidebar disclosure - design note: "avoid clutter and put things in menus". */
.dp-range { border-top: 1px solid #3a3228; margin-top: 9px; padding-top: 8px; }
.dp-range .dp-field-label { display: block; margin-bottom: 5px; }
.dp-range .dp-check { font-size: 11px; margin-bottom: 3px; }
.dp-range input[type="radio"] { accent-color: #8b0000; cursor: pointer; }
.dp-rivals { color: #8a7f6d; font-size: 10px; margin: 6px 0 0; line-height: 1.4; }

/* The animal spawn surface, in the card. Same slot and same border as the
   fish range above it - both answer "where does this live", and both answer it
   with an overlay rather than pins. */
.dp-heat { border-top: 1px solid #3a3228; margin-top: 9px; padding-top: 8px; }
.dp-heat .dp-field-label { display: block; margin-bottom: 5px; }
.dp-heat-hour {
    background: #262626;
    border: 1px solid #4a4a4a;
    color: #c0b8a0;
    font-family: inherit;
    font-size: 11px;
    padding: 2px 6px;
    cursor: pointer;
}
.dp-heat-note {
    color: #8a7f6d;
    font-size: 10px;
    line-height: 1.4;
    margin: 6px 0 0;
}
.dp-heat-note em { color: #c9a227; font-style: normal; }
.dp-heat .dp-facts { margin-top: 6px; }
.dp-heat .dp-check { display: block; font-size: 11px; margin-top: 4px; }
.dp-heat input[type="radio"] { accent-color: #c9761f; cursor: pointer; }
.dp-heat input[type="checkbox"] { accent-color: #c9761f; cursor: pointer; }
.dp-heat-legend {
    align-items: center;
    color: #c0b8a0;
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    gap: 4px 8px;
    margin-top: 8px;
}
.dp-heat-clear {
    background: #2a2a2a;
    border: 1px solid #4a4a4a;
    color: #c0b8a0;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    margin-left: auto;
    padding: 1px 7px;
}
.dp-heat-clear:hover { background: #3a3a3a; }
/* The PNG export. Sits under the mark facts, on the same panel as the chance
   legend, and takes the hour and scale already selected above it. */
.dp-heat-export-row {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 8px 0 4px;
}
.dp-heat-export {
    background: #3b3223;
    border: 1px solid #6a5a3c;
    color: #e5d6b4;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    padding: 3px 10px;
}
.dp-heat-export:hover:not(:disabled) { background: #4b4029; }
.dp-heat-export:disabled { cursor: progress; opacity: .7; }
.dp-heat-export-note {
    color: #8a8272;
    font-size: 10px;
}
.dp-swatch {
    border: 1px solid rgba(0, 0, 0, .5);
    display: inline-block;
    height: 9px;
    width: 9px;
}
/* Twenty four hours in a row. Each bar's height is that hour's share of the
   animal's own best hour, and its colour is the same five bands as the marks.
   A fixed 34 px track so the bars line up across animals. */
/* The headline number, above the controls. */
.dp-heat-peak {
    color: #e0cfae;
    font-size: 13px;
    margin: 2px 0 6px;
}
.dp-hours { margin: 8px 0 6px; }
.dp-hour-strip {
    align-items: flex-end;
    background: #1b1814;
    border: 1px solid #3a342a;
    display: flex;
    gap: 1px;
    height: 34px;
    padding: 2px;
}
.dp-hour-bar {
    align-items: flex-end;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    flex: 1;
    height: 100%;
    min-width: 0;
    padding: 0;
}
.dp-hour-bar > span { display: block; width: 100%; }
.dp-hour-bar:hover { background: rgba(240, 226, 200, .12); }
.dp-hour-bar.is-now { background: rgba(240, 226, 200, .22); }
.dp-hour-scale {
    color: #7d7566;
    display: flex;
    font-size: 9px;
    justify-content: space-between;
    padding: 2px 2px 0;
}

/* Marks live outside .dp-facts: that is a two-column grid for key/value pairs
   and the key below is neither - dropping it in there squeezed the info box
   into the 90 px label column. */
.dp-heat-marks { display: block; margin: 6px 0 8px; }
.dp-fact-loose { display: flex; flex-wrap: wrap; gap: 2px 8px; }

/* The placement-system key: a glyph, a count and a name per system, on one
   wrapping line. The explanation is behind the `i` button - five systems each
   needing a sentence of qualification is a wall of text on a card you open to
   check one number. */
.dp-mark-key {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 6px 0 4px;
}
.dp-mark {
    align-items: center;
    color: #b9ae96;
    display: inline-flex;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
}
.dp-mark b { color: #e0cfae; font-weight: 600; }
.dp-mark-glyph { color: #c8bda4; display: inline-flex; }
.dp-glyph { height: 12px; width: 12px; vertical-align: -2px; }
.dp-mark-info {
    background: #2a2a2a;
    border: 1px solid #5a5242;
    color: #c8bda4;
    cursor: pointer;
    font-family: Georgia, serif;
    font-size: 10px;
    font-style: italic;
    height: 16px;
    line-height: 1;
    margin-left: auto;
    padding: 0;
    width: 16px;
}
.dp-mark-info:hover { background: #3a3a3a; color: #f0e2c8; }
.dp-mark-help {
    background: #1d1a15;
    border: 1px solid #4a4234;
    color: #b9ae96;
    font-size: 11px;
    line-height: 1.45;
    margin: 4px 0 8px;
    padding: 8px 10px;
}
.dp-mark-help p { margin: 0 0 7px; }
.dp-mark-help p:last-child { margin-bottom: 0; }
.dp-mark-help b { color: #e0cfae; }
.dp-mark-list { list-style: none; margin: 0 0 7px; padding: 0; }
.dp-mark-list li { margin-bottom: 5px; }
.dp-mark-list .dp-glyph { color: #c8bda4; margin-right: 2px; }
.dp-mark-help .dp-chance-key { margin: -2px 0 7px; }
.dp-mark-foot { border-top: 1px solid #3a342a; color: #8a8272; padding-top: 6px; }

/* The scenario dots' chance bands. Wraps rather than scrolls - the card is
   narrow and five labelled swatches do not fit on one line at every width. */
.dp-chance-key {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: 4px;
}
.dp-chance-band {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    white-space: nowrap;
}


.fc-range {
    background: #262626;
    border: 1px solid #4a4a4a;
    color: #c0b8a0;
    padding: 2px 8px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}
.fc-range:hover { background: #4a3c2e; border-color: #c8a951; color: #e0d8c0; }

/* A counter is a number field, not a meter you climb - 144 steps would be a
   silly shape. Buttons flank a typeable value so a shop run's worth of cards
   goes in with two clicks and a mid-playthrough total goes in with one entry. */
.dp-count-row { flex-wrap: wrap; gap: 4px; }
.dp-count-row .dp-field-label { flex-basis: 100%; margin-bottom: 2px; }
.dp-count-step {
    min-width: 30px;
    height: 24px;
    background: #262626;
    border: 1px solid #4a4a4a;
    color: #c0b8a0;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
}
.dp-count-step:hover { background: #4a3c2e; border-color: #c8a951; color: #e0d8c0; }
.dp-count-input {
    width: 56px;
    height: 24px;
    background: #1a1a1a;
    border: 1px solid #4a4a4a;
    color: #e0d8c0;
    font-family: inherit;
    font-size: 12px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.dp-count-total { color: #8a7f6d; font-size: 11px; }

.dp-count-bar { height: 5px; background: #262626; border: 1px solid #3a3a3a; margin: 2px 0 9px; }
.dp-count-bar span { display: block; height: 100%; background: #c8a951; }

/* Same treatment as .dp-pending: this is the reason the entry isn't a list of
   144, and it should read as an explanation rather than a stray tip. */
.dp-count-note {
    color: #8a7f6d;
    background: #221f18;
    border: 1px dashed #3a3228;
    padding: 8px 10px;
    line-height: 1.5;
    font-size: 11px;
}

/* The card's face for a counter: the tick can't say 37, so the number does. */
.card-count {
    margin-top: 3px;
    color: #c8a951;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Row-layout cards carry a longer name (breed names, legendary animals), so
   they get the width a 5-across grid cell can't give them. */
.compendium-page.page-row .animal-card { width: 100%; }

/* Coat detail within the horse panel */
.dp-coat-tally { color: #c8a951; font-size: 11px; font-variant-numeric: tabular-nums; }
.dp-owned-row { margin: 8px 0 6px; }

.dp-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0 8px; }
.dp-fact { display: contents; }
.dp-fact-key {
    color: #8a7f6d;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: center;
}
.dp-fact-value { color: #c0b8a0; line-height: 1.4; }

.dp-missable {
    background: #4a1010;
    border-left: 3px solid #b71c1c;
    color: #ff9b9b;
    padding: 5px 8px;
    margin: 6px 0;
    font-size: 11px;
}
.dp-npc {
    color: #8a7f6d;
    font-style: italic;
    border-left: 2px solid #3a3228;
    padding: 4px 8px;
    margin: 6px 0;
    font-size: 11px;
    line-height: 1.5;
}

/* ---- Compare Horses ----------------------------------------------------- */

.tx-action {
    display: block;
    margin: 6px 6px 4px;
    padding: 5px 10px;
    background: #3d3126;
    color: #e0d8c0;
    border: 1px solid #5c4e40;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
}
.tx-action:hover { background: #4a3c2e; }
.tx-bulk-track { display: flex; }
.tx-bulk-track .tx-action { flex: 1; }

/* =========================================
   RESPONSIVE
   =========================================
   Everything above was authored at one size. The card grid is the constraint:
   the sidebar width is DERIVED from a 5-across page (see the top of this file),
   so making the app scale means scaling the card, not overriding the widths one
   at a time. --card-w/--card-h are those numbers; the derivation is unchanged,
   just written in terms of them. 2026-08-10: "the fixed pixel sizes make
   it impossible to scale this around."

   The sidebar width is DERIVED, not chosen: it has to contain a full 5x3
   compendium page at the game's own card size, or the fifth column clips.
     page      5 x card + 4 x 10px gap
     grid      + 2 x  5px padding
     carousel  + 2 x 30px arrow gutters
     sidebar   + 2 x 15px padding
     scrollbar + ~20px
   Change the card size and this changes with it. */
:root {
    --card-w: clamp(56px, 5.6vw, 82px);
    --card-h: clamp(37px, 3.7vw, 54px);
    --sidebar-width: calc(5 * var(--card-w) + 4 * 10px + 10px + 60px + 30px + 20px);
}
.compendium-page { grid-template-columns: repeat(5, var(--card-w)); grid-template-rows: repeat(3, var(--card-h)); }
.compendium-page.page-grid4 { grid-template-columns: repeat(4, var(--card-w)); grid-template-rows: repeat(5, var(--card-h)); }
/* page-row was left behind when the fixed 82px sizes moved to --card-w, so it
   kept `repeat(5, 82px)` while the sidebar around it shrank. Five cards no
   longer fit, the fifth was clipped, and the carousel still paged by five -
   2026-08-19: "some cards that are meant to display 5 only show 4 but still
   scroll 5. These are Legendary animals, legendary fish, gangs, horses, and
   camp request", which is every layout:'row' subsection. */
.compendium-page.page-row { grid-template-columns: repeat(5, var(--card-w)); grid-template-rows: var(--card-h); }
.compendium-grid { min-height: calc(3 * var(--card-h) + 2 * 10px + 10px); }
.compendium-grid.layout-grid4 {
    min-height: calc(5 * var(--card-h) + 4 * 10px + 10px);
    width: calc(4 * var(--card-w) + 3 * 10px + 10px);
}

@media (max-width: 780px) {
    :root { --card-w: clamp(52px, 17vw, 82px); --card-h: clamp(34px, 11vw, 54px); }

    /* A card's size is its grid cell's, never the phone's touch minimum. */
    .animal-card { min-height: 0; }
    .nav-arrow { min-height: 0; height: var(--touch); }

    /* The tally boxes keep their look at a finger's size: a bigger square, and
       a hit area that reaches the full 44px past its edges. */
    .dp-task-boxes, .dp-part-boxes { flex-wrap: wrap; gap: 6px; }
    .dp-task-box, .dp-part-box { position: relative; width: 32px; height: 32px; min-height: 32px; }
    .dp-task-box::after, .dp-part-box::after { content: ''; position: absolute; inset: -6px; }
    .dp-bond-step { width: var(--touch); height: var(--touch); }
    .dp-count-step, .dp-count-input { height: var(--touch); min-width: var(--touch); }
    .dp-fav, .dp-close, .dp-mat-map, .dp-heat-hour, .dp-heat-clear,
    .dp-show-range, .fc-range, .tx-action { min-height: var(--touch); min-width: var(--touch); }
    .dp-check { min-height: var(--touch); }
    .tx-section > summary, .tx-subsection > summary { min-height: var(--touch); box-sizing: border-box; }
    .dp-hour-bar { min-height: 0; }
    .dp-mark-info { min-height: 0; }
}

/* Hunting intel - js/huntingIntel.js. On the animal card, the Hunt List's
   Intel column, and the Bait Planner tool. */
.intel { border-top: 1px solid #3a3228; margin-top: 9px; padding-top: 6px; font-size: 11px; color: #c0b8a0; }
.intel > summary { cursor: pointer; color: #c8a951; text-transform: uppercase; letter-spacing: 1px; font-size: 10px; }
.intel-block { margin-top: 7px; }
.intel-h { color: #e0d8c0; font-weight: bold; margin-bottom: 2px; }
.intel-sub { color: #8a8270; margin-top: 4px; }
.intel-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.intel-set { color: #8a8270; font-size: 10px; }
.intel-note, .intel-src { color: #7a7260; font-size: 10px; margin-top: 2px; }
.intel-src { margin-top: 8px; font-style: italic; }
.intel-empty { color: #8a8270; margin: 6px 0 0; }
.intel-items { line-height: 1.5; }
.intel-grid { border-collapse: collapse; width: 100%; margin-top: 3px; font-size: 10px; }
.intel-grid th, .intel-grid td { border: 1px solid #3a3228; padding: 2px 3px; text-align: left; vertical-align: top; }
.intel-grid th { color: #8a8270; font-weight: normal; }
.intel-bars { display: flex; align-items: flex-end; gap: 1px; height: 26px; margin: 3px 0; }
.intel-bar { flex: 1; background: #4a4232; min-width: 0; }
.intel-bar.is-best { background: #c9761f; }
.intel-spot { font-size: 10px; padding: 1px 6px; background: #2e2418; color: #e0d8c0; border: 1px solid #6a5a28; cursor: pointer; }
.hl-intel { color: #8a8270; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.bp-search { background: #1f1b16; color: #e0d8c0; border: 1px solid #4a4232; padding: 5px 8px; min-width: 0; flex: 1 1 140px; max-width: 240px; }
.bp-note { margin: 0; padding: 8px 16px; color: #8a8270; font-size: 11px; border-bottom: 1px solid #2a2520; }
.bp-body { overflow: auto; padding: 8px 16px 24px; }
.bp-body h3 { font-size: 13px; color: #c8a951; margin: 12px 0 6px; }
.bp-table { border-collapse: collapse; width: 100%; max-width: 720px; font-size: 12px; }
.bp-table th, .bp-table td { border-bottom: 1px solid #2a2520; padding: 5px 6px; text-align: left; }
.bp-table th { color: #8a8270; font-weight: normal; }
.bp-animal { background: none; border: none; color: #e0d8c0; cursor: pointer; padding: 0; text-decoration: underline dotted; font: inherit; }
.bp-model { color: #7a7260; font-family: monospace; font-size: 11px; }
@media (max-width: 780px) {
    #bait-planner .overlay-header { flex-wrap: wrap; gap: 8px; }
    .hl-intel { display: none; }
}
