/*
 * Watch module (app/watch): the dashboard, claim, verify, roster, change pages, alert settings, the staff queue.
 * The dashboard is built from the Record's own parts (site.css: .record__top, .answer, .checks, .sign). Status
 * colours are read only through sig-* classes (--sig); nothing here writes one directly.
 */

/* ---------- The dashboard: the Record's column, with what changed right under the verdict ---------- */
.watch-home .claimed { flex-wrap: wrap; }
.watch-note { font-weight: 400; color: var(--ink-3); font-size: 1rem; }
.watch-owner { margin: 0; }
.watch-owner a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.watch-home .claimed .mark, .watch-list .mark { color: var(--ink-2); }
.watch-changes .timeline { margin-bottom: 0; }
.watch-changes .link-line { margin: var(--s-3) 0 0; }
.watch-welcome > p { margin-bottom: var(--s-3); }
.watch-example { margin: 0 0 var(--s-4); padding: var(--s-4); background: var(--paper-2); border-radius: var(--radius-small); }
.watch-example .specimen { margin-bottom: var(--s-3); }
.watch-example .timeline::before { display: none; }
.watch-example .tl-item { padding-bottom: 0; }
.watch-contact { padding-top: var(--s-2); padding-bottom: var(--s-2); }
.watch-contact > summary .part-title { font-size: var(--step-1); margin: 0; }
.watch-after-ledger { margin: var(--s-4) 0 var(--s-2); color: var(--ink-2); }
.watch-more .go-links { max-width: none; }
.record__meta > p { margin: 0 0 var(--s-2); }

/* Where the facts come from: a plain line in the reading face, never small mono. */
.watch-sources { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ink-3); }
.watch-sources .src { font: inherit; color: inherit; }

/* What we check every day: ink ticks, never green (green is a record's answer). */
.watch-list { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; gap: var(--s-2); }
.watch-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem; align-items: start; }
.watch-list .mark { margin-top: 0.2rem; }
.watch-section { margin-top: var(--s-6); }
.watch-section h2 { font-size: var(--step-1); }

/* ---------- Severity of a change: its shape and its word ---------- */
.watch-dot { display: inline-block; width: 1.45rem; height: 1.45rem; }
.watch-dot::before { content: ""; display: block; width: 0.7rem; height: 0.7rem; margin: 0.375rem; border-radius: 50%; background: var(--ink-2); }
.watch-sev-urgent .watch-sev-word, .watch-severity.watch-sev-urgent { color: var(--stop); }
.watch-sev-watch .watch-sev-word, .watch-severity.watch-sev-watch { color: var(--caution); }
.watch-sev-word { font-weight: 700; }
.tl-when .badge { margin-left: 0.4rem; vertical-align: 0.1em; }
.watch-home .tl-meta, .watch-change .tl-meta { font-size: 1rem; }

/* ---------- A change ---------- */
.watch-severity { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 var(--s-3); font-weight: 700; font-size: var(--step-1); }
.watch-severity .mark, .watch-severity .watch-dot { width: 1.4rem; height: 1.4rem; }
.watch-carrier { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.75rem; margin: 0 0 var(--s-4); color: var(--ink-2); }
.watch-carrier-name { font-weight: 700; color: var(--ink); }
.watch-change > .read-line { margin-bottom: var(--s-5); }
.watch-change > .record__next { margin-bottom: var(--s-6); }
.watch-self-step__title { font-weight: 700; font-size: var(--step-1); margin: 0 0 var(--s-1); }
.watch-self-step > :last-child { margin-bottom: 0; }
.watch-evidence { margin-bottom: var(--s-5); }
.watch-evidence h3 { margin-top: var(--s-5); }
.watch-evidence__src { margin: var(--s-2) 0 0; }
.watch-signals { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.watch-change > .go-links { margin-top: var(--s-5); }

/* ---------- Claim ---------- */
/* Where the carrier stands now: one tappable card that opens its Record. */
.watch-current {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3); align-items: start; margin: var(--s-4) 0;
  padding: var(--s-4); border: 1.5px solid var(--sig-edge, var(--rule)); background: var(--sig-wash, var(--paper));
  border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
a.watch-current:hover { color: var(--ink); border-color: var(--sig, var(--rule-strong)); }
.watch-current__text { display: grid; gap: 0.15rem; }
.watch-current__word { font-weight: 700; color: var(--sig); }
.watch-current__headline { font-weight: 700; font-size: var(--step-1); line-height: 1.3; }
.watch-current__go { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: var(--s-2); color: var(--action); font-weight: 600;
  text-decoration: underline; text-underline-offset: 0.18em; }
.watch-current__go svg { width: 1rem; height: 1rem; }
.work .card-form { margin: var(--s-5) 0; }
.watch-inline { margin: 0 0 var(--s-4); }

/* ---------- Verify: one card for each way ---------- */
.ways { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-4); }
.ways form { margin: var(--s-3) 0 0; }
.code-input input[type] { font-size: 1.5rem; font-weight: 600; letter-spacing: 0.2em; max-width: 12rem; font-variant-numeric: tabular-nums; }

/* ---------- The dashboard before a carrier: one big number box ---------- */
.watch-find.door { max-width: none; }
.watch-find .door__input { margin-bottom: 0; }

