/* ─── Fonts ─── */
@font-face {
  font-family: "PP Telegraf";
  src: url("https://pub-0bbb92cb8b864441b9e912d6aa6abc2c.r2.dev/assets/fonts/PPTelegraf-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("https://pub-0bbb92cb8b864441b9e912d6aa6abc2c.r2.dev/assets/fonts/DMSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("https://pub-0bbb92cb8b864441b9e912d6aa6abc2c.r2.dev/assets/fonts/DMMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ─── Tokens ─── */
:root {
  --colour-yellow: #daff00;
  --colour-turquoise: #5bc0de;
  --colour-off-black: #2e2e2e;
  --colour-off-white: #f4f4f2;
  --colour-khaki: #d4d7c4;
  --colour-grey-01: #e4e4e0;
  --colour-grey-02: #6a6d66;
  --colour-blue-01: #96addd;
  --colour-blue-02: #6682ba;
  --colour-blue-03: #314d83;

  --tf-yellow: var(--colour-yellow);
  --tf-fixed: var(--colour-yellow);
  --tf-dynamic: var(--colour-turquoise); /* Dark text only; white text fails contrast on this fill. */
  --tf-offblack: var(--colour-off-black);
  --tf-offwhite: var(--colour-off-white);
  --tf-khaki: var(--colour-khaki);
  --tf-blue-02: var(--colour-blue-02);
  --tf-blue-03: var(--colour-blue-03);
  --tf-border: rgba(46, 46, 46, 0.14);
  --tf-muted: var(--colour-grey-02);
  --tf-status-green-bg: var(--colour-yellow);
  --tf-status-green-text: var(--colour-off-black);
  --tf-status-amber-bg: #fff4d6;
  --tf-status-amber-text: #8a5a00;
  --tf-status-red-bg: #fde8e8;
  --tf-status-red-text: #c62828;
  --tf-status-grey-bg: #ececea;
  --tf-status-grey-text: #5f615e;

  --fw-light: 300;
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;

  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;

  --leading-tight: 1.05;
  --leading-snug: 1.3;
  --leading-normal: 1.5;

  /* Layout */
  --topbar-h: 44px;
  --inner-w: min(1120px, calc(100% - 48px));
  --section-pad-y: 96px;
}

/* ─── Reset ─── */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: var(--fw-regular);
  background: var(--tf-offwhite);
  color: var(--tf-offblack);
}

.proposal-app [hidden] {
  display: none !important;
}

h1,
h2,
h3,
.cover-title,
.site-name,
.section-heading,
.hw-name {
  font-family: "PP Telegraf", system-ui, sans-serif;
  font-weight: var(--fw-regular);
}

p,
label,
li,
.section-kicker,
.cover-kicker,
.kpi-title,
.sites-header-label,
.site-contact,
.tariff-explainer,
.toggle-option,
.toggle-lock-label,
.status-pill,
.survey-label,
.gantt-task-label,
.gantt-week-label,
.next-col h4,
.supplier-explainer,
.supplier-tariff-name,
.tariff-savings-label,
.tariff-cmp-col h4,
.sites-table thead th {
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}

.kpi-value,
.site-savings-cell,
.site-payback-cell,
.site-meta,
.supplier-rates-grid .rate-value,
.tariff-rates .rate-value,
.tariff-savings-value {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:focus-visible {
  outline: 3px solid var(--tf-yellow);
  outline-offset: 2px;
}

a {
  color: var(--tf-blue-03);
}

/* ─── App shell ─── */
.proposal-app {
  height: 100%;
  overflow: hidden;
  background: var(--tf-offwhite);
}

/* ─── Topbar ─── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: rgba(244, 244, 242, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tf-border);
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
}

.brand-name {
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.back-link {
  border: 1px solid var(--tf-border);
  border-radius: 999px;
  background: transparent;
  min-height: 32px;
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--tf-offblack);
  cursor: pointer;
  white-space: nowrap;
}

.back-link:hover {
  background: var(--tf-offblack);
  color: var(--tf-offwhite);
  border-color: var(--tf-offblack);
}

.topbar-client {
  font-size: 12px;
  color: var(--tf-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--tf-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  padding: 2px;
}

.preview-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 72px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  color: var(--tf-muted);
}

.preview-link.active {
  background: var(--tf-offblack);
  color: #fff;
}

/* ─── Progress dots ─── */
.progress-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tf-khaki);
  transition: background 200ms ease, transform 200ms ease;
}

