/* SENTINEL v12 — Watch view. */
#view-watch { padding-top: var(--s-6); }
#view-watch .wrap > * + * { margin-top: var(--s-5); }

/* ── v12.2 top: live headline, pulse strip, priorities + context ── */
#view-watch .lead { max-width: 1100px; }
#view-watch .lead-h {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.75rem, 1.05rem + 2.1vw, 2.75rem); line-height: 1.12; letter-spacing: -0.012em;
  margin-top: var(--s-2); max-width: 34ch; text-wrap: balance;
}
#view-watch .lead-h em { font-style: italic; color: var(--amber); }
#view-watch .lead-sub { font-family: var(--f-display); font-style: italic; font-size: var(--t-18); color: var(--fog); margin-top: var(--s-2); max-width: 70ch; }
#view-watch .lead-sub:empty { display: none; }

#view-watch .pulse { margin-top: var(--s-5); }
#view-watch .pulse-h .mono { font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 6px; color: var(--fog); }
#view-watch .pulse-list { list-style: none; margin-top: var(--s-2); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--slate); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
#view-watch .pulse-list > li + li { border-left: 1px solid var(--rule); }
#view-watch .pulse-tile { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5);
  color: var(--fog); text-decoration: none; transition: background var(--t-fast); position: relative; }
#view-watch .pulse-tile:hover { background: var(--slate-2); }
#view-watch .pulse-tile:hover span { color: var(--paper); }
#view-watch .pulse-tile b { font-size: var(--t-36); font-weight: 500; line-height: 1; color: var(--paper); }
#view-watch .pulse-tile span { font-size: var(--t-14); line-height: 1.35; }
#view-watch .pulse-tile small { display: block; font-size: var(--t-12); color: var(--mist); margin-top: 2px; }
#view-watch .pulse-tile.is-hot b { color: var(--amber); }
#view-watch .pulse-tile.is-hot { background: color-mix(in srgb, var(--amber) 6%, transparent); }
#view-watch .pulse-tile.is-hot:hover { background: color-mix(in srgb, var(--amber) 10%, var(--slate-2)); }

#view-watch .watch-lead { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, 1fr); gap: var(--s-5); align-items: start; margin-top: var(--s-5); }
#view-watch .ctx { display: flex; flex-direction: column; gap: var(--s-2); }
#view-watch .ctx-tiles { list-style: none; background: var(--slate); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
#view-watch .ctx-tile { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--rule); display: grid; gap: 6px; }
#view-watch .ctx-tile:first-child { border-top: 0; }
#view-watch .ctx-tile > b, #view-watch .ctx-link > b { font-size: var(--t-28); font-weight: 500; line-height: 1; color: var(--paper); }
#view-watch .ctx-tile b small { font-size: var(--t-16); color: var(--mist); margin-left: 2px; }
#view-watch .ctx-tile span { font-size: var(--t-14); color: var(--fog); line-height: 1.45; }
#view-watch .ctx-tile span small { display: block; font-size: var(--t-12); color: var(--mist); margin-top: 2px; }
#view-watch .ctx-tile strong { color: var(--paper); font-weight: 600; }
#view-watch .ctx-bar { display: block; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; margin-top: 2px; }
#view-watch .ctx-bar i { display: block; height: 100%; background: var(--amber); border-radius: 2px; }
#view-watch .ctx-link { display: grid; gap: 6px; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: none; width: 100%; }
#view-watch .ctx-link:hover span { color: var(--paper); }
#view-watch .ctx-link .is-amber, #view-watch .ctx-link button b { color: var(--amber); }
#view-watch .ctx-tile button.ctx-link > b { color: var(--amber); }
#view-watch .ctx-basis { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s-2); font-size: var(--t-12); color: var(--mist); padding-inline: 2px; }
#view-watch .ctx-basis:empty { display: none; }
@media (max-width: 1080px) {
  #view-watch .pulse-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #view-watch .pulse-list > li { border-top: 1px solid var(--rule); }
  #view-watch .pulse-list > li:nth-child(-n+3) { border-top: 0; }
  #view-watch .pulse-list > li:nth-child(3n+1) { border-left: 0; }
}
@media (max-width: 560px) {
  #view-watch .pulse-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-watch .pulse-list > li { border-left: 0; border-top: 1px solid var(--rule); }
  #view-watch .pulse-list > li:nth-child(-n+2) { border-top: 0; }
  #view-watch .pulse-list > li:nth-child(2n) { border-left: 1px solid var(--rule); }
  #view-watch .pulse-list > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #view-watch .pulse { margin-top: var(--s-4); }
  #view-watch .pulse-tile { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; }
  #view-watch .pulse-tile b { font-size: var(--t-22); min-width: 1.6em; }
  #view-watch .pulse-tile span { font-size: var(--t-13); line-height: 1.25; }
  #view-watch .pulse-tile small { display: none; }
  #view-watch .pulse-tile small.keep { display: block; }
  #view-watch .lead-sub { font-size: var(--t-16); }
  #view-watch .ctx-tile { padding-inline: var(--s-4); }
}

