/* Client updates desk (OPS-0196 part B). Portal tokens only; every status is colour + symbol + word. */
.upd-page, .upd-layer { --upd-run: #93c5fd; --upd-off: #a3a3a3; --text-muted: #9a9a9a; --upd-gap: 24px; }   /* dark: a touch brighter than the portal's muted so it holds 4.5:1 on elevated rows */
/* Light theme: the portal's tokens do the surfaces; status colours and muted text are darkened here for >=4.5:1 on white (PhoneDesk light artboard). */
[data-theme="light"] .upd-page, [data-theme="light"] .upd-layer, [data-theme="light"] .upd-tabbar { --upd-run: #1d4ed8; --upd-off: #525252; --status-ok: #15803d; --status-warn: #b45309; --status-error: #b91c1c; --text-muted: #6b6b6b; --accent-link: #047857; }
[data-theme="light"] .upd-pill, [data-theme="light"] .upd-att-badge { background: color-mix(in srgb, var(--c) 7%, transparent); }
[data-theme="light"] .upd-nav-badge { color: #fff; }
.upd-page > div { display: flex; flex-direction: column; gap: var(--upd-gap); min-width: 0; }
.upd-page .upd-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.upd-page h1 { margin: 0; font-size: 26px; font-weight: 600; color: var(--text-heading); letter-spacing: -.01em; }
.upd-page h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-heading); }
.upd-page h2.upd-eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.upd-muted { color: var(--text-muted); }
.upd-small { font-size: 12px; }
.upd-mono { font-family: var(--font-mono); }
.upd-strong { color: var(--text-heading); }
.upd-nowrap { white-space: nowrap; }
.upd-empty { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.upd-note { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 10px 14px; font-size: 13px; color: var(--status-warn); margin: 0; }
.upd-hero { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.upd-hero p { margin: 6px 0 0; font-size: 14px; }
.upd-hero-main { min-width: 0; }
.upd-hero-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.upd-titlerow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upd-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.upd-section { display: flex; flex-direction: column; gap: 12px; }
.upd-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.upd-back { font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; align-self: flex-start; }
.upd-nav-badge { margin-left: auto; background: var(--status-error); color: #1c1c1c; border-radius: 9999px; font-size: 11px; padding: 1px 8px; font-weight: 700; }
.upd-nav-badge[hidden] { display: none; }

/* status pills */
.upd-c-ok { --c: var(--status-ok); } .upd-c-run { --c: var(--upd-run); } .upd-c-warn { --c: var(--status-warn); }
.upd-c-fail { --c: var(--status-error); } .upd-c-off { --c: var(--upd-off); } .upd-c-sched { --c: var(--upd-off); }
.upd-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 9999px; padding: 3px 10px;
  color: var(--c); border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.upd-c-sched.upd-pill { background: transparent; }
.upd-ico { font-family: var(--font-mono); }
.upd-c-ok-t { color: var(--status-ok); } .upd-c-run-t { color: var(--upd-run); } .upd-c-warn-t { color: var(--status-warn); }
.upd-c-fail-t { color: var(--status-error); } .upd-c-off-t { color: var(--upd-off); }
.upd-c-ok-bg { background: var(--status-ok); } .upd-c-run-bg { background: var(--upd-run); } .upd-c-warn-bg { background: var(--status-warn); }
.upd-c-fail-bg { background: var(--status-error); } .upd-c-off-bg { background: var(--upd-off); }

/* header pill, buttons */
.upd-asof { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-body); border: 1px solid var(--border); border-radius: 9999px; padding: 8px 14px; min-height: 44px; box-sizing: border-box; }
.upd-asof-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-ok); }
.upd-asof-stale { border-color: var(--status-warn); } .upd-asof-stale .upd-asof-dot { background: var(--status-warn); }
.upd-asof-note, .upd-asof-warn { color: var(--status-warn); }
.upd-btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-heading); background: transparent;
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); padding: 10px 14px; min-height: 44px; box-sizing: border-box; white-space: nowrap; cursor: pointer; text-decoration: none; }
.upd-btn:hover { background: var(--bg-elevated); text-decoration: none; }
.upd-btn-primary { background: var(--accent); color: var(--accent-on); border-color: transparent; }
.upd-btn-primary:hover { background: var(--accent-hover); }
.upd-link, .upd-tname, .upd-lane-name { font: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--text-heading); }
.upd-link:hover, .upd-tname:hover, .upd-lane-name:hover { color: var(--accent-link); }
.upd-link-a { font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }
.upd-mname { color: var(--text-heading); font-weight: 600; overflow-wrap: anywhere; }
a.upd-mname:hover { color: var(--accent-link); }
.upd-tk { font: 500 12px var(--font-mono); border: 1px solid var(--border-strong); border-radius: 9999px; padding: 1px 8px; color: var(--accent-link); }

