﻿@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@500;700;800&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --ink: #112d44;
  --muted: #5a7389;
  --line: #c8dceb;
  --panel: #ffffff;
  --accent: #1e96ec;
  --accent-soft: #dff0fd;
  --warning: #ff8f3f;
  --danger: #de4f4f;
  --success: #18a957;
  --bg-a: #eef8ff;
  --bg-b: #f8fbf5;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(30, 150, 236, 0.16), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(255, 143, 63, 0.14), transparent 28%),
    linear-gradient(135deg, var(--bg-a), var(--bg-b));
}

html.embedMode,
body.embedMode {
  height: auto;
  min-height: 0;
}

body.embedMode {
  background: transparent;
  min-height: 0;
  overflow: hidden;
}

.widget-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 1.1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
}

body.embedMode .widget-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.8rem;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(17, 45, 68, 0.08);
}

.controls-panel {
  padding: 1.2rem;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.badge {
  margin: 0;
  width: fit-content;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(30, 150, 236, 0.15), rgba(255, 143, 63, 0.16));
  border: 1px solid rgba(17, 45, 68, 0.1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font: 800 clamp(1.7rem, 1.1rem + 1.5vw, 2.45rem) / 1.08 "Outfit", sans-serif;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.mode-banner {
  border-radius: 18px;
  padding: 0.9rem;
  border: 1px solid rgba(17, 45, 68, 0.1);
  background: #f2f7fc;
}

.mode-banner h2 {
  margin: 0;
  font: 700 1rem/1.1 "Outfit", sans-serif;
}

.mode-banner p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.mode-banner.manual {
  background: linear-gradient(135deg, rgba(255, 143, 63, 0.14), rgba(255, 255, 255, 0.96));
}

.mode-banner.automated {
  background: linear-gradient(135deg, rgba(30, 150, 236, 0.16), rgba(255, 255, 255, 0.96));
}

.mode-banner.compare {
  background: linear-gradient(
    135deg,
    rgba(255, 143, 63, 0.14),
    rgba(30, 150, 236, 0.14) 60%,
    rgba(255, 255, 255, 0.96)
  );
}

.outcome {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(17, 45, 68, 0.06);
  font-size: 0.82rem;
  font-weight: 600;
}

.controls {
  display: grid;
  gap: 0.75rem;
}

.control {
  display: grid;
  gap: 0.35rem;
}

.hasTip {
  position: relative;
}

.control label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.84rem;
  font-weight: 600;
}

.control output {
  color: var(--muted);
  font-weight: 700;
}

.labelWithInfo {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}

.tip {
  display: none;
  margin-top: 0.12rem;
  padding: 0.56rem 0.68rem;
  border-radius: 12px;
  border: 1px solid rgba(17, 45, 68, 0.10);
  background: rgba(248, 251, 255, 0.98);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.42;
  position: relative;
  z-index: 4;
}

.hasTipOpen .tip {
  display: block;
}

.infoBtn {
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid rgba(48, 91, 132, 0.4);
  background: #f9fcff;
  color: #29557f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 800 10.5px/1 "Outfit", sans-serif;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
  line-height: 1;
  text-transform: lowercase;
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease,
    color 0.14s ease;
}

.infoBtn:hover {
  transform: translateY(-1px) scale(1.04);
  border-color: rgba(46, 98, 147, 0.58);
  background: #edf6fd;
  color: #214f78;
}

.hasTipOpen .infoBtn {
  border-color: rgba(34, 87, 137, 0.72);
  background: #2b6aa6;
  color: #fff;
}

input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

select {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.45rem 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
}

.currency-input {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 0.7rem;
  background: #fff;
}

.currency-input span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.currency-input input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 0.95rem/1 "IBM Plex Sans", sans-serif;
  padding: 0.62rem 0;
}

.currency-input input:focus {
  outline: none;
}

.currency-input:focus-within {
  border-color: rgba(30, 150, 236, 0.42);
  box-shadow: 0 0 0 3px rgba(30, 150, 236, 0.12);
}

