:root {
  --bg: #e8f0ef;
  --bg-2: #f8f7f2;
  --ink: #122428;
  --ink-soft: #496168;
  --brand: #0a7a68;
  --brand-deep: #05594b;
  --warn: #da7f00;
  --danger: #b22a20;
  --ok: #1f8a4c;
  --panel: rgba(255, 255, 255, 0.85);
  --border: rgba(18, 36, 40, 0.12);
  --shadow: 0 18px 44px rgba(18, 36, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 8% 10%, rgba(10, 122, 104, 0.22), transparent 44%),
    radial-gradient(circle at 88% 6%, rgba(218, 127, 0, 0.18), transparent 38%),
    linear-gradient(120deg, var(--bg), var(--bg-2));
  z-index: -1;
}

.site-header {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 1.25rem 1.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

nav {
  min-width: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
}

.nav-link.active,
.nav-link:hover {
  color: var(--brand-deep);
  background: rgba(10, 122, 104, 0.12);
}

.lang-toggle {
  min-width: 72px;
}

.page {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 1.2rem 2rem;
  display: grid;
  gap: 1rem;
  animation: rise 500ms ease;
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 1.1rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1rem;
  align-items: end;
}

.hero.compact {
  grid-template-columns: 2fr 1fr;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--brand-deep);
  margin: 0 0 0.4rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(1.3rem, 2vw, 2rem);
}

h2 {
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
}

.section-head {
  margin-bottom: 0.7rem;
}

.subtle {
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
  line-height: 1.45;
}

.upload-wrap {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

input[type="file"] {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  font-weight: 600;
  padding: 0.58rem 0.9rem;
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  color: var(--brand-deep);
  border: 1px solid rgba(5, 89, 75, 0.35);
}

.score-card {
  border: 1px solid rgba(18, 36, 40, 0.1);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.88);
}

.score-card.small {
  max-width: 220px;
  margin-left: auto;
}

.score-label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.score-value {
  font: 700 clamp(2rem, 4vw, 2.8rem) "Space Grotesk", sans-serif;
  margin: 0.3rem 0;
}

.score-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

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

.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.alert-item {
  border: 1px solid var(--border);
  border-left: 5px solid var(--warn);
  border-radius: 10px;
  padding: 0.56rem 0.62rem;
  background: rgba(255, 255, 255, 0.7);
}

.alert-item.red {
  border-left-color: var(--danger);
}

.alert-item.yellow {
  border-left-color: var(--warn);
}

.alert-item.none {
  border-left-color: var(--ok);
}

.bars {
  display: grid;
  gap: 0.7rem;
}

.bar-row {
  display: grid;
  gap: 0.3rem;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.bar-track {
  background: rgba(10, 122, 104, 0.12);
  border-radius: 999px;
  overflow: hidden;
  height: 9px;
}

.bar-fill {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #1aa687);
}

.driver-card,
.glossary-card,
.dimension-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.75);
}

.summary-panel {
  display: grid;
  gap: 0.5rem;
}

.summary-line {
  color: var(--ink-soft);
  line-height: 1.45;
}

.summary-score {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.indicator-mini-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.75);
}

.indicator-mini-card h3 {
  margin: 0;
  font-size: 0.9rem;
}

.indicator-value {
  margin-top: 0.4rem;
  font-size: 1.12rem;
  font-weight: 700;
}

.indicator-source {
  margin-top: 0.22rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.driver-card h3,
.glossary-card h3,
.dimension-card h3 {
  font-size: 0.98rem;
}

.driver-card p,
.glossary-card p,
.dimension-card p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  line-height: 1.4;
}

.dim-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.dim-chip {
  font-size: 0.76rem;
  border: 1px solid rgba(18, 36, 40, 0.16);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
}

.model-layers {
  display: grid;
  gap: 0.9rem;
}

.layer-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.72);
}

.layer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.layer-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.layer-weight {
  font-size: 0.8rem;
  border: 1px solid rgba(18, 36, 40, 0.18);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  color: var(--ink-soft);
}