/* needs attention */
.upd-att-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; }
.upd-att-row .upd-pill { justify-self: start; }
.upd-att-top { font-size: 14px; }
.upd-att-why { font-size: 13px; color: var(--text-body); margin-top: 3px; overflow-wrap: anywhere; }

.upd-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* attention actions (OPS-0196 v2): inline buttons, snoozed rows, side panel, dialogs. Same pills/buttons/tokens as the rest of the desk. */
.upd-att-row[data-row] { cursor: pointer; }
.upd-att-acts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upd-btn[disabled] { opacity: .55; cursor: default; }
.upd-btn-quiet { border-color: transparent; color: var(--text-body); margin-left: auto; }
.upd-att-err { font-size: 13px; margin-top: 6px; overflow-wrap: anywhere; }
.upd-att-prev { margin-top: 4px; overflow-wrap: anywhere; }
.upd-snz-row { grid-template-columns: 150px minmax(0, 1fr) auto; cursor: default; }
.upd-pill-dash { border-style: dashed; background: transparent; }
.upd-page .upd-btn:focus-visible, .upd-layer .upd-btn:focus-visible, .upd-layer .upd-input:focus-visible, .upd-layer a:focus-visible, .upd-layer input:focus-visible,
.upd-page .upd-att-row a:focus-visible { outline: 2px solid var(--accent-link); outline-offset: 2px; }
.upd-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 80; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-card); color: var(--text-body); border-left: 1px solid var(--border-strong); box-shadow: -12px 0 32px rgba(0, 0, 0, .35);
  padding: 20px; display: flex; flex-direction: column; gap: 18px; font-size: 13px; }
.upd-panel h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text-heading); overflow-wrap: anywhere; }
.upd-panel h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.upd-panel p { margin: 6px 0 0; }
.upd-pn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.upd-pn-state, .upd-pn-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.upd-pn-sec { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.upd-pn-fail { padding: 8px 0; border-top: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.upd-pn-sug { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 10px 12px; color: var(--text-body); }
.upd-pn-act { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.upd-pn-act .upd-btn { white-space: normal; text-align: left; }
.upd-pn-btns, .upd-dlg-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.upd-dlg-btns { justify-content: flex-end; margin-top: 4px; }
.upd-lbl { display: block; font-size: 13px; font-weight: 600; color: var(--text-heading); margin: 8px 0 6px; padding: 0; }
.upd-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--text-body); background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-input); padding: 10px 12px; min-height: 44px; }
.upd-ta { resize: vertical; line-height: 1.5; min-height: 160px; }
.upd-date { width: auto; margin-left: 8px; }
.upd-fs { border: 0; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.upd-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--text-body); flex-wrap: wrap; }
.upd-opt input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
.upd-dlg { background: var(--bg-card); color: var(--text-body); border: 1px solid var(--border-strong); border-radius: var(--radius-card); padding: 24px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; }
.upd-dlg::backdrop { background: rgba(0, 0, 0, .6); }
.upd-dlg-form { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.upd-dlg-form h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text-heading); overflow-wrap: anywhere; }
.upd-dlg-form p { margin: 0; }
.upd-dlg-warn { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border-strong); border-radius: var(--radius-input); padding: 10px 12px; background: var(--bg-elevated); }
.upd-dlg-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

