:root {
  --page: #f7f9f8;
  --card: #ffffff;
  --ink: #111b17;
  --green-950: #053b22;
  --green-700: #0c8845;
  --green-100: #eaf6ec;
  --green-50: #f4faf5;
  --muted: #5d6870;
  --line: #e0e7e3;
  --row-line: #e8edea;
  --track: #e8ecee;
  --shadow: 0 20px 55px rgba(17, 27, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top left, rgba(12, 136, 69, 0.08), transparent 34rem),
    var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  margin: 0;
  overflow: auto;
}

input {
  font: inherit;
}

.sheet-preview {
  align-items: flex-start;
  display: flex;
  min-height: 100vh;
  justify-content: center;
  overflow-x: hidden;
  padding: 16px;
}

.dashboard-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  grid-template-rows: auto auto auto auto;
  margin: 0 auto;
  max-width: 1760px;
  min-height: calc(100vh - 32px);
  min-width: 0;
  padding: 18px;
  width: 100%;
}

.hero {
  align-items: center;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, #e5f4e8, #f3faf3);
  border: 1px solid #d4e9d8;
  border-radius: 14px;
  display: flex;
  gap: 26px;
  justify-content: space-between;
  min-height: 86px;
  overflow: hidden;
  padding: 14px 28px 14px 64px;
  position: relative;
}

