:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #19202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
}

.app-header {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 251, 0.98)),
    linear-gradient(90deg, rgba(6, 55, 109, 0.09), transparent 52%);
  border-bottom: 1px solid #d9dee7;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(460px, 1fr) minmax(190px, 240px) auto;
  min-height: 112px;
  padding: 18px clamp(18px, 4vw, 48px);
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 20px;
  min-width: 0;
}

.product-logo {
  background: linear-gradient(135deg, #05294d, #255f95 68%, #6fb4c4);
  border-radius: 16px;
  box-shadow: 0 18px 34px rgba(5, 41, 77, 0.2);
  color: #ffffff;
  flex: 0 0 auto;
  height: 76px;
  overflow: hidden;
  position: relative;
  width: 76px;
}

.product-logo::after {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 13px;
  content: "";
  inset: 6px;
  position: absolute;
}

.product-logo span {
  font-size: 1.85rem;
  font-weight: 950;
  left: 11px;
  letter-spacing: 0;
  line-height: 1;
  position: absolute;
  top: 16px;
  z-index: 1;
}

.product-logo i {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px);
  background-size: 8px 8px;
  bottom: 13px;
  height: 20px;
  left: 14px;
  opacity: 0.72;
  position: absolute;
  width: 27px;
  z-index: 1;
}

.header-visual {
  align-items: center;
  align-self: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: 76px minmax(96px, 1fr);
  min-height: 64px;
}

.visual-card,
.visual-chart {
  border: 1px solid #d3deeb;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(24, 47, 79, 0.1);
  height: 64px;
}

.visual-card {
  background: #ffffff;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.visual-card-primary {
  border-left: 5px solid #255f95;
}

.visual-line {
  background: #c8d6e6;
  border-radius: 999px;
  display: block;
  height: 7px;
  width: 82%;
}

.visual-line.short {
  width: 56%;
}

.visual-total {
  align-self: end;
  color: #05294d;
  font-size: 1.15rem;
  font-weight: 900;
}

.visual-chart {
  align-items: end;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(237, 246, 248, 0.96));
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 10px 12px;
}

.visual-chart span {
  background: linear-gradient(180deg, #255f95, #6fb4c4);
  border-radius: 5px 5px 2px 2px;
  display: block;
  width: 11px;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.suite-home-link {
  background: #ffffff;
  border: 1px solid #bdc8d9;
  border-radius: 6px;
  color: #05294d;
  font-weight: 850;
  padding: 9px 11px;
  text-decoration: none;
  white-space: nowrap;
}

.eyebrow {
  color: #4b627f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: #05294d;
  font-size: clamp(2.15rem, 3.5vw, 3.3rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin-bottom: 0;
  white-space: nowrap;
}

.brand-subtitle {
  color: #344258;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0;
  margin: 4px 0 0;
  text-transform: uppercase;
}

.publisher-mark {
  color: #66758a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-top: 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.language-control {
  align-items: center;
  display: flex;
  gap: 8px;
}

.language-control span {
  color: #344258;
  font-size: 0.9rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 93px);
}

.calc-nav {
  background: #202938;
  padding: 16px;
}

.nav-item {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #d8e0ed;
  cursor: pointer;
  display: block;
  font: inherit;
  margin-bottom: 6px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.nav-item.active,
.nav-item:hover {
  background: #ffffff;
  color: #202938;
}

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(300px, 520px) minmax(360px, 1fr);
  padding: clamp(18px, 4vw, 36px);
}

.calc-form,
.results {
  background: #ffffff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  min-width: 0;
  padding: 20px;
}

.section-heading p {
  color: #5c6a7c;
  margin-bottom: 10px;
}

.section-heading > p:nth-of-type(n + 2) {
  display: none;
}

.planning-guidance {
  background: #f7fafc;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
}

.planning-guidance h3 {
  color: #202938;
  font-size: 1rem;
  margin-bottom: 2px;
}

.planning-guidance strong {
  color: #344258;
  display: block;
  font-size: 0.84rem;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.planning-guidance p {
  color: #344258;
  font-size: 0.92rem;
  margin: 0;
}

.glossary-list {
  border-top: 1px solid #d9dee7;
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.glossary-list dl {
  display: grid;
  gap: 2px;
  margin: 0;
}

.glossary-list dt {
  color: #202938;
  font-size: 0.9rem;
  font-weight: 800;
}

.glossary-list dd {
  color: #5c6a7c;
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 0;
}

.field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: #344258;
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 6px;
}

input,
select {
  border: 1px solid #bbc5d3;
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: #2668d9;
  outline: 3px solid #d9e7ff;
}

select {
  background: #ffffff;
  cursor: pointer;
}

.primary-action {
  background: #2668d9;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-top: 18px;
  padding: 11px 16px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.secondary-action {
  background: #ffffff;
  border: 1px solid #bbc5d3;
  border-radius: 6px;
  color: #344258;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 10px;
}

.result-summary {
  background: #f0f5ff;
  border: 1px solid #bdd1ff;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px;
}

.result-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-grid div {
  min-width: 0;
}

.empty-results {
  color: #5c6a7c;
  margin-bottom: 0;
}

.result-summary span {
  color: #5c6a7c;
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
}

.result-summary strong {
  font-size: 1.35rem;
}

.chart-panel {
  border-bottom: 1px solid #d9dee7;
  margin-bottom: 22px;
  padding-bottom: 22px;
}

.chart-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 14px;
}

.chart-card h4 {
  color: #202938;
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.chart-frame {
  height: 260px;
  min-width: 0;
  position: relative;
}

table {
  border-collapse: collapse;
  font-size: 0.92rem;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e4e8ef;
  padding: 10px 8px;
  text-align: right;
  vertical-align: top;
}

th:first-child,
td:first-child,
th:last-child,
td:last-child {
  text-align: left;
}

.year-result {
  border-bottom: 1px solid #d9dee7;
  margin-bottom: 22px;
  padding-bottom: 22px;
}

.year-result:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.year-heading {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.swatch {
  border: 1px solid #bbc5d3;
  border-radius: 4px;
  display: inline-block;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
  width: 28px;
}

.swatch-code {
  color: #5c6a7c;
  font-size: 0.82rem;
  vertical-align: middle;
}

@media (max-width: 1050px) {
  .layout,
  .workspace {
    grid-template-columns: 1fr;
  }

  .calc-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .nav-item {
    margin: 0;
    min-width: 170px;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .language-control {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-grid,
  .result-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media print {
  .app-header,
  .calc-nav,
  .calc-form,
  .report-actions,
  .chart-panel {
    display: none;
  }

  .layout,
  .workspace {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .results {
    border: 0;
    padding: 0;
  }
}
