/* Cooper&Wright -- the console skin: a tool's interface, not a document.
   Off-white ground, white panels, dark ink, one dark green for the top bar
   and the primary action. IBM Plex Sans for the interface and IBM Plex Mono
   only for data (ids, repositories, shas, times, figures). Status is always
   a shape, a colour and a word together, never colour alone. See DESIGN.md.
   Fonts are loaded via <link> in the application layout (CSP-friendly). */

/* ---- tokens: color ---- */
:root {
  --ink-1: #101a15;
  --ink-2: #1c2822;
  --ink-3: #44524b;
  --ink-4: #5f6e66;
  --paper-1: #f5f7f5;
  --paper-2: #ffffff;
  --paper-3: #eef3ef;
  --paper-4: #dfe6e1;
  --green-9: #0b1f17;
  --green-8: #123d2c;
  --green-7: #0f6b45;
  --green-6: #177a4b;
  --green-3: #8cc9a6;
  --green-1: #dff3e7;
  /* amber: work in progress and "worth a look" */
  --brass-7: #6f4800;
  --brass-6: #8a5a00;
  --brass-5: #b07a12;
  --brass-3: #e2c27a;
  --brass-1: #fbf0d4;
  --oxblood-8: #8f2413;
  --oxblood-7: #c0341d;
  --oxblood-6: #d2492f;
  --oxblood-1: #fde4df;
  --blue-7: #1d5fc4;
  --blue-1: #e3edfb;

  --surface-page: var(--paper-1);
  --surface-card: var(--paper-2);
  --surface-inset: var(--paper-3);
  --surface-inverse: #0f2b20;
  --surface-raised: #ffffff;
  --surface-selected: #dcefe3;
  --text-display: var(--ink-1);
  --text-body: var(--ink-2);
  --text-muted: var(--ink-3);
  --text-faint: var(--ink-4);
  --text-on-inverse: #f1f6f3;
  --text-on-inverse-muted: #c2d3ca;
  --text-accent: var(--ink-3);
  --text-link: var(--green-7);
  --action-primary: var(--green-8);
  --action-primary-hover: var(--green-9);
  --action-destructive: var(--oxblood-7);
  --action-destructive-hover: var(--oxblood-8);
  --focus-ring: var(--green-7);
  --rule-hairline: #c3cec7;
  --rule-faint: #dfe6e1;
  --rule-strong: #c3cec7;
  --rule-brass: #dfe6e1;
  --rule-on-inverse: #3a6551;

  --status-detected: var(--ink-3);
  --status-generating: var(--brass-6);
  --status-creating-pr: var(--brass-6);
  --status-pr-opened: var(--green-7);
  --status-resolved: var(--blue-7);
  --status-failed: var(--oxblood-7);
  --status-generating-bg: var(--brass-1);
  --status-pr-opened-bg: var(--green-1);
  --status-resolved-bg: var(--blue-1);
  --status-failed-bg: var(--oxblood-1);
  --status-detected-bg: var(--paper-3);

  /* status: green=good, amber=in progress, red=needs a person, ink=neutral */
  --status-good: var(--green-6);
  --status-good-bg: var(--green-1);
  --status-progress: var(--brass-6);
  --status-progress-bg: var(--brass-1);
  --status-bad: var(--oxblood-7);
  --status-bad-bg: var(--oxblood-1);
  --status-neutral: var(--ink-3);
  --status-neutral-bg: var(--paper-3);
  --status-done: var(--blue-7);
  --status-done-bg: var(--blue-1);

  /* type */
  --font-display: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --type-display-1: 28px;
  --type-display-2: 22px;
  --type-title: 18px;
  --type-heading: 15px;
  --type-body: 13px;
  --type-small: 12.5px;
  --type-caption: 12px;
  --type-label: 11.5px;
  --weight-display: 600;
  --weight-heading: 600;
  --weight-body: 400;
  --weight-medium: 500;
  --leading-display: 1.2;
  --leading-body: 1.45;
  --leading-tight: 1.3;
  --tracking-label: 0;
  --tracking-wide: 0;
  --tracking-display: -0.01em;

  /* spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 40px;
  --space-8: 56px;
  --space-9: 80px;
  /* the app runs the full window; only the public site keeps a measure */
  --page-max-width: none;
  --site-max-width: 1180px;
  --content-measure: 68ch;

  /* effects */
  --radius-panel: 6px;
  --radius-control: 5px;
  --border-hairline: 1px solid var(--rule-hairline);
  --border-faint: 1px solid var(--rule-faint);
  --border-strong: 1px solid var(--rule-strong);
  --border-double: 1px solid var(--rule-faint);
  --border-brass: 1px solid var(--rule-faint);
  --shadow-card: none;
  --shadow-raised: 0 4px 16px rgba(16, 26, 21, 0.12);
  --shadow-modal: 0 16px 48px rgba(16, 26, 21, 0.22);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur-med: 200ms;
  --dur-slow: 320ms;
}

/* ---- base ---- */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--leading-body);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}

a {
  color: var(--text-link);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--green-8);
  text-decoration: underline;
}

::selection {
  background: #bfe6cf;
  color: var(--ink-1);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  color: var(--text-display);
  margin: 0;
}

pre {
  font-family: var(--font-mono);
}

/* Emphasis in the interface is weight, never a slant. */
.cw-main em,
.cw-main i {
  font-style: normal;
}

/* ---- house classes ---- */
.cw-label {
  font-family: var(--font-body);
  font-size: var(--type-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  font-variant-numeric: lining-nums;
}

.cw-display {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  color: var(--text-display);
}

.cw-body {
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--leading-body);
  color: var(--text-body);
}

.cw-mono {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-variant-ligatures: none;
}

.cw-muted {
  color: var(--text-muted);
}

/* ---- wordmark ---- */
.cw-wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-display);
  text-decoration: none;
  line-height: 1;
}

.cw-wordmark .amp {
  color: var(--green-7);
}

.cw-wordmark--dark {
  color: var(--paper-2);
}

.cw-wordmark--dark .amp {
  color: #8fe3b8;
}

/* ---- app shell: top bar / frame (section nav + main) / footer ----
   The design system's page anatomy: a 52px top bar carrying only who and
   where (wordmark, organization, back office, person, sign out); a frame
   at the page measure holding the section nav (shared/_subnav, 196px,
   sticky) beside the page; one hairline footer line. */
.cw-appshell {
  /* 100vh first as the fallback, then the honest number: iOS Safari's vh is
     the viewport with the URL bar HIDDEN, so a shell sized in vh puts its
     last row behind the chrome and lurches as the bar comes and goes. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
}

.cw-header {
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}

.cw-header__inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Sized here rather than inline on the link so the phone rule below can
   take it down a step. */
.cw-header .cw-wordmark {
  font-size: 13px;
  flex-shrink: 0;
}

.cw-header__divider {
  width: 1px;
  height: 22px;
  background: rgba(251, 247, 236, 0.22);
  flex-shrink: 0;
}

.cw-header__org {
  color: var(--paper-2);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw-header__spacer {
  flex: 1;
}

/* The organization switcher (shared/_app_header), shown only to a person
   who can reach more than one organization. A native select dressed as the
   organization's name; the Switch button is there for a page without the
   bundle, which submits on change. */
.cw-header__switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cw-header__switch-select {
  background: transparent;
  color: var(--paper-2);
  border: 0;
  border-bottom: 1px solid rgba(200, 174, 114, 0.5);
  border-radius: 0;
  padding: 2px 4px 2px 0;
  max-width: 240px;
  font-family: var(--font-body);
  font-size: 13px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cw-header__switch-select option {
  color: var(--text-display);
  background: var(--surface-card);
}

.cw-header__switch-select:focus-visible {
  outline: 1px solid var(--text-on-inverse);
  outline-offset: 2px;
}

/* The bundle submits the select on change (lib/autosubmit.js), so the
   button is only for a page without it. */
.cw-autosubmit .cw-header__switch-go {
  display: none;
}

.cw-header__switch-go {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--text-on-inverse);
  font-family: var(--font-body);
}

/* A label the screen reader hears and nobody sees. */
.cw-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.cw-header__office {
  color: var(--text-on-inverse);
  text-decoration: none;
  padding-bottom: 1px;
  white-space: nowrap;
}

.cw-header__office:hover,
.cw-header__office.is-active {
  color: var(--text-on-inverse);
  border-bottom: 1px solid var(--text-on-inverse-muted);
}

/* Allowed to give way: on a narrow header a long GitHub login is the one
   thing here that can be shortened without losing a control. */
.cw-header__user {
  color: var(--green-3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw-header form {
  margin: 0;
  display: inline;
}

.cw-header__signout-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--paper-2);
  font-family: var(--font-body);
  font-size: var(--type-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
}

.cw-header__signout-btn:hover {
  color: #ffffff;
}

/* The page measure, and the section nav beside the page. */
.cw-frame {
  flex: 1;
  max-width: var(--page-max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
}

/* A banner the dashboard island cannot hold (it replaces its mount
   point's contents): at the page measure, above the frame. */
.cw-frame-banner {
  max-width: var(--page-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 20px var(--space-6) 0;
}

.cw-frame-banner .cw-flash {
  margin-bottom: 0;
}

.cw-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-4) var(--space-5) var(--space-7);
  border-left: var(--border-faint);
}

/* ---- section nav (SubNav) ---- */
.cw-subnav {
  width: 216px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 0;
  padding: var(--space-3) var(--space-2);
}

.cw-subnav__group + .cw-subnav__group {
  margin-top: 18px;
}

.cw-subnav__heading {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  padding: 0 10px 6px;
}

.cw-subnav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  min-height: 30px;
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
}

.cw-subnav__link:hover {
  background: var(--surface-inset);
  color: var(--text-display);
  text-decoration: none;
}

.cw-subnav__link.is-active {
  background: var(--surface-selected);
  color: var(--text-display);
  font-weight: var(--weight-medium);
}

.cw-subnav__label {
  flex: 1;
}

.cw-subnav__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.cw-subnav__link.is-active .cw-subnav__count {
  color: var(--text-body);
}

/* The readiness mark. It says "look in there" and nothing else; nothing
   renders when there is nothing to report -- a permanent green tick would
   train the eye past it. */
.cw-subnav__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
}

.cw-subnav__dot--blocked {
  background: var(--status-failed);
}

.cw-subnav__dot--warn {
  background: var(--brass-5);
}

.cw-footer {
  border-top: var(--border-faint);
  color: var(--text-muted);
}

.cw-footer__inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 12px var(--space-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px var(--space-5);
  font-size: 12px;
}

.cw-footer__inner .amp {
  color: var(--green-7);
  font-style: normal;
}

/* ---- page heads ----
   One per page: 34px for a landing page; a record page's (.cw-matter h1)
   is 28px. */
.cw-pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 14px;
}

/* A page's own controls, on the title line (a dashboard tab teleports
   its into #cw-page-actions). Empty, it takes no room. */
.cw-pagehead__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.cw-pagehead__actions:empty {
  display: none;
}

.cw-pagehead__note {
  flex: 0 0 100%;
}

.cw-pagehead h1 {
  font-size: var(--type-title);
  line-height: 1.25;
  margin: 0;
}

.cw-pagehead__note {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---- buttons ---- */
.cw-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  padding: 6px 12px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
  line-height: 1;
}

.cw-btn:active {
  transform: translateY(1px);
}

/* A button that cannot be pressed has to look it. */
.cw-btn:disabled,
.cw-btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}

.cw-btn:disabled:active,
.cw-btn[aria-disabled='true']:active {
  transform: none;
}

.cw-btn--lg {
  padding: 10px 18px;
  min-height: 44px;
  font-size: 13px;
}

.cw-btn--sm {
  padding: 4px 10px;
  min-height: 26px;
  font-size: 12px;
}

.cw-btn--block {
  width: 100%;
}

.cw-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.cw-actions__form {
  margin: 0;
}

.cw-btn--primary {
  background: var(--action-primary);
  color: var(--text-on-inverse);
  border-color: var(--action-primary);
}

.cw-btn--primary:hover {
  background: var(--action-primary-hover);
  color: var(--text-on-inverse);
}

.cw-btn--secondary {
  border: 1px solid var(--rule-strong);
  background: var(--surface-inset);
  color: var(--text-display);
}

.cw-btn--secondary:hover {
  border-color: var(--ink-4);
  color: var(--text-display);
  text-decoration: none;
}

/* A button that leaves the page rather than acting on it: set in the body
   face, not the letterpress caps, label left and a brass arrow right, on a
   hairline instead of an ink rule -- so "View pull request" never reads as
   one more thing Cooper will do. */
.cw-btn--out {
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: var(--weight-body);
  text-decoration: none;
  color: var(--text-link);
  padding: 6px 12px;
  background: transparent;
  border: var(--border-hairline);
}

.cw-btn--out:hover {
  color: var(--green-9);
  background: var(--surface-inset);
  border-color: var(--rule-strong);
}

.cw-btn__arrow {
  color: var(--text-faint);
}

/* The record pages' Actions card (RecordActions.vue): the actions, then
   the links out, past a rule when there are both. */
.cw-record-actions__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cw-record-actions__links.is-ruled {
  margin-top: 14px;
  padding-top: 12px;
  border-top: var(--border-faint);
}

.cw-record-actions__over {
  font-size: 11px;
  color: var(--text-muted);
}

.cw-btn--ghost {
  color: var(--text-link);
}

.cw-btn--ghost:hover {
  color: var(--green-9);
}

.cw-btn--destructive {
  background: var(--action-destructive);
  color: var(--text-on-inverse);
  border-color: var(--action-destructive);
}

.cw-btn--destructive:hover {
  background: var(--action-destructive-hover);
  color: var(--text-on-inverse);
}

/* ---- cards ---- */
.cw-card {
  background: var(--surface-card);
  border: var(--border-hairline);
  border-color: var(--rule-faint);
  border-radius: var(--radius-panel);
  /* Dense by default: 12 / 20 / 14. */
  padding: 12px 20px 14px;
}

.cw-card__over {
  color: var(--text-accent);
  display: block;
}

.cw-card__head {
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.cw-card__head--brass {
  border-bottom: var(--border-brass);
}

/* A label used as a panel's heading reads as one. */
.cw-card__head .cw-label {
  font-size: 13px;
  font-weight: var(--weight-heading);
  color: var(--text-display);
}

.cw-card__note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 14px 0 0;
}

/* The README badge snippet on the mapping page: a markdown image link whose
   longest token is wider than a phone and has nothing to break on. Left to
   the default wrapping it sets the column's min-content width, which drags
   the settings card -- and the page -- past the viewport. */
.cw-card__note[data-badge='markdown'] {
  overflow-wrap: anywhere;
}

/* The Headroom snapshot never expires, so an old one still shows its
   figures. This is the only thing on the panel saying they are old --
   it has to read as a warning, not as another muted footnote. */
.cw-headroom-age.is-stale {
  font-style: normal;
  color: var(--status-bad);
  background: var(--status-bad-bg);
  border: 1px solid var(--oxblood-6);
  border-radius: var(--radius-control);
  padding: 6px 10px;
}

/* ---- status marks ----
   A status is a shape, a colour and a word, so it never rests on colour
   alone: a disc is good, a ring is work in progress, a triangle needs a
   person, a diamond is finished, a hollow disc is at rest. No pill. */
.cw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--weight-medium);
  line-height: 1.5;
  white-space: nowrap;
  color: var(--status-neutral);
}

.cw-badge::before {
  content: '';
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}

.cw-badge--generating::before,
.cw-badge--creating_pr::before,
.cw-badge--fixing_ci::before,
.cw-badge--trialing::before,
.cw-badge--open::before,
.cw-badge--incomplete::before,
.cw-badge--needs_response::before,
.cw-badge--under_review::before,
.cw-badge--pending::before,
.cw-badge--running::before {
  background: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
}

