:root {
  --bg: #f4efe6;
  --panel: rgba(255, 250, 244, 0.86);
  --panel-strong: #fff8ef;
  --text: #1d2936;
  --muted: #5f6f7d;
  --line: rgba(29, 41, 54, 0.12);
  --primary: #14532d;
  --primary-soft: #d3f2db;
  --secondary: #0f766e;
  --accent: #a16207;
  --danger: #b91c1c;
  --shadow: 0 24px 60px rgba(29, 41, 54, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(20, 83, 45, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(161, 98, 7, 0.16), transparent 28%),
    linear-gradient(135deg, #f8f3ea 0%, #ece4d7 100%);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  padding: 20px 4px 32px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
}

.hero-copy {
  max-width: 760px;
  margin: 16px 0 0;
  line-height: 1.7;
  color: var(--muted);
  font-size: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.form-panel,
.status-panel,
.metric-card,
.results .panel {
  animation: rise 0.55s ease both;
}

.form-panel {
  padding: 24px;
}

.estimate-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.estimate-form label {
  display: grid;
  gap: 8px;
}

.estimate-form span,
.metric-label,
.section-head h3 {
  font-weight: 700;
}

input,
button {
  border: none;
  border-radius: 18px;
  font: inherit;
}

input {
  width: 100%;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  outline: none;
}

input:focus {
  border-color: rgba(20, 83, 45, 0.35);
  box-shadow: 0 0 0 4px rgba(20, 83, 45, 0.08);
}

button {
  cursor: pointer;
  padding: 15px 22px;
  font-weight: 700;
  color: #fff9f0;
  background: linear-gradient(135deg, #14532d, #0f766e);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.24);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.helper,
.muted,
.disclaimer,
.metric-foot,
#statusText {
  color: var(--muted);
}

.helper {
  margin: 14px 2px 0;
  font-size: 14px;
}

.status-panel {
  margin-top: 18px;
  padding: 18px 22px;
}

.results {
  margin-top: 24px;
}

.hidden {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.two-columns {
  grid-template-columns: 1.15fr 0.85fr;
}

.metric-card {
  padding: 22px;
}

.metric-card.accent {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 36%),
    linear-gradient(135deg, rgba(20, 83, 45, 0.96), rgba(15, 118, 110, 0.88));
  color: #fffcf4;
}

.metric-card.accent .metric-foot,
.metric-card.accent .metric-label {
  color: rgba(255, 252, 244, 0.82);
}

.metric-card h2 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 3vw, 40px);
}

.results .panel {
  padding: 22px;
}

.formula-panel {
  margin-bottom: 18px;
}

.formula-text {
  margin: 0;
  line-height: 1.8;
  font-size: 16px;
  color: var(--text);
}

.section-head,
.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h3 {
  margin: 0;
  font-size: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}

.style-bars {
  display: grid;
  gap: 16px;
}

.bar-track {
  height: 12px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 41, 54, 0.08);
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #14532d, #34d399);
  transition: width 0.35s ease;
}

.bar-fill.secondary {
  background: linear-gradient(90deg, #0f766e, #38bdf8);
}

.bar-fill.tertiary {
  background: linear-gradient(90deg, #a16207, #f59e0b);
}

.bar-fill.quaternary {
  background: linear-gradient(90deg, #7c3aed, #ec4899);
}

.indices-list {
  display: grid;
  gap: 14px;
}

.index-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
}

.index-card strong {
  display: block;
  margin-bottom: 6px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 14px;
}

.up {
  color: #b42318;
}

.down {
  color: #107c41;
}

.disclaimer {
  margin: 16px 2px 0;
  line-height: 1.6;
  font-size: 14px;
}

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

@media (max-width: 900px) {
  .estimate-form,
  .result-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 26px;
  }
}
