/* ============================================================
   CHARTS — canvas container styles
   ============================================================ */

/* ── Bank holiday date dropdown (results breakdown) ────────── */
.bh-detail-list { margin-top: 6px; padding: 0; }

.bh-detail-list__toggle {
  font-size: var(--text-xs);
  color: var(--c-primary);
  cursor: pointer;
  display: inline;
}

.bh-detail-list__list {
  margin-top: 6px;
  padding-left: 0;
  list-style: none;
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  line-height: 1.8;
}

/* ── Donut chart ─────────────────────────────────────────── */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.donut-canvas-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
}

.donut-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-centre {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-centre__value {
  font-family: var(--font-num);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.donut-centre__label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* ── Line chart (step 4) ─────────────────────────────────── */
.line-chart-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2.5 / 1;
  min-height: 120px;
}

.line-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Chart section (step 4) ──────────────────────────────── */
.chart-section {
  margin-top: var(--sp-6);
}

.chart-section__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--sp-1);
}

.chart-section__desc {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-3);
}

/* ── Results dashboard ───────────────────────────────────── */
.results-hero {
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
  background: linear-gradient(135deg, var(--c-primary-light) 0%, var(--c-surface) 60%);
  border: 1px solid var(--c-primary);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-6);
  position: relative;
  overflow: hidden;
}

.results-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: var(--r-full);
  background: radial-gradient(circle, rgb(0 109 119 / 0.18) 0%, rgb(0 109 119 / 0.04) 70%);
  pointer-events: none;
}

.results-hero__days {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  animation: countUp var(--dur-slow) var(--ease-out);
}

.results-hero__hrs {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--c-text-secondary);
  margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
}

.results-hero__context {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-3);
  line-height: var(--leading-snug);
}

@keyframes countUp {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Day basis label — "(7.5 hr working day)" */
.results-hero__day-basis {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-left: var(--sp-1);
}

/* Toggle to switch between standard day and ACAS average */
.day-toggle-btn {
  display: inline-block;
  margin-top: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--c-primary);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.8;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.day-toggle-btn:hover { opacity: 1; }

/* ── Breakdown accordion ─────────────────────────────────── */
.breakdown {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.breakdown__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-surface-2);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--c-text);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.breakdown__toggle:hover { background: var(--c-surface-3); }

.breakdown__toggle svg {
  width: 16px;
  height: 16px;
  color: var(--c-text-muted);
  transition: transform var(--dur-normal) var(--ease-out);
}

.breakdown__toggle--open svg { transform: rotate(180deg); }

.breakdown__body {
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.breakdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.breakdown__row--total {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  font-weight: 700;
  font-size: var(--text-base);
}

.breakdown__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.breakdown__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-text-secondary);
  flex: 1;
}

.breakdown__value {
  font-family: var(--font-num);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.breakdown__value--positive { color: var(--c-success); }
.breakdown__value--negative { color: var(--c-warning); }

/* ── Methodology disclosure ──────────────────────────────── */
.methodology {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.methodology__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
  gap: var(--sp-2);
}

.methodology__toggle:hover { background: var(--c-surface-3); }
.methodology__toggle svg { width: 14px; height: 14px; flex-shrink: 0; }
.methodology__toggle .chevron {
  transition: transform var(--dur-normal) var(--ease-out);
}
.methodology__toggle--open .chevron { transform: rotate(180deg); }

.methodology__body {
  padding: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  line-height: var(--leading-normal);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.methodology__body p { color: var(--c-text-secondary); }

.methodology__body a {
  font-size: var(--text-xs);
}

/* ── Action buttons ──────────────────────────────────────── */
.results-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-lg);
  font-size: var(--text-base);
  font-weight: 700;
  background: var(--c-primary);
  color: white;
  min-height: 48px;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--c-primary-alt);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary svg { width: 18px; height: 18px; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  color: var(--c-text);
  min-height: 44px;
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--c-surface-3);
  border-color: var(--c-border-strong);
}

.btn-secondary svg { width: 16px; height: 16px; }

.actions-row {
  display: flex;
  gap: var(--sp-3);
}

.actions-row .btn-secondary { flex: 1; }

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--c-text-muted);
  min-height: 44px;
  transition: color var(--dur-fast) var(--ease-out);
  cursor: pointer;
  width: 100%;
}

.btn-ghost:hover { color: var(--c-text); }
.btn-ghost svg { width: 16px; height: 16px; }

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  background: transparent;
  border: 1.5px solid var(--c-border);
  color: var(--c-text-secondary);
  min-height: 44px;
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-light);
}

.btn-outline svg { width: 16px; height: 16px; }

.results-new-calc {
  text-align: center;
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--c-border);
  margin-top: var(--sp-2);
}

/* ── Disclaimer ──────────────────────────────────────────── */
.disclaimer {
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-warning-light);
  border: 1px solid var(--c-warning);
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  line-height: var(--leading-normal);
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.disclaimer svg { width: 14px; height: 14px; color: var(--c-warning); flex-shrink: 0; margin-top: 1px; }

/* ── Toast notification ─────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--c-text);
  color: var(--c-surface);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform var(--dur-normal) var(--ease-spring),
              opacity var(--dur-normal) var(--ease-out);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast svg { width: 16px; height: 16px; }