.progress-dot.active {
  background: var(--tf-offblack);
  transform: scale(1.3);
}

/* ─── Panel stack ─── */
.panel-stack {
  position: relative;
  height: calc(100% - var(--topbar-h));
  margin-top: var(--topbar-h);
  overflow: hidden;
}

.panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.panel.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ─── Loading ─── */
.loading-panel {
  padding: 24px;
  background: var(--tf-offwhite);
}

.skeleton-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.skeleton-block {
  border-radius: 10px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #e6e7e2 20%, #f0f1ed 40%, #e6e7e2 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton-block.hero  { height: 180px; }
.skeleton-block.card  { height: 110px; }
.skeleton-block.list  { height: 88px; }

@keyframes shimmer {
  0%   { background-position: 180% 0; }
  100% { background-position: -40% 0; }
}

/* ─── Full-height sections ─── */
.portfolio-panel,
.detail-panel {
  background: var(--tf-offwhite);
}

.fp-section {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fp-inner {
  width: var(--inner-w);
  margin: 0 auto;
  padding: var(--section-pad-y) 0;
}

/* fp-inner that also grows to fill flex parent */
.fp-inner--flex {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── Section typography ─── */
.section-kicker {
  margin: 0 0 12px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 5px;
  background: var(--tf-yellow);
  color: var(--tf-offblack);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-kicker--light {
  background: var(--tf-yellow);
  color: var(--tf-offblack);
}

.section-heading {
  margin: 0 0 48px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: var(--fw-regular);
}

.section-heading--light {
  color: var(--tf-offwhite);
}

/* ─── Cover section ─── */
.cover-section {
  background: radial-gradient(circle at 20% 90%, rgba(102, 130, 186, 0.14), transparent 40%),
    var(--tf-offblack);
  justify-content: center;
}

.cover-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 72px 28px 28px;
  position: relative;
}

.cover-content {
  width: min(780px, 100%);
  text-align: center;
  color: #f0f0ee;
}

.cover-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 16px;
  padding: 6px 10px;
  border-radius: 5px;
  background: var(--tf-yellow);
  color: var(--tf-offblack);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cover-title {
  margin: 0;
  font-size: clamp(36px, 8vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: var(--fw-regular);
}

.cover-rule {
  width: min(200px, 40vw);
  height: 3px;
  margin: 22px auto;
  background: var(--tf-yellow);
}

.cover-client {
  font-size: clamp(24px, 4vw, 40px);
  margin: 0;
  color: var(--tf-khaki);
  font-weight: var(--fw-regular);
}

.cover-wordmark {
  position: absolute;
  top: 40px;
  right: 44px;
  width: clamp(140px, 16vw, 220px);
  max-width: 34%;
  height: auto;
}

.cover-meta {
  margin-top: 14px;
  font-size: 15px;
  color: rgba(244, 244, 242, 0.6);
}

.cover-chevron {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--tf-yellow);
  border-bottom: 2px solid var(--tf-yellow);
  transform: translateX(-50%) rotate(45deg);
  opacity: 0.7;
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(45deg); }
  50%       { transform: translateX(-50%) translateY(7px) rotate(45deg); }
}

/* ─── Buttons ─── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 160px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--tf-border);
  background: transparent;
  color: var(--tf-offblack);
  font: inherit;
  font-size: 15px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.button.primary {
  background: var(--tf-yellow);
  border-color: var(--tf-yellow);
  color: var(--tf-offblack);
}

.button.primary:hover {
  background: #c8ec00;
  border-color: #c8ec00;
}

.button.ghost {
  margin-top: 32px;
  background: transparent;
  border: 1px solid var(--tf-yellow);
  color: #fff;
}

.button.ghost:hover {
  background: var(--tf-yellow);
  color: var(--tf-offblack);
}

/* ─── Exec Summary section ─── */
.exec-section .fp-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.exec-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 40px;
}

.exec-kpi-item {
  padding-right: 32px;
  border-right: 1px solid var(--tf-border);
  margin-right: 32px;
}

.exec-kpi-item:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.kpi-title {
  font-size: 11px;
  font-weight: var(--fw-regular);
  color: var(--tf-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 10px;
}

.kpi-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
  margin: 0 0 10px;
}

.kpi-value {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: var(--fw-regular);
}

.exec-address {
  display: none;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Hardware section / carousel ─── */
.hardware-section .fp-inner,
.tariff-fp-section .fp-inner {
  min-height: 100dvh;
}

.carousel-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.carousel-track {
  flex: 1;
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

/* ─── Hardware carousel item ─── */
.hw-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 40px 0;
}

.hw-name {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.03;
  letter-spacing: -0.025em;
  font-weight: var(--fw-regular);
}

.hw-rule {
  width: 100px;
  height: 3px;
  background: var(--tf-yellow);
  margin: 20px 0;
}

.hw-benefit {
  font-size: 17px;
  line-height: 1.45;
  margin: 0 0 28px;
}

.hw-media {
  background: var(--tf-khaki);
  border-radius: 12px;
  min-height: 340px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hw-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder {
  text-align: center;
  color: var(--tf-muted);
  padding: 24px;
  font-size: 14px;
}

/* ─── Tariff carousel item ─── */
.tariff-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.supplier-tariff-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.supplier-tariff-card {
  max-width: 920px;
  border: 1px solid var(--tf-border);
  border-radius: 14px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.4);
}

.supplier-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.supplier-name {
  margin: 0;
  font-size: clamp(24px, 3.8vw, 38px);
  font-weight: var(--fw-regular);
  letter-spacing: -0.02em;
}

.supplier-tariff-name {
  margin: 4px 0 0;
  color: var(--tf-muted);
  font-size: 15px;
}

.supplier-rates-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
}

.supplier-rates-grid li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--tf-border);
  padding-bottom: 10px;
  font-size: 15px;
}