.cw-badge--failed::before,
.cw-badge--needs_attention::before,
.cw-badge--billing_blocked::before,
.cw-badge--past_due::before,
.cw-badge--unpaid::before,
.cw-badge--uncollectible::before,
.cw-badge--lost::before,
.cw-badge--errored::before {
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.cw-badge--merged::before,
.cw-badge--auto_merged::before,
.cw-badge--resolved::before {
  border-radius: 0;
  transform: rotate(45deg) scale(0.8);
}

.cw-badge--detected::before,
.cw-badge--watching::before,
.cw-badge--closed::before,
.cw-badge--skipped::before,
.cw-badge--canceled::before,
.cw-badge--void::before,
.cw-badge--draft::before,
.cw-badge--paused::before,
.cw-badge--incomplete_expired::before,
.cw-badge--refused::before,
.cw-badge--filed_issue::before {
  background: none;
  border: 1.5px solid currentColor;
}

/* A status that is not one of the named states: say the tone. The shape
   follows it, so the mark still never rests on colour alone. */
.cw-badge--tone-good {
  color: var(--status-good);
}

.cw-badge--tone-progress {
  color: var(--status-progress);
}

.cw-badge--tone-progress::before {
  background: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
}

.cw-badge--tone-bad {
  color: var(--status-bad);
}

.cw-badge--tone-bad::before {
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.cw-badge--tone-done {
  color: var(--status-done);
}

.cw-badge--tone-done::before {
  border-radius: 0;
  transform: rotate(45deg) scale(0.8);
}

.cw-badge--tone-neutral {
  color: var(--status-neutral);
}

.cw-badge--tone-neutral::before {
  background: none;
  border: 1.5px solid currentColor;
}

.cw-badge--detected {
  color: var(--status-detected);
}

.cw-badge--generating {
  color: var(--status-generating);
}

.cw-badge--creating_pr {
  color: var(--status-creating-pr);
}

.cw-badge--pr_opened {
  color: var(--status-pr-opened);
}

.cw-badge--resolved {
  color: var(--status-resolved);
}

.cw-badge--failed {
  color: var(--status-failed);
}

/* a pull request that landed -- merged by a human, or by Cooper itself */
.cw-badge--merged,
.cw-badge--auto_merged {
  color: var(--status-done);
}

.cw-badge--fixing_ci {
  color: var(--status-generating);
}

/* incident: flagged for a human to step in -- warm attention, not an error */
.cw-badge--needs_attention {
  color: var(--status-bad);
}

/* incident: gated on billing */
.cw-badge--billing_blocked {
  color: var(--status-bad);
}

/* billing states -- subscription / invoice / refund / dispute */
.cw-badge--active,
.cw-badge--paid,
.cw-badge--succeeded,
.cw-badge--won {
  color: var(--status-good);
}

.cw-badge--trialing,
.cw-badge--open,
.cw-badge--incomplete,
.cw-badge--needs_response,
.cw-badge--under_review,
.cw-badge--pending {
  color: var(--status-progress);
}

.cw-badge--past_due,
.cw-badge--unpaid,
.cw-badge--uncollectible,
.cw-badge--lost {
  color: var(--status-bad);
}

.cw-badge--closed,
.cw-badge--skipped,
.cw-badge--canceled,
.cw-badge--void,
.cw-badge--draft,
.cw-badge--paused,
.cw-badge--incomplete_expired {
  color: var(--text-faint);
}

/* self-improve run outcomes (admin panel) */
.cw-badge--running {
  color: var(--status-generating);
}

.cw-badge--filed_issue {
  color: var(--status-detected);
}

.cw-badge--opened_pr {
  color: var(--status-good);
}

/* Cooper declining is normal operation, not a failure -- same neutral
   treatment as a closed/canceled row. */
.cw-badge--refused {
  color: var(--status-neutral);
}

.cw-badge--errored {
  color: var(--status-bad);
}

/* ---- status filter chips (dashboard) ---- */
.cw-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.cw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  line-height: 1.5;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 12px;
  min-height: 26px;
  color: var(--text-muted);
  background: var(--surface-card);
  border: var(--border-hairline);
  border-radius: var(--radius-control);
  text-decoration: none;
  cursor: pointer;
  transition:
    color 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.cw-chip:hover {
  color: var(--text-display);
  border-color: var(--rule-strong);
}

/* The chip text is a real control (click => filter to this status only), so it
   must shed all default <button> chrome and inherit the chip's typography. */

/* Active = selected: the inverse surface, the one fill a chip ever takes. */
.cw-chip.is-active {
  color: var(--text-display);
  font-weight: var(--weight-medium);
  background: var(--surface-selected);
  border-color: var(--green-3);
}

.cw-chip__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.cw-chip.is-active .cw-chip__count {
  color: var(--text-muted);
}

/* ---- tags ---- */
.cw-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: var(--border-hairline);
  border-radius: 3px;
  /* A pill that breaks over two lines stops reading as a pill -- except
     under a page title, where the pill IS the branch name and the whole of
     it has to be on the page (see .cw-matter__tags below). */
  white-space: nowrap;
}

/* ---- panel head ----
   A panel's one line: its heading, a count in mono, and its controls on
   the right. */
.cw-panelhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.cw-panelhead__title {
  margin: 0;
  font-size: 13px;
  font-weight: var(--weight-heading);
  color: var(--text-display);
}

.cw-panelhead__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.cw-panelhead__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.cw-table tfoot td {
  font-weight: var(--weight-heading);
  border-top: var(--border-hairline);
  border-bottom: 0;
}

/* ---- attempt budget ----
   A CI fix gets three attempts. Three numbered boxes say how many are spent
   and how each ended; the wrapper carries the same in an aria-label. */
.cw-attempts {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.cw-attempts__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: var(--border-hairline);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--weight-medium);
  color: var(--text-faint);
}

.cw-attempts__box.is-failed {
  background: var(--status-bad-bg);
  border-color: #e19a8d;
  color: var(--oxblood-8);
}

.cw-attempts__box.is-passed {
  background: var(--status-good-bg);
  border-color: var(--green-3);
  color: var(--green-8);
}

.cw-attempts__box.is-running {
  border-color: var(--status-progress);
  color: var(--status-progress);
}

/* ---- log ----
   What happened, newest first or oldest first as the page says: a time,
   then one line whose verb carries the status colour. */
.cw-log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.cw-log__line {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  border-bottom: var(--border-faint);
}

.cw-log__line:last-child {
  border-bottom: 0;
}

.cw-log__time {
  flex: none;
  min-width: 44px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.cw-log__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cw-log .is-good {
  color: var(--status-good);
}

.cw-log .is-progress {
  color: var(--status-progress);
}

.cw-log .is-bad {
  color: var(--status-bad);
}

.cw-log .is-done {
  color: var(--status-done);
}

/* ---- tables (docket) ---- */
/* A card holding a list: the table bleeds to the card's edges (the design
   system's flush Card), its first and last cells keeping the card's 20px. */
.cw-card--flush .cw-table-scroll {
  /* Holds a visually hidden label inside a th within the scroll box. */
  position: relative;
  margin: 0 -20px;
}

.cw-card--flush .cw-table th:first-child,
.cw-card--flush .cw-table td:first-child {
  padding-left: 20px;
}

.cw-card--flush .cw-table th:last-child,
.cw-card--flush .cw-table td:last-child {
  padding-right: 20px;
}
.cw-table {
  width: 100%;
  border-collapse: collapse;
}

.cw-table thead th {
  text-align: left;
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: var(--type-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  color: var(--text-faint);
  border-bottom: var(--border-faint);
  white-space: nowrap;
}

.cw-table thead th.is-right,
.cw-table td.is-right {
  text-align: right;
}

.cw-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule-faint);
  vertical-align: top;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 12.5px;
  color: var(--text-body);
}

.cw-table tbody tr.is-clickable {
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.cw-table tbody tr.is-clickable:hover {
  background: var(--surface-inset);
}

.cw-table a {
  text-decoration: none;
}

.cw-table tbody tr:last-child td {
  border-bottom: 0;
}

.cw-table td .cw-mono {
  font-size: 12px;
}

/* A column that takes exactly its content's width and never breaks it (a
   tag, a repo slug, a relative time), leaving the flexible columns -- the
   title -- to absorb the rest of the table. `width: 1%` reads as "as narrow
   as possible": auto table layout raises it to the cell's min-content, which
   nowrap makes its full single line. Only works while the table is
   `table-layout: auto` (the default) -- under `fixed` the 1% would be taken
   literally and the content would spill out of the cell instead. */
.cw-table th.is-tight,
.cw-table td.is-tight {
  width: 1%;
  white-space: nowrap;
}

/* The column that absorbs whatever the is-tight ones leave. It has to be
   allowed to break below its longest word: auto layout sizes a table to the
   SUM of its columns' min-content widths, so one unbreakable token in here
   -- a Flutter exception carrying a 90-character method channel, say --
   pushes that sum past the card and the last column lands outside the
   border. Breaking anywhere caps this column's min-content at one
   character, and the leftover width still comes to it because it has by far
   the largest max-content of the row. */
.cw-table th.is-elastic,
.cw-table td.is-elastic {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ...and, where the leftover width should go to that column rather than be
   shared out, 100% against the others' 1%. Auto layout hands the slack to
   the widest max-content otherwise, which left the title on ~180px while
   Repository sat on 45px of dead space beside its longest value. Pairs with
   is-elastic on the same cell; a table wanting its columns to share the
   slack (the by-repository one) simply does not use it. */
.cw-table th.is-remainder,
.cw-table td.is-remainder {
  width: 100%;
}

/* A table that would rather scroll than spill. Auto layout can shrink a
   table only to the sum of its columns' min-content widths; past that it
   overflows its card, straight across the right border. Wrapping the table
   gives that overflow a scrollbar instead. */
.cw-table-scroll {
  overflow-x: auto;
}

/* A column of prose (a CI-fix reason, an incident title) inside a scrolling
   table. Auto layout would hand it its min-content width -- one word -- and
   wrap the reason into a column of thirty short lines; the floor keeps it
   readable and lets the wrapper scroll for the rest. */
.cw-table th.is-prose,
.cw-table td.is-prose {
  min-width: 24ch;
}

/* ---- the same table on a phone: one docket per row ----
   Below this width a six-column table can only scroll, and scrolling hides
   the very cell the row exists for (its title, its status). So a table
   marked --stack turns each row into a short docket: every cell on its own
   line, labelled by its `data-label` in the same small caps the column head
   used, and the `.is-remainder` cell -- the column that was already the
   row's point on the wide layout -- first and unlabelled, as the headline.
   The label sits in the cell's left padding rather than as a first child, so
   a cell with several inline children (a link, its glyph, a note beneath)
   keeps flowing exactly as it did in the wide table. The head is dropped:
   its text is now on every cell. Tables that are numbers all the way across
   (the by-repository one, the admin ledgers) stay tables and scroll in a
   `.cw-table-scroll` instead.

   Every selector here doubles up as `.cw-table.cw-table--stack`: the wide
   layout's column rules (`.cw-table td.is-right`, `.cw-table td.is-tight`
   with its 1% width and nowrap, the tablet cell padding) are two classes
   deep, and a docket has to out-rank them, not just come later. */
@media (max-width: 560px) {
  .cw-table.cw-table--stack,
  .cw-table.cw-table--stack tbody,
  .cw-table.cw-table--stack tbody td {
    display: block;
    width: auto;
  }

  .cw-table.cw-table--stack thead {
    display: none;
  }

  /* A flex column, for `order`: the headline cell comes first whichever
     column it was. */
  .cw-table.cw-table--stack tbody tr {
    display: flex;
    flex-direction: column;
    padding: 12px 0 14px;
    border-bottom: 1px solid var(--rule-hairline);
  }

  .cw-table.cw-table--stack tbody td {
    position: relative;
    min-height: 1.6em;
    padding: 3px 0 3px 7.5em;
    border-bottom: none;
    text-align: left;
    white-space: normal;
  }

  /* Inside a flush card the wide table bleeds to the card's edge; a
     stacked one sits inside it, every label in its own gutter. */
  .cw-card--flush .cw-table-scroll:has(> .cw-table--stack) {
    margin: 0;
  }

  .cw-card--flush .cw-table.cw-table--stack tbody td:first-child {
    padding-left: 7.5em;
  }

  .cw-card--flush .cw-table.cw-table--stack tbody td.is-remainder {
    padding-left: 0;
  }

  .cw-card--flush .cw-table.cw-table--stack tbody td:last-child {
    padding-right: 0;
  }

  .cw-table.cw-table--stack td[data-label]::before {
    content: attr(data-label);
    position: absolute;
    top: 5px;
    left: 0;
    width: 7em;
    font-family: var(--font-body);
    font-size: var(--type-label);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-label);
    color: var(--text-muted);
  }

  .cw-table.cw-table--stack tbody td.is-remainder {
    order: -1;
    padding-left: 0;
    padding-bottom: 6px;
    font-size: var(--type-body);
  }

  /* The wide layout's caps and right-hand alignment no longer apply: a note
     hangs under its badge on the left, a branch name has the whole line,
     and the rule column's floor (there for a table that could still scroll
     sideways) would push this docket past the phone. */
  .cw-table.cw-table--stack .cw-row-note,
  .cw-table.cw-table--stack .cw-row-sub {
    margin-left: 0;
    max-width: none;
  }

  .cw-table.cw-table--stack .cw-branch {
    max-width: 100%;
  }

  /* A docket row has the whole line: a cut cell wraps instead, and a
     fixed table's widths no longer apply. */

  .cw-table.cw-table--stack .cw-cell-line {
    white-space: normal;
  }
}

.cw-table__caption {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ---- forms ---- */
.cw-field {
  display: grid;
  gap: 6px;
}

.cw-field > label {
  color: var(--text-muted);
}

.cw-input,
.cw-select {
  font-family: var(--font-body);
  font-size: var(--type-small);
  color: var(--text-display);
  background: var(--surface-raised);
  border: var(--border-hairline);
  border-radius: var(--radius-control);
  padding: 5px 10px;
  min-height: 30px;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.cw-input--mono,
.cw-select--mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* In a table's tight column (the members page's role picker) 100% of a 1%
   cell is just the arrow: size to the longest option instead. */
.cw-table td.is-tight .cw-select {
  width: auto;
}

.cw-input:focus,
.cw-select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--green-7);
}

.cw-input::placeholder {
  color: var(--text-faint);
}

/* switch (retainer) */

.cw-switch__track {
  width: 40px;
  height: 20px;
  background: var(--paper-4);
  border: 1px solid var(--rule-hairline);
  border-radius: 10px;
  position: relative;
  transition: background var(--dur-med) var(--ease-out);
}

.cw-switch__track::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--rule-hairline);
  border-radius: 50%;
  transition: transform var(--dur-med) var(--ease-out);
}

/* ---- flashes ---- */
.cw-flash {
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-size: var(--type-small);
}

.cw-flash--notice {
  color: var(--green-7);
  background: var(--status-pr-opened-bg);
  border-color: var(--green-3);
}

.cw-flash--alert {
  color: var(--oxblood-7);
  background: var(--status-failed-bg);
  border-color: var(--oxblood-6);
}

/* ---- launch banner ---- */

.cw-ph-banner {
  background: var(--surface-inverse);
  border-bottom: 1px solid var(--green-7);
}

.cw-ph-banner__inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.cw-ph-banner .cw-label {
  color: var(--text-on-inverse);
}

.cw-ph-banner img {
  display: block;
  width: 135px;
  height: auto;
}

/* ---- empty states ---- */
.cw-empty {
  padding: 22px 10px;
  border: var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-muted);
  text-align: center;
}

/* Never a card inside a card (the design system's rule): a panel composed
   inside another -- the Activity tab's panels inside the admin's pulse --
   keeps its ruled head and drops its box. */
.cw-card .cw-card {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* Body copy in a card is the working document's size, not the
   marketing page's. */
.cw-card .cw-body {
  font-size: 12.5px;
  line-height: 1.5;
}

/* An empty state's prose is italic; a button in it is not. */
.cw-empty .cw-btn {
  font-style: normal;
}

/* Inside a card it is the table's empty row, not a second box. */
.cw-card .cw-empty {
  border: 0;
  background: none;
}

/* ---- sign in ---- */
/* One centred panel: the wordmark, one line, the GitHub button. The body is
   the full-height column, so the launch banner above takes its own height
   out of the panel's room instead of pushing the page past one screen. */
body:has(.cw-signin) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.cw-signin {
  flex: 1;
  background: var(--surface-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.cw-signin__card {
  background: var(--surface-card);
  border: 1px solid var(--rule-faint);
  border-radius: var(--radius-panel);
  padding: 24px;
  width: 340px;
  max-width: 100%;
  display: grid;
  gap: 16px;
  text-align: center;
}

.cw-signin__wordmark {
  font-size: 20px;
}

.cw-signin__title {
  font-size: var(--type-body);
  font-weight: var(--weight-body);
  color: var(--text-muted);
  margin: 0;
}

.cw-signin .cw-flash {
  margin: 0;
  text-align: left;
}

.cw-signin form {
  margin: 0;
}

/* ---- incident detail ---- */
.cw-back {
  display: inline-block;
  font-size: 12.5px;
  white-space: nowrap;
}

.cw-matter__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 10px 0 4px;
}

.cw-matter__over {
  color: var(--text-accent);
}

/* The title is the customer's own exception message, and a compare URL or a
   90-character method channel in it has no space to break at: without this
   it runs off the right of the page at every width, 1440px included. */
.cw-matter h1 {
  font-size: var(--type-title);
  line-height: 1.15;
  margin: 0;
  max-width: 56ch;
  overflow-wrap: anywhere;
}

.cw-matter__tags {
  display: flex;
  gap: 6px;
  margin: 8px 0 0;
  flex-wrap: wrap;
}

/* The one place a tag may wrap: these are the branch names, shown whole. */
.cw-matter__tags .cw-tag {
  white-space: normal;
  overflow-wrap: anywhere;
}

.cw-matter__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  margin-top: 20px;
}

.cw-matter__col {
  display: grid;
  gap: 16px;
  /* Without this, a column with an unbreakable long string (a stack trace
     line, a commit-compare URL in an incident title) forces its track past
     its share and squeezes the other column down to its own
     min-content width. */
  min-width: 0;
}

/* pre-wrap keeps the trace's own line breaks and indentation; anywhere lets
   a gem path -- the longest token on the page, with no space in it -- break
   inside a phone's width instead of widening the card past it. */
/* The incident page's executive summary: four headed paragraphs, then a
   row of buttons rather than .cw-actions' stacked column. */
.cw-summary__heading {
  margin: 14px 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-display);
}

