:root {
  --bg: #0b0d12;
  --bg-soft: #11141b;
  --panel: #161a23;
  --panel-2: #1b202b;
  --line: #262c3a;
  --line-soft: #1f2430;
  --text: #eef2f8;
  --muted: #97a1b4;
  --dim: #6d768a;
  --accent: #3b82f6;
  --accent-hover: #2f6fdd;
  --mint: #34d399;
  --amber: #f0b45a;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* ------------------------------------------------------------------ header */

.site-header {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 13, 18, .85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), #6366f1);
  font-size: 15px;
}
.nav { display: flex; gap: 22px; font-size: 14px; align-items: center; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }

/* --------------------------------------------------------- language switch */

.lang-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang-switch button {
  min-width: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.is-on { background: var(--accent); color: #fff; }

/* Arabic script sits differently in a small pill than Latin does. */
[dir="rtl"] .lang-switch button { font-size: 13px; }

/* -------------------------------------------------------------------- RTL */

/* Almost nothing is needed here: the layout was moved onto logical properties
   (margin-inline, inset-inline, text-align: start), which flip themselves when
   dir="rtl" is set. Only things that are genuinely direction-specific remain. */

/* A number keeps its own direction inside Arabic text - "٣٠ يومًا" must not
   have its digits reordered by the surrounding paragraph. */
[dir="rtl"] .price,
[dir="rtl"] .app-from,
[dir="rtl"] .key-box,
[dir="rtl"] .mono,
[dir="rtl"] .countdown { direction: ltr; unicode-bidi: embed; }

/* The receipt step numbers and plan badges read left-to-right either way. */
[dir="rtl"] .receipt-step .n { direction: ltr; }

/* ------------------------------------------------------------- mobile nav */

/* The header used to be the one thing on the site that could not fit a phone.
   Four links plus the unsubscribe pill measure roughly 700px in a row that
   never wrapped, so on a 360px screen every page scrolled sideways.

   Below the breakpoint the links come out of the flow entirely and become a
   panel under the header, leaving only the brand and a button in the bar -
   about 210px, which fits the narrowest phone in use with room to spare.

   The button and the `nav-collapse` class are added by app.js, and only where
   the nav is long enough to need them, so a short nav (the admin header) keeps
   its links inline. That also means no page's markup had to change. */

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  flex: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 17px; height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle:hover span { background: var(--text); }

/* The bars fold into a cross while the panel is open. */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-collapse .nav-toggle { display: flex; }

  .nav-collapse .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 20px 18px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    /* Taller than the screen on a small phone in landscape, so it scrolls. */
    max-height: calc(100vh - 62px);
    overflow-y: auto;
    display: none;
  }
  .nav-collapse .nav.is-open { display: flex; }

  /* Full-width rows: a link on a phone is a thumb target, not a word. */
  .nav-collapse .nav a {
    padding: 14px 2px;
    font-size: 15px;
    border-bottom: 1px solid var(--line-soft);
  }
  .nav-collapse .nav a:last-child { border-bottom: 0; }

  .nav-collapse .nav .nav-unsub {
    margin-top: 14px;
    text-align: center;
    border-bottom: 0;
    padding: 13px 15px;
  }
}

/* ------------------------------------------------------------------- hero */

main { flex: 1; }

