:root {
  color-scheme: dark;
  --redline-bg: #070708;
  --redline-bg-soft: #0d0d10;
  --redline-surface: #121216;
  --redline-surface-raised: #19191e;
  --redline-steel: #2d2e35;
  --redline-line: #383941;
  --redline-line-soft: #24252b;
  --redline-text: #f7f5f4;
  --redline-muted: #aaa8ac;
  --redline-red: #e3192d;
  --redline-red-bright: #ff3246;
  --redline-red-dark: #8f0715;
  --redline-success: #35c986;
  --redline-warning: #e0a12d;
  --redline-info: #4c8ce8;
  --redline-danger: #ff5365;
  --redline-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --font-thai: "IBM Plex Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --font-display: "Chakra Petch", "IBM Plex Sans Thai", sans-serif;

  /* Legacy aliases used by the current page styles. */
  --bg: var(--redline-bg);
  --soft: var(--redline-bg-soft);
  --panel: var(--redline-surface);
  --text: var(--redline-text);
  --ink: var(--redline-text);
  --muted: var(--redline-muted);
  --line: var(--redline-line);
  --line-strong: #55565f;
  --surface: var(--redline-surface);
  --paper: var(--redline-bg);
  --white: var(--redline-surface);
  --forest: #0a0a0c;
  --forest-soft: var(--redline-surface-raised);
  --green: var(--redline-red);
  --green-bright: var(--redline-red-bright);
  --green-dark: var(--redline-red);
  --primary: var(--redline-red);
  --primary-strong: #bd0f21;
  --danger: var(--redline-danger);
  --success: var(--redline-success);
  --amber: var(--redline-warning);
  --blue: var(--redline-info);
  --dark-line: var(--redline-line);
  --shadow: var(--redline-shadow);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--redline-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  color: var(--redline-text);
  background-color: var(--redline-bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  font-family: var(--font-thai);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 0 68%, rgba(227, 25, 45, 0.035) 68% 68.15%, transparent 68.15%),
    linear-gradient(180deg, rgba(7, 7, 8, 0.18), rgba(7, 7, 8, 0.88));
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-thai);
}

h1,
h2,
h3,
.brand strong,
.wordmark strong,
.price,
.download-action > strong {
  font-family: var(--font-display);
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--redline-red-bright);
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: var(--redline-red-dark);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: #09090b;
}

::-webkit-scrollbar-thumb {
  border: 3px solid #09090b;
  border-radius: 8px;
  background: #414149;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--redline-red);
}

.site-header,
.topbar,
.download-header {
  border-color: var(--redline-line-soft);
  background: rgba(8, 8, 10, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.site-header::after,
.topbar::after,
.download-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--redline-red) 18%, rgba(227, 25, 45, 0.12) 62%, transparent);
}

.site-header,
.topbar,
.header-inner {
  position: relative;
}

.site-header .site-navigation,
.topbar .site-navigation,
.header-inner .site-navigation {
  display: flex;
  align-items: center;
}

.site-header .site-navigation {
  justify-self: end;
  gap: 34px;
}

.topbar .site-navigation {
  min-width: 0;
  flex: 1;
  justify-content: space-between;
  gap: 24px;
}

.header-inner .site-navigation {
  justify-content: flex-end;
}

.nav-download-link {
  min-width: 94px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.nav-release-version {
  display: block;
  color: var(--redline-red-bright);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.nav-release-version.is-unavailable {
  color: var(--redline-muted);
  font-size: 9px;
}

.brand-mark,
.wordmark img {
  border-color: #4a2a30;
  background: #0b0b0d;
  box-shadow: 0 0 22px rgba(227, 25, 45, 0.16);
}

.brand small,
.wordmark small,
.card-kicker,
.eyebrow,
.section-kicker,
.section-heading span,
.release-label {
  color: var(--redline-red-bright);
}

.site-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--redline-line);
  border-radius: 5px;
  color: var(--redline-text);
  background: var(--redline-surface);
  cursor: pointer;
}

.site-menu-toggle-lines {
  width: 18px;
  height: 14px;
  margin: auto;
  display: grid;
  align-content: space-between;
}

