/* ── Hero ─────────────────────────────────────────── */
.app-hero {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 1.5rem 1.1rem;
}
.app-hero--matcha {
  background: var(--c-matcha-bg);
  border-bottom-color: var(--c-matcha-border);
}
.app-hero__inner { margin: 0 auto; }
.app-hero__title {
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800;
  color: var(--c-matcha-text); letter-spacing: -.02em;
  margin: 0 0 .5rem; line-height: 1.2;
}
.app-hero__desc {
  font-size: .9rem; color: var(--color-text-secondary);
  max-width: 660px; line-height: 1.6; margin: 0 0 .85rem;
}
.app-hero__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.hero-chip {
  display: inline-flex; align-items: center;
  padding: .22rem .65rem; font-size: .72rem; font-weight: 700;
  background: var(--color-surface); border: 1.5px solid var(--c-matcha-border);
  border-radius: var(--radius-full); color: var(--c-matcha-text); white-space: nowrap;
}

/* ── Tool shell ─────────────────────────────────────────── */
.tool-wrap {
  background: var(--color-surface);
  border: 1.5px solid var(--c-matcha-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: var(--space-10);
}

/* ── Two-column body ────────────────────────────────────── */
.calc-body {
  display: grid;
  grid-template-columns: 320px 1fr;
}
@media (max-width: 820px) {
  .calc-body { grid-template-columns: 1fr; }
}

/* ── Inputs pane ────────────────────────────────────────── */
.inputs-pane {
  border-right: 1.5px solid var(--color-border);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: var(--color-surface);
}
@media (max-width: 820px) {
  .inputs-pane { border-right: none; border-bottom: 1.5px solid var(--color-border); }
}

/* ── Section heading ────────────────────────────────────── */
.input-section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-matcha-text);
  margin: 0 0 var(--space-2);
}

/* ── Field rows ─────────────────────────────────────────── */
.field-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.field-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
}
.field-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
  margin: 0;
}

/* ── Inputs ─────────────────────────────────────────────── */
.text-input,
.num-input,
.select-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-in-out);
  box-sizing: border-box;
}
.text-input:focus,
.num-input:focus,
.select-input:focus {
  border-color: var(--c-matcha-text);
  box-shadow: 0 0 0 3px rgba(56, 90, 32, 0.12);
}

/* ── Currency prefix ────────────────────────────────────── */
.currency-wrap { position: relative; }
.currency-prefix {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--c-matcha-text);
  pointer-events: none;
  user-select: none;
}
.currency-wrap .num-input { padding-left: 1.75rem; }

/* ── Pill toggle group ──────────────────────────────────── */
.pill-group {
  display: flex;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.pill-btn {
  flex: 1;
  padding: var(--space-2) var(--space-1);
  background: transparent;
  border: none;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-family: inherit;
  color: var(--color-text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast);
  white-space: nowrap;
  text-align: center;
  line-height: 1.3;
}
.pill-btn:last-child { border-right: none; }
.pill-btn:hover:not(:disabled):not(.active) {
  background: var(--c-matcha-bg);
  color: var(--c-matcha-text);
}
.pill-btn.active {
  background: var(--c-matcha-text);
  color: #fff;
}
.pill-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Add to invoice button ──────────────────────────────── */
.btn-add-inv {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--c-matcha-text);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-family: inherit;
  transition: opacity var(--duration-fast);
}
.btn-add-inv:hover { opacity: 0.82; }

/* ── Output pane ────────────────────────────────────────── */
.output-pane {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: var(--c-matcha-bg);
}

/* ── VAT result card ────────────────────────────────────── */
.vat-card {
  background: var(--color-surface);
  border: 2px solid var(--c-matcha-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-5) var(--space-6);
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.vat-card.active {
  border-color: var(--c-matcha-text);
  box-shadow: 0 0 0 4px rgba(56, 90, 32, 0.10);
}

/* ── Country row ────────────────────────────────────────── */
.card-country-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.card-flag {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.card-country-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  line-height: 1.2;
}
.card-rate-badge {
  display: inline-block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  background: var(--c-matcha-bg);
  color: var(--c-matcha-text);
  border: 1px solid var(--c-matcha-border);
  border-radius: var(--radius-full);
  padding: 1px var(--space-3);
  letter-spacing: 0.04em;
}
.card-rate-badge.b2b {
  background: #fff9e6;
  color: #7a5000;
  border-color: #f0d060;
}

/* ── Net / VAT / Gross chips ────────────────────────────── */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.amount-chip {
  background: var(--c-matcha-bg);
  border: 1px solid var(--c-matcha-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2);
  text-align: center;
}
.amount-chip--gross {
  border-color: var(--c-matcha-text);
}
.chip-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}
.chip-value {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}
.chip-value--gross { color: var(--c-matcha-text); }