.supplier-rates-grid .rate-label {
  color: var(--tf-muted);
}

.supplier-rates-grid .rate-value {
  font-weight: var(--fw-semibold);
}

.supplier-explainer {
  margin: 18px 0 0;
  color: var(--tf-muted);
  line-height: 1.5;
}

/* ─── Tariff comparison (used in carousel items and site detail) ─── */
.tariff-comparison {
  margin-bottom: 32px;
}

.tariff-cmp-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 48px;
  align-items: start;
}

.tariff-cmp-grid--single {
  grid-template-columns: minmax(0, 460px);
  gap: 0;
}

.tariff-cmp-col--proposed {
  display: grid;
  gap: 20px;
}

.tariff-cmp-col h4 {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--tf-offblack);
  text-transform: none;
  letter-spacing: 0.02em;
}

.tariff-rates {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.tariff-rates li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
}

.tariff-rates .rate-label {
  color: var(--tf-muted);
}

.tariff-rates .rate-value {
  font-weight: var(--fw-semibold);
}

.tariff-savings-col {
  text-align: center;
  padding-top: 8px;
}

.tariff-savings-arrow {
  font-size: 22px;
  color: var(--tf-khaki);
  margin-bottom: 16px;
  display: block;
}

.tariff-savings-value {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
  color: var(--tf-offblack);
}

.tariff-savings-label {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tf-muted);
}

.tariff-savings-inline {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.tariff-savings-inline-label {
  margin: 0;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tf-muted);
}

.tariff-savings-inline-value {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1;
  color: var(--tf-offblack);
}

.tariff-site-label {
  margin: 0 0 24px;
  font-size: 12px;
  color: var(--tf-muted);
}

/* ─── Carousel navigation ─── */
.carousel-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding-bottom: 8px;
}

.carousel-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--tf-border);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--tf-offblack);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  flex-shrink: 0;
}

.carousel-btn:hover:not(:disabled) {
  background: var(--tf-offblack);
  color: var(--tf-offwhite);
  border-color: var(--tf-offblack);
}

.carousel-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.carousel-dot-list {
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--tf-khaki);
  cursor: pointer;
  padding: 0;
  transition: background 150ms ease, transform 150ms ease;
}

.carousel-dot.active {
  background: var(--tf-offblack);
  transform: scale(1.25);
}

/* ─── Spec list (in hardware items) ─── */
.spec-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.spec-list li {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  font-size: 15px;
  padding-bottom: 0;
}

.spec-list li:last-child {
  padding-bottom: 0;
}

.spec-label {
  color: var(--tf-muted);
}

/* ─── Tariff explainer + accordion ─── */
.tariff-explainer {
  margin: 0 0 14px;
  line-height: 1.5;
  font-size: 15px;
  color: var(--tf-muted);
}

.tariff-accordion {
  margin-bottom: 12px;
}

.tariff-accordion[hidden] {
  display: none;
}

