/* Base styles. Component styles live next to components in *.razor.css. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
}

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

html {
  background: var(--color-bg);
  color: var(--color-fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--color-brand);
  text-decoration: none;
}

a:hover {
  color: var(--color-brand-600);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img,
svg {
  display: block;
}

::selection {
  background: var(--color-brand-100);
  color: var(--color-fg);
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Headings receive programmatic focus on navigation (FocusOnNavigate); don't draw a ring for that. */
h1:focus,
main:focus {
  outline: none;
}

/* ---------- Utilities ---------- */

.tnum {
  font-variant-numeric: tabular-nums;
}

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

.text-ai {
  background-image: var(--gradient-ai);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-ai {
  background-image: var(--gradient-ai);
}

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

/* Faint blueprint grid for empty states and hero backdrops. */
.grid-fade {
  background-image:
    linear-gradient(to right, rgb(11 12 16 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(11 12 16 / 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 100%);
}

/* ---------- Skip link (DSH-081) ---------- */

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-fg);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 0.15s var(--ease-out-expo);
}

.skip-link:focus,
.skip-link:focus-visible {
  color: #fff;
  transform: translateY(0);
}

/* ---------- Page scaffolding ---------- */

.page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.page-title {
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--color-fg);
}

.page-subtitle {
  margin-top: 0.125rem;
  font-size: var(--text-base);
  color: var(--color-fg-3);
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  z-index: 1000;
  display: none;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 2rem);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-lg);
  background: var(--color-fg);
  color: #fff;
  font-size: var(--text-base);
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
}

#blazor-error-ui .reload {
  color: var(--color-brand-100);
  font-weight: 500;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  color: var(--color-fg-3);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* A link styled like a secondary button (for navigation actions). */
.link-button {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-fg);
  font-size: var(--text-base);
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--color-line-2), var(--shadow-soft);
}

.link-button:hover {
  background: var(--color-surface-2);
  color: var(--color-fg);
}

/* T42: link buttons with an icon, small, or in the brand colour; also a form's submit button styled the same way. */
.link-button-icon {
  gap: 0.375rem;
  white-space: nowrap;
}

.link-button-sm {
  height: 1.875rem;
  padding: 0 0.625rem;
  font-size: var(--text-sm);
}

.link-button-brand {
  background: var(--color-brand);
  color: #fff;
  box-shadow: none;
}

.link-button-brand:hover {
  background: var(--color-brand-600);
  color: #fff;
}

button.link-button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

button.link-button:focus-visible,
a.link-button:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* ---------- Dropdown panel content (used inside Dropdown) ---------- */

.menu-label {
  padding: 0.375rem 0.5rem 0.25rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-fg-3);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-fg);
  font-size: var(--text-base);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--color-surface-2);
  color: var(--color-fg);
}

.menu-item[aria-current="true"] {
  color: var(--color-brand-600);
}

.menu-item .menu-check {
  margin-left: auto;
  color: var(--color-brand);
}

.menu-item-sub {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-fg-3);
}

.menu-separator {
  height: 1px;
  margin: 0.375rem 0;
  background: var(--color-line);
}

.menu-form {
  margin: 0;
}

.page-eyebrow {
  margin-bottom: 0.125rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-fg-3);
}

.loading-text {
  font-size: var(--text-base);
  color: var(--color-fg-3);
}

/* ---------- Inline notices ---------- */

.notice {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}

.notice-ok {
  background: var(--color-ok-bg);
  color: var(--color-ok-fg);
}

.notice-bad {
  margin-top: 0.75rem;
  background: var(--color-bad-bg);
  color: var(--color-bad-fg);
}

/* T38: a link inside a notice (the reprocessing a settings change started). */
.notice-link {
  margin-left: 0.5rem;
  font-weight: 500;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notice-warn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-warn-bg);
  color: var(--color-warn-fg);
}

.page-eyebrow a {
  color: inherit;
}

.page-eyebrow a:hover {
  color: var(--color-fg);
}