.cw-summary__heading:first-child {
  margin-top: 0;
}

.cw-summary p {
  margin: 0 0 8px;
  font-size: 13px;
}

.cw-trace {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-body);
}

.cw-diff {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
}

.cw-diff__line {
  padding: 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cw-diff__line--add {
  color: var(--status-pr-opened);
  background: var(--status-pr-opened-bg);
}

.cw-diff__line--del {
  color: var(--status-failed);
  background: var(--status-failed-bg);
}

.cw-diff__line--ctx {
  color: var(--text-muted);
}

/* A fixed width, so every label starts 28px in whatever the glyph -- the
   same indent as the note under it. */

/* A step still going -- the checks on the PR's head have not reported --
   is drawn as in progress: a brass ring turning where a finished step's
   ✓ would be, and its label as loud as a finished one's, since it is the
   step being waited on. Under reduced motion the ring holds still and a
   slow pulse says the same thing. */

@keyframes cw-timeline-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cw-timeline-pulse {
  50% {
    opacity: 0.35;
  }
}

/* The label is what wraps in a narrow column, never the time: a timestamp
   that shared the squeeze broke over two or three lines at its own width
   each, and the column of times down the card went ragged. */

/* Who took a step, for a person's own: quieter than the label it follows,
   since the label is what happened and this is only who asked. */

.cw-incident__glyph {
  margin-right: 6px;
}

/* A long trace scrolls inside its panel, so the fix, the checks and the
   timeline stay within reach under it. */
.cw-incident .cw-trace {
  max-height: 420px;
  overflow-y: auto;
}

/* A step's note (which files, which checks, why Cooper stopped) gets its own
   row: a `reason` is a whole sentence of Claude's and would push the
   timestamp off the step's line. It belongs to the step above it, so the step
   hands its rule down to the note and the pair reads as one entry -- a
   browser without :has() just shows one extra hairline between them.
   Indented past the mark so it aligns under the label, and free to wrap
   anywhere, since a long path has no spaces to break on. */
/* A card's own timeline (the PR and incident pages' side column) is about
   250px wide at a laptop's width, and a label there is a check name: beside
   a timestamp it broke over four or five lines. Under 420px of card the
   time takes its own line beneath the label instead, and the label gets the
   card. A container query, not a media one, because it is the column that
   is narrow, not the window. */

/* The console's incident list (IncidentsTab.vue, DispositionTable.vue)
   and incident page (IncidentPage.vue). */
.cw-incidents {
  display: grid;
  gap: 14px;
}

.cw-incidents > * {
  min-width: 0;
}

/* Room for the whole placeholder, which names three things to search. */
.cw-incidents .cw-filterbar__search {
  flex-basis: 320px;
}

/* The customer's own exception message under the id: given the width and
   wrapped, never cut. */
/* Two lines each for the error and the last step; the whole text is the
   `title`. An exception carrying a URL, or the model's paragraph on why it
   stopped, unclamped made one row a screen. */
.cw-incidents__title,
.cw-incidents__step {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.cw-incidents__title {
  color: var(--text-display);
}

/* Enough of the row for the step to say something in its two lines. */
@media (min-width: 561px) {
  .cw-incidents .cw-table td[data-cell='last_step'] {
    width: 28%;
    min-width: 220px;
  }
}

/* A cell with nothing in it (no PR, nobody, a zero count) says so, dimmed. */
.cw-incidents__none {
  color: var(--text-faint);
}

.cw-incident__crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.cw-incident__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 4px 0 14px;
}

/* The title has the line; its status and tags sit under it. */
.cw-incident__head h1 {
  flex: 1 1 100%;
  max-width: none;
}

/* The branch name, whole, as under the old title. */
.cw-incident__head .cw-tag {
  white-space: normal;
  overflow-wrap: anywhere;
}

.cw-incident .cw-matter__grid {
  margin-top: 0;
  gap: 14px;
}

.cw-incident .cw-matter__col {
  gap: 14px;
}

.cw-incident__reason {
  margin: 0;
}

.cw-incident__reason + .cw-incident__reason {
  margin-top: 6px;
}

/* A timestamp is a date and a time: one width, so the lines start level. */
.cw-incident__time {
  min-width: 17ch;
}

/* Under the title: where it is, in one quiet line. */
.cw-incident__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: -8px 0 16px;
  font-size: var(--type-small);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* The page's lead: where it stands, in a sentence, before any evidence. */
.cw-incident__status {
  display: grid;
  gap: 6px;
  border-left: 3px solid var(--text-link);
}

.cw-incident__status.is-bad {
  border-left-color: var(--status-bad);
}

.cw-incident__status p {
  margin: 0;
}

.cw-incident__lead {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--text-display);
}

.cw-incident__status .is-bad {
  color: var(--status-bad);
}

.cw-incident__attempts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--type-small);
}

/* A card's heading, with a quiet aside after it (the branch, a count). */
.cw-incident__section {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.cw-incident__aside {
  margin-left: 8px;
  font-size: var(--type-small);
  font-weight: normal;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.cw-incident__more-link {
  margin-top: 8px;
}

.cw-incident__consulted {
  margin-top: 12px;
  font-size: var(--type-small);
}

.cw-incident__consulted summary {
  color: var(--text-link);
  cursor: pointer;
}

.cw-incident__menu > summary {
  list-style: none;
  cursor: pointer;
}

.cw-incident__menu > summary::-webkit-details-marker {
  display: none;
}

.cw-incident__menu[open] > summary {
  margin-bottom: 8px;
}

.cw-incident__assign {
  display: grid;
  gap: 6px;
}

.cw-incident__glyph {
  margin-right: 6px;
}

/* A long trace scrolls inside its panel, so the fix, the checks and the
   timeline stay within reach under it. */
.cw-incident .cw-trace {
  max-height: 420px;
  overflow-y: auto;
}

/* A step's note (which files, which checks, why Cooper stopped) on its own
   line under the step. */
.cw-incident__note {
  display: block;
}

/* The side column is 320px: a narrower label leaves a date its one line. */
.cw-incident .cw-facts__row {
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
}

/* ---- dashboard: retainer switch + inline forms + retain form ---- */

.cw-switch-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.cw-switch-btn .cw-switch__track {
  width: 40px;
  height: 20px;
  background: var(--paper-4);
  border: 1px solid var(--rule-hairline);
  position: relative;
  transition: background var(--dur-med) var(--ease-out);
}

.cw-switch-btn .cw-switch__track::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--rule-hairline);
  transition: transform var(--dur-med) var(--ease-out);
}

.cw-switch-btn.is-on .cw-switch__track {
  background: var(--green-6);
  border-color: var(--green-7);
}

.cw-switch-btn.is-on .cw-switch__track::after {
  transform: translateX(20px);
  border-color: var(--green-7);
}

.cw-switch-btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.cw-link-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-color: var(--rule-brass);
  text-underline-offset: 3px;
  text-align: left;
}

.cw-link-btn:hover {
  color: var(--green-9);
}

.cw-check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.cw-check-row .cw-label {
  white-space: nowrap;
}

.cw-check {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green-9);
}

.cw-field__hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ---- settings (the repository page's "What Cooper does here") ----
   One group per thing Cooper does. A setting is its name, a sentence or two
   saying what it changes, and its control on the right; a setting that
   depends on the group's switch is indented under it. The help is in the
   open, never a tooltip. */
.cw-settings {
  display: grid;
}

.cw-settings__group {
  padding: 6px 0;
  border-top: 1px solid var(--rule-faint);
}

.cw-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 24px;
  padding: 12px 0;
}

.cw-setting--master {
  padding-top: 4px;
}

.cw-setting--sub {
  padding: 10px 0 10px 20px;
}

.cw-setting__text {
  display: grid;
  gap: 3px;
  max-width: 68ch;
}

.cw-setting__label {
  margin: 0;
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  color: var(--text-display);
}

h3.cw-setting__label,
.cw-setting--master .cw-setting__label {
  font-weight: var(--weight-heading);
}

.cw-setting__help,
.cw-field__help,
.cw-panelhead__lede {
  font-size: var(--type-small);
  line-height: 1.5;
  color: var(--text-muted);
}

.cw-panelhead__lede {
  max-width: 72ch;
  margin: 0 0 12px;
}

.cw-card--flush > .cw-panelhead__lede {
  margin-bottom: 4px;
}

.cw-setting__control {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.cw-setting__control .cw-select {
  width: auto;
  min-width: 190px;
}

/* At most this many lines of a title in a list; the whole is its `title`. */
.cw-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  /* A select does not fit beside its sentence on a phone: it goes under. */
  .cw-setting:has(.cw-select) {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw-setting__control .cw-select {
    width: 100%;
  }
}

/* ==========================================================================
   activity tab — the window line, the figure strip, the chart panel, three
   tables side by side and the list. Reads top to bottom as how much / how
   well / what, panels 14px apart. The admin overview's pulse reuses the
   chart, the stat strip, the funnel and the proportion bar from here.
   ========================================================================== */

.cw-activity {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

/* The line under the page title: what the figures are compared with. */
.cw-activity__note {
  margin: 0;
  font-size: var(--type-small);
  color: var(--text-muted);
}

/* A band inside one panel (the admin pulse's chart, under its strip). */

/* Inside a panel a heading follows a figure rather than opening a band, so
   it needs air above it ("Checks", under the success ratio). */

/* A run of small counts under a table or a figure ("3 lessons learned · 2
   self-checks failed"). */
.cw-activity__figures {
  margin: 10px 0 0;
  font-size: var(--type-caption);
}

/* Two panels in a row (the admin pulse). */

/* Three tables in a row. The repository one is the widest: a slug and five
   counts against a label and two. All three take the row's height (the
   default `stretch`), so the row reads as one band. */
.cw-activity__tables {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 14px;
}

/* A slug stays whole up to this width and breaks past it (GitHub allows
   140 characters with no space), and the panel scrolls for the counts. On
   the span, since a table cell's own widths are the browser's to ignore. */
.cw-activity__repo .cw-mono {
  display: inline-block;
  width: max-content;
  max-width: 19ch;
}

/* Why a row was closed, on its own line under the detail: one line, the
   whole of it in the `title`. A block with a fixed cap, because the column
   takes its content's width and an uncapped reason would take the item's. */
.cw-activity__reason {
  display: block;
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .cw-activity__reason {
    max-width: 18ch;
  }
}

/* ---- figure strip: one bordered row of label, figure and delta ----
   The cells are white on a gap the colour of the rule, so the dividers are
   right however many columns the row has wrapped to. */
.cw-figures {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  background: var(--rule-faint);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}

.cw-figures__cell {
  min-width: 0;
  padding: 9px 14px 10px;
  background: var(--surface-card);
}

.cw-figures__label {
  font-size: var(--type-label);
  color: var(--text-faint);
}

.cw-figures__figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 2px 0 0;
}

.cw-figures__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: var(--weight-medium);
  line-height: 1.3;
  color: var(--text-display);
  font-variant-numeric: tabular-nums lining-nums;
}

@media (max-width: 1100px) {
  .cw-figures {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cw-activity__tables {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .cw-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- stat strip: label, figure, delta (admin pulse, overview week) ---- */
.cw-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0;
  border-top: var(--border-faint);
  border-bottom: var(--border-faint);
}

/* Inside a panel the panel's own head is the rule. */
.cw-card .cw-stats {
  border-top: none;
  border-bottom: none;
}

.cw-stat {
  padding: 4px 20px;
  border-right: 1px solid var(--rule-faint);
  min-width: 0;
}

.cw-card .cw-stat:first-child {
  padding-left: 0;
}

.cw-stat > .cw-label:first-child {
  color: var(--text-faint);
  font-size: var(--type-label);
  line-height: 1.3;
}

.cw-stat:last-child {
  border-right: none;
}

.cw-stat__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: var(--weight-medium);
  line-height: 1.3;
  margin: 2px 0;
  font-variant-numeric: lining-nums tabular-nums;
}

/* Coloured by whether the change is good, not by its sign. */
.cw-stat__delta {
  margin: 0;
  font-size: var(--type-caption);
  color: var(--text-muted);
  font-variant-numeric: lining-nums;
}

.cw-stat__delta--good {
  color: var(--status-good);
}

.cw-stat__delta--bad {
  color: var(--status-bad);
}

/* Inside a panel the same strip carries secondary figures. Three fixed
   columns, never auto-fit -- a panel is only ~450px wide, so auto-fit's
   150px floor wrapped the third figure onto a row of its own. */

/* ---- chart: a Chart.js canvas, framed by this stylesheet ---- */

/* The canvas's positioning parent, which is what Chart.js measures: it needs
   a definite height (the canvas has none of its own) and `min-width: 0` so a
   grid track cannot hand it a min-content width it will never give back.
   The font is set here rather than in JS because the chart reads its own
   ticks, legend and tooltip type off this element's computed style -- so
   this file stays the source of truth for both the palette and the type. */
.cw-chart__plot {
  position: relative;
  height: 200px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: var(--type-caption);
}

.cw-chart__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 10px;
}

.cw-chart__peak,
.cw-chart__hint {
  margin: 0;
  font-size: var(--type-caption);
}

/* The legend in a panel head: the peak, then one toggle per series. Each is
   a chip, so it is a real control with a chip's touch target; the swatch is
   the series' status colour, the same token BarChart.vue paints the bars
   with. */
.cw-chart__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cw-chart__legend .cw-chart__peak {
  margin-right: 6px;
  font-family: var(--font-mono);
}

.cw-chart__swatch {
  flex: none;
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: currentColor;
}

.cw-chart__swatch--brass {
  color: var(--status-progress);
}

.cw-chart__swatch--ink {
  color: var(--status-neutral);
}

.cw-chart__swatch--green {
  color: var(--status-good);
}

.cw-chart__swatch--oxblood {
  color: var(--status-bad);
}

.cw-chart__swatch--done {
  color: var(--status-done);
}

/* Switched off: struck through and hollow, so it is not colour alone. */
.cw-chart__key.is-off {
  color: var(--text-faint);
  text-decoration: line-through;
}

.cw-chart__key.is-off .cw-chart__swatch {
  background: transparent;
}

/* ---- funnel: label, count, conversion, proportion bar (admin pulse) ---- */
.cw-funnel {
  display: grid;
  grid-template-columns: minmax(84px, auto) 40px 44px minmax(60px, 1fr);
  gap: 10px 12px;
}

.cw-funnel__row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
}

.cw-funnel__label {
  color: var(--text-muted);
  white-space: nowrap;
}

.cw-funnel__value {
  font-family: var(--font-mono);
  font-size: var(--type-body);
  text-align: right;
}

.cw-funnel__rate {
  font-size: var(--type-label);
  text-align: right;
}

.cw-funnel__track {
  display: block;
  height: 8px;
  background: var(--surface-inset);
  border-radius: 2px;
}

.cw-funnel__bar {
  display: block;
  height: 100%;
  background: var(--status-neutral);
  border-radius: 2px;
}

/* ---- two-tone proportion bar (admin: checks passed vs failed) ---- */

/* ---- watched PRs: the list (both PR tabs) and the PR page ---- */

/* The list: the FilterBar is the panel's head, the table the rest. The PR
   and its last outcome share whatever the fixed columns leave, each cut to
   one line (`max-width: 0` lets a percentage column clip instead of
   widening the table). */
.cw-prs .cw-table td {
  vertical-align: middle;
}

.cw-prs .cw-table td.cw-prs__pr {
  width: 36%;
  min-width: 220px;
  max-width: 0;
}

.cw-prs .cw-table td.cw-prs__outcome {
  width: 40%;
  min-width: 200px;
  max-width: 0;
  color: var(--text-muted);
}

.cw-prs .cw-table td.cw-prs__branch {
  width: 14%;
  min-width: 110px;
  max-width: 0;
  color: var(--text-muted);
}

.cw-prs__out {
  padding: 0 4px;
  color: var(--text-faint);
}

.cw-prs__caption {
  margin: 0;
  padding-top: 8px;
  font-size: 12px;
}

