/* [2026-10-13, SPEC 164, A's R164-1 / R164-2] DUE, THEN OVERDUE IN FOUR SHADES.
   ONE rule for every list (Incoming, Leads, Chats, Shopify forms, the admin
   page): before the deadline the words say how long is left (`.srm-due`);
   from the deadline on they say OVERDUE (`.srm-overdue[data-shade]`) and the
   row's ground darkens day by day (`[data-overdue-shade]`). The shade is
   computed in Python (`reply_clock.due_state`, OVERDUE_SHADE_HOURS) and only
   painted here. Its own file because srm.css is byte-pinned; linked by
   `_base.html` on every console page and versioned (VERSIONED_ASSETS).
   Contrast, measured (WCAG): each ink on its own ground 6.13 / 6.11 / 6.28 /
   6.39 : 1, on white 6.98 / 8.01 / 9.83 / 12.33 : 1; body ink #242b26 on the
   four grounds 12.74 / 11.05 / 9.27 / 7.51 : 1. All clear 4.5:1. */
:root {
  --ag-overdue-1: #f8eeee;  --ag-overdue-ink-1: #963c3c;
  --ag-overdue-2: #f1dcdc;  --ag-overdue-ink-2: #8a3434;
  --ag-overdue-3: #e8c7c7;  --ag-overdue-ink-3: #752b2b;
  --ag-overdue-4: #dcb0b0;  --ag-overdue-ink-4: #5e2020;
}

/* The words. The doubled attribute lifts them over a page's own red word
   (e.g. `.crm-row-wait.is-red`, 0,2,0), so the shade decides the ink. */