.hero::before {
  background: linear-gradient(180deg, #2fac61, #006f38);
  border-radius: 14px 0 0 14px;
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 24px;
}

.hero::after {
  background:
    radial-gradient(120% 90% at 100% -20%, rgba(12, 136, 69, 0.12) 0 36%, transparent 37%),
    radial-gradient(90% 80% at 96% -24%, rgba(12, 136, 69, 0.09) 0 47%, transparent 48%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.hero-title,
.brand-logo {
  position: relative;
  z-index: 1;
}

h1,
h2 {
  margin: 0;
}

h1 {
  color: var(--green-950);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(7, 43, 25, 0.12);
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 50px;
  max-width: 210px;
  object-fit: contain;
  width: 17vw;
}

.summary-card,
.table-card,
.mix-card,
.progress-card,
.comparison-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.summary-card {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 1px minmax(170px, auto);
  min-height: 92px;
  padding: 16px 30px;
}

.summary-item {
  align-items: center;
  display: flex;
  gap: 18px;
  min-width: 0;
}

.summary-item:nth-child(3) {
  padding-left: 28px;
}

.summary-icon {
  align-items: center;
  background: var(--green-100);
  border-radius: 999px;
  color: var(--green-700);
  display: flex;
  flex: 0 0 auto;
  height: 58px;
  justify-content: center;
  width: 58px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.summary-icon svg {
  height: 30px;
  width: 30px;
}

.summary-copy {
  display: block;
  min-width: 0;
}

.summary-copy span {
  color: var(--muted);
  display: block;
  font-size: 19px;
  line-height: 1.2;
  margin-bottom: 5px;
}

.summary-copy strong,
.goal-input {
  display: block;
  font-size: 26px;
  font-weight: 750;
  line-height: 1.05;
}

.goal-input {
  appearance: textfield;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--green-700);
  margin: -3px 0 0 -8px;
  padding: 3px 8px;
  width: 128px;
}

.goal-input::-webkit-outer-spin-button,
.goal-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.summary-divider {
  background: var(--line);
  height: 62px;
}

.save-panel {
  align-items: center;
  background: var(--green-100);
  border: 1px solid #cce8d3;
  border-radius: 999px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  padding: 10px 13px;
  width: fit-content;
}

.sync-dot {
  background: var(--green-700);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(12, 136, 69, 0.12);
  flex: 0 0 auto;
  height: 8px;
  width: 8px;
}

.save-status {
  color: var(--green-700);
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  max-width: 150px;
  min-width: 0;
}

.save-status[data-state="saving"] {
  color: #9b6a12;
}

.save-status[data-state="warning"] {
  color: #9b6a12;
}

.save-status[data-state="error"] {
  color: #b44b3f;
}

.content-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(760px, 1fr) minmax(320px, 380px);
  min-width: 0;
}

.left-stack {
  display: grid;
  gap: 16px;
  grid-template-rows: auto auto;
  min-width: 0;
}

.table-card {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 880px;
  width: 100%;
}

thead th {
  background: var(--green-50);
  border-bottom: 1px solid #d7e6da;
  color: var(--green-950);
  font-size: 16px;
  font-weight: 850;
  height: 46px;
  padding: 0 20px;
  text-transform: uppercase;
}

th,
td {
  border-bottom: 1px solid var(--row-line);
  font-size: 18px;
  height: 45px;
  padding: 0 20px;
  text-align: center;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

.trade-name {
  align-items: center;
  display: inline-flex;
  gap: 12px;
}

.trade-icon {
  align-items: center;
  color: var(--green-950);
  display: inline-flex;
  height: 27px;
  justify-content: center;
  width: 27px;
}

.trade-icon svg {
  height: 26px;
  stroke-width: 1.9;
  width: 26px;
}

.number-input {
  appearance: textfield;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  font-size: 18px;
  height: 32px;
  line-height: 1;
  padding: 0 8px;
  text-align: center;
  width: 66px;
}

.number-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.goal-input:focus,
.number-input:focus {
  background: #fff;
  border-color: rgba(21, 150, 79, 0.55);
  box-shadow: 0 0 0 3px rgba(21, 150, 79, 0.13);
  outline: none;
}

tfoot th,
tfoot td {
  background: var(--green-50);
  border-bottom: 0;
  color: var(--green-950);
  font-size: 18px;
  font-weight: 750;
  height: 48px;
  text-transform: uppercase;
}

.mix-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 20px;
}

.mix-visual {
  align-items: center;
  display: flex;
  justify-content: center;
}

.mix-donut {
  align-items: center;
  background: conic-gradient(#7c5fb5 0 202deg, #167a74 202deg 309deg, #3978c6 309deg 334deg, #df6b57 334deg 347deg, #d99a2b 347deg 353deg, #2e9d63 353deg 360deg);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 1px rgba(17, 27, 23, 0.06),
    0 16px 35px rgba(17, 27, 23, 0.08);
  display: flex;
  height: 170px;
  justify-content: center;
  position: relative;
  width: 170px;
}

.mix-donut::before {
  background: #fff;
  border-radius: inherit;
  content: "";
  height: 104px;
  position: absolute;
  width: 104px;
}

.donut-center {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  max-width: 92px;
  position: relative;
  text-align: center;
  z-index: 1;
}

.donut-center span,
.mix-header p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  margin: 0;
}

.donut-center strong {
  color: var(--green-950);
  font-size: 17px;
  line-height: 1.05;
}

.donut-center small {
  color: var(--green-700);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.mix-detail {
  min-width: 0;
}

.mix-header {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.mix-header h2 {
  color: var(--green-950);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: uppercase;
}

.mix-header p {
  margin-top: 5px;
}

#leaderBadge {
  background: var(--green-100);
  border-radius: 999px;
  color: var(--green-700);
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1;
  padding: 9px 12px;
  width: fit-content;
}

.mix-bars {
  display: grid;
  gap: 8px;
}

.mix-row {
  align-items: start;
  display: grid;
  gap: 9px;
  grid-template-columns: 98px minmax(74px, 1fr) 50px;
}

.mix-label {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 13px;
  font-weight: 750;
  gap: 7px;
  min-width: 0;
}

.mix-dot {
  border-radius: 999px;
  flex: 0 0 auto;
  height: 10px;
  width: 10px;
}

.mix-track {
  background: var(--track);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.mix-fill {
  border-radius: inherit;
  height: 100%;
  min-width: 2px;
  transition: width 150ms ease;
}

.mix-measures {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mix-yoy {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: flex-start;
  min-width: 0;
}

.mix-yoy span,
.mix-yoy strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.yoy-year {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  gap: 3px;
  padding: 3px 5px;
}

.yoy-year b {
  font-weight: 850;
}

.yoy-year.is-prior-year {
  background: #edf1f3;
  color: #59656f;
}

.mix-yoy > strong {
  margin-left: auto;
}

.mix-value {
  text-align: right;
}

.mix-value strong,
.mix-value span {
  display: block;
  line-height: 1;
}

.mix-value strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 4px;
}

.mix-value span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.progress-card {
  min-width: 0;
  padding: 18px 28px 16px;
}

.progress-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.progress-header h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.progress-header strong {
  background: var(--green-100);
  border-radius: 999px;
  color: var(--green-700);
  display: inline-flex;
  font-size: 20px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-width: 78px;
  padding: 9px 14px;
}

.progress-track {
  background: var(--track);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}

.progress-fill {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.13) 0 8px,
      transparent 8px 16px
    ),
    linear-gradient(180deg, #1fb55b, #069246);
  border-radius: inherit;
  height: 100%;
  transition: width 150ms ease;
  width: 14%;
}

.progress-labels {
  color: var(--muted);
  display: flex;
  font-size: 16px;
  justify-content: space-between;
  line-height: 1;
  margin-top: 12px;
}

.progress-labels span:first-child {
  color: var(--green-700);
}

.comparison-card {
  display: grid;
  gap: 16px;
  grid-column: 1 / -1;
  padding: 20px;
}

.comparison-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.comparison-header span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.comparison-header h2 {
  color: var(--green-950);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.pace-formula {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  margin: 7px 0 0;
  max-width: 360px;
}

#paceBadge {
  background: #eef7f0;
  border: 1px solid #cce8d3;
  border-radius: 999px;
  color: var(--green-700);
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
  padding: 10px 14px;
}

.comparison-chart {
  align-content: start;
  display: grid;
  gap: 14px;
  min-height: 0;
  min-width: 0;
}

.comparison-summary {
  border-bottom: 1px solid var(--row-line);
  border-top: 1px solid var(--row-line);
  display: grid;
  gap: 0;
  grid-template-columns: 1.05fr 1fr 1fr;
  padding: 12px 0;
}

.comparison-stat {
  min-width: 0;
  padding: 0 12px;
}

.comparison-stat:first-child {
  padding-left: 0;
}

.comparison-stat + .comparison-stat {
  border-left: 1px solid var(--row-line);
}

.comparison-stat span,
.comparison-stat em {
  color: var(--muted);
  display: block;
  font-style: normal;
  font-weight: 750;
  line-height: 1.1;
}

.comparison-stat span {
  font-size: 11px;
  letter-spacing: 0.03em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.comparison-stat strong {
  color: var(--green-950);
  display: block;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
  margin-bottom: 6px;
}

.comparison-stat em {
  font-size: 11px;
}

.comparison-stat.is-current strong,
.comparison-stat.is-current em {
  color: var(--green-700);
}

.comparison-svg {
  display: block;
  fill: none;
  height: auto;
  min-height: 0;
  stroke: none;
  width: 100%;
}

.comparison-svg rect,
.comparison-svg text {
  stroke: none;
}

.chart-plot {
  fill: #fbfcfb;
  stroke: var(--row-line);
  stroke-width: 1;
}

.chart-gridline line {
  stroke: #e3e9e6;
  stroke-width: 1;
}

.chart-gridline text,
.chart-label,
.chart-sublabel,
.legend-text,
.average-label,
.goal-label,
.history-range-label,
.last-year-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.chart-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.chart-sublabel {
  font-size: 11px;
}

.chart-value {
  fill: var(--green-950);
  font-size: 15px;
  font-weight: 850;
}

.chart-bar.is-entered rect {
  fill: url(#currentBar);
}

.chart-bar.is-empty rect {
  fill: #e1e7e4;
}

.chart-bar.is-entered .chart-value,
.chart-bar.is-entered .chart-label {
  fill: var(--green-700);
}

.chart-bar.is-empty .chart-value {
  fill: #8a9690;
}

.last-year-bar rect {
  fill: url(#historyBar);
  opacity: 0.92;
}

.last-year-value {
  fill: #226f96;
}

.history-range {
  fill: rgba(61, 126, 208, 0.08);
  stroke: none;
}

.history-range-label {
  fill: #226f96;
}

.last-year-line {
  stroke: #226f96;
  stroke-linecap: round;
  stroke-width: 3;
}

.last-year-label {
  fill: #226f96;
  font-weight: 850;
}

.average-line {
  stroke: #d99a2b;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
  stroke-width: 2;
}

.average-label {
  fill: #9b6a12;
  font-size: 12px;
}

.goal-line {
  stroke: #0c8845;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
  stroke-width: 2;
}

.goal-label {
  fill: var(--green-700);
}

.outlook-panel {
  background: #fbfcfb;
  border: 1px solid var(--row-line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.outlook-header {
  align-items: end;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.outlook-header span,
.outlook-row span,
.outlook-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
  line-height: 1.1;
}

.outlook-header span,
.outlook-row span {
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.outlook-header strong {
  color: var(--green-950);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.1;
}

.outlook-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--row-line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: 132px minmax(0, 1fr);
  min-height: 50px;
  padding: 10px 12px;
}

.outlook-row strong {
  color: #226f96;
  display: block;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
  margin-top: 5px;
}

.outlook-row em {
  font-size: 12px;
  text-align: right;
}

.outlook-row.is-goal strong {
  color: var(--green-700);
}

.trade-yoy-panel {
  border-top: 1px solid var(--row-line);
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
}

.trade-yoy-header {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.trade-yoy-header span,
.trade-yoy-header em,
.trade-yoy-legend,
.trade-yoy-value span {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.trade-yoy-header span {
  display: block;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.trade-yoy-header strong {
  color: var(--green-950);
  display: block;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.1;
}

.trade-yoy-legend {
  align-items: center;
  display: flex;
  gap: 14px;
}

.trade-yoy-legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.trade-yoy-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.legend-current {
  background: var(--green-700);
}

.legend-previous {
  background: #c7d1d8;
}

.trade-yoy-rows {
  display: grid;
  gap: 6px;
}

.trade-yoy-row {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: 92px minmax(0, 1fr) 48px;
}

.trade-yoy-label {
  align-items: center;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.trade-yoy-label strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-yoy-bars {
  display: grid;
  gap: 3px;
}

.trade-yoy-track {
  background: #e8eef0;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.trade-yoy-track.is-previous {
  height: 5px;
}

.trade-yoy-fill {
  background: #c7d1d8;
  border-radius: inherit;
  height: 100%;
  min-width: 2px;
}

.trade-yoy-value {
  text-align: right;
}

.trade-yoy-value strong {
  color: var(--green-950);
  display: block;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  margin-bottom: 3px;
}

.trade-yoy-value .is-up {
  color: var(--green-700);
}

.trade-yoy-value .is-down {
  color: #b44b3f;
}

@media (min-width: 1500px) {
  body {
    overflow: hidden;
  }

  .sheet-preview {
    align-items: center;
    height: 100vh;
    overflow: hidden;
  }

  .dashboard-card {
    grid-template-rows: auto auto minmax(0, 1fr);
    height: calc(100vh - 32px);
    min-height: 0;
  }

  .hero {
    min-height: 78px;
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .summary-card {
    min-height: 82px;
    padding: 12px 30px;
  }

  .content-grid {
    grid-template-columns: minmax(800px, 1fr) minmax(320px, 380px) minmax(380px, 430px);
    min-height: 0;
  }

  .left-stack {
    grid-template-rows: minmax(0, auto) auto;
  }

  .mix-card,
  .comparison-card {
    min-height: 0;
  }

  .mix-card {
    gap: 14px;
    padding: 18px;
  }

  .mix-donut {
    height: 160px;
    width: 160px;
  }

  .mix-donut::before {
    height: 96px;
    width: 96px;
  }

  .comparison-card {
    align-content: start;
    gap: 12px;
    grid-column: auto;
    overflow: hidden;
    padding: 18px;
  }

  .comparison-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .comparison-header h2 {
    font-size: 20px;
  }

  #paceBadge {
    font-size: 13px;
    padding: 9px 12px;
    white-space: normal;
  }

  .comparison-summary {
    padding: 10px 0;
  }
}

@media (max-width: 1060px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .mix-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .comparison-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sheet-preview {
    padding: 16px 10px;
  }

  .dashboard-card {
    padding: 14px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 22px 18px 22px 44px;
  }

  .brand-logo {
    max-height: 42px;
    max-width: 180px;
    width: 44vw;
  }

  .summary-card,
  .mix-card {
    grid-template-columns: 1fr;
  }

  .comparison-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #paceBadge {
    white-space: normal;
  }

  .progress-card {
    padding: 16px;
  }

  .progress-header {
    gap: 12px;
  }

  .progress-header h2 {
    font-size: 16px;
  }

  .progress-header strong {
    font-size: 18px;
    min-width: 68px;
    padding: 9px 12px;
  }

  .comparison-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .comparison-stat,
  .comparison-stat:first-child {
    padding: 0;
  }

  .comparison-stat + .comparison-stat {
    border-left: 0;
    border-top: 1px solid var(--row-line);
    padding-top: 10px;
  }

  .summary-card {
    gap: 18px;
    padding: 20px;
  }

  .summary-item:nth-child(3) {
    padding-left: 0;
  }

  .summary-divider {
    display: none;
  }
}
