:root {
  --ink: #151918;
  --muted: #66716d;
  --line: #dbe1dd;
  --cream: #f7f2e8;
  --surface: #fffdf8;
  --emerald: #123f31;
  --emerald-soft: #e8f1ec;
  --gold: #bf8e3e;
  --red: #9f3028;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #f9f4ea, #edf2ef);
  font: 14px/1.5 Inter, "Segoe UI", Arial, sans-serif;
}

button, input, select { font: inherit; }

.app-shell { max-width: 1500px; margin: 0 auto; }

.hero {
  min-height: 280px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 42px clamp(18px, 4vw, 46px);
  background: linear-gradient(120deg, #13231d, #123f31);
  color: #fffdf8;
  border-bottom: 4px solid var(--gold);
}

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

h1, h2 { margin: 0; line-height: 1.08; }
h1 { font-size: clamp(36px, 5vw, 64px); }
.hero p:not(.eyebrow) { max-width: 720px; color: rgba(255, 253, 248, .76); font-size: 17px; }

.status-card {
  min-width: 240px;
  align-self: flex-start;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
}

#status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-right: 8px; }
.status-card small { display: block; margin-top: 5px; color: rgba(255,255,255,.62); }

.control-panel, .results {
  margin: 22px clamp(18px, 4vw, 46px);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

form {
  display: grid;
  grid-template-columns: 170px minmax(260px, 1fr) 100px 130px 110px auto 140px;
  gap: 14px;
  align-items: end;
}

label { display: flex; flex-direction: column; gap: 6px; color: #4c5a55; font-size: 12px; font-weight: 750; }

input, select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #bdc8c3;
  background: white;
  color: var(--ink);
  outline: none;
}

input:focus, select:focus { border-color: var(--emerald); box-shadow: 0 0 0 2px #d6ebe1; }

.toggle {
  min-height: 40px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toggle input { width: 16px; min-height: 16px; accent-color: var(--emerald); }

button {
  min-height: 40px;
  border: 0;
  background: var(--emerald);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:disabled { opacity: .55; cursor: not-allowed; }

.hidden { display: none !important; }

.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

#notice { margin: 8px 0 0; color: var(--muted); }

.export-card {
  min-width: 300px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--cream);
}

.export-card span { display: block; color: var(--muted); font-size: 12px; }
.export-card strong { display: block; margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }

.table-wrap { overflow: auto; border: 1px solid var(--line); }
table { width: 100%; min-width: 1180px; border-collapse: collapse; }
th { padding: 10px; background: var(--emerald-soft); color: #41504a; text-align: left; font-size: 11px; text-transform: uppercase; }
td { padding: 12px 10px; border-top: 1px solid #e7ece9; vertical-align: top; }
td strong { display: block; }
td small { display: block; color: var(--muted); margin-top: 3px; }
a { color: #1a684a; font-weight: 800; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 520px;
  padding: 13px 16px;
  background: var(--red);
  color: white;
}

@media (max-width: 1100px) {
  form { grid-template-columns: 1fr 1fr; }
  .hero, .results-heading { flex-direction: column; }
}

@media (max-width: 620px) {
  form { grid-template-columns: 1fr; }
}