@media (max-width: 560px) {
  /* Stacked, a cell has the whole line and wraps. */
  .cw-prs .cw-table.cw-table--stack td.cw-prs__pr,
  .cw-prs .cw-table.cw-table--stack td.cw-prs__outcome,
  .cw-prs .cw-table.cw-table--stack td.cw-prs__branch {
    width: auto;
    min-width: 0;
    max-width: none;
  }

  /* Stacked, a row with no outcome yet has no line for one. */
  .cw-prs .cw-table.cw-table--stack td.cw-prs__outcome.is-empty {
    display: none;
  }

  /* A step's time over its words: side by side the date takes half a
     phone's line. */
  .cw-pr .cw-log__line {
    flex-direction: column;
    gap: 0;
  }

  /* The way to GitHub is a touch target here, not a glyph. */
  .cw-prs__out {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
}

/* The PR page. */
.cw-pr__crumb {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* The branch tag is shown whole, so it may break where a tag elsewhere
   may not. */
.cw-pr .cw-matter__head .cw-tag {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* A time is one line, so the column of them keeps its edge. */
.cw-pr .cw-log__time {
  white-space: nowrap;
}

/* Why Cooper stopped: the one panel that asks for a person. */
.cw-pr__stopped {
  border-color: var(--oxblood-6);
}

.cw-pr__reason {
  margin: 0;
  overflow-wrap: anywhere;
}

/* A step's detail (which files, which checks), after its words. */
.cw-pr__note {
  display: block;
  color: var(--text-muted);
}

.cw-pr__facts .cw-attempts {
  margin-right: 8px;
}

/* ---- a date header inside a table body ---- */

/* A muted second line under a cell's own link ("3 files"), as opposed to
   .cw-row-note, which hangs off the right-aligned status column. */
.cw-row-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

/* Chips that sit in a card head, where the head owns the spacing. */
.cw-filter--flush {
  margin-bottom: 0;
}

/* ---- lists (the design system's FilterBar and Table) ---- */

/* One labelled group of toggle chips per question, an italic note after
   them, and the list's own actions on the right. */
/* Wraps: on a phone the actions go under the groups rather than pushing
   the bar past the card. */
.cw-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  /* A card pads itself, flush or not: the bar keeps its edge, which is the
     table's first column too. */
  padding: 0 0 10px;
}

.cw-filterbar__groups {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.cw-filterbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cw-filterbar__label {
  margin-right: 4px;
  font-size: 11px;
  color: var(--text-faint);
}

.cw-filterbar__note {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* The list's free-text search (FilterBar's `searchPlaceholder`). */
.cw-filterbar__search {
  flex: 0 1 240px;
  min-width: 160px;
  width: auto;
}

.cw-filterbar__actions {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 8px;
}

/* A long action ("Retry all 12 needing attention") wraps before it
   overflows. */
.cw-filterbar__actions .cw-btn {
  white-space: normal;
  text-align: center;
}

/* Status as a segmented control: one value at a time, the picked one
   filled. Scrolls sideways on a phone rather than wrapping into a second
   row. */
.cw-filterbar__tabs {
  display: flex;
  /* Every segment is the track's full height, so the picked one's fill
     sits the same 2px from the track on all four sides in every browser. */
  align-items: stretch;
  gap: 2px;
  padding: 2px;
  background: var(--surface-inset);
  border-radius: var(--radius-control);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.cw-filterbar__tabs::-webkit-scrollbar {
  display: none;
}

.cw-filtertab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  margin: 0;
  padding: 0 10px;
  line-height: 1;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition:
    color 120ms ease,
    background-color 120ms ease;
}

.cw-filtertab:hover {
  color: var(--text-display);
}

.cw-filtertab.is-active {
  color: var(--text-display);
  font-weight: var(--weight-medium);
  background: var(--surface-selected);
}

.cw-filtertab__count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1;
  color: var(--text-muted);
}

/* Past a phone a long set of segments wraps onto a second line rather
   than hiding the last ones off its edge. */
@media (min-width: 561px) {
  .cw-filterbar__tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* On a phone the filter menus sit at the card's left edge, where a panel
   hung from its trigger's right runs off the screen: hang it from the row
   of menus instead, the card's width. */
@media (max-width: 560px) {
  .cw-filterbar__actions {
    position: relative;
  }

  .cw-filterbar__actions .cw-filtermenu {
    position: static;
  }

  .cw-filterbar__actions .cw-filtermenu__panel {
    left: 0;
    right: auto;
    width: 100%;
  }
}

/* Between what still needs work and the history (merged, resolved,
   closed). */
.cw-filterbar__rule {
  flex: 0 0 1px;
  align-self: center;
  height: 16px;
  margin: 0 4px;
  background: var(--rule-hairline);
}

/* A long list as a dropdown (FilterMenu.vue): a <details> whose summary
   says what is picked. */
.cw-filtermenu {
  position: relative;
}

.cw-filtermenu__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-display);
  background: var(--surface-raised);
  border: var(--border-hairline);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.cw-filtermenu__trigger::-webkit-details-marker {
  display: none;
}

.cw-filtermenu__trigger:hover,
.cw-filtermenu[open] > .cw-filtermenu__trigger {
  border-color: var(--rule-strong);
}

.cw-filtermenu__label {
  font-size: 11px;
  color: var(--text-muted);
}

.cw-filtermenu__value {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-filtermenu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--surface-raised);
  border: var(--border-hairline);
  box-shadow: var(--shadow-modal);
}

.cw-filtermenu__search {
  display: block;
  padding: 10px;
  border-bottom: var(--border-faint);
}

.cw-filtermenu__search .cw-input {
  width: 100%;
  box-sizing: border-box;
}

.cw-filtermenu__options {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}

.cw-filtermenu__option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  color: var(--text-display);
  cursor: pointer;
}

.cw-filtermenu__option:hover {
  background: var(--surface-inset);
}

.cw-filtermenu__option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green-8);
}

.cw-filtermenu__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw-filtermenu__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.cw-filtermenu__none {
  margin: 0;
  padding: 8px 14px;
  color: var(--text-muted);
}

.cw-filtermenu__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-top: var(--border-faint);
}

/* What a menu has picked, kept in sight under the bar. */
.cw-filterbar__picked {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cw-filterbar__tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green-8);
  background: var(--green-1);
}

.cw-filterbar__untag {
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 13px;
  color: var(--text-body);
  background: none;
  border: 0;
  cursor: pointer;
}

.cw-filterbar__untag:hover {
  color: var(--oxblood-7);
}

/* A list's table never runs past its card and never scrolls sideways:
   fixed layout, every column but the elastic one given its width by the
   table's <colgroup>, each cell cutting its value with an ellipsis. The
   elastic column (`is-remainder`, no width) takes the rest. */

/* A right-aligned cell holds a badge or a count that must never be cut. */

/* One line of a cell, cut with an ellipsis; the whole of it in its title
   and on the row's page. */
.cw-cell-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* A row's headline: the title or rule a row exists for. */
.cw-cell-line--display {
  color: var(--text-display);
}

.cw-cell-line--display:hover {
  text-decoration: underline;
}

/* The muted line under a cell's value (a branch, a breakdown). */

/* Cards stacked down a page, one gap apart. */

/* The lesson page's lead: how Cooper learned the rule. */
.cw-lesson__prose {
  margin: 8px 0 0;
  max-width: 80ch;
  font-size: 13px;
  line-height: 1.5;
}

/* The Lessons tab: one rule per row, over one plain line about it. */
.cw-lesson-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cw-lesson-list__item {
  padding: 14px 0;
  border-top: 1px solid var(--rule-faint);
}

.cw-lesson-list__item:first-child {
  border-top: 0;
}

.cw-lesson-list__rule {
  display: block;
  max-width: 90ch;
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  line-height: 1.45;
  color: var(--text-display);
  text-decoration: none;
}

.cw-lesson-list__rule:hover {
  color: var(--text-link);
  text-decoration: underline;
}

.cw-lesson-list__meta {
  margin: 4px 0 0;
  font-size: var(--type-small);
  color: var(--text-muted);
}

.cw-lesson-list__meta .cw-badge {
  margin-right: 8px;
}

.cw-lesson-list__item.is-muted .cw-lesson-list__rule {
  color: var(--text-muted);
}

/* The panel head's repository select and search field: sized to sit in a
   row with the segmented controls, not to fill it. */
.cw-lesson__filter {
  width: auto;
  max-width: 220px;
}

/* The files and the check under the diffs: a path or a regex has no space
   to break at, and unbroken it widens a phone's page. */
.cw-lesson__note {
  overflow-wrap: anywhere;
}

/* The lesson page's scope select, under the mute button. */
.cw-lesson__scope {
  display: grid;
  gap: 4px;
}

@media (max-width: 560px) {
  .cw-lesson__filter {
    flex: 1 1 140px;
    max-width: none;
  }
}

/* A lesson whose rule is no longer trusted: at rest, a hollow disc. */
.cw-badge--muted {
  color: var(--text-faint);
}

.cw-badge--muted::before {
  background: none;
  border: 1.5px solid currentColor;
}

/* A promoted rung, as the public site and the back office mark it. */
.cw-badge--stack {
  color: var(--status-neutral);
}

/* The rung above stack: the same brass, a shade deeper on a tinted ground,
   so the two upper rungs read as one family with system the stronger. */
.cw-badge--system {
  color: var(--text-display);
}

/* The evidence, side by side: what the person shipped against what Cooper
   tried. Two tracks of equal width, each allowed to shrink below its
   content -- a diff line has no break opportunities, so without minmax(0)
   one long line would push the other column out of the card. */
.cw-lesson__diffs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.cw-lesson__side {
  margin: 0 0 6px;
}

.cw-lesson__diff {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-body);
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-control);
}

@media (max-width: 860px) {
  .cw-matter__grid {
    grid-template-columns: 1fr;
  }

  /* Below this the panels are too narrow for a funnel bar and a legend side
     by side, and the headline strip reads better two-up than squeezed. */

  .cw-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* The CI panel's three figures are one reading, not a strip: they stay
     three-up on a stacked panel, which is wider than a column was. */

  /* Half a card is not enough for a diff line; below this the person's
     excerpt sits above Cooper's rather than beside it. */
  .cw-lesson__diffs {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Below the general rule on purpose: two 170px cells cannot hold
     "Detected → fix PR" and a duration, so the speed pair stacks -- and its
     divider turns from a vertical rule into a horizontal one. */

  .cw-header__inner,
  .cw-frame,
  .cw-frame-banner,
  .cw-footer__inner {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .cw-header__inner {
    gap: 16px;
  }

  /* The section nav leaves the side and becomes one row above the page
     that scrolls sideways: a 196px column is a third of a tablet and more
     than half a phone. Its group headings go (the row reads in the same
     order without them), and the row keeps its own overflow, which is also
     what keeps it out of the page's -- a scroll container is allowed to be
     wider than the phone, exactly as the table wrappers are.

     No scrollbar is drawn: a phone overlays its own and takes no width for
     it, while a desktop browser narrowed past 860px would otherwise get a
     permanent grey bar under the row. */
  .cw-frame {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .cw-main {
    padding: 0;
    border-left: 0;
  }

  .cw-subnav {
    position: static;
    align-self: stretch;
    padding: 0;
    width: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    border-bottom: var(--border-hairline);
    /* The one cue that there is more to the right. */
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  }

  .cw-subnav::-webkit-scrollbar {
    display: none;
  }

  .cw-subnav__group {
    display: contents;
  }

  .cw-subnav__heading {
    display: none;
  }

  /* Links keep their own width: left to flex they would each shrink to
     fit, which is how a scrollable row turns back into a squeezed one. */
  .cw-subnav__link {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  /* Tighter cells and a smaller, less tracked column head, so the
     six-column PR table fits a tablet without a scrollbar (with the shorter
     caps on .cw-branch and .cw-row-note, set beside their own rules further
     down): "ATTEMPTS" in full small caps is a 100px column for a single
     digit. */
  .cw-table thead th,
  .cw-table tbody td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .cw-table thead th {
    font-size: 11.5px;
  }
}

/* ---- phones ----
   One column of everything. The display sizes step down through the tokens
   rather than rule by rule, so a page head, a hero, a headline figure and a
   closing banner all shrink together. */
@media (max-width: 560px) {
  :root {
    --type-display-1: 34px;
    --type-display-2: 28px;
    --type-title: 23px;
    --type-heading: 19px;
  }

  /* The heading is clamped here, not shrunk. An incident or PR title is the
     customer's own exception message, and Sentry's routinely carry a compare
     URL -- a hundred characters with nowhere to break -- which unclamped
     runs to nine lines at 360px. Shrinking the type was tried first and
     bought one line out of nine, so it went back.

     Only the BOX is clipped. The full title stays in the DOM, so it is still
     selected, searched, and read aloud in full by a screen reader; what is
     lost is the sighted phone reader's view of the tail, which is the
     accepted cost of three lines of heading over nine of shattered URL. */
  .cw-matter h1 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }

  /* The top bar keeps one row: the organization gives way first, then the
     login, both with an ellipsis, so every control stays on the page. */
  .cw-header__inner {
    gap: 12px;
  }

  .cw-header .cw-wordmark {
    font-size: 15px;
  }

  .cw-header__divider {
    display: none;
  }

  .cw-header__org,
  .cw-header__switch {
    flex: 0 1 auto;
  }

  /* Shrinks with its form rather than overflowing onto the next control. */
  .cw-header__switch-select {
    max-width: 120px;
    width: 100%;
    min-width: 0;
  }

  .cw-header__signout-btn {
    white-space: nowrap;
  }

  /* An admin's row has no room for the back office door beside the
     organization on a phone; /admin is still a typed URL away. Doubled up
     to outrank the touch-target rule that makes it inline-flex. */
  .cw-header .cw-header__office {
    display: none;
  }

  .cw-header__switch {
    min-width: 96px;
  }

  /* A basis of zero, so the login never asks the row for its full width:
     it takes whatever is left and shows an ellipsis when that is not
     enough. */
  .cw-header__user {
    flex: 1 1 0;
    text-align: right;
  }

  .cw-frame {
    padding-top: var(--space-4);
    padding-bottom: var(--space-7);
  }

  .cw-pagehead {
    margin-bottom: 18px;
  }

  .cw-card {
    padding: 14px 16px 16px;
  }

  .cw-empty {
    padding: 20px 16px;
  }

  .cw-btn--lg {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* A button whose label wraps needs its lines apart; 1 is right only for
     the one-line button the wide layouts always have room for. */
  .cw-btn {
    line-height: 1.25;
  }

  /* A step as a small grid: the mark, then everything else in one column
     beside it, the label on the first line and the timestamp (or the
     "required" tag) on its own line beneath, right-aligned. A wrapping flex
     row put the label on a line of its own under a lonely mark instead. */

  /* The mapping page's lists have no mark: a title that wraps, then its
     badge. The badge's track is `auto`, never the flexible one -- a grid
     item in a minmax(0, 1fr) track has no automatic minimum, and the badge
     was squeezed to its padding with its nowrap text running off the
     phone. */

  /* A funnel row is label, count and rate on one line with the bar beneath:
     four tracks across need 264px, and a panel here has about 250. */
  .cw-funnel {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px 12px;
  }

  .cw-funnel__track {
    grid-column: 1 / -1;
  }

  /* The CI panel's three figures as a list, each label beside its number:
     three-up they were 80px cells, too narrow for "Abandoned" in small
     caps. (The 860px rule above kept them three-up on the grounds that a
     stacked panel is wide; a phone's is not.) */

  /* The settings stack's sub-setting keeps a visible indent, just not the
     switch-width one, which is a fifth of a phone. */

  .cw-modal {
    padding: 22px 18px 20px;
  }

  .cw-modal__actions {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Marketing page: the public site. Reading sizes inside the site measure,
   and the console's own panels, tables, marks and logs wherever the page
   shows the product.
   ========================================================================== */

/* A run of plain words -- the stacks, the two promises under the hero --
   separated by a mid-dot rather than boxed. */
.cw-pill {
  font-size: var(--type-caption);
  color: var(--text-muted);
}

.cw-pill:not(:last-child)::after {
  content: '·';
  margin-left: 8px;
  color: var(--text-faint);
}

.cw-section {
  padding: var(--space-8) 0;
  border-top: var(--border-faint);
}

.cw-mkt > .cw-section:first-child {
  border-top: none;
}

.cw-section__title {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
  margin: 0 0 8px;
}

h1.cw-section__title {
  font-size: 34px;
  line-height: 1.12;
  margin-bottom: 14px;
}

.cw-section__lead {
  font-family: var(--font-body);
  font-size: var(--type-body);
  color: var(--text-muted);
  max-width: var(--content-measure);
  margin: 0 0 22px;
}

ul.cw-section__lead {
  padding-left: 22px;
}

.cw-section__lead + .cw-section__title,
.cw-compare + .cw-section__title,
.cw-proof-figures + .cw-section__title,
.cw-faq-grid + .cw-section__title {
  margin-top: var(--space-7);
}

/* ---- hero ---- */
.cw-hero {
  padding: 72px 0 64px;
}

.cw-mkt-hero {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-7);
  align-items: center;
}

.cw-hero__inner {
  flex: 1 1 440px;
  min-width: 0;
}

.cw-hero h1 {
  font-size: var(--type-display-1);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin: 0;
}

/* The second half of the claim, inside the h1: "we file the fix" and "we
   stay on the PR" are one promise, and the second half is the one a
   per-issue fixer cannot make. A size down so the brand line leads. */
.cw-hero__then {
  display: block;
  margin-top: 12px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-display);
  color: var(--text-muted);
}

.cw-hero__lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 18px 0 26px;
}

.cw-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 26px 0 14px;
}

.cw-hero__actions form {
  margin: 0;
}

.cw-hero__actions .cw-btn--lg {
  font-size: 14px;
}

/* The hero's one-line answer to "what will it touch?", under the buttons. */
.cw-hero__assure {
  font-size: var(--type-caption);
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 6px;
}

.cw-hero__pills,
.cw-built-for {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 0;
}

/* The example round: a console panel -- repository and PR, the status mark
   and the attempt budget in its head, then the log. */
.cw-mkt-hero__aside {
  flex: 1 1 480px;
  min-width: 0;
}

/* The shared panel head, ruled off from the log under it. */
.cw-mkt-hero__aside-head {
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: var(--border-faint);
}

.cw-mkt-hero__aside .cw-log__line {
  padding: 6px 0;
}

/* Tables at reading size. The paddings stop at the phone breakpoint, where
   the stacked table's own rules take over. */
.cw-mkt .cw-table thead th {
  font-size: 12.5px;
}

.cw-mkt .cw-table tbody td,
.cw-mkt .cw-table tbody th {
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 561px) {
  .cw-mkt .cw-table thead th {
    padding: 9px 14px;
  }

  .cw-mkt .cw-table tbody td,
  .cw-mkt .cw-table tbody th {
    padding: 10px 14px;
  }
}

/* ---- exhibits (before/after) ---- */
.cw-exhibits__caption {
  font-size: var(--type-caption);
  color: var(--text-muted);
  max-width: var(--content-measure);
  margin: 16px 0 0;
}
/* A heading that follows a caption inside one section (the bugstack page). */
.cw-exhibits__caption + .cw-section__title {
  margin-top: 40px;
}

/* ---- how it works ---- */
/* The three loops, one row each. */
.cw-loops {
  padding-top: 2px;
  padding-bottom: 2px;
}

.cw-loops tbody th {
  text-align: left;
  vertical-align: top;
  font-weight: 600;
  color: var(--text-display);
  white-space: nowrap;
  border-bottom: var(--border-faint);
}

.cw-loops tbody tr:last-child th {
  border-bottom: none;
}

/* Three plain columns of text, for a loop whose steps do not share
   columns. */
.cw-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6) var(--space-7);
  margin-top: 4px;
}

