/* Stratosphere Intelligence customer portal.

   Two themes from one set of tokens. Light is the default; dark follows the system setting
   until the person picks one (portal.js stores the choice). The accent, fonts and dark colours
   match the public site (aip.stratosphereips.org). */

:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #f8f9f6;
  --sunken: #eef0eb;
  --text: #131c17;
  --muted: #5b665f;
  /* Chart series, one per list (Okabe-Ito, told apart with colour-blindness too). */
  --series-1: #0072b2;
  --series-2: #c98a00;
  --series-3: #009e73;
  --series-4: #d55e00;
  --series-5: #b85f95;
  --series-6: #3a9fd6;
  --series-7: #6b6b6b;
  --border: #e2e6df;
  --border-strong: #cdd4ca;
  --accent: #9ee35f;
  --accent-ink: #111a16;
  --accent-text: #3b7716;
  --accent-soft: #ebf7de;
  --warn: #8a5d00;
  --warn-soft: #fcf1d2;
  --danger: #b3321f;
  --danger-soft: #fbe8e4;
  --code-bg: #111a16;
  --code-text: #e8efe6;
  --shadow: 0 1px 2px rgba(17, 26, 22, 0.06);
  --shadow-pop: 0 12px 32px rgba(17, 26, 22, 0.16);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: clamp(20px, 3vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1714;
    --surface: #152420;
    --surface-2: #1a2b26;
    --sunken: #0b1310;
    --text: #f2f5f0;
    --muted: #b3beb7;
    --series-1: #5aa9e6;
    --series-2: #f0b44c;
    --series-3: #3cc79a;
    --series-4: #f08a4b;
    --series-5: #e09ac4;
    --series-6: #8fd0f5;
    --series-7: #c4c4c4;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent-text: #a9e873;
    --accent-soft: rgba(158, 227, 95, 0.12);
    --warn: #f4d06f;
    --warn-soft: rgba(244, 208, 111, 0.12);
    --danger: #ff8f80;
    --danger-soft: rgba(255, 143, 128, 0.12);
    --code-bg: #0b1310;
    --shadow: none;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1714;
  --surface: #152420;
  --surface-2: #1a2b26;
  --sunken: #0b1310;
  --text: #f2f5f0;
  --muted: #b3beb7;
  --series-1: #5aa9e6;
  --series-2: #f0b44c;
  --series-3: #3cc79a;
  --series-4: #f08a4b;
  --series-5: #e09ac4;
  --series-6: #8fd0f5;
  --series-7: #c4c4c4;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent-text: #a9e873;
  --accent-soft: rgba(158, 227, 95, 0.12);
  --warn: #f4d06f;
  --warn-soft: rgba(244, 208, 111, 0.12);
  --danger: #ff8f80;
  --danger-soft: rgba(255, 143, 128, 0.12);
  --code-bg: #0b1310;
  --shadow: none;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 12px;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

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

.small {
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 12px;
  z-index: 50;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
}

/* App shell: sidebar + content */

.app {
  display: flex;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  flex-shrink: 0;
  width: 248px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

/* Wordmark: STRATOSPHERE in green, "Intelligence" beside it. In the narrow sidebar the two
   stack and the Staff pill sits next to "Intelligence", so the wordmark has the whole width;
   on the sign-in pages they sit on one line. */
.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 4px 10px 18px;
  text-decoration: none;
}

.brand b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.brand span {
  grid-row: 2;
  color: var(--muted);
  font-size: 13px;
}

.auth-story .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.auth-story .brand b {
  font-size: 20px;
}

.brand i {
  grid-row: 2;
  margin-left: auto;
  padding: 1px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.org-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.org-chip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.org-mark {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
}

.nav a[aria-current="page"] svg {
  color: var(--accent-text);
}

.nav .count {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
}

.theme-switch button {
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 500 13px var(--font-body);
  cursor: pointer;
}

.theme-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  overflow-wrap: anywhere;
}

.who small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

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

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px var(--gutter) 56px;
}

/* Page header */