/* ---------- Form fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 9rem;
}

.field-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-fg-2);
}

.input {
  height: 2rem;
  padding: 0 0.625rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-line-2);
  font-size: var(--text-base);
  color: var(--color-fg);
}

.input:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}

/* ---------- Table helpers ---------- */

.cell-sub {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-fg-3);
}

.th-note {
  color: var(--color-fg-3);
  font-weight: 400;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: -2px;
}

.num {
  text-align: right !important;
}

/* ---------- Forms: layout, hints, validation, checkboxes and switches (T08) ---------- */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.875rem;
}

.fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset > legend {
  margin-bottom: 0.375rem;
  padding: 0;
}

.field-hint {
  font-size: var(--text-sm);
  color: var(--color-fg-3);
}

.field-optional {
  font-weight: 400;
  color: var(--color-fg-3);
}

.field-error {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--text-sm);
  color: var(--color-bad-fg);
}

.input[aria-invalid="true"] {
  box-shadow: 0 0 0 1px var(--color-bad);
}

.input:disabled {
  background: var(--color-surface-2);
  color: var(--color-fg-2);
  cursor: not-allowed;
}

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--color-line-2);
  font-size: var(--text-base);
  cursor: pointer;
}

.checkbox input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--color-brand);
}

/* A checkbox drawn as a switch (put role="switch" on the input). */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-base);
  color: var(--color-fg-2);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  appearance: none;
  position: relative;
  width: 1.875rem;
  height: 1.125rem;
  margin: 0;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-line-2);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(11 12 16 / 0.2);
  transition: transform 0.15s var(--ease-out-expo);
}

.toggle input:checked {
  background: var(--color-brand);
}

.toggle input:checked::after {
  transform: translateX(0.75rem);
}

.toggle input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dialog-text {
  font-size: var(--text-md);
  color: var(--color-fg-2);
}

/* ---------- Sign-in pages (AuthLayout: sign-in, development sign-in, invitations; T21) ---------- */

.login-card {
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-card), 0 24px 48px -24px rgb(35 28 110 / 0.18);
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.login-header h1 {
  font-size: var(--text-xl);
}

.login-note {
  margin-top: 0.375rem;
  font-size: var(--text-base);
  color: var(--color-fg-3);
}

.login-alert {
  margin-top: 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-warn-bg);
  color: var(--color-warn-fg);
  font-size: var(--text-base);
}

.login-success {
  margin-top: 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-ok-bg);
  color: var(--color-ok-fg);
  font-size: var(--text-base);
}

/* Link and form buttons on static pages (the Button component is for interactive pages). */
.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 2.5rem;
  margin-top: 1.25rem;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-brand);
  color: #fff;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.login-button:hover {
  background: var(--color-brand-600);
}

.login-button:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.login-button-secondary {
  background: var(--color-surface);
  color: var(--color-fg);
  box-shadow: 0 0 0 1px var(--color-line-2), var(--shadow-soft);
}

.login-button-secondary:hover {
  background: var(--color-surface-2);
}

/* T64: "Email me a sign-in link" right under "Sign in". */
.login-button + .login-button {
  margin-top: 0.625rem;
}

.login-hint {
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-fg-3);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  font-size: var(--text-sm);
  color: var(--color-fg-3);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-line);
}

.login-fineprint {
  margin-top: 1rem;
  font-size: var(--text-sm);
  color: var(--color-fg-3);
}

/* ---------- Setup wizard steps and sit tests (T18) ---------- */

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

.setup-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

/* Step 9: T24's DPA card, then where the signage and staff notices are. */
.setup-privacy {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.setup-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.setup-block-title {
  font-size: var(--text-md);
  font-weight: 600;
}

.setup-block .form-actions,
.sit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.setup-input-short {
  max-width: 6rem;
  text-transform: uppercase;
}

.setup-empty {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  font-size: var(--text-base);
  color: var(--color-fg-2);
}

.setup-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--color-line);
}

.setup-list-row:first-child {
  border-top: 0;
}

.setup-list-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.setup-strong {
  font-weight: 600;
  color: var(--color-fg);
}

a.setup-strong:hover {
  color: var(--color-brand);
}