.tariff-accordion summary {
  cursor: pointer;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--fw-semibold);
  font-size: 14px;
  color: var(--tf-muted);
}

.tariff-accordion summary::before {
  content: "▸";
  font-size: 12px;
  color: var(--tf-muted);
  transition: transform 150ms ease;
}

.tariff-accordion[open] summary::before {
  transform: rotate(90deg);
}

.tariff-accordion p {
  margin: 10px 0 0;
  color: var(--tf-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Sites table section ─── */
.sites-section .fp-inner {
  display: flex;
  flex-direction: column;
}

.sites-table-wrap {
  position: relative;
  max-height: 55dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--tf-khaki) transparent;
}

.sites-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.sites-table col.sites-col-site {
  width: 36%;
}

.sites-table col.sites-col-savings {
  width: 18%;
}

.sites-table col.sites-col-payback {
  width: 18%;
}

.sites-table col.sites-col-status {
  width: 22%;
}

.sites-table col.sites-col-action {
  width: 6%;
}

.sites-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--tf-offwhite);
  text-align: left;
  padding: 0 20px 14px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tf-muted);
  border-bottom: 1px solid var(--tf-border);
  white-space: nowrap;
}

.sites-table tbody td {
  padding: 16px 20px;
  vertical-align: middle;
  font-size: 15px;
}

.sites-table thead th:first-child,
.sites-table tbody td:first-child {
  padding-left: 24px;
}

.sites-table thead th:last-child,
.sites-table tbody td:last-child {
  padding-right: 24px;
}

.sites-table tbody tr {
  cursor: pointer;
  transition: background 100ms ease;
}

.sites-table tbody tr:hover {
  background: rgba(46, 46, 46, 0.06);
}

/* Sites section header */
.sites-header {
  margin-bottom: 28px;
}

.sites-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sites-header-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tf-muted);
}

.sites-header-name {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: var(--fw-semibold);
  line-height: 1.15;
  margin: 0;
  color: var(--tf-offblack);
}

/* Table cells */
.site-name-cell {
  font-size: 18px;
  font-weight: var(--fw-semibold);
}

.site-savings-cell {
  font-size: 20px;
  font-weight: var(--fw-regular);
  white-space: nowrap;
}

.site-payback-cell {
  color: var(--tf-muted);
  font-size: 15px;
  white-space: nowrap;
}

.site-status-cell {
  white-space: nowrap;
}

.site-arrow-cell {
  color: var(--tf-muted);
  font-size: 28px;
  line-height: 1;
  text-align: left;
}

.site-name-text {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.12;
  max-width: 95%;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.site-view-button {
  display: inline-block;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--tf-offblack);
  font-size: 28px;
  font-weight: var(--fw-regular);
  line-height: 1;
  white-space: nowrap;
}

.site-view-button:hover {
  background: transparent;
  color: var(--tf-offblack);
}

@media (max-width: 640px) {
  .sites-table col.sites-col-site {
    width: 44%;
  }

  .sites-table col.sites-col-savings {
    width: 24%;
  }

  .sites-table col.sites-col-payback,
  .sites-table thead th:nth-child(3),
  .site-payback-cell {
    display: none;
  }

  .sites-table col.sites-col-status {
    width: 24%;
  }

  .sites-table col.sites-col-action {
    width: 8%;
  }
}

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

.sites-table-fade {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--tf-offwhite));
  pointer-events: none;
}

/* ─── Timeline / Gantt section ─── */
.dark-section {
  background: var(--tf-offblack);
  color: var(--tf-offwhite);
}

.gantt-wrap {
  margin-top: 0;
}

.gantt-header-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  margin-bottom: 4px;
}

.gantt-header-label {
  /* blank left cell */
}

.gantt-weeks-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.gantt-week-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(212, 215, 196, 0.7);
  padding: 0 4px 10px;
}

.gantt-task-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  min-height: 44px;
  border-top: 1px solid rgba(244, 244, 242, 0.08);
}

.gantt-task-row:first-of-type {
  border-top: none;
}

.gantt-task-label {
  font-size: 13px;
  color: rgba(244, 244, 242, 0.75);
  padding-right: 20px;
  line-height: 1.35;
}

.gantt-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  height: 28px;
  gap: 3px;
}

.gantt-bar {
  grid-column: var(--gc-start) / var(--gc-end);
  height: 22px;
  background: var(--tf-yellow);
  border-radius: 4px;
}