.crumbs {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--text);
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.head-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.h1 {
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  max-width: 760px;
}

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

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 500 13.5px var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--muted);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn-primary:hover {
  border-color: var(--accent-text);
}

.btn-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  font-weight: 600;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
}

.btn-ghost.danger {
  color: var(--danger);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-lg {
  height: 46px;
  padding: 0 20px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-icon {
  width: 36px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 30px;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-ok {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-ok::before,
.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

/* Messages and callouts */

.messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message,
.callout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.message p,
.callout p {
  margin: 0;
}

.message-success {
  background: var(--accent-soft);
  border-color: transparent;
}

.message-warning,
.callout-warn {
  background: var(--warn-soft);
  border-color: transparent;
}

.message-error,
.callout-danger {
  background: var(--danger-soft);
  border-color: transparent;
}

.callout .grow {
  flex: 1;
}

.callout svg {
  flex-shrink: 0;
}

.callout-warn svg {
  color: var(--warn);
}

.callout-danger svg {
  color: var(--danger);
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-h h2 {
  font-size: 16px;
  font-weight: 600;
}

.card-h p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card-h a {
  font-size: 13px;
}

.card-b {
  padding: 16px 20px;
}

.card-b.tight {
  padding-top: 4px;
  padding-bottom: 4px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
}

.empty-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 20px;
  color: var(--muted);
}

.empty-inline svg {
  flex-shrink: 0;
  color: var(--accent-text);
}

/* Numbers */

.kpis {
  display: grid;
  /* min(…, 100%): on a narrow phone one column fills the width instead of overflowing. */
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

.kpis > .kpi + .kpi {
  border-left: 1px solid var(--border);
}

.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
}

.kpi .label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.kpi strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

.kpi strong small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.kpi em {
  color: var(--muted);
  font-style: normal;
  font-size: 12.5px;
}

.kpi.hot {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--sunken);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.meter-warn span {
  background: var(--warn);
}

/* Layout grids */

.grid-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* The side column needs room: below 1280px it moves under the main one. */
@media (max-width: 1280px) {
  .grid-rail {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

/* Tables */

.table-wrap {
  position: relative;
  overflow-x: auto;
}

/* Tables with row menus scroll sideways like any table, except while a menu is open: then
   the menu may hang below the last row instead of being clipped. */
.table-wrap.has-menus:has(details[open]) {
  overflow: visible;
}

.t {
  width: 100%;
  border-collapse: collapse;
}

.t th {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.t td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.t .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.t .end {
  text-align: right;
  white-space: nowrap;
}

.t .nowrap {
  white-space: nowrap;
}

/* Charts */

.chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: end;
  height: 120px;
}

.chart span {
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
}

.chart span.zero {
  opacity: 0.35;
}

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* Lists */

.dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}

.dl dt {
  color: var(--muted);
}

.dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.feed,
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed li,
.list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.feed li:last-child,
.list li:last-child {
  border-bottom: 0;
}

.feed li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 12px;
}

.feed .tick {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--border-strong);
}

.feed .tick.api {
  background: var(--accent);
}

.feed time {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.src {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person + .person {
  margin-top: 12px;
}

.person .grow {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.note p {
  margin: 4px 0 0;
}

/* Menus: <details class="menu"> so they work without JavaScript */

.menu {
  position: relative;
  display: inline-block;
}

.menu > summary {
  list-style: none;
}

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

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: 270px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  text-align: left;
  white-space: normal;
}

.menu-panel a,
.menu-panel button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: 14px var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-panel a:hover,
.menu-panel button:hover {
  background: var(--surface-2);
}

.menu-panel small {
  color: var(--muted);
  font-size: 12px;
}

.menu-panel .danger {
  color: var(--danger);
}

.menu-panel hr {
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* Forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-narrow {
  max-width: 520px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
}

.field input:not([type="checkbox"]),
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 14px/1.4 var(--font-body);
}

.field textarea,
textarea.input {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  outline: 0;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field--check {
  flex-flow: row wrap;
  align-items: flex-start;
  gap: 10px;
}

/* The error goes on its own line, under the box and its label. */
.field--check .field__error {
  flex-basis: 100%;
}

.field--check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent-text);
}

.field--check label {
  font-size: 14px;
  font-weight: 400;
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--danger);
}

.field__error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.field__help {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.form-row .field {
  flex: 1 1 200px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  width: min(360px, 100%);
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 14px var(--font-body);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filters select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 14px var(--font-body);
}

/* A new key, shown once */

.once {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.once h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
}

.keybox {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.keybox code {
  flex: 1 1 360px;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  word-break: break-all;
  user-select: all;
}

.once p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

pre.code {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.7;
}

/* Getting started: a tile per integration guide. */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-grid li {
  display: flex;
}

.tool {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

a.tool:hover {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

.tool .badge {
  margin-top: auto;
}

.tool strong {
  font-size: 15px;
}

.start-choice h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.start-choice p {
  margin: 0;
}

.start-details {
  margin-top: 14px;
}

.start-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

/* Getting started: notes between code blocks. */
.start-note {
  margin: 12px 0;
}

.start-note:last-child {
  margin-bottom: 0;
}

.start-list li {
  font-size: 14px;
  line-height: 1.55;
}

.start-list li:last-child {
  border-bottom: 0;
}

pre.code b {
  color: #9ee35f;
  font-weight: 500;
}

/* Trial banner */

.trial {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 22px 24px;
}

.trial h2 {
  margin-bottom: 4px;
  font-size: 20px;
  font-weight: 600;
}

.trial .meter {
  max-width: 560px;
  height: 8px;
  margin-top: 14px;
}

/* Plans */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.plan h2 {
  font-size: 17px;
  font-weight: 600;
}

.plan .price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-text);
}

.plan .price small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: 500 12px var(--font-body, inherit);
}

.plan ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
}

.plan.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.quote {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
}

/* Sign-in pages: story on the left, form on the right */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 48px clamp(32px, 5vw, 72px);
  background: #0e1714;
  color: #f5f7f2;
}

.auth-story .brand b {
  color: #9ee35f;
}

.auth-story .brand span {
  color: #b6c1ba;
}

.auth-story h1 {
  max-width: 560px;
  margin-bottom: 18px;
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.auth-story p {
  max-width: 520px;
  margin: 0;
  color: #b6c1ba;
  font-size: 17px;
}

.term {
  max-width: 560px;
  overflow: hidden;
  border: 1px solid rgba(158, 227, 95, 0.5);
  border-radius: var(--radius);
  background: #16231f;
}

.term-h {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #b6c1ba;
  font: 12px var(--font-mono);
}

.term-h b {
  color: #9ee35f;
  font-weight: 500;
}

.term pre {
  margin: 0;
  padding: 16px;
  color: #f5f7f2;
  font-size: 13px;
  line-height: 1.7;
}

.auth-story .auth-foot {
  color: #b6c1ba;
  font-size: 13px;
}

.auth-foot a {
  color: #b6c1ba;
}

.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-box {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-box h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-box .lead {
  margin: -6px 0 0;
  color: var(--muted);
}

.auth-box .field input:not([type="checkbox"]) {
  min-height: 46px;
  border-radius: 10px;
  font-size: 15px;
}

.hint {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.hint svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent-text);
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
}

.auth-box .theme-switch {
  align-self: flex-start;
  margin-top: 8px;
}

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

  .auth-story {
    padding: 28px 24px;
    gap: 20px;
  }

  .auth-story .term,
  .auth-story .auth-foot {
    display: none;
  }

  .auth-story h1 {
    font-size: 28px;
  }
}

/* Small screens: the sidebar becomes a top bar */

@media (max-width: 860px) {
  .app {
    flex-direction: column;
  }

  .side {
    position: static;
    width: auto;
    height: auto;
    padding: 12px var(--gutter);
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    padding-bottom: 10px;
  }

  .org-chip {
    display: none;
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .nav a {
    flex-shrink: 0;
  }

  .side-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
  }

  .h1 {
    font-size: 26px;
  }

  .kpis > .kpi + .kpi {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

/* Cookie note: bottom corner, on every page until dismissed. */

.cookie-note {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  margin-left: auto;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
}
.cookie-note p {
  margin: 0;
  color: var(--muted);
}
[data-cookie-note="seen"] .cookie-note {
  display: none;
}

/* Lookup (#44): the answer first, history by list, every observation by day. */

.lookup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.lookup-head p {
  margin: 4px 0 0;
}

.lookup-form {
  display: flex;
  flex: 1 1 360px;
  gap: 8px;
  max-width: 560px;
}

.lookup-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 14px var(--font-mono);
}

.lookup-form input:focus {
  outline: 0;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lookup-form .btn {
  height: 40px;
}

.lookup-error {
  margin: -12px 0 16px;
  text-align: right;
}

.lookup-answer,
.lookup-section {
  margin-bottom: 20px;
}

.lookup-answer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.lookup-ip {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lookup-ip h2 {
  font: 600 clamp(24px, 3vw, 34px) var(--font-mono);
  letter-spacing: -0.02em;
  word-break: break-all;
}

.lookup-ip p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
}

.lookup-until {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 10px;
  background: var(--accent-soft);
}

.lookup-until span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lookup-until strong {
  font: 600 24px var(--font-display);
}

.lookup-until small {
  color: var(--accent-text);
  font-size: 13px;
}

.lookup-until.is-past {
  border-color: var(--border);
  background: var(--surface-2);
}

.lookup-until.is-past small {
  color: var(--muted);
}

.lookup-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: 1px solid var(--border);
}

.lookup-tiles > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 28px;
  border-right: 1px solid var(--border);
}

.lookup-tiles > div:last-child {
  border-right: 0;
}

.lookup-tiles span {
  color: var(--muted);
  font-size: 12px;
}

.lookup-tiles strong {
  font: 600 22px var(--font-display);
}

.lookup-tiles strong small {
  color: var(--muted);
  font: 400 14px var(--font-body);
}

.lookup-tiles em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.lookup-section {
  padding: 24px 28px;
}

.lookup-observations {
  padding: 0;
}

.lookup-observations .lookup-section-head {
  padding: 24px 28px 16px;
}

.lookup-section-head {
  margin-bottom: 18px;
}

.lookup-observations .lookup-section-head {
  margin: 0;
}

.lookup-section-head h2 {
  font-size: 17px;
  font-weight: 600;
}

.lookup-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* History by list: name | one square per day (or week) | last rank and position. */
.by-list-wrap {
  overflow-x: auto;
}

/* Squares never get narrower than 11px: the chart scrolls sideways instead. A year (53
   weeks) still fits a normal desktop width. */
.by-list {
  --sq-min: 11px;
  display: grid;
  grid-template-columns: 160px minmax(calc(var(--cols) * (var(--sq-min) + 2px)), 1fr) 170px;
  align-items: center;
  gap: 10px 16px;
}

.by-list-label {
  color: var(--muted);
  font-size: 12px;
}

.by-list-label.right {
  text-align: right;
}

.by-list-name {
  font-weight: 500;
}

/* The model behind the list, under its title. */
.by-list-name small,
.th-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.by-list-cells {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(var(--sq-min), 1fr));
  gap: 2px;
}

.sq {
  height: 22px;
  border-radius: 3px;
  background: var(--sunken);
}

.sq.level-1 {
  background: color-mix(in srgb, var(--accent) 40%, var(--sunken));
}

.sq.level-2 {
  background: color-mix(in srgb, var(--accent) 75%, var(--sunken));
}

.sq.level-3 {
  background: color-mix(in srgb, var(--accent-text) 65%, var(--accent));
}

.sq.level-4 {
  background: color-mix(in srgb, var(--accent-text) 85%, var(--accent));
}

.sq-n {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.sq-n.level-3,
.sq-n.level-4 {
  color: #fff;
}

.sq-n.level-1,
.sq-n.level-2 {
  color: var(--text);
}

.by-list-last {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 4px 10px;
  font-variant-numeric: tabular-nums;
}

.by-list-last > span:last-of-type {
  min-width: 72px;
  text-align: right;
}

.by-list-total {
  align-self: stretch;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.by-list-axis span {
  overflow: visible;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.lookup-caption {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.lookup-observations .t th:first-child,
.lookup-observations .t td:first-child {
  padding-left: 28px;
}

.lookup-observations .t th:last-child,
.lookup-observations .t td:last-child {
  padding-right: 28px;
}

.lookup-observations tr[hidden] {
  display: none;
}

.lookup-table-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 28px;
  border-top: 1px solid var(--border);
}

.lookup-table-foot [hidden] {
  display: none;
}

@media (max-width: 640px) {
  .lookup-answer-top,
  .lookup-section {
    padding: 20px;
  }

  .lookup-tiles > div {
    padding: 14px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .lookup-tiles > div:last-child {
    border-bottom: 0;
  }

  .lookup-until {
    min-width: 0;
    width: 100%;
  }
}

.sq-tip {
  position: absolute;
  z-index: 60;
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: var(--shadow-pop);
}

.sq-tip[hidden] {
  display: none;
}

/* In dark theme the busier squares are bright green: dark numbers on them. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sq-n.level-2,
  :root:not([data-theme="light"]) .sq-n.level-3,
  :root:not([data-theme="light"]) .sq-n.level-4 {
    color: var(--accent-ink);
  }
}

:root[data-theme="dark"] .sq-n.level-2,
:root[data-theme="dark"] .sq-n.level-3,
:root[data-theme="dark"] .sq-n.level-4 {
  color: var(--accent-ink);
}

.by-list-cells[tabindex]:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.reg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 24px;
  margin: 0;
}

.reg-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.reg-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

/* Staff: data pipeline (#53). */

.pipeline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
}

.seg a {
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.seg a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.danger-text {
  color: var(--danger);
}

#uploads .card-h {
  flex-wrap: wrap;
}

#uploads .seg {
  max-width: 100%;
  overflow-x: auto;
}

.pipeline-detail {
  min-width: 220px;
}

.pipeline-status,
#pipeline > .card {
  margin-bottom: 20px;
}

.pipeline-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pipeline-badge {
  height: 28px;
  padding: 0 12px;
  font-size: 14px;
}

.pipeline-problems {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--warn);
  font-weight: 500;
}

.pipeline-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 24px;
  margin: 18px 0 0;
}

