/* JWATCH redesign mock v2 (11/5). Same palette as the PROJECT #3 sample board (cement matrix,
   brass strip, DAC blue for links/focus, Segoe UI, tabular numerals), laid out as a dense grouped
   list (one row per job) after Mobbin references: Linear issue list, Zendesk grouped tickets,
   Searchable inline score rings, Customer.io "healthy" card. Departures from the v1 rules:
   one soft panel with a 6px corner, and a muted green for the score gradient. */

:root {
  --ground: #efece5;   /* page behind the panel */
  --matrix: #f8f6f2;   /* panel surface */
  --matrix-2: #f1eee8; /* group header / hover */
  --matrix-3: #e7e3db; /* pressed / track */
  --ink: #1f1d1a; --ink-2: #5a5751; --ink-3: #847d72;
  --strip: #c2a86b; --line: rgba(31, 29, 26, 0.09); --line-2: rgba(31, 29, 26, 0.16);
  --blue: #0b4f9c;
  --t1: #9e2a1c; --t1-field: #f6e6e1;
  --amber: #a46f00;
  --g-red: #b0361f; --g-amber: #c08a12; --g-green: #3f8050;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --r: 6px; --r-s: 4px;
  color-scheme: light;
}
[data-theme="dark"] {
  --ground: #161513;
  --matrix: #1e1d1a; --matrix-2: #242320; --matrix-3: #2f2d29;
  --ink: #ece8e0; --ink-2: #b3ada2; --ink-3: #8c867c;
  --strip: #8e939b; --line: rgba(236, 232, 224, 0.07); --line-2: rgba(236, 232, 224, 0.14);
  --blue: #86b4ea;
  --t1: #f29486; --t1-field: #33221e;
  --amber: #e4b663;
  --g-red: #f08a7a; --g-amber: #e4b663; --g-green: #86c495;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; font: 13px/1.45 var(--font); color: var(--ink); background: var(--ground); font-variant-numeric: tabular-nums; min-width: 1280px; }
a { color: var(--blue); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1 { margin: 0; }

/* ---------- top bar ---------- */
.top { background: var(--matrix); border-bottom: 1px solid var(--strip); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 28px; height: 52px; display: flex; align-items: center; justify-content: space-between; }
.mark { display: flex; align-items: center; gap: 10px; }
.mark b { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; }
.logo { width: 18px; height: 18px; border-radius: 4px; background:
  radial-gradient(circle at 30% 35%, var(--ink-2) 0 1.6px, transparent 2px),
  radial-gradient(circle at 68% 30%, var(--strip) 0 1.8px, transparent 2.2px),
  radial-gradient(circle at 55% 70%, var(--ink-3) 0 2px, transparent 2.4px),
  radial-gradient(circle at 22% 75%, var(--strip) 0 1.2px, transparent 1.6px),
  var(--matrix-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.crumb { color: var(--ink-3); padding-left: 10px; border-left: 1px solid var(--line-2); }
.top-r { display: flex; align-items: center; gap: 14px; color: var(--ink-2); font-size: 12px; }
.mockflag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 999px; padding: 1px 8px; cursor: help; }
.btn { background: var(--matrix); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 4px 12px; font-size: 12px; cursor: pointer; }
.btn:hover { background: var(--matrix-2); border-color: var(--ink-3); }

/* ---------- page ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.title-row h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); cursor: help; }
.legend .bar { width: 120px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--g-red), var(--g-amber) 50%, var(--g-green)); }
.legend .rule { padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--line-2); }

.summary { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.sum { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 999px; background: var(--matrix); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sum:hover { border-color: var(--line-2); background: var(--matrix-2); }
.sum .n { font-weight: 700; font-size: 14px; }
.sum .l { color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.crit { background: var(--g-red); }
.dot.look { background: var(--g-amber); }
.dot.follow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.dot.clear { background: var(--g-green); }
label.chk { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
label.chk input { margin: 0; accent-color: var(--blue); }
label.chk .c { color: var(--ink-3); }

/* ---------- the panel ---------- */
.panel { background: var(--matrix); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.group + .group { border-top: 1px solid var(--line-2); }
.ghead { width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 40px; background: var(--matrix-2); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.ghead:hover { background: var(--matrix-3); }
.ghead .chev { width: 14px; height: 14px; color: var(--ink-3); transform: rotate(90deg); transition: transform 120ms; }
.ghead.collapsed .chev { transform: none; }
.ghead.collapsed { border-bottom: 0; }
.gt { font-weight: 600; font-size: 13px; }
.gc { font-size: 12px; color: var(--ink-3); font-weight: 600; min-width: 18px; }
.gn { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.crit .gt { color: var(--t1); }

/* column labels */
.cols, .row { display: grid; grid-template-columns: 36px minmax(240px, 1.25fr) 84px minmax(260px, 2fr) 132px 112px 16px; gap: 16px; align-items: center; padding: 0 16px; }
.cols { height: 30px; font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.03em; border-bottom: 1px solid var(--line); }

/* a job row */
.row { min-height: 56px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover { background: var(--matrix-2); }
.row.open { background: var(--matrix-2); border-bottom-color: transparent; }
.row > .chev { width: 14px; height: 14px; color: var(--ink-3); transition: transform 120ms; }
.row.open > .chev { transform: rotate(90deg); }
.group > .row:last-child, .group > .detail:last-child { border-bottom: 0; }

.ring { position: relative; width: 36px; height: 36px; display: inline-block; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: var(--matrix-3); }
.ring .fill { stroke: var(--rc); stroke-linecap: round; }
.ring .v { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.ring.gem .v { font-size: 8.5px; letter-spacing: 0.06em; color: var(--t1); }

.job { display: flex; flex-direction: column; min-width: 0; }
.job .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .no, .clear-list .no { font-size: 11.5px; color: var(--ink-3); }
.fac-tag { justify-self: start; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--matrix-3); border-radius: var(--r-s); padding: 2px 7px; }
.what { min-width: 0; color: var(--ink); }
.what .tag { color: var(--ink-3); margin-left: 4px; white-space: nowrap; }
.what .more { color: var(--blue); font-size: 12px; margin-left: 6px; }
.when, .start { display: flex; flex-direction: column; line-height: 1.3; font-size: 12px; }
.wl { color: var(--ink-2); }
.wr { color: var(--ink-3); font-size: 11.5px; }
.when.late .wr { color: var(--t1); font-weight: 600; }
.none { color: var(--ink-3); }

/* opened row */
.detail { padding: 4px 16px 16px 68px; background: var(--matrix-2); border-bottom: 1px solid var(--line); cursor: default; }
.dl-k { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.03em; margin-bottom: 6px; }
.lines { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.lines li { display: grid; grid-template-columns: 34px 76px 1fr; gap: 10px; align-items: baseline; }
.lines .d { font-weight: 700; color: var(--t1); text-align: right; }
.lines .fac { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); }
.chips { display: flex; gap: 6px; }
.chip { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-3); }
.chip i { font-style: normal; color: var(--g-green); margin-left: 2px; }
.chip.bad { color: var(--ink); border-color: color-mix(in oklab, var(--g-amber) 55%, transparent); background: color-mix(in oklab, var(--g-amber) 12%, transparent); font-weight: 600; }
.math { font-size: 12px; color: var(--ink-3); }
.math b { color: var(--ink); }

/* critical: calm healthy state */
.calm { display: flex; align-items: center; gap: 14px; padding: 16px; }
.ok-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--g-green); background: color-mix(in oklab, var(--g-green) 14%, transparent); }
.ok-ic svg { width: 18px; height: 18px; }
.calm > div { display: flex; flex-direction: column; }
.calm b { font-weight: 600; font-size: 13.5px; }
.calm span { color: var(--ink-2); }
.link { margin-left: auto; background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font-size: 12px; }
.link:hover { text-decoration: underline; }
.gemrow { background: var(--t1-field); border-top: 1px solid var(--line); cursor: default; }
.gemrow:hover { background: var(--t1-field); }
.exlabel { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t1); grid-column: 7; justify-self: end; writing-mode: horizontal-tb; }
.gemrow .exlabel { grid-column: auto; }

/* follow up: lighter rows */
.follow .row { min-height: 46px; cursor: default; }
.follow .row:hover { background: transparent; }
.fdot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-3); justify-self: center; }
.follow .job .nm { font-weight: 500; }
.follow .what { color: var(--ink-2); }

/* all clear */
.empty-line { padding: 10px 16px 10px 68px; color: var(--ink-3); font-size: 12px; border-top: 1px solid var(--line); }
.clear-tools { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.search { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; width: 340px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--matrix); color: var(--ink-3); }
.search:focus-within { border-color: var(--blue); }
.search svg { width: 14px; height: 14px; flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12.5px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.qn { font-size: 12px; color: var(--ink-3); }
.clear-list { list-style: none; margin: 0; padding: 0 16px 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 24px; }
.clear-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); min-width: 0; }
.clear-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clear-list .no { margin-left: auto; white-space: nowrap; }
.cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--g-green); flex: none; }
.clear-list .none { grid-column: 1 / -1; color: var(--ink-2); padding: 12px 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.mockflag.stale{color:var(--t1,#9e2a1c)}

/* not-live warning + what's-checked list (11/5) */
.stale-banner { background: #9e2a1c; color: #fff; font-weight: 600; font-size: 13px; padding: 8px 20px; text-align: center; }
.stale-banner[hidden], .coverage[hidden] { display: none; }
.mockflag.stale { color: #fff; background: #9e2a1c; border: 1px solid #9e2a1c; }
.coverage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border: 1px solid var(--line-2); border-radius: 8px; padding: 16px 20px; margin: 0 0 16px; }
.coverage h2 { font-size: 13px; margin: 0 0 8px; }
.coverage ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
@media (max-width: 800px) { .coverage { grid-template-columns: 1fr; } }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: 420px; background: #1f2a33; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.25); z-index: 50; }
.toast[hidden] { display: none; }
.feedrow { display: grid; grid-template-columns: 90px 1.3fr 1.6fr 70px 120px; gap: 12px; padding: 6px 16px; font-size: 12.5px; border-top: 1px solid var(--line-2); }
.feedrow .ft, .feedrow .fa, .feedrow .fw { color: var(--ink-3); }
.feedrow .fj, .feedrow .ff { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gn-bad { color: #9e2a1c; font-weight: 600; }

/* clearing a critical with a written reason (11/12) */
.clr-open { margin-left: 10px; font-size: 12px; }
.lines li.clr-form { display: block; margin: 6px 0 8px 120px; }
.clr-form > div { border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--matrix); padding: 10px 12px; display: grid; gap: 8px; }
.clr-l { color: var(--ink-2); font-size: 12.5px; }
.clr-l b { color: var(--t1); }
.clr-form textarea { width: 100%; resize: vertical; min-height: 64px; font: inherit; font-size: 13px; color: var(--ink); background: var(--matrix); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 6px 8px; }
.clr-form textarea:focus, .clr-who input:focus { border-color: var(--blue); outline: 0; }
.clr-row { display: flex; align-items: center; gap: 10px; }
.clr-who { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.clr-who input { width: 160px; height: 26px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--matrix); }
.clr-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.btn.danger { background: var(--t1); border-color: var(--t1); color: var(--matrix); font-weight: 600; }
.btn.danger:hover { background: color-mix(in oklab, var(--t1) 85%, var(--ink)); }
.btn:disabled, .btn.danger:disabled { opacity: 0.45; cursor: not-allowed; }
.clr-err { color: var(--t1); font-weight: 600; font-size: 12.5px; }
.clr-item { padding: 12px 16px 12px 68px; border-top: 1px solid var(--line); }
.clr-h { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 2fr) auto auto; gap: 16px; align-items: center; }
.clr-st { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-3); cursor: help; }
.clr-st.on { color: var(--t1); border-color: color-mix(in oklab, var(--t1) 45%, transparent); }
.clr-why { margin: 8px 0 4px; padding: 6px 12px; border-left: 3px solid var(--strip); color: var(--ink); white-space: pre-wrap; }
.clr-by { font-size: 11.5px; color: var(--ink-3); }
.clr-by span { text-decoration: underline dotted; cursor: help; }