.cw-step h3 {
  font-size: 16px;
  margin: 0 0 10px;
}

.cw-note {
  font-size: var(--type-small);
  color: var(--text-muted);
  max-width: var(--content-measure);
  margin: 22px 0 0;
}

/* ---- social proof ---- */
.cw-built-for {
  margin-bottom: 22px;
}

/* ---- pricing (retainers) ---- */
.cw-retainers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.cw-retainer {
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.cw-retainer--featured {
  border-color: var(--rule-hairline);
}

.cw-retainer__tier {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-display);
}

.cw-retainer__price {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: var(--weight-medium);
  color: var(--text-display);
  font-variant-numeric: tabular-nums;
}

.cw-retainer__period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

.cw-retainer__desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 8px 0 18px;
  flex: 1;
}

/* The yearly price, under what the plan is. */
.cw-retainer__for {
  font-size: 13px;
  color: var(--text-muted);
  margin: -10px 0 18px;
}

.cw-retainer form {
  margin: 0;
}

/* On the public page the three plans are one bordered block, compared
   column by column. */
.cw-mkt .cw-retainers {
  gap: 0;
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}

.cw-mkt .cw-retainer {
  background: none;
  border: none;
  border-right: var(--border-faint);
  border-radius: 0;
}

.cw-mkt .cw-retainer:last-child {
  border-right: none;
}

/* ---- faq ---- */
.cw-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
  margin-top: 22px;
}

.cw-faq-item h3 {
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 6px;
}

.cw-faq-item p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* The loop diagram on the home page's method section and the docs
   overview: an image, so it scales with the column rather than past it. */
.cw-loop-figure {
  margin: 22px 0 0;
}

.cw-loop-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}

.cw-product-shot figcaption {
  margin-top: 8px;
  font-size: var(--type-caption);
  color: var(--text-muted);
}

/* ---- closing banner ---- */
.cw-closing {
  border-top: var(--border-faint);
  padding: var(--space-8) 0;
}

.cw-closing__inner {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.cw-closing h2 {
  font-size: 26px;
  letter-spacing: var(--tracking-display);
  margin: 0 0 8px;
}

.cw-closing p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: var(--content-measure);
  margin: 0 0 22px;
}

.cw-closing form {
  margin: 0;
}

.cw-closing .cw-btn--lg {
  font-size: 14px;
}

/* ---- loop dockets ----
   A step's labelled rows: what it reads, does, and where it stops. */
.cw-step__facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0;
}

.cw-step__facts dt {
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text-body);
}

.cw-step__facts dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---- one incident (the arc) ----
   The timeline card takes the wider track; the two diffs it ends by
   comparing stack beside it. */
.cw-arc {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: start;
}

.cw-arc__side {
  display: grid;
  gap: 14px;
}

/* The incident page's diff lines are pre-wrap for the whitespace a real
   patch carries. These two are typed into the template, where the markup's
   own indentation would otherwise render as part of the code. */
.cw-arc .cw-diff__line {
  white-space: normal;
}

/* A step of the arc: the verb in the log's mono, what it concerned under
   it in the reading face. */
.cw-arc .cw-log__line {
  padding: 7px 0;
}

.cw-arc__step {
  font-weight: var(--weight-medium);
}

.cw-arc__note {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ---- lessons ----
   The lesson in the Lessons tab's shape (rule over summary, tags under),
   and the ladder it climbs as a ruled list: the section has to show what a
   lesson looks like before it explains where one goes. */
.cw-lessons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-7);
  align-items: start;
}

.cw-lesson-example__rule {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-display);
  overflow-wrap: anywhere;
}

.cw-lesson-example__summary {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.cw-lesson-example__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cw-ladder {
  margin: 0;
  border-top: var(--border-faint);
}

.cw-ladder dt {
  padding-top: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-display);
}

.cw-ladder dd {
  margin: 4px 0 0;
  padding-bottom: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
  border-bottom: var(--border-faint);
}

/* ---- compared with Seer ----
   Two columns of scope, one difference per row, in one panel. The head row
   is for the wide layout; on a phone each cell names its column itself
   (data-who), so the row still reads when the two columns become one. */
.cw-compare {
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}

.cw-compare__head,
.cw-compare__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 10px 20px;
}

.cw-compare__head {
  font-size: 12.5px;
  font-weight: var(--weight-medium);
  color: var(--text-faint);
  border-bottom: var(--border-faint);
}

.cw-compare__head > :first-child {
  grid-column: 2;
}

.cw-compare__rows {
  margin: 0;
}

.cw-compare__row {
  border-bottom: var(--border-faint);
}

.cw-compare__row:last-child {
  border-bottom: none;
}

.cw-compare__row dt {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-display);
}

.cw-compare__row dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.cw-compare__row dd:last-child {
  color: var(--text-body);
}

.cw-compare__row dd::before {
  display: none;
  content: attr(data-who);
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--text-faint);
}

/* Text for screen readers only: the words a glyph stands for. */
.cw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .cw-arc,
  .cw-lessons,
  .cw-steps,
  .cw-retainers,
  .cw-faq-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw-mkt .cw-retainer {
    border-right: none;
    border-bottom: var(--border-faint);
  }

  .cw-mkt .cw-retainer:last-child {
    border-bottom: none;
  }
}

/* ==========================================================================
   marketing: nav band, page container and footer (cw-mkt-*)
   ========================================================================== */

/* ---- top nav band (logged-out masthead) ---- */
.cw-mkt-nav {
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}

