/* =============================================================================
   delta_stable_entries.css — Entries page styled to match stable list
   ============================================================================= */



/* ── Tabs ── */
.re_tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1em;
  padding: 0 1em;
  background: var(--ehr-tabbar-bg);
  color: var(--ehr-tabbar-text);
}

.re_tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ehr-tabbar-text);
  font: inherit;
  font-weight: inherit;
  font-size: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.re_tab_active {
  background: var(--ehr-tabbar-bg);
  color: var(--ehr-tabbar-text);
  font-weight: 700;
  position: relative;
}

.re_tab_active:after,
.re_tab:hover::after  {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: .25rem;
  background: var(--ehr-theme-accent);
}

.re_tab_active:hover {
    background: none;
    filter: none;
}

/* ENTRIESREFRESH_20261018 (owner 10-18): the refresh pill at the far right of the tab row (this tab and page again, in place) */
.re_tab_refresh {
  margin-left: auto;
  padding: .3em .8em;
  font-size: 1.35em;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 480px) {
  .re_tab {
    padding: 0 4px;
    font-size: inherit;
  }
}


/* ── Table wrapper ── */


.re_empty {
  padding: 20px;
  color: #64748b;
  font-style: italic;
}

/* ── Table ── */
.re_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background-color: #fff;
}

.re_table_wrapper {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  box-sizing: border-box;
}

.re_page_container {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  box-sizing: border-box;
}

.re_table thead tr {
  background-color: #E8E8D0;
}

.re_table th {
  padding: 8px 6px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #c8c8a0;
  white-space: nowrap;
  overflow: hidden;
}

.re_table td {
  padding: 6px 6px;
  font-size: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #e5e7eb;
}

.re_td_expand  { text-align: center; padding-left: 14px; white-space: nowrap; }
.re_td_horse   { font-weight: 600; }
.re_td_action  { white-space: nowrap; }
/* .re_td_action a { border: 1px solid var(--ehr-border); padding: .25em; } */
.re_td_trk, .re_td_type, .re_td_tag, .re_td_dist, .re_td_cond,
.re_td_sex, .re_td_age, .re_td_surf, .re_td_purse,
.re_td_ml, .re_td_cr, .re_td_num, .re_td_post { white-space: nowrap; }