/* ── B2B notice ─────────────────────────────────────────── */
.b2b-notice {
  background: #fff9e6;
  border: 1px solid #f0d060;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  color: #5a4000;
  line-height: 1.55;
}

/* ── Invoice section ────────────────────────────────────── */
.invoice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.invoice-empty {
  background: var(--color-surface);
  border: 1.5px dashed var(--c-matcha-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.btn-link:hover { color: var(--color-text-primary); }

/* ── Invoice table ──────────────────────────────────────── */
.inv-table-wrap {
  background: var(--color-surface);
  border: 1.5px solid var(--c-matcha-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.invoice-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-matcha-text);
  background: var(--c-matcha-bg);
  border-bottom: 1px solid var(--c-matcha-border);
}
.invoice-table td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.invoice-table tbody tr:last-child td {
  border-bottom: 1px solid var(--c-matcha-border);
}
.invoice-table tfoot td {
  padding: var(--space-3) var(--space-3);
  font-weight: var(--weight-bold);
  background: var(--c-matcha-bg);
  color: var(--c-matcha-text);
  border-bottom: none;
}

/* ── Reverse charge notice ──────────────────────────────── */
.rc-notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.rc-notice-box {
  background: #fff9e6;
  border: 1.5px solid #f0d060;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: #5a4000;
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Privacy note ───────────────────────────────────────── */
.privacy-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  justify-content: center;
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* ── Reference rates table ──────────────────────────────── */
.rates-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow-x: auto;
}
.rates-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}
.rates-table th {
  background: var(--c-matcha-bg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-matcha-text);
  text-align: left;
  border-bottom: 1px solid var(--c-matcha-border);
  white-space: nowrap;
}
.rates-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
}
.rates-table tr:last-child td { border-bottom: none; }
.rates-table tr:hover td { background: var(--c-matcha-bg); transition: background 0.1s; }
.rate-std {
  display: inline-block;
  background: var(--c-matcha-bg);
  color: var(--c-matcha-text);
  font-weight: var(--weight-bold);
  border: 1px solid var(--c-matcha-border);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  font-size: var(--text-xs);
}
.rate-red {
  display: inline-block;
  background: #eef6ee;
  color: #2d5a2d;
  border: 1px solid #c6dfc6;
  border-radius: var(--radius-full);
  padding: 1px 8px;
  font-size: var(--text-xs);
  margin-right: 2px;
}
.rate-sup {
  display: inline-block;
  background: #f4faf4;
  color: #3a6b3a;
  border: 1px solid #d0e8d0;
  border-radius: var(--radius-full);
  padding: 1px 8px;
  font-size: var(--text-xs);
}
.rate-none {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1a2e1a;
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Learn More ─────────────────────────────────────────────── */
.learn-more{max-width:820px;margin:1.25rem auto 0;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-xl);padding:1.1rem 1.5rem}
.learn-more-title{font-size:1.1rem;font-weight:800;color:var(--c-matcha-text);margin:0 0 .75rem}
.learn-more h3{font-size:1rem;font-weight:800;color:var(--color-text-primary);margin:1.1rem 0 .5rem}
.learn-more p{font-size:.88rem;line-height:1.65;color:var(--color-text-secondary);margin:0 0 .75rem}
.learn-more a{color:var(--c-matcha-text)}
.learn-more .faq-item{margin-bottom:.75rem}
.learn-more .faq-q{font-size:.88rem;font-weight:700;color:var(--color-text-primary);margin:0 0 .25rem}
.learn-more-meta{font-size:.72rem;color:var(--color-text-muted);margin-top:1rem}