.pipeline-counts dt {
  color: var(--muted);
  font-size: 12px;
}

.pipeline-counts dd {
  margin: 2px 0 0;
  font: 600 18px var(--font-display);
}

.upload-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.upload-status.is-loaded {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.upload-status.is-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.upload-status.is-queued,
.upload-status.is-loading {
  background: var(--warn-soft);
  color: var(--warn);
}

/* The grid: a square per model and day. */
.pipeline-grid {
  border-collapse: separate;
  border-spacing: 4px 3px;
  font-size: 12px;
}

.pipeline-grid thead th {
  padding: 0 4px 6px;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  vertical-align: bottom;
}

.pipeline-grid thead small {
  display: block;
  font-size: 10px;
}

.pipeline-grid tbody th {
  padding-right: 10px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 400;
  text-align: left;
}

.pipeline-grid td {
  text-align: center;
}

.pl-cell,
.pl-key {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 18px;
  border-radius: 4px;
  background: var(--sunken);
  vertical-align: middle;
}

.pl-key {
  width: 14px;
  height: 10px;
}

.pl-cell.is-ok,
.pl-key.is-ok {
  background: color-mix(in srgb, var(--accent) 80%, var(--sunken));
}

.pl-cell.is-failed,
.pl-key.is-failed {
  background: var(--danger);
}

.pl-cell.is-missing,
.pl-key.is-missing {
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.pl-cell.is-unserved.is-missing {
  box-shadow: none;
}

/* Upload marks: a dot for one received, a ring for one that failed. */
.pl-cell[class*="up-"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0.55;
}

.pl-cell.up-failed::after {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: transparent;
  box-shadow: 0 0 0 2px var(--surface);
  opacity: 1;
}

.pl-cell.up-queued::after,
.pl-cell.up-loading::after {
  background: var(--warn);
  opacity: 1;
}

/* The months: a row per model, a square per month, the days left to load inside. It opens
   at the newest months: the wrapper scrolls from the right. */
.pl-month-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 14px;
  font-size: 13px;
}

.pl-month-filter label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pl-month-filter .input {
  width: auto;
  min-height: 34px;
  padding: 4px 8px;
}

.pl-months-wrap {
  overflow-x: auto;
  direction: rtl;
}

.pl-months {
  direction: ltr;
  table-layout: fixed;
  width: 100%;
  min-width: 1000px;
  border-spacing: 2px 4px;
}

.pl-months thead th {
  padding: 0;
  font-size: 10px;
  font-weight: 400;
  text-align: left;
}

.pl-months thead .pl-y {
  padding-bottom: 2px;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}

.pl-months .pl-corner,
.pl-months tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  padding-right: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}

