:root {
  --primary: #0b1c2d;
  --accent: #1fb6aa;
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #5f6b7a;
  --border: #e5e7eb;
  --shadow: 0 24px 70px rgba(11, 28, 45, 0.12);
  --shadow-soft: 0 14px 34px rgba(11, 28, 45, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1180px;
}

[data-theme="dark"] {
  --primary: #06111d;
  --bg: #081521;
  --surface: #0f2133;
  --text: #eef6fb;
  --muted: #a7b4c4;
  --border: rgba(229, 231, 235, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 0%, rgba(31, 182, 170, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(11, 28, 45, 0.04), transparent 30%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
a,
summary {
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease, color 180ms ease;
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(31, 182, 170, 0.38);
  outline-offset: 3px;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
  min-width: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand img {
  width: clamp(150px, 16vw, 190px);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.site-nav a:hover {
  color: var(--accent);
}

.theme-toggle,
.button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.15rem;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 24px rgba(31, 182, 170, 0.28);
}

.button-secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.button:hover,
.theme-toggle:hover,
.slab-cards button:hover,
.tab:hover {
  transform: translateY(-1px);
}

.hero {
  padding: 5rem 0 3.5rem;
  background: linear-gradient(135deg, var(--primary), #12395a);
  color: #ffffff;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.62fr);
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 13ch;
  margin-bottom: 1.2rem;
  font-size: clamp(2.55rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 1rem;
  font-size: 1.22rem;
  line-height: 1.2;
}

.hero-text {
  max-width: 670px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.1rem;
}

.hero-actions,
.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  max-width: 560px;
  margin: 2rem 0 0;
}

.hero-stats div,
.hero-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.hero-stats div {
  padding: 1rem;
}

.hero-stats dt {
  font-size: 1.45rem;
  font-weight: 900;
}

.hero-stats dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.hero-card {
  padding: 1.4rem;
  backdrop-filter: blur(18px);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.status-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.preview-total {
  margin: 1.2rem 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.preview-row,
.result-list div,
.mini-results div,
.summary-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preview-row {
  padding: 0.95rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.calculator-section,
.business-tools,
.seo-content,
.faq-section,
.cta-section {
  padding: 4.8rem 0;
}

/* Astra assigns heading colors directly, so inherited white is not enough. */
.vhp-page-gst-calculator .hero .hero-copy h1,
.vhp-page-gst-calculator .cta-section .section-heading h2 {
  color: #ffffff;
  opacity: 1;
  -webkit-text-fill-color: #ffffff;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
}

.heading-with-help,
.label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.heading-with-help {
  justify-content: center;
}

.heading-with-help-left {
  justify-content: flex-start;
}

.heading-with-help h2,
.label-with-help h3 {
  margin: 0;
}

.help-tip,
.has-tip {
  position: relative;
}

.help-tip {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 999px;
  cursor: help;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
}

.summary-grid .help-tip,
.result-list .help-tip,
.mini-results .help-tip {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 950;
}

.help-tip:focus-visible {
  outline: 3px solid rgba(31, 182, 170, 0.38);
  outline-offset: 3px;
}

.help-tip::after,
.has-tip::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.65rem);
  z-index: 30;
  width: min(260px, calc(100dvw - 2rem));
  max-width: calc(100dvw - 2rem);
  padding: 0.72rem 0.85rem;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid color-mix(in srgb, #ffffff 12%, transparent);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.help-tip::before,
.has-tip::before {
  content: "";
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.28rem);
  z-index: 31;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--primary);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) rotate(45deg);
  transition: opacity 160ms ease, transform 160ms ease;
}

.help-tip:hover::before,
.help-tip:hover::after,
.help-tip:focus-visible::before,
.help-tip:focus-visible::after,
.has-tip:hover::before,
.has-tip:hover::after,
.has-tip:focus-visible::before,
.has-tip:focus-visible::after {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}

.help-tip:hover::after,
.help-tip:focus-visible::after,
.has-tip:hover::after,
.has-tip:focus-visible::after {
  transform: translate(-50%, 0);
}

.tab.has-tip::after {
  width: min(290px, calc(100dvw - 2rem));
  font-weight: 700;
}

.heading-with-help-left .help-tip::after {
  left: auto;
  right: 0;
  transform: translate(0, 6px);
}

.heading-with-help-left .help-tip::before {
  left: auto;
  right: 0.3rem;
  transform: translate(0, 6px) rotate(45deg);
}

.heading-with-help-left .help-tip:hover::before,
.heading-with-help-left .help-tip:focus-visible::before {
  transform: translate(0, 0) rotate(45deg);
}

.heading-with-help-left .help-tip:hover::after,
.heading-with-help-left .help-tip:focus-visible::after {
  transform: translate(0, 0);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.25rem;
  align-items: start;
}

.calculator-panel,
.result-panel,
.tool-card,
.table-card,
.seo-content article,
.faq-list details {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calculator-panel {
  padding: clamp(1rem, 3vw, 1.6rem);
}

.result-panel {
  position: sticky;
  top: 94px;
  padding: 1.35rem;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 45%, transparent);
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.tab.active {
  color: #ffffff;
  background: var(--primary);
}

.input-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.62fr;
  gap: 1rem;
  margin-top: 1.2rem;
}

.field,
.tool-card label,
.table-card label {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 52px;
  padding: 0 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.transaction-type {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.transaction-type legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-weight: 900;
}

.transaction-type label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
}

.transaction-type input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

.slab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 0.75rem;
  margin: 1.2rem 0;
  min-width: 0;
}

.slab-cards button {
  width: 100%;
  min-width: 0;
  min-height: 72px;
  padding: 0.65rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 950;
}

.slab-cards button.selected {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 16px 30px rgba(31, 182, 170, 0.24);
}

.summary-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg) 72%, var(--surface));
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.summary-grid div,
.mini-results div,
.result-list div {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.summary-grid span,
.mini-results span,
.result-list span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.copy-status {
  min-height: 1.5rem;
  margin: 0.7rem 0 0;
  color: var(--accent);
  font-weight: 800;
}

.result-total {
  margin: 1rem 0;
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 950;
  letter-spacing: -0.045em;
}

.result-list {
  display: grid;
  gap: 0.65rem;
}

.result-note {
  margin: 1rem 0 0;
  color: var(--muted);
}

.tool-grid,
.comparison-grid,
.cta-grid {
  display: grid;
  gap: 1rem;
}

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

.tool-card,
.table-card {
  padding: 1.25rem;
}

.tool-card label {
  margin-bottom: 0.85rem;
}

.mini-results {
  display: grid;
  gap: 0.65rem;
}

.comparison-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  margin-top: 1rem;
}

.comparison-grid > *,
.table-card {
  min-width: 0;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-heading label {
  min-width: 190px;
}

.rate-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.7rem;
}

.rate-comparison article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 76%, var(--surface));
  overflow: hidden;
}

.rate-comparison b {
  display: block;
  color: var(--accent);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.rate-comparison small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.seo-content {
  background: color-mix(in srgb, var(--surface) 64%, transparent);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.seo-content article {
  padding: 1.35rem;
}

.seo-content p,
.faq-list p,
.site-footer p {
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 0.8rem;
  max-width: 900px;
  margin: 0 auto;
}

.faq-list details {
  padding: 1rem 1.15rem;
}

.faq-list summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.faq-list p {
  margin: 0.7rem 0 0;
}

.cta-section {
  background: var(--primary);
  color: #ffffff;
}

.cta-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cta-grid a {
  min-height: 120px;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 900;
}

.cta-grid a:hover {
  background: rgba(31, 182, 170, 0.24);
  transform: translateY(-2px);
}

.site-footer {
  padding: 1.8rem 0 2.6rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.footer-layout {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  min-width: 0;
}

.footer-brand {
  max-width: 360px;
  min-width: 0;
}

.footer-brand p {
  color: var(--muted);
  font-size: 1.02rem;
}

.brand-footer {
  margin-bottom: 0.9rem;
}

.brand-footer .brand-logo {
  width: clamp(9.5rem, 16vw, 13rem);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, max-content));
  gap: 0.9rem 1.5rem;
  min-width: 0;
}

.footer-links a {
  color: var(--muted);
  font-family: "Manrope", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .calculator-panel,
  .result-panel,
  .tool-card,
  .table-card,
  .seo-content article,
  .hero-card {
    animation: rise 420ms ease both;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .pulse {
    animation: pulseValue 260ms ease;
  }

  @keyframes pulseValue {
    50% {
      color: var(--accent);
    }
  }
}

@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  .hero-grid,
  .workspace,
  .tool-grid,
  .comparison-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }

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

  .footer-layout {
    flex-direction: column;
  }

  .footer-links {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 2rem, var(--container));
  }

  .nav-wrap {
    min-height: 68px;
  }

  .theme-toggle span:last-child {
    display: none;
  }

  .hero,
  .calculator-section,
  .business-tools,
  .seo-content,
  .faq-section,
  .cta-section {
    padding: 3rem 0;
  }

  .hero-stats,
  .input-grid,
  .summary-grid,
  .rate-comparison,
  .cta-grid {
    grid-template-columns: 1fr;
  }

  .slab-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-heading,
  .footer-layout {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .card-heading label {
    min-width: 0;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #invoiceSummary,
  #invoiceSummary * {
    visibility: visible;
  }

  #invoiceSummary {
    position: absolute;
    inset: 1rem auto auto 1rem;
    width: calc(100% - 2rem);
    box-shadow: none;
  }

  .summary-actions,
  .copy-status {
    display: none;
  }
}