.switch-row {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

.switch-row strong {
  display: block;
  font-size: 0.9rem;
}

.switch-row small {
  color: var(--muted);
  font-size: 0.73rem;
}

.brand-strip {
  margin-top: 0.15rem;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.62rem 0.72rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.16), transparent 38%),
    linear-gradient(135deg, #16324b, #214e74);
  border: 1px solid rgba(17, 45, 68, 0.12);
  overflow: hidden;
}

.brand-strip-logo {
  display: block;
  width: 100%;
  max-width: 88px;
  height: auto;
}

.brand-strip-copy {
  min-width: 0;
}

.brand-strip-copy p {
  margin: 0;
  color: rgba(245, 250, 255, 0.96);
  font-size: 0.72rem;
  line-height: 1.38;
}

.brand-strip-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.3rem;
  color: #effbff;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(239, 251, 255, 0.64);
}

.brand-strip-link:hover {
  opacity: 0.92;
}

.sim-panel {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.savings-top-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.6rem;
  background: linear-gradient(135deg, rgba(30, 150, 236, 0.10), rgba(255, 255, 255, 0.96));
}

.savings-title {
  margin: 0 0 0.48rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sim-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.sim-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.32rem;
  border-radius: 18px;
  border: 1px solid rgba(17, 45, 68, 0.08);
  background: linear-gradient(135deg, rgba(17, 45, 68, 0.05), rgba(255, 255, 255, 0.95));
}

.sim-actions button {
  min-height: 44px;
  box-shadow: 0 10px 20px rgba(17, 45, 68, 0.08);
  letter-spacing: 0.01em;
  transition:
    transform 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease,
    box-shadow 0.14s ease;
}

.sim-actions button:focus-visible {
  outline: none;
}

.product-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.day-counter {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.view-mode {
  margin: 0.24rem 0 0;
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
}

#resetButton {
  border: 1px solid rgba(17, 45, 68, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #eef5fb);
  color: var(--ink);
  font: 700 0.84rem/1 "IBM Plex Sans", sans-serif;
  padding: 0.7rem 0.98rem;
  cursor: pointer;
}

#resetButton:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 45, 68, 0.28);
  background: linear-gradient(180deg, #ffffff, #e6eff8);
  box-shadow: 0 12px 22px rgba(17, 45, 68, 0.12);
}

#resetButton:focus-visible {
  box-shadow:
    0 0 0 4px rgba(30, 150, 236, 0.14),
    0 12px 22px rgba(17, 45, 68, 0.12);
}

#pauseButton {
  border: 1px solid rgba(25, 103, 171, 0.48);
  border-radius: 14px;
  background: linear-gradient(135deg, #1d90e6, #52bbff);
  color: #f7fbff;
  font: 700 0.84rem/1 "IBM Plex Sans", sans-serif;
  padding: 0.7rem 1.05rem;
  cursor: pointer;
}

#pauseButton:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #177ecb, #44b1f4);
  box-shadow: 0 14px 24px rgba(30, 150, 236, 0.24);
}

#pauseButton:focus-visible {
  box-shadow:
    0 0 0 4px rgba(82, 187, 255, 0.24),
    0 14px 24px rgba(30, 150, 236, 0.24);
}

#pauseButton.is-paused {
  border-color: rgba(204, 113, 45, 0.48);
  background: linear-gradient(135deg, #ff9949, #ffc56f);
  color: #6f3517;
}

.time-progress {
  display: block;
}

.time-progress-track {
  height: 0.56rem;
  border-radius: 999px;
  border: none;
  background: rgba(203, 221, 235, 0.92);
  overflow: hidden;
}

.time-progress-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1e96ec 0%, #5dc9ff 55%, #15bf8e 100%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.35);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  transition: none;
}

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