.pl-months tbody th small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.pl-months tbody th .pl-left {
  color: var(--warn);
}

.pl-months td {
  padding: 0;
}

.pl-months .pl-name {
  width: 150px;
}

.pl-months .pl-gap {
  width: 4px;
}

.pl-months .pl-month {
  display: block;
  width: auto;
  height: 22px;
  border-radius: 3px;
}

.pl-cell.is-partial,
.pl-key.is-partial {
  background: color-mix(in srgb, var(--warn) 45%, var(--sunken));
}

.pl-cell.is-queued,
.pl-key.is-queued {
  background: var(--warn-soft);
  box-shadow: inset 0 0 0 2px var(--warn);
}

.pl-cell.is-empty,
.pl-key.is-empty {
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.pl-cell.is-old,
.pl-key.is-old {
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 3px,
    color-mix(in srgb, var(--surface) 70%, transparent) 3px 6px
  );
}

.pl-fix-h {
  margin: 22px 0 8px;
  font-size: 14px;
}

/* Staff: list evaluation. One panel per list, all on the same 0-100% scale. */
.eval-legend {
  margin: 0 0 16px;
}

.eval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* The numbers and the chart sit at the bottom, so panels in a row line up whatever the
   length of their question. */
.eval-panel {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
}

.eval-h h2 {
  margin: 0;
  font-size: 16px;
}

