/* Pipelinica: the legacy app's look (SB Admin 2: blue gradient sidebar, Nunito, white cards on
   #f8f9fc, legacy's blue), quieter: smaller text, lighter weights, muted state colours. Tokens,
   components and rules: .claude/skills/web-ui/SKILL.md.
   No inline styles anywhere (CSP style-src 'self'); url() paths are relative to this file. */

/* Fonts: self-hosted (CSP), OFL (fonts/OFL.txt). A new version gets a new file name. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(fonts/nunito-latin-5.3.0.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(fonts/nunito-latin-ext-5.3.0.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Legacy's wordmark face (Overpass 800), only the letters of "Pipelinica". */
@font-face {
  font-family: "Pipelinica Wordmark";
  font-weight: 800;
  font-display: block;
  src: url(fonts/overpass-800-wordmark-5.3.0.woff2) format("woff2");
}

:root {
  /* Blues: legacy's #4e73df, a step darker where white text or small blue text must pass WCAG
     AA (4.5:1). */
  --blue: #4e73df;          /* brand: focus rings, accents */
  --blue-rail: #4a6fdc;     /* sidebar top (white text 4.6:1) */
  --blue-deep: #224abe;     /* sidebar bottom */
  --action-fill: #4a6fdc;   /* primary buttons, chosen pills, the current step (white text 4.6:1) */
  --action: #3d62d6;        /* links, card titles: blue text, 5.4:1 on white, 5.1:1 on the page */
  --action-hover: #2e59d9;
  --action-tint: #eef2fd;   /* selected tile, avatar */
  /* Surfaces and text: legacy greys, one step darker for running text. */
  --page: #f8f9fc;
  --surface: #fff;
  --border: #e3e6f0;
  --border-strong: #d1d3e2;
  --control-border: #8c8fa1; /* a field's edge: 3.2:1 */
  --text: #5a5c69;          /* 6.6:1 (legacy's #858796 was 3.6:1) */
  --text-strong: #3a3b45;
  --muted: #6e707e;         /* 4.9:1 */
  /* States: legacy's green, red, yellow, grey, muted; as pills they pass AA. */
  --ok: #3a9a76;            /* marks: 3.5:1 */
  --ok-bg: #e1f2ea;
  --ok-fg: #1f6a50;
  --error: #d2604f;         /* marks: 3.8:1 */
  --error-bg: #f8e5e2;
  --error-fg: #8a3328;
  --danger: #b84a3e;
  --danger-hover: #a03f34;
  --warn-bg: #fdf3d8;
  --warn-fg: #806520;
  --info-bg: #e3eafb;
  --info-fg: #224abe;
  --off-bg: #eaecf4;
  --off-fg: #5a5c69;
  --none: #dddfeb;
  /* Shape and depth. */
  --radius: .5rem;
  --radius-sm: .375rem;
  --shadow: 0 1px 2px rgba(58, 59, 69, .05), 0 2px 10px rgba(58, 59, 69, .05);
  --ring: 0 0 0 .2rem rgba(78, 115, 223, .3);
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar: 14rem;
  --pad: 1.5rem;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { color: var(--text-strong); line-height: 1.25; margin: 0 0 .75rem; text-wrap: balance; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.0625rem; font-weight: 600; }
p { margin: 0 0 1rem; text-wrap: pretty; }
a { color: var(--action); text-decoration: none; }
a:hover { color: var(--action-hover); text-decoration: underline; text-underline-offset: .15em; }
p a, dd a, li a { text-decoration: underline; text-underline-offset: .15em; }
small { color: var(--muted); font-size: .8125rem; }
strong { font-weight: 600; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: #c9d6f7; color: var(--text-strong); }
.icon { width: 1.125rem; height: 1.125rem; flex: none; }

.skip {
  position: absolute;
  top: .5rem;
  left: .5rem;
  z-index: 10;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--action);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Shell: sidebar left, topbar and page right (legacy's layout). */
body.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "side top" "side main";
  min-height: 100vh;
}
.sidebar {
  grid-area: side;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0 .75rem 1.5rem;
  background: linear-gradient(180deg, var(--blue-rail) 10%, var(--blue-deep) 100%);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: inherit;
  text-decoration: none;
}
.brand:hover { color: inherit; text-decoration: none; }
.brand .icon { width: 2rem; height: 2rem; }
.brand span {
  font-family: "Pipelinica Wordmark", var(--font);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .05em;
}
.sidebar .brand {
  justify-content: center;
  height: 4.375rem;
  margin: 0 .25rem .75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.sidebar nav { display: flex; flex-direction: column; gap: .125rem; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .875rem;
  border-radius: var(--radius);
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s;
}
.sidebar nav a .icon { opacity: .8; }
/* Hover and the current page darken the rail, never lighten it: white text keeps AA (5.4:1, 6.4:1). */
.sidebar nav a:hover { background: rgba(10, 20, 60, .12); }
.sidebar nav a[aria-current="page"] { background: rgba(10, 20, 60, .24); font-weight: 700; }
.sidebar nav a[aria-current="page"] .icon { opacity: 1; }
.sidebar hr { margin: .5rem .25rem; border-top-color: rgba(255, 255, 255, .16); }
.sidebar :focus-visible { outline-color: #fff; }
.sidebar .brand:focus-visible { outline-offset: -4px; } /* inside the rail's scroll box */
.foot { display: none; }

.topbar {
  grid-area: top;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem 1.25rem;
  min-height: 4.375rem;
  padding: .75rem var(--pad);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.topbar .switcher { margin-right: auto; }
.topbar .switcher select { max-width: 18rem; }

/* You, top right (legacy's picture and menu): a button that opens a popover. */
.topbar .me {
  margin-left: auto;
  gap: .6rem;
  padding: .25rem .6rem .25rem .25rem;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
}
.topbar .me:hover { border-color: transparent; background: var(--off-bg); }
.me > .icon { color: var(--muted); }
.me-name { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--action-tint);
  color: var(--action);
  font-size: .875rem;
  font-weight: 600;
}
/* The picture covers the initial; static/app.js removes one that cannot load (browsers draw a
   broken-image icon), so the initial shows. */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Two cards side by side on a wide page column (the profile's account and billing). */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.pair > .card { margin: 0; }
/* The profile's person: the picture large, the name and e-mail beside it. */
.person { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.5rem; }
.person .avatar { width: 4rem; height: 4rem; font-size: 1.5rem; }
.person p { display: grid; min-width: 0; margin: 0; }
.person strong { color: var(--text-strong); font-size: 1.0625rem; }
.person span { color: var(--muted); overflow-wrap: anywhere; }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 .375rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
}
/* The menu: in the top layer, under the button (anchor positioning; without it, top right). */
.menu {
  position: fixed;
  inset: auto;
  top: 4rem;
  right: var(--pad);
  width: max-content;
  min-width: 15rem;
  max-width: min(22rem, calc(100vw - 2rem));
  margin: 0;
  padding: .375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(31, 36, 48, .14), 0 2px 6px rgba(31, 36, 48, .06);
}
/* Without anchor positioning a phone's topbar sits under the nav band: the menu opens at the
   bottom instead of over the band and the button. */
@supports not (anchor-name: --me) {
  @media (max-width: 48rem) { .menu { top: auto; bottom: var(--pad); } }
}
@supports (anchor-name: --me) {
  .topbar .me { anchor-name: --me; }
  .menu { position-anchor: --me; top: calc(anchor(bottom) + .375rem); right: anchor(right); }
}
.menu-who { display: grid; margin: 0 0 .375rem; padding: .5rem .75rem .625rem; border-bottom: 1px solid var(--border); }
.menu-who strong { color: var(--text-strong); }
.menu-who span { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.menu a, .menu button {
  display: flex;
  justify-content: flex-start;
  gap: .6rem;
  width: 100%;
  min-height: 2.5rem;
  padding: .5rem .75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.menu a { align-items: center; }
.menu a:hover, .menu button:hover { background: var(--page); color: var(--text-strong); text-decoration: none; }
.menu .icon { width: 1rem; height: 1rem; color: var(--muted); }
.topbar .menu form { display: block; margin: .375rem 0 0; padding-top: .375rem; border-top: 1px solid var(--border); }

/* main is the container its tables and the wizard size against; long customer strings wrap. */
main { min-width: 0; padding: var(--pad); container-type: inline-size; overflow-wrap: anywhere; }
body.app > main { grid-area: main; }

/* Signed out: one card on legacy's blue gradient. */
body.public {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--blue-rail) 10%, var(--blue-deep) 100%);
}
body.public main {
  width: min(100%, 27rem);
  padding: 2.25rem 2rem 2rem;
  border-radius: .75rem;
  background: var(--surface);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .2);
  text-align: center;
}
body.public main .brand { justify-content: center; margin-bottom: 1.5rem; color: var(--action); }
body.public main p[role="alert"] { text-align: left; }

/* Page heading: title left, the page's main action right. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  min-height: 2.5rem; /* a button's height: the page below starts at one place, button or not */
  margin-bottom: 1.5rem;
}
.page-head h1 { margin: 0; }
.page-head form { margin: 0; }
.page-head .sub { flex-basis: 100%; margin: -.5rem 0 0; color: var(--muted); }

/* Cards: white on the page grey; a card's first h2 is its header. */
.card, .plan {
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child {
  margin: -1.25rem -1.25rem 1.25rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--action);
  font-size: .9375rem;
  font-weight: 600;
}
/* A table runs to the card's edges; its first and last cells keep the card's padding. */
.card > table { width: calc(100% + 2.5rem); margin: 0 -1.25rem 1.25rem; }
.card > table:first-child, .card > h2:first-child + table { margin-top: -1.25rem; }
.card > table:last-child { margin-bottom: -1.25rem; }
.notice-card { max-width: 36rem; margin-inline: auto; text-align: center; }
.notice-card > .icon { display: block; width: 3rem; height: 3rem; margin: .5rem auto 1rem; color: var(--action); }
.notice-card.danger > .icon { color: var(--danger); }
.notice-card.good > .icon { color: var(--ok); }
.notice-card h1 { font-size: 1.5rem; }
.notice-card .actions { justify-content: center; }
.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin: 0 0 1.25rem;
  color: var(--text-strong);
  font-weight: 500;
}
.facts > span:first-child { display: inline-flex; align-items: center; gap: .4rem; }
.facts .icon { color: var(--muted); }

/* Dashboard figures (legacy's KPI cards, without the side stripe). */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat > .icon {
  width: 2.75rem;
  height: 2.75rem;
  padding: .7rem;
  border-radius: var(--radius);
  background: var(--action-tint);
  color: var(--action);
}
.stat.ok > .icon { background: var(--ok-bg); color: var(--ok-fg); }
.stat.bad > .icon { background: var(--error-bg); color: var(--error-fg); }
.stat p { display: grid; margin: 0; }
.stat .label { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.stat .value { color: var(--text-strong); font-size: 1.375rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.stat .value small { font-size: .875rem; font-weight: 500; letter-spacing: 0; }

/* The dashboard's cards: the chart and the latest refreshes, the active pipelines beside them on
   a wide page column (the second row takes the list's extra height). */
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.board > .card { margin: 0; }
/* A card's header with a control at its right (the chart's period): the h2's header bar. */
.card > .card-head:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin: -1.25rem -1.25rem 1.25rem;
  padding: .5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { margin: 0; color: var(--action); font-size: .9375rem; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: -.25rem 0 .75rem; color: var(--muted); font-size: .8125rem; }
/* Two links as one switch (the chart's period); the current one raised. Compact controls are
   32 px high (WCAG 2.5.8 asks 24). */
.period { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--page); }
.period a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .1rem .8rem;
  border-radius: 999px;
  color: var(--text);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
}
.period a:hover { color: var(--action); text-decoration: none; }
.period a[aria-current="true"] { background: var(--surface); color: var(--text-strong); font-weight: 600; box-shadow: 0 1px 2px rgba(58, 59, 69, .14); }
.key { display: inline-flex; align-items: center; gap: .4rem; }
.key::before { content: ""; width: .625rem; height: .625rem; border-radius: 2px; background: var(--none); }
.key.ok::before { background: var(--ok); }
.key.error::before { background: var(--error); }
.chart { display: block; width: 100%; height: auto; }
.chart .ok { fill: var(--ok); }
.chart .error { fill: var(--error); }
.chart .none { fill: var(--control-border); }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart g:hover .hit { fill: var(--page); }
/* A label under each bar (the chart draws 14 days or 24 hours, equally wide), and the month (or
   the day) where one starts. */
.chart-days {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  margin: .375rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  list-style: none;
  text-align: center;
}
.chart-days.hours { grid-template-columns: repeat(24, minmax(0, 1fr)); }
.chart-days span { display: block; min-height: 1.5em; }
.chart-days small { display: block; font-size: .75rem; white-space: nowrap; }
.fresh-list, .feed { margin: 0; padding: 0; list-style: none; }
.fresh-list li, .feed li { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.fresh-list li:first-child, .feed li:first-child { padding-top: 0; }
.fresh-list li:last-child, .feed li:last-child { padding-bottom: 0; border-bottom: 0; }
.fresh-list li > div, .feed li > div { display: grid; gap: .125rem; min-width: 0; }
.fresh-list li > div { flex: 1; } /* the row's width: every strip ends at the card's edge */
.fresh-list .route { align-self: flex-start; }
/* One line, cut with "…" (the pipeline's page shows it whole). Positioned, so its hidden words
   for screen readers stay inside it: past its cut they made the page scroll sideways. */
.fresh-list a { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fresh-list a, .feed a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
/* 40 px targets without taller rows (the trick of .pipe a). */
.fresh-list a, .feed a, .more a { display: inline-block; margin-block: -.6rem; padding-block: .6rem; }
.fresh-list a { display: block; }
.fresh-list a:hover, .feed a:hover { text-decoration: underline; }
.fresh-list small, .feed small { overflow-wrap: anywhere; }
.fresh-list .when { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin: 0; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.fresh-list .when .strip { gap: 2px; margin-left: auto; }
.fresh-list .day { width: .375rem; } /* the strip beside the time, in the narrow column */
.last { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.last .icon { width: .9rem; height: .9rem; }
.last.success .icon { color: var(--ok); }
.last.error { color: var(--error-fg); }
.last.error .icon { color: var(--error); }
.feed li > .icon { align-self: flex-start; margin-top: .15rem; color: var(--error); }
.empty.good > .icon { color: var(--ok); }
.feed p { margin: 0; }
.feed .when { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.more { margin: 1rem 0 0; font-size: .875rem; }
.chart-note { margin: .75rem 0 0; font-size: .8125rem; }
.recent > h2 + .help { margin-top: -.5rem; font-size: .8125rem; }

/* Tables: hairline rows, contained in a card. */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
td { padding: .8rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
td, th { overflow-wrap: break-word; } /* anywhere would let a column shrink to one letter */
th:first-child, td:first-child { padding-left: 1.25rem; }
th:last-child, td:last-child { padding-right: 1.25rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfbfd; }
td small { display: block; overflow-wrap: anywhere; }
td.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.message { min-width: 14rem; overflow-wrap: anywhere; }
td.id { min-width: 10rem; overflow-wrap: anywhere; } /* e-mails, connection ids */
td.act { text-align: right; white-space: nowrap; }
td.dates { font-variant-numeric: tabular-nums; }
td.dates time { white-space: nowrap; } /* a narrow column breaks at the dash, never in a date */
td.act form { display: inline-flex; }

/* A pipeline: logo -> logo, then its names (legacy's picture of a pipeline). */
.pipe { display: flex; align-items: center; gap: .875rem; min-width: 0; }
.pipe > div { min-width: 0; }
td .pipe { min-width: 14rem; }
.pipe a { display: inline-block; margin-block: -.6rem; padding-block: .6rem; font-weight: 600; overflow-wrap: anywhere; } /* a 40 px target */
.route { display: inline-flex; align-items: center; gap: .3rem; flex: none; }
.route .icon { width: .875rem; height: .875rem; color: #9a9db0; }
.logo { width: 2rem; height: 2rem; object-fit: contain; flex: none; }
.route .logo { width: 1.75rem; height: 1.75rem; }
.logo.blank {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--off-bg);
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Status: legacy's green / red / grey as pills. The class is the log status. */
.status, .state {
  display: inline-flex;
  align-items: center;
  padding: .125rem .6rem;
  border-radius: 999px;
  background: var(--off-bg);
  color: var(--off-fg);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.5;
  text-transform: capitalize;
  white-space: nowrap;
}
.status.success, .state.on { background: var(--ok-bg); color: var(--ok-fg); }
.status.error { background: var(--error-bg); color: var(--error-fg); }
.status.start { background: var(--info-bg); color: var(--info-fg); }
/* A run queued or running: legacy's yellow "start", with a turning icon. */
.status.pending { gap: .3rem; background: var(--warn-bg); color: var(--warn-fg); text-transform: none; }
.status.pending .icon { width: .8rem; height: .8rem; animation: turn 1.6s linear 3; } /* under 5 s: WCAG 2.2.2 */
@keyframes turn { to { transform: rotate(360deg); } }

/* The last 14 days: a failed day stands taller, a day without a refresh is a stub. */
.strip { display: inline-flex; align-items: center; gap: 3px; height: 1.25rem; vertical-align: middle; }
.day { display: inline-block; width: .5rem; height: .875rem; border: 1px solid transparent; border-radius: 2px; background: var(--none); }
.day.ok { background: var(--ok); }
.day.error { height: 1.25rem; background: var(--error); }
.day.none { height: .25rem; border: 0; background: var(--control-border); } /* a dash: nothing ran */

/* Buttons: one shape. Plain = secondary; .primary, .danger, .quiet. */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.5rem;
  padding: .45rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-strong);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover, .button:hover { border-color: var(--control-border); background: var(--page); color: var(--text-strong); text-decoration: none; }
button .icon, .button .icon { width: 1rem; height: 1rem; }
button.primary, .button.primary { border-color: var(--action-fill); background: var(--action-fill); color: #fff; }
button.primary:hover, .button.primary:hover { border-color: var(--action); background: var(--action); color: #fff; }
button.danger, .button.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
button.danger:hover, .button.danger:hover { border-color: var(--danger-hover); background: var(--danger-hover); color: #fff; }
button.quiet, .button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
button.quiet:hover, .button.quiet:hover { background: var(--off-bg); color: var(--text-strong); }
button.remove, .button.remove { border-color: transparent; background: transparent; color: var(--danger); }
button.remove:hover, .button.remove:hover { background: var(--error-bg); color: var(--danger-hover); }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1.5rem; }
.actions:last-child, .fields:last-child { margin-bottom: 0; }
.actions form { display: inline-flex; margin: 0; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
td.act form.inline + form.inline { margin-left: .25rem; }
.connect { display: flex; flex-wrap: wrap; gap: .75rem; }
.connect form { margin: 0; }
.connect button, .connect-more button { min-height: 3rem; padding-left: .75rem; }
button .logo { width: 1.5rem; height: 1.5rem; }
.connect-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .875rem;
}
.invite { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* Fields: a visible label above every control. */
input[type="text"], input[type="email"], input[type="date"], select {
  min-height: 2.5rem;
  max-width: 100%;
  padding: .4rem .75rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-strong);
  font: inherit;
  font-size: 1rem;
}
select {
  padding-right: 2.25rem;
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a5c69' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center / 1rem;
}
input:focus, select:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--blue); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--action); flex: none; }
input[type="checkbox"]:disabled { opacity: .6; }
fieldset { min-width: 0; margin: 0 0 1.5rem; padding: 0; border: 0; }
legend { margin-bottom: .6rem; padding: 0; color: var(--text-strong); font-weight: 600; }
.fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.field { display: grid; gap: .35rem; color: var(--text-strong); font-size: .875rem; font-weight: 500; }
.field input, .field select { font-weight: 400; }
.wide { width: min(100%, 32rem); }
.help, .lead { color: var(--muted); font-size: .875rem; }

/* Pick one: tiles (platforms, connections). */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: .75rem;
}
.tiles legend { grid-column: 1 / -1; }
.tile {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3.75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.tile span { min-width: 0; overflow-wrap: anywhere; }
.tile .logo { margin-left: auto; }
/* On a tinted surface a logo sits on a white chip (some logos bring their own white square). */
.tile .logo, button .logo { padding: .125rem; border-radius: var(--radius-sm); background: #fff; }
.tile:hover { border-color: var(--blue); }
.tile:has(input:checked) { border-color: var(--action); background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action); }
.tile:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Pick from a few: report types and presets as pills; the current one is <strong>. */
.choices { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1.25rem; }
.choices > span { flex-basis: 100%; color: var(--text-strong); font-size: .875rem; font-weight: 600; }
.choices a, .choices strong {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: .3rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-strong);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.choices a:hover { border-color: var(--blue); color: var(--action); text-decoration: none; }
.choices strong { border-color: var(--action-fill); background: var(--action-fill); color: #fff; }
.choices strong::before { content: "\2713"; content: "\2713" / ""; margin-right: .4rem; }

/* Pick many: the field checkboxes, in columns. */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: .125rem 1rem; }
.checks legend { grid-column: 1 / -1; }
.checks.one { grid-template-columns: minmax(0, 1fr); }
/* The box sits in the label's padding, so the label's text (and its note) wraps under itself. */
.checks label {
  position: relative;
  display: block;
  padding: .55rem .5rem .55rem 2.1rem;
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-size: .875rem;
  cursor: pointer;
}
.checks label:hover { background: var(--page); }
.checks label input { position: absolute; top: .8rem; left: .55rem; }
/* Ratios: a folded note under the fields (they cannot be exported; they are calculated). */
.ratios { margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--page); }
.ratios > summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.5rem;
  padding: .5rem .875rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.ratios > summary::-webkit-details-marker { display: none; }
.ratios > summary::before {
  content: "";
  width: .4rem;
  height: .4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.ratios[open] > summary::before { transform: rotate(45deg); }
.ratios > summary:hover { color: var(--text-strong); }
.ratios > :not(summary) { margin-inline: .875rem; }
.ratios[open] { padding-bottom: .5rem; }
.ratio { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.ratio:last-child { border-bottom: 0; }
.ratio label { position: relative; display: block; padding-left: 1.6rem; color: var(--text-strong); font-size: .875rem; }
.ratio label input { position: absolute; top: .25rem; left: 0; }
.ratio small { display: block; padding-left: 1.6rem; overflow-wrap: anywhere; }

/* Notices: info (role=status) and errors (role=alert). */
p[role="status"], p[role="alert"], .shared {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 0 0 1.5rem;
  padding: .75rem 1rem;
  border: 1px solid #c8d5f7;
  border-radius: var(--radius);
  background: #eaf0fd;
  color: var(--info-fg);
  font-weight: 500;
}
p[role="status"] .icon, p[role="alert"] .icon, .shared .icon { margin-top: .15rem; }
p[role="alert"] { border-color: #f0cdc8; background: #fbefed; color: var(--error-fg); }

/* The new-pipeline wizard: steps, the step's card, the answers so far. */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  content: counter(step) / "";
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 600;
}
.steps li.done { color: var(--ok-fg); }
.steps li.done::before { content: "\2713"; content: "\2713" / ""; border-color: var(--ok); background: var(--ok); color: #fff; }
.steps li[aria-current="step"] { color: var(--action); }
.steps li[aria-current="step"]::before { border-color: var(--action-fill); background: var(--action-fill); color: #fff; }
.wizard.with-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.wizard > .card { margin-bottom: 0; }
.wizard .so-far dl.summary { grid-template-columns: minmax(0, 1fr); gap: 0; }
.wizard .so-far dt { margin-top: .6rem; }
.wizard .so-far dt:first-child { margin-top: 0; }
.radios { display: grid; gap: .5rem; margin-bottom: 1.5rem; }
.radios .tile { min-height: 3rem; font-weight: 500; }

dl.summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .6rem 1.5rem; margin: 0; }
dl.summary dt { color: var(--muted); font-size: .875rem; font-weight: 500; }
dl.summary dd { margin: 0; color: var(--text-strong); overflow-wrap: anywhere; }
.card dl.summary:not(:last-child) { margin-bottom: 1.5rem; }
dl.summary .billed span { display: block; }

/* Plans: one card each, the chosen one outlined. */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.plan { display: flex; flex-direction: column; margin: 0; padding: 1.25rem; }
.plan.chosen { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action), var(--shadow); }
.plan h2 { margin-bottom: .25rem; }
.plan p strong { color: var(--text-strong); font-size: 1.5rem; letter-spacing: -.01em; }
.plan ul { flex: 1; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.plan li {
  margin-bottom: .45rem;
  padding-left: 1.6rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f6848' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat 0 .25rem / 1rem;
  font-size: .875rem;
}
.plan form { margin: 0; }
.plan button { width: 100%; }
.manage { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.manage p:not([role]) { margin: 0; }
.manage p[role] { flex-basis: 100%; margin: 0; }
.plan ul:last-child { margin-bottom: 0; }

/* A long list's filters (a GET form, applied on change), compact: a label beside each select. */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; margin: 0 0 1rem; }
.filters label { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.filters select {
  min-height: 2rem;
  padding: .15rem 1.9rem .15rem .6rem;
  border-color: var(--border-strong);
  color: var(--text-strong);
  font-size: .875rem;
  background-position: right .5rem center;
}
.filters .clear { font-size: .875rem; }
/* The results under the filters: a table still runs to the card's edges. */
.results > table { width: calc(100% + 2.5rem); margin: 0 -1.25rem; }
.results > table:last-child { margin-bottom: -1.25rem; }
.card > .results:last-child > :last-child:not(table) { margin-bottom: 0; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .25rem; margin: 1rem 0 0; font-size: .875rem; }
.pager .count { margin-right: auto; color: var(--muted); }
.pager a, .pager [aria-current="page"], .pager .gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 .6rem;
  border-radius: var(--radius-sm);
}
.pager a { color: var(--text); text-decoration: none; }
.pager a:hover { background: var(--page); color: var(--action); text-decoration: none; }
.pager [aria-current="page"] { background: var(--action-fill); color: #fff; font-weight: 600; }
.pager .gap { min-width: 1.5rem; padding: 0; color: var(--muted); }
.pager .icon { width: 1rem; height: 1rem; }

/* Empty states and errors. */
.empty { padding: 1.5rem 0; color: var(--muted); text-align: center; }
.empty > .icon { display: block; width: 2.25rem; height: 2.25rem; margin: 0 auto .5rem; color: #9a9db0; }
.empty p { margin: 0 0 .75rem; }
.empty p:last-child { margin-bottom: 0; }
.empty p a:not(.button) { display: inline-block; margin-block: -.6rem; padding-block: .6rem; }
.zone-note { display: none; }
.request-id { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }

/* Sign in with Google: Google's own button look. */
.google {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-height: 2.75rem;
  padding: .55rem 1.25rem;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #3c4043;
  font-weight: 500;
  text-decoration: none;
}
.google:hover { border-color: #c4c7cc; background: #f8f9fc; color: #3c4043; text-decoration: none; }
.google img { width: 1.25rem; height: 1.25rem; }

/* Narrow screens: the sidebar becomes a band of icons on top; tables become stacked rows. */
@media (max-width: 48rem) {
  :root { --pad: 1rem; }
  body.app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "side" "top" "main" "foot";
  }
  .sidebar { position: static; height: auto; padding: 0 .5rem .5rem; }
  .sidebar .brand { justify-content: flex-start; height: 3.25rem; margin: 0 .5rem; border: 0; }
  .sidebar nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; }
  .sidebar nav a[href="/profile"], .sidebar nav a[href="/sharing"] { display: none; } /* in the menu, top right */
  .sidebar nav a {
    flex-direction: column;
    gap: .2rem;
    padding: .45rem .2rem;
    font-size: .75rem;
    text-align: center;
  }
  .sidebar hr { display: none; }
  .sidebar nav a[target="_blank"] { display: none; } /* FAQ and Support move to the page's foot */
  .foot { grid-area: foot; display: flex; justify-content: center; gap: 1rem; padding: 0 var(--pad) 1rem; font-size: .875rem; font-weight: 500; }
  .foot a { display: inline-flex; align-items: center; min-height: 2.5rem; padding-inline: .5rem; }
  .topbar { min-height: 0; padding: .5rem var(--pad); }
  .me-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* still its name */
  .topbar .switcher { flex-basis: 100%; min-width: 0; }
  .topbar .switcher select { flex: 1; min-width: 0; max-width: none; }
  h1 { font-size: 1.5rem; }
  dl.summary { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.summary dd { margin-bottom: .6rem; }
}

/* A narrow page column (a phone, a tablet, a zoomed window): tables become labelled rows. Up to
   60rem: a long time zone or platform name widens a table past a 54rem column. */
@container (width <= 60rem) {
  .stack, .stack tbody { display: block; }
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stack tr { display: block; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); }
  .stack tbody tr:last-child { border-bottom: 0; }
  .stack td { display: flex; align-items: baseline; gap: .75rem; padding: .3rem 0; border: 0; overflow-wrap: anywhere; }
  .stack td:first-child, .stack td:last-child { padding-left: 0; padding-right: 0; }
  .stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 6.5rem;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 500;
  }
  .stack td.when { white-space: normal; }
  .stack td .pipe { min-width: 0; flex-wrap: wrap; row-gap: .25rem; }
  .stack td .pipe > :is(div, a):last-child { flex-basis: 100%; } /* a pipeline's names: always under its logos */
  .stack td.act .remove { margin-inline-start: -1rem; } /* its text lines up with the row */
  .zone-note { display: block; }
  .stack td.act { justify-content: flex-start; }
  .stack td.act:not(:has(*)) { display: none; }
}
/* The narrowest phones: a row's label goes above its value. */
@container (max-width: 22rem) {
  .stack td[data-label] { flex-direction: column; align-items: flex-start; gap: .1rem; }
  .stack td[data-label]::before { flex: none; }
}
/* A narrow page column: the dashboard's figures get compact. */
@container (max-width: 48rem) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .stat { flex-direction: column; align-items: flex-start; gap: .25rem; padding: .75rem; }
  .stat > .icon { display: none; }
  .stat p { flex: 1; grid-template-rows: 1fr auto; }
  .stat .label { font-size: .75rem; line-height: 1.3; }
  .stat .value { font-size: 1.25rem; }
  .choices a, .choices strong { border-radius: var(--radius); }
}
/* Tables as tables: the log keeps platform names on one line (the dashboard's and the list's
   wrap, or the table outgrows its card). */
@container (width > 60rem) {
  td .pipe > a { white-space: nowrap; }
  .card > h2:first-child + .zone-note + table { margin-top: -1.25rem; } /* the note is hidden */
}
/* A wide page column: "Your pipeline" sits beside the wizard's step; the dashboard's recently
   refreshed pipelines beside its chart and latest errors, in a column as wide as their longest
   name (owner, 2026-11-13): at least 22rem, at most 34rem or 45% of the row; longer names end
   in "…". */
@container (min-width: 54rem) {
  .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wizard.with-summary { grid-template-columns: minmax(0, 1fr) 19rem; }
  .board { grid-template-columns: minmax(0, 1fr) fit-content(min(34rem, 45%)); grid-template-rows: auto 1fr; }
  .board > .fresh { min-width: 22rem; }
  .board > .fresh { grid-column: 2; grid-row: 1 / span 2; }
  .board > .recent { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