.setup-row-icon,
.setup-avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-fg-2);
}

.setup-avatar {
  border-radius: 50%;
  background: var(--color-brand-50);
  color: var(--color-brand-600);
  font-size: var(--text-sm);
  font-weight: 600;
}

.setup-pills {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
}

.setup-sync {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-base);
}

.setup-sync-label {
  font-weight: 500;
  color: var(--color-fg-2);
}

.setup-inline-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-brand);
  font-size: var(--text-base);
  cursor: pointer;
}

.setup-enrolment {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.5rem 2.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}

.setup-ids {
  display: grid;
  gap: 0.5rem;
}

.setup-plan {
  height: 18rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

/* The Overview's entry point. */
.setup-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(95deg, var(--color-brand-50), var(--color-surface) 70%);
  box-shadow: var(--shadow-card);
}

.setup-entry-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-lg);
  background: var(--gradient-ai);
  color: #fff;
}

.setup-entry-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 14rem;
}

.setup-entry-title {
  font-size: var(--text-lg);
}

.setup-entry-sub {
  font-size: var(--text-base);
  color: var(--color-fg-2);
}

.setup-progress-bar {
  display: block;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-surface-3);
  overflow: hidden;
}

.setup-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-ai);
}

.setup-entry-bar {
  max-width: 20rem;
  margin-top: 0.25rem;
}

.setup-entry-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-md);
  background: var(--color-brand);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 500;
}

.setup-entry-button:hover {
  background: var(--color-brand-600);
  color: #fff;
}

/* Sit tests. */
.sit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.75rem;
}

.sit-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-line);
}

.sit-card.sit-running {
  box-shadow: 0 0 0 1.5px var(--color-brand-100), var(--shadow-soft);
}

.sit-card.sit-passed {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-ok) 35%, var(--color-line));
}

.sit-card-compact {
  padding: 0.625rem;
}

.sit-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sit-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-fg-2);
}

.sit-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.sit-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sit-instruction,
.sit-result {
  font-size: var(--text-base);
  color: var(--color-fg-2);
}

.sit-result-bad {
  color: var(--color-bad-fg);
}

.sit-simulated {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sit-bar {
  display: block;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-surface-3);
  overflow: hidden;
}

.sit-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-ai);
  transition: width 900ms linear;
}

/* The go-live checklist (ONB-022). */
.golive-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.golive-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--color-line);
  list-style: none;
  overflow: hidden;
}

.golive-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--color-line);
  font-size: var(--text-base);
}

.golive-item:first-child {
  border-top: 0;
}

.golive-item.is-ok svg {
  color: var(--color-ok);
}

.golive-item.is-bad {
  background: var(--color-bad-bg);
}

.golive-item.is-bad svg {
  color: var(--color-bad);
}

.golive-item.is-warn svg {
  color: var(--color-warn);
}

.golive-item.is-info svg {
  color: var(--color-fg-3);
}

.golive-item svg {
  flex: none;
}

.golive-text {
  flex: 1;
  min-width: 0;
}

.golive-step {
  font-size: var(--text-sm);
  color: var(--color-fg-3);
  white-space: nowrap;
}

.golive-fix {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.golive-subtitle {
  margin-top: 0.25rem;
  font-size: var(--text-base);
  font-weight: 600;
}

.golive-info {
  box-shadow: none;
}

.golive-info .golive-item {
  padding: 0.25rem 0;
  border: 0;
  color: var(--color-fg-3);
}

.golive-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}

.golive-action .field-hint {
  flex: 1;
  min-width: 14rem;
}

.golive-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--color-ok-bg);
}

.golive-done > div {
  flex: 1;
  min-width: 14rem;
}

.golive-done-icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-lg);
  background: var(--color-ok);
  color: #fff;
}

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

  .setup-list-row {
    flex-wrap: wrap;
  }

  .setup-enrolment {
    margin-left: 0;
  }

  .golive-step {
    display: none;
  }
}

/* T14: small SVG charts (the staff detail's distribution and daily trend; reusable by reports). One series in the brand
   colour, thin columns with rounded data ends, hairline recessive grid, axis text in text tokens, a hover tint per band. */
