:root {
  --fp-bg: #020624;
  --fp-panel: #071021;
  --fp-panel-2: #0b1530;
  --fp-line: rgba(255,255,255,.14);
  --fp-text: #f8fbff;
  --fp-muted: #b8c4d8;
  --fp-blue: #07145f;
  --fp-gold: #d9a441;
  --fp-radius: 10px;
}

.fm-product-page,
.fm-product-page *,
.fm-auth-gate,
.fm-auth-gate *,
.fm-product-settings,
.fm-product-settings * {
  box-sizing: border-box;
}

.fm-product-page {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg,#020624,#050b2c 58%,#081126);
  color: var(--fp-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fm-download-shell {
  min-height: 100dvh;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 26px;
  padding: 32px 0;
}

.fm-product-brand {
  position: absolute;
  top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fp-text);
  text-decoration: none;
  font-weight: 900;
}

.fm-product-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--fp-blue);
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
}

.fm-product-mark::before {
  content: "";
  display: block;
  width: 20px;
  height: 12px;
  margin: 11px auto;
  border-bottom: 3px solid #eaf6ff;
  border-left: 3px solid #eaf6ff;
  transform: skewX(-18deg);
}

.fm-download-card,
.fm-auth-gate-card,
.fm-terms-gate-card {
  justify-self: stretch;
  width: min(720px, calc(100vw - 36px));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  border: 1px solid var(--fp-line);
  border-radius: 14px;
  background: rgba(7,16,33,.86);
  box-shadow: 0 34px 100px rgba(0,0,0,.34);
  padding: clamp(22px, 5vw, 38px);
}

.fm-download-card h1,
.fm-auth-gate-card h2,
.fm-terms-gate-card h2 {
  margin: 0;
  max-width: 100%;
  color: var(--fp-text);
  font-size: clamp(34px, 6vw, 58px);
  line-height: .98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.fm-download-card p,
.fm-auth-gate-card p,
.fm-terms-gate-card p {
  margin: 12px 0 0;
  color: var(--fp-muted);
  line-height: 1.5;
  font-size: 17px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.fm-kicker {
  margin: 0 0 10px !important;
  color: var(--fp-gold) !important;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px !important;
  font-weight: 900;
}

.fm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.fm-actions a,
.fm-actions button {
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: var(--fp-text);
  padding: 11px 15px;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  overflow-wrap: anywhere;
}

.fm-actions .primary,
.fm-actions button.primary {
  background: #fff;
  color: var(--fp-blue);
}

.fm-terms-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.fm-terms-form label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--fp-muted);
  line-height: 1.4;
}

.fm-download-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.fm-download-meta span {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: var(--fp-muted);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.fm-short-note {
  font-size: 14px !important;
}

.fm-download-card details {
  margin-top: 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 12px;
}

.fm-download-card summary {
  cursor: pointer;
  font-weight: 850;
}

.fm-download-card pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--fp-muted);
  margin: 10px 0 0;
}

.fm-app-locked .app-shell {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.fm-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2,6,36,.72);
  backdrop-filter: blur(14px);
}

.fm-auth-gate[hidden] {
  display: none;
}

.fm-app-locked .fm-auth-overlay {
  z-index: 1600;
}

.fm-terms-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.fm-terms-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--fp-muted);
  line-height: 1.4;
}

html[data-theme="light"] .fm-product-panel {
  background: #fff;
  color: #101827;
}

.fm-product-settings {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.fm-product-settings nav,
.fm-product-section {
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 14px 38px rgba(15,23,42,.08);
}

html[data-theme="night"] .fm-product-settings nav,
html[data-theme="night"] .fm-product-section {
  background: rgba(11,18,32,.84);
}

.fm-product-settings nav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
}

.fm-product-settings nav button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 9px 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.fm-product-settings nav button[aria-pressed="true"] {
  background: #07145f;
  color: #fff;
}

.fm-product-section {
  padding: 18px;
}

.fm-product-section h3 {
  margin: 0 0 12px;
  color: #07145f;
}

html[data-theme="night"] .fm-product-section h3 {
  color: #eaf6ff;
}

.fm-control-row {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 10px;
}

.fm-control-row button,
.fm-control-row a,
.fm-control-row label {
  min-height: 42px;
  border: 1px solid rgba(148,163,184,.34);
  border-radius: 8px;
  background: rgba(255,255,255,.75);
  color: #07145f;
  padding: 10px;
  text-decoration: none;
  font-weight: 800;
}

html[data-theme="night"] .fm-control-row button,
html[data-theme="night"] .fm-control-row a,
html[data-theme="night"] .fm-control-row label {
  background: rgba(15,23,42,.82);
  color: #eaf6ff;
}

@media(max-width:760px) {
  .fm-product-brand { position: static; }
  .fm-download-shell { align-content: start; }
  .fm-download-card,
  .fm-auth-gate-card,
  .fm-terms-gate-card {
    width: calc(100vw - 36px);
    padding: 24px;
  }
  .fm-download-card h1,
  .fm-auth-gate-card h2,
  .fm-terms-gate-card h2 {
    font-size: clamp(30px, 8.5vw, 38px);
    line-height: 1.05;
  }
  .fm-actions { display: grid; }
  .fm-actions a,
  .fm-actions button { width: 100%; }
  .fm-product-settings { grid-template-columns: 1fr; }
  .fm-product-settings nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media(prefers-reduced-motion:reduce) {
  * { animation: none !important; transition: none !important; }
}