.srm-due { color: var(--fg-2, #4a514c); }
.srm-overdue[data-shade="1"][data-shade] { color: var(--ag-overdue-ink-1); }
.srm-overdue[data-shade="2"][data-shade] { color: var(--ag-overdue-ink-2); }
.srm-overdue[data-shade="3"][data-shade] { color: var(--ag-overdue-ink-3); }
.srm-overdue[data-shade="4"][data-shade] { color: var(--ag-overdue-ink-4); }

/* The row grounds. Three selector shapes, one meaning: any element, a list
   row (`.crm-email-row`) and a table row's cells. The doubled attribute
   lifts them above the older two-step `[data-due]` grounds (0,2,0) wherever
   both are present, so the four shades are what a reader sees. */
[data-overdue-shade="1"][data-overdue-shade] { background: var(--ag-overdue-1); }
[data-overdue-shade="2"][data-overdue-shade] { background: var(--ag-overdue-2); }
[data-overdue-shade="3"][data-overdue-shade] { background: var(--ag-overdue-3); }
[data-overdue-shade="4"][data-overdue-shade] { background: var(--ag-overdue-4); }
.crm-email-row[data-overdue-shade="1"][data-overdue-shade] { background: var(--ag-overdue-1); }
.crm-email-row[data-overdue-shade="2"][data-overdue-shade] { background: var(--ag-overdue-2); }
.crm-email-row[data-overdue-shade="3"][data-overdue-shade] { background: var(--ag-overdue-3); }
.crm-email-row[data-overdue-shade="4"][data-overdue-shade] { background: var(--ag-overdue-4); }
tr[data-overdue-shade="1"][data-overdue-shade] > td { background: var(--ag-overdue-1); }
tr[data-overdue-shade="2"][data-overdue-shade] > td { background: var(--ag-overdue-2); }
tr[data-overdue-shade="3"][data-overdue-shade] > td { background: var(--ag-overdue-3); }
tr[data-overdue-shade="4"][data-overdue-shade] > td { background: var(--ag-overdue-4); }

/* [2026-10-13, SPEC 164, A's R164-8] THE RED MARK IS THE PRESS (the Leads Due
   cell): the overdue words, drawn as a quiet button that opens the menu. */
.crm-red-mark { display: inline; position: relative; }
.srm-main--crm .crm-red-mark > summary.crm-red-mark-press,
.crm-red-mark > summary.crm-red-mark-press {
  display: inline; cursor: pointer; list-style: none;
  padding: 0; margin: 0; min-height: 0; height: auto; width: auto;
  border: 0; background: none; box-shadow: none;
  /* the cell's own face and case: the label face draws 1 as I */
  font: inherit; text-transform: none; letter-spacing: normal;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.srm-main--crm .crm-red-mark > summary.crm-red-mark-press:hover { text-decoration-style: solid; }
.crm-red-mark-press::-webkit-details-marker { display: none; }
.crm-red-mark-press:focus-visible { outline: 2px solid var(--ag-sage, #465849); outline-offset: 2px; }
.crm-red-mark-when { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 12px; }
.crm-red-mark-when legend { padding: 0; margin-bottom: 4px; }
.crm-nd-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crm-nd-quick .crm-nd-head, .crm-nd-quick .srm-label, .crm-nd-quick fieldset,
.crm-nd-quick .crm-la-line { flex-basis: 100%; }

/* The two sheets whose older two-step wash paints the CELLS
   (`crm-leads-visual.css` `.srm-main--crm.crm-leads-page tr[data-due] > td`,
   0,3,2, and its locked column 0,4,2; `crm-forms.css`
   `.srm-main--crm .crm-forms-table tr[data-due] > td`, 0,3,2, which the Chats
   sheet shares): the shades outrank them cell by cell, opaque, so one row
   reads one shade and never the two stacked. */
.srm-main--crm.crm-leads-page tr[data-overdue-shade="1"][data-overdue-shade] > td,
.srm-main--crm.crm-leads-page tr[data-overdue-shade="1"][data-overdue-shade] > td[data-col-lock],
.srm-main--crm .crm-forms-table tr[data-overdue-shade="1"][data-overdue-shade] > td { background: var(--ag-overdue-1); }
.srm-main--crm.crm-leads-page tr[data-overdue-shade="2"][data-overdue-shade] > td,
.srm-main--crm.crm-leads-page tr[data-overdue-shade="2"][data-overdue-shade] > td[data-col-lock],
.srm-main--crm .crm-forms-table tr[data-overdue-shade="2"][data-overdue-shade] > td { background: var(--ag-overdue-2); }
.srm-main--crm.crm-leads-page tr[data-overdue-shade="3"][data-overdue-shade] > td,
.srm-main--crm.crm-leads-page tr[data-overdue-shade="3"][data-overdue-shade] > td[data-col-lock],
.srm-main--crm .crm-forms-table tr[data-overdue-shade="3"][data-overdue-shade] > td { background: var(--ag-overdue-3); }
.srm-main--crm.crm-leads-page tr[data-overdue-shade="4"][data-overdue-shade] > td,
.srm-main--crm.crm-leads-page tr[data-overdue-shade="4"][data-overdue-shade] > td[data-col-lock],
.srm-main--crm .crm-forms-table tr[data-overdue-shade="4"][data-overdue-shade] > td { background: var(--ag-overdue-4); }

/* The red mark's menu is the row menu's own floating panel (`.crm-fu-form`,
   `crm-leads-visual.css`), a little wider for the reason buttons. */
.crm-red-mark > .crm-fu-form { width: min(380px, 80vw); }

/* [2026-11-05, SPEC 246f, A's Board 41 Question 2] PAST THE 1-HOUR TARGET, NOT LATE YET: gold words
   (`.srm-due[data-gold]`) and a light gold row ground (`[data-target-gold]`), first in the list after the late
   ones. Late (red, the four shades above) starts at 1 business day. The gold is computed in Python
   (`reply_clock.reply_state`, `past_target_sql`) and only painted here. Contrast measured by G246f-2. */
:root { --ag-target: #fff6dd; --ag-target-ink: #7a5600; }
.srm-due[data-gold][data-gold] { color: var(--ag-target-ink); font-weight: 600; }
[data-target-gold][data-target-gold] { background: var(--ag-target); }
.crm-email-row[data-target-gold][data-target-gold] { background: var(--ag-target); }
tr[data-target-gold][data-target-gold] > td { background: var(--ag-target); }
/* [2026-11-05, SPEC 246f] the Leads list's Due words on a gold row: gold ink, and they may wrap, because
   "PAST TARGET . REPLY BY THU 3:30 PM" is longer than the column (the late words already wrap). */
tr[data-target-gold][data-target-gold] .crm-due-words { white-space: normal; color: var(--ag-target-ink); font-weight: 600; }
/* the lead page's DO THIS NOW box past the target (`.crm-now.is-gold`), over the page's own box rules */
.srm-main--crm #ld-band > .crm-attn > .crm-now.is-gold.is-gold.is-gold.is-gold.is-gold { border-left-color: #c99a1e; background: var(--ag-target); }
.srm-main--crm #ld-band .crm-now.is-gold.is-gold.is-gold.is-gold.is-gold .crm-now-line { color: var(--ag-target-ink); }

/* [2026-11-05, SPEC 246f follow-up, found making the how-to] the Leads Due cell: "LATE FOR A REPLY . 8 BUSINESS DAYS"
   wraps, and an inline fold let the row's button sit on top of the second line. As a box beside the button, the
   words wrap inside it and the button stays to their right. */
.srm-main--crm .crm-red-mark { display: inline-block; max-width: calc(100% - 44px); vertical-align: middle; }
