:root {
  --bg: #f5efe3;
  --bg-accent: #efe2c1;
  --card: rgba(255, 252, 245, 0.82);
  --card-strong: rgba(255, 250, 240, 0.95);
  --border: rgba(72, 54, 31, 0.15);
  --text: #1d160f;
  --muted: #5f5140;
  --primary: #0f6c5a;
  --primary-strong: #0a5446;
  --secondary: #b9672d;
  --notice: #f1d59e;
  --shadow: 0 24px 60px rgba(66, 44, 18, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(234, 195, 125, 0.55), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(15, 108, 90, 0.18), transparent 24%),
    linear-gradient(180deg, #f7f1e7 0%, #f2e8d7 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.25;
  pointer-events: none;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
  position: relative;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-card,
.panel {
  backdrop-filter: blur(16px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 44px;
}

.eyebrow,
.section-kicker,
.metric-label,
.summary-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0 0 14px;
}

h1,
h2 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
  margin: 0;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.95;
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-top: 4px;
}

.hero-text {
  margin: 22px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 58ch;
  color: var(--muted);
}

.hero-text span {
  color: var(--primary-strong);
  font-weight: 700;
}

.hero-actions,
.form-actions,
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 28px;
}

.hero-card {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.metric-card,
.summary-card,
.toggle-card {
  background: var(--card-strong);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(72, 54, 31, 0.1);
}

.metric-card {
  padding: 18px 20px;
}

.metric-card strong,
.summary-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 8px;
  font-family: "Space Grotesk", sans-serif;
}

.metric-card p,
.summary-card p,
.toggle-card small,
.field small,
#status-message,
.results-caption {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 28px;
}

.panel-header {
  margin-bottom: 22px;
}

.sim-form {
  display: grid;
  gap: 18px;
}

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

.field span {
  font-weight: 600;
}

input[type="number"],
input[type="file"] {
  width: 100%;
  border: 1px solid rgba(45, 34, 19, 0.12);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
}

input[type="file"] {
  padding: 12px 14px;
}

input:focus {
  outline: 2px solid rgba(15, 108, 90, 0.28);
  outline-offset: 2px;
}

.toggle-grid,
.optional-upload-grid,
.summary-grid {
  display: grid;
  gap: 14px;
}

.toggle-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
}

.toggle-card input {
  margin: 0;
}

.toggle-card span {
  font-weight: 600;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--primary) 0%, #0d8b71 100%);
  box-shadow: 0 16px 26px rgba(15, 108, 90, 0.25);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid rgba(72, 54, 31, 0.12);
}

.status-panel {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(72, 54, 31, 0.09);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 108, 90, 0.1);
  color: var(--primary-strong);
  font-weight: 600;
  margin-bottom: 10px;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(15, 108, 90, 0.3);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 108, 90, 0.36);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(15, 108, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 108, 90, 0);
  }
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.summary-card {
  padding: 16px 18px;
}

.notice-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(241, 213, 158, 0.55);
  border: 1px solid rgba(185, 103, 45, 0.22);
}

.results-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.table-shell {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(72, 54, 31, 0.08);
  background: rgba(255, 252, 246, 0.92);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(242, 232, 215, 0.96);
  text-align: left;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(72, 54, 31, 0.08);
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(15, 108, 90, 0.04);
}

.path-chip,
.flag-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.86rem;
  background: rgba(15, 108, 90, 0.08);
}

.flag-chip.invalid {
  background: rgba(185, 103, 45, 0.14);
}

.empty-row td {
  color: var(--muted);
  padding: 28px 16px;
}

code {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 0.94em;
}

@media (max-width: 1040px) {
  .hero,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 34px 28px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .panel,
  .hero-copy,
  .hero-card {
    border-radius: 22px;
    padding: 22px;
  }

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

  .results-toolbar {
    align-items: stretch;
  }

  .button,
  .results-toolbar .button {
    width: 100%;
    justify-content: center;
  }
}