.eval-h p,
.eval-q {
  margin: 2px 0 0;
}

.eval-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  justify-content: space-between;
  gap: 8px;
  margin: auto 0 12px;
  padding-top: 14px;
}

.eval-kpis dt {
  color: var(--muted);
  font-size: 12px;
}

.eval-kpis dd {
  margin: 2px 0 0;
  font: 600 18px/1.2 var(--font-display);
}

.eval-kpis small {
  display: block;
  color: var(--muted);
  font: 400 12px var(--font-body, inherit);
}

.eval-chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  /* One row of the box's height: the chart must not grow to its viewBox's shape on a wide
     screen. */
  grid-template-rows: minmax(0, 1fr);
  gap: 6px;
  height: 90px;
}

.eval-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.eval-chart svg {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.eval-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.eval-base-line {
  stroke: var(--muted);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.eval-line {
  pointer-events: none;
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Zero-length segments with round caps: a dot that keeps its shape in the stretched box. */
.eval-dot {
  pointer-events: none;
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.eval-hit {
  fill: transparent;
}

.eval-hit:hover {
  fill: var(--accent-soft);
}

.eval-x {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding-left: 34px;
}

/* The heatmap: a row per list, a square per day, darker for more coverage. */
.eval-heat {
  width: 100%;
  min-width: 640px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 11px;
}

.eval-heat .heat-name {
  width: 170px;
}

.eval-heat .heat-period {
  width: 70px;
}

/* Dates sit over their day without widening it. */
.eval-heat thead th {
  position: relative;
  height: 18px;
  padding: 0;
  color: var(--muted);
  font-weight: 400;
}

.eval-heat thead th span {
  position: absolute;
  bottom: 4px;
  left: 50%;
  white-space: nowrap;
  transform: translateX(-50%);
}

.eval-heat thead th:last-child span {
  right: 0;
  left: auto;
  transform: none;
}

.eval-heat tbody th {
  padding-right: 10px;
  font-weight: 500;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.eval-heat tbody th .eval-swatch {
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.eval-heat td {
  min-width: 6px;
  height: 24px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--series-1) calc(var(--v, 0) * 100%), var(--sunken));
  color: var(--text);
  text-align: center;
}

.eval-heat.with-numbers {
  min-width: 720px;
}

.eval-heat td.dark {
  color: #fff;
}

.eval-heat td:not([style]) {
  background: repeating-linear-gradient(135deg, var(--sunken) 0 3px, transparent 3px 6px);
}

.eval-heat td.num {
  padding-left: 10px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* Coverage against list size: dots placed in percent of the plot, axis titles centred on
   their axes, and a key beside the plot (under it on a narrow screen). */
.eval-size {
  margin-bottom: 20px;
}

.eval-size-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, 220px);
  gap: 0 12px;
  align-items: start;
}

.eval-size-ytitle {
  align-self: stretch;
  height: 300px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.eval-size-plot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 300px 22px auto;
  gap: 0 8px;
}

.eval-size-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.eval-size-area {
  position: relative;
  border-bottom: 1px solid var(--muted);
  background: repeating-linear-gradient(
    to bottom,
    var(--border) 0 1px,
    transparent 1px 25%
  );
}

.eval-size-vline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  opacity: 0.6;
}

.eval-size-bar {
  position: absolute;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--series);
  opacity: 0.35;
}

.eval-size-mark,
.eval-size-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--series);
}

