/* MagiXells / Binary Magic brand */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-elevated: #eef2f7;
  --bg-soft: #ffffff;
  --text: #0d1726;
  --text-muted: #5c6d80;
  --blue: #2a8fc0;
  --blue-deep: #1f7aa8;
  --green: #1fa34f;
  --green-deep: #178a42;
  --line: rgba(13, 23, 38, 0.12);
  --header-bg: rgba(246, 248, 251, 0.92);
  --hero-top: #e8eef5;
  --hero-glow-blue: rgba(42, 143, 192, 0.14);
  --hero-glow-green: rgba(31, 163, 79, 0.1);
  --hero-grid-line: rgba(42, 143, 192, 0.14);
  --hero-grid-opacity: 0.28;
  --code-bg: #eef2f7;
  --code-text: #1a2a3a;
  --code-comment: #6a8098;
  --input-bg: #ffffff;
  --input-focus: rgba(42, 143, 192, 0.35);
  --shot-bg: #eef2f7;
  --shot-checker: #e2e8f0;
  --flash-success-bg: rgba(31, 163, 79, 0.1);
  --flash-success-border: rgba(31, 163, 79, 0.35);
  --flash-cancel-bg: rgba(42, 143, 192, 0.08);
  --flash-cancel-border: rgba(42, 143, 192, 0.25);
  --featured-border: rgba(31, 163, 79, 0.4);
  --featured-shadow: rgba(31, 163, 79, 0.12);
  --cta-glow: rgba(42, 143, 192, 0.1);
  --btn-primary-bg: #4eb5e6;
  --btn-primary-hover: #6fc4eb;
  --btn-primary-text: #061018;
  --btn-green-hover: #2ec766;
  --link-hover: #1f7aa8;
  --radius: 4px;
  --font-display: "Outfit", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1120px;
  --nav-h: 4.25rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1726;
  --bg-elevated: #132033;
  --bg-soft: #18283c;
  --text: #f4f7fb;
  --text-muted: #9aafc4;
  --blue: #4eb5e6;
  --blue-deep: #2a8fc0;
  --green: #2ec766;
  --green-deep: #1fa34f;
  --line: rgba(78, 181, 230, 0.18);
  --header-bg: rgba(13, 23, 38, 0.88);
  --hero-top: #0a121f;
  --hero-glow-blue: rgba(78, 181, 230, 0.22);
  --hero-glow-green: rgba(46, 199, 102, 0.14);
  --hero-grid-line: rgba(78, 181, 230, 0.12);
  --hero-grid-opacity: 0.35;
  --code-bg: #081018;
  --code-text: #c8dcec;
  --code-comment: #6a8098;
  --input-bg: #0a121c;
  --input-focus: rgba(78, 181, 230, 0.45);
  --shot-bg: #081018;
  --shot-checker: #0a1522;
  --flash-success-bg: rgba(46, 199, 102, 0.12);
  --flash-success-border: rgba(46, 199, 102, 0.35);
  --flash-cancel-bg: rgba(78, 181, 230, 0.1);
  --flash-cancel-border: rgba(78, 181, 230, 0.3);
  --featured-border: rgba(46, 199, 102, 0.45);
  --featured-shadow: rgba(46, 199, 102, 0.15);
  --cta-glow: rgba(78, 181, 230, 0.16);
  --btn-primary-bg: #4eb5e6;
  --btn-primary-hover: #6fc4eb;
  --btn-primary-text: #061018;
  --btn-green-hover: #4ad57d;
  --link-hover: #7cc8ee;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* -- Nav -- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100% - 2.5rem, var(--max));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: auto;
  height: 2.35rem;
  object-fit: contain;
  border-radius: 0.35rem;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.nav-cta:hover {
  background: var(--btn-primary-hover);
  color: var(--btn-primary-text) !important;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--blue);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1.25rem 1.25rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-cta {
    margin-top: 0.75rem;
    justify-content: center;
    border-bottom: none !important;
  }

  .theme-toggle {
    margin-top: 0.75rem;
    justify-content: center;
    width: 100%;
  }
}

