:root {
  color-scheme: dark;
  font-family: "Geist", "Inter", system-ui, sans-serif;
  color: #eff3fa;
  background: #0b0d13;
  font-synthesis: none;
  --muted: #adb8c9;
  --line: #283141;
  --card: #141923;
  --input: #0f141e;
  --accent: #a7c9ff;
  --focus: #9bbfff;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p, dl, dd, fieldset { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.shell {
  width: min(100% - 64px, 1060px);
  margin-inline: auto;
}

.topbar { background: #10141d; border-bottom: 1px solid #232b39; }
.bar-inner, .brand, .privacy { display: flex; align-items: center; }
.bar-inner { height: 64px; justify-content: space-between; gap: 12px; }
.brand { gap: 10px; font-size: 15px; font-weight: 710; letter-spacing: -.025em; }
.brand-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #385781;
  border-radius: 9px;
  background: #1c2c46;
}
.brand-symbol span {
  width: 14px;
  height: 12px;
  margin-top: 5px;
  border: 1.5px solid #e0ecff;
  border-radius: 2px 2px 3px 3px;
  transform: perspective(18px) rotateX(12deg);
}
.brand-symbol::before {
  position: absolute;
  top: 6px;
  left: 11px;
  width: 6px;
  height: 5px;
  border: 1.5px solid #e0ecff;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  content: "";
}
.privacy { gap: 7px; color: #b8c5d9; font-size: 12px; font-weight: 620; }
.lock { position: relative; width: 10px; height: 8px; margin-top: 3px; border: 1.3px solid currentColor; border-radius: 2px; }
.lock::before { content: ""; position: absolute; top: -5px; left: 1px; width: 4px; height: 4px; border: 1.2px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; }

.intro { padding: 39px 0 29px; }
.market {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a6bddc;
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 720;
}
.market span { width: 4px; height: 4px; border-radius: 100%; background: #719acf; }
h1 {
  margin-top: 10px;
  font-size: clamp(34px, 4.7vw, 52px);
  line-height: 1.06;
  letter-spacing: -.058em;
  font-weight: 750;
}
h2 { font-size: 16px; font-weight: 710; letter-spacing: -.025em; }

.dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; align-items: start; padding-bottom: 36px; }
.results { display: grid; gap: 15px; min-width: 0; }
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 12px 28px #03040755;
}
.controls { padding: 23px; }
.section-head, .outcome-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-button {
  border: 0;
  border-radius: 7px;
  min-height: 36px;
  padding: 5px 9px;
  margin: -4px -9px -4px 0;
  color: var(--accent);
  background: none;
  font-size: 13px;
  font-weight: 650;
}
.text-button:hover { background: #22334e; }

.fulfilment { border: 0; min-width: 0; padding: 0; margin-top: 18px; }
.fulfilment legend { padding: 0; }
.field label, legend { display: block; font-size: 13px; font-weight: 675; }
.fulfilment-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; margin-top: 7px; }
.fulfilment-option { position: relative; cursor: pointer; min-width: 0; }
.fulfilment-option input, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.option-content {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 9px;
  row-gap: 2px;
  min-height: 59px;
  padding: 9px 12px;
  border: 1px solid #354256;
  border-radius: 10px;
  background: #111724;
  font-size: 14px;
}
.option-content small { grid-column: 2; color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.radio-mark { width: 14px; height: 14px; border: 1px solid #8b9ab1; border-radius: 50%; }
.fulfilment-option input:checked + .option-content { border-color: #729bdc; background: #1b2c47; color: #e4efff; }
.fulfilment-option input:checked + .option-content .radio-mark { border: 4px solid #a9cbff; background: #233857; }
.fulfilment-option input:focus-visible + .option-content { outline: 2px solid var(--focus); outline-offset: 2px; }
.fulfilment-option:hover .option-content { border-color: #729bdc; }

.fields { display: grid; gap: 13px; margin-top: 17px; }
.field { min-width: 0; }
.field-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.vat-hint {
  padding: 2px 6px;
  border-radius: 4px;
  background: #26334a;
  color: #d0def2;
  font-size: 11px;
  font-weight: 620;
  line-height: 1.35;
  white-space: nowrap;
}
.field small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.4; margin-top: 5px; }
.field small.error { color: #ffaaa2; }
.input-wrap {
  display: flex;
  align-items: center;
  min-height: 43px;
  width: 100%;
  margin-top: 5px;
  border: 1px solid #354256;
  border-radius: 8px;
  background: var(--input);
}
.input-wrap > span { padding-left: 12px; color: #aebbd0; font-size: 14px; font-weight: 650; }
.input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.input-wrap input::placeholder { color: #8392a8; font-weight: 500; }
.input-wrap:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.input-wrap:has([aria-invalid="true"]) { border-color: #da827c; }
.input-wrap input:focus { outline: none; }

.field-assist { display: flex; justify-content: flex-end; }
.field-assist a {
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: 5px;
  text-underline-offset: 2px;
}
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.presets button {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #354256;
  border-radius: 6px;
  background: #171f2f;
  color: #c7d6ed;
  font-size: 11.5px;
}
.presets button[aria-pressed="true"], .presets button:hover { border-color: #729bdc; background: #233856; color: #edf4ff; }

.settings { margin-top: 13px; border-top: 1px solid var(--line); }
.settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 43px;
  color: #c3cfdf;
  font-size: 12.5px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
.chevron { width: 7px; height: 7px; flex: 0 0 auto; border-right: 1.6px solid #a6b7ce; border-bottom: 1.6px solid #a6b7ce; transform: translateY(-2px) rotate(45deg); margin-right: 4px; }
details[open] > summary .chevron { transform: translateY(2px) rotate(225deg); }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 2px 0 12px; }
.calculate {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #a0c3ff;
  border-radius: 8px;
  background: #9bbfff;
  color: #0d1b30;
  font-size: 14px;
  font-weight: 760;
  margin-top: 3px;
}
.calculate:hover { background: #bdd4ff; }

.outcome {
  padding: 21px 22px 18px;
  background: linear-gradient(155deg, #172641 0%, #131e34 67%, #142032 100%);
  border-color: #324563;
}
.outcome-head h2 { scroll-margin-top: 20px; }
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #435773;
  border-radius: 100px;
  background: #243750;
  color: #d5e4f9;
  font-size: 11px;
  font-weight: 690;
  text-align: center;
}
.status > span:first-child { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.status[data-state="met"] { background: #1b3936; border-color: #376958; color: #ade7ce; }
.status[data-state="super"] { background: #243b63; border-color: #587dbb; color: #d1e4ff; }
.status[data-state="acceptable"] { background: #3c3026; border-color: #74563e; color: #f6d3a2; }
.status[data-state="below"] { background: #472a34; border-color: #7d4b58; color: #ffc5ca; }
.metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 22px; }
.metric-label, .metric-detail { color: #c2cee1; font-size: 12px; line-height: 1.4; }
.metric-label { font-weight: 660; }
.metric-value {
  font-size: clamp(29px, 4vw, 44px);
  font-weight: 720;
  line-height: 1.13;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.margin-metric { border-left: 1px solid #3c4d68; padding-left: 16px; }
.target { margin-top: 20px; padding-top: 14px; border-top: 1px solid #344760; }
.target-track { position: relative; height: 6px; border-radius: 5px; background: #354a67; }
.target-fill { height: 100%; width: 0; border-radius: inherit; background: #a3ddc8; transition: width .18s ease-out; }
.outcome:has(.status[data-state="super"]) .target-fill { background: #9bbfff; }
.outcome:has(.status[data-state="acceptable"]) .target-fill { background: #efc28c; }
.outcome:has(.status[data-state="below"]) .target-fill { background: #f3adb5; }
.target-marker { position: absolute; top: -3px; width: 2px; height: 12px; background: #ebf3ff; border-radius: 2px; }
.margin-thresholds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.margin-thresholds li {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid #344760;
  border-radius: 6px;
  color: #c7d3e7;
  font-size: 11px;
  text-align: center;
}
.margin-thresholds strong { color: #f0f5ff; font-size: 12px; font-variant-numeric: tabular-nums; }
.margin-thresholds .threshold-goal { background: #233650; border-color: #577398; }
#target-gap { margin-top: 8px; font-size: 11px; color: #c7d3e7; }

.breakdown { padding: 17px 22px 12px; }
.vat-label { font-size: 11px; font-weight: 670; color: #c5d4e8; background: #222c3d; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.breakdown dl { margin-top: 8px; }
.detail-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 9px; padding: 7px 0; border-top: 1px solid #262f3e; font-size: 12px; color: #b9c5d7; }
.detail-row:first-child { border-top: 0; }
.detail-row dd { color: #e1eaf8; font-weight: 650; font-variant-numeric: tabular-nums; }
.revenue { font-weight: 710; color: #dfe9f7; }
.row-rate { margin-left: 4px; padding: 2px 4px; border-radius: 4px; background: #26334a; color: #cedfff; font-size: 10px; font-weight: 680; white-space: nowrap; }
.row-rate:empty { display: none; }
.breakdown .cash-details { border-top: 1px solid #344053; margin-top: 1px; padding-top: 2px; }

@media (max-width: 850px) {
  .shell { width: calc(100% - 40px); }
  .dashboard { gap: 14px; }
  .controls, .outcome, .breakdown { padding-inline: 16px; }
}
@media (max-width: 670px) {
  .shell { width: calc(100% - 30px); }
  .bar-inner { height: 54px; }
  .intro { padding: 24px 0 20px; }
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .results { gap: 13px; }
  .card { border-radius: 15px; }
  .controls, .outcome { padding-block: 16px; }
  .breakdown { padding-block: 15px 9px; }
  .metric-value { font-size: clamp(28px, 8vw, 41px); }
}
@media (max-width: 350px) {
  .shell { width: calc(100% - 22px); }
  .option-content { padding-inline: 9px; column-gap: 6px; }
  .margin-metric { padding-left: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .target-fill { transition: none; }
}