/* client tiles */
.upd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.upd-tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.upd-tile-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.upd-tname { font-size: 15px; font-weight: 600; min-height: 44px; }
.upd-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.upd-dot { width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--text-muted); background: transparent; }
.upd-d-ok { background: var(--status-ok); border-color: var(--status-ok); }
.upd-d-running { border-color: var(--upd-run); }
.upd-d-restart { background: var(--status-warn); border-color: var(--status-warn); border-radius: 3px; }
.upd-d-failed { background: var(--status-error); border-color: var(--status-error); }
.upd-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.upd-count { font: inherit; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-body); background: var(--bg-elevated);
  border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; min-height: 44px; box-sizing: border-box; cursor: pointer; text-align: left; }
.upd-count:hover, .upd-count.is-on { border-color: var(--border-strong); }
.upd-num { font-family: var(--font-mono); font-weight: 600; color: var(--text-muted); }
.upd-kv { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 6px 8px; font-size: 13px; margin: 0; }
.upd-kv dt { color: var(--text-muted); } .upd-kv dd { margin: 0; overflow-wrap: anywhere; }
.upd-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.upd-fwhy { flex: 1 1 240px; min-width: 0; } .upd-fseen { margin-left: auto; }

/* running now, phases */
.upd-runcard { display: flex; flex-direction: column; gap: 10px; }
.upd-runcard + .upd-runcard { border-top: 1px solid var(--border); padding-top: 16px; }
.upd-runtitle { font-size: 14px; font-weight: 600; color: var(--text-heading); }
.upd-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-height: 44px; }
.upd-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--upd-run); }
.upd-bar { display: flex; height: 10px; border-radius: 9999px; overflow: hidden; background: var(--bg-elevated); }
.upd-bar-ok { background: var(--status-ok); } .upd-bar-run { background: var(--upd-run); } .upd-bar-fail { background: var(--status-error); } .upd-bar-off { background: var(--upd-off); }
.upd-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-muted); }
.upd-phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.upd-ph { border-top: 4px solid var(--border-strong); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.upd-ph-done { border-top-color: var(--status-ok); } .upd-ph-live { border-top-color: var(--upd-run); }
.upd-ph-name { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.upd-ph-done .upd-ph-name { color: var(--text-body); } .upd-ph-live .upd-ph-name { color: var(--text-heading); }

/* up next */
.upd-next { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.upd-count-down { font: 500 15px var(--font-mono); color: var(--text-heading); }
.upd-link { font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.upd-next-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.upd-chip { border: 1px dashed var(--border-strong); border-radius: 9999px; padding: 2px 9px; color: var(--text-body); }

/* this week */
.upd-week { display: grid; grid-template-columns: 120px repeat(7, minmax(0, 1fr)); font-size: 12px; }
.upd-day { padding: 0 0 8px 6px; color: var(--text-muted); } .upd-day.is-today { color: var(--text-heading); font-weight: 600; }
.upd-lane-name { padding: 12px 8px 12px 0; border-top: 1px solid var(--border-subtle); min-height: 44px; box-sizing: border-box; font-size: 12px; color: var(--text-body); }
.upd-cell { border-top: 1px solid var(--border-subtle); border-left: 1px solid var(--border-subtle); padding: 8px 6px; min-height: 44px; box-sizing: border-box; font-size: 11px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.upd-cell.has-ev { background: color-mix(in srgb, var(--upd-run) 10%, transparent); }
.upd-cell-ev { color: var(--text-body); overflow-wrap: anywhere; }
a.upd-cell-ev { text-decoration: underline; text-underline-offset: 2px; }
.upd-cell-now { font-weight: 600; }

/* tables */
.upd-scroll { overflow-x: auto; }
.upd-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; }
.upd-table th { font-weight: 500; text-align: left; padding: 8px; color: var(--text-muted); }
.upd-table td { padding: 12px 8px; border-top: 1px solid var(--border-subtle); vertical-align: top; }
.upd-table th:first-child, .upd-table td:first-child { padding-left: 0; }
.upd-when { font-family: var(--font-mono); white-space: nowrap; }
.upd-w-prog { width: 180px; }
.upd-mbar { height: 6px; border-radius: 9999px; background: var(--bg-elevated); overflow: hidden; }
.upd-mbar span { display: block; height: 6px; }
.upd-seen-on { color: var(--status-ok); } .upd-seen-off { color: var(--upd-off); }

/* run detail */
.upd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.upd-st-tile { font: inherit; text-align: left; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; display: flex; flex-direction: column; gap: 6px; min-height: 44px; color: inherit; }
button.upd-st-tile { cursor: pointer; } button.upd-st-tile:hover, .upd-st-tile.is-on { border-color: var(--border-strong); }
.upd-stat { font: 600 26px var(--font-mono); color: var(--text-heading); }
.upd-pkgs { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.upd-pkgs li { padding: 9px 0; border-top: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.upd-feed { list-style: none; margin: 0; padding: 0; }
.upd-feed li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; overflow-wrap: anywhere; }

.upd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; color: var(--text-muted); font-size: 12px; }
.upd-logos { display: inline-flex; align-items: center; gap: 22px; opacity: .85; }

@media (max-width: 900px) {
  .upd-two { grid-template-columns: minmax(0, 1fr); }
  .upd-att-row { grid-template-columns: minmax(0, 1fr); }
}

/* phone-only / desktop-only pieces, the bottom tab bar */
.upd-phone-only, .upd-tabbar { display: none; }
.upd-att-badge { width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; font: 700 14px var(--font-mono);
  color: var(--c); border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); box-sizing: border-box; }
.upd-tabbar button { position: relative; font: inherit; font-size: 11px; font-weight: 600; color: var(--text-muted); background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; cursor: pointer; }
.upd-tabbar button.is-on { color: var(--accent-link); }
.upd-tab-ico { width: 22px; height: 22px; border-radius: 6px; border: 2px solid currentColor; box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.upd-tab-badge { position: absolute; top: 4px; left: calc(50% + 8px); background: var(--status-error); color: #1c1c1c; border-radius: 9999px; font-size: 10px; line-height: 16px; padding: 0 6px; font-weight: 700; }
.upd-tab-badge[hidden] { display: none; }
[data-theme="light"] .upd-tab-badge { color: #fff; }

@media (max-width: 640px) {
  .upd-desk-only { display: none !important; }
  .upd-phone-only { display: revert; }
  .upd-att-badge.upd-phone-only { display: flex; }
  .upd-page { --upd-gap: 18px; }
  body:has(.upd-tabbar) main.upd-page.dashboard { padding: 16px 16px calc(84px + 60px + 16px + env(safe-area-inset-bottom)); }
  body:has(.upd-tabbar) .chat-dock { bottom: calc(84px + 12px + env(safe-area-inset-bottom)); right: 16px; width: 52px; height: 52px; }
  .upd-page [id^="upd-"] { scroll-margin-top: 76px; }
  .upd-page .upd-card { padding: 14px; gap: 8px; }
  .upd-page h1 { font-size: 22px; }
  .upd-hero { align-items: flex-start; gap: 8px; }
  .upd-hero p { display: none; }
  .upd-hero-main p { display: block; }
  .upd-hero-tools { width: 100%; }
  .upd-hero-tools .upd-btn { flex: 1 1 100%; min-height: 52px; }
  .upd-asof { font-size: 12px; padding: 4px 12px; min-height: 36px; }
  .upd-head { align-items: center; }
  .upd-page .upd-head > .upd-muted.upd-small { display: block; }

  .upd-tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--shell); border-top: 1px solid var(--border); padding: 4px 0 calc(8px + env(safe-area-inset-bottom)); box-sizing: border-box; }

  /* needs attention: compact rows with a round status badge, the whole row opens the run */
  .upd-att-row { position: relative; grid-template-columns: 28px minmax(0, 1fr) 14px; gap: 10px; padding: 10px; min-height: 52px; box-sizing: border-box; }
  .upd-mname-btn { font: inherit; font-size: 14px; font-weight: 600; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
  .upd-mname-btn::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
  .upd-att-row:has(.upd-mname-btn:focus-visible) { outline: 2px solid var(--accent-link); outline-offset: 2px; }
  .upd-att-top { font-size: 14px; }
  .upd-att-why { font-size: 12px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .upd-att-sw { font-weight: 600; }
  .upd-att-go { color: var(--text-muted); }
  .upd-att-tk { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
  .upd-att-tk .upd-tk { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; }

  /* action sheet: opens from an attention row, sits above the tab bar (64 px + safe area) */
  .upd-scrim { position: fixed; top: 0; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 60; background: rgba(0, 0, 0, .55); }
  .upd-sheet { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 61; box-sizing: border-box; outline: none;
    max-height: calc(100vh - 64px - env(safe-area-inset-bottom) - 24px); max-height: calc(100dvh - 64px - env(safe-area-inset-bottom) - 24px); overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg-card); color: var(--text-body); border-top: 1px solid var(--border-strong); border-radius: 16px 16px 0 0; box-shadow: 0 -12px 32px rgba(0, 0, 0, .35);
    padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
  .upd-sheet-grab { position: sticky; top: 0; display: flex; justify-content: center; align-items: center; min-height: 28px; margin: 0 -16px; background: var(--bg-card); touch-action: none; cursor: grab; }
  .upd-sheet-grab span { width: 40px; height: 4px; border-radius: 9999px; background: var(--border-strong); }
  .upd-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
  .upd-sheet-head > div { min-width: 0; }
  .upd-sheet h2 { margin: 0; font-size: 17px; font-weight: 600; color: var(--text-heading); overflow-wrap: anywhere; }
  .upd-sheet-head .upd-small { margin-top: 2px; overflow-wrap: anywhere; }
  .upd-sheet-acts { display: flex; flex-direction: column; gap: 10px; }
  .upd-sheet-acts .upd-btn { width: 100%; min-height: 52px; font-size: 15px; border-radius: 10px; white-space: normal; text-align: center; }
  .upd-sheet-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .upd-sheet-two > :only-child { grid-column: 1 / -1; }
  .upd-sheet-two .upd-btn { min-height: 48px; font-size: 14px; border-radius: 10px; white-space: normal; text-align: center; }
  .upd-sheet-tk { color: var(--accent-link); font-family: var(--font-mono); }
  .upd-sheet-run { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; color: var(--accent-link); }
  .upd-sheet .upd-att-err { margin-top: 0; }
  /* restart + snooze dialogs at phone width: stacked full-width buttons */
  .upd-dlg { padding: 18px; overflow-y: auto; }
  .upd-dlg-btns { flex-direction: column; }
  .upd-dlg-btns .upd-btn { width: 100%; min-height: 52px; white-space: normal; }

  /* phone order: attention, running summary, clients, then up next */
  [data-upd-root] > .upd-two { display: contents; }
  [data-upd-root] > * { order: 0; }
  [data-upd-root] > #upd-att { order: 1; }
  [data-upd-root] #upd-running { order: 2; }
  [data-upd-root] > .upd-clients-sec { order: 3; }
  [data-upd-root] > #upd-filter { order: 4; }
  [data-upd-root] #upd-next { order: 5; }
  [data-upd-root] > .upd-card:not(#upd-att):not(#upd-filter), [data-upd-root] .upd-two > .upd-card:not(#upd-running):not(#upd-next) { order: 6; }
  [data-upd-root] > .upd-foot { order: 9; }
  /* running now: one summary card that opens the run */
  .upd-running-sec:not(.upd-norun) { background: none; border: 0; box-shadow: none; padding: 0; }
  .upd-running-sec:not(.upd-norun) > .upd-head { display: none; }
  .upd-runcard { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; gap: 6px; }
  .upd-runcard + .upd-runcard { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 8px; }
  .upd-rc-top { display: flex; justify-content: space-between; align-items: center; }
  .upd-rc-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--upd-run); }
  .upd-runtitle { font-size: 16px; min-height: 28px; }
  .upd-runtitle::after { content: ""; position: absolute; inset: 0; }
  .upd-rc-meta, .upd-rc-phases { display: none; }
  .upd-bar { margin-top: 6px; }
  .upd-legend { gap: 14px; align-items: center; }
  .upd-rc-open { margin-left: auto; color: var(--accent-link); font-weight: 600; }

  /* clients: one card each, dots + one line, the whole card opens that client's computers */
  .upd-tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .upd-tile { position: relative; padding: 14px; gap: 10px; }
  .upd-tname { font-size: 15px; min-height: 28px; }
  .upd-tname::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
  .upd-tile .upd-counts, .upd-tile .upd-kv { display: none; }
  .upd-tile-line { font-size: 12px; color: var(--text-muted); }
  .upd-tile-tk { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
  .upd-next-meta .upd-tk, .upd-frow .upd-mname { min-height: 44px; display: inline-flex; align-items: center; }
  .upd-next-meta .upd-tk { padding: 0 14px; }
  .upd-tile-tk .upd-tk { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; }

  /* up next + schedule (the week grid is desktop-only; Up next is the phone schedule) */
  .upd-page .upd-week-sec { display: none; }
  .upd-next { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 10px 0; min-height: 52px; box-sizing: border-box; }
  .upd-count-down { font-size: 14px; }
  .upd-link { font-size: 14px; }

  /* tables become cards */
  .upd-table.upd-mtable, .upd-table.upd-rtable { min-width: 0; display: block; }
  .upd-mtable thead, .upd-rtable thead { display: none; }
  .upd-mtable tbody, .upd-rtable tbody { display: flex; flex-direction: column; gap: 8px; }
  .upd-mtable td, .upd-rtable td { display: block; padding: 0; border: 0; }
  .upd-mtable th:first-child, .upd-mtable td:first-child { padding-left: 0; }
  .upd-bare-sec { background: none; border: 0; box-shadow: none; padding: 0; }
  .upd-mtable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 52px; box-sizing: border-box; }
  .upd-mtable td:nth-child(3), .upd-mtable td:nth-child(4), .upd-mtable td:nth-child(5) { grid-column: 1 / -1; }
  .upd-mtable td:nth-child(4), .upd-mtable td:nth-child(5) { font-size: 12px; color: var(--text-muted); }
  .upd-mtable td:nth-child(5):empty { display: none; }
  .upd-mtable td[colspan] { grid-column: 1 / -1; }
  .upd-rtable tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
  .upd-rtable td:nth-child(2) { order: 1; flex: 1 1 0; min-width: 0; }
  .upd-rtable td:nth-child(3) { order: 2; }
  .upd-rtable td:nth-child(1) { order: 3; flex: 1 1 100%; }
  .upd-rtable td:nth-child(1) a { min-height: 44px; display: inline-flex; align-items: center; }
  .upd-rtable td:nth-child(4), .upd-rtable td:nth-child(5) { display: none; }
  .upd-rtable td:nth-child(6) { order: 4; flex: 1 1 100%; font-size: 12px; }
  .upd-rtable td:nth-child(6):empty { display: none; }
  .upd-rtable td[colspan] { flex: 1 1 100%; }

  /* run view */
  .upd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .upd-st-tile { padding: 10px; border-radius: 10px; min-height: 52px; }
  .upd-stat { font-size: 20px; }
  .upd-phases { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .upd-ph { border-top: 1px solid var(--border-subtle); padding: 10px 0; flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; }
  .upd-ph:first-child { border-top: 0; }
  .upd-ph-done, .upd-ph-live { border-top-color: var(--border-subtle); }
  .upd-ph:first-child.upd-ph-done, .upd-ph:first-child.upd-ph-live { border-top-color: transparent; }
  .upd-ph .upd-small { text-align: right; font-family: var(--font-mono); font-size: 11px; }
  .upd-feed li { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
  .upd-st-tile.is-on { border-color: var(--accent-link); }
}