#view-watch .pri { overflow: hidden; }
#view-watch .pri-list { list-style: none; }
#view-watch .pri-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--rule); position: relative; }
#view-watch .pri-item:first-child { border-top: 0; }
#view-watch .pri-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
#view-watch .pri-item.lvl-critical::before, #view-watch .pri-item.lvl-system::before { background: var(--sev-crit); }
#view-watch .pri-item.lvl-high::before { background: var(--sev-high); }
#view-watch .pri-item.lvl-watch::before { background: var(--rule-2); }
#view-watch .pri-n { font-size: var(--t-22); color: var(--mist); line-height: 1.2; text-align: right; padding-top: 22px; }
#view-watch .pri-item:first-child .pri-n { color: var(--paper); }
#view-watch .pri-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
#view-watch .pri-t {
  display: block; text-align: left; background: none; border: 0; padding: 0;
  font-family: var(--f-body); font-size: var(--t-18); font-weight: 700; line-height: 1.35;
  color: var(--paper); text-decoration: none; cursor: pointer;
}
#view-watch .pri-t:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
#view-watch .pri-why { font-size: var(--t-14); color: var(--fog); margin-top: 4px; line-height: 1.5; }
#view-watch .pri-item.mine .pri-why::after { content: ""; }
#view-watch .pri-more { padding: 0 var(--s-5) var(--s-3); }
#view-watch .pri-list > .empty { list-style: none; }

/* ── waterfall ── */
#view-watch .fall-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-5); padding: var(--s-4) var(--s-5) var(--s-5); }
#view-watch .scope { min-width: 0; }
#view-watch .bands { display: grid; margin-left: 46px; border-bottom: 1px solid var(--rule); font-size: var(--t-12); color: var(--fog); }
#view-watch .bands div { padding: 0 4px 6px 8px; border-left: 1px solid var(--rule); min-width: 0; overflow: hidden; }
#view-watch .bands b { display: block; color: var(--paper); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-watch .bands > div > span { font-family: var(--f-data); display: block; line-height: 1.35; overflow-wrap: anywhere; }
#view-watch .bands b .short { display: none; }
#view-watch .screen { display: flex; }
#view-watch .yaxis { width: 46px; flex: none; position: relative; font-family: var(--f-data); font-size: var(--t-12); color: var(--mist); }
#view-watch .yaxis span { position: absolute; right: 8px; transform: translateY(-50%); white-space: nowrap; }
#view-watch .yaxis span:first-child { transform: translateY(0); }
#view-watch .yaxis span:last-child { transform: translateY(-100%); }
#view-watch #wf { display: block; width: 100%; min-width: 0; height: clamp(320px, 46vh, 480px); background: var(--ink-2); border-radius: 0 0 var(--radius) var(--radius); cursor: crosshair; }
#view-watch #wf:focus-visible { outline-offset: -2px; }
#view-watch .ramp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0 46px; font-size: var(--t-12); color: var(--fog); }
#view-watch .ramp i { display: block; width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ramp-0), var(--ramp-1), var(--ramp-2), var(--ramp-3), var(--ramp-4)); }
#view-watch .scope .note { margin: 8px 0 0 46px; }
#view-watch .readout { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ink-2); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
#view-watch .ro-top { display: flex; justify-content: space-between; gap: var(--s-2); }
#view-watch .ro-top span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-watch .ro-title { font-family: var(--f-display); font-size: var(--t-22); line-height: 1.3; overflow-wrap: anywhere; }
#view-watch .ro-title kbd { font-size: var(--t-12); }
#view-watch .ro-hint { margin-top: auto; }

/* ── judgments ── */
#view-watch .kj { list-style: none; }
#view-watch .kj > li { padding: var(--s-4) var(--s-5) var(--s-5); border-top: 1px solid var(--rule); }
#view-watch .kj > li:first-child { border-top: 0; }
#view-watch .kj-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); align-items: start; }
#view-watch .kj h3 { font-family: var(--f-display); font-weight: 500; font-size: var(--t-22); line-height: 1.28; }
#view-watch .kj p { color: var(--fog); margin-top: var(--s-2); max-width: 70ch; }
#view-watch .kj-basis { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── your stack ── */
#view-watch .stack-add { display: flex; gap: var(--s-2); margin-top: var(--s-3); max-width: 420px; }
#view-watch .due-over { color: var(--sev-crit); }
#view-watch .due-open { color: var(--amber); }
#view-watch .epss { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-12); color: var(--fog); }
#view-watch .epss .meter { width: 64px; }

