:root {
  color-scheme: light;
  --page: #eef2f5;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --surface-3: #eef4f2;
  --ink: #182026;
  --muted: #68737d;
  --line: #dfe6e9;
  --line-strong: #c8d2d6;
  --accent: #0a7c6d;
  --accent-strong: #075e55;
  --accent-soft: #dff3ee;
  --blue: #315b8c;
  --amber: #b7791f;
  --rose: #a24059;
  --shadow: 0 24px 60px rgba(25, 37, 48, 0.12);
  --shadow-soft: 0 12px 28px rgba(25, 37, 48, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 320px),
    linear-gradient(120deg, rgba(10, 124, 109, 0.13), rgba(49, 91, 140, 0.06) 42%, rgba(183, 121, 31, 0.09)),
    var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  width: min(1460px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 34px;
}

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

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-lockup {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  filter: drop-shadow(0 12px 18px rgba(25, 37, 48, 0.16));
}

.brand-mark-bg {
  fill: #10251f;
  stroke: rgba(10, 124, 109, 0.22);
  stroke-width: 1;
}

.brand-mark-check {
  fill: none;
  stroke: #c9f3e8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.4;
}

.brand-mark-key {
  fill: none;
  stroke: #f3c86b;
  stroke-linecap: round;
  stroke-width: 3.2;
}

.brand-mark-dot {
  fill: #2fc2a6;
  stroke: none;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.brand-domain {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.panel-kicker {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  font-size: 34px;
  line-height: 1.08;
}

.topbar-note {
  max-width: 780px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.product-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.product-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.product-nav a:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.product-nav a[aria-current="page"] {
  border-color: rgba(10, 124, 109, 0.28);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  line-height: 1.25;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(430px, 1.08fr) minmax(360px, 0.94fr) minmax(330px, 0.86fr);
  grid-template-areas:
    "calc copy advanceText"
    "batch batch batch"
    "seo seo seo";
  gap: 16px;
  align-items: stretch;
}

.tool-panel {
  border: 1px solid rgba(24, 32, 38, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.calculator-panel {
  grid-area: calc;
  padding: 20px;
}

.copy-panel {
  grid-area: copy;
  padding: 20px;
}

.advance-text-panel {
  grid-area: advanceText;
  padding: 20px;
}

.calculator-panel,
.copy-panel,
.advance-text-panel {
  height: 100%;
}

.batch-panel {
  grid-area: batch;
  padding: 20px;
}

.seo-panel {
  grid-area: seo;
  padding: 28px 0 8px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading h2,
.panel-heading h3 {
  margin-top: 3px;
}

.icon-button,
.secondary-button,
.segment,
.rate-chip,
.mini-segment,
.copy-item button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.top-action {
  background: #13221e;
  color: #eaf7f4;
  border-color: #13221e;
}

.secondary-button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.icon-button:hover,
.secondary-button:hover,
.copy-item button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(10, 124, 109, 0.2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.status-pill strong {
  font-size: 14px;
}

.doc-cue {
  display: grid;
  gap: 5px;
  width: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.doc-cue span {
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.doc-cue span:nth-child(2) {
  width: 75%;
  background: var(--blue);
}

.doc-cue span:nth-child(3) {
  width: 88%;
  background: var(--amber);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-height: 48px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.segment {
  min-width: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field span,
.custom-rate span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.amount-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 76px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 249, 0.96)),
    var(--surface-2);
}

.amount-input:focus-within,
.custom-rate:focus-within,
.field.compact input:focus,
.batch-panel textarea:focus {
  border-color: rgba(10, 124, 109, 0.52);
  box-shadow: 0 0 0 4px rgba(10, 124, 109, 0.12);
}

.amount-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 31px;
  font-weight: 800;
}

.amount-input span {
  color: var(--accent-strong);
  font-size: 21px;
  font-weight: 800;
}

.rate-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(48px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.rate-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.rate-chip.active {
  border-color: rgba(10, 124, 109, 0.42);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.custom-rate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-column: span 2;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.custom-rate input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: right;
  font-weight: 800;
}

.date-line {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.field.compact {
  flex: 1;
  margin-top: 0;
}

.field.compact input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle span {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d0d9dc;
}

.toggle span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24, 32, 38, 0.18);
  content: "";
  transition: transform 140ms ease;
}

.toggle input:checked + span {
  background: var(--accent);
}

.toggle input:checked + span::after {
  transform: translateX(20px);
}

.toggle em {
  font-style: normal;
  white-space: nowrap;
}

.result-strip,
.advance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.metric-card {
  min-width: 0;
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.metric-card.accent {
  border-color: rgba(10, 124, 109, 0.22);
  background: var(--accent-soft);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.14;
}

.formula-line {
  min-height: 44px;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid rgba(183, 121, 31, 0.2);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff6e8;
  color: #70470b;
  font-size: 14px;
  line-height: 1.35;
}

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

.advance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.advance-top h2 {
  margin-top: 3px;
}

.mini-segmented {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.mini-segment {
  min-height: 30px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mini-segment.active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
}

.advance-field {
  margin-top: 12px;
}

.amount-input.small {
  min-height: 58px;
  padding: 0 14px;
}

.amount-input.small input {
  font-size: 24px;
}

.amount-input.small span {
  font-size: 18px;
}

.advance-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.advance-metrics .metric-card {
  min-height: 74px;
  padding: 11px;
}

.advance-metrics .metric-card strong {
  font-size: 16px;
}

.copy-list {
  display: grid;
  gap: 10px;
}

.copy-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}

.copy-text {
  min-height: 74px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.copy-text strong {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 12px;
  text-transform: uppercase;
}

.copy-item button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-strong);
}

.no-vat-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.batch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
  gap: 14px;
  align-items: start;
}

.batch-workarea,
.batch-words {
  min-width: 0;
}

.batch-panel textarea {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-2);
  color: var(--ink);
  line-height: 1.45;
}

.batch-table-wrap {
  width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

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

th {
  background: #f4f7f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.batch-words {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.batch-words-heading {
  margin-bottom: 12px;
}

.batch-words-heading h3 {
  margin-top: 3px;
}

.seo-heading {
  max-width: 820px;
}

.seo-heading h2 {
  margin-top: 5px;
  font-size: 26px;
}

.seo-heading p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.seo-heading.compact {
  margin-bottom: 14px;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.formula-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.formula-card h3,
.seo-columns h3 {
  font-size: 16px;
}

.formula-card p,
.seo-columns p,
.faq-block p {
  color: var(--muted);
  line-height: 1.58;
}

.formula-card p {
  margin-top: 10px;
}

.formula-card code {
  display: block;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(49, 91, 140, 0.18);
  border-radius: 8px;
  background: #f3f7fb;
  color: var(--blue);
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
}

.sheet-formulas {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.sheet-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.sheet-card h3 {
  font-size: 16px;
}

.sheet-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.formula-code-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.formula-code-list code {
  display: block;
  padding: 10px 11px;
  border: 1px solid rgba(10, 124, 109, 0.16);
  border-radius: 8px;
  background: #f2f8f6;
  color: var(--accent-strong);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.sheet-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.seo-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.seo-columns p {
  margin-top: 8px;
}

.seo-columns a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.faq-block {
  margin-top: 24px;
}

.faq-block details {
  border-top: 1px solid var(--line);
}

.faq-block details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-block summary {
  cursor: pointer;
  padding: 16px 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.faq-block summary::marker {
  color: var(--accent);
}

.faq-block details p {
  max-width: 880px;
  padding-bottom: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #14211e;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: space-between;
  margin-top: 26px;
  padding: 20px 4px 0;
  font-size: 14px;
}

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

.site-footer a:hover {
  text-decoration: underline;
}

.legal-page {
  display: grid;
  justify-items: center;
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
  max-width: 920px;
  padding: 34px;
}

.legal-card h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.04;
  max-width: 760px;
}

.legal-card h2 {
  font-size: 20px;
  margin-top: 8px;
}

.legal-card p {
  color: var(--muted);
  line-height: 1.68;
}

.legal-card a {
  color: var(--accent-strong);
  font-weight: 700;
}

.legal-updated {
  font-weight: 700;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "calc copy"
      "calc advanceText"
      "batch batch"
      "seo seo";
  }

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

  .formula-grid,
  .sheet-grid,
  .seo-columns {
    grid-template-columns: 1fr;
  }
}

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

  .topbar {
    align-items: flex-start;
  }

  .brand-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  h1 {
    font-size: 28px;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "calc"
      "copy"
      "advanceText"
      "batch"
      "seo";
  }

  .tool-panel {
    padding: 16px;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .amount-input {
    min-height: 66px;
  }

  .amount-input input {
    font-size: 26px;
  }

  .rate-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .custom-rate {
    grid-column: 1 / -1;
  }

  .date-line,
  .no-vat-box {
    align-items: stretch;
    flex-direction: column;
  }

  .result-strip,
  .advance-metrics,
  .batch-layout {
    grid-template-columns: 1fr;
  }

  .seo-panel {
    padding-top: 18px;
  }

  .legal-card {
    padding: 24px;
  }

  .seo-heading h2 {
    font-size: 22px;
  }

  .advance-top {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 460px) {
  .topbar {
    gap: 12px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-domain {
    font-size: 11px;
  }

  h1 {
    font-size: 24px;
  }

  .copy-item {
    grid-template-columns: 1fr;
  }

  .copy-item button {
    width: 100%;
  }
}