.hero { padding: 76px 0 56px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--mint);
  background: rgba(52, 211, 153, .09);
  border: 1px solid rgba(52, 211, 153, .22);
  padding: 6px 13px; border-radius: 999px;
}
.hero h1 {
  margin: 22px 0 0;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 680;
}
.hero p.lede {
  margin: 16px auto 0;
  max-width: 560px;
  font-size: 17px;
  color: var(--muted);
}
.hero-actions { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ----------------------------------------------------------------- layout */

section { padding: 34px 0; }
.section-title { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 0 0 18px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* A single plan should not stretch the full page width. */
.plans { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 360px)); justify-content: center; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 620; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .icon { font-size: 20px; margin-bottom: 12px; display: block; }

/* --------------------------------------------------------------- products */

.plan {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.plan { position: relative; }
.plan-featured { border-color: rgba(59, 130, 246, .55); }
.plan-badge {
  position: absolute; top: -10px; inset-inline-end: 18px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 650; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
}
.plan h3 { margin: 0; font-size: 17px; font-weight: 640; }
.plan .tagline { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.price { margin: 20px 0 4px; font-size: 38px; font-weight: 680; letter-spacing: -.02em; }
.price small { font-size: 14px; font-weight: 400; color: var(--dim); letter-spacing: 0; }
.plan ul { list-style: none; margin: 18px 0 24px; padding: 0; display: grid; gap: 10px; }
.plan li { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.plan li::before { content: "✓"; color: var(--mint); font-weight: 700; flex: none; }
.plan .btn { margin-top: auto; }

/* --------------------------------------------------------- unsubscribe */

/* Deliberately visible in the header on every page: a subscriber must never
   have to hunt for the way out, and one that cannot find it charges back. */
.nav .nav-unsub {
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .5);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fca5a5;
  white-space: nowrap;
}
.nav .nav-unsub:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  text-decoration: none;
}

/* -------------------------------------------------------------- free trial */

.free-band {
  border: 1px dashed rgba(52, 211, 153, .45);
  background: rgba(52, 211, 153, .06);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 26px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.free-band h3 { margin: 0 0 5px; font-size: 16px; font-weight: 640; }
.free-band p { margin: 0; color: var(--muted); font-size: 14px; }
.btn-free { background: var(--mint); color: #06281c; font-weight: 650; }
.btn-free:hover { background: #2bbd8a; }

/* ---------------------------------------------------------- announcements */

#announcements { margin-top: 26px; }
#announcements:empty { margin-top: 0; }

.announcement {
  margin-bottom: 10px;
  /* An admin types plain text; newlines they type should survive. */
  white-space: pre-wrap;
}

/* ------------------------------------------------------------- was price */

.was {
  font-size: 20px;
  font-weight: 500;
  color: var(--dim);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  margin-inline-end: 10px;
  letter-spacing: -.01em;
}
.save-badge {
  display: inline-block;
  background: rgba(52, 211, 153, .13);
  color: var(--mint);
  font-size: 12px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  margin-inline-start: 10px;
  vertical-align: middle;
}

/* ------------------------------------------------------------ buzzle art */

/* The plan header pairs the buzzle screenshot with the name, so a buyer picks
   by matching the bar they actually see in game rather than by reading. */
.plan-head { display: flex; gap: 16px; align-items: flex-start; }
.plan-head > div { min-width: 0; }

.buzzle {
  flex: none;
  width: 54px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: block;
}
.buzzle-lg { width: 66px; }

.buzzle-caption {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  margin-top: 6px;
}

@media (max-width: 460px) {
  .buzzle { width: 44px; }
}

/* --------------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
  text-align: center;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); border-color: #374054; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

label { display: block; font-size: 13px; font-weight: 560; margin-bottom: 7px; color: var(--text); }
.hint { font-size: 12.5px; color: var(--dim); margin-top: 7px; }

input[type=email], input[type=text], input[type=tel], input[type=password],
input[type=number], input[type=search], textarea, select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}
textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 13px; }

.field { margin-bottom: 20px; }

.check { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check label { margin: 0; font-weight: 400; color: var(--muted); font-size: 14px; }

/* -------------------------------------------------------- payment methods */

.methods { display: grid; gap: 10px; }
.method {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; text-align: start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.method:hover { border-color: #3a4457; }
.method[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(59, 130, 246, .08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.method-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.method-name { font-weight: 600; font-size: 14.5px; }
.method-note { font-size: 12.5px; color: var(--dim); }
.method-price { font-weight: 640; font-size: 15px; white-space: nowrap; }

/* ---------------------------------------------------------------- notices */

.notice {
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 14px;
  border: 1px solid;
  margin-bottom: 18px;
}
.notice-error { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .3); color: #fca5a5; }
.notice-ok    { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .28); color: #6ee7b7; }
.notice-warn  { background: rgba(240, 180, 90, .09); border-color: rgba(240, 180, 90, .3); color: var(--amber); }
.notice-info  { background: rgba(59, 130, 246, .08); border-color: rgba(59, 130, 246, .28); color: #93c5fd; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------- delivery */

.key-box {
  background: var(--bg-soft);
  border: 1px solid #2b3546;
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: clamp(18px, 4.4vw, 25px);
  letter-spacing: .1em;
  color: var(--mint);
  word-break: break-all;
}
.countdown { font-family: var(--mono); font-weight: 600; }
.meta-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.meta-row:last-child { border-bottom: 0; }
.meta-row span:first-child { color: var(--dim); }
.mono { font-family: var(--mono); font-size: 13px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: flex; gap: 13px; font-size: 14px; color: var(--muted); }
.steps li::before {
  content: counter(step);
  flex: none; width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--text);
}

/* ----------------------------------------------------------- content bits */

.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.bullets li {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 11px;
  align-items: flex-start;
  line-height: 1.55;
}
.bullets li::before { content: "\2022"; color: var(--dim); flex: none; font-weight: 700; }
.bullets.no  li::before { content: "\2715"; color: var(--danger); font-size: 12px; padding-top: 2px; }
.bullets.yes li::before { content: "\2713"; color: var(--mint); }
.bullets strong { color: var(--text); font-weight: 600; }
.bullets a { color: var(--accent); }

/* The steps list is used for ordered instructions as well as the buy flow. */
.steps strong { color: var(--text); font-weight: 600; }
.steps a { color: var(--accent); }

kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ legal */

.prose h1 { font-size: 27px; letter-spacing: -.01em; margin: 0 0 8px; }
.prose h2 { font-size: 16px; margin: 34px 0 10px; font-weight: 620; }
.prose p, .prose li { color: var(--muted); font-size: 14.5px; }
.prose ul { padding-inline-start: 20px; }
.prose hr { border: 0; border-top: 1px solid var(--line-soft); margin: 30px 0; }

/* ------------------------------------------------------------------ admin */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--dim); font-weight: 560; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill-ok    { background: rgba(52, 211, 153, .13); color: #6ee7b7; }
.pill-warn  { background: rgba(240, 180, 90, .13); color: var(--amber); }
.pill-dim   { background: rgba(148, 163, 184, .12); color: var(--muted); }
.pill-err   { background: rgba(248, 113, 113, .13); color: #fca5a5; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 660; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------- license drawer */

.btn-danger { background: transparent; border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, .12); border-color: var(--danger); }

.drawer-back {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, .66);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
}
.drawer {
  width: min(620px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 26px 28px 60px;
}
.drawer h2 { font-size: 17px; margin: 0 0 3px; letter-spacing: -.01em; }
.drawer h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--dim);
  margin: 26px 0 10px;
}
.drawer-close {
  float: right;
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.drawer-close:hover { color: var(--text); }

.device {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 13px 15px;
  margin-bottom: 9px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.device-id { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.device-meta { font-size: 12px; color: var(--dim); margin-top: 4px; }

.danger-zone {
  border: 1px solid rgba(248, 113, 113, .28);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-top: 26px;
}
.danger-zone p { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 60px;
  padding: 26px 0;
  font-size: 13px;
  color: var(--dim);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  .hero { padding: 52px 0 36px; }
  .nav { gap: 15px; font-size: 13px; }
  .card, .plan { padding: 19px; }
}

/* ==========================================================================
   MULTI-APPLICATION STOREFRONT
   --------------------------------------------------------------------------
   The store sells several applications, each with its own plans and its own
   instructions. These are the pieces that repeat once per application, so a
   new one is content and a database row - never a new layout.

   Everything here is built from the tokens already at the top of this file, so
   an app card and a plan card are recognisably the same family.
   ========================================================================== */

/* ------------------------------------------------------------- app cards */

/* auto-fit rather than a fixed column count: one application centres, two sit
   side by side, six wrap into rows, and none of it needs touching again.

   The 400px cap matters now that each card leads with a 16:9 cover. Left to
   stretch as 1fr, a lone application would fill the 1040px page and its image
   would stand nearly 600px tall - a banner, not a product card. Capped, the
   cover lands around 400x225: unmistakably a cover image, still one glance.

   min(320px, 100%) rather than a bare 320px: on a 320px-wide phone the column
   minimum would otherwise exceed the space left after the page padding, and the
   grid would push the whole page sideways. */
.app-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 400px));
  justify-content: center;
}

.app-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* No padding: the cover runs edge to edge. The body brings its own. */
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.app-card:hover { border-color: #38415a; transform: translateY(-2px); }

/* ---------------------------------------------------------- cover image */

/* The card leads with the product, and the WHOLE picture is shown - the area
   takes its shape from the image rather than forcing the image into a shape.

   `height: auto` is what does it: the image spans the card's width and its
   height follows its own proportions, so a wide screenshot is wide, a squarer
   one is taller, and neither is cropped or squashed.

   `max-height` is the one limit, and it exists for a real case: a tall, narrow
   picture would otherwise be scaled up to the card's width and stand over
   1500px high, a single card taller than the screen. Past the limit the image
   is fitted inside instead - `contain`, so still complete, just centred with
   space either side rather than trimmed. The cap is set just above the card's
   own width, so everything from a wide banner to a square lands full width with
   no bars at all - only genuinely portrait pictures are fitted.

   min-height only guards the empty case: a picture that fails to load leaves a
   panel rather than collapsing the top of the card to nothing. */
.app-cover {
  width: 100%;
  min-height: 100px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.app-cover img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

/* An application with no cover yet. A lettered mark on a lit gradient reads as
   a deliberate cover rather than a missing one - which an empty box would. */
.app-cover-empty {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 130% at 22% 0%, rgba(59, 130, 246, .32), transparent 62%),
    linear-gradient(150deg, var(--panel-2), var(--bg));
  position: relative;
}
.app-cover-empty::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 46%, rgba(255, 255, 255, .04) 50%, transparent 54%);
}
.app-cover-mark {
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 680;
  letter-spacing: -.02em;
  color: rgba(238, 242, 248, .92);
}

/* ------------------------------------------------------------- card body */

.app-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex: 1;
}

/* Kept for the product page hero, which pairs a small mark with the title. */
.app-thumb {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, var(--accent), #6366f1);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 660; color: #fff;
  overflow: hidden;
}
.app-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.app-card-title { min-width: 0; }
.app-card-title h3 { margin: 0; font-size: 17px; font-weight: 640; }
.app-card-title .app-sub {
  margin: 4px 0 0;
  font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--dim);
}

.app-card-desc { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }

.app-card-meta {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.app-from { font-size: 22px; font-weight: 660; letter-spacing: -.01em; }
.app-from small { font-size: 12.5px; font-weight: 400; color: var(--dim); letter-spacing: 0; }

.app-card-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 2px; }
.app-card-actions .btn { flex: 1 1 auto; }

/* ---------------------------------------------------- product page header */

/* A product hero, unlike the site hero, leads with the thing being sold: the
   artwork and name sit beside each other so the page is identifiable before a
   word of it is read. */
.product-hero {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
  padding: 52px 0 34px;
}
.product-hero .app-thumb { width: 84px; height: 84px; border-radius: 18px; font-size: 34px; }
.product-hero-text { flex: 1 1 340px; min-width: 0; }
.product-hero h1 {
  margin: 12px 0 0;
  font-size: clamp(27px, 4.4vw, 38px);
  line-height: 1.14;
  letter-spacing: -.02em;
  font-weight: 680;
}
.product-hero .lede { margin: 13px 0 0; font-size: 16.5px; color: var(--muted); max-width: 620px; }
.product-hero .hero-actions { margin-top: 24px; justify-content: flex-start; }

/* ------------------------------------------------------ in-page section nav */

/* Sticks under the site header so the sections of a long product page stay
   reachable - a buyer looking for "how to use" should never have to scroll
   past the pricing to find it. */
.subnav {
  position: sticky;
  top: 62px;
  z-index: 15;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  margin-bottom: 8px;
  background: rgba(11, 13, 18, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.subnav a:hover { color: var(--text); border-color: #374054; text-decoration: none; }
.subnav a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Anchored sections must clear both sticky bars when jumped to. Scoped to
   sections so it cannot reach form fields and table rows elsewhere. */
section[id] { scroll-margin-top: 128px; }

/* ------------------------------------------------------------- section head */

/* Lets a section carry a sentence of context under its label without every
   page inventing its own margins for it. */
.section-head { margin-bottom: 18px; }
.section-head .section-title { margin-bottom: 6px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 640px; }

/* --------------------------------------------------------------- features */

.feature-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature .icon { font-size: 19px; display: block; margin-bottom: 10px; }
.feature h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 620; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------- faq */

/* <details> keeps the FAQ short on screen and needs no JavaScript, so it works
   the moment the HTML lands. */
.faq { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer;
  padding: 16px 20px;
  font-size: 14.5px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--dim);
  font-size: 18px;
  font-weight: 400;
  flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--panel-2); }
.faq .faq-body { padding: 0 20px 18px; color: var(--muted); font-size: 14px; }
.faq .faq-body p { margin: 0 0 10px; }
.faq .faq-body p:last-child { margin: 0; }

/* --------------------------------------------------------- purchase call */

.cta-band {
  border: 1px solid rgba(59, 130, 246, .38);
  background: linear-gradient(180deg, rgba(59, 130, 246, .10), rgba(59, 130, 246, .03));
  border-radius: var(--radius);
  padding: 30px 28px;
  text-align: center;
}
.cta-band h3 { margin: 0 0 8px; font-size: 19px; font-weight: 650; }
.cta-band p { margin: 0 auto 20px; color: var(--muted); font-size: 14.5px; max-width: 520px; }

/* ------------------------------------------------------- receipt sections */

/* The success page groups everything about one purchase; a numbered label
   makes it read as a sequence to work through rather than a pile of boxes. */
.receipt-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
}
.receipt-step .n {
  flex: none;
  width: 21px; height: 21px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  display: grid; place-items: center;
  font-size: 11px; letter-spacing: 0;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .product-hero { padding: 34px 0 26px; gap: 18px; }
  .product-hero .app-thumb { width: 62px; height: 62px; border-radius: 14px; font-size: 26px; }
  .subnav { top: 62px; padding: 10px 0; }
  .app-card-body { padding: 16px 17px 18px; }
  .cta-band { padding: 24px 19px; }
  section[id] { scroll-margin-top: 116px; }
}

/* ------------------------------------------------- bulk selection (admin) */

.pickcell { width: 34px; text-align: center; }
.pickcell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--mint);
  cursor: pointer;
  vertical-align: middle;
}
.pickcell input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .3; }

.bulkbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(248, 113, 113, .35);
  background: rgba(248, 113, 113, .07);
  border-radius: var(--radius);
  font-size: 14px;
}
