:root {
  --bg: #2d2d2d;
  --surface: #303030;
  --text: #d7d7d7;
  --muted: #999;
  --accent: #ff5757;
  --gold: #ff5757;
  --border: #4c4c4c;
}

body,
button,
input,
select,
textarea {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

body { background: #2d2d2d; }
body.home { overflow-x: clip; }
.site-header { background: #303030; border-bottom-color: var(--border); }
.primary-nav { padding: 14px 28px; }
.primary-nav .brand-text-only { flex: 0 0 auto; transform: translateY(2px); }
.primary-nav .brand-meta { font-size: 1.5rem; }
/* Native WordPress child links under Download. */
.primary-nav .nav-menu > .menu-item-has-children { position: relative; }
.primary-nav .nav-menu > .menu-item-has-children::after {
  content: "";
  position: absolute;
  z-index: 19;
  top: 100%;
  left: -14px;
  right: -14px;
  height: 12px;
}
.primary-nav .nav-menu .sub-menu {
  display: block;
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 50%;
  min-width: 154px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--border);
  background: #303030;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 100ms ease, visibility 0s linear 150ms;
}
.primary-nav .nav-menu > .menu-item-has-children:hover > .sub-menu,
.primary-nav .nav-menu > .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.primary-nav .nav-menu .sub-menu a {
  display: block;
  padding: 9px 12px;
  white-space: nowrap;
}
.hero::before { background-image: url('../images/main-page-bg.png'); }

/* The homepage artwork is deliberately wide and shallow. Keep its composition
   instead of stretching it into the former full-viewport hero. */
@media (min-width: 783px) {
  body.home .hero,
  body.admin-bar.home .hero {
    box-sizing: border-box;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto;
    padding: 1.5rem clamp(1.5rem, 3vw, 2.5rem) 40px !important;
  }

  body.home .hero::before {
    animation: none;
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: right top;
    transform: none;
  }
}

@media (max-width: 782px) {
  .primary-nav .nav-menu > .menu-item-has-children::after {
    display: none;
  }

  .primary-nav .nav-menu .sub-menu {
    position: static;
    min-width: 0;
    margin: 2px 0 0 14px;
    padding: 2px 0 2px 10px;
    border: 0;
    border-left: 1px solid var(--border);
    background: transparent;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  body.home .hero,
  body.admin-bar.home .hero {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  body.home .hero-mobile-media,
  body.home .hero-mobile-bg {
    min-height: 0 !important;
    aspect-ratio: auto !important;
  }
}

@media (min-width: 769px) {
  .primary-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 24px;
  }

  .primary-nav .brand { grid-column: 1; }
  .primary-nav-panel { display: contents; }
  .primary-nav .nav-menu {
    position: static;
    grid-column: 2;
    margin: 0;
    transform: none;
  }

  .primary-nav .nav-actions {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }
}


button,
.button,
.btn,
.nav-cta,
.fai-library-download,
input,
select,
textarea,
.section,
.fai-library-card {
  border-radius: 0 !important;
}

button,
.button,
.btn,
.btn.ghost,
.nav-cta,
.fai-library-download {
  background: #3f3f3f;
  border: 1px solid #5a5a5a;
  color: var(--text);
}

button:hover,
.button:hover,
.btn:hover,
.btn.ghost:hover,
.nav-cta:hover,
.fai-library-download:hover { background: #4a4a4a; border-color: #7a7a7a; }

/* WooCommerce carries legacy gold gradients with high selector specificity. */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .added_to_cart,
.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-info .button,
.wc-block-components-button,
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
  border: 1px solid #5a5a5a !important;
  border-radius: 0 !important;
  background: #3f3f3f !important;
  background-image: none !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .added_to_cart:hover,
.woocommerce-message .button:hover,
.woocommerce-error .button:hover,
.woocommerce-info .button:hover,
.wc-block-components-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover {
  border-color: #7a7a7a !important;
  background: #4a4a4a !important;
  background-image: none !important;
  color: var(--text) !important;
}

/* Public product downloads use the same controls as the rest of the site. */
.download-section { max-width: 1180px; margin: 0 auto; padding: 48px 20px; }
.download-access-card { padding: 40px 32px 32px; border: 1px solid var(--border); background: #303030; }
.download-access-card--locked { text-align: center; }
.download-access-card > .eyebrow { margin: 0 0 16px; }
.download-access-card h2 { margin: 0 0 20px; color: var(--text); }
.download-access-card p { color: var(--muted); line-height: 1.6; }
.download-access-card > h2 + p { max-width: 760px; margin: 0; }
.download-access-card a:not(.button) { color: var(--text); }
.download-item { margin: 28px 0; padding: 24px; border: 1px solid var(--border); background: #252525; }
.download-item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.download-item-copy { flex: 1; min-width: 200px; }
.download-item-copy p { margin: 0; }
.download-item-copy p + p { margin-top: 4px; font-size: .9rem; }
.download-item-copy p:last-child { color: #9a9a9a; font-size: .85rem; }
.download-section .fai-download-button { display: inline-block; padding: 12px 20px; text-decoration: none; white-space: nowrap; }
.download-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.download-product-section { min-width: 0; padding: 24px; border: 1px solid var(--border); background: #292929; }
.download-product-section--single { margin-top: 32px; }
.download-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.download-section-heading .eyebrow { margin: 0 0 8px; }
.download-section-heading h3 { margin: 0; color: var(--text); }
.download-product-section > p { margin: 18px 0 0; }
.download-access-label { flex: 0 0 auto; padding-left: 12px; border-left: 2px solid var(--accent); color: var(--muted); font-size: .78rem; line-height: 1.5; text-transform: uppercase; letter-spacing: .08em; }
.download-access-label--free { color: var(--text); }
.download-product-section .download-item { display: flex; flex-direction: column; align-items: flex-start; margin: 20px 0 0; }
.download-product-section .download-item-row { width: 100%; height: 100%; flex-direction: column; align-items: flex-start; }
.download-product-section .fai-download-button { margin-top: 20px; }
.download-standalone-grid { display: grid; grid-template-columns: 1fr; }
.android-download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 32px 0 18px; }
.android-download-grid .download-item { display: flex; flex-direction: column; align-items: flex-start; min-height: 244px; margin: 0; }
.android-download-grid .download-item-copy p { margin: 0 0 12px; }
.android-download-grid .download-item-copy p:last-child { margin-bottom: 0; }
.android-download-grid .fai-download-button { margin-top: 24px; }
.android-download-grid .is-highlighted { border-color: var(--accent); }
.android-tailscale-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 20px; border: 1px solid var(--border); background: #252525; }
.android-tailscale-row strong { display: block; color: var(--text); }
.android-tailscale-row p { margin: 4px 0 0; font-size: .9rem; }
.android-tailscale-row .fai-download-button { flex: 0 0 auto; margin: 0; }
.remote-download-dialog { width: min(360px, calc(100vw - 32px)); color: var(--text, #eee); background: var(--panel, #2d2d2d); border: 1px solid var(--line, #505050); border-radius: 0; padding: 18px; }
.remote-download-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.remote-download-dialog .remote-download-close { display: block; margin-left: auto; }
.remote-download-dialog h2 { margin-top: 10px; }
.remote-download-dialog .pairing-qr { display: block; width: 190px; height: 190px; margin: 16px 0; padding: 8px; border: 1px solid var(--line, #505050); background: #fff; image-rendering: pixelated; }
.download-release-history { margin-top: 34px; border-top: 1px solid var(--border); padding-top: 24px; }
.download-release-history h3 { margin: 0; color: var(--text); }
.download-release-history-intro { max-width: 640px; margin: 10px 0 20px; font-size: .92rem; }
.download-release-note { padding: 18px 0; border-top: 1px solid var(--border); }
.download-release-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.download-release-heading h4 { margin: 0; color: var(--text); font-size: 1rem; }
.download-release-heading span { color: #9a9a9a; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.download-release-note ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.download-release-note li + li { margin-top: 7px; }
.download-release-more { margin-top: 14px; }
.download-release-more summary { width: fit-content; color: var(--accent); font-weight: 700; cursor: pointer; }
.download-release-more summary:hover,
.download-release-more summary:focus-visible { color: var(--text); }
.download-release-more[open] summary { margin-bottom: 4px; }
.download-release-more ul { margin-top: 10px; }
.download-support-note { margin-top: 24px; font-size: .85rem; }

/* Shared public-page surfaces: the download page establishes the quiet grey
   tool material used for Home, Blog, and the WooCommerce product listing. */
.home-overview .section-heading,
.blog-index .section-heading {
  margin-bottom: 32px;
  text-align: left;
}

.home-overview .section-heading > .eyebrow {
  margin: 0 0 10px;
  line-height: 1.2;
}

.home-overview .section-heading > h2 {
  margin: 0 0 18px;
  line-height: 1.08;
}

.home-overview-grid { gap: 24px; }

body.home .home-overview {
  padding-top: 40px !important;
}

.home-overview-card,
.blog-feed .blog-entry,
body.woocommerce-shop .page-content :is(.shop-grid > .products > li.product, ul.products > li.product) {
  background: #252525 !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.home-overview-card {
  padding: 28px;
}

.home-overview-card h3,
.home-overview-card h4 {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.3;
}

.home-overview-card h4 { font-size: 1.1rem; }
.home-overview-card p { margin: 0; color: var(--muted); }
.home-overview-card .link { margin-top: 18px; }

.blog-feed {
  display: flex;
  max-width: 800px;
  margin: 0 auto;
  flex-direction: column;
  gap: 32px;
}

.blog-feed .blog-entry { padding: 32px; }

.blog-entry-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.blog-entry-header h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 2rem;
}

.blog-entry-header h2 a { color: inherit; text-decoration: none; }
.blog-entry-header h2 a:hover { color: var(--accent); }

.blog-entry .post-meta {
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.blog-entry .post-content { color: var(--text); line-height: 1.7; }

@media (max-width: 780px) {
  .home-overview-card,
  .blog-feed .blog-entry { padding: 24px; }
}

/* Capabilities page: product proof and practical explanations. */
.capabilities-page .section {
  box-sizing: border-box;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
}
.capabilities-page h1 { margin: 0 0 16px; color: var(--text); font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1; }
.capabilities-page h2,
.capabilities-page h3 { color: var(--text); }

.capability-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 34px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.capability-points article { min-height: 164px; padding: 24px; border-left: 1px solid var(--border); }
.capability-points article:first-child { border-left: 0; }
.capability-points h2,
.capability-points h3 { margin: 0 0 10px; font-size: 1.05rem; }
.capability-points p,
.capability-copy p,
.capability-note { margin: 0 0 14px; color: var(--muted); }

.capability-panel-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.capability-panel-strip figure,
.capability-shot { margin: 0; }
.capability-panel-strip img,
.capability-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); }
.capability-panel-strip figcaption,
.capability-shot figcaption { padding-top: 9px; color: var(--muted); font-size: .9rem; }

.capability-split,
.capability-library-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.capability-split.reverse { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.capability-panel-story { grid-template-columns: minmax(0, 1.18fr) minmax(320px, .72fr); }
.capability-vex-story { grid-template-columns: minmax(320px, .72fr) minmax(0, 1.18fr) !important; }
.capability-split.reverse .capability-copy { order: 2; }
.capability-split.reverse .capability-shot { order: 1; }
.capabilities-page :is(.section-heading, .capability-copy) > .eyebrow {
  margin: 0 0 10px;
  line-height: 1.2;
}
.capabilities-page :is(.section-heading, .capability-copy) > :is(h1, h2) {
  margin: 0 0 18px;
  line-height: 1.08;
}
.capabilities-page .capabilities-hero .section-heading > h1 {
  line-height: 1;
}
.capability-copy h2 { margin: 0 0 18px; font-size: clamp(1.65rem, 3vw, 2.6rem); line-height: 1.08; }
.capability-copy h3 { margin: 0 0 14px; font-size: 1.25rem; }
.capability-copy .button { display: inline-block; padding: 11px 16px; text-decoration: none; }

.capability-library { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.capability-library .section-heading { margin-bottom: 30px; }
.capability-foundation { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.capability-foundation .section-heading { max-width: 860px; margin-bottom: 30px; }
.capability-foundation-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.capability-foundation-grid .capability-copy + .capability-copy { padding-left: clamp(28px, 5vw, 72px); border-left: 1px solid var(--border); }
.capability-safety { padding-top: 58px; padding-bottom: 58px; }
.capability-safety .section-heading { max-width: 700px; }
.capability-note { max-width: 760px; margin: 26px 0 0; font-size: 1.05rem; color: var(--text); }

/* Buyer ticket portal: same quiet, square tool surface as fAI Suite. */
.tickets-main #wpsc_tickets_container,
.tickets-main .wpsc-frontend-wrap,
.tickets-main .wpsc-wrapper,
.tickets-main .wpsc-ticket-list,
.tickets-main .wpsc-ticket-container {
  background: transparent !important;
  color: var(--text) !important;
}

.tickets-main .wpsc-panel,
.tickets-main .wpsc-ticket-reply,
.tickets-main .wpsc-ticket-history,
.tickets-main .wpsc-ticket-header,
.tickets-main .wpsc-tabs .wpsc-tab-nav,
.tickets-main form.wpsc-form,
.tickets-main .wpsc-modal-content {
  background: #252525 !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
}

.tickets-main .wpsc-frontend-wrap :is(h1, h2, h3, h4, label, .wpsc-title, .wpsc-staff-name),
.tickets-main .wpsc-frontend-wrap :is(th, td, p, span) { color: var(--text) !important; }

.tickets-main .wpsc-frontend-wrap :is(input, select, textarea, .select2-selection--single, .select2-selection--multiple) {
  background: #101010 !important;
  border: 1px solid #5a5a5a !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
}

.tickets-main .wpsc-frontend-wrap :is(input, select, textarea):focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent) !important;
  outline: 0 !important;
}

.tickets-main .wpsc-frontend-wrap :is(button, input[type="submit"], .wpsc-btn, .wpsc-button) {
  background: #3f3f3f !important;
  background-image: none !important;
  border: 1px solid #5a5a5a !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

.tickets-main .wpsc-frontend-wrap :is(button, input[type="submit"], .wpsc-btn, .wpsc-button):hover {
  background: #4a4a4a !important;
  border-color: var(--accent) !important;
  filter: none !important;
}

.tickets-main .wpsc-frontend-wrap a { color: #b9d5e6 !important; }
.tickets-main .wpsc-frontend-wrap table :is(th, td) { border-color: var(--border) !important; }
.tickets-main .wpsc-frontend-wrap table th { background: #303030 !important; }
.tickets-main .wpsc-frontend-wrap table tbody tr,
.tickets-main .wpsc-frontend-wrap table tbody tr:nth-child(even) { background: #252525 !important; }
.tickets-main .wpsc-frontend-wrap table tbody tr:hover { background: #303030 !important; }
.tickets-main .wpsc-ticket-reply.wpsc-staff-reply { border-left: 3px solid var(--accent) !important; }
.tickets-main :is(.wpsc-my-profile-link, .wpsc-user-profile, .wpsc-user-menu, .wpsc-user-icon, .wpsc-header-right, .wpsc-logout) { display: none !important; }

/* Tickets is a single focused tool, not a community card inside another card. */
#tickets-hub .tickets-layout { margin: 0 auto; max-width: 1200px; }
#tickets-hub .section-heading { margin-bottom: 24px; max-width: 800px; }
#tickets-hub .community-grid-full { margin: 0; max-width: none; }
#tickets-hub .tickets-main {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding: 0;
}

/* The account screen is a compact customer portal, not a WooCommerce admin area. */
.woocommerce-account .woocommerce-MyAccount-navigation {
  display: none;
}

.woocommerce-account .page-content > .woocommerce {
  max-width: 560px;
  margin: 232px auto 0;
}

.woocommerce-account .woocommerce-MyAccount-content {
  float: none;
  width: 100%;
}

/* Red is reserved for intentional interaction and status emphasis. Page
   headings, descriptions, and structural rules stay neutral. */
main a:not(.btn):not(.button):not(.wp-block-button__link),
.download-access-card a:not(.button),
.tickets-main .wpsc-frontend-wrap a,
.woocommerce-account .woocommerce a:not(.button),
.woocommerce-message a:not(.button),
.woocommerce-info a:not(.button),
.woocommerce-error a:not(.button) {
  color: var(--accent) !important;
}

main a:not(.btn):not(.button):not(.wp-block-button__link):hover,
.download-access-card a:not(.button):hover,
.tickets-main .wpsc-frontend-wrap a:hover,
.woocommerce-account .woocommerce a:not(.button):hover,
.woocommerce-message a:not(.button):hover,
.woocommerce-info a:not(.button):hover,
.woocommerce-error a:not(.button):hover {
  color: #ff7777 !important;
}

.primary-nav .nav-menu .current-menu-item > a,
.primary-nav .nav-menu .current_page_item > a,
.primary-nav .nav-menu a:hover,
.section .link,
.blog-card .link,
.blog-entry-header h2 a:hover,
.community-main a:hover,
.community-sidebar a:hover,
#bbpress-forums .bbp-forum-title a:hover,
#bbpress-forums .bbp-topic-title a:hover,
#bbpress-forums .bbp-pagination-links a:hover {
  color: var(--accent) !important;
}

:is(input, select, textarea):focus,
.woocommerce :is(input, select, textarea):focus,
.tickets-main .wpsc-frontend-wrap :is(input, select, textarea):focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent) !important;
}

.fai-library-card,
.download-release-history,
.tickets-main .wpsc-ticket-reply.wpsc-staff-reply {
  border-color: var(--accent) !important;
}

@media (max-width: 780px) {
  .capability-points,
  .capability-panel-strip,
  .capability-split,
  .capability-split.reverse,
  .capability-library-grid,
  .capability-foundation-grid { grid-template-columns: 1fr; }

  .capability-points article { min-height: 0; border-top: 1px solid var(--border); border-left: 0; }
  .capability-points article:first-child { border-top: 0; }
  .capability-split.reverse .capability-copy,
  .capability-split.reverse .capability-shot { order: initial; }
  .capability-vex-story { grid-template-columns: 1fr !important; }
  .capability-foundation-grid .capability-copy + .capability-copy { padding-top: 28px; padding-left: 0; border-top: 1px solid var(--border); border-left: 0; }

  .capabilities-page .section,
  .page-content,
  .shop-content,
  .download-section {
    width: 100%;
    max-width: 100%;
  }

  .capabilities-page code,
  .page-content code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .page-content {
    padding-inline: 20px;
  }

  .download-section { padding: 32px 16px; }
  .download-access-card { padding: 30px 20px 20px; }
  .download-platform-tabs { margin-bottom: 24px; }
  .download-product-grid { grid-template-columns: 1fr; margin-top: 24px; }
  .download-product-section { padding: 20px; }
  .download-section-heading { flex-direction: column; }
  .download-access-label { padding-top: 8px; padding-left: 0; border-top: 2px solid var(--accent); border-left: 0; }
  .android-download-grid { grid-template-columns: 1fr; margin: 24px 0 16px; }
  .android-download-grid .download-item { min-height: 0; }
  .android-tailscale-row { align-items: flex-start; flex-direction: column; gap: 16px; padding: 18px; }

  #tickets-hub :is(.tickets-layout, .community-grid-full, .tickets-main, .fai-tracker-app, .fai-tracker-content) {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  #tickets-hub .fai-tracker-table-wrapper {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    width: 100%;
  }

  #tickets-hub .fai-ticket-table {
    min-width: 620px;
  }
}
