/* Watchdog (watchdog.js, 27 Oct 2026): the morning brief + health. Same cards, type and tokens as Keystone; phone first.
   No :has() and no runtime custom properties (see the 22 Oct perf rules in app.css). */
.wd { display: flex; flex-direction: column; gap: 12px; }
.wd-today { margin: 0 0 12px; }
.wd-i { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 3px; }
.wd-title { display: flex; gap: 10px; align-items: flex-start; }
.wd-title h3 { margin: 0; }
.wd-title h3 small { font-family: "Geist", system-ui, sans-serif; font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.wd-lead { margin: 4px 0 0; font-size: 15px; line-height: 1.4; }
.wd-mut { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.wd-fine { font-size: 11.5px; }
.wd-sub { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.wd-secs { display: grid; grid-template-columns: 1fr; gap: 4px 18px; margin-top: 10px; }
@media (min-width: 760px) { .wd-secs { grid-template-columns: 1fr 1fr; } .wd-compact .wd-secs { grid-template-columns: 1fr 1fr; } }
.wd-sec { border-top: 1px solid var(--rule); padding: 8px 0 6px; min-width: 0; }
.wd-sec h4 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wd-sec ul, .wd-items { list-style: none; margin: 0; padding: 0; }
.wd-sec li { font-size: 13.5px; line-height: 1.4; padding: 2px 0; overflow-wrap: anywhere; }
.wd-ref { font: inherit; color: inherit; text-align: left; padding: 0; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.wd-t-bad { color: #b42318; } .wd-t-warn { color: #a14b00; }
.wd-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.wd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.wd-btn.ghost { background: var(--surface); color: var(--accent); border: 1px solid var(--rule); }
.wd-btn[disabled] { opacity: .5; }
.wd-pill { display: inline-flex; font-family: "Geist", system-ui, sans-serif; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.wd-pill.ok { background: #dcf3e8; color: #13744a; } .wd-pill.warn { background: #fdecd6; color: #a14b00; } .wd-pill.bad { background: #fde3dc; color: #b42318; } .wd-pill.mute { background: var(--notice); color: var(--muted); }
.wd-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wd-row h3 { margin: 0; }
.wd-strip { display: flex; gap: 1px; height: 22px; align-items: stretch; margin-top: 10px; }
.wd-strip i { flex: 1; min-width: 1px; max-width: 8px; border-radius: 2px; background: #19a463; }
.wd-strip i.warn { background: #e8a33d; } .wd-strip i.bad { background: #d4380d; }
.wd-items li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; padding: 6px 0; border-top: 1px solid var(--rule); }
.wd-items li:first-child { border-top: 0; }
.wd-says { color: var(--muted); }
.wd-items li.wd-st-bad .wd-says { color: #b42318; } .wd-items li.wd-st-warn .wd-says { color: #a14b00; }
.wd-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 5px; background: var(--rule); }
.wd-dot.ok { background: #19a463; } .wd-dot.warn { background: #e8a33d; } .wd-dot.bad { background: #d4380d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wd-pill.ok { background: #12352a; color: #6fd3a5; }
  :root:not([data-theme="light"]) .wd-pill.warn { background: #3a2a14; color: #f2b366; }
  :root:not([data-theme="light"]) .wd-pill.bad { background: #3d1a16; color: #ff9b8a; }
  :root:not([data-theme="light"]) .wd-t-bad, :root:not([data-theme="light"]) .wd-items li.wd-st-bad .wd-says { color: #ff9b8a; }
  :root:not([data-theme="light"]) .wd-t-warn, :root:not([data-theme="light"]) .wd-items li.wd-st-warn .wd-says { color: #f2b366; }
}
:root[data-theme="dark"] .wd-pill.ok { background: #12352a; color: #6fd3a5; }
:root[data-theme="dark"] .wd-pill.warn { background: #3a2a14; color: #f2b366; }
:root[data-theme="dark"] .wd-pill.bad { background: #3d1a16; color: #ff9b8a; }
:root[data-theme="dark"] .wd-t-bad, :root[data-theme="dark"] .wd-items li.wd-st-bad .wd-says { color: #ff9b8a; }
:root[data-theme="dark"] .wd-t-warn, :root[data-theme="dark"] .wd-items li.wd-st-warn .wd-says { color: #f2b366; }
/* 28 Oct 2026 UX pass: brief lines are easy to tap on a phone */
.wd-sec li.wd-li-ref { padding: 0; }
.wd-ref { display: block; width: 100%; min-height: 40px; padding: 9px 0; }
.wd-btn { min-height: 44px; }

/* ───── Desktop (28 Oct 2026): the morning brief and the health check side by side from 1280px; mouse states from 1024px.
   Below 1024px is untouched. ───── */
@media (min-width: 1024px) {
  .wd { gap: 16px; }
  .wd-strip { height: 28px; }
  .wd-ref { min-height: 0; padding: 4px 0; cursor: pointer; }
  .wd-ref:hover { color: var(--accent); text-decoration-color: currentColor; }
  .wd-btn { min-height: 38px; }
  .wd-btn:hover:not([disabled]) { filter: brightness(1.08); }
  .wd-btn.ghost:hover:not([disabled]) { filter: none; border-color: var(--accent); }
  .wd-items li { padding: 7px 4px; border-radius: 6px; }
  .wd-items li:hover { background: var(--bg); }
  .wd button:focus-visible, .wd-today button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}
@media (min-width: 1280px) {
  body:not(.chat-docked) .wd { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  body:not(.chat-docked) .wd > .card { min-width: 0; }
}
@media (min-width: 1440px) {
  body:not(.chat-docked) .wd { gap: 20px; }
}

/* desktop Today (28 Oct 2026): the brief spans both columns of crm.css's .k-today, right under the numbers */
.crm .k-today > .wd-today { column-span: all; margin-bottom: 16px; }