/* ─── Next Steps section ─── */
.next-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
  margin: 0 0 40px;
}

.next-col h4 {
  margin: 0 0 16px;
  font-weight: var(--fw-semibold);
  font-size: 15px;
}

.next-steps-intro {
  margin: 0 0 24px;
  max-width: 980px;
  line-height: 1.55;
  color: var(--tf-muted);
}

.next-col ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.next-col li {
  line-height: 1.5;
  font-size: 15px;
}

/* ─── Site detail: status pill ─── */
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  text-transform: capitalize;
  white-space: nowrap;
}

.status-complete      { background: var(--tf-status-green-bg); color: var(--tf-status-green-text); }
.status-in-progress   { background: var(--tf-status-amber-bg); color: var(--tf-status-amber-text); }
.status-issues-found  { background: var(--tf-status-red-bg);   color: var(--tf-status-red-text);   }
.status-not-started,
.status-default       { background: var(--tf-status-grey-bg);  color: var(--tf-status-grey-text);  }
.status-awaiting      { background: var(--tf-status-grey-bg);  color: var(--tf-status-grey-text);  }
.status-scheduled     { background: #dce6f5; color: #3a527a; }
.status-not-required  { background: #f0f0ee; color: #888a85; }

/* ─── Site detail panel ─── */
.detail-panel {
  background: var(--tf-offwhite);
}

.site-header-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 40px;
}

.site-name {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: var(--fw-regular);
}

.site-meta {
  margin: 0 0 8px;
  color: var(--tf-muted);
  font-size: 14px;
}

.site-contact {
  margin: 0;
  font-size: 14px;
}

.site-meta-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
  padding-top: 4px;
}

.site-meta-rail-label {
  margin: 0;
  font-size: 11px;
  color: var(--tf-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-meta-rail-value {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--tf-offblack);
}

/* Site financial KPI strip */
.site-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding-top: 32px;
}

.site-kpi-item {
  padding-right: 0;
  margin-right: 0;
}

/* ─── Detail toggles (tariff mode + capex option) ─── */
.detail-toggles {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.tariff-toggle[hidden],
.capex-toggle[hidden] { display: none; }

.tariff-toggle,
.capex-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--tf-border);
  border-radius: 999px;
  padding: 3px;
  background: transparent;
}

.toggle-option {
  border: none;
  border-radius: 999px;
  padding: 7px 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  background: transparent;
  color: var(--tf-muted);
  transition: background 120ms ease, color 120ms ease;
  white-space: nowrap;
}

.toggle-option--active {
  background: var(--colour-yellow);
  color: var(--colour-off-black);
}

.toggle-option:not(.toggle-option--active):hover {
  color: var(--tf-offblack);
}

.toggle--locked .toggle-option {
  pointer-events: none;
}

.toggle-option--locked-inactive {
  opacity: 0.6;
}

.toggle-lock-label {
  font-size: 12px;
  color: var(--tf-muted);
}

/* ─── Survey row ─── */
.survey-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 0;
}

.survey-label {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--tf-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ─── Lightbox ─── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 46, 46, 0.92);
}

.lightbox-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(900px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  gap: 16px;
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(244, 244, 242, 0.3);
  background: transparent;
  color: var(--tf-offwhite);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(244, 244, 242, 0.15);
}

.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 160px);
  overflow: hidden;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-pdf-link {
  color: var(--tf-offwhite);
  font-size: 16px;
  border-bottom: 1px dotted rgba(244, 244, 242, 0.5);
  text-decoration: none;
  padding: 40px;
}

.lightbox-footer {
  display: flex;
  align-items: center;
  gap: 20px;
}

.lightbox-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(244, 244, 242, 0.3);
  background: transparent;
  color: var(--tf-offwhite);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-btn:hover:not(:disabled) {
  background: rgba(244, 244, 242, 0.15);
}

.lightbox-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.lightbox-counter {
  color: rgba(244, 244, 242, 0.7);
  font-size: 13px;
  min-width: 48px;
  text-align: center;
}

/* ─── Hardware block: site detail ─── */
.hw-site-block {
  margin-top: 0;
  padding-top: 0;
}

/* Switch to .hw-site-block--twothirds to use the narrower layout */
.hw-site-block--full       { width: 100%; }
.hw-site-block--twothirds  { width: 66.667%; }

.hw-site-block-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.hw-site-specs .spec-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.hw-site-subheading {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tf-muted);
}

