:root {
  --bg: #eef1ed;
  --bg-strong: #f7f8f5;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --line: #d7ddd4;
  --line-strong: #b6c1b6;
  --ink: #17211d;
  --muted: #64726b;
  --accent: #0c6661;
  --accent-soft: #dbeae5;
  --warm: #dd9a2c;
  --critical: #b55239;
  --shadow: 0 18px 40px rgba(22, 35, 32, 0.06);
  --radius: 20px;
  --radius-sm: 12px;
  --strict: #0c6661;
  --strict-soft: #dcefea;
  --extended: #c67e1f;
  --extended-soft: #f6ead7;
  --warm-soft: #f6ead7;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(12, 102, 97, 0.09), transparent 28%),
    radial-gradient(circle at bottom right, rgba(160, 180, 150, 0.12), transparent 24%),
    linear-gradient(180deg, #f5f6f2 0%, #e8ece7 100%);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

html {
  scrollbar-gutter: stable;
}

body {
  padding: clamp(0.85rem, 1.5vw, 1.25rem);
  overflow-x: clip;
}

a,
button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88em;
  background: #eef5f3;
  border: 1px solid #d8e3e0;
  border-radius: 7px;
  padding: 0.1rem 0.35rem;
}

button {
  border: 0;
  background: none;
  color: inherit;
}

.page-shell {
  width: min(1480px, 100%);
  margin-inline: auto;
  display: grid;
  gap: 1.1rem;
}

.page-shell > * {
  min-width: 0;
}

.brand-bar,
.panel,
.hero-card,
.summary-card,
.tier-card,
.highlight-card,
.history-card,
.minor-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.brand-bar {
  border-radius: calc(var(--radius) + 4px);
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background:
    radial-gradient(circle at top left, rgba(126, 200, 196, 0.14), transparent 26%),
    linear-gradient(135deg, #103a39 0%, #0c5450 52%, #0c6661 100%);
  border-color: rgba(8, 53, 50, 0.62);
  box-shadow:
    0 22px 44px rgba(16, 43, 41, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.brand-bar::after {
  content: "";
  position: absolute;
  inset: auto -5% -35% auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(151, 223, 217, 0.18) 0%, rgba(151, 223, 217, 0) 68%);
  pointer-events: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

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

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem 0.9rem;
  flex-wrap: wrap;
}

.brand-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand-nav {
  margin-left: auto;
}

.brand-nav-checkbox,
.brand-nav-toggle {
  display: none;
}

.brand-mark {
  width: 30px;
  height: 38px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, #b9f0f2 0%, #59b3b7 42%, #13857f 100%);
  border-radius: 55% 55% 60% 60% / 72% 72% 42% 42%;
  transform: rotate(45deg);
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    0 10px 20px rgba(6, 31, 31, 0.22);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px 10px auto auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.brand-kicker,
.eyebrow,
.pill,
.table-copy,
.table-empty {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-kicker,
.eyebrow {
  color: var(--muted);
}

.brand-kicker {
  color: rgba(230, 255, 250, 0.76);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
  color: #f7fffd;
}

h2 {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.brand-subtitle,
.section-copy,
.section-lead,
.hero-copy,
.method-list p,
.guidance-list p,
.summary-copy,
.tier-copy,
.highlight-copy,
.history-copy,
.minor-copy,
.table-copy {
  color: var(--muted);
  line-height: 1.5;
}

.brand-subtitle {
  max-width: 760px;
  margin-top: 0.4rem;
  color: rgba(234, 252, 248, 0.82);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.78rem 1rem;
  border: 1px solid rgba(198, 241, 235, 0.32);
  border-radius: 14px;
  background: rgba(246, 253, 251, 0.12);
  color: #f1fcfa;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  text-decoration: none;
}

.brand-button:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.brand-nav-toggle:focus-visible {
  outline: 2px solid rgba(213, 248, 244, 0.46);
  outline-offset: 2px;
}

.brand-button-secondary {
  background: rgba(246, 253, 251, 0.08);
}

.brand-button-current {
  background: rgba(245, 255, 252, 0.95);
  color: #0d3f3d;
  border-color: rgba(198, 241, 235, 0.5);
}

.brand-button[data-emoji] {
  position: relative;
  overflow: hidden;
}

.brand-button[data-emoji]::after {
  content: attr(data-emoji);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  color: #f4fffc;
  font-size: 1.1rem;
  transition: opacity 120ms ease;
}

.brand-button-current[data-emoji]::after {
  color: #0d3f3d;
}

@media (hover: hover) {
  .brand-button[data-emoji]:hover {
    color: transparent;
  }

  .brand-button[data-emoji]:hover::after {
    opacity: 1;
  }
}

.hero-grid,
.content-grid,
.summary-grid,
.tier-grid,
.history-grid {
  display: grid;
  gap: 1rem;
}

.hero-grid,
.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.hero-card,
.panel {
  border-radius: var(--radius);
  padding: 1.2rem;
  min-width: 0;
}

.hero-card-primary {
  background:
    radial-gradient(circle at top left, rgba(12, 102, 97, 0.12), transparent 40%),
    linear-gradient(135deg, rgba(219, 234, 229, 0.82) 0%, rgba(255, 255, 255, 0.96) 56%, rgba(242, 247, 245, 0.98) 100%);
  border-color: rgba(12, 102, 97, 0.12);
}

.hero-card-primary h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  max-width: 11ch;
}

.hero-copy {
  margin-top: 0.75rem;
  max-width: 58ch;
  font-size: 1.03rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(12, 102, 97, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.method-list,
.guidance-list {
  display: grid;
  gap: 0.8rem;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.05rem;
}

.section-head > * {
  min-width: 0;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.summary-divider {
  height: 1px;
  margin: 1.05rem 0 1.1rem;
  background: linear-gradient(90deg, rgba(182, 193, 182, 0.18) 0%, rgba(182, 193, 182, 0.68) 20%, rgba(182, 193, 182, 0.68) 80%, rgba(182, 193, 182, 0.18) 100%);
}

.section-lead {
  width: 100%;
  margin: 0 0 1.1rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
}

.summary-card,
.tier-card,
.highlight-card,
.history-card,
.minor-card {
  border-radius: 18px;
  padding: 1rem;
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 248, 245, 0.98) 100%);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 999px;
  background: rgba(12, 102, 97, 0.18);
}

.summary-card[data-tone="core"]::before {
  background: var(--strict);
}

.summary-card[data-tone="extended"]::before {
  background: var(--extended);
}

.summary-card[data-tone="history"]::before {
  background: #3d7a8c;
}

.summary-card[data-tone="minor"]::before {
  background: var(--critical);
}

.summary-value,
.tier-value,
.history-value {
  margin-top: 0.5rem;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.summary-copy,
.tier-copy {
  margin-top: 0.42rem;
}

.summary-card strong,
.tier-card strong,
.minor-copy strong {
  color: var(--ink);
}

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

.tier-grid-shell {
  position: relative;
}

.tier-operator {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(247, 248, 245, 0.94);
  box-shadow:
    0 16px 28px rgba(22, 35, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tier-operator-plus {
  left: 33.333%;
}

.tier-operator-equals {
  left: 66.666%;
}

.tier-card {
  border: 1px solid var(--line);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  padding: 1.4rem 1.3rem;
}

.tier-card[data-tier="useful_selection"] {
  background:
    radial-gradient(circle at top left, rgba(151, 223, 217, 0.2), transparent 34%),
    linear-gradient(150deg, #103a39 0%, #0c5450 52%, #0c6661 100%);
  border-color: rgba(8, 53, 50, 0.34);
  color: #f5fbff;
  box-shadow:
    0 22px 44px rgba(16, 43, 41, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tier-card[data-tier="minor_contracts"] {
  background:
    radial-gradient(circle at top left, rgba(255, 243, 214, 0.26), transparent 34%),
    linear-gradient(150deg, #9b6716 0%, #c8841f 58%, #dd9a2c 100%);
  border-color: rgba(157, 104, 21, 0.28);
  color: #fffaf1;
  box-shadow:
    0 22px 44px rgba(104, 72, 18, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tier-card[data-tier="total_contracts"] {
  background:
    radial-gradient(circle at top left, rgba(151, 223, 217, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 236, 194, 0.22), transparent 38%),
    linear-gradient(160deg, rgba(219, 234, 229, 0.96) 0%, rgba(255, 248, 235, 0.96) 100%);
  border-color: rgba(139, 152, 121, 0.24);
  color: var(--ink);
  box-shadow:
    0 18px 38px rgba(22, 35, 32, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.tier-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.tier-card .tier-value {
  margin-top: 0;
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  line-height: 0.92;
}

.tier-card[data-tier="useful_selection"] .tier-value,
.tier-card[data-tier="minor_contracts"] .tier-value,
.tier-card[data-tier="total_contracts"] .tier-value,
.tier-card[data-tier="useful_selection"] .tier-title,
.tier-card[data-tier="minor_contracts"] .tier-title,
.tier-card[data-tier="total_contracts"] .tier-title {
  color: inherit;
}

.highlight-list,
.minor-list {
  display: grid;
  gap: 0.9rem;
}

.highlight-card,
.minor-card {
  display: grid;
  gap: 0.6rem;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.highlight-card:hover,
.minor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 40px rgba(22, 35, 32, 0.09);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.pill-tier-strict_core {
  color: var(--strict);
  background: var(--strict-soft);
  border-color: rgba(12, 102, 97, 0.18);
}

.pill-tier-extended_relevant {
  color: #9a6113;
  background: var(--extended-soft);
  border-color: rgba(198, 126, 31, 0.22);
}

.pill-kind-minor {
  color: var(--critical);
  background: #f5e3de;
  border-color: rgba(181, 82, 57, 0.2);
}

.amount {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.card-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
}

.text-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.5rem 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(12, 102, 97, 0.16);
  background: rgba(219, 234, 229, 0.72);
  white-space: nowrap;
}

.procurement-table td:nth-child(7) {
  white-space: nowrap;
}

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

.history-card {
  background: linear-gradient(180deg, rgba(12, 102, 97, 0.06) 0%, rgba(255, 255, 255, 0.96) 100%);
  position: relative;
}

.history-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(12, 102, 97, 0.55) 0%, rgba(12, 102, 97, 0) 78%);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.filter-chip.is-active {
  color: var(--accent);
  border-color: rgba(12, 102, 97, 0.28);
  background: var(--accent-soft);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.filter-field {
  display: grid;
  gap: 0.42rem;
  min-width: min(220px, 100%);
}

.filter-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.procurement-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.table-pill-stack {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}

.procurement-table th,
.procurement-table td {
  padding: 0.9rem 0.95rem;
  border-bottom: 1px solid rgba(215, 221, 212, 0.88);
  text-align: left;
  vertical-align: top;
}

.procurement-table thead th {
  position: sticky;
  top: 0;
  background: rgba(246, 248, 244, 0.96);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.procurement-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.56);
}

.procurement-table tbody tr:hover {
  background: rgba(219, 234, 229, 0.38);
}

.table-title {
  font-weight: 700;
  line-height: 1.4;
}

.table-empty {
  padding: 1.2rem;
  color: var(--muted);
  text-align: center;
}

.error-card {
  border-radius: 18px;
  padding: 1rem;
  border: 1px solid rgba(181, 82, 57, 0.2);
  background: rgba(245, 227, 222, 0.8);
  color: var(--critical);
}

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

@media (max-width: 980px) {
  body {
    padding: 0.75rem;
  }

  .brand-bar,
  .hero-grid,
  .content-grid,
  .section-head {
    display: grid;
  }

  .brand-bar {
    align-items: stretch;
    gap: 0.75rem;
  }

  .brand-lockup {
    width: 100%;
    gap: 0.7rem;
  }

  .brand-mark {
    width: 24px;
    height: 30px;
  }

  .brand-mark::after {
    inset: 6px 8px auto auto;
    width: 6px;
    height: 6px;
  }

  .brand-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .brand-copy h1 {
    font-size: 1.65rem;
  }

  .brand-title-row {
    gap: 0.5rem 0.65rem;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-actions {
    margin-left: 0;
    width: 100%;
    display: none;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-top: 0.65rem;
  }

  .brand-nav {
    width: 100%;
    margin-left: 0;
  }

  .brand-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0.68rem 0.84rem;
    border: 1px solid rgba(198, 241, 235, 0.32);
    border-radius: 14px;
    background: rgba(239, 251, 248, 0.14);
    color: #f4fffc;
    font-weight: 800;
    cursor: pointer;
  }

  .brand-nav-toggle::after {
    content: "+";
    font-size: 1rem;
    line-height: 1;
  }

  .brand-nav-checkbox:checked + .brand-nav-toggle::after {
    content: "−";
  }

  .brand-nav-checkbox:checked + .brand-nav-toggle + .brand-actions {
    display: grid;
  }

  .brand-button {
    width: 100%;
    min-height: 40px;
    padding: 0.62rem 0.82rem;
    font-size: 0.92rem;
  }

  .hero-grid,
  .content-grid,
  .summary-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }

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

  .tier-operator {
    display: none;
  }

  .section-head {
    justify-content: flex-start;
  }

  .filter-field {
    width: 100%;
  }
}
