:root {
  color-scheme: light;
  --page: #f6f7f4;
  --surface: #ffffff;
  --surface-alt: #f0f3ef;
  --ink: #182024;
  --muted: #657077;
  --line: #dfe4e1;
  --teal: #0c7774;
  --teal-dark: #075e5b;
  --blue: #3d5f9f;
  --coral: #c9563f;
  --amber: #d99922;
  --shadow: 0 16px 36px rgba(35, 45, 49, 0.08);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(12, 119, 116, 0.3);
  border-radius: 8px;
  color: var(--teal-dark);
  background: #f9fffd;
  box-shadow: inset 0 -5px 0 rgba(12, 119, 116, 0.08);
  font-size: 1.65rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 680px;
  font-size: 1.82rem;
  line-height: 1.1;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.header-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.formula-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  white-space: nowrap;
}

.formula-chip span {
  color: var(--ink);
  margin-right: 4px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-panel,
.results-panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-heading p {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: right;
}

.slider-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.slider-title-row,
.range-meta,
.meter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.slider-title-row label {
  font-size: 0.96rem;
  font-weight: 800;
}

output {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
  white-space: nowrap;
}

input[type="range"] {
  --fill: 0%;
  width: 100%;
  height: 8px;
  margin: 16px 0 8px;
  border-radius: 999px;
  outline: none;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--slider-color) var(--fill),
    #d9e0df var(--fill)
  );
}

input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  appearance: none;
  background: var(--slider-color);
  box-shadow: 0 2px 9px rgba(24, 33, 38, 0.22);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--slider-color);
  box-shadow: 0 2px 9px rgba(24, 33, 38, 0.22);
  cursor: pointer;
}

.slider-block[data-tone="hourly"] {
  --slider-color: var(--teal);
}

.slider-block[data-tone="salary"] {
  --slider-color: var(--blue);
}

.range-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.money-field,
.field,
.deduction-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.money-field {
  margin-top: 14px;
}

.money-field > span:first-child,
.field span,
.deduction-field strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.input-shell,
.percent-shell {
  display: flex;
  align-items: center;
  width: 170px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  overflow: hidden;
}

.input-shell span,
.percent-shell span {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 42px;
  background: var(--surface-alt);
  font-weight: 800;
}

.input-shell input,
.percent-shell input,
.field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  outline: none;
}

.input-shell input,
.percent-shell input {
  padding: 0 12px;
}

.field input,
.field select {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

input:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(8, 125, 123, 0.16);
}

.two-column-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.field {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}

.field select {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  font-weight: 800;
  outline: none;
}

.deduction-field {
  padding-top: 18px;
}

.deduction-field > span:first-child {
  display: grid;
  gap: 4px;
}

.deduction-field small {
  color: var(--muted);
  font-size: 0.82rem;
}

.percent-shell {
  width: 132px;
}

.percent-shell span {
  background: #fff5e1;
  color: #805314;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 2px 0 0;
  border-bottom: 1px solid var(--line);
}

.metric-block {
  min-height: 132px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.metric-block:nth-child(odd) {
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.metric-block:nth-child(even) {
  padding-left: 18px;
}

.metric-block:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.metric-block p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.metric-block strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 1.58rem;
  line-height: 1.05;
}

.metric-block span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.metric-block.accent strong {
  color: var(--teal-dark);
}

.deduction-meter {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.meter-label-row {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.meter-label-row span:first-child {
  color: var(--teal-dark);
}

.meter-track {
  height: 12px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(201, 86, 63, 0.18);
  overflow: hidden;
}

.meter-fill {
  width: 78%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 160ms ease;
}

.breakdown-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.breakdown-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.breakdown-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.breakdown-list dt {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.breakdown-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 850;
  text-align: right;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 24px, 720px);
    padding: 24px 0;
  }

  .app-header,
  .workspace,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .app-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-chips {
    justify-content: flex-start;
  }

  .workspace {
    display: grid;
  }

  .section-heading p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 520px);
    padding: 18px 0;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  h1 {
    font-size: 1.56rem;
  }

  .control-panel,
  .results-panel {
    padding: 18px;
  }

  .money-field,
  .deduction-field,
  .slider-title-row,
  .meter-label-row,
  .breakdown-list div {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .input-shell,
  .percent-shell {
    width: 100%;
  }

  .two-column-controls,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .metric-block,
  .metric-block:nth-child(odd),
  .metric-block:nth-child(even) {
    min-height: auto;
    padding: 16px 0;
    border-right: 0;
  }

  .metric-block:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .breakdown-list dd {
    text-align: left;
  }
}
