:root {
  color-scheme: light;
  --bg: #eef2f7;
  --ink: #142033;
  --muted: #526174;
  --panel: #ffffff;
  --line: #cfd8e5;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warm: #f59e0b;
  --soft: #e6f4f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 32rem),
    linear-gradient(245deg, rgba(245, 158, 11, 0.13), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.app {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.panel,
.notes,
.privacy,
.examples,
.faq {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-panel {
  padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 24px 80px rgba(20, 32, 51, 0.10);
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4.3rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.rate-badge {
  min-height: 150px;
  border: 1px solid #9fd6ce;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--soft), #ffffff);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
}

.rate-badge span {
  display: block;
  color: var(--accent-dark);
  font-size: 2rem;
  font-weight: 900;
}

.rate-badge small {
  color: var(--muted);
  font-weight: 800;
}

.calculator {
  margin-top: 32px;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 800;
}

.mode-option input {
  accent-color: var(--accent);
}

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

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

.field span,
.label {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  background: #ffffff;
}

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

.shares-field {
  display: none;
}

body[data-mode="shares"] .shares-field {
  display: grid;
}

body[data-mode="shares"] .aggregate-field {
  display: none;
}

.result-band {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #9fd6ce;
  border-radius: 8px;
  overflow: hidden;
  background: var(--soft);
}

.result-band > div {
  padding: 18px;
}

.result-band > div + div {
  border-left: 1px solid #9fd6ce;
}

.result-band strong {
  display: block;
  font-size: clamp(1.45rem, 4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rate-note {
  margin: 14px 0 0;
  max-width: 76ch;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: var(--accent-dark);
}

.support {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.source-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}

.source-strip span {
  color: #9a3412;
  font-weight: 900;
}

.notes,
.privacy,
.examples,
.faq {
  padding: 18px;
}

.notes p,
.privacy p,
.faq p {
  margin-bottom: 0;
  color: var(--muted);
}

.notes p + p,
.faq h3 {
  margin-top: 10px;
}

.faq h3 {
  margin-bottom: 5px;
  font-size: 0.92rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .app {
    width: min(100vw - 20px, 1120px);
    padding: 10px 0 24px;
  }

  .mast,
  .grid,
  .result-band,
  .support {
    grid-template-columns: 1fr;
  }

  .rate-badge {
    min-height: 104px;
  }

  .result-band > div + div {
    border-left: 0;
    border-top: 1px solid #9fd6ce;
  }
}