/* ── Horse name ── */
.re_horse_name_wrap {
    font-family: var(--hp-font-sans);
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: .05em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.re_horse_name_wrap a {
  cursor: pointer;
  color: var(--ehr-text-primary);
}

.re_horse_name_wrap a:hover {
  text-decoration: none;
  background-color: #dbeafe;
  border-radius: 3px;
  padding: 0 2px;
}

.re_mine_tag {
  font-size: 0.85em;
  color: #6b7280;
  font-weight: 400;
}

.re_scratched {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ── Expanded info — reuse stable list styles ── */
.re_expanded_info {
  display: none;
}

/* ── Alternating row colors ── */
.re_table tbody tr:nth-child(8n+1),
.re_table tbody tr:nth-child(8n+2),
.re_table tbody tr:nth-child(8n+3),
.re_table tbody tr:nth-child(8n+4) {
  background-color: #f8f8f2;
}

/* Force main_contain to establish full width for entries table */
#main_contain {
  width: 100%;
  display: block;
  box-sizing: border-box;
}

/* Responsive: hide less important cols; NEVER hide horse.
   Measured against the content area (.ehr-main-content), not the viewport. */
@container content (max-width: 700px) {
  .re_th_tag,   .re_td_tag,
  .re_th_cond,  .re_td_cond,
  .re_th_purse, .re_td_purse,
  /* .re_th_cr,    .re_td_cr, */
  /* .re_th_num,   .re_td_num, */
  .re_th_surf,  .re_td_surf,
  .re_th_trk,   .re_td_trk   { display: none; }
}

/* RESULTSPHONE_20261024 (owner 10-24: "on the results page; mobile view ... hide the post position and include the how long
   ago the race ran column"): on the Results tab (table.re_list_results, stable_entries.j2) a phone keeps C/R, which there is
   race_run_ago (5h, Sa, 2w), and drops Post. Pending and Accepted keep the rule above. */
@container content (max-width: 700px) {
  .re_list_results .re_th_cr,   .re_list_results .re_td_cr   { display: table-cell; }
  /* .re_list_results .re_th_post, .re_list_results .re_td_post { display: none; } */
  .re_list_accepted .re_th_post, .re_list_accepted .re_td_post { display: none; } 
  .re_list_results .re_th_num, .re_list_results .re_td_num { display: none; } 
}

@container content (max-width: 520px) {
  .re_th_sex,  .re_td_sex,
  /* .re_th_age,  .re_td_age, */
  .re_th_dist, .re_td_dist   { display: none; }
}

/* Expanded info cards — wrap on small screens */
.re_expanded_info .stable_horse_list_expanded_row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.re_expanded_info .stable_horse_list_expanded_item {
  min-width: 90px;
  flex: 1 1 90px;
}

/* ── Scratch card ── */
.re_scratch_btn {
  display: inline-block;
  padding: 3px 10px;
  background: #7c3aed;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.re_scratch_btn:hover { background: #6d28d9; }

.re_scratch_confirm {
  padding: 6px 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.re_scratch_confirm_msg { color: #92400e; font-weight: 500; }

.re_scratch_yes {
  padding: 3px 10px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.re_scratch_yes:hover { background: #b91c1c; }

.re_scratch_no {
  padding: 3px 10px;
  background: #64748b;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.re_scratch_no:hover { background: #475569; }

/* ── Claims page column widths ── */
/* PERCENTAGES, not px (2026-08-23). Every column here used to be a small fixed
   pixel width except Horse, which was width:auto -- so Horse was the ONLY
   flexible column and absorbed every spare pixel. The fixed widths summed to
   about 580px, which on a 1400px laptop handed Horse roughly 800px of slack
   and shoved the rest of the row to the far right.

   Percentages make every column share the slack proportionally, so the table
   fills the screen and no single column dominates. Deliberately NOT
   table-layout:fixed: content still gets a say, so a long track code or a
   "Late Claim Attempt" status can push its cell rather than being clipped by
   a width nobody checked.

   They sum to ~99 for the widest tab (M, which has both Note and Wnr). The
   narrower tabs come in under 100 and the browser distributes the difference
   proportionally -- which is the behaviour we want, not a bug to correct. */
.claims_th_note   { width: 7%; }
.claims_th_horse  { width: 18%; min-width: 100px; }
.claims_th_wnr    { width: 7%; }
.claims_th_trk    { width: 5%; }
.claims_th_type   { width: 5%; }
.claims_th_tag    { width: 7%; }
.claims_th_dist   { width: 4%; }
.claims_th_sex    { width: 4%; }
.claims_th_age    { width: 4%; }
.claims_th_surf   { width: 5%; }
.claims_th_date   { width: 8%; }
.claims_th_num    { width: 3%; }
.claims_th_action { width: 5%; }

.claims_td_horse { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.claims_td_action { text-align: center; }

/* ── Claims: tighter table, 2026-08-23 ───────────────────────────────────
   Owner: "there's a lot of space between the horse name and the right hand
   columns; can we get them tighter?"

   Cause: .re_table is width:100% and .claims_th_horse was width:auto, so the
   horse column absorbed every pixel of slack in the container and shoved the
   rest of the row to the far right. The gap was one stretched column, not
   padding.

   REVISED the same day. The first attempt sized the table to its CONTENT
   (width:auto), which closed the gap but went too far the other way -- the
   table stopped using the screen at all. Owner: "it's now really tight; i feel
   like we could take up the whole screen when we are on laptop but have the
   columns more uniformly sized; we do that on most of the other pages."

   They do: every table on this site is width:100% (.re_table, .pst_table,
   .stable_horse_list_table). Full width was never the problem -- ONE greedy
   column was. So the table goes back to 100%, matching every other screen,
   and the fix moves to the column widths below, which are now percentages so
   the slack spreads instead of pooling in Horse.

   SCOPED to .claims_table. .re_table is shared with stable_entries.j2, whose
   own column widths are untouched. claims.j2 carries both classes. */
.claims_table          { width: 100%; }

/* Cards, added 2026-08-23. Beside Tag: the same number in the other currency. */
.claims_th_cards       { width: 5%; }
.claims_td_cards       { text-align: right; white-space: nowrap; }

/* ── Claim outcome boxes ─────────────────────────────────────────────────
   Green for a win, dark red for a loss, per the owner. The other four states
   are styled too, so a settled row and an in-flight row do not read as the
   same kind of thing -- leaving them bare next to two coloured ones would
   have made "no colour" ambiguous between "still running" and "not handled".

   Sized off the row, not fixed, so a long status like "Late Claim Attempt"
   wraps its box rather than escaping it. */
.claims_status {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  /* NOT nowrap. The comment above promised the box wraps, and the rule said
     the opposite -- with Note at 7% (~98px on a 1400px laptop) the longest
     status, "Late Claim Attempt", is wider than its cell and would have
     escaped it. A two-line pill is fine; a pill overlapping the next column
     is not. */
}
.claims_status_won     { background: #166534; color: #fff; }
.claims_status_lost    { background: #7f1d1d; color: #fff; }
.claims_status_active  { background: #1e3a8a; color: #fff; }
.claims_status_problem { background: #a16207; color: #fff; }
.claims_status_none    { background: #e2e8f0; color: #475569; }

/* Cond, added 2026-08-23. The entries screen has had .re_td_cond all along;
   claims was the odd one out, which is why race conditions lived only in the
   expander. Same truncation treatment as the other narrow text columns. */
.claims_th_cond  { width: 12%; }
.claims_td_cond  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Claims responsive ladder, rebuilt 2026-08-23 ────────────────────────
   Owner: "slide bar.. nope... more collapsing, no sliding."

   There used to be exactly ONE breakpoint here, at 640px. Fifteen columns of
   nowrap content need roughly 1000px of minimum width, so anywhere between
   640px and about 1000px the table overflowed and .re_table_wrapper's
   overflow-x turned that into a horizontal scrollbar. The cliff was the bug:
   nothing collapsed until long after the table had stopped fitting.

   It now sheds columns steadily, least useful first, so the table keeps
   fitting instead of sliding:

     sex, age    -- both are on the horse page, one click away
     surf, num   -- context, not decisions
     cond, dist  -- race shape; Cond comes back in the expander here
     type, trk   -- which race it was
     wnr, date   -- last to go before the core

   Always survives: horse, tag, cards, action and the status box -- who, how
   much, and what you can do about it.

   The wrapper keeps overflow-x as a last resort. It should now be unreachable
   in practice rather than the primary mechanism, which is the actual change. */
@media (max-width: 1250px) {   /* WILLMERGE_20261017 (render R17): was 1100px -- from 981px up the sidebar takes 250px; the arrow rule below moves with it */
  .claims_th_sex,   .claims_td_sex,
  .claims_th_age,   .claims_td_age   { display: none; }
}
@media (max-width: 950px) {
  .claims_th_surf,  .claims_td_surf,
  .claims_th_num,   .claims_td_num   { display: none; }
}
@media (max-width: 850px) {
  .claims_th_cond,  .claims_td_cond,
  .claims_th_dist,  .claims_td_dist  { display: none; }
}
@media (max-width: 700px) {
  .claims_th_type,  .claims_td_type,
  .claims_th_trk,   .claims_td_trk   { display: none; }
}
@media (max-width: 560px) {
  .claims_th_wnr,   .claims_td_wnr,
  .claims_th_date,  .claims_td_date  { display: none; }
}
/* WILLMERGE_20261017 (render R17): with the sidebar showing (981px up) the table has 250px less room, so two steps from below 981px
   repeat inside that range. Every column hidden here is in the expander panel, and the arrow shows up to 1250px.
   Offline render: no sideways scroll from 981 to 1460px, 35px+ to spare at every step. */
@media (min-width: 981px) and (max-width: 1200px) {
  .claims_th_surf,  .claims_td_surf,
  .claims_th_num,   .claims_td_num   { display: none; }
}
@media (min-width: 981px) and (max-width: 1100px) {
  .claims_th_cond,  .claims_td_cond,
  .claims_th_dist,  .claims_td_dist  { display: none; }
}

/* The expander arrow earns its place once a column has been taken away. Above
   640px -- the exact complement of the rule above, the first breakpoint that
   hides anything on this screen -- nothing is collapsed, the panel restates the
   row, and the arrow is noise. Same rule and same shape as Player Stats in
   ehr_style_13_misc_pages.css; the two must stay in step. 2026-08-23.

   No per-row exception, because there is nothing left to except: Cond was the
   one panel item without a column and it now has one, hidden by the rule above
   at exactly the width where the arrow comes back. Coverage is continuous --
   above 640px the column shows it, below 640px the panel does.

   Scoped to .claims_td_expand and NOT .re_td_expand: those classes and
   re_page_container are shared with stable_entries.j2, whose panel still
   carries items with no column (Local, Close/Run, M/L) and must keep its arrow
   at every width. */
/* 1101px is the exact complement of the FIRST rule in the ladder above (sex and
   age at 1100px). The two must move together -- if that breakpoint changes,
   this changes with it, or the arrow reappears with nothing behind it.

   !important is not decoration here. ehr_horsepage_02_horseinfo.css:886 sets
   `.stable_horse_list_expand_toggle { display: inline-block !important }` under
   the comment "Always show the expand toggle regardless of viewport width" -- a
   global override that loads before this file and beat a plain rule outright.
   That is why the arrow was still showing on a wide screen. */
@media (min-width: 1251px) {   /* WILLMERGE_20261017 (render R17): was 1101px, the complement of the first step (now 1250px) */
  .claims_td_expand .stable_horse_list_expand_toggle { display: none !important; }
}

/* ═════════════════════════════════════════════════════════════════════════════
   NARROW PHONES — 2026-08-24
   Companion to the block of the same name in ehr_style_13_misc_pages.css; the
   reasoning is written out there. Short version: below ~480px the thing forcing
   this table wider than the viewport is not the column count but the horse
   name, which is normally one unbreakable token.

   Claims reaches this width in better shape than the ratings screens -- its
   ladder already runs to 560px and it keeps only Note, Horse, Tag, Cards and
   Action -- so this is padding and a floor, not a rescue.

   claims_th_horse's min-width comes down from 100px but does not go away. It is
   what stops the name column collapsing to nothing once the cells are allowed
   to ellipsis, and 80px still shows enough of a name to recognise it.
   ═════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .claims_table       { font-size: 12px; }
  .claims_table th    { padding: 6px 3px; white-space: normal; }
  .claims_table td    { padding: 5px 3px; }
  .claims_th_horse    { min-width: 80px; }
}

/* RACEINLINE_20261022 (daniel 10-22, iPhone): the race opened from the Action icon (the rareal_ div in stable_entries.j2).
   The table cells here are nowrap, and the race view inherited it, so the race name, conditions and also-ran list each
   stayed on one line and pushed the whole table to about 1060px. The page frame clips sideways overflow
   (.ehr-main-content, ehr_base.css), so the right side could not be reached and every row's Action icons were off the
   screen, and a loaded race kept the table that wide after it was closed (collapsed rows still size the columns) until
   a refresh. white-space: normal lets the race wrap as it does on the Races page; contain: inline-size keeps a loaded
   race from ever setting the table's width, so the race takes the table's width instead. */
.re_race_inline { white-space: normal; contain: inline-size; }
/* RACEINLINE_20261022 (owner 10-22: "let's add that too"): the horse view (the hireal_ div) gets the same rule. Measured:
   on a phone it already fitted (no change there); at 1280px a loaded horse page widened the table by about 23px. */
.re_horse_inline { white-space: normal; contain: inline-size; }
