:root {
  --blue: #3471ff;
  --blue-dark: #2765f2;
  --ink: #181d2a;
  --muted: #66708a;
  --faint: #8e97ad;
  --line: #dfe5ef;
  --line-soft: #edf1f7;
  --panel: #ffffff;
  --wash: #f6f8ff;
  --font: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 1180px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: auto;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--font);
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reference-board {
  position: relative;
  width: 100%;
  min-width: 1586px;
  min-height: 992px;
  margin: 0;
  overflow: visible;
  background:
    radial-gradient(circle at 24% 19%, rgba(255, 255, 255, 0.95) 0 170px, rgba(255, 255, 255, 0) 390px),
    radial-gradient(circle at 69% 25%, rgba(255, 255, 255, 0.92) 0 240px, rgba(255, 255, 255, 0) 560px),
    linear-gradient(180deg, #f8faff 0%, #f5f7ff 100%);
}

.reference-board:has(#exactVatToggle:checked) {
  min-height: 1220px;
}

.brand-block {
  position: absolute;
  top: 32px;
  left: 50px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-icon,
.feature-row svg,
.privacy-note svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-icon {
  width: 44px;
  height: 44px;
  overflow: visible;
  filter: drop-shadow(0 9px 18px rgba(52, 113, 255, 0.18));
}

.brand-mark-bg {
  fill: url("#brandMarkGradient");
}

.brand-mark-paper-shadow {
  fill: rgba(19, 55, 122, 0.16);
  transform: translate(2px, 2px);
}

.brand-mark-paper {
  fill: url("#brandPaperGradient");
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.2;
}

.brand-mark-fold,
.brand-mark-ruble {
  fill: none;
  stroke: #2563eb;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark-fold {
  stroke-width: 1.4;
  opacity: 0.72;
}

.brand-mark-ruble {
  stroke-width: 2.2;
}

.brand-block strong {
  display: block;
  color: #17345b;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
}

.brand-block small {
  display: block;
  margin-top: 5px;
  color: #66708a;
  font-size: 16px;
  line-height: 1.1;
}

.hero-copy {
  position: absolute;
  top: 156px;
  left: 50px;
  width: 480px;
}

.hero-copy h1 {
  width: 480px;
  margin: 0;
  color: #1a202d;
  font-size: 43px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero-copy p {
  width: 382px;
  margin: 24px 0 0;
  color: #626c84;
  font-size: 21px;
  font-weight: 430;
  line-height: 1.42;
}

.feature-list {
  display: grid;
  gap: 26px;
  margin-top: 25px;
}

.feature-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 26px;
  align-items: start;
}

.feature-row svg {
  width: 38px;
  height: 38px;
  color: var(--blue);
  stroke-width: 2.4;
}

.feature-row strong {
  display: block;
  padding-top: 1px;
  color: #20283a;
  font-size: 17px;
  font-weight: 760;
  line-height: 1.25;
}

.feature-row small {
  display: block;
  width: 315px;
  margin-top: 7px;
  color: #64708a;
  font-size: 15.5px;
  font-weight: 430;
  line-height: 1.45;
}

.paper-stack {
  position: absolute;
  top: 549px;
  left: -50px;
  width: 520px;
  height: 292px;
  user-select: none;
  pointer-events: none;
}

.converter-card {
  position: absolute;
  top: 102px;
  left: 551px;
  right: 47px;
  width: auto;
  height: 835px;
  margin: 0;
  padding: 46px 52px 0;
  border: 1px solid #dbe1ed;
  border-radius: 9px;
  background:
    radial-gradient(circle at 62% 11%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 305px),
    var(--panel);
  box-shadow: 0 16px 46px rgba(54, 71, 110, 0.08);
}

.converter-card h2 {
  margin: 0;
  color: #111827;
  font-size: 25px;
  font-weight: 780;
  line-height: 1.1;
}

.amount-label,
.result-label {
  position: absolute;
  left: 52px;
  color: #171d2d;
  font-size: 18px;
  font-weight: 510;
  line-height: 1;
}

.amount-label {
  top: 113px;
}

.amount-shell {
  position: absolute;
  top: 145px;
  left: 52px;
  right: 52px;
  width: auto;
  height: 104px;
  border: 1.5px solid var(--blue);
  border-radius: 6px;
  background: #ffffff;
}

.amount-shell input {
  width: 100%;
  height: 100%;
  padding: 0 196px 0 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #171c28;
  font-size: 56px;
  font-weight: 430;
  line-height: 104px;
  letter-spacing: 4px;
}

.amount-shell select {
  position: absolute;
  top: 27px;
  right: 16px;
  width: 150px;
  height: 52px;
  padding: 0 30px 0 16px;
  border: 1px solid #d8deeb;
  border-radius: 7px;
  outline: 0;
  background: #ffffff;
  color: #1f2937;
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
}

.section-divider {
  position: absolute;
  top: 275px;
  left: 52px;
  right: 52px;
  width: auto;
  height: 1px;
  background: var(--line);
}

.result-label {
  top: 305px;
}

.result-paper {
  position: absolute;
  top: 338px;
  left: 52px;
  right: 52px;
  width: auto;
  height: 168px;
  padding: 39px 190px 30px 48px;
  border: 1px solid #dbe1ec;
  border-radius: 4px;
  background:
    repeating-linear-gradient(135deg, rgba(20, 28, 45, 0.017) 0 2px, transparent 2px 5px),
    #ffffff;
  box-shadow: none;
}

.result-paper::before {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 8px;
  background: radial-gradient(circle at 0 8px, transparent 0 4px, #dbe1ec 4.5px, transparent 5px) 0 0 / 8px 18px repeat-y;
  content: "";
  opacity: 0.85;
}

.result-paper::after {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 30px;
  height: 30px;
  border-left: 1px solid #d7deea;
  border-bottom: 1px solid #d7deea;
  border-radius: 0 4px 0 4px;
  background: linear-gradient(135deg, #e8edf5, #dfe5ee);
  content: "";
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

#exactResultOutput {
  display: block;
  max-height: none;
  overflow: visible;
  color: #171d2b;
  white-space: pre-wrap;
  font-size: 27px;
  font-weight: 520;
  line-height: 1.42;
}

.copy-button {
  position: absolute;
  top: 55px;
  right: 37px;
  display: grid;
  grid-template-rows: 34px 18px;
  width: 86px;
  height: 78px;
  padding: 10px 8px 8px;
  place-items: center;
  border: 1px solid #dbe1ec;
  border-radius: 7px;
  background: #ffffff;
  color: var(--blue);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(44, 62, 110, 0.08);
}

.copy-button svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.copy-button span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.copy-status {
  position: absolute;
  top: 480px;
  right: 84px;
  width: 100px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.options {
  position: absolute;
  top: 530px;
  left: 52px;
  right: 52px;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

.option-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px 280px 1fr 28px;
  align-items: center;
  width: 100%;
  height: 55px;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
}

.option-row input {
  position: absolute;
  top: 16px;
  left: 4px;
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.checkbox-ui {
  position: relative;
  grid-column: 1;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  border: 1.5px solid #cbd3e2;
  border-radius: 5px;
  background: #ffffff;
  pointer-events: none;
}

.option-row input:checked + .checkbox-ui {
  border-color: var(--blue);
  background: var(--blue);
}

.option-row input:checked + .checkbox-ui::after {
  position: absolute;
  top: 3px;
  left: 7px;
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.option-row strong {
  grid-column: 2;
  color: #151b2a;
  font-size: 18px;
  font-weight: 760;
}

.option-row small {
  grid-column: 3;
  color: #8b94aa;
  font-size: 16px;
  font-weight: 430;
}

.option-info {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #aeb6c7;
  border-radius: 50%;
  color: #9aa3b7;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
}

.vat-rate-row {
  display: grid;
  grid-template-columns: 40px 280px 150px 1fr;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.vat-rate-row[hidden] {
  display: none;
}

.vat-rate-row span {
  grid-column: 2;
  color: #151b2a;
  font-size: 17px;
  font-weight: 720;
}

.vat-rate-row select {
  grid-column: 3;
  width: 150px;
  height: 40px;
  padding: 0 34px 0 14px;
  border: 1px solid #d8deeb;
  border-radius: 7px;
  background: #ffffff;
  color: #1f2937;
  font-size: 16px;
  font-weight: 650;
}

.converter-card:has(#exactVatToggle:checked) {
  height: 1110px;
}

.converter-card:has(#exactVatToggle:checked) .result-paper {
  height: 256px;
}

.converter-card:has(#exactVatToggle:checked) .options {
  top: 620px;
}

.privacy-note {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  height: 68px;
  margin: 0;
  padding-left: 60px;
  align-items: center;
  gap: 14px;
  border-top: 1px solid #dfe5ef;
  border-radius: 0 0 9px 9px;
  background: #f8faff;
  color: #7b849b;
  font-size: 16px;
}

.privacy-note svg {
  width: 22px;
  height: 22px;
  color: #2f3749;
  stroke-width: 2;
}

.privacy-note a {
  color: #50607c;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.cookie-banner {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(680px, calc(100vw - 48px));
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid #dbe1ed;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(42, 61, 103, 0.16);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0;
  color: #54617a;
  font-size: 14px;
  line-height: 1.4;
}

.cookie-banner a {
  color: var(--blue);
  font-weight: 650;
  text-decoration: none;
}

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

.cookie-actions button {
  min-width: 104px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d8deeb;
  border-radius: 7px;
  background: #ffffff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.cookie-actions #cookie-accept {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

@media (max-width: 1585px) {
  .reference-board {
    margin-left: 0;
  }
}

@media (max-width: 1585px) {
  html,
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .reference-board {
    display: grid;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 100vh;
    margin: 0;
    padding: 28px clamp(18px, 4vw, 40px) 40px;
    gap: 28px;
    overflow: hidden;
  }

  .brand-block {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 360px);
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .brand-block strong,
  .brand-block small {
    overflow-wrap: anywhere;
  }

  .hero-copy {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 680px);
    margin-top: 34px;
  }

  .hero-copy h1 {
    width: 100%;
    max-width: 640px;
    font-size: clamp(42px, 7.8vw, 68px);
    line-height: 1.12;
  }

  .hero-copy p {
    width: min(100%, 520px);
    margin-top: 22px;
    font-size: clamp(20px, 3.2vw, 28px);
  }

  .feature-list {
    max-width: 620px;
    gap: 24px;
    margin-top: 32px;
  }

  .feature-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 20px;
  }

  .feature-row small {
    width: min(100%, 420px);
  }

  .paper-stack {
    position: relative;
    top: auto;
    left: auto;
    display: block;
    width: min(520px, calc(100vw - 36px));
    height: auto;
    margin: 16px 0 -6px -18px;
  }

  .converter-card {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: 720px;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 34px clamp(18px, 4vw, 36px) 0;
    border-radius: 9px;
  }

  .converter-card:has(#exactVatToggle:checked) {
    height: auto;
  }

  .converter-card:has(#exactVatToggle:checked) .result-paper {
    height: auto;
  }

  .converter-card:has(#exactVatToggle:checked) .options {
    top: auto;
  }

  .converter-card h2,
  .amount-label,
  .result-label,
  .amount-shell,
  .section-divider,
  .result-paper,
  .copy-status,
  .options,
  .privacy-note {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
  }

  .converter-card h2 {
    font-size: clamp(26px, 4.4vw, 34px);
  }

  .amount-label,
  .result-label {
    display: block;
    margin-top: 34px;
    font-size: 18px;
  }

  .amount-shell {
    width: 100%;
    height: clamp(78px, 13vw, 104px);
    margin-top: 14px;
  }

  .amount-shell input {
    min-width: 0;
    padding: 0 118px 0 clamp(18px, 4vw, 30px);
    font-size: clamp(34px, 8.2vw, 56px);
    line-height: 1;
    letter-spacing: clamp(0px, 0.5vw, 4px);
  }

  .amount-shell select {
    top: 50%;
    right: 14px;
    width: 92px;
    height: 50px;
    transform: translateY(-50%);
  }

  .section-divider {
    width: 100%;
    margin-top: 26px;
  }

  .result-label {
    margin-top: 26px;
  }

  .result-paper {
    width: 100%;
    height: auto;
    min-height: 150px;
    margin-top: 16px;
    padding: 34px 120px 30px clamp(32px, 5vw, 48px);
  }

  #exactResultOutput {
    max-height: none;
    overflow: visible;
    font-size: clamp(22px, 4.5vw, 30px);
    line-height: 1.42;
  }

  .copy-button {
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
  }

  .copy-status {
    display: block;
    width: 100%;
    min-height: 16px;
    margin-top: 8px;
    text-align: right;
  }

  .options {
    width: 100%;
    margin-top: 18px;
  }

  .option-row {
    width: 100%;
    min-height: 58px;
    height: auto;
    grid-template-columns: 40px minmax(170px, 0.9fr) minmax(0, 1.2fr) 24px;
    column-gap: 0;
    padding: 12px 0;
  }

  .option-row input {
    top: 18px;
  }

  .option-row strong,
  .option-row small {
    min-width: 0;
  }

  .option-row small {
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .vat-rate-row {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    grid-template-columns: 40px minmax(170px, 0.9fr) minmax(118px, 150px) minmax(0, 1.2fr);
    min-height: 58px;
    padding-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .vat-rate-row select {
    width: 150px;
  }

  .privacy-note {
    display: flex;
    height: auto;
    min-height: 68px;
    margin: 20px calc(clamp(18px, 4vw, 36px) * -1) 0;
    padding: 18px clamp(18px, 4vw, 36px);
    flex-wrap: wrap;
    border-radius: 0 0 9px 9px;
    line-height: 1.35;
  }
}

@media (max-width: 720px) {
  .reference-board {
    padding: 20px 16px 28px;
    gap: 22px;
  }

  .brand-block {
    width: 100%;
  }

  .hero-copy {
    display: contents;
  }

  .hero-copy h1 {
    order: 2;
    font-size: clamp(34px, 11vw, 48px);
  }

  .hero-copy p {
    order: 4;
    font-size: 20px;
  }

  .feature-list {
    order: 5;
    gap: 20px;
    margin-top: 26px;
  }

  .paper-stack {
    order: 6;
    width: min(420px, calc(100vw - 22px));
    margin: 4px 0 -6px 0;
  }

  .converter-card {
    order: 3;
    padding: 28px 16px 0;
  }

  .amount-shell {
    height: 78px;
  }

  .amount-shell input {
    padding-right: 96px;
    font-size: clamp(30px, 10vw, 42px);
  }

  .amount-shell select {
    right: 10px;
    width: 78px;
    height: 44px;
    padding-left: 12px;
    padding-right: 24px;
    font-size: 15px;
  }

  .result-paper {
    display: flex;
    min-height: 0;
    padding: 26px 24px 24px 30px;
    flex-direction: column;
    gap: 18px;
  }

  .copy-button {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    display: flex;
    width: 100%;
    height: 54px;
    min-height: 54px;
    padding: 0 18px;
    justify-content: center;
    gap: 10px;
    transform: none;
  }

  .copy-button svg {
    width: 24px;
    height: 24px;
  }

  .copy-button span {
    font-size: 14px;
  }

  .option-row {
    grid-template-columns: 38px minmax(0, 1fr) 24px;
    grid-template-rows: auto auto;
    row-gap: 3px;
    min-height: 68px;
  }

  .option-row strong {
    grid-column: 2;
    font-size: 17px;
  }

  .option-row small {
    grid-column: 2 / 4;
    font-size: 14px;
  }

  .option-info {
    grid-column: 3;
    grid-row: 1;
  }

  .vat-rate-row {
    grid-template-columns: 38px minmax(0, 1fr) 132px;
    padding: 12px 0 12px 38px;
  }

  .vat-rate-row span {
    grid-column: 1 / 3;
    font-size: 17px;
  }

  .vat-rate-row select {
    grid-column: 3;
    justify-self: end;
    width: 132px;
  }

  .privacy-note {
    margin-right: -16px;
    margin-left: -16px;
    padding: 16px;
    align-items: flex-start;
    font-size: 14px;
  }

  .cookie-banner {
    right: 16px;
    bottom: 16px;
    grid-template-columns: 1fr;
    width: calc(100vw - 32px);
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-actions button {
    flex: 1;
  }
}

@media (min-width: 1180px) and (max-width: 1585px) {
  .reference-board {
    grid-template-columns: minmax(380px, 0.85fr) minmax(0, 1.15fr);
    max-width: none;
    padding: 28px 40px 56px;
    column-gap: 42px;
    align-items: start;
  }

  .brand-block {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-copy {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: 520px;
    margin-top: 64px;
  }

  .hero-copy h1 {
    max-width: 520px;
    font-size: clamp(40px, 3.2vw, 44px);
  }

  .hero-copy p {
    max-width: 430px;
    font-size: 21px;
  }

  .feature-list {
    max-width: 460px;
  }

  .paper-stack {
    width: min(520px, 100%);
    margin-top: 26px;
  }

  .converter-card {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 100%;
    max-width: none;
    margin-top: 74px;
  }
}

@media (max-width: 430px) {
  .hero-copy h1 {
    font-size: 33px;
  }

  .hero-copy p {
    font-size: 18px;
  }

  .feature-row {
    gap: 14px;
  }

  .feature-row strong {
    font-size: 16px;
  }

  .feature-row small {
    font-size: 14px;
  }

  .converter-card h2 {
    font-size: 25px;
  }

  .amount-shell input {
    font-size: 29px;
    letter-spacing: 0;
  }

  #exactResultOutput {
    font-size: 22px;
  }
}