.layer-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.dimension-card .score-line {
  margin-top: 0.44rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.score-pill {
  border-radius: 999px;
  padding: 0.14rem 0.52rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

.trend-up,
.trend-down,
.trend-flat {
  font-size: 0.9rem;
  font-weight: 700;
}

.trend-up {
  color: var(--ok);
}

.trend-down {
  color: var(--danger);
}

.trend-flat {
  color: var(--ink-soft);
}

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

.table-group-gap {
  margin-top: 0.9rem;
}

.table-block {
  margin-top: 0.9rem;
}

.table-wrap {
  overflow: auto;
  max-height: 320px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.table-wrap.tall {
  max-height: 420px;
}

.table-wrap.explorer {
  margin-top: 0.7rem;
  max-height: 620px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid rgba(18, 36, 40, 0.08);
  border-right: 1px solid rgba(18, 36, 40, 0.06);
  padding: 0.42rem 0.48rem;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eff5f4;
  font-weight: 600;
}

.table-empty {
  margin: 0;
  padding: 0.9rem;
  color: var(--ink-soft);
}

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sheet-tab {
  border: 1px solid rgba(5, 89, 75, 0.25);
  color: var(--brand-deep);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.sheet-tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  border-color: transparent;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  align-items: center;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.report-editor {
  width: 100%;
  min-height: 420px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.85rem;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.94rem;
  line-height: 1.45;
  resize: vertical;
}

.report-links {
  display: grid;
  gap: 0.4rem;
}

.report-item {
  border: 1px solid rgba(5, 89, 75, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.5rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.report-item-main {
  display: grid;
  gap: 0.22rem;
}

.report-date {
  font-weight: 700;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.badge {
  font-size: 0.76rem;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(18, 36, 40, 0.15);
  color: var(--ink-soft);
}

.report-link,
.report-open {
  color: var(--brand-deep);
  text-decoration: none;
  border: 1px solid rgba(5, 89, 75, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.report-link:hover,
.report-open:hover {
  background: rgba(10, 122, 104, 0.12);
}

.report-preview {
  display: grid;
  gap: 0.8rem;
}

.preview-header,
.preview-section,
.preview-tier {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.8rem;
}

.preview-header h3,
.preview-section h3,
.preview-tier h3 {
  margin: 0 0 0.5rem;
}

.preview-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.2rem;
  color: var(--ink-soft);
}

.preview-dim-card {
  margin-top: 0.45rem;
  border: 1px solid rgba(18, 36, 40, 0.1);
  border-radius: 10px;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.65);
}

.glossary-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.search-input,
.filter-select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.62rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
}

.search-input {
  min-width: 160px;
  flex: 1;
}

.subscribe-form {
  display: grid;
  gap: 0.45rem;
}

.subscribe-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.subscribe-row .search-input {
  min-width: 240px;
}

.glossary-card .term-weight {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.signal-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.78rem;
}

.signal-card h3 {
  margin: 0;
  font-size: 0.96rem;
}

.signal-card p {
  margin: 0.38rem 0 0;
  color: var(--ink-soft);
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
  }

  .hero,
  .hero.compact,
  .two-col,
  .three-col,
  .layer-dimensions {
    grid-template-columns: 1fr;
  }

  .score-card.small {
    margin-left: 0;
  }

  .cta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-item {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.8rem 0.8rem 0.45rem;
  }

  .page {
    padding: 0 0.72rem 1.2rem;
    gap: 0.7rem;
  }

  .panel {
    padding: 0.82rem;
    border-radius: 12px;
  }

  .nav-link {
    font-size: 0.84rem;
    padding: 0.4rem 0.56rem;
  }

  .lang-toggle {
    min-width: 62px;
  }

  .score-value {
    font-size: 1.92rem;
  }

  .report-editor {
    min-height: 300px;
    font-size: 0.9rem;
  }

  .report-open {
    width: 100%;
    text-align: center;
  }

  .sheet-tab {
    font-size: 0.76rem;
    padding: 0.28rem 0.52rem;
  }

  .data-table th,
  .data-table td {
    font-size: 0.78rem;
    padding: 0.34rem 0.36rem;
  }
}
