/* ==========================================================================
   DUOHEAT — design tokens
   ========================================================================== */

:root {
  /* Colors */
  --color-primary: #0d2b3e;
  --color-primary-dark: #071a26;
  --color-accent: #ff5a1f;
  --color-accent-hover: #e2450d;
  --color-accent-glow: rgba(255, 90, 31, 0.25);
  --color-dark: #0a0f14;
  --color-bg: #ffffff;
  --color-surface: #f8f6f4;
  --color-surface-2: #eeebe7;
  --color-text: #2b3540;
  --color-text-light: #5a6570;
  --color-heading: #0d2032;
  --color-on-dark: #f4f6f7;
  --color-on-dark-muted: #a9b4bd;
  --color-border: rgba(13, 32, 50, 0.1);
  --color-border-on-dark: rgba(255, 255, 255, 0.14);

  /* Typography */
  --font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-h1: clamp(2.25rem, 1.7rem + 2.2vw, 3.5rem);
  --font-size-h2: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  --font-size-h3: clamp(1.375rem, 1.25rem + 0.5vw, 1.75rem);
  --font-size-body-lg: 1.125rem;
  --font-size-body: 1rem;
  --font-size-small: 0.875rem;
  --line-height-heading: 1.15;
  --line-height-body: 1.6;

  /* Spacing scale */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --container-max: 1200px;
  --nav-height: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px rgba(13, 32, 50, 0.06), 0 1px 1px rgba(13, 32, 50, 0.04);
  --shadow-md: 0 8px 24px rgba(13, 32, 50, 0.1);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-md);
  color: var(--color-heading);
  line-height: var(--line-height-heading);
  font-weight: 700;
}

h1 {
  font-size: var(--font-size-h1);
  letter-spacing: -0.01em;
}
h2 {
  font-size: var(--font-size-h2);
  letter-spacing: -0.01em;
}
h3 {
  font-size: var(--font-size-h3);
}

p {
  margin: 0 0 var(--space-md);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-accent-hover);
}

ul,
ol {
  padding-left: 1.25em;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}

.skip-link:focus {
  top: var(--space-md);
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section {
  padding-block: var(--space-3xl);
}

@media (min-width: 900px) {
  .section {
    padding-block: var(--space-4xl);
  }
}

.section--surface {
  background: var(--color-surface);
}

.section--dark {
  background: linear-gradient(160deg, var(--color-dark) 0%, var(--color-primary-dark) 55%, var(--color-dark) 100%);
  color: var(--color-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: #fff;
}

.section-eyebrow {
  display: block;
  font-size: var(--font-size-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.section-intro {
  max-width: 65ch;
  font-size: var(--font-size-body-lg);
  color: var(--color-text-light);
}

.section--dark .section-intro {
  color: var(--color-on-dark-muted);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.75em 1.5em;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--font-size-body);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.section--dark .btn-secondary {
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Header & navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--color-heading);
}

.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-heading);
  position: relative;
  transition: transform var(--transition);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-lg);
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-size-small);
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.lang-switch {
  display: flex;
  gap: var(--space-2xs);
  font-size: var(--font-size-small);
  font-weight: 700;
}

.lang-switch a {
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text-light);
}

.lang-switch a[aria-current="true"] {
  background: var(--color-surface-2);
  color: var(--color-heading);
}

/* --- Technology submenu (desktop: hover/focus dropdown) --- */
.has-submenu {
  position: relative;
}

.has-submenu > a::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin: 0;
  padding: var(--space-xs) 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 200;
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  display: block;
}

.submenu a {
  display: block;
  padding: var(--space-xs) var(--space-lg);
  white-space: nowrap;
  border-bottom: none;
}

.submenu a:hover,
.submenu a[aria-current="page"] {
  border-bottom: none;
  background: var(--color-surface);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    display: none;
    /* The menu is anchored inside the sticky header, so it cannot rely on
       page scroll — cap its height and scroll internally on short screens. */
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
  }

  .nav-links a {
    display: block;
    padding: var(--space-sm) 0;
  }

  /* On mobile the submenu is just an indented, always-visible sub-list. */
  .submenu {
    position: static;
    display: block;
    min-width: 0;
    margin: 0 0 0 var(--space-md);
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .submenu a {
    padding: var(--space-sm) 0;
  }

  .has-submenu > a::after {
    display: none;
  }

  .lang-switch {
    margin-top: var(--space-md);
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-4xl);
  background-image: radial-gradient(circle at 15% 20%, var(--color-accent-glow), transparent 45%),
    url("../assets/images/hero-bg.jpg");
  background-position: center, left center;
  background-size: auto, cover;
  background-repeat: no-repeat;
  color: var(--color-on-dark);
}