.chart {
  min-width: 0;
  margin: 0;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--color-line);
  stroke-width: 1;
}

.chart-tick {
  fill: var(--color-fg-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart-label {
  fill: var(--color-fg-2);
  font-size: 11px;
  font-weight: 500;
}

.chart-column {
  fill: var(--color-brand);
}

.chart-line {
  fill: none;
  stroke: var(--color-brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--color-brand);
  stroke: var(--color-surface);
  stroke-width: 2;
}

.chart-hit rect {
  transition: fill 120ms ease-out;
}

.chart-hit:hover rect {
  fill: color-mix(in srgb, var(--color-brand) 6%, transparent);
}

.chart-empty {
  padding: 2rem 0;
  font-size: var(--text-base);
  color: var(--color-fg-3);
  text-align: center;
}

/* The charts scale with their width: on phones their text gets more user units, so it stays about 10 px on screen. */
@media (max-width: 640px) {
  .chart-tick,
  .chart-label {
    font-size: 17px;
  }
}

/* ---------- T33: segmented controls shared by the Live page's views, the heatmap and the replay ---------- */

.seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.125rem;
  padding: 0.1875rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.seg-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.875rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-fg-2);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.seg-button:hover {
  color: var(--color-fg);
}

.seg-button[aria-pressed="true"],
.seg-button[aria-selected="true"] {
  background: var(--color-surface);
  color: var(--color-fg);
  box-shadow: var(--shadow-card);
}

.seg-button:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}

/* ---------- The fake payment provider's pages (T28: hosted checkout and portal, development and CI only) ---------- */

.checkout-card {
  width: min(28rem, 100%);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-card), 0 24px 48px -24px rgb(35 28 110 / 0.18);
}

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checkout-provider {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-fg-2);
}

.checkout-title {
  margin: 0 0 0.25rem;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-fg);
}

.checkout-note {
  margin: 0 0 1rem;
  font-size: var(--text-base);
  color: var(--color-fg-2);
}

.checkout-error {
  margin: 0 0 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-bad-bg);
  font-size: var(--text-base);
  color: var(--color-bad-fg);
  box-shadow: 0 0 0 1px rgb(240 68 56 / 0.25);
}

.checkout-lines {
  width: 100%;
  margin-bottom: 0.5rem;
  border-collapse: collapse;
  font-size: var(--text-base);
}

.checkout-lines th {
  padding: 0.4375rem 0;
  font-weight: 400;
  text-align: left;
  color: var(--color-fg);
}

.checkout-lines td {
  padding: 0.4375rem 0;
  text-align: right;
  white-space: nowrap;
}

.checkout-lines .is-sub th,
.checkout-lines .is-sub td {
  color: var(--color-fg-2);
}

.checkout-lines .is-total th,
.checkout-lines .is-total td {
  border-top: 1px solid var(--color-line);
  font-size: var(--text-md);
  font-weight: 600;
}

.checkout-muted {
  color: var(--color-fg-3);
}

.checkout-small {
  margin: 0.25rem 0 0.75rem;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.checkout-card-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: var(--text-base);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.checkout-actions {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkout-actions form {
  margin: 0;
}

.checkout-button {
  width: 100%;
  height: 2.5rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-fg);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--color-line-2), var(--shadow-soft);
}

.checkout-button:hover {
  background: var(--color-surface-2);
}

.checkout-button.is-primary {
  background: var(--color-brand);
  color: #fff;
  box-shadow: none;
}

.checkout-button.is-primary:hover {
  background: var(--color-brand-600);
}

.checkout-button.is-danger {
  color: var(--color-bad-fg);
}

.checkout-button.is-ghost {
  background: transparent;
  color: var(--color-fg-2);
  box-shadow: none;
}

.checkout-button:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.checkout-small a {
  color: var(--color-brand);
  font-weight: 500;
}

/* ---------- T38: locked days and the calibration period ---------- */

.report-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.375rem 0 0;
}

.sessions-locked {
  display: inline-flex;
}