.spec-list li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: start;
}

.hw-site-image {
  border-radius: 6px;
  overflow: hidden;
  background: var(--tf-offwhite);
}

.hw-site-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.chart-mode-label {
  margin: -20px 0 20px;
  font-size: 18px;
  font-weight: var(--fw-semibold);
  color: var(--tf-offblack);
}

/* ─── Utilities ─── */
.muted {
  color: var(--tf-muted);
}

.muted-link {
  color: var(--tf-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--tf-muted);
  font-size: 14px;
}

/* ─── Error panel ─── */
.error-panel {
  background: var(--tf-offwhite);
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-card {
  width: min(680px, calc(100% - 40px));
  margin: 28px auto;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--tf-status-red-text);
  background: var(--tf-status-red-bg);
  color: var(--tf-status-red-text);
  font-size: 15px;
}

/* ─── Responsive — tablet ─── */
@media (max-width: 960px) {
  :root {
    --section-pad-y: 72px;
  }

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

  .progress-dots {
    display: none;
  }

  .exec-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 0;
  }

  .exec-kpi-item {
    padding-right: 24px;
    margin-right: 24px;
  }

  .exec-kpi-item:nth-child(2),
  .exec-kpi-item:nth-child(4) {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
  }

  .hw-item {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .supplier-rates-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hw-media {
    min-height: 240px;
  }

  .tariff-cmp-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .tariff-savings-col {
    text-align: left;
    padding-top: 0;
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .tariff-savings-arrow {
    display: none;
  }

  .site-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .detail-toggles {
    gap: 20px;
  }

  .next-steps-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .gantt-task-label {
    font-size: 12px;
  }

  .gantt-header-row,
  .gantt-task-row {
    grid-template-columns: 160px 1fr;
  }
}

/* ─── Responsive — mobile ─── */
@media (max-width: 640px) {
  :root {
    --section-pad-y: 56px;
  }

  .topbar {
    gap: 8px;
    padding: 0 10px;
  }

  .brand-name {
    display: none;
  }

  .cover-wordmark {
    top: 24px;
    right: 24px;
    width: 120px;
    max-width: 44%;
  }

  .local-preview-toggle {
    display: none;
  }

  .back-link {
    padding: 4px 8px;
    min-height: 30px;
    font-size: 11px;
  }

  .fp-inner {
    --inner-w: calc(100% - 32px);
  }

  .exec-kpi-strip {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .exec-kpi-item {
    border-right: none;
    border-bottom: 1px solid var(--tf-border);
    margin-right: 0;
    padding-right: 0;
    padding-bottom: 20px;
  }

  .exec-kpi-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .site-header-grid {
    grid-template-columns: 1fr;
  }

  .site-meta-rail {
    align-items: flex-start;
    text-align: left;
  }

  .site-kpi-strip {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-toggles {
    flex-direction: column;
    gap: 10px;
  }

  .spec-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .gantt-header-row,
  .gantt-task-row {
    grid-template-columns: 120px 1fr;
  }

  .gantt-task-label {
    font-size: 11px;
  }

  .gantt-week-label {
    font-size: 9px;
  }
}

/* ─── Savings chart ─── */
.site-chart-section {
  background: var(--colour-off-white);
}

.chart-outer {
  background: var(--colour-off-black);
  border-radius: 8px;
  padding: 40px;
  max-width: 100%;
  box-sizing: border-box;
}

.chart-outer canvas {
  display: block;
  width: 100%;
}

@media (max-width: 900px) {
  .chart-outer {
    max-width: 100%;
    padding: 24px;
  }
}

/* ─── Detail panel: remove forced full-height, reduce padding ─── */
#detail-panel .fp-section {
  min-height: unset;
  justify-content: flex-start;
}

#detail-panel .fp-inner {
  padding-top: 64px;
  padding-bottom: 64px;
}

#section-site-summary > .fp-inner {
  padding-top: 40px;
}

/* ─── Compact layout: side-by-side product + tariff cards ─── */
.compact-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.compact-card {
  border: 1px solid var(--tf-border);
  border-radius: 10px;
  padding: 32px;
  min-width: 0;
}

.compact-card--twothirds { flex: 2; }
.compact-card--onethird  { flex: 1; }

.compact-card .section-kicker {
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .compact-row {
    flex-direction: column;
  }
  .compact-card--twothirds,
  .compact-card--onethird {
    flex: unset;
    width: 100%;
  }
}