@media (max-width: 900px) {
  .hero {
    background-image: radial-gradient(circle at 15% 20%, var(--color-accent-glow), transparent 45%),
      linear-gradient(160deg, var(--color-dark) 0%, var(--color-primary-dark) 60%, var(--color-dark) 100%);
  }
}

.hero-grant {
  display: inline-block;
  font-size: var(--font-size-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-on-dark-muted);
  border: 1px solid var(--color-border-on-dark);
  border-radius: 999px;
  padding: var(--space-2xs) var(--space-md);
  margin-bottom: var(--space-lg);
}

.hero h1 {
  color: #fff;
  max-width: 18ch;
  margin-bottom: var(--space-lg);
}

.hero-lede {
  max-width: 60ch;
  font-size: var(--font-size-body-lg);
  color: var(--color-on-dark-muted);
  margin-bottom: var(--space-xl);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-lg);
  border-top: 1px solid var(--color-border-on-dark);
  padding-top: var(--space-xl);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  display: block;
}

.stat-label {
  font-size: var(--font-size-small);
  color: var(--color-on-dark-muted);
}

/* ==========================================================================
   Page hero (inner pages)
   ========================================================================== */

.page-hero {
  padding-block: var(--space-3xl) var(--space-2xl);
  background: radial-gradient(circle at 85% 10%, var(--color-accent-glow), transparent 45%),
    linear-gradient(160deg, var(--color-dark) 0%, var(--color-primary-dark) 60%, var(--color-dark) 100%);
  color: var(--color-on-dark);
}

.page-hero h1 {
  color: #fff;
  max-width: 26ch;
  margin-bottom: var(--space-sm);
}

.page-hero .section-eyebrow {
  margin-bottom: var(--space-md);
}

.page-hero-lede {
  max-width: 65ch;
  font-size: var(--font-size-body-lg);
  color: var(--color-on-dark-muted);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.card p:last-child {
  margin-bottom: 0;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.partner-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}

.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  margin-bottom: var(--space-lg);
}

.partner-logo img {
  height: 100%;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.partner-card .partner-role {
  font-weight: 700;
  color: var(--color-accent);
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: var(--space-xs);
}

.partner-card h3 {
  font-size: 1.125rem;
}

/* ==========================================================================
   Diagram section
   ========================================================================== */

.diagram-figure {
  margin: 0;
}

.diagram-caption {
  margin-top: var(--space-md);
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  text-align: center;
}

/* ==========================================================================
   Image placeholders (photos pending)
   ========================================================================== */

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  aspect-ratio: 4 / 3;
  background: var(--color-surface-2);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-light);
  text-align: center;
  padding: var(--space-lg);
}

.image-placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--color-text-light);
}

.image-placeholder-label {
  font-size: var(--font-size-small);
  font-weight: 600;
}

figure {
  margin: 0;
}

figure figcaption {
  margin-top: var(--space-sm);
  font-size: var(--font-size-small);
  color: var(--color-text-light);
}

/* ==========================================================================
   Chart legend
   ========================================================================== */

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--color-text);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.chart-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend-dot--accent {
  background: #e2450d;
}

.chart-legend-dot--muted {
  background: #6b7580;
}

/* ==========================================================================
   Data table
   ========================================================================== */

.table-scroll {
  overflow-x: auto;
  margin-top: var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-small);
  background: #fff;
}

.data-table caption {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
  color: var(--color-heading);
  border-bottom: 1px solid var(--color-border);
}

.data-table th,
.data-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}

.data-table thead th {
  color: var(--color-text-light);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table-highlight th,
.data-table-highlight td {
  background: rgba(226, 69, 13, 0.08);
  font-weight: 700;
  color: var(--color-heading);
}

/* ==========================================================================
   Articles & quotes
   ========================================================================== */

.news-item .news-meta {
  display: block;
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.news-item h2 {
  margin-bottom: var(--space-lg);
}

blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-xl);
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--font-size-body-lg);
  color: var(--color-heading);
}

blockquote p {
  margin: 0;
}

blockquote cite {
  display: block;
  margin-top: var(--space-sm);
  font-style: normal;
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--color-text-light);
}

.contact-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}

.contact-card h3 {
  font-size: 1.125rem;
}

/* ==========================================================================
   Press coverage / media cards
   ========================================================================== */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.media-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.media-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-surface-2);
}

