/* Intent and rules: docs/features/home.md (read before changing). */
/*
 * Home (/team/, design B, 2026-11-22; the owner: "Yes, build B"): the frame, the Today strip, Needs you's groups and
 * its one row design (inbox.js, schedule-rows.js), and its one-line parts. Linked after team.css (its tokens, .btn,
 * .link-btn, .today-row) and sheet.css; Book it's own look is book-it.css. Sizes in px like team.css; the heights that
 * must hold at 125% text (the strip's slots and foot) are in em, so they grow with the text.
 * Colour as in the approved mockups: Needs you's groups sit in four coloured tier bands (owner, 2026-12-01: "I like
 * the bands"): Do first red, Money on the table gold, Follow up grey, Cleans and clients blue. A band's heading is big
 * words in its colour with a grey hint; a group's heading is plain words under it; a row's left edge takes its band's
 * colour. No count on any of them. The team pages have one (dark) theme, team.css :root.
 */

.home-main { gap: 14px; }
@media (max-width: 760px) {
  .home-main { padding-top: 12px; gap: 12px; }
}

/* ---------- Today strip: a head, 2 row slots and one foot line, at a fixed height ---------- */
.today-strip {
  /* One slot holds a compact Today row of up to three lines (the name, the phone and crew, the pills under them on
     the smallest phones) and its padding. */
  --slot: 5.6em;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px 14px 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* One line: Today, its count (cut short rather than wrap: the height holds) and All today › on the right. */
.today-strip .today-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-height: 2.95em;
  padding: 0;
  border-top: 0;
}
.today-strip .today-head h2 { margin: 0; font-size: 18px; font-weight: 600; flex-shrink: 0; }
.today-strip .today-head h2:focus { outline: none; }
.today-count { flex: 1 1 auto; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 2.95em grows with the text; never under a 44 px tap (14px text gives 41 px). */
.today-all { flex-shrink: 0; min-height: max(44px, 2.95em); padding: 0 2px; font-size: 14px; }
.today-slots { min-height: calc(2 * var(--slot)); }
.today-strip .today-row.compact { min-height: var(--slot); padding: 8px 2px; align-items: center; }
/* The name and the phone · crew line, one line each (the address is on the panel). */
.today-row.compact .today-what, .today-row.compact .today-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row.compact .today-main { justify-content: center; }
/* On a phone the pills go under the phone and crew line (as on the smallest phones in team.css), so the name keeps
   the row's width; the slot is sized for those three lines. */
@media (max-width: 480px) {
  .today-strip .today-row.compact { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .today-strip .today-row.compact .today-pills { grid-column: 2; flex-direction: row; align-items: flex-start; max-width: none; }
  .today-strip .today-row.compact .confirm-pill { text-align: left; }
}
.today-slot { min-height: var(--slot); margin: 0; display: flex; align-items: center; }
.next-pill { background: var(--gold-wash); color: var(--gold-deep); }
/* The foot line: one line, a 44 px tap, cut short rather than wrapped. Its height counts its 1 px top border, so the
   button's 44 px fits without the foot growing when the schedule lands. */
.today-foot { min-height: calc(max(44px, 2.95em) + 1px); display: flex; align-items: center; border-top: 1px solid var(--line); min-width: 0; }
.today-foot > * { min-width: 0; }
/* A block, not a flex box: the " · " between its parts keeps its spaces. */
.today-foot-btn {
  display: block;
  width: 100%;
  height: max(44px, 2.95em);
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  line-height: max(44px, 2.95em);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-foot-day { color: var(--muted); font-weight: 600; }
.today-foot-go { color: var(--muted); }
.today-foot .range-note, .today-foot-none { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tomorrow-list { border-top: 1px solid var(--line); }

/* ---------- Needs you ---------- */
.needs { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.needs > h2 { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.needs > h2:focus { outline: none; }
.needs-list { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.needs-list:empty { display: none; }

/* A band (inbox.js BANDS): a tinted box in its tone holding its heading, then its groups. --tone tints it, --tone-ink
   is its heading's colour, --tone-edge its rows' left edge. The plain background and border first, for a browser
   without color-mix. */
.nr-band {
  --tone: var(--muted);
  --tone-ink: var(--ink-2);
  --tone-edge: var(--danger);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 8px 12px;
  border-radius: 16px;
  background: transparent;
  background: color-mix(in srgb, var(--tone) 9%, transparent);
  border: 1px solid var(--line-strong);
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
}
.nr-band[data-tone="red"] { --tone: var(--danger); --tone-ink: var(--danger); --tone-edge: var(--danger); }
.nr-band[data-tone="gold"] { --tone: var(--gold); --tone-ink: var(--gold-deep); --tone-edge: var(--gold); }
.nr-band[data-tone="blue"] { --tone: var(--blue); --tone-ink: var(--blue); --tone-edge: var(--blue); }
.nr-band[data-tone="grey"] { --tone: var(--muted); --tone-ink: var(--ink-2); --tone-edge: rgba(160, 168, 180, 0.55); }
/* The band's heading: big words in its colour, the grey hint on the right (under them when the line is full). */
.nr-band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  min-width: 0;
  margin: 0;
  padding: 2px 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--tone-ink);
  overflow-wrap: anywhere;
}
.nr-band-hint { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); }
/* A row's left edge follows its band (a saved copy's blank rows keep their own, below). */
.nr-band .nr { border-left-color: var(--tone-edge); }

/* A group: its heading in plain words (no count), then its rows. */
.nr-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nr-head { margin: 4px 6px 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.nr-head-hint { font-weight: 400; color: var(--muted); }
/* Probably not a customer: the heading is the fold's button. */
.nr-fold { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; text-align: left; }
.nr-fold[aria-expanded="true"] .card-chev { transform: rotate(-135deg) translateX(-2px); }
.nr-fold-rows { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* The row: the open area fills it (line 1 the name and the time, line 2 what is needed in grey, an optional line 3
   their words); 0 to 2 buttons beside it, never inside; a refusal's words under both. */
.nr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 4px;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.nr-open {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 9px 12px 10px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
}
@media (hover: hover) { .nr-open:hover { background: var(--hover); } }
.nr-top { display: flex; align-items: baseline; gap: 4px 10px; min-width: 0; }
.nr-name { flex: 0 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-top .test-pill { flex-shrink: 0; align-self: center; }
.nr-time { margin-left: auto; flex-shrink: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
/* What is needed: two lines at most (a phone at 125% text keeps the job number), the rest on its sheet. */
.nr-what {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.nr-said { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; padding: 6px 10px; }
.nr-act { flex-shrink: 0; min-height: 44px; }
.nr-say { flex: 1 0 100%; margin: 0; padding: 0 12px 10px; font-size: 13px; color: var(--ink); }
.nr-say[hidden] { display: none; }
.nr-empty, .nr-loading { margin: 0; font-size: 14px; }
/* Earlier ones not marked ›: one line under Mark a clean's rows, the rest shown in place on a tap. */
.nr-earlier { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nr-more { align-self: flex-start; min-height: 44px; padding: 0 2px; font-size: 14px; }
/* The Calendar check under Fix before the clean: one block in the rows' look. Its heading is an h5, one level under
   the group's h4 (band h3 > group h4 > Calendar check h5). */
.nr-group > .calcheck { margin-top: 0; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.calcheck h5 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }

/* Home's saved copy of Needs you (home-load.js): the bands, headings and blank rows, no name, dimmed until the list
   is in. A blank row keeps its own grey edge, in a band too. */
.needs-saved { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.needs-saved.is-saved { opacity: 0.6; pointer-events: none; }
/* While rows are in beside the copy, its groups sit in the live list's bands (inbox.js redraw), dimmed the same, and
   its own box stands empty. */
.needs-saved:empty { display: none; }
.needs-list .nr-band[data-placeholder],
.needs-list .nr-band:not([data-placeholder]) > .nr-group[data-placeholder] { opacity: 0.6; pointer-events: none; }
.nr-placeholder, .nr-band .nr.nr-placeholder { min-height: 62px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 10px 14px; border-left-color: var(--line-strong); }
.nr-ph { display: block; height: 10px; border-radius: 5px; background: var(--bone); }
.nr-ph-name { width: 40%; }
.nr-ph-what { width: 70%; opacity: 0.6; }

/* ---------- One-line parts of Needs you ---------- */
.home-line { margin: 0; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.watch-line { color: var(--muted); }
.watch-line[data-problem] { color: var(--you); font-weight: 600; }
.needs-note { color: var(--you); }
.needs-note-btn { min-height: 44px; padding: 0; color: var(--you); text-align: left; }
.needs-note-more { display: block; color: var(--muted); }
/* N client details need a look ›, What the app did ›: one line each, a 44 px tap. */
.home-go {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}
@media (hover: hover) { .home-go:hover { background: var(--hover); color: var(--ink); } }

/* A cleaner's way to the Handbook, under the owners-only note (2026-11-27, docs/features/handbook.md). */
.home-handbook { align-self: flex-start; }