/* ---------- Roster: a count by status, then one card per carrier ---------- */
.watch-tally { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0 0 var(--s-5); padding: var(--s-4);
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.watch-tally li { display: inline-flex; align-items: center; gap: 0.45rem; }
.watch-tally strong { font-variant-numeric: tabular-nums; }
.watch-tally li > span:last-child { color: var(--ink); }
.watch-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 var(--s-4); margin-bottom: var(--s-2); }
.watch-sorts { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); margin: 0; padding: 0; list-style: none; }
.watch-sorts a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; font-size: 1rem; }
.watch-sorts a[aria-current="true"] { color: var(--ink); text-decoration: none; box-shadow: inset 0 -3px 0 var(--action); }
.watch-count { margin: 0; font-size: 1rem; color: var(--ink-3); }
.watch-roster { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-3); }
.watch-roster__row { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.watch-roster__link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.15rem var(--s-3); align-items: start;
  padding: var(--s-4); color: var(--ink); text-decoration: none; border-radius: var(--radius) var(--radius) 0 0;
}
.watch-roster__link:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.watch-roster__link:hover .watch-roster__name { text-decoration: underline; text-underline-offset: 0.18em; }
.watch-roster__light { grid-row: span 4; padding-top: 0.1rem; }
.watch-roster__link > svg { grid-column: 3; grid-row: 1 / span 4; align-self: center; width: 1.25rem; height: 1.25rem; color: var(--ink-2); }
.watch-roster__name { font-weight: 700; font-size: var(--step-0); line-height: 1.3; overflow-wrap: anywhere; }
.watch-roster__word { font-weight: 700; color: var(--sig); }
.watch-roster__headline { line-height: 1.4; color: var(--ink-2); }
.watch-roster__meta { font-size: 1rem; color: var(--ink-3); }
.watch-roster__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3);
  padding: var(--s-2) var(--s-4); border-top: 1px solid var(--rule); }
.watch-roster__foot:has(.watch-roster__tags:empty) { justify-content: flex-end; }
.watch-roster__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.watch-roster__remove { margin: 0; }
.watch-roster__remove .button { min-height: 44px; font-size: 1rem; color: var(--ink-2); font-weight: 600; }
.watch-add { display: grid; gap: var(--s-4); margin-bottom: var(--s-6); }
.watch-add .card-title { font-size: var(--step-1); }
.watch-inline-field { display: grid; gap: var(--s-3); margin: 0; }
@media (min-width: 34rem) { .watch-inline-field { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.watch-inline-field .field { margin-bottom: 0; }
.watch-add-after { margin-top: var(--s-6); }
.watch-problems { margin: var(--s-2) 0 0; padding-left: 1.2rem; }
.work > .empty-state { margin-bottom: var(--s-5); }

/* ---------- Alert settings ---------- */
.choice-list { list-style: none; margin: 0; padding: 0; }
.choice-list .field-check { margin-bottom: var(--s-1); }
.watch-carrier-choice { padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); }
.watch-carrier-choice:last-child { border-bottom: 0; }
.watch-carrier-choice .specimen--inline { margin-bottom: var(--s-1); }
.carrier-choices { max-height: 24rem; overflow-y: auto; border: 1px solid var(--rule-strong); border-radius: var(--radius-small);
  padding: var(--s-2) var(--s-3); background: var(--paper); }
.watch-alerts .form-go { max-width: none; }

/* ---------- Staff view ---------- */
.watch-admin .stats { margin-bottom: var(--s-5); }
.queue-item { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-4); margin-bottom: var(--s-3); }
.queue-item h3 { margin-top: 0; }
.queue-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin-top: var(--s-3); }
.queue-actions .field { margin: 0; flex: 1 1 14rem; }
.queue-actions > form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); margin: 0; }

@media print {
  .watch-welcome, .watch-add, .watch-tools, .watch-roster__remove { display: none; }
}
/* The account's orders, by carrier (watch/_orders.html). */
.watch-orders__carrier { margin-top: var(--s-4); }
.watch-orders__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2); font-size: var(--step-0); margin: 0 0 var(--s-2); }
.watch-orders__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }

/* ---------- The owner's dates (watch/dates.html, WATCH_ENABLED): one column on a 390px phone ---------- */
.watch-dates-form .watch-row { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-3);
  margin: 0 0 var(--s-3); }
.watch-dates-form .watch-row > legend { float: none; width: auto; padding: 0 var(--s-1); margin: 0; font-size: 1rem; }
.watch-dates-form input[type="date"], .watch-dates-form input[type="month"], .watch-dates-form select {
  width: 100%; max-width: 100%; min-width: 0; min-height: 44px; }
.watch-yesno { border: 0; padding: 0; margin: 0 0 var(--s-3); }
.watch-yesno > .watch-yesno__q { float: none; font-family: inherit; font-weight: 700; font-size: 1rem; margin: 0 0 var(--s-1); }
.watch-yesno__row { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); }
.watch-yesno__row .field-check { margin: 0; }
.watch-upcoming__list { list-style: none; margin: 0; padding: 0; }
.watch-upcoming__list li { padding: var(--s-1) 0; border-bottom: 1px solid var(--rule); }
.watch-upcoming__list li:last-child { border-bottom: 0; }
.watch-late { font-weight: 700; color: var(--fail, #c0291b); }
.watch-dates .form-go { max-width: none; }