.canvas-wrap {
  border: 1px solid rgba(17, 45, 68, 0.16);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 12%, rgba(30, 150, 236, 0.22), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(255, 143, 63, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(245, 251, 255, 0.98), rgba(232, 243, 255, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -14px 30px rgba(17, 45, 68, 0.06),
    0 16px 30px rgba(17, 45, 68, 0.10);
}

.view-block {
  display: grid;
  gap: 0.8rem;
}

.canvas-wrap.small canvas {
  width: 100%;
  height: clamp(230px, 30vw, 320px);
  display: block;
}

body.embedMode .canvas-wrap.small canvas {
  height: clamp(210px, 34vw, 290px);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  display: inline-block;
}

.swatch.normal {
  background: var(--accent);
}

.swatch.correction {
  background: var(--warning);
}

.swatch.complete {
  background: var(--success);
}

.backlog-block {
  display: grid;
  gap: 0.38rem;
}

.backlog-block.compact {
  gap: 0.3rem;
}

.backlog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.backlog-head strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.backlog-track {
  height: 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #e7f0f8;
  overflow: hidden;
}

.backlog-fill {
  height: 100%;
  width: 0%;
  transition: width 0.2s linear;
  background: linear-gradient(90deg, #32b66d, #1ea662);
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.compare-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 0.58rem;
  display: grid;
  gap: 0.52rem;
}

.compare-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.compare-card h3 {
  margin: 0;
  font: 700 0.96rem/1 "Outfit", sans-serif;
}

.compare-card header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.compare-card.manual {
  box-shadow: inset 0 0 0 1px rgba(255, 143, 63, 0.18);
}

.compare-card.automated {
  box-shadow: inset 0 0 0 1px rgba(30, 150, 236, 0.18);
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.36rem;
}

.mini-metrics p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem 0.4rem;
  background: #fff;
  display: grid;
  gap: 0.15rem;
}

.mini-metrics span {
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-metrics strong {
  font: 700 0.9rem/1 "Outfit", sans-serif;
}

.delta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.62rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(17, 45, 68, 0.06);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(17, 45, 68, 0.08);
}

.metric-card.metric-hours {
  border-color: rgba(255, 154, 73, 0.34);
  background: linear-gradient(135deg, rgba(255, 203, 154, 0.24), rgba(255, 255, 255, 0.98) 42%, rgba(255, 235, 214, 0.78));
}

.metric-card.metric-hours::before {
  background: linear-gradient(180deg, #ffb166, #ff8a48);
}

.metric-card.metric-followup {
  border-color: rgba(212, 143, 64, 0.32);
  background: linear-gradient(135deg, rgba(255, 219, 168, 0.22), rgba(255, 255, 255, 0.98) 42%, rgba(245, 234, 211, 0.78));
}

.metric-card.metric-followup::before {
  background: linear-gradient(180deg, #d99a49, #c06d36);
}

.metric-card.metric-cost {
  border-color: rgba(24, 169, 87, 0.34);
  background: linear-gradient(135deg, rgba(141, 224, 180, 0.24), rgba(255, 255, 255, 0.98) 42%, rgba(220, 247, 231, 0.8));
}

.metric-card.metric-cost::before {
  background: linear-gradient(180deg, #28bf7a, #169764);
}

.metric-card.metric-fte {
  border-color: rgba(30, 150, 236, 0.32);
  background: linear-gradient(135deg, rgba(153, 210, 247, 0.24), rgba(255, 255, 255, 0.98) 42%, rgba(224, 241, 252, 0.8));
}

.metric-card.metric-fte::before {
  background: linear-gradient(180deg, #389be7, #2c73cf);
}

.metric-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 600;
}

.metric-card.hasTip {
  display: grid;
  gap: 0;
}

.metric-card h3 .labelWithInfo {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.metric-card .tip {
  margin-top: 0.44rem;
}

.metric-card p {
  margin: 0.42rem 0 0;
  color: var(--ink);
  font: 800 1.3rem/1 "Outfit", sans-serif;
  letter-spacing: -0.02em;
}

.stats-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(17, 45, 68, 0.42);
  z-index: 40;
}

.stats-modal[hidden] {
  display: none;
}

.stats-dialog {
  width: min(760px, 100%);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 255, 0.99));
  box-shadow: 0 20px 44px rgba(17, 45, 68, 0.2);
  padding: 1rem;
  position: relative;
}

.stats-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 700 0.8rem/1 "IBM Plex Sans", sans-serif;
  cursor: pointer;
}

.stats-dialog h2 {
  margin: 0;
  font: 700 1.32rem/1 "Outfit", sans-serif;
}

.stats-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.stats-compare {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats-compare-column {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.72rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.94));
  display: grid;
  gap: 0.65rem;
}

.stats-compare-column.manual {
  box-shadow: inset 0 0 0 1px rgba(255, 143, 63, 0.16);
}

.stats-compare-column.automated {
  box-shadow: inset 0 0 0 1px rgba(30, 150, 236, 0.16);
}

.stats-compare-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.stats-compare-head p {
  margin: 0;
  font: 700 1rem/1 "Outfit", sans-serif;
}

.stats-compare-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: right;
}