/* -- Buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  color: var(--btn-primary-text);
}

.btn-green {
  background: var(--green);
  color: #04140a;
}

.btn-green:hover {
  background: var(--btn-green-hover);
  color: #04140a;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* -- Hero -- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% 20%, var(--hero-glow-blue), transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 80%, var(--hero-glow-green), transparent 50%),
    linear-gradient(180deg, var(--hero-top) 0%, var(--bg) 100%);
}

.hero-shot {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  line-height: 0;
  pointer-events: none;
}

.hero-shot img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  object-position: 72% 18%;
  opacity: 0.88;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 92%, transparent) 34%,
      color-mix(in srgb, var(--bg) 55%, transparent) 52%,
      transparent 72%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 35%, transparent) 0%,
      transparent 28%,
      transparent 62%,
      var(--bg) 100%
    );
}

.hero-inner {
  position: relative;
  z-index: 3;
  padding: clamp(2.5rem, 8vh, 5rem) 0 clamp(3rem, 8vh, 5rem);
  max-width: min(40rem, 92vw);
}

.hero-logo {
  height: clamp(5.5rem, 18vw, 8.5rem);
  width: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 1.5rem;
  border-radius: 1.1rem;
  filter: drop-shadow(0 10px 28px rgba(13, 23, 38, 0.18));
}

.hero-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0 0 1.25rem;
  text-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 70%, transparent);
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 34rem;
}

@media (max-width: 820px) {
  .hero-shot img {
    object-position: 60% 12%;
    opacity: 0.55;
  }

  .hero-scrim {
    background:
      linear-gradient(
        180deg,
        color-mix(in srgb, var(--bg) 72%, transparent) 0%,
        color-mix(in srgb, var(--bg) 82%, transparent) 42%,
        var(--bg) 100%
      );
  }

  .hero-inner {
    max-width: 100%;
  }
}

/* -- Sections -- */
.section {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.section-label {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.section h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-lead {
  margin: 0 0 2rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.section-alt {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg));
  border-block: 1px solid var(--line);
}

.feature {
  display: grid;
  gap: 1rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

.feature:last-child {
  border-bottom: 1px solid var(--line);
}

.feature h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  max-width: 40rem;
}

.feature-accent {
  width: 2.5rem;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 2px;
}

/* -- Code -- */
.code-block {
  margin: 0;
  padding: 1.25rem 1.35rem;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--code-text);
}

.code-block .kw {
  color: var(--blue);
}

.code-block .str {
  color: var(--green);
}

.code-block .cm {
  color: var(--code-comment);
}

/* -- Pricing -- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 720px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.price-tier {
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.price-tier.featured {
  border-color: var(--featured-border);
  box-shadow: 0 0 0 1px var(--featured-shadow);
}

.price-tier h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.price-amount {
  margin: 0.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.price-amount span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.price-tier ul {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.price-tier li {
  padding: 0.35rem 0 0.35rem 1.15rem;
  position: relative;
}

.price-tier li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green);
}

.price-note {
  margin-top: 1.75rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.flash {
  display: none;
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.flash.is-visible {
  display: block;
}

.flash-success {
  background: var(--flash-success-bg);
  border-color: var(--flash-success-border);
}

.flash-cancel {
  background: var(--flash-cancel-bg);
  border-color: var(--flash-cancel-border);
}

/* -- Page header (inner pages) -- */
.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 1rem;
}

.page-hero h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
}

.page-hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 36rem;
}

.prose {
  max-width: 42rem;
}