.eval-size-mark {
  position: absolute;
  margin: 0 0 -6px -6px;
}

.eval-size-x {
  position: relative;
  grid-column: 2;
  font-size: 11px;
}

.eval-size-x span {
  position: absolute;
  top: 5px;
  transform: translateX(-50%);
}

.eval-size-x span:first-child {
  transform: none;
}

.eval-size-x span:last-child {
  transform: translateX(-100%);
}

.eval-size-xtitle {
  grid-column: 2;
  padding-top: 4px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.eval-size-key {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  list-style: none;
  font-size: 13px;
}

.eval-size-key li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.eval-size-key .eval-size-dot {
  flex: none;
  margin-top: 3px;
}

.eval-size-key .muted {
  display: block;
}

.eval-size-axes {
  grid-column: 1 / -1;
  margin: 12px 0 0;
}

@media (max-width: 900px) {
  .eval-size-body {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .eval-size-key {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin-top: 14px;
  }
}

/* The evaluation's reading guide, written for people new to it. */
.eval-read {
  margin-bottom: 20px;
}

/* Folded by default: a summary line that opens the guide. */
.eval-read > summary {
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.eval-read > summary::-webkit-details-marker {
  display: none;
}

.eval-read:not([open]) > summary {
  border-bottom: 0;
}

.eval-read-toggle {
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.eval-read[open] .eval-read-toggle {
  transform: rotate(-135deg);
}

.eval-read-intro {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
}

/* Lines a reader can follow on a wide screen. */
.eval-read .card-h p,
.eval-read .card-b,
.eval-all .card-h p,
.eval-section-p {
  max-width: 980px;
}

.eval-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 28px;
  margin: 0 0 12px;
}

.eval-terms dt {
  font-weight: 600;
}

.eval-terms dd {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

.eval-context {
  margin-bottom: 20px;
}

.eval-context p {
  max-width: 980px;
  margin: 0;
  line-height: 1.55;
}

.eval-context p + p {
  margin-top: 8px;
}

.eval-plain {
  margin: -4px 0 12px;
  font-size: 13px;
  line-height: 1.5;
}

.eval-notes {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.55;
}

.eval-section-h {
  margin: 4px 0 2px;
  font-size: 16px;
}

.eval-section-p {
  margin: 0 0 12px;
}

/* The evaluation's colours, one per list, and the chart of every list together. */
.series-1 { --series: var(--series-1); }
.series-2 { --series: var(--series-2); }
.series-3 { --series: var(--series-3); }
.series-4 { --series: var(--series-4); }
.series-5 { --series: var(--series-5); }
.series-6 { --series: var(--series-6); }
.series-7 { --series: var(--series-7); }

.eval-line,
.eval-dot {
  stroke: var(--series, var(--accent-text));
}

.eval-all {
  margin-bottom: 20px;
}

.eval-all > .card-h {
  flex-wrap: wrap;
}

.eval-all > .card-h > div:first-child {
  flex: 1 1 420px;
}

.eval-chart-all {
  height: 280px;
}

/* Charts with dated ticks: the plot, then a row of dates under it. */
.eval-chart-ticked {
  grid-template-rows: minmax(0, 1fr) 20px;
}

.eval-chart-ticked .eval-y {
  grid-row: 1;
}

.eval-ticks {
  position: relative;
  grid-column: 2;
  font-size: 11px;
}

.eval-ticks span {
  position: absolute;
  top: 5px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.eval-ticks .first {
  transform: none;
}

.eval-ticks .last {
  transform: translateX(-100%);
}

.eval-vline {
  opacity: 0.6;
}

/* On a narrow screen every other date, so they do not run into each other. */
@media (max-width: 700px) {
  .eval-ticks span:nth-child(even):not(.last),
  .eval-ticks span:nth-last-child(2) {
    display: none;
  }
}

.eval-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.eval-key li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.eval-swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--series, var(--accent-text));
}

/* Pointing at a list in the key picks out its line. */
.eval-all:has(.eval-key li:hover) .eval-line,
.eval-all:has(.eval-key li:hover) .eval-dot {
  opacity: 0.18;
}

.eval-all:has(.eval-key .series-1:hover) .eval-line.series-1,
.eval-all:has(.eval-key .series-2:hover) .eval-line.series-2,
.eval-all:has(.eval-key .series-3:hover) .eval-line.series-3,
.eval-all:has(.eval-key .series-4:hover) .eval-line.series-4,
.eval-all:has(.eval-key .series-5:hover) .eval-line.series-5,
.eval-all:has(.eval-key .series-6:hover) .eval-line.series-6,
.eval-all:has(.eval-key .series-7:hover) .eval-line.series-7 {
  opacity: 1;
  stroke-width: 3;
}

.eval-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eval-open {
  flex: none;
  padding: 0 8px;
}

/* The small chart is a button that opens the large one. */
.eval-chart-button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.eval-chart-button .eval-chart,
.eval-chart-button .eval-x {
  display: grid;
}

.eval-chart-button .eval-y {
  display: flex;
}

.eval-chart-button .eval-x {
  display: flex;
}

.eval-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.eval-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.eval-dialog .eval-kpis {
  margin: 8px 0 14px;
  max-width: 420px;
}

.eval-chart-big {
  height: min(380px, 52vh);
}

.eval-precision {
  stroke-dasharray: 5 4;
  opacity: 0.75;
}

.eval-dot.eval-precision {
  stroke-dasharray: none;
}

.eval-precision-key .eval-swatch {
  background: repeating-linear-gradient(
    90deg,
    var(--series, var(--accent-text)) 0 5px,
    transparent 5px 8px
  );
  opacity: 0.75;
}

/* The steps on CTU's payment page, in the plan page's payment callout. */
.pay-steps {
  margin: 8px 0 0;
  padding-left: 20px;
}

.pay-steps li {
  margin: 2px 0;
}

/* On a phone the button goes under the steps, so they keep the width. */
@media (max-width: 600px) {
  .callout-pay {
    flex-wrap: wrap;
  }

  .callout-pay .grow {
    flex-basis: calc(100% - 40px);
  }

  .callout-pay .btn {
    margin-left: 30px;
  }
}

/* A small select inside a table row (Team: roles; removing someone: their keys). */
.select-sm {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 13px var(--font-body);
  max-width: 100%;
}

.row-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}