.media-card-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.media-card-source {
  display: block;
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.media-card h3 {
  font-size: 1.0625rem;
  margin-bottom: var(--space-sm);
}

.media-card p {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  flex: 1;
}

.media-card a.media-card-link {
  margin-top: var(--space-sm);
  font-size: var(--font-size-small);
  font-weight: 700;
}

.dg-label {
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
  fill: var(--color-heading);
}

.dg-label-small {
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  fill: var(--color-text-light);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--color-dark);
  color: var(--color-on-dark-muted);
  padding-block: var(--space-3xl) var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-grid h4 {
  color: #fff;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li + li {
  margin-top: var(--space-xs);
}

.footer-grid a {
  color: var(--color-on-dark-muted);
  text-decoration: none;
  font-size: var(--font-size-small);
}

.footer-grid a:hover {
  color: #fff;
}

.funding-note {
  font-size: var(--font-size-small);
  border-top: 1px solid var(--color-border-on-dark);
  padding-top: var(--space-xl);
  line-height: 1.6;
}

.funding-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-lg);
  width: fit-content;
  max-width: 100%;
}

.funding-logo {
  height: 32px;
  width: auto;
}

.funding-separator {
  align-self: stretch;
  width: 1px;
  background: var(--color-border);
}

.copyright {
  margin-top: var(--space-lg);
  font-size: var(--font-size-small);
}

/* ==========================================================================
   Interactive tool panel (e.g. cascade cycle calculator)
   ========================================================================== */

.tool-panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.tool-panel-lang-note {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
}

/* Cascade cycle calculator — scoped to avoid leaking into the rest of the site */
@keyframes cascade-fm {
  to { stroke-dashoffset: -48; }
}

.cascade-tool .b {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.2;
}

.cascade-tool .f {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 8 16;
  animation: cascade-fm 1.5s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cascade-tool .f {
    animation: none;
  }
}

.cascade-tool .mc {
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.cascade-tool .mc span {
  display: block;
  font-size: 12px;
  color: var(--color-text-light);
}

.cascade-tool .mc b {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-heading);
}

.cascade-tool .ax {
  font-size: 11px;
  fill: var(--color-text-light);
}

.cascade-tool .at {
  font-size: 12px;
  fill: var(--color-text-light);
}

.cascade-tool .pl {
  font-size: 11px;
  font-weight: 700;
}

.cascade-tool .th {
  font-size: 13px;
  font-weight: 700;
  fill: var(--color-heading);
}

.cascade-tool .ts {
  font-size: 11px;
  fill: var(--color-text-light);
}

.cascade-tool .arr {
  fill: none;
  stroke-width: 1.3;
}

.cascade-tool .c-red {
  fill: rgba(226, 75, 74, 0.08);
  stroke: #e24b4a;
}

.cascade-tool .c-purple {
  fill: rgba(127, 119, 221, 0.1);
  stroke: #7f77dd;
}

.cascade-tool .c-blue {
  fill: rgba(55, 138, 221, 0.08);
  stroke: #378add;
}

.cascade-tool .c-gray {
  fill: var(--color-surface-2);
  stroke: #5f5e5a;
}

.cascade-tool .rw {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0.7rem;
}

.cascade-tool .rw label {
  font-size: 14px;
  color: var(--color-text-light);
  min-width: 150px;
}

.cascade-tool .rw output {
  font-size: 14px;
  font-weight: 700;
  min-width: 74px;
  text-align: right;
  color: var(--color-heading);
}

.cascade-tool .rw button {
  font-family: var(--font-family);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

.cascade-tool .rw button:hover {
  background: var(--color-accent-hover);
}

.cascade-tool .rw select,
.cascade-tool .rw input[type="range"] {
  font-family: var(--font-family);
}

.cascade-tool .wn {
  color: #c1613a;
  font-weight: 700;
}

/* On narrow screens the diagrams would scale their labels below legibility —
   give each one a minimum width and let it scroll inside its own container. */
.cascade-tool .svg-scroll {
  overflow-x: auto;
}

.cascade-tool .svg-scroll svg {
  min-width: 300px;
  display: block;
}

.cascade-tool .cascade-schematic svg {
  min-width: 340px;
  max-width: 480px;
}

/* The schematic's inner content is wrapped in a scale(0.8) group to compact
   its layout further; bump these font sizes by 1/0.8 so the rendered glyph
   size is unchanged. */
.cascade-tool .cascade-schematic .th {
  font-size: 16px;
}

.cascade-tool .cascade-schematic .ts {
  font-size: 14px;
}

.cascade-tool .cascade-schematic .at {
  font-size: 15px;
}

.cascade-tool .cascade-charts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.cascade-tool .cascade-charts .svg-scroll {
  flex: 0 1 330px;
}