.cw-mkt-nav__inner {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 52px;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

/* Eight links since the Blog joined them: a label that wraps onto three
   lines ("How / it / works") is a broken band, so none of them may wrap. */
.cw-mkt-nav__links a,
.cw-mkt-nav__signin,
.cw-mkt-nav__cta .cw-btn {
  white-space: nowrap;
}

.cw-mkt-nav__brand {
  display: inline-flex;
  text-decoration: none;
}

.cw-mkt-nav__brand .cw-wordmark {
  font-size: 16px;
}

.cw-mkt-nav__links {
  display: flex;
  gap: var(--space-5);
  flex: 1;
  justify-content: flex-end;
  /* Short of room (a laptop between the phone breakpoint and the full
     width) the row scrolls sideways rather than pushing the sign-in and
     Get started off the band -- the phone's own answer, a step earlier. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cw-mkt-nav__links::-webkit-scrollbar {
  display: none;
}

.cw-mkt-nav__links a,
.cw-mkt-nav__signin {
  font-size: 13.5px;
  color: var(--text-on-inverse-muted);
  text-decoration: none;
}

.cw-mkt-nav__links a:hover,
.cw-mkt-nav__signin:hover {
  color: var(--text-on-inverse);
}

.cw-mkt-nav__cta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cw-mkt-nav__cta form {
  margin: 0;
}

/* The one button on the dark band is the light one. */
.cw-mkt-nav__cta .cw-btn--primary {
  background: var(--paper-2);
  border-color: var(--paper-2);
  color: var(--green-8);
}

.cw-mkt-nav__cta .cw-btn--primary:hover {
  background: var(--green-1);
  border-color: var(--green-1);
  color: var(--green-9);
}

/* ---- page container ---- */
.cw-mkt {
  --type-display-1: 44px;
  --type-display-2: 30px;
  --type-title: 24px;
  --type-heading: 18px;
  --type-body: 16px;
  --type-small: 14.5px;
  --type-caption: 13px;
  --type-label: 12.5px;
  --leading-body: 1.55;
  font-size: var(--type-body);
  line-height: var(--leading-body);
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ---- footer ---- */
.cw-mkt-footer {
  border-top: var(--border-faint);
  color: var(--text-muted);
  padding: var(--space-7) 0 var(--space-6);
}

.cw-mkt-footer__inner {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.cw-mkt-footer__top {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: var(--space-7);
  padding-bottom: var(--space-6);
  border-bottom: var(--border-faint);
}

.cw-mkt-footer__brand .cw-wordmark {
  font-size: 16px;
}

.cw-mkt-footer__blurb {
  font-size: 13.5px;
  margin: 10px 0 0;
  max-width: 38ch;
  line-height: 1.55;
}

.cw-mkt-footer__col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-display);
  margin: 0 0 10px;
}

.cw-mkt-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.cw-mkt-footer__col a,
.cw-mkt-footer__col .cw-link-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
}

.cw-mkt-footer__col a:hover,
.cw-mkt-footer__col .cw-link-btn:hover {
  color: var(--text-link);
  text-decoration: underline;
}

.cw-mkt-footer__base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  padding-top: var(--space-4);
  font-size: 13px;
  color: var(--text-faint);
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  /* The band follows the reader. The home page and /docs are many screens
     long on a phone, and these section links are the only way around
     either of them. */
  .cw-mkt-nav {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  /* The links stay, as a row that scrolls: there is no hamburger in this
     app, so hiding them left a phone with no way to reach them at all.

     min-width: 0 from the start: a nowrap row inside a flex parent will not
     shrink below its content unless told it may. */
  .cw-mkt-nav__links {
    flex-wrap: nowrap;
    flex: 1 1 100%;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  }

  .cw-mkt-nav__links a {
    flex: 0 0 auto;
  }

  .cw-mkt-footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
  }

  .cw-mkt-footer__brand {
    grid-column: 1 / -1;
  }

  .cw-mkt,
  .cw-mkt-nav__inner,
  .cw-mkt-footer__inner,
  .cw-closing__inner {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* Phones: the nav band wraps its links under the brand and the two
   actions, the sections lose most of their vertical air, and the exhibits'
   mono lines -- a controller path, a diff line -- break inside the card
   instead of widening it. */
@media (max-width: 560px) {
  /* The contents list follows the two-row band at this width. */
  .cw-docs-toc {
    top: 92px;
  }

  .cw-mkt-nav__inner {
    flex-wrap: wrap;
    justify-content: space-between;
    height: auto;
    padding-top: 2px;
    padding-bottom: 2px;
    gap: 0 16px;
  }

  /* Sign in and Get started share the brand's line, with the links
     scrolling beneath them, rather than taking a line of their own. */
  .cw-mkt-nav__cta {
    margin-left: auto;
    gap: 10px;
    order: 2;
  }

  .cw-mkt-nav__cta .cw-btn {
    padding-left: 12px;
    padding-right: 12px;
  }

  .cw-mkt-nav__links {
    order: 3;
  }

  .cw-hero {
    padding: var(--space-5) 0 var(--space-7);
  }

  .cw-ph-banner__inner {
    flex-wrap: nowrap;
    padding: 6px var(--space-4);
  }

  .cw-ph-banner .cw-label {
    font-size: 10px;
  }

  .cw-ph-banner img {
    width: 110px;
  }

  .cw-hero__then {
    font-size: 19px;
  }

  h1.cw-section__title {
    font-size: 28px;
  }

  .cw-section__title,
  .cw-closing h2 {
    font-size: 22px;
  }

  .cw-section,
  .cw-closing {
    padding: var(--space-7) 0;
  }

  .cw-arc .cw-mono {
    overflow-wrap: anywhere;
  }

  /* The loop's name heads its stacked row. */
  .cw-card--flush.cw-loops tbody th {
    display: block;
    padding: 0 0 6px;
    font-size: 15px;
    white-space: normal;
    border-bottom: none;
  }

  /* The comparison's two columns become one: the head row goes, and each
     cell names its column itself. */
  .cw-compare__head {
    display: none;
  }

  .cw-compare__row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }

  .cw-compare__row dd::before {
    display: block;
  }

  .cw-mkt-footer__top {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Documentation page (cw-docs-*): a reference. The contents list stays put
   on the left while the sections scroll past at the reading measure; on a
   phone, where there is no room beside the text, it is one swipeable line
   above it.
   ========================================================================== */
.cw-docs__head {
  padding: var(--space-8) 0 var(--space-6);
  border-bottom: var(--border-faint);
}

.cw-docs__head h1 {
  font-size: 34px;
  line-height: 1.12;
  margin: 0 0 12px;
}

.cw-docs__head .cw-section__lead {
  margin-bottom: 10px;
}

.cw-docs__byline {
  margin: 0;
  font-size: var(--type-caption);
  color: var(--text-faint);
}

.cw-docs__grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
}

.cw-docs-toc {
  position: sticky;
  top: var(--space-5);
  padding-top: var(--space-7);
}

.cw-docs-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cw-docs-toc a {
  display: flex;
  align-items: baseline;
  padding: 5px 10px;
  border-radius: var(--radius-control);
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}

.cw-docs-toc a:hover {
  background: var(--surface-inset);
  color: var(--text-display);
}

/* min-width: 0 so a table wider than the column scrolls inside its
   .cw-table-scroll rather than widening the grid track and the page. */
.cw-docs__body {
  min-width: 0;
}

.cw-docs-section {
  padding: var(--space-7) 0;
  border-bottom: var(--border-faint);
}

.cw-docs-section:last-child {
  border-bottom: none;
}

.cw-docs-section__title {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: var(--tracking-display);
  margin: 0 0 14px;
}

.cw-docs-section h3 {
  font-size: var(--type-heading);
  margin: 28px 0 8px;
}

/* Reference prose holds to the body measure; tables may run the column's
   full width. */
.cw-docs-section p,
.cw-docs-section ul,
.cw-docs-section .cw-step__facts,
.cw-docs-section .cw-ladder {
  max-width: var(--content-measure);
}

.cw-docs-section p {
  margin: 0 0 14px;
}

.cw-docs-section ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.cw-docs-section li {
  margin-bottom: 6px;
}

.cw-docs-section .cw-step__facts {
  margin: 14px 0 20px;
}

.cw-docs-section .cw-step__facts dd {
  color: var(--text-body);
}

/* A reference table is a panel of its own. */
.cw-docs-section .cw-table-scroll {
  margin: 14px 0 20px;
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}

.cw-docs-section .cw-table tbody td {
  vertical-align: top;
}

/* A code block: the mono face in an inset panel, wrapped rather than
   scrolled, because the one thing in it is often a URL a reader has to see
   whole on a phone. */
.cw-docs-section pre.cw-mono {
  margin: 0 0 14px;
  padding: 12px 16px;
  max-width: var(--content-measure);
  background: var(--surface-inset);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
  color: var(--text-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cw-docs-section .cw-ladder ul {
  margin: 0;
  padding-left: 20px;
}

.cw-docs-section .cw-ladder dd {
  color: var(--text-body);
}

/* The section's own rule closes the ladder; the last entry's would double it. */
.cw-docs-section .cw-ladder dd:last-child {
  border-bottom: none;
}

.cw-docs-section .cw-hero__actions {
  margin: 20px 0 0;
}

@media (max-width: 860px) {
  .cw-docs__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  /* The contents list stays with the reader: on the longest page of the
     site the only way back must not scroll away after the first screen. It
     stays one line tall, so the strip it costs is a strip and not a third
     of the screen, and takes the page's own background so the prose does
     not read through it while it is stuck. */
  .cw-docs-toc {
    /* Below the band, not under it: the nav is sticky too. */
    top: 52px;
    z-index: 2;
    /* A grid item's min-width is `auto`: without this a nowrap row of
       thirteen entries sizes the track, and takes the page sideways. */
    min-width: 0;
    background: var(--surface-page);
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: var(--border-faint);
  }

  .cw-docs-toc ol {
    display: flex;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 0 var(--space-2);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  }

  .cw-docs-toc ol::-webkit-scrollbar {
    display: none;
  }

  .cw-docs-toc li {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .cw-docs__head {
    padding-top: var(--space-6);
  }

  .cw-docs__head h1 {
    font-size: 28px;
  }

  .cw-docs-section {
    padding: var(--space-6) 0;
  }

  .cw-docs-section__title {
    font-size: 22px;
  }

  .cw-docs-section .cw-step__facts {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }

  .cw-docs-section .cw-step__facts dd {
    margin-bottom: 10px;
  }

  /* A stacked table has no panel: each row is its own block. */
  .cw-docs-section .cw-table-scroll {
    background: none;
    border: none;
  }

  /* The reference tables' first column names the row (a field, a
     permission, a switch), so in the stacked table it is the headline, not
     a labelled line. */
  .cw-docs-section .cw-table--stack tbody td:first-child {
    padding-left: 0;
    padding-bottom: 6px;
    font-size: var(--type-body);
    font-weight: var(--weight-medium);
    color: var(--text-display);
  }

  .cw-docs-section .cw-table--stack tbody td:first-child::before {
    display: none;
  }
}

/* ---- modal (native <dialog>, opened by the Vue islands) ---- */
.cw-modal {
  width: min(520px, calc(100vw - 32px));
  padding: 28px 32px 24px;
  border: var(--border-hairline);
  background: var(--surface-raised);
  color: var(--text-body);
  box-shadow: var(--shadow-modal);
}

.cw-modal::backdrop {
  background: rgba(15, 35, 28, 0.45);
}

/* A modal that simply appears reads as a page swap rather than as something
   laid on top of the page; the paper rises the way a sheet put on a desk
   would. Both animations are on [open] so they run once, when showModal()
   puts the dialog on the top layer. */
.cw-modal[open] {
  animation: cw-modal-rise var(--dur-med) var(--ease-out);
}

.cw-modal[open]::backdrop {
  animation: cw-modal-fade var(--dur-med) var(--ease-out);
}

@keyframes cw-modal-rise {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

@keyframes cw-modal-fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw-modal[open],
  .cw-modal[open]::backdrop {
    animation: none;
  }
}

/* The overline naming the action, above the question itself -- the same
   kicker every card head carries, so a dialog reads as part of the docket. */
.cw-modal__over {
  display: block;
  margin-bottom: 6px;
  color: var(--text-accent);
}

.cw-modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.cw-modal__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-display);
}

.cw-modal__body {
  margin: 0 0 20px;
  font-size: var(--type-small);
  line-height: 1.5;
}

.cw-modal__actions {
  display: flex;
  gap: 18px;
  align-items: center;
}

/* Two real buttons rather than a button and a way out, so they sit closer
   together than the gate modal's primary-plus-link pair. */
.cw-modal__actions--confirm {
  gap: var(--space-3);
}

/* Branch names can run long (Dependabot's especially); cap the column and
   let the title attribute carry the full name. */
.cw-branch {
  display: inline-block;
  max-width: 19ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* A card head that carries an action button (or a row of chips) on the
   right -- and under the title once the two no longer fit side by side. */

/* One-line note under a status badge (the PR's last outcome). */
.cw-row-note {
  display: block;
  max-width: 26ch;
  margin-left: auto;
  margin-top: 4px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A self-improvement run's reason, under its outcome badge. Deliberately
   NOT .cw-row-note above: that clamp exists because a watched PR's last
   outcome is a footnote to its status, whereas here the reason IS the row --
   why Cooper refused, or the error it died on -- and a reason you cannot
   read is a row that says nothing. So: wrapped in full, and broken mid-token
   where it has to be, since these carry file paths and backtrace lines. */
.cw-run-reason {
  display: block;
  max-width: 62ch;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* What else a run left behind, under its issue: the pull request it opened
   and the warning that the patch touches a migration. */
.cw-run-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 4px;
  font-size: 12px;
}

.cw-run-flag {
  color: var(--text-muted);
}

/* Shorter caps on a tablet, where the PR table's six columns have about
   690px between them: the title attribute still carries the whole branch
   and the whole reason. Here, after the two rules above, because an
   earlier rule of the same weight would lose to them. */
@media (max-width: 860px) {
  .cw-branch {
    max-width: 16ch;
  }

  .cw-row-note {
    max-width: 16ch;
  }
}

/* A link that opens a GitHub resource in a new tab: text (optional) plus a
   small boxed arrow glyph, used for repo/branch cells in the dashboard
   tables. */
.cw-extlink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cw-extlink__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
  background: var(--surface-inset);
  border: var(--border-faint);
  flex-shrink: 0;
}

.cw-extlink:hover .cw-extlink__glyph {
  color: var(--text-body);
  border-color: var(--rule-hairline);
}

/* ==========================================================================
   Touch targets. On a phone, or on anything driven by a finger, every
   control a person has to hit measures at least 44px both ways (the AAA
   figure; test/system/responsive_layout_test.rb holds the page to it), and
   the two small secondary affordances -- a checkbox, an external-link
   glyph -- at least 24px. The visible weight stays what it was: the extra
   is padding, or a min-height on an inline-flex box, never a bigger glyph.
   The header links swap their border-bottom underline for a text underline
   here, because a border sits at the bottom of the (now 44px) box, a long
   way under the word.
   ========================================================================== */
@media (max-width: 560px), (pointer: coarse) {
  .cw-btn {
    min-height: 44px;
  }

  .cw-subnav__link {
    min-height: 44px;
  }

  .cw-header__signout-btn,
  .cw-mkt-nav__signin {
    min-width: 44px;
    justify-content: center;
  }

  .cw-header__office,
  .cw-header__signout-btn,
  .cw-mkt-nav__signin,
  .cw-mkt-nav__links a,
  .cw-mkt-footer__col a,
  .cw-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* The contents list keeps its flex row (number, then title). */
  .cw-docs-toc a {
    min-height: 44px;
    align-items: center;
  }

  .cw-mkt-nav__links a {
    padding-bottom: 0;
    border-bottom: 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 5px;
  }

  /* "Docs" is 41px of text; the box under the thumb is not. The others in
     the row clear 44px on their own, and this only began to matter once the
     row stopped being display:none and a thumb could reach it at all. */
  .cw-mkt-nav__links a {
    min-width: 44px;
    justify-content: center;
  }

  .cw-mkt-footer__col ul {
    gap: 0;
  }

  /* "Demo" is 35px of text; the box under the thumb is not. */
  .cw-mkt-footer__col a {
    min-width: 44px;
  }

  .cw-chip,
  .cw-filtertab,
  .cw-filtermenu__trigger,
  .cw-filtermenu__option {
    min-height: 44px;
  }

  .cw-link-btn {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
  }

  /* 16px is not a taste: below it, iOS Safari zooms the page in when the
     field takes focus and never zooms back out. Being 44px tall does not
     exempt a field from that, which is why the height and the size are set
     together here. The mono fields are named explicitly rather than left to
     source order, so moving this block cannot quietly undo them. */
  .cw-input,
  .cw-select {
    min-height: 44px;
    font-size: 16px;
  }

  .cw-input--mono,
  .cw-select--mono {
    font-size: 16px;
  }

  /* The header's organization switcher: a select and its no-JS button. */
  .cw-header__switch-select {
    min-height: 44px;
    font-size: 16px;
  }

  .cw-header__switch-go {
    min-width: 44px;
    min-height: 44px;
  }

  .cw-check-row {
    min-height: 44px;
  }

  /* The track stays 40 by 20; the button around it grows to the target. */
  .cw-switch-btn {
    padding: 12px 2px;
  }

  .cw-modal__close {
    top: 4px;
    right: 6px;
    width: 44px;
    height: 44px;
  }

  .cw-extlink {
    min-width: 24px;
    min-height: 24px;
  }
}

/* ==========================================================================
   admin — the back office. The console's own pieces and nothing else: a
   title line, a figure strip, then panels of tables and facts lists. Every
   rule here is scoped to .cw-admin (the back office's <main>) or carries
   its own cw-admin / cw-ledger / cw-facts name.
   ========================================================================== */

/* ---- the title line (the shared .cw-pagehead) ---- */
.cw-admin__asof {
  white-space: nowrap;
}

.cw-admin .cw-matter__tags {
  margin: -6px 0 14px;
}

/* ---- the figure strip: one bordered row of label, figure and delta ---- */
.cw-ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0 0 14px;
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
  overflow: hidden;
}

/* Inside a panel the panel is the box. */
.cw-card .cw-ledger {
  margin: 0 -14px;
  border: 0;
  border-radius: 0;
}

/* Three figures in a panel are one row at every width: auto-fit's floor
   wrapped the third onto a line of its own in a half-width panel. */
.cw-card .cw-ledger:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cw-ledger__cell {
  min-width: 0;
  padding: 9px 14px 10px;
  /* The rule a cell draws is on its right and bottom and the strip clips
     the outermost ones, so a wrapped strip is ruled on every inner edge. */
  margin: 0 -1px -1px 0;
  border-right: var(--border-faint);
  border-bottom: var(--border-faint);
}

.cw-ledger__label {
  display: block;
  font-size: var(--type-label);
  color: var(--text-faint);
}

.cw-ledger__value {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: var(--weight-medium);
  line-height: 1.25;
  color: var(--text-display);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-ledger__sub {
  margin: 0;
  font-size: var(--type-caption);
  color: var(--text-muted);
  font-variant-numeric: lining-nums;
}

/* ---- the docket: what needs an operator ---- */

/* ---- panels ---- */
.cw-admin > .cw-card,
.cw-admin > .cw-empty,
.cw-admin-overview > .cw-card {
  margin-bottom: 14px;
}

/* A band inside one panel (the pulse's chart, under its strip) and the
   heading over it. */
.cw-admin__band {
  margin-top: 16px;
}

.cw-admin__subhead {
  margin: 0 0 6px;
  font-size: var(--type-caption);
  font-weight: var(--weight-heading);
  color: var(--text-muted);
}

/* What is under a flush panel's table keeps the panel's own top rule. */
.cw-admin .cw-card--flush .cw-table-scroll + .cw-card__note,
.cw-admin .cw-card--flush .cw-card__note + .cw-card__note {
  margin-top: 0;
  padding-top: 8px;
}

.cw-admin .cw-card--flush .cw-table-scroll + .cw-card__note {
  margin-top: 0;
  border-top: var(--border-faint);
}

.cw-admin .cw-card__note .is-bad {
  color: var(--status-bad);
  font-weight: var(--weight-heading);
}

/* Something the page cannot read (Redis, the Headroom proxy): a status mark
   and the sentence, where the table would have been. */
.cw-admin__down {
  display: flex;
  margin: 10px 0;
  white-space: normal;
}

/* The overview's machine row: the queues (2 parts) beside the switches and
   the sweeps (1 part). */
.cw-admin__row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.cw-admin__col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

/* A third of the page is narrow for a job name: it wraps before the panel
   scrolls. */
.cw-admin__col .cw-table td:first-child {
  overflow-wrap: anywhere;
}

.cw-admin__row > .cw-card {
  min-width: 0;
}

.cw-admin__panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

.cw-admin__panels > .cw-card {
  min-width: 0;
}

/* The overview's five small panels are of very different heights, so they
   are packed down columns rather than laid in rows with holes in them. */
.cw-admin__panels--packed {
  display: block;
  columns: 3 300px;
  column-gap: 14px;
  margin-bottom: 0;
}

.cw-admin__panels--packed > .cw-card {
  break-inside: avoid;
  margin-bottom: 14px;
}

/* A record's form (coupon, code, affiliate): one field a line, each label
   over its field, no wider than a field needs. */
.cw-admin__form {
  display: grid;
  gap: 6px;
  justify-items: start;
  max-width: 520px;
  margin: 0;
}

.cw-admin__form > .cw-input,
.cw-admin__form > .cw-select,
.cw-admin__form > .cw-flash {
  width: 100%;
}

/* Rails wraps an invalid field; the wrapper must not become the grid item. */
.cw-admin__form > .field_with_errors {
  display: contents;
}

.cw-admin__form .field_with_errors > .cw-input {
  width: 100%;
}

.cw-admin__form > .cw-label,
.cw-admin__form .field_with_errors > .cw-label {
  margin-top: 10px;
}

.cw-admin__form > .cw-label:first-child {
  margin-top: 0;
}

.cw-admin__form > .cw-btn {
  margin-top: 14px;
}

/* Two tables side by side inside one panel (the Headroom page). */
.cw-admin__pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 24px;
  margin-top: 14px;
}

.cw-admin__pair > * {
  min-width: 0;
}

/* Still drawn by the client statement (statements/show). */

.cw-si-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 860px) {
  .cw-si-actions {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  }

  .cw-si-actions::-webkit-scrollbar {
    display: none;
  }

  .cw-si-actions > * {
    flex: 0 0 auto;
  }
}

/* The pulse's own small tables (why the CI fixer stops). */
.cw-table--compact tbody td {
  padding: 6px 10px;
  font-size: var(--type-caption);
}

.cw-table--compact tbody td:first-child {
  padding-left: 0;
}

.cw-table--compact tbody td:last-child {
  padding-right: 0;
}

.cw-table--compact .cw-row-sub {
  font-family: var(--font-body);
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- kill switches as tags ---- */

/* ---- the sweeps list: the ones on time, folded behind a count ---- */
.cw-crons summary {
  padding: 7px 20px;
  font-size: var(--type-small);
  color: var(--text-link);
  cursor: pointer;
}

.cw-table-scroll + .cw-crons {
  border-top: var(--border-faint);
}

.cw-crons[open] summary {
  border-bottom: var(--border-faint);
}

/* ---- admin panel index ----
   Desktop does not need it: the panels are a scroll away. A phone gets
   them stacked a long way down, so the index appears there and stays put,
   as one swipeable line -- the same answer as the section nav. */
.cw-admin__index {
  display: none;
}

/* On a phone the docket's label wraps so its link stays on screen. */
@media (max-width: 560px) {
  .cw-admin [data-docket] .cw-badge {
    white-space: normal;
  }

  .cw-admin [data-docket] td {
    padding-left: 6px;
    padding-right: 6px;
  }
}

@media (max-width: 860px) {
  .cw-admin__index {
    display: flex;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 0 var(--space-4);
    position: sticky;
    top: 0;
    z-index: 3;
    margin-bottom: 14px;
    background: var(--surface-page);
    border-bottom: var(--border-faint);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  }

  .cw-admin__index::-webkit-scrollbar {
    display: none;
  }

  .cw-admin__index a {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: var(--type-small);
    color: var(--text-muted);
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }

  .cw-admin__index a:hover {
    color: var(--text-display);
  }
}

/* ---- facts: a label/value list (the money panel, the admin show pages) ---- */
.cw-facts {
  margin: 0;
}

.cw-facts__row {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: var(--border-faint);
}

.cw-facts__row:last-child {
  border-bottom: none;
}

.cw-facts dt {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--type-caption);
  /* Wrapped, never ellipsed: "Time to green (median)" cut to "Time to
     green (m…" no longer says what the figure is. */
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cw-facts dd {
  margin: 0;
  font-size: var(--type-body);
  text-align: left;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

/* Span evidence: a fact whose value is a query, not a number. The default
   row puts the value in its own column, which is right for "Attempts: 3"
   and unreadable for eighty characters of SQL -- so stack the value under
   its label and let it run the full width of the card. */
.cw-facts--stacked .cw-facts__row {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.cw-facts--stacked dd {
  text-align: left;
  white-space: pre-wrap;
}

/* A list of figures: the label takes the room and the figure sits at the
   right edge, so a column of them lines up. */
.cw-facts--figures .cw-facts__row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.cw-facts--figures dd {
  text-align: right;
}

.cw-facts--figures + .cw-facts {
  border-top: var(--border-faint);
}

.cw-facts dt.cw-mono {
  font-family: var(--font-mono);
  color: var(--text-body);
}

.cw-facts__row.is-bad dd {
  color: var(--status-bad);
  font-weight: var(--weight-heading);
}

/* ---- fleet: the status mark rows ---- */
.cw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  white-space: normal;
}

/* ---- admin list and record pages ---- */
.cw-admin .cw-actions {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.cw-admin .cw-facts + .cw-actions {
  margin-top: 12px;
}

/* One charge on the invoice page: its id, state and amount on a line, the
   refund form under it. */
.cw-admin__charge {
  padding: 10px 0;
  border-bottom: var(--border-faint);
}

.cw-admin__charge:last-child {
  border-bottom: none;
}

.cw-admin__charge-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.cw-admin__charge-amount {
  margin-left: auto;
  color: var(--text-display);
}

/* A one-line form: label, control, button (a refund, a lifetime plan). */
.cw-admin__inline,
.cw-admin__refund {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.cw-admin__refund .cw-input,
.cw-admin__inline .cw-select {
  width: 200px;
  max-width: 100%;
}

.cw-admin .cw-card--flush .cw-table__caption {
  margin: 0;
  padding-top: 8px;
  border-top: var(--border-faint);
}

@media (max-width: 1100px) {
  .cw-admin__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .cw-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cw-ledger__value {
    font-size: var(--type-title);
  }
}

/* The sweeps fold and a table's one link are controls like any other (see
   the touch target block above), so on a phone or under a finger they grow
   to the minimum. */
@media (max-width: 560px), (pointer: coarse) {
  .cw-crons summary,
  .cw-admin .cw-table td > a:only-child,
  .cw-admin a.cw-panelhead__actions {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
  }

  .cw-crons summary {
    display: flex;
  }
}

/* ==========================================================================
   Proof: the live figures, on the home page as a three-up strip and on
   /proof as all six. The console's figure strip -- label, then the figure in
   mono -- at the public site's reading size.
   ========================================================================== */
.cw-proof-strip {
  padding-bottom: var(--space-8);
}

.cw-proof-strip__figures,
.cw-proof-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}

/* Label over figure, whichever the markup says first. */
.cw-proof-strip__figure,
.cw-proof-figures__item {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  padding: 14px 20px;
  border-right: var(--border-faint);
}

.cw-proof-figures__item {
  flex-direction: column;
  justify-content: flex-start;
}

.cw-proof-strip__figure:last-child,
.cw-proof-figures__item:nth-child(3n) {
  border-right: none;
}

.cw-proof-figures__item:nth-child(n + 4) {
  border-top: var(--border-faint);
}

.cw-proof-strip__label,
.cw-proof-figures dt {
  font-size: var(--type-caption);
  color: var(--text-muted);
}

.cw-proof-strip__value,
.cw-proof-figures__value {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: 26px;
  line-height: 1.2;
  color: var(--text-display);
  font-variant-numeric: lining-nums tabular-nums;
}

.cw-proof-strip__link {
  white-space: nowrap;
}

@media (max-width: 860px) {
  .cw-proof-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cw-proof-figures__item:nth-child(3n) {
    border-right: var(--border-faint);
  }

  .cw-proof-figures__item:nth-child(2n) {
    border-right: none;
  }

  .cw-proof-figures__item:nth-child(n + 3) {
    border-top: var(--border-faint);
  }
}

@media (max-width: 560px) {
  .cw-proof-strip__figures,
  .cw-proof-figures {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw-proof-strip__figure,
  .cw-proof-figures__item,
  .cw-proof-figures__item:nth-child(3n) {
    flex-direction: row-reverse;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-right: none;
    border-top: var(--border-faint);
  }

  .cw-proof-figures__item,
  .cw-proof-figures__item:nth-child(3n) {
    flex-direction: row;
  }

  .cw-proof-strip__figure:first-child,
  .cw-proof-figures__item:first-child {
    border-top: none;
  }

  .cw-proof-strip__value,
  .cw-proof-figures__value {
    font-size: 20px;
  }
}

/* ---- setup readiness (Repositories tab) ----
   The setup panel: one table row per BLOCKER, not per project -- a status
   mark, the sentence with the projects it is about, one action. What is
   ready is a count in the head. */
.cw-readiness__dismiss {
  flex: none;
}

/* Dismissed: the head alone. The panel still says what is outstanding; it
   has just stopped taking up the top of the tab. */
.cw-readiness--dismissed > .cw-panelhead {
  margin-bottom: 0;
}

.cw-readiness__group td {
  vertical-align: middle;
}

/* The projects the row is about: evidence under the sentence, not a list
   to act on one by one. */
.cw-readiness__projects {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.cw-readiness__project {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 12px;
}

/* README badge card (the repository page, and the Repositories tab right
   after an add). The badge itself is the example, shown before the snippet
   that makes it. */
.cw-readme__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

/* A choice is a touch target as well as an example: until the badge image
   arrives the label is only its radio, so it holds the 44px floor itself
   (test/system/responsive_layout_test.rb). */
.cw-readme__choices .cw-readme__example {
  align-items: center;
  min-width: 44px;
}

.cw-readme__example img {
  display: block;
  height: 20px;
  width: auto;
}

/* Wrapped rather than scrolled: the snippet is one long line and a person
   copying it by hand has to see all of it, phone included. */
.cw-readme__snippet {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: var(--surface-inset);
  border: var(--border-faint);
  border-radius: var(--radius-control);
  color: var(--text-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cw-readme__snippet code {
  font: inherit;
}

.cw-readme__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cw-readme__status {
  margin: 10px 0 0;
  font-size: var(--type-small);
  color: var(--text-muted);
}

/* ---- self-improvement docket (admin) ----
   One row per issue rather than per round, so the row has to carry five
   things at once: which issue, what state, how much budget is left, its
   pull request and when it last moved. A grid, because those columns have
   to line up down the docket for "three attempts and gave up" to be
   readable at a glance. The state is the shared status mark and the budget
   the shared attempt boxes. */
.cw-si-docket {
  margin: 0 -20px;
}

.cw-si-row {
  border-bottom: var(--border-faint);
}

.cw-si-row:last-child {
  border-bottom: 0;
}

/* The whole row is the disclosure control: an issue's rounds are what the
   panel is for, and a chevron-sized target for them would be a joke. The
   detail is the head's sibling in a block, never beside it. */
.cw-si-row__head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 120px 140px 180px 92px;
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 7px 20px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.cw-si-row__head:hover,
.cw-si-row__head[aria-expanded='true'] {
  background: var(--surface-inset);
}

.cw-si-row__number {
  color: var(--text-muted);
}

.cw-si-row__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cw-si-row__title {
  color: var(--text-display);
  font-weight: var(--weight-medium);
  line-height: 1.35;
}

/* Bucket, backlog and the last round's reason, in one line of small print:
   the reason is the single most useful thing on a failed row, and clamping
   it here is deliberate -- the unclamped copy is one click away, under
   Rounds. */
.cw-si-row__note {
  display: flex;
  gap: 2px 10px;
  font-size: var(--type-caption);
  overflow: hidden;
  white-space: nowrap;
}

.cw-si-row__note > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-si-row__budget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-si-row__rounds,
.cw-si-row__when {
  font-size: var(--type-caption);
}

.cw-si-row__when {
  text-align: right;
}

.cw-si-detail {
  padding: 8px 20px 12px 88px;
  border-top: var(--border-faint);
}

.cw-si-detail__heading {
  margin: 0;
  font-size: var(--type-caption);
  font-weight: var(--weight-heading);
  color: var(--text-muted);
}

.cw-si-rounds {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.cw-si-round {
  display: grid;
  grid-template-columns: 22px 172px minmax(0, 1fr) 92px;
  align-items: start;
  gap: 12px;
  padding: 6px 0;
  border-bottom: var(--border-faint);
}

.cw-si-round__ordinal {
  color: var(--text-faint);
}

.cw-si-round__outcome {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cw-si-round__when {
  font-size: var(--type-caption);
  text-align: right;
}

.cw-si-budget {
  margin: 8px 0;
  font-size: var(--type-caption);
}

.cw-si-footnote {
  margin: 10px 0 0;
  font-size: var(--type-caption);
}

/* A phone has no room for six columns: the row stacks, and the state,
   budget and pull request sit under the title rather than beside it. */
@media (max-width: 860px) {
  .cw-si-row__head {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 10px 20px;
  }

  .cw-si-row__body {
    grid-column: 2 / -1;
  }

  .cw-si-row__state,
  .cw-si-row__budget,
  .cw-si-row__pr {
    grid-column: 2 / -1;
  }

  .cw-si-row__when {
    grid-column: 3;
    grid-row: 1;
  }

  .cw-si-row__note {
    flex-wrap: wrap;
    white-space: normal;
  }

  .cw-si-detail {
    padding-left: 20px;
  }

  .cw-si-round {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  /* Everything but the ordinal stacks beside it, never under it. */
  .cw-si-round > :not(.cw-si-round__ordinal) {
    grid-column: 2;
  }

  .cw-si-round__when {
    text-align: left;
  }
}

/* ---- changelog: one panel per week ---------------------------------------
   The page ships a week at a time, so a week is a panel whose head carries
   the week and its count, and each entry below it is a row: what changed,
   what kind of change it was, when it merged, and the pull request that did
   it. The title is the only elastic column, since it is the only part worth
   reading in full. */
.cw-changelog__week + .cw-changelog__week {
  margin-top: 14px;
}

.cw-changelog__week-head {
  justify-content: space-between;
}

.cw-changelog__count {
  white-space: nowrap;
}

.cw-changelog__entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cw-changelog__entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 128px 60px;
  gap: var(--space-5);
  align-items: baseline;
  padding: 8px 0;
  border-bottom: var(--border-faint);
}

.cw-changelog__entry:last-child {
  border-bottom: none;
}

.cw-changelog__title {
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-display);
}

.cw-changelog__refined {
  font-size: 12px;
  color: var(--text-faint);
}

.cw-changelog__bucket {
  justify-self: start;
}

.cw-changelog__date {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cw-changelog__pr {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* A week's subheadings: New, Fixed, Site & docs. */
.cw-changelog__section {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.cw-changelog__entries + .cw-changelog__section {
  margin-top: var(--space-4);
}

/* On a phone the four columns cannot hold: the title takes the full width
   and its three facts sit under it as one line, the pull request pushed to
   the right edge where a thumb expects it. */
@media (max-width: 720px) {
  .cw-changelog__entry {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: var(--space-2) var(--space-3);
  }

  .cw-changelog__title {
    grid-column: 1 / -1;
  }

  .cw-changelog__date {
    justify-self: start;
  }
}

/* ---- Overview tab ---- */
/* The window line (on the page's title line), the week's figure strip, then the work (2 parts: what
   needs a person, the loops) beside the log (1 part). */
.cw-overview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cw-overview__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0;
  font-size: var(--type-small);
  color: var(--text-muted);
}
.cw-overview__asof {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--text-faint);
}
.cw-overview__week-link {
  white-space: nowrap;
  text-decoration: none;
}
/* The figure strip: one bordered row. */
.cw-overview__week {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}
.cw-overview__week .cw-stat {
  padding: 9px 14px 10px;
}
.cw-overview__week .cw-stat__value {
  font-size: 20px;
  font-weight: var(--weight-medium);
  color: var(--text-display);
}
.cw-overview__row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.cw-overview__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
/* A panel head here sits straight on its table or log. */
.cw-overview .cw-panelhead {
  margin-bottom: 4px;
}
.cw-overview .cw-panelhead__actions {
  text-decoration: none;
}
.cw-overview .cw-card--flush {
  padding-bottom: 4px;
}
.cw-overview__count {
  display: inline-block;
  min-width: 2ch;
  margin-right: 6px;
  font-weight: var(--weight-medium);
}
.cw-overview__need .cw-badge {
  margin-right: 6px;
}
.cw-overview__whose {
  font-size: var(--type-caption);
  color: var(--text-muted);
}
.cw-overview__item .cw-row-sub {
  overflow-wrap: anywhere;
}
/* One row is the link, one line of title and at most two of reason; the
   whole text is the cell's `title`. An exception message or a model's
   paragraph unclamped made each row a page. */
.cw-overview__title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cw-overview__reason {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
@media (min-width: 561px) {
  /* `max-width: 0` lets a percentage column clip instead of widening the
     table to its longest line. */
  .cw-overview__item td.is-elastic {
    max-width: 0;
    width: 38%;
  }
  /* The reason is the column a person reads; it takes the larger share. */
  .cw-overview__item td.is-elastic + td.is-elastic {
    width: 62%;
  }
  .cw-overview__item td.is-elastic > a {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
/* The grouped counts under the table: each links to its own list. */
.cw-overview__groups {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin: 0;
  padding: 8px 0 6px;
  border-top: var(--border-faint);
  font-size: var(--type-small);
  color: var(--text-muted);
}
.cw-overview__groups a {
  text-decoration: none;
}
.cw-overview__error {
  margin: 0 0 8px;
  font-size: var(--type-small);
  color: var(--status-bad);
}
/* Nothing waiting: one quiet line where the panel would be. */
.cw-overview__clear,
.cw-overview__none {
  margin: 0;
  font-size: var(--type-small);
}
.cw-overview__none {
  padding-top: 8px;
}
.cw-loop__turn-on {
  margin-left: 10px;
}
.cw-loop__last .cw-mono {
  margin-right: 6px;
}
.cw-loop__last a {
  margin-left: 6px;
}
/* The wide table gives its slack to the last event, not to the counts. */
@media (min-width: 561px) {
  .cw-overview td.cw-loop__last {
    width: 100%;
  }
}
/* Both prose cells may break anywhere, so auto layout would squeeze the
   item to a column of syllables; the reason takes what is left. Only where
   the panel has the width: narrower, a floor pushes the action out of
   sight behind a scrollbar. */
@media (min-width: 1101px) {
  .cw-overview__item td:first-child {
    min-width: 22ch;
  }
}
.cw-loop__last--failed {
  color: var(--status-bad);
}
.cw-overview__lately .cw-log {
  margin-top: 4px;
}
.cw-overview__lately .cw-log__time {
  min-width: 4ch;
}
/* Two lines an event at most; the rest is its `title`. */
.cw-overview__lately .cw-log__text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.cw-overview__lately .cw-log a {
  text-decoration: none;
}
/* Vue drops the whitespace between the verb, the link and the title. */
.cw-overview__lately .cw-log__text > * + * {
  margin-left: 1ch;
}
@media (max-width: 1100px) {
  .cw-overview__row {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .cw-overview__week {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cw-overview__week .cw-stat {
    border-right: none;
    border-bottom: var(--border-faint);
  }
  .cw-overview__week .cw-stat:last-child {
    border-bottom: none;
  }
  .cw-overview .cw-card--flush {
    padding-bottom: 0;
  }
}

/* ==========================================================================
   Blog (cw-blog-*). /blog and /blog/<slug>, the articles HeyCatch writes.
   The index is one panel with a row per article; an article is one column
   at the reading measure. The article body is HeyCatch's own markup, which
   carries no classes, so it is styled by element inside
   .cw-blog-article__body; the one piece of ours in it is the table of
   contents.
   ========================================================================== */
.cw-blog-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Title, then date and read time. The title's link is stretched over the
   whole row so the row is the target, not the words. */
.cw-blog-index__entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-5);
  align-items: baseline;
  padding: 12px 0;
  border-bottom: var(--border-faint);
}

.cw-blog-index__entry:last-child {
  padding-bottom: 4px;
  border-bottom: none;
}

.cw-blog-index__title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-display);
  text-decoration: none;
}

.cw-blog-index__title::after {
  content: '';
  position: absolute;
  inset: 0;
}

.cw-blog-index__entry:hover .cw-blog-index__title {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cw-blog-index__meta {
  display: flex;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cw-blog-article {
  max-width: calc(var(--content-measure) + 4ch);
  padding-bottom: var(--space-8);
}

.cw-blog-article__back {
  margin: 0 0 10px;
  font-size: var(--type-caption);
}

.cw-blog-article__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.cw-blog-article__body {
  padding-top: var(--space-6);
  font-size: var(--type-body);
  line-height: 1.65;
  color: var(--text-body);
}

.cw-blog-article__body h2 {
  font-size: var(--type-title);
  line-height: var(--leading-tight);
  margin: var(--space-7) 0 14px;
}

.cw-blog-article__body > h2:first-child {
  margin-top: 0;
}

.cw-blog-article__body h3 {
  font-size: var(--type-heading);
  margin: 28px 0 8px;
}

.cw-blog-article__body p,
.cw-blog-article__body ul,
.cw-blog-article__body ol,
.cw-blog-article__body blockquote {
  margin: 0 0 14px;
}

.cw-blog-article__body ul,
.cw-blog-article__body ol {
  padding-left: 22px;
}

.cw-blog-article__body li {
  margin-bottom: 6px;
}

.cw-blog-article__body blockquote {
  padding: 12px 16px;
  background: var(--surface-inset);
  border-radius: var(--radius-panel);
}

.cw-blog-article__body blockquote > :last-child {
  margin-bottom: 0;
}

.cw-blog-article__body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px 4px;
  background: var(--surface-inset);
  border-radius: 3px;
}

.cw-blog-article__body pre {
  margin: 0 0 14px;
  padding: 12px 16px;
  background: var(--surface-inset);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
  overflow-x: auto;
}

.cw-blog-article__body pre code {
  padding: 0;
  background: none;
}

/* The console table's look on bare markup; wide tables scroll on their own
   rather than widening the page. */
.cw-blog-article__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0 20px;
  border-collapse: collapse;
}

.cw-blog-article__body th {
  text-align: left;
  padding: 8px 14px;
  font-size: var(--type-label);
  font-weight: var(--weight-medium);
  color: var(--text-faint);
  border-bottom: var(--border-hairline);
}

.cw-blog-article__body td {
  padding: 10px 14px;
  border-bottom: var(--border-faint);
  font-size: var(--type-small);
  vertical-align: top;
}

.cw-blog-toc {
  margin: var(--space-6) 0;
  padding: 14px 20px;
  background: var(--surface-card);
  border: var(--border-faint);
  border-radius: var(--radius-panel);
}

.cw-blog-article__body .cw-blog-toc h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.cw-blog-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cw-blog-toc li {
  margin: 0;
}

.cw-blog-toc a {
  display: block;
  padding: 4px 0;
  font-size: var(--type-small);
  text-decoration: none;
}

.cw-blog-toc a:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .cw-blog-index__entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .cw-blog-article__body h2 {
    font-size: var(--type-heading);
  }
}

.cw-blog-article .cw-exhibits__caption {
  text-align: left;
}

/* ---- the client statement (/statement) ----
   A document people also print: the title line with the month links and the
   CSV, the figures as one strip, then tables. */
.cw-statement__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.cw-statement__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-left: auto;
}

.cw-statement__nav a:not(.cw-btn) {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
}

/* The figures: one row that wraps to as many as fit, on paper too. */
.cw-statement__figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.cw-statement .cw-stat,
.cw-statement .cw-stat:first-child {
  flex: 1 1 110px;
  padding: 0;
  border: 0;
}

.cw-statement .cw-stat__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: var(--weight-medium);
}

.cw-statement .cw-stat__delta {
  font-family: var(--font-mono);
}

/* On paper the statement is the page: no top bar, no section nav, no footer,
   no month links, and a table prints whole instead of scrolling. */
@media print {
  body:has(.cw-statement) {
    background: var(--surface-card);
  }

  body:has(.cw-statement) .cw-header,
  body:has(.cw-statement) .cw-subnav,
  body:has(.cw-statement) .cw-footer,
  body:has(.cw-statement) .cw-frame-banner,
  .cw-statement__nav {
    display: none;
  }

  body:has(.cw-statement) .cw-frame {
    display: block;
  }

  .cw-statement .cw-table-scroll {
    overflow: visible;
  }

  /* A row never splits over two sheets, and a head stays with its table. */
  .cw-statement tr,
  .cw-statement__figures {
    break-inside: avoid;
  }

  .cw-statement .cw-panelhead {
    break-after: avoid;
  }

  .cw-statement .cw-main {
    padding: 0;
    border: 0;
  }
}

/* ---- organization pages: the panel ----
   Members, Settings, Billing and the Statement are flush cards under the
   shared .cw-panelhead: a table that bleeds to the card's edges, setting
   rows, or a form. */
.cw-pane {
  margin-bottom: 14px;
}

.cw-pane > .cw-panelhead:last-child {
  margin-bottom: 0;
}

.cw-pane .cw-panelhead__actions form {
  margin: 0;
}

.cw-panelhead__actions.cw-inline-add {
  margin-left: auto;
  justify-content: flex-end;
}

/* Beside a panel's heading: one muted line saying whose it is or where its
   documentation lives. */
.cw-pane__aside {
  font-size: var(--type-caption);
  color: var(--text-muted);
}

/* The form under a panel's table (create a token, add a webhook). */
.cw-pane__foot {
  padding-top: 10px;
  border-top: 1px solid var(--rule-faint);
}

/* One line under a head or a table: an empty list, an upgrade pointer, a
   state worth a sentence. */
.cw-pane__note {
  margin: 6px 0 0;
  font-size: var(--type-small);
  color: var(--text-muted);
}

.cw-pane .cw-table tbody tr:hover {
  background: var(--surface-inset);
}

/* A table whose rows carry controls (the members' role pickers): every cell
   on the control's centre line rather than the cell's top. */
.cw-table--controls tbody td {
  vertical-align: middle;
}

/* A row's own detail under it (a webhook's recent deliveries): the two read
   as one row, so the first drops its rule and the second its top padding. */
.cw-table tbody tr.has-subrow td {
  border-bottom: 0;
}

.cw-table tbody tr.cw-subrow td {
  padding-top: 0;
}

.cw-subrow .cw-log__line {
  align-items: center;
}

.cw-subrow .cw-link-btn {
  white-space: nowrap;
}

/* One tbody per webhook: the rule the last row of each drops comes back
   above the next one. */
.cw-pane .cw-table tbody + tbody tr:first-child td {
  border-top: 1px solid var(--rule-faint);
}

@media (max-width: 560px) {
  .cw-pane .cw-table.cw-table--stack tbody tr.has-subrow {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .cw-pane .cw-table.cw-table--stack tbody tr.cw-subrow td {
    padding-left: 0;
  }

  .cw-subrow .cw-log__line {
    flex-wrap: wrap;
    gap: 0 10px;
  }
}

/* ---- one organization setting: a row -- its name, one short line, and
   the control on the right ---- */
.cw-setting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-faint);
}

.cw-setting-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cw-setting-row__text {
  flex: 1 1 260px;
  min-width: 0;
}

.cw-setting-row__label {
  display: block;
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  color: var(--text-display);
}

.cw-setting-row__note {
  display: block;
  font-size: var(--type-caption);
  color: var(--text-muted);
}

.cw-setting-row__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.cw-setting-row__control .cw-select,
.cw-setting-row__control .cw-input {
  width: auto;
  min-width: 210px;
}

/* A compact form on one line (add a member, a client, a token, a webhook):
   its labels are for a screen reader, the placeholders say what goes where. */
.cw-inline-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.cw-inline-add .cw-input,
.cw-inline-add .cw-select {
  flex: 0 1 170px;
  width: 170px;
  min-width: 0;
}

.cw-inline-add .cw-inline-add__wide {
  flex: 1 1 260px;
  max-width: 460px;
}

/* The same form as a setting row's control: it takes the room the row has
   and keeps its fields against the right edge. */
.cw-setting-row__control.cw-inline-add {
  flex: 1 1 420px;
  justify-content: flex-end;
}

.cw-pane .cw-table td .cw-link-btn + .cw-link-btn {
  margin-left: 12px;
}

.cw-inline-add__checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cw-inline-add__checks > legend {
  float: left;
  padding: 0;
  margin-right: 14px;
  color: var(--text-muted);
}

.cw-inline-add__checks .cw-check-row {
  gap: 6px;
}

/* On a phone the form is a column: each field the full width, in the
   panel head too. Here, after the rules it overrides. */
@media (max-width: 560px) {
  .cw-inline-add .cw-input,
  .cw-inline-add .cw-select,
  .cw-inline-add .cw-inline-add__wide {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }

  .cw-panelhead__actions.cw-inline-add,
  .cw-setting-row__control.cw-inline-add {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

/* A secret shown once (a new API token, a webhook's signing secret): a box
   of its own, the warning in bold above the value, which selects whole. */
.cw-secret {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--status-good);
  border-radius: var(--radius-control);
  background: var(--status-good-bg);
  color: var(--text-display);
}

.cw-secret__label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--type-body);
  font-weight: var(--weight-heading);
}

.cw-secret__value {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--type-body);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---- proof strip texture: the weekly merges chart and the live count ---- */
.cw-proof-strip__chart {
  margin-top: 14px;
}

.cw-proof-strip__watching {
  margin: 12px 0 0;
  font-size: var(--type-caption);
  color: var(--text-muted);
}

.cw-proof-strip__watching + .cw-exhibits__caption {
  margin-top: 4px;
}

.cw-retainers__payments {
  margin: 0;
  font-size: var(--type-small);
}

/* ---- customer quotes on the home page (pages/_quotes) ---- */
.cw-quotes__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6) var(--space-7);
  margin-top: 14px;
}

.cw-quotes__item {
  margin: 0;
}

.cw-quotes__text {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-body);
}

.cw-quotes__item figcaption,
.cw-listed {
  font-size: var(--type-caption);
  color: var(--text-muted);
}

.cw-listed {
  margin: 12px 0 0;
}

/* ---- repositories tab ---- */
/* The repositories panel's filters, in its head. */
.cw-repos__filter {
  flex: 0 1 220px;
  width: auto;
}

.cw-repos__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* Never a box inside a panel: an empty state here is a line of text. */
.cw-repos .cw-card > .cw-empty,
.cw-repo-page .cw-card > .cw-empty {
  padding: 12px 0 0;
  border: 0;
  text-align: left;
}

.cw-repos {
  display: grid;
  gap: 14px;
}

.cw-repos > * {
  min-width: 0;
}

.cw-repos__table td {
  line-height: 18px;
  white-space: nowrap;
}

/* The name takes whatever width the other columns leave, and a name
   longer than that wraps rather than being cut or pushing the loop
   columns out of the panel; the head's floor is how narrow it may get. */
.cw-repos__table th.cw-repos__name {
  min-width: 180px;
}

.cw-repos__table td.cw-repos__name {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Every other column is as wide as what it holds, so the slack is the
   name's. Wide layout only: stacked, a cell is a line of its own. */
@media (min-width: 561px) {
  .cw-repos__table:not(.cw-repos__accounts) th:not(.cw-repos__name),
  .cw-repos__table:not(.cw-repos__accounts) td:not(.cw-repos__name) {
    width: 1%;
  }
}

/* One Sentry project per line: `account / project → subdir`. */
.cw-repos__project {
  display: block;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-repos__error {
  display: block;
  max-width: 44ch;
  margin-top: 2px;
  font-size: 12px;
  color: var(--status-bad);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The accounts table shares its width out by content, so an account's
   own actions keep one line while there is room and wrap, still in view,
   when there is not. */
.cw-repos__accounts td.is-remainder,
.cw-repos__accounts th.is-remainder {
  width: auto;
}

.cw-repos__actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

/* A Sentry account's projects set aside as never having a repository, on
   their own line under it, each with its undo. */
.cw-repos__ignored {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: normal;
}

.cw-repos__ignored-project {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-left: 8px;
  white-space: nowrap;
}

/* "Add a repository": three questions down a column. An answered one folds
   to its answer on one line; one not yet open is faint. */
.cw-add-steps {
  display: grid;
}

.cw-add-step {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--rule-faint);
}

.cw-add-step:first-child {
  padding-top: 0;
  border-top: 0;
}

.cw-add-step:last-child {
  padding-bottom: 0;
}

.cw-add-step--waiting .cw-label {
  color: var(--text-faint);
}

.cw-add-step__num {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
}

.cw-add-step__body {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
}

.cw-add-step--done .cw-add-step__body,
.cw-add-step--waiting .cw-add-step__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}

.cw-add-step__answer {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}

.cw-add-step__body > .cw-select {
  width: min(100%, 420px);
}

.cw-add-step__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cw-add-step__note {
  margin: 0;
  font-size: var(--type-small);
  color: var(--text-muted);
}

.cw-add-pick {
  display: grid;
  gap: 6px;
}

.cw-add-pick__group {
  margin-top: 4px;
  color: var(--text-faint);
}

.cw-add-switch--sub {
  margin-left: 25px;
}

/* The repository page. "Link another Sentry project" in its panel's head. */
.cw-repo-page__link .cw-select {
  width: auto;
  max-width: 260px;
}

.cw-repo-page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
}

.cw-repo-page .cw-repo-page__title {
  max-width: none;
  margin: 0;
  font-size: var(--type-title);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cw-repo-page .cw-repo-page__grid,
.cw-repo-page .cw-matter__col {
  gap: 14px;
}

.cw-repo-page .cw-repo-page__grid {
  margin-top: 14px;
}

/* A panel may be narrower than the table scrolling inside it. */
.cw-repo-page .cw-matter__col > * {
  min-width: 0;
}

/* Nothing for the right column to say (no history, no lessons, a README
   that already wears the badge): the work takes the whole width. */
.cw-repo-page__grid:not(:has(> .cw-matter__col:last-child > *)) {
  grid-template-columns: minmax(0, 1fr);
}

.cw-repo-page__lessons {
  margin: 0;
  font-size: var(--type-small);
}

.cw-repo-page__summary {
  max-width: 78ch;
  margin: 8px 0 0;
  font-size: var(--type-body);
  line-height: 1.5;
  color: var(--text-body);
}

/* Its Sentry projects: one labelled form per project, a rule between two. */
.cw-repo-project + .cw-repo-project {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-faint);
}

.cw-repo-project__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cw-repo-project__name {
  margin: 0;
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  color: var(--text-display);
  overflow-wrap: anywhere;
}

.cw-repo-project__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px 24px;
}

.cw-repo-project__wide {
  grid-column: 1 / -1;
  padding: 0;
}

.cw-repo-project__fields .cw-label {
  color: var(--text-display);
}

.cw-repo-project__fields textarea {
  resize: vertical;
}

/* Removing the repository: last on the page and apart from the rest. */
.cw-repo-page__danger {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 28px;
}

.cw-repo-page__danger-note {
  margin: 2px 0 0;
  font-size: var(--type-small);
  color: var(--text-muted);
}

@media (max-width: 860px) {
  /* Six columns and three buttons do not fit a tablet on one line each:
     the words wrap so the actions stay in view. */
  .cw-repos__accounts td {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .cw-repos__filter,
  .cw-repo-page__link {
    flex-basis: 100%;
  }

  .cw-repo-page__link {
    flex-wrap: nowrap;
    min-width: 0;
  }

  .cw-repo-page__link .cw-select {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .cw-repo-project__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A stacked row: a cell with no label (a project's fields, the row's
     action) takes the whole line. */
  .cw-repos
    .cw-card--flush
    .cw-table.cw-table--stack
    tbody
    td:not([data-label]),
  .cw-repo-page
    .cw-card--flush
    .cw-table.cw-table--stack
    tbody
    td:not([data-label]) {
    padding-left: 0;
  }

  .cw-repos__table td,
  .cw-repos__table td.cw-repos__name,
  .cw-repos__project {
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .cw-repos__actions {
    justify-content: flex-start;
  }
}

/* ---- billing page ---- */
/* The plan in one row: each fact a small label over its value. */
.cw-factrow {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

.cw-factrow__item {
  min-width: 0;
  padding: 2px 22px 2px 14px;
  border-right: 1px solid var(--rule-faint);
}

.cw-factrow__item:first-child {
  padding-left: 0;
}

.cw-factrow__item:last-child {
  border-right: 0;
}

.cw-factrow dt {
  margin-bottom: 2px;
  font-size: var(--type-label);
  font-weight: var(--weight-medium);
  color: var(--text-faint);
}

.cw-factrow dd {
  margin: 0;
  font-size: var(--type-body);
  color: var(--text-body);
}

/* The plans, compared: a row per feature, a column per plan, and the two
   prices with their buttons as the last rows. */
.cw-plans th[scope='row'] {
  text-align: left;
  font-weight: var(--weight-body);
  color: var(--text-body);
}

.cw-plans thead th {
  vertical-align: bottom;
}

.cw-plans thead th:not(:first-child),
.cw-plans tbody td {
  width: 24%;
  min-width: 150px;
}

.cw-plans tbody th,
.cw-plans tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule-faint);
  font-size: var(--type-small);
  vertical-align: middle;
}

.cw-plans tbody tr:last-child th {
  border-bottom: 0;
}

.cw-plans__name {
  display: block;
  font-size: var(--type-body);
  font-weight: var(--weight-heading);
  color: var(--text-display);
}

/* The plan a visitor picked on the pricing page, carried here as ?plan=. */
.cw-plans .is-featured {
  background: var(--surface-selected);
}

.cw-plans__price {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  color: var(--text-display);
}

.cw-plans form {
  margin: 0;
}

.cw-plans .cw-btn {
  height: auto;
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.3;
  white-space: normal;
  text-align: center;
}

.cw-billing-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

/* A refused save: the reason under the field it is about, which also
   carries aria-invalid. A word and a border, not colour alone. */
.cw-field__error {
  margin: 0;
  font-size: var(--type-caption);
  font-weight: var(--weight-medium);
  color: var(--status-bad);
}

.cw-billing-form [aria-invalid='true'] {
  border-color: var(--status-bad);
}

.cw-billing-form {
  align-items: start;
}

.cw-billing-form__wide {
  grid-column: span 2;
}

.cw-billing-form__submit {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .cw-billing-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .cw-billing-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .cw-billing-form__wide {
    grid-column: auto;
  }

  .cw-factrow__item {
    flex: 1 1 100%;
    padding-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule-faint);
  }

  .cw-factrow__item:last-child {
    border-bottom: 0;
  }

  /* Three plans beside their features in a phone's width: the columns give
     up their floor and a button's label wraps. */
  .cw-plans thead th:not(:first-child),
  .cw-plans tbody td {
    width: auto;
    min-width: 0;
  }

  .cw-plans thead th,
  .cw-plans tbody th,
  .cw-plans tbody td {
    padding-left: 5px;
    padding-right: 5px;
    white-space: normal;
  }

  .cw-plans .cw-btn {
    padding-left: 6px;
    padding-right: 6px;
  }

  .cw-plans .cw-badge {
    white-space: normal;
  }
}

/* A sans headline runs wider than the serif it replaced: on a phone the
   hero steps down so the first action stays on the first screen
   (ResponsiveLayoutTest holds it under 600px at 375px). */
@media (max-width: 560px) {
  .cw-mkt {
    --type-display-1: 30px;
  }

  .cw-hero__lead {
    font-size: 16px;
    line-height: 1.5;
    margin: 14px 0 0;
  }

  .cw-hero__actions {
    margin-top: 20px;
  }
}
