/* ===========================================================================
   DietOwl brand foundation
   Values come from the moodboard at client.dietowl.in/newsite/index2.html.

   The fonts are SELF-HOSTED, not loaded from Google. The CSP is style-src
   'self' / font-src 'self', so a fonts.googleapis.com link would be blocked in
   exactly the way the Application Insights snippet was - silently, with the
   page still returning 200 and the type quietly falling back. Self-hosting also
   means no third-party request on every page load of an internal staff tool.
   Manrope and Lora are both OFL, which permits this.
   =========================================================================== */

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  font-weight: 200 800; /* one variable file covers every weight */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-italic-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Palette. Lime is a CTA and accent colour ONLY - never body text, where its
     contrast against white is far too low to read. */
  --brand-emerald: #14532D;
  --brand-emerald-deep: #0E3D21;
  --brand-lime: #C8F000;
  --brand-gold: #F5C227;
  --brand-ember: #FF5733;
  --brand-pine: #0B1A10;

  --brand-ink: #14532D;
  --brand-body: #2C3A32;
  --brand-muted: #5E6B66;
  --brand-border: #DFE6E1;
  --brand-surface: #FFFFFF;
  --brand-surface-subtle: #F6F8F7;
  --brand-emerald-soft: #E8F1EB;

  --brand-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --brand-serif: 'Lora', Georgia, serif;

  /* Motion, from the moodboard. Never linear. */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  position: relative;
  min-height: 100%;
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background-color: var(--brand-surface-subtle);
  color: var(--brand-body);
  font-family: var(--brand-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand {
  color: var(--brand-ink);
  font-family: var(--brand-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 2.625rem); line-height: 1.15; }
h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }

/* Lora is for emphasis only - a pull quote, a lede. Never for structure. */
.brand-quote {
  color: var(--brand-ink);
  font-family: var(--brand-serif);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
}

.brand-overline {
  color: var(--brand-emerald);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---- Focus. One visible ring everywhere, in brand, replacing Bootstrap's
   blue - which appeared on every button and input and belonged to nothing. --- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--brand-emerald);
  box-shadow: 0 0 0 0.2rem rgba(20, 83, 45, 0.22);
  outline: none;
}

/* ---- Bootstrap components, rebadged.
   Bootstrap 5.3 styles these from per-component variables rather than from
   --bs-primary, so overriding the palette alone changes nothing. ------------- */
.btn {
  --bs-btn-font-weight: 600;
  border-radius: 0.5rem;
  transition: background-color var(--duration-normal) var(--easing-default),
              border-color var(--duration-normal) var(--easing-default),
              color var(--duration-normal) var(--easing-default);
}

.btn-primary, .btn-success {
  --bs-btn-bg: var(--brand-emerald);
  --bs-btn-border-color: var(--brand-emerald);
  --bs-btn-hover-bg: var(--brand-emerald-deep);
  --bs-btn-hover-border-color: var(--brand-emerald-deep);
  --bs-btn-active-bg: var(--brand-emerald-deep);
  --bs-btn-active-border-color: var(--brand-emerald-deep);
  --bs-btn-disabled-bg: #9BB3A4;
  --bs-btn-disabled-border-color: #9BB3A4;
}

/* The one place lime belongs: a primary call to action, carrying dark text.
   Lime on white as text would be unreadable; dark green on lime is not. */
.btn-cta {
  --bs-btn-color: var(--brand-pine);
  --bs-btn-bg: var(--brand-lime);
  --bs-btn-border-color: var(--brand-lime);
  --bs-btn-hover-color: var(--brand-pine);
  --bs-btn-hover-bg: #B8DE00;
  --bs-btn-hover-border-color: #B8DE00;
  --bs-btn-active-color: var(--brand-pine);
  --bs-btn-active-bg: #B8DE00;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-outline-success {
  --bs-btn-color: var(--brand-emerald);
  --bs-btn-border-color: var(--brand-border);
  --bs-btn-hover-bg: var(--brand-emerald);
  --bs-btn-hover-border-color: var(--brand-emerald);
  --bs-btn-hover-color: #FFFFFF;
  --bs-btn-active-bg: var(--brand-emerald-deep);
  --bs-btn-active-border-color: var(--brand-emerald-deep);
}

.card {
  border: 1px solid var(--brand-border);
  border-radius: 0.75rem;
  background: var(--brand-surface);
  box-shadow: 0 1px 2px rgba(11, 26, 16, 0.04);
}

.card-header {
  border-bottom: 1px solid var(--brand-border);
  background: var(--brand-surface-subtle);
  color: var(--brand-ink);
  font-weight: 600;
}

.form-control, .form-select {
  border-color: var(--brand-border);
  border-radius: 0.5rem;
  color: var(--brand-body);
}