.stats-compare-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.stats-compare-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.58rem;
  background: #fff;
}

.stats-compare-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.stats-compare-card p {
  margin: 0.34rem 0 0;
  font: 700 1.08rem/1 "Outfit", sans-serif;
}

.stats-summary-strip {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.stats-summary-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.68rem 0.72rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 246, 255, 0.9));
}

.stats-summary-card.highlight {
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(17, 45, 68, 0.12);
}

.stats-summary-card.highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 48%);
  pointer-events: none;
}

.stats-summary-card.highlight.hours {
  border-color: rgba(255, 154, 73, 0.42);
  background: linear-gradient(135deg, rgba(255, 190, 121, 0.3), rgba(255, 255, 255, 0.98) 42%, rgba(255, 221, 184, 0.78));
}

.stats-summary-card.highlight.cost {
  border-color: rgba(24, 169, 87, 0.42);
  background: linear-gradient(135deg, rgba(113, 218, 159, 0.28), rgba(255, 255, 255, 0.98) 42%, rgba(197, 244, 219, 0.82));
}

.stats-summary-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.stats-summary-card p {
  margin: 0.38rem 0 0;
  font: 700 1.16rem/1 "Outfit", sans-serif;
}

.stats-summary-card.highlight h3 {
  color: rgba(17, 45, 68, 0.74);
}

.stats-summary-card.highlight p {
  font-size: 1.42rem;
  letter-spacing: -0.02em;
}

.compare-card.is-stable .backlog-fill {
  background: linear-gradient(90deg, #34ba6c, #1ea95d);
}

.compare-card.is-strained .backlog-fill {
  background: linear-gradient(90deg, #ffce57, #f6a33f);
}

.compare-card.is-unstable .backlog-fill {
  background: linear-gradient(90deg, #ffac4a, #f47f2e);
}

.compare-card.is-overloaded .backlog-fill {
  background: linear-gradient(90deg, #ef6f4b, #d54141);
}

@media (max-width: 1180px) {
  .delta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .widget-shell {
    grid-template-columns: 1fr;
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }

  .sim-top {
    align-items: stretch;
    flex-direction: column;
  }

  .sim-actions {
    width: 100%;
  }

  #pauseButton,
  #resetButton {
    flex: 1 1 0;
  }

  body.embedMode .widget-shell {
    padding: 0.7rem;
  }

  .canvas-wrap.small canvas {
    height: clamp(225px, 40vw, 285px);
  }

  body.embedMode .canvas-wrap.small canvas {
    height: clamp(210px, 44vw, 270px);
  }

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

@media (max-width: 620px) {
  .widget-shell {
    padding: 0.8rem;
  }

  body.embedMode .widget-shell {
    padding: 0.55rem;
  }

  .controls-panel,
  .sim-panel {
    padding: 0.82rem;
  }

  .delta-grid,
  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .stats-compare {
    grid-template-columns: 1fr;
  }

  .stats-compare-metrics,
  .stats-summary-strip {
    grid-template-columns: 1fr;
  }

  .canvas-wrap.small canvas {
    height: clamp(205px, 54vw, 240px);
  }

  body.embedMode .canvas-wrap.small canvas {
    height: clamp(195px, 58vw, 230px);
  }

  .brand-strip {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.58rem;
    padding: 0.56rem 0.6rem;
  }

  .brand-strip-copy p,
  .brand-strip-link {
    font-size: 0.68rem;
  }
}

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