:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #6b7280;
  --line: #d7dde5;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --accent: #be7c18;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  margin-top: 4px;
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 40px;
}

.quote,
.settings-row,
.table-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.quote,
.table-section {
  padding: 20px;
}

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

.pill {
  border: 1px solid #b7d7d4;
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}

.quote-grid,
.settings-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.settings-row {
  align-items: end;
  margin: 16px 0;
  padding: 16px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 9px 10px;
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

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

.results div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fbfcfd;
}

.results span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.results strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.negative {
  color: var(--danger);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  background: var(--brand);
  color: #fff;
}

.primary:hover {
  background: var(--brand-dark);
}

.secondary,
.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tools input {
  width: 240px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

th {
  background: #eef2f5;
  color: #374151;
  font-size: 12px;
}

td:last-child,
th:last-child {
  width: 140px;
}

td input {
  min-height: 36px;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 900px) {
  .quote-grid,
  .settings-row,
  .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-head,
  .tools {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-grid,
  .settings-row,
  .results {
    grid-template-columns: 1fr;
  }

  .tools input {
    width: 100%;
  }
}

@media print {
  .settings-row,
  .table-section,
  .ghost {
    display: none;
  }

  body {
    background: #fff;
  }

  .shell {
    width: 100%;
    margin: 0;
  }

  .quote {
    border: 0;
    box-shadow: none;
  }
}