.form-label {
  color: var(--brand-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.form-check-input:checked {
  border-color: var(--brand-emerald);
  background-color: var(--brand-emerald);
}

.table > thead {
  color: var(--brand-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--brand-border);
}

.alert {
  border: 1px solid transparent;
  border-radius: 0.625rem;
  font-size: 0.9rem;
}

.alert-success {
  border-color: #BFDCC9;
  background: var(--brand-emerald-soft);
  color: var(--brand-emerald-deep);
}

a {
  color: var(--brand-emerald);
  text-underline-offset: 0.2rem;
}

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

/* ---- The shell ---- */
.navbar {
  border-bottom: 1px solid var(--brand-border) !important;
  background: var(--brand-surface) !important;
}

.navbar-brand {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* A lime underline on the active-looking brand mark: the one flash of the
   accent colour in the chrome, used as an accent rather than as text. */
.navbar-brand::after {
  display: block;
  width: 1.75rem;
  height: 0.1875rem;
  border-radius: 999px;
  margin-top: 0.1875rem;
  background: var(--brand-lime);
  content: "";
}

.navbar .nav-link {
  color: var(--brand-body) !important;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color var(--duration-fast) var(--easing-default);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--brand-emerald) !important;
}

footer.footer {
  border-top: 1px solid var(--brand-border) !important;
  color: var(--brand-muted) !important;
  font-size: 0.8125rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Dashboard workspace */
/* These were a teal of their own (#0b6b53) that belonged to no brand. Pointed at
   the brand tokens instead, so every rule below inherits the palette without any
   of the layout being touched. Declared on :root as well as here because the
   finance pages use them too and are not inside .dashboard-page. */
:root,
.dashboard-page {
  --labs-accent: var(--brand-emerald);
  --labs-accent-strong: var(--brand-emerald-deep);
  --labs-accent-soft: var(--brand-emerald-soft);
  --labs-ink: var(--brand-ink);
  --labs-muted: var(--brand-muted);
  --labs-border: var(--brand-border);
  --labs-surface: var(--brand-surface);
  --labs-surface-subtle: var(--brand-surface-subtle);
  --labs-attention: #A43A2A;
  --labs-attention-soft: #FFF0EC;
}

.dashboard-page {
  color: var(--labs-ink);
  padding: 0.5rem 0 2rem;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.dashboard-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.dashboard-eyebrow,
.dashboard-section-kicker {
  margin: 0 0 0.5rem;
  color: var(--labs-accent);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.dashboard-lede {
  max-width: 40rem;
  margin: 0.75rem 0 0;
  color: var(--labs-muted);
  font-size: 1rem;
}

.dashboard-window {
  min-width: 15rem;
  border-left: 0.25rem solid var(--labs-accent);
  background: var(--labs-accent-soft);
  padding: 0.875rem 1rem;
}

.dashboard-window span,
.dashboard-window strong {
  display: block;
}

.dashboard-window > span {
  margin-bottom: 0.25rem;
  color: var(--labs-muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-window strong {
  color: var(--labs-ink);
  font-size: 0.95rem;
}

.dashboard-window strong span {
  display: inline;
  padding: 0 0.25rem;
  color: var(--labs-muted);
}

.dashboard-filter {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--labs-border);
  border-radius: 0.75rem;
  background: var(--labs-surface-subtle);
  padding: 1rem 1.25rem;
}

.dashboard-filter-copy h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-filter-copy p {
  margin: 0.25rem 0 0;
  color: var(--labs-muted);
  font-size: 0.85rem;
}

.dashboard-filter-form {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 0.75rem;
}

.dashboard-filter-field {
  width: 9.75rem;
}

.dashboard-filter-field label {
  display: block;
  margin-bottom: 0.375rem;
  color: var(--labs-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.dashboard-filter-field .form-control {
  min-height: 2.5rem;
  border-color: var(--labs-border);
  background-color: var(--labs-surface);
  color: var(--labs-ink);
}

.dashboard-filter-field .form-control:focus {
  border-color: var(--labs-accent);
  box-shadow: 0 0 0 0.2rem rgba(11, 107, 83, 0.16);
}

.dashboard-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-apply {
  min-height: 2.5rem;
  border-color: var(--labs-accent);
  background: var(--labs-accent);
  color: #ffffff;
  font-weight: 700;
}

.dashboard-apply:hover,
.dashboard-apply:focus {
  border-color: var(--labs-accent-strong);
  background: var(--labs-accent-strong);
  color: #ffffff;
}

.dashboard-reset {
  color: var(--labs-muted);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.dashboard-reset:hover,
.dashboard-reset:focus {
  color: var(--labs-accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.dashboard-validation.validation-summary-valid {
  display: none;
}

.dashboard-validation {
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.dashboard-validation ul {
  margin-bottom: 0;
}

.dashboard-section {
  margin-top: 2.25rem;
}

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.875rem;
}

.dashboard-section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.dashboard-section-heading > p {
  margin: 0;
  color: var(--labs-muted);
  font-size: 0.875rem;
  text-align: right;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--labs-border);
  border-radius: 0.75rem;
  background: var(--labs-border);
}

.dashboard-metric {
  position: relative;
  min-width: 0;
  min-height: 8.5rem;
  background: var(--labs-surface);
  padding: 1.25rem;
}

.dashboard-metric::before {
  position: absolute;
  top: 0;
  right: 1.25rem;
  left: 1.25rem;
  height: 0.1875rem;
  background: transparent;
  content: "";
}

.dashboard-metric--brand::before {
  background: var(--labs-accent);
}

.dashboard-metric--good::before {
  background: #2d8369;
}

.dashboard-metric--attention::before {
  background: var(--labs-attention);
}

.dashboard-metric-label,
.dashboard-metric-detail {
  display: block;
}

.dashboard-metric-label {
  color: var(--labs-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dashboard-metric-value {
  display: block;
  margin: 0.75rem 0 0.375rem;
  color: var(--labs-ink);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1;
}

.dashboard-metric--attention .dashboard-metric-value {
  color: var(--labs-attention);
}

.dashboard-metric-detail {
  color: var(--labs-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.dashboard-tool-count {
  border: 1px solid var(--labs-border);
  border-radius: 999px;
  background: var(--labs-surface-subtle);
  color: var(--labs-muted);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.dashboard-tool-list {
  overflow: hidden;
  border: 1px solid var(--labs-border);
  border-radius: 0.75rem;
  background: var(--labs-surface);
}

.dashboard-tool {
  display: grid;
  grid-template-columns: minmax(17rem, 1.5fr) minmax(18rem, 1fr) minmax(8rem, auto) auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.125rem 1.25rem;
}

.dashboard-tool + .dashboard-tool {
  border-top: 1px solid var(--labs-border);
}

.dashboard-tool:hover {
  background: var(--labs-surface-subtle);
}

.dashboard-tool-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.875rem;
}

.dashboard-tool-mark {
  display: inline-flex;
  flex: 0 0 2.625rem;
  width: 2.625rem;
  height: 2.625rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  background: var(--labs-accent-soft);
  color: var(--labs-accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.dashboard-tool-mark--workspace {
  background: var(--labs-ink);
  color: #ffffff;
}

.dashboard-tool-identity h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.dashboard-tool-identity h3 a {
  color: var(--labs-ink);
  text-decoration: none;
}

.dashboard-tool-identity h3 a:hover,
.dashboard-tool-identity h3 a:focus {
  color: var(--labs-accent);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.dashboard-tool-type {
  display: inline-block;
  margin-top: 0.2rem;
  color: var(--labs-accent);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.dashboard-tool-identity p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0.25rem 0 0;
  color: var(--labs-muted);
  font-size: 0.8rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-tool-metrics {
  display: grid;
  grid-template-columns: 4rem 4rem minmax(8rem, 1fr);
  gap: 1rem;
  margin: 0;
}

.dashboard-tool-metrics div {
  min-width: 0;
}

.dashboard-tool-metrics dt {
  margin-bottom: 0.25rem;
  color: var(--labs-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-tool-metrics dd {
  overflow: hidden;
  margin: 0;
  color: var(--labs-ink);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-workspace-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-workspace-summary strong {
  font-size: 0.82rem;
}

.dashboard-workspace-summary span {
  color: var(--labs-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.dashboard-text-attention {
  color: var(--labs-attention) !important;
}

.dashboard-tool-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.dashboard-tool-status span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.dashboard-status--healthy {
  background: var(--labs-accent-soft);
  color: var(--labs-accent-strong);
}

.dashboard-status--ready {
  background: #eef2f0;
  color: #4b5a55;
}

.dashboard-status--attention {
  background: var(--labs-attention-soft);
  color: var(--labs-attention);
}

.dashboard-status--workspace {
  background: #edf1f0;
  color: var(--labs-ink);
}

.dashboard-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.375rem;
  gap: 0.45rem;
  border-color: var(--labs-border);
  background: var(--labs-surface);
  color: var(--labs-ink);
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
}

.dashboard-open:hover,
.dashboard-open:focus {
  border-color: var(--labs-accent);
  background: var(--labs-accent);
  color: #ffffff;
}

.dashboard-empty {
  display: flex;
  min-height: 10rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--labs-border);
  border-radius: 0.75rem;
  background: var(--labs-surface-subtle);
  padding: 2rem;
  text-align: center;
}

.dashboard-empty strong {
  margin-bottom: 0.375rem;
}

.dashboard-empty span {
  max-width: 32rem;
  color: var(--labs-muted);
  font-size: 0.875rem;
}

/* Finance module shell */
.finance-page {
  max-width: 70rem;
  margin: 0 auto;
}

.finance-back {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  color: var(--labs-muted);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.finance-back:hover,
.finance-back:focus {
  color: var(--labs-accent);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.finance-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.finance-heading h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 775;
  letter-spacing: -0.045em;
  line-height: 1;
}

.finance-lede {
  max-width: 43rem;
  margin: 0.75rem 0 0;
  color: var(--labs-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.finance-stage {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--labs-border);
  border-radius: 999px;
  background: var(--labs-surface-subtle);
  padding: 0.55rem 0.8rem;
  color: var(--labs-ink);
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
}

.finance-stage span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--labs-accent);
}

.finance-boundary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(17rem, 0.8fr);
  gap: 2rem;
  border-top: 0.25rem solid var(--labs-accent);
  background: var(--labs-ink);
  color: #ffffff;
  padding: 1.75rem;
}

.finance-boundary h2 {
  max-width: 34rem;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.025em;
}

.finance-boundary p:not(.dashboard-section-kicker) {
  max-width: 42rem;
  margin: 0.75rem 0 0;
  color: #c7d2ce;
  line-height: 1.6;
}

.finance-boundary .dashboard-section-kicker {
  color: #8fd1bd;
}

.finance-boundary dl {
  margin: 0;
}

.finance-boundary dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.75rem 0;
}

.finance-boundary dl div:first-child {
  padding-top: 0;
}

.finance-boundary dt {
  color: #aebdb8;
  font-size: 0.72rem;
  font-weight: 650;
}

.finance-boundary dd {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: right;
}

.finance-section {
  margin-top: 2.5rem;
}

.finance-workstreams {
  overflow: hidden;
  border: 1px solid var(--labs-border);
  border-radius: 0.75rem;
  background: var(--labs-surface);
}

.finance-workstream {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
}

.finance-workstream + .finance-workstream {
  border-top: 1px solid var(--labs-border);
}

.finance-workstream-number {
  color: var(--labs-accent);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.finance-workstream h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
}

.finance-workstream p {
  margin: 0.3rem 0 0;
  color: var(--labs-muted);
  font-size: 0.82rem;
}

.finance-workstream-state {
  border-radius: 999px;
  background: #eef2f0;
  color: var(--labs-muted);
  padding: 0.4rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
}

.finance-workstream-state--next {
  background: var(--labs-accent-soft);
  color: var(--labs-accent-strong);
}

.finance-safety-note {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
  border-left: 0.25rem solid var(--labs-accent);
  background: var(--labs-accent-soft);
  padding: 1rem 1.25rem;
}

.finance-safety-note strong {
  font-size: 0.82rem;
}

.finance-safety-note span {
  color: var(--labs-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 1199.98px) {
  .dashboard-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dashboard-metric {
    grid-column: span 2;
  }

  .dashboard-metric:nth-last-child(-n + 2) {
    grid-column: span 3;
  }

  .dashboard-tool {
    grid-template-columns: minmax(15rem, 1.25fr) minmax(17rem, 1fr) auto;
  }

  .dashboard-tool-status {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .dashboard-filter {
    grid-template-columns: 1fr;
  }

  .dashboard-filter-form {
    justify-content: flex-start;
  }

  .dashboard-tool {
    grid-template-columns: 1fr auto;
  }

  .dashboard-tool-metrics {
    grid-column: 1 / -1;
    grid-template-columns: 4rem 4rem minmax(8rem, 1fr);
    padding-left: 3.5rem;
  }

  .dashboard-workspace-summary {
    grid-column: 1 / -1;
    padding-left: 3.5rem;
  }

  .finance-boundary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .finance-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .dashboard-window {
    min-width: 0;
  }

  .dashboard-filter-form {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .dashboard-filter-field {
    flex: 1 1 9rem;
    width: auto;
  }

  .dashboard-filter-actions {
    flex: 1 1 100%;
  }

  .dashboard-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .dashboard-section-heading > p {
    text-align: left;
  }

  .dashboard-section-heading--tools {
    align-items: center;
    flex-direction: row;
  }

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

  .dashboard-metric,
  .dashboard-metric:nth-last-child(-n + 2) {
    grid-column: auto;
  }

  .dashboard-tool {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-tool-metrics {
    grid-column: auto;
    padding-left: 0;
  }

  .dashboard-workspace-summary {
    grid-column: auto;
    padding-left: 0;
  }

  .dashboard-filter-field .form-control,
  .dashboard-apply,
  .dashboard-reset,
  .dashboard-open {
    min-height: 44px;
  }

  .dashboard-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dashboard-open {
    justify-self: stretch;
  }

  .finance-boundary {
    gap: 1.5rem;
    padding: 1.25rem;
  }

  .finance-workstream {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }

  .finance-workstream-state {
    grid-column: 2;
    justify-self: start;
  }

  .finance-safety-note {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }
}

@media (max-width: 479.98px) {
  .dashboard-page {
    padding-top: 0;
  }

  .dashboard-heading h1 {
    font-size: 2rem;
  }

  .dashboard-filter {
    padding: 1rem;
  }

  .dashboard-filter-field,
  .dashboard-filter-actions {
    flex-basis: 100%;
  }

  .dashboard-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-apply {
    width: 100%;
  }

  .dashboard-reset {
    align-self: center;
    padding: 0.25rem;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-metric {
    min-height: 7.5rem;
  }

  .dashboard-section-heading--tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-tool-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-tool-metrics div:last-child {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------------------------
   Layout helpers that used to be inline style attributes.

   The Content-Security-Policy is style-src 'self', which blocks a style="..."
   attribute just as firmly as an inline <script>. Every one of these was being
   dropped on the floor in production - the sign-in panel was full width with no
   top margin - and nothing said so, because a blocked style is not an error the
   server can see. Keep new styles here rather than on the element.
   --------------------------------------------------------------------------- */

/* The sign-in page. It sets Layout = null, so nothing here is inherited - and it
   is the only page an outsider ever sees, so it is the one that has to look
   like DietOwl rather than like a default Bootstrap form. */
.signin-body {
  background:
    radial-gradient(circle at 15% 0%, rgba(200, 240, 0, 0.10), transparent 42%),
    radial-gradient(circle at 85% 8%, rgba(20, 83, 45, 0.08), transparent 46%),
    var(--brand-surface-subtle);
  min-height: 100vh;
}

.signin-panel {
  max-width: 420px;
  margin-top: 7rem;
}

.signin-card {
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: var(--brand-surface);
  box-shadow: 0 12px 32px rgba(11, 26, 16, 0.07);
  padding: 2.25rem 2rem;
}

.signin-title {
  margin: 0;
  font-size: 2.125rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.signin-lede {
  margin: 0.625rem 0 1.75rem;
  color: var(--brand-muted);
  font-size: 0.9375rem;
}

/* A touch target that clears the moodboard's 48px minimum on a phone, where
   this form is most likely to be used. */
.signin-card .btn,
.signin-card .form-control {
  min-height: 48px;
}

@media (max-width: 479.98px) {
  .signin-panel {
    margin-top: 3rem;
  }

  .signin-card {
    padding: 1.75rem 1.25rem;
  }
}

.denied-panel {
    max-width: 520px;
    margin-top: 4rem;
}

.country-code-input {
    max-width: 4rem;
}

.report-preview-frame {
    height: 360px;
}

/* ---------------------------------------------------------------------------
   Social: the week of posts.
   --------------------------------------------------------------------------- */

.social-week {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.social-card {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--brand-border);
  border-radius: 0.75rem;
  background: var(--brand-surface);
}

.social-card-image {
  display: block;
  width: 100%;
  /* The card is 4:5. Reserving the ratio stops the grid jumping as images arrive. */
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--brand-surface-subtle);
}

.social-card-image--missing {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-muted);
  font-size: 0.8rem;
}

.social-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.875rem 1rem 1rem;
}

.social-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.social-card-caption {
  margin: 0.5rem 0 0.25rem;
  color: var(--brand-body);
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-line;
}

.social-card-tags {
  margin: 0 0 0.75rem;
  color: var(--brand-muted);
  font-size: 0.75rem;
}

.social-card-problem {
  margin: 0.5rem 0 0;
  border-left: 0.1875rem solid #A43A2A;
  background: #FFF0EC;
  padding: 0.5rem 0.625rem;
  color: #A43A2A;
  font-size: 0.78rem;
}

.social-card-actions {
  display: flex;
  align-items: center;
  margin-top: auto;
  gap: 0.5rem;
}

.social-detail {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 767.98px) {
  .social-detail {
    grid-template-columns: 1fr;
  }
}

/* ===========================================================================
   Assessment - the client-facing form

   The only screen in Labs a client ever sees, so it deliberately looks nothing
   like the staff console: no navbar, one question at a time, thumb-sized taps.

   Every rule lives here rather than in a style="..." attribute, and that is not
   a preference. The CSP is style-src 'self', which makes the browser DISCARD
   inline style attributes outright - server still returns 200, nothing is
   logged, and the rule simply never applies. Four of them were dead across this
   app before anybody noticed.
   =========================================================================== */

.asm-body {
  margin: 0;
  background: var(--brand-surface);
  font-family: var(--brand-sans);
  color: var(--brand-body);
}

.asm-shell {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

/* ---- the two indicators ---- */

.asm-head {
  position: sticky;
  top: 0;
  background: var(--brand-surface);
  padding: 0.75rem 0 0.5rem;
  border-bottom: 1px solid var(--brand-border);
  z-index: 2;
}

/* A real <progress>. A div with an inline width would be silently dropped by
   the CSP and sit at zero forever. */
.asm-journey {
  display: block;
  width: 100%;
  height: 0.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand-emerald-soft);
  appearance: none;
  -webkit-appearance: none;
}

.asm-journey::-webkit-progress-bar {
  background: var(--brand-emerald-soft);
  border-radius: 999px;
}

.asm-journey::-webkit-progress-value {
  background: var(--brand-emerald);
  border-radius: 999px;
  transition: width var(--duration-normal) var(--easing-default);
}

.asm-journey::-moz-progress-bar {
  background: var(--brand-emerald);
  border-radius: 999px;
}

.asm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.asm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--brand-muted);
}

.asm-pill-name {
  margin-right: 0.15rem;
}

/* Coverage is allowed to look bad. It answers "how well do you know me?", and a
   thin answer must show as a thin answer - that honesty is the whole reason it
   is separate from the journey bar, which only ever moves forward. */
.asm-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--brand-border);
  display: inline-block;
}

.asm-dot-on {
  background: var(--brand-emerald);
}

/* ---- the question ---- */

.asm-card {
  padding: 1.75rem 0 1rem;
}

.asm-title {
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--brand-ink);
  margin: 0 0 0.5rem;
}

.asm-sub,
.asm-howto {
  color: var(--brand-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.asm-howto {
  background: var(--brand-surface-subtle);
  border-left: 3px solid var(--brand-emerald-soft);
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.asm-probe {
  font-family: var(--brand-serif);
  font-style: italic;
  color: var(--brand-muted);
  margin: 0 0 0.25rem;
}

/* <details> so the reason is one tap away and needs no JavaScript - which the
   CSP forbids inline anyway. */
.asm-why {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.asm-why summary {
  color: var(--brand-emerald);
  cursor: pointer;
}

.asm-why p {
  color: var(--brand-muted);
  margin: 0.4rem 0 0;
}

/* ---- the input surface, which changes per question ---- */

.asm-form {
  margin-top: 1.25rem;
}

.asm-chips,
.asm-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.asm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}

.asm-chip,
.asm-pick {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--brand-border);
  border-radius: 0.6rem;
  background: var(--brand-surface);
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--brand-body);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--easing-default),
              background-color var(--duration-fast) var(--easing-default);
}

.asm-chips .asm-chip,
.asm-chips .asm-pick {
  width: auto;
}

.asm-chip:hover,
.asm-pick:hover {
  border-color: var(--brand-emerald);
  background: var(--brand-emerald-soft);
}

.asm-pick input {
  margin-right: 0.5rem;
  accent-color: var(--brand-emerald);
}

/* :has means a ticked item looks ticked without a line of JavaScript. */
.asm-pick:has(input:checked) {
  border-color: var(--brand-emerald);
  background: var(--brand-emerald-soft);
  font-weight: 600;
}

.asm-own {
  display: block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--brand-muted);
}

.asm-own input,
.asm-text,
.asm-number input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--brand-border);
  border-radius: 0.6rem;
  font: inherit;
  color: var(--brand-body);
}

.asm-number {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.asm-number input {
  max-width: 9rem;
  font-size: 1.4rem;
}

.asm-unit {
  color: var(--brand-muted);
}

/* Lime is the single forward action on the screen, and it is a background with
   dark text on it - never text itself, where it measures 1.32:1 on white. */
.asm-next {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--brand-lime);
  color: var(--brand-pine);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.asm-next:hover {
  filter: brightness(0.95);
}

/* Deliberately quiet, and deliberately present. Nothing in this flow may trap
   somebody who does not want to answer. */
.asm-skip {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem;
  border: 0;
  background: none;
  color: var(--brand-muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- the closing screen ---- */

.asm-group {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-muted);
  margin: 1.5rem 0 0.5rem;
}

.asm-answers {
  margin: 0;
}

.asm-answers dt {
  font-weight: 400;
  color: var(--brand-muted);
  font-size: 0.85rem;
}

.asm-answers dd {
  margin: 0 0 0.75rem;
  color: var(--brand-ink);
  font-weight: 600;
}

.asm-thin {
  background: var(--brand-surface-subtle);
  border-left: 3px solid var(--brand-gold);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--brand-body);
}

.asm-done {
  font-family: var(--brand-serif);
  font-style: italic;
  color: var(--brand-emerald);
  margin-top: 1.5rem;
}

/* Going back. Quiet, always there, and never a re-ask: the fact stays answered
   while it is being changed, so retracing steps cannot reopen a question. */
.asm-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--brand-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.asm-back:hover {
  color: var(--brand-emerald);
  text-decoration: underline;
}

/* The answer they already gave, when a single-choice question is reopened. */
.asm-chip-on {
  border-color: var(--brand-emerald);
  background: var(--brand-emerald-soft);
  font-weight: 600;
}

/* "Why we ask" is a disclosure, not a control. Without this the browser draws a
   focus box round the whole width after a submit, which reads as a broken field. */
.asm-why summary {
  list-style: none;
  display: inline-block;
  outline: none;
}

.asm-why summary::-webkit-details-marker { display: none; }

.asm-why summary::before {
  content: "ⓘ ";
}

.asm-why summary:focus-visible {
  outline: 2px solid var(--brand-emerald);
  outline-offset: 2px;
  border-radius: 0.2rem;
}

/* The skip control is a link when editing and a button otherwise; both should sit
   the same way. */
a.asm-skip {
  display: block;
  text-align: center;
}

/* Back is a form when it cancels a follow-up, because that changes state and a
   link must not. It has to look identical to the link version either way. */
.asm-backform { margin: 0 0 0.75rem; }

button.asm-back {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 0;
}

/* The review list. Reaching the first question should not cost twenty taps, so
   every answer is openable directly. */
.asm-back-all {
  display: block;
  margin-top: -0.4rem;
}

.asm-review {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.asm-review li {
  border-bottom: 1px solid var(--brand-border);
}

.asm-review a {
  display: block;
  padding: 0.7rem 0.2rem;
  text-decoration: none;
  color: inherit;
}

.asm-review a:hover {
  background: var(--brand-emerald-soft);
}

.asm-review-q {
  display: block;
  font-size: 0.8rem;
  color: var(--brand-muted);
}

.asm-review-a {
  display: block;
  font-weight: 600;
  color: var(--brand-ink);
}

/* Reports worth sharing. Deliberately quiet: it sits under "you are done", it is
   information rather than a task, and a list styled like a call to action would
   read as homework at the exact moment the form is trying to feel finished. */
.asm-title-small {
  font-size: 1.1rem;
}

.asm-labs {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.asm-lab {
  padding: 0.7rem 0;
  border-top: 1px solid var(--brand-emerald-soft);
}

.asm-lab:first-child {
  border-top: none;
}

.asm-lab-name {
  display: inline;
  font-weight: 600;
  color: var(--brand-ink);
}

.asm-lab-kind {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--brand-emerald-soft);
  color: var(--brand-emerald);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.asm-lab-why {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--brand-muted);
}

/* ===========================================================================
   Tasks - the work screen (prototype)

   Design rules this stylesheet is enforcing, so they survive an edit:
   - ONE list. No tabs, no lanes, no filter bar. V1's screen puts 13 controls
     in front of a dietitian before any work is visible; this puts zero.
   - The reason a row exists is ON the row. V1 hides it behind a drawer, which
     is why nobody trusts a machine-created task.
   - Lime is not used here at all. Every row carries an action, and eleven lime
     buttons would turn the brand's one call-to-action colour into wallpaper.
     Ember appears only as a 3px lateness marker - as an accent, never a button.
   =========================================================================== */

.tw-switch {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.tw-switch-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-muted);
}

.tw-switch-set {
  display: inline-flex;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: var(--brand-surface);
  padding: 0.2rem;
}

.tw-switch-option {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-muted);
  text-decoration: none;
}

.tw-switch-option:hover,
.tw-switch-option:focus {
  color: var(--brand-emerald);
}

.tw-switch-option.is-on {
  background: var(--brand-emerald);
  color: #FFFFFF;
}

.tw-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tw-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  gap: 1.25rem;
  align-items: start;
  padding: 1rem 1.25rem;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-left-width: 3px;
  border-left-color: var(--brand-border);
  border-radius: 10px;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tw-item:hover {
  border-color: var(--brand-emerald);
  box-shadow: 0 2px 10px rgba(20, 83, 45, 0.08);
}

.tw-item--late {
  border-left-color: var(--brand-ember);
}

.tw-item--today {
  border-left-color: var(--brand-gold);
}

.tw-item--soon {
  border-left-color: var(--brand-border);
}

.tw-when {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.1rem;
}

.tw-age {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-ink);
}

.tw-item--late .tw-age {
  color: #B23A1B;
}

.tw-waited {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--brand-muted);
}

.tw-body {
  min-width: 0;
}

.tw-client {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-emerald);
}

.tw-owner {
  margin-left: 0.5rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--brand-muted);
}

.tw-headline {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--brand-ink);
}

.tw-reason {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--brand-body);
}

.tw-do {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}

.tw-action {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1px solid var(--brand-emerald);
  border-radius: 6px;
  background: var(--brand-surface);
  color: var(--brand-emerald);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: default;
}

.tw-item:hover .tw-action {
  background: var(--brand-emerald);
  color: #FFFFFF;
}

.tw-signal {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-muted);
}

.tw-footnote {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border);
}

.tw-footnote p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--brand-muted);
  max-width: 60ch;
}

.tw-footnote-counts {
  color: var(--brand-body);
}

.tw-footnote-warning {
  font-weight: 600;
  color: var(--brand-emerald);
}

@media (max-width: 767px) {
  .tw-item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .tw-when {
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
  }

  .tw-do {
    align-items: flex-start;
  }
}

/* Customer Analytics */
.customer-analytics-page {
  --analytics-ink: #1f2937;
  --analytics-muted: #6b7280;
  --analytics-line: #e7e9ee;
  --analytics-brand: #4255a6;
  --analytics-organic: #3f8f75;
  --analytics-paid: #e58b56;
}

.customer-analytics-back { display: inline-block; margin-bottom: 1.5rem; color: var(--analytics-muted); text-decoration: none; }
.customer-analytics-heading, .customer-analytics-filter, .customer-analytics-card-heading { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; }
.customer-analytics-heading { margin-bottom: 2rem; }
.customer-analytics-heading h1 { margin-bottom: .55rem; color: var(--analytics-ink); }
.customer-analytics-lede { max-width: 43rem; margin: 0; color: var(--analytics-muted); font-size: 1.05rem; }
.customer-analytics-source { white-space: nowrap; color: var(--analytics-organic); font-weight: 700; font-size: .85rem; }
.customer-analytics-source span { display: inline-block; width: .55rem; height: .55rem; margin-right: .4rem; border-radius: 50%; background: currentColor; }
.customer-analytics-filter, .customer-analytics-contract, .customer-analytics-card { border: 1px solid var(--analytics-line); border-radius: 1rem; background: #fff; }
.customer-analytics-filter { align-items: center; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.customer-analytics-filter h2, .customer-analytics-card h2 { margin: 0; color: var(--analytics-ink); font-size: 1.1rem; }
.customer-analytics-filter p:not(.dashboard-section-kicker) { margin: .3rem 0 0; color: var(--analytics-muted); font-size: .85rem; }
.customer-analytics-filter-form { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.customer-analytics-filter-form label { color: var(--analytics-muted); font-size: .8rem; }
.customer-analytics-filter-form input { min-width: 9rem; padding: .48rem .55rem; border: 1px solid var(--analytics-line); border-radius: .45rem; }
.customer-analytics-alert { margin-bottom: 1rem; }
.customer-analytics-contract { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.2rem; color: var(--analytics-muted); }
.customer-analytics-contract strong { color: var(--analytics-ink); }
.customer-analytics-metrics { margin-bottom: 1.25rem; }
.customer-analytics-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.25rem; margin-bottom: 1.25rem; }
.customer-analytics-grid--lower { grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); }
.customer-analytics-card { min-width: 0; padding: 1.25rem; }
.customer-analytics-card-heading { align-items: end; margin-bottom: 1rem; }
.customer-analytics-card-heading > span { color: var(--analytics-muted); font-size: .78rem; }
.customer-analytics-bar { display: flex; height: .8rem; overflow: hidden; margin: 1.25rem 0 1rem; border-radius: 99rem; background: #f1f2f5; }
.customer-analytics-bar-organic { background: var(--analytics-organic); }
.customer-analytics-bar-paid { background: var(--analytics-paid); }
.customer-analytics-bar-width-0 { width: 0%; }
.customer-analytics-bar-width-1 { width: 5%; }
.customer-analytics-bar-width-2 { width: 10%; }
.customer-analytics-bar-width-3 { width: 15%; }
.customer-analytics-bar-width-4 { width: 20%; }
.customer-analytics-bar-width-5 { width: 25%; }
.customer-analytics-bar-width-6 { width: 30%; }
.customer-analytics-bar-width-7 { width: 35%; }
.customer-analytics-bar-width-8 { width: 40%; }
.customer-analytics-bar-width-9 { width: 45%; }
.customer-analytics-bar-width-10 { width: 50%; }
.customer-analytics-bar-width-11 { width: 55%; }
.customer-analytics-bar-width-12 { width: 60%; }
.customer-analytics-bar-width-13 { width: 65%; }
.customer-analytics-bar-width-14 { width: 70%; }
.customer-analytics-bar-width-15 { width: 75%; }
.customer-analytics-bar-width-16 { width: 80%; }
.customer-analytics-bar-width-17 { width: 85%; }
.customer-analytics-bar-width-18 { width: 90%; }
.customer-analytics-bar-width-19 { width: 95%; }
.customer-analytics-bar-width-20 { width: 100%; }
.customer-analytics-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 0; }
.customer-analytics-breakdown div { padding: .65rem; border-radius: .65rem; background: #f7f8fa; }
.customer-analytics-breakdown dt { color: var(--analytics-muted); font-size: .75rem; }
.customer-analytics-breakdown dd { margin: .15rem 0 0; color: var(--analytics-ink); font-weight: 800; }
.customer-analytics-note { margin: 1rem 0 0; color: var(--analytics-muted); font-size: .78rem; }
.customer-analytics-inline-form { display: flex; align-items: center; gap: .6rem; margin: -.3rem 0 .9rem; }
.customer-analytics-inline-form span { color: var(--analytics-muted); font-size: .75rem; }
.customer-analytics-table { margin: 0; font-size: .83rem; }
.customer-analytics-table th { color: var(--analytics-muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.customer-analytics-table td { vertical-align: middle; }
.customer-analytics-table small { display: block; color: var(--analytics-muted); font-size: .7rem; }
.customer-analytics-purchase { display: block; min-width: 10rem; }
.customer-analytics-customer-table { min-width: 820px; }
.customer-analytics-pill { display: inline-block; padding: .2rem .45rem; border-radius: 99rem; font-size: .7rem; font-weight: 700; }
.customer-analytics-pill--organic { color: #1f604e; background: #e3f2ed; }
.customer-analytics-pill--paid { color: #925127; background: #fff0e5; }
.customer-analytics-pill--unknown { color: #5d6574; background: #eef0f4; }

@media (max-width: 900px) {
  .customer-analytics-heading, .customer-analytics-filter, .customer-analytics-card-heading { flex-direction: column; align-items: stretch; }
  .customer-analytics-filter-form { flex-wrap: wrap; }
  .customer-analytics-grid, .customer-analytics-grid--lower { grid-template-columns: 1fr; }
}
