:root {
  --ink: #17202b;
  --muted: #677487;
  --panel: rgba(250, 247, 241, 0.94);
  --line: rgba(28, 39, 54, 0.10);
  --navy: #12324a;
  --teal: #137b72;
  --amber: #b16a2c;
  --red: #c24c3d;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: #f5f7f8;
}

.analysis-shell {
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px;
}

.analysis-header,
.summary-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(17, 30, 43, 0.08);
}

.analysis-header {
  padding: 22px 200px 22px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow,
.panel-kicker,
.summary-label,
.chart-note {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: var(--muted);
}

.analysis-header h1 {
  margin: 8px 0 8px;
  font-size: clamp(1.9rem, 2.8vw, 3rem);
  line-height: 1.05;
}

.header-copy,
.panel-copy,
.conclusion-list {
  color: #304050;
  line-height: 1.6;
}

.header-copy {
  margin: 0;
  max-width: 68rem;
}

.back-link {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(19, 123, 114, 0.34);
  background: linear-gradient(135deg, rgba(18, 50, 74, 0.98), rgba(19, 123, 114, 0.98));
  box-shadow: 0 18px 34px rgba(19, 123, 114, 0.28);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.back-link:hover,
.back-link:focus {
  border-color: rgba(255, 255, 255, 0.42);
  background: linear-gradient(135deg, rgba(16, 60, 88, 0.99), rgba(21, 141, 129, 0.99));
  box-shadow: 0 22px 36px rgba(19, 123, 114, 0.34);
  transform: translateY(-2px);
  outline: none;
}

.summary-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  padding: 16px 18px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.04rem;
  line-height: 1.3;
}

.impact-card {
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(249, 244, 236, 0.92));
}

.chart-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  margin-top: 16px;
  padding: 18px 20px;
}

.methodology-panel {
  margin-top: 16px;
  background: linear-gradient(180deg, rgba(247, 250, 251, 0.98), rgba(242, 247, 248, 0.94));
}

.methodology-panel h2 {
  margin: 6px 0 12px;
  line-height: 1.08;
}

.methodology-list {
  margin: 0;
  padding-left: 18px;
  color: #304050;
  line-height: 1.55;
}

.methodology-list li + li {
  margin-top: 8px;
}

.panel h2 {
  margin: 6px 0 12px;
  line-height: 1.08;
}

.panel-copy {
  margin: 0 0 14px;
}

.chart-frame {
  border-radius: 16px;
  border: 1px solid rgba(18, 50, 74, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.line-chart {
  padding: 12px;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #304050;
  font-size: 0.9rem;
  font-weight: 700;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.delta-chart {
  display: grid;
  gap: 10px;
}

.delta-header,
.delta-row {
  display: grid;
  grid-template-columns: 170px 96px 96px minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
}

.delta-header {
  padding: 0 0 6px;
  border-bottom: 1px solid rgba(18, 50, 74, 0.08);
}

.delta-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 800;
}

.delta-label {
  font-weight: 700;
  color: var(--ink);
}

.delta-num {
  text-align: right;
  font-size: 0.84rem;
  font-weight: 700;
  color: #304050;
}

.delta-axis {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      rgba(46, 154, 120, 0.12) 0%,
      rgba(46, 154, 120, 0.12) 50%,
      rgba(194, 76, 61, 0.12) 50%,
      rgba(194, 76, 61, 0.12) 100%);
  overflow: hidden;
}

.delta-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(18, 50, 74, 0.22);
}

.delta-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
}

.delta-bar.improve {
  right: 50%;
  background: linear-gradient(90deg, #1f8a69, #42af89);
}

.delta-bar.worse {
  left: 50%;
  background: linear-gradient(90deg, #d58b2c, #c24c3d);
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(18, 50, 74, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

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

thead th {
  background: #eef5f4;
  color: #0f5f58;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(18, 50, 74, 0.07);
  vertical-align: top;
  font-size: 0.9rem;
}

tbody tr:nth-child(even) {
  background: rgba(245, 249, 248, 0.76);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.good {
  background: rgba(46, 154, 120, 0.14);
  color: #14634a;
}

.tag.warn {
  background: rgba(213, 139, 44, 0.14);
  color: #8a5117;
}

.tag.bad {
  background: rgba(194, 76, 61, 0.14);
  color: #8d3428;
}

.conclusions-panel {
  position: relative;
  border-color: rgba(177, 106, 44, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.99), rgba(247, 242, 234, 0.96));
  box-shadow:
    0 24px 44px rgba(17, 30, 43, 0.10),
    0 0 0 1px rgba(177, 106, 44, 0.08);
}

.conclusions-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, #b16a2c, #d58b2c, #137b72);
}

.takeaway-banner {
  display: grid;
  gap: 4px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(177, 106, 44, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 247, 233, 0.96), rgba(255, 251, 244, 0.92));
}

.takeaway-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a5117;
}

.takeaway-banner strong {
  font-size: 1rem;
  line-height: 1.35;
  color: #4d321d;
}

.conclusions-panel h2 {
  margin: 6px 0 12px;
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
  line-height: 1.08;
}

#recommendationLong {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid rgba(19, 123, 114, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.65;
  color: #203142;
}

.conclusion-list {
  margin: 16px 0 0;
  padding-left: 0;
  list-style: none;
}

.conclusion-list li {
  position: relative;
  margin: 0;
  padding: 11px 12px 11px 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(18, 50, 74, 0.08);
}

.conclusion-list li::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 14px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(19, 123, 114, 0.92), rgba(15, 95, 88, 0.92));
  box-shadow: 0 0 0 4px rgba(19, 123, 114, 0.10);
}

.conclusion-list li + li {
  margin-top: 10px;
}

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

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

  .delta-header,
  .delta-row {
    grid-template-columns: 150px 88px 88px minmax(150px, 1fr);
    gap: 10px;
  }
}

@media (max-width: 840px) {
  .analysis-shell {
    padding: 16px;
  }

  .analysis-header {
    padding: 84px 16px 18px;
    flex-direction: column;
    align-items: stretch;
  }

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

  .delta-header {
    display: none;
  }

  .delta-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .delta-num {
    text-align: left;
  }

  .back-link {
    top: 14px;
    right: 16px;
    min-height: 44px;
    padding: 0 15px;
  }
}
