@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'Manrope', sans-serif;
  color: #09241d;
  background: #eef8f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --deep: #082f25;
  --green: #119969;
  --green-bright: #18d184;
  --soft: #eef8f4;
  --line: #cfe5dc;
  --muted: #6c7c87;
  --muted-soft: #8fa0aa;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--soft);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(24, 209, 132, 0.24);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1538px, calc(100vw - 48px));
  min-height: 76px;
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #0b4739, #38a77b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
}

.brand-mark path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-copy strong {
  color: #08241d;
  font-size: 21px;
  font-weight: 800;
}

.brand-copy small {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.pdf-size {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfffd;
  color: var(--deep);
}

.profile-button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #35a476;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.profile-button svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.page-shell {
  width: min(1538px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.hero-banner {
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 8px;
  margin-bottom: 34px;
  padding: 38px 52px;
  border-radius: 18px;
  background:
    linear-gradient(100deg, rgba(8, 47, 37, 0.98) 0%, rgba(8, 47, 37, 0.96) 22%, rgba(18, 137, 91, 0.94) 100%),
    #083024;
  color: #ffffff;
}

.hero-banner h1 {
  margin: 0;
  font-size: 35px;
  line-height: 1.08;
  font-weight: 800;
}

.hero-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 17px;
}

.workspace,
.lower-grid {
  display: grid;
  min-width: 0;
  gap: 34px;
}

.workspace {
  grid-template-columns: 456px minmax(0, 1fr);
  align-items: start;
}

.lower-grid {
  grid-template-columns: minmax(360px, 0.52fr) minmax(520px, 1.48fr);
  margin-top: 34px;
}

.results-column {
  display: grid;
  min-width: 0;
  gap: 24px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
}

.input-panel,
.result-panel,
.composition-panel,
.warning-panel,
.curve-panel,
.table-panel {
  padding: 30px;
}

.input-panel h2,
.section-heading h2,
.empty-state h2 {
  margin: 0;
  color: #08241d;
  font-size: 20px;
  font-weight: 800;
}

.input-panel h2 {
  margin-bottom: 28px;
}

.form-stack {
  display: grid;
  gap: 24px;
}

.field,
.field-group {
  min-width: 0;
}

.field {
  display: grid;
  gap: 10px;
}

.field-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field > span:first-child,
.label-row {
  color: #09241d;
  font-size: 16px;
  font-weight: 800;
}

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

.label-row strong {
  color: var(--green-bright);
  font-size: 14px;
  white-space: nowrap;
}

.field em {
  color: var(--muted-soft);
  font-size: 14px;
  font-style: normal;
  line-height: 1.4;
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: #09241d;
  font-size: 18px;
  font-weight: 600;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input::placeholder {
  color: #8b9698;
  font-weight: 500;
}

.field input:focus {
  border-color: rgba(24, 209, 132, 0.52);
  box-shadow: 0 0 0 4px rgba(24, 209, 132, 0.1);
}

.input-shell {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(24, 209, 132, 0.52);
  box-shadow: 0 0 0 4px rgba(24, 209, 132, 0.1);
}

.input-shell input {
  flex: 1;
  width: auto;
  min-height: 54px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 14px;
}

.input-shell input:focus {
  box-shadow: none;
}

.input-shell small {
  padding-left: 14px;
  color: #8b9ca4;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.input-shell small:last-child {
  padding-right: 14px;
  padding-left: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 56px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f3faf6;
}

.segmented button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.is-active {
  background: #ffffff;
  color: var(--deep);
  box-shadow: 0 8px 20px rgba(8, 47, 37, 0.08);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-top: 4px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.primary-button {
  border: 0;
  background: var(--green-bright);
  color: #063126;
  box-shadow: 0 16px 28px rgba(24, 209, 132, 0.24);
}

.secondary-button {
  border: 1px solid rgba(24, 209, 132, 0.38);
  background: #edfbf5;
  color: #0a5d44;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.empty-state {
  min-height: 274px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 20px;
  background: #e5f6ef;
  color: var(--green-bright);
}

.empty-icon svg {
  width: 31px;
  height: 31px;
}

.empty-state p {
  max-width: 540px;
  margin: 0;
  color: #6f7d89;
  font-size: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafffc;
}

.metric.strong {
  background: linear-gradient(135deg, #082f25, #16875f);
  border-color: transparent;
  color: #ffffff;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric.strong span,
.metric.strong strong {
  color: #ffffff;
}

.metric strong {
  color: var(--deep);
  font-size: 20px;
  line-height: 1.1;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.summary-list div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.summary-list div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.summary-list dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.summary-list dd {
  margin: 0;
  color: var(--deep);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: #e9f7f1;
  color: var(--deep);
  font-size: 14px;
  font-weight: 800;
}

.composition-list {
  display: grid;
  gap: 16px;
}

.composition-item {
  display: grid;
  gap: 8px;
}

.composition-item div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.composition-item strong {
  color: var(--deep);
  text-align: right;
}

.track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6f2ec;
}

.track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-bright), #0b5d43);
}

.warning-panel {
  border-color: #f0dca9;
  background: #fffaf0;
}

.warning-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #7a5a12;
  font-weight: 650;
}

.curve {
  width: 100%;
  min-height: 220px;
}

.curve-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.table-wrapper {
  min-width: 0;
  width: 100%;
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--deep);
  color: #ffffff;
  text-align: left;
  font-size: 13px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: #f7fcfa;
}

svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 1180px) {
  .workspace,
  .lower-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .topbar-content,
  .page-shell {
    width: min(100vw - 24px, 100%);
  }

  .topbar-content {
    min-height: 70px;
  }

  .brand-copy {
    display: grid;
    gap: 2px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small,
  .pdf-size {
    display: none;
  }

  .page-shell {
    padding: 20px 0 40px;
  }

  .hero-banner {
    min-height: 132px;
    padding: 28px;
    margin-bottom: 22px;
  }

  .hero-banner h1 {
    font-size: 29px;
  }

  .hero-banner p {
    font-size: 15px;
  }

  .input-panel,
  .result-panel,
  .composition-panel,
  .warning-panel,
  .curve-panel,
  .table-panel {
    padding: 20px;
  }

  .field-group,
  .metrics-grid,
  .summary-list {
    grid-template-columns: 1fr;
  }

  .summary-list div,
  .summary-list div:nth-child(odd) {
    border-right: 0;
  }

  .summary-list div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .summary-list div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 520px) {
  .hero-banner h1 {
    font-size: 26px;
  }

  .empty-state {
    min-height: 238px;
  }

  .empty-state p {
    font-size: 16px;
  }

  .label-row,
  .summary-list div,
  .composition-item div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-list dd,
  .composition-item strong {
    text-align: left;
  }
}