.prose h2 {
  margin: 2.25rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.prose p,
.prose li {
  color: var(--text-muted);
}

.prose ul {
  padding-left: 1.2rem;
}

.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  text-decoration: none;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-form-wrap {
  max-width: 36rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .contact-form .field-row {
    grid-template-columns: 1fr;
  }
}

.contact-form .field {
  display: grid;
  gap: 0.35rem;
}

.contact-form label {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.contact-form .optional {
  font-weight: 400;
  color: var(--text-muted);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--input-focus);
  outline-offset: 1px;
  border-color: var(--blue);
}

.contact-form textarea {
  resize: vertical;
  min-height: 9rem;
}

.contact-form .btn {
  justify-self: start;
  margin-top: 0.25rem;
  border: none;
}

.contact-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form .captcha-field {
  max-width: 14rem;
}

.contact-form .captcha-field input {
  font-variant-numeric: tabular-nums;
}

.cta-band {
  padding: clamp(3rem, 7vw, 4.5rem) 0;
  background:
    radial-gradient(ellipse 70% 80% at 50% 100%, var(--cta-glow), transparent 60%),
    var(--bg-elevated);
  border-top: 1px solid var(--line);
  text-align: center;
}

.cta-band h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  white-space: nowrap;
}

.cta-band p {
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  max-width: none;
  white-space: nowrap;
}

.cta-band .btn-row {
  justify-content: center;
  flex-wrap: nowrap;
}

@media (max-width: 720px) {
  .cta-band h2,
  .cta-band p {
    white-space: normal;
  }

  .cta-band .btn-row {
    flex-wrap: wrap;
  }
}

.site-footer {
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer .wrap > p {
  margin: 0;
  white-space: nowrap;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.25rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .site-footer .wrap {
    flex-wrap: wrap;
  }

  .site-footer .wrap > p,
  .footer-links {
    white-space: normal;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

/* -- Screenshots -- */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.shot-grid .shot-featured {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .shot-grid {
    grid-template-columns: 1fr;
  }
}

.shot {
  margin: 0;
}

.shot-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--shot-bg);
  text-decoration: none;
}

.shot-link:hover {
  border-color: var(--input-focus);
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
  background:
    linear-gradient(45deg, var(--shot-checker) 25%, transparent 25%),
    linear-gradient(-45deg, var(--shot-checker) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--shot-checker) 75%),
    linear-gradient(-45deg, transparent 75%, var(--shot-checker) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-color: var(--shot-bg);
}

.shot-featured img {
  min-height: 12rem;
  object-fit: contain;
}

.shot figcaption {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.shot figcaption strong {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.shot-note {
  margin-top: 2rem;
  color: var(--text-muted);
}

/* -- Download -- */
.download-card {
  padding: 1.75rem 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 44rem;
}

.download-card-main {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.download-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.85rem;
  flex-shrink: 0;
}

.download-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.download-card p {
  margin: 0;
  color: var(--text-muted);
}

.download-meta {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.download-meta li {
  padding: 0.2rem 0 0.2rem 1.1rem;
  position: relative;
}

.download-meta li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--green);
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

@media (max-width: 560px) {
  .download-card-main {
    flex-direction: column;
  }
}

/* Motion: hero fade-in */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner {
    animation: rise 0.9s ease both;
  }

  .hero-shot img {
    animation: fade-grid 1.1s ease both;
  }

  .feature {
    animation: rise 0.7s ease both;
  }

  .feature:nth-child(1) {
    animation-delay: 0.05s;
  }
  .feature:nth-child(2) {
    animation-delay: 0.1s;
  }
  .feature:nth-child(3) {
    animation-delay: 0.15s;
  }
  .feature:nth-child(4) {
    animation-delay: 0.2s;
  }
  .feature:nth-child(5) {
    animation-delay: 0.25s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-grid {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.35;
  }
}

/* -- Internal stats -- */
.stats-header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stats-badge {
  margin-right: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--line);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
}

.stats-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stats-kpi {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.stats-kpi-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stats-kpi-value {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stats-kpi-sub {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.stats-grid > .stats-panel:only-child,
.stats-grid > .stats-panel:first-child:last-child {
  grid-column: 1 / -1;
}

.stats-panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  min-width: 0;
}

.stats-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.stats-table-wrap {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-table th,
.stats-table td {
  text-align: left;
  padding: 0.4rem 0.55rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.stats-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-table td:nth-child(n + 2) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stats-meta {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .stats-kpis,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