/* ── lanes ── */
#view-watch .lanes .row { padding-block: 10px; }
#view-watch .lanes .row-title { font-weight: 600; font-size: var(--t-14); }
#view-watch .lanes .row-title a { color: var(--paper); text-decoration: none; }
#view-watch .lanes .row-title a:hover { color: var(--cyan); text-decoration: underline; }
#view-watch .scales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-4); }
#view-watch .scale { border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 10px 12px; }
#view-watch .scale b { display: block; font-size: var(--t-28); font-weight: 500; line-height: 1.1; color: var(--ok); }
#view-watch .scale.lvl-1 b, #view-watch .scale.lvl-2 b { color: var(--amber); }
#view-watch .scale.lvl-3 b, #view-watch .scale.lvl-4 b, #view-watch .scale.lvl-5 b { color: var(--sev-crit); }
#view-watch .scale span { font-size: var(--t-12); color: var(--fog); }
#view-watch svg.kp { width: 100%; height: auto; display: block; }

@media (max-width: 1080px) {
  #view-watch .watch-lead { grid-template-columns: minmax(0, 1fr); }
  #view-watch .ctx-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-watch .ctx-tile { border-top: 0; border-left: 1px solid var(--rule); }
  #view-watch .ctx-tile:nth-child(odd) { border-left: 0; }
  #view-watch .ctx-tile:nth-child(n+3) { border-top: 1px solid var(--rule); }
  #view-watch .fall-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  #view-watch .bands { margin-left: 30px; } #view-watch .yaxis { width: 30px; } #view-watch .ramp, #view-watch .scope .note { margin-left: 30px; }
  #view-watch .bands > div > span { display: none; }
  #view-watch .bands div { padding-left: 3px; }
  #view-watch .bands b .full { display: none; } #view-watch .bands b .short { display: inline; }
  #view-watch .fall-grid { padding-inline: var(--s-3); }
  #view-watch .pri-item { padding-inline: var(--s-4); grid-template-columns: 24px minmax(0, 1fr); }
  #view-watch .kj > li { padding-inline: var(--s-4); }
}

/* ── v12.1: grades, AI tag, policy clock ── */
#view-watch .grade, #drawer .grade { font-family: var(--f-data); font-weight: 600; color: var(--paper); margin-left: 2px; }
#view-watch .policy-list { list-style: none; }
#view-watch .policy-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--rule); }
#view-watch .policy-item:first-child { border-top: 0; }
#view-watch .policy-when { font-size: var(--t-14); color: var(--fog); display: flex; flex-direction: column; gap: 2px; }
#view-watch .policy-when span { font-size: var(--t-12); color: var(--mist); }
#view-watch .policy-item.is-deadline .policy-when { color: var(--amber); }
#view-watch .policy-item.is-deadline .policy-when span { color: var(--amber); font-weight: 600; }
#view-watch .policy-title { font-weight: 700; }
#view-watch .policy-meta { margin-top: var(--s-2); display: flex; flex-wrap: wrap; gap: 6px var(--s-3); align-items: center; font-size: var(--t-13); }
@media (max-width: 560px) { #view-watch .policy-item { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-inline: var(--s-4); } }
#drawer .grades-list > li { padding: 10px 0; }
#drawer .grades-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: var(--s-3); align-items: start; }
#drawer .grades-row .grade { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--rule-2); margin: 0; }
#drawer .grade--A { color: var(--ok); border-color: var(--ok); }
#drawer .grade--B { color: var(--cyan); border-color: var(--cyan); }
#drawer .grade--C { color: var(--amber); border-color: var(--amber); }
#drawer .grade--F { color: var(--sev-high); border-color: var(--sev-high); }
#view-watch .policy-meta .chip { white-space: normal; border-radius: 10px; }

/* ── v12.2: glossary hooks ── */
#view-watch .ro-learn { font-size: var(--t-13); color: var(--mist); line-height: 1.5; border-top: 1px solid var(--rule); padding-top: var(--s-3); margin-top: auto; }
#view-watch .ro-learn:empty { display: none; }
#view-watch .ro-learn b { color: var(--fog); font-weight: 600; }
#view-watch .ro-learn:not(:empty) + .ro-hint { margin-top: 0; }
#view-watch .bands b .term { color: inherit; font-weight: inherit; }
#view-watch .lead .learn-note { margin-top: var(--s-3); max-width: 80ch; }

/* v12.2 review: context heading inside its box so it aligns with Priorities */
#view-watch .ctx { gap: 0; }
#view-watch .ctx-box { background: var(--slate); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
#view-watch .ctx-box > .ctx-head { padding: var(--s-4) var(--s-5) var(--s-2); }
#view-watch .ctx-box .ctx-tiles { background: none; border: 0; border-radius: 0; }
#view-watch .ctx-basis { margin-top: var(--s-2); }
#view-watch .ctx-tile > b small.unit, #view-watch .ctx-link > b small.unit { margin-left: 3px; }

/* v12.5: vendor patch days are scheduled, not deadlines: cyan, not amber */
#view-watch .policy-item.is-patch .policy-when { color: var(--cyan); }
#view-watch .policy-item.is-patch .policy-when span { color: var(--fog); }
#view-watch .wire-down { color: var(--sev-med); cursor: help; }
