:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --ink: #17211d;
  --muted: #5c6963;
  --panel: #ffffff;
  --line: #d9dfd8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --gold: #d99a2b;
  --red: #b9473a;
  --blue: #3267a8;
  --shadow: 0 22px 60px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

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

.hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  align-items: center;
  gap: 32px;
  padding: 42px 0 34px;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

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

.hero-visual {
  min-height: 260px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.coin {
  position: absolute;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, #ffe3a3 0 14%, transparent 15%),
    linear-gradient(145deg, #e9b94d, #b97616);
  box-shadow: inset -12px -14px 22px rgba(92, 55, 9, 0.18), 0 16px 30px rgba(57, 42, 13, 0.15);
}

.coin-a {
  width: 96px;
  height: 96px;
  top: 20px;
  left: 44px;
}

.coin-b {
  width: 56px;
  height: 56px;
  right: 48px;
  top: 34px;
}

.coin-c {
  width: 72px;
  height: 72px;
  bottom: 30px;
  right: 100px;
}

.salary-card {
  width: min(100%, 310px);
  min-height: 158px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 26px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.salary-card span,
.salary-card small {
  color: var(--muted);
}

.salary-card strong {
  font-size: 2rem;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(23, 33, 29, 0.08);
}

.form-panel,
.results-panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  cursor: pointer;
}

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

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

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

.job-card {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.job-card legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 850;
}

.remove-job-button {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cfd7d1;
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.remove-job-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.job-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(160px, 1fr);
  gap: 14px;
}

.job-grid label:nth-child(3),
.job-grid label:nth-child(4) {
  max-width: 260px;
}

.field-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.jobs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.result-actions .ghost-button {
  min-height: 34px;
  padding: 0 10px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd7d1;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

summary {
  cursor: pointer;
  font-weight: 850;
}

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

.input-with-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #cfd7d1;
  border-radius: 8px;
  background: #fff;
}

.input-with-unit input {
  border: 0;
  background: transparent;
}

.input-with-unit span {
  padding: 0 12px;
  color: var(--muted);
}

.section-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.checks {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.advanced-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.advanced-panel summary {
  color: var(--accent-dark);
}

.advanced-grid {
  margin-top: 14px;
}

.check-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
}

.check-row input {
  min-height: 18px;
}

.badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #dff2ee;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.result-bars {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 88px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.bar-row strong {
  color: var(--ink);
  text-align: right;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece7;
}

.bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.bar-fill.net {
  background: var(--accent);
}

.bar-fill.tax {
  background: var(--red);
}

.bar-fill.social {
  background: var(--blue);
}

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

.metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.metrics dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metrics dd {
  margin: 7px 0 0;
  font-size: 1.2rem;
  font-weight: 850;
}

.breakdown {
  padding-top: 8px;
}

.breakdown h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.tax-explanation,
.validation-box,
.scenario-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tax-explanation h3,
.validation-box h3,
.scenario-box h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.explain-grid {
  display: grid;
  gap: 8px;
}

.explain-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.explain-row strong {
  color: var(--ink);
  text-align: right;
}

.validation-box ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.scenario-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.scenario-actions input {
  min-width: 0;
}

.scenario-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.scenario-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.scenario-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-results {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.job-results h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.job-result-card {
  display: grid;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.job-result-card:last-child {
  border-bottom: 0;
}

.job-result-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-weight: 850;
}

.job-result-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.job-result-meta span {
  display: grid;
  gap: 2px;
}

.job-result-meta strong {
  color: var(--ink);
}

.extra-pay-results {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: #effaf7;
}

.extra-pay-results h3 {
  margin: 0 0 12px;
}

.extra-pay-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 118, 110, 0.16);
}

.extra-pay-result:last-child { border-bottom: 0; }
.extra-pay-result strong { color: var(--accent-dark); }
.extra-pay-result small { grid-column: 1 / -1; color: var(--muted); }

.line-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.line-item strong {
  color: var(--ink);
  text-align: right;
}

.line-item.total {
  border-bottom: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 850;
}

.notice {
  margin-top: 18px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff8e8;
  color: #59431d;
  line-height: 1.45;
}

.reference-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1.4fr);
  gap: 20px;
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eaf1ec;
}

.reference-band h2 {
  margin: 0;
}

.reference-band ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 20px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer a {
  color: var(--accent-dark);
  font-weight: 750;
  text-decoration: none;
}

.legal-page {
  max-width: 880px;
}

.legal-header {
  padding: 32px 0 18px;
}

.legal-header h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
}

.legal-content {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(23, 33, 29, 0.08);
  line-height: 1.65;
}

.legal-content h2 {
  margin: 8px 0 0;
  font-size: 1.35rem;
}

.legal-content p,
.legal-content ul {
  margin: 0;
  color: var(--muted);
}

.legal-content a {
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  .hero,
  .calculator,
  .reference-band {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 20px;
  }

  .hero-visual {
    min-height: 220px;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .field-grid,
  .job-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .scenario-actions,
  .scenario-item {
    grid-template-columns: 1fr;
  }

  .form-panel,
  .results-panel,
  .reference-band {
    padding: 18px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 1fr 82px;
  }

  .bar-row span {
    grid-column: 1 / -1;
  }

  .job-result-meta {
    grid-template-columns: 1fr;
  }
}