.site-menu-toggle-lines::before,
.site-menu-toggle-lines::after,
.site-menu-toggle-lines span {
  content: "";
  width: 100%;
  height: 2px;
  display: block;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle-lines::before {
  transform: translateY(6px) rotate(45deg);
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle-lines span {
  opacity: 0;
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle-lines::after {
  transform: translateY(-6px) rotate(-45deg);
}

.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;
}

.primary-button,
.primary-link,
.download-button,
.primary-action,
.primary-download {
  border: 1px solid #f13b4d;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(180deg, var(--redline-red-bright), #bd0d20 58%, #990918);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 26px rgba(190, 10, 31, 0.2);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.primary-button:hover,
.primary-link:hover,
.download-button:hover,
.primary-action:hover,
.primary-download:hover {
  border-color: #ff6a78;
  color: #fff;
  background: linear-gradient(180deg, #ff4355, #d41125 58%, #ae0b1c);
  transform: translateY(-1px);
}

.primary-button:disabled,
.primary-download.disabled {
  border-color: #33343a;
  color: #76767d;
  background: #202126;
  box-shadow: none;
  text-shadow: none;
}

.ghost-button,
.secondary-link,
.secondary-action,
.text-action,
.back-link {
  color: #dedbda;
  border-color: var(--redline-line);
}

.ghost-button:hover,
.secondary-link:hover,
.secondary-action:hover,
.text-action:hover,
.back-link:hover {
  color: #fff;
  border-color: var(--redline-red);
  background: rgba(227, 25, 45, 0.08);
}

input,
select,
textarea {
  border-color: var(--redline-line);
  color: var(--redline-text);
  background: #0c0c0f;
}

input::placeholder,
textarea::placeholder {
  color: #73737a;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--redline-red);
  box-shadow: 0 0 0 3px rgba(227, 25, 45, 0.15);
}

select {
  color-scheme: dark;
}

.auth-overlay,
.contact-overlay,
.verify-overlay,
.announcement-overlay {
  background: rgba(2, 2, 3, 0.84);
  backdrop-filter: blur(10px);
}

.auth-panel,
.contact-panel,
.verify-panel,
.announcement-dialog {
  border-color: #4b3035;
  color: var(--redline-text);
  background: var(--redline-surface);
  box-shadow: var(--redline-shadow), 0 0 0 1px rgba(227, 25, 45, 0.08);
}

.close-button {
  border-color: var(--redline-line);
  color: var(--redline-muted);
  background: #0b0b0d;
}

.close-button:hover {
  border-color: var(--redline-red);
  color: #fff;
  background: #2a0c12;
}

.button-spinner,
.inline-spinner,
.verify-icon.loading {
  border-color: rgba(255, 255, 255, 0.24);
  border-right-color: var(--redline-red-bright);
}

.customer-footer {
  width: min(1240px, calc(100% - 48px));
  min-height: 116px;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  color: var(--redline-muted);
  border-top: 1px solid var(--redline-line-soft);
  background: transparent;
}

.customer-footer p {
  margin: 0;
  text-align: center;
}

.customer-footer nav,
.customer-footer > div:last-child {
  justify-self: end;
  display: flex;
  gap: 20px;
}

.customer-footer a {
  text-decoration: none;
}

.customer-footer a:hover {
  color: var(--redline-red-bright);
}

@media (max-width: 900px) {
  .site-menu-toggle {
    display: block;
    justify-self: end;
  }

  .site-header .site-navigation,
  .topbar .site-navigation,
  .header-inner .site-navigation {
    position: absolute;
    z-index: 100;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    max-height: calc(100vh - 86px);
    padding: 16px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    border: 1px solid var(--redline-line);
    border-top: 2px solid var(--redline-red);
    border-radius: 0 0 7px 7px;
    background: rgba(12, 12, 15, 0.985);
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.48);
  }

  .site-navigation.is-open {
    display: flex;
  }

  .site-navigation nav,
  .site-navigation .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-navigation nav a,
  .site-navigation nav button,
  .site-navigation > .header-action {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    justify-content: flex-start;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 4px;
  }

  .site-navigation .nav-download-link {
    align-items: flex-start;
  }

  .customer-footer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .customer-footer p {
    text-align: left;
  }

  .customer-footer nav,
  .customer-footer > div:last-child {
    justify-self: start;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .customer-footer {
    width: calc(100% - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Checkout application must win over its legacy visual layer. */
body .topbar {
  min-height: 76px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 30px;
  background: rgba(8, 8, 10, 0.94);
  border-color: var(--redline-line-soft);
}

body .topbar .site-navigation {
  min-width: 0;
  flex: 1;
  justify-content: space-between;
}

body .topbar .ghost-button,
body .topbar .secondary-link {
  color: #cfcccd;
  background: transparent;
  border-color: transparent;
}

body .topbar .ghost-button:hover,
body .topbar .secondary-link:hover {
  color: #fff;
  background: rgba(227, 25, 45, 0.08);
  border-color: #563239;
}

body .top-auth .primary-button,
body .top-auth .primary-button:hover {
  color: #fff;
  background: linear-gradient(180deg, var(--redline-red-bright), #a8091a);
  border-color: #ef4354;
}

body .pricing-hero,
body .announcements-hero,
body .profile-hero,
body .checkout-hero {
  min-height: 350px;
  color: #fff;
  background:
    linear-gradient(108deg, rgba(227, 25, 45, 0.11), transparent 35%),
    linear-gradient(180deg, #121216, #09090b);
  border-color: #493038;
}

body .pricing-hero::before,
body .announcements-hero::before,
body .profile-hero::before,
body .checkout-hero::before {
  background:
    linear-gradient(rgba(227, 25, 45, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(227, 25, 45, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
}

body .pricing-hero h1,
body .announcements-hero h1,
body .profile-hero h1,
body .checkout-hero h1 {
  color: #fff;
}

body .pricing-hero p:not(.eyebrow),
body .announcements-hero p:not(.eyebrow),
body .profile-hero p:not(.eyebrow),
body .checkout-hero p:not(.eyebrow) {
  color: var(--redline-muted);
}

body .pricing-hero .eyebrow,
body .announcements-hero .eyebrow,
body .profile-hero .eyebrow,
body .checkout-hero .eyebrow,
body .eyebrow,
body .card-kicker,
body .mini-eyebrow {
  color: var(--redline-red-bright);
}

body .account-strip,
body .pricing-section,
body .payment-panel,
body .profile-card,
body .profile-loading,
body .profile-login-required,
body .announcement-card,
body .announcements-empty,
body .empty-card {
  color: var(--redline-text);
  background: rgba(18, 18, 22, 0.96);
  border-color: var(--redline-line);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2);
}

body .account-strip {
  border-left: 3px solid var(--redline-red);
}

body .account-strip h2,
body .section-head h2,
body .download-card h2 {
  color: #fff;
}

body .account-strip p,
body .profile-help,
body .profile-empty,
body .profile-metric span,
body .profile-metric small,
body .announcement-copy p,
body .announcements-empty span {
  color: var(--redline-muted);
}

body .user-summary,
body .summary-card,
body .summary-card.muted-card {
  color: #dedadc;
  background: #09090b;
  border-color: #553038;
}

body .summary-card strong,
body .summary-card b,
body .user-summary strong {
  color: #fff;
}

body .user-summary span {
  color: var(--redline-muted);
}

body .billing-tabs,
body .auth-tabs {
  background: #09090b;
  border-color: var(--redline-line);
}

body .billing-tabs button,
body .tab {
  color: var(--redline-muted);
}

body .billing-tabs button.active,
body .tab.active {
  color: #fff;
  background: var(--redline-red-dark);
  box-shadow: inset 0 0 0 1px var(--redline-red);
}

body .pill,
body .period-pill,
body .profile-badges span {
  color: #ff8a95;
  background: rgba(227, 25, 45, 0.09);
  border-color: #5d333b;
}

body .plan-card {
  color: var(--redline-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.028), transparent 42%),
    #111115;
  border-color: var(--redline-line);
  box-shadow: none;
}

body .plan-card:hover {
  border-color: #71323d;
  background:
    linear-gradient(145deg, rgba(227, 25, 45, 0.08), transparent 48%),
    #151519;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
}

body .plans.is-visible .plan-card:nth-child(2),
body .plans.plans-entering .plan-card:nth-child(2),
body .plan-card.selected {
  border-color: var(--redline-red);
  box-shadow: inset 0 3px 0 var(--redline-red), 0 20px 54px rgba(159, 6, 23, 0.16);
}

body .plan-card:nth-child(2)::before,
body .announcement-link,
body .announcement-featured .announcement-link,
body .profile-hero .secondary-link {
  color: #fff;
  background: var(--redline-red);
  border-color: #f13b4d;
}

body .plan-desc,
body .feature,
body .old-price,
body .checkout-plan-hint,
body .checkout-plan-top p {
  color: var(--redline-muted);
}

body .feature span::before {
  color: var(--redline-success);
}

body .download-card,
body .announcement-featured,
body .profile-overview > .profile-card:first-child,
body .help-card {
  color: #fff;
  background:
    linear-gradient(118deg, rgba(227, 25, 45, 0.09), transparent 48%),
    #101013;
  border-color: #563039;
}

body .download-card p,
body .announcement-featured .announcement-copy p,
body .announcement-featured .announcement-meta,
body .profile-overview > .profile-card:first-child .profile-identity p:not(.eyebrow),
body .help-card span {
  color: var(--redline-muted);
}

body .download-card .card-kicker,
body .download-card small,
body .help-card strong {
  color: var(--redline-red-bright);
}

body .download-card .download-button {
  color: #fff;
  background: linear-gradient(180deg, var(--redline-red-bright), #a8091a);
}

body .announcement-media.placeholder {
  color: var(--redline-red-bright);
  background-color: #0c0c0f;
}

body .profile-avatar {
  color: #fff;
  background: var(--redline-red-dark);
  border: 1px solid var(--redline-red);
}

body .profile-metric,
body .profile-detail-list span,
body .profile-mini-table,
body .profile-mini-table span,
body .profile-mini-table b,
body .profile-mini-table small,
body .checkout-plan-features span,
body .start-payment-card,
body .bank-card,
body .contact-item,
body .muted-card,
body .qr-box {
  color: var(--redline-text);
  background: #0c0c0f;
  border-color: var(--redline-line-soft);
}

body .profile-mini-table small,
body .start-payment-card span,
body .bank-card span,
body .qr-box span,
body .qr-box small {
  color: var(--redline-muted);
}

body .file-picker {
  color: var(--redline-text);
  background: #0c0c0f;
  border-color: #63343d;
}

body .file-picker:hover {
  border-color: var(--redline-red);
  background: #160d10;
}

body .result-box.success {
  color: #8ce3bb;
  background: rgba(53, 201, 134, 0.08);
  border-color: rgba(53, 201, 134, 0.4);
}

body .result-box.error {
  color: #ff9ba5;
  background: rgba(255, 83, 101, 0.08);
  border-color: rgba(255, 83, 101, 0.42);
}

body .auth-drop-wrap {
  align-items: center;
}

body .hanger {
  display: none;
}

body .auth-panel,
body .auth-modal,
body .contact-panel,
body .verify-panel,
body .announcement-dialog {
  color: var(--redline-text);
  background: #131317;
  border-color: #593139;
}

body .auth-modal {
  border-top: 4px solid var(--redline-red);
}

body .auth-modal::before,
body .auth-modal::after {
  display: none;
}

body .auth-modal-head p:last-child,
body .contact-panel p:not(.eyebrow),
body .verify-panel p:not(.eyebrow),
body .announcement-dialog-date,
body .announcement-dialog-body {
  color: var(--redline-muted);
}

@media (max-width: 900px) {
  body .topbar {
    min-height: 68px;
    flex-direction: row;
    padding: 10px 0;
  }

  body .topbar .site-navigation {
    position: absolute;
    display: none;
  }

  body .topbar .site-navigation.is-open {
    display: flex;
  }
}
