/* Ratin Special — My account redesign (dashboard.html only).
   Loaded LAST. Design only: no JS / IDs / API touched.
   Dark, same look as the landing page products section. */

body.ap-dash {
  --bg: #000; --surface: #161618; --surface-2: #1f1f22; --field: #1f1f22;
  --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.2);
  --text: #f5f5f7; --muted: #a1a1a6; --body-text: #c7c7cc;
  --accent: #ffca0a; --accent-rgb: 255,202,10; --accent-ink: #111100; --link: #ffd60a;
  --g1: #ffd60a; --g2: #ffca0a; --g3: #efb800; --grad: linear-gradient(100deg, #ffd60a, #ffca0a 55%, #efb800);
  --danger: #ff453a; --danger-bg: rgba(255,69,58,.14);
  --ok: #30d158; --ok-bg: rgba(48,209,88,.14);
  --warn: #ffb340; --warn-bg: rgba(255,159,10,.16);
  --card-shadow: none; --nav-bg: rgba(22,22,23,.78); --nav-line: rgba(255,255,255,.08);
  --toast-bg: #2c2c2e; --toast-text: #f5f5f7;
  color-scheme: dark; background: #000; color: var(--text);
}
html:has(body.ap-dash) { background: #000; }
body.ap-dash .aurora { display: none !important; }

/* ---------- top bar ---------- */
body.ap-dash .top { background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); }
body.ap-dash .user-chip { padding: 4px 14px 4px 4px; border-radius: 980px; background: rgba(255,255,255,.07); font-size: 14px; }
body.ap-dash .btn-ghost { border-color: rgba(255,255,255,.22); color: #f5f5f7; }
body.ap-dash .btn-ghost:hover { background: rgba(255,255,255,.08); }

/* ---------- greeting ---------- */
body.ap-dash .page { max-width: 980px; padding-top: 56px; padding-bottom: 96px; }
body.ap-dash .greeting { margin-bottom: 8px; }
body.ap-dash .greeting h1 { font-size: clamp(34px, 5vw, 56px); color: #f5f5f7; }
body.ap-dash .greeting p { color: var(--muted); font-size: 18px; max-width: 50ch; }

/* ---------- tabs: one pill bar on top instead of a side menu ---------- */
body.ap-dash .layout { display: block; margin-top: 30px; }
body.ap-dash .layout > .nav {
  position: sticky; top: 64px; z-index: 30; display: flex; flex-direction: row; gap: 4px;
  width: fit-content; max-width: 100%; margin: 0 0 28px; padding: 5px; overflow-x: auto; scrollbar-width: none;
  border-radius: 980px; background: rgba(40,40,44,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255,255,255,.08); }
body.ap-dash .layout > .nav::-webkit-scrollbar { display: none; }
body.ap-dash .nav button {
  flex: none; width: auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px;
  border: 0; border-radius: 980px; background: transparent; color: #a1a1a6; font-size: 14.5px; font-weight: 500; white-space: nowrap; }
body.ap-dash .nav button svg { width: 17px; height: 17px; }
body.ap-dash .nav button:hover { background: rgba(255,255,255,.08); color: #f5f5f7; }
body.ap-dash .nav button[aria-selected="true"] { background: #ffca0a; color: #111100; font-weight: 600; }

/* ---------- cards ---------- */
body.ap-dash .block {
  padding: 34px; border-radius: 28px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #1a1a1d 0%, #131315 100%); }
body.ap-dash .block + .block { margin-top: 18px; }
body.ap-dash .block h2 { font-size: 30px; color: #f5f5f7; }
body.ap-dash .block h3 { color: #f5f5f7; }
body.ap-dash .lead { color: var(--muted); font-size: 16px; max-width: 60ch; }

/* licenses pane: licenses first, then downloads, then the help text */
body.ap-dash #secLicenses > .block:first-child { display: flex; flex-direction: column; }
body.ap-dash #secLicenses > .block:first-child > * { order: 5; }
body.ap-dash #secLicenses > .block:first-child > h2,
body.ap-dash #secLicenses > .block:first-child > .lead { order: 0; }
body.ap-dash #licenseListContainer { order: 1 !important; display: grid; gap: 16px; }
body.ap-dash #downloadContainer { order: 2 !important; }
body.ap-dash #claimBox { order: 6 !important; }

/* ---------- license card ---------- */
body.ap-dash .license {
  position: relative; padding: 26px; border-radius: 24px; border: 1px solid rgba(255,202,10,.28);
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,202,10,.20) 0%, rgba(255,202,10,0) 60%), linear-gradient(180deg, #241d08 0%, #141410 100%); }
body.ap-dash .license-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 16px; }
body.ap-dash .license-top > span:last-child { font-size: 13.5px !important; font-weight: 500; color: #a1a1a6 !important; }
body.ap-dash .key-row { display: flex; gap: 10px; align-items: stretch; }
body.ap-dash .key {
  flex: 1 1 auto; min-width: 0; height: 56px; display: flex; align-items: center; padding: 0 18px; overflow-x: auto; white-space: nowrap;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  font-family: var(--ap-mono, ui-monospace, Menlo, monospace); font-size: 16px; font-weight: 600; letter-spacing: .06em; color: #f5f5f7; }
body.ap-dash .key-row .btn { height: 56px; flex: none; }
body.ap-dash .license-meta { margin: 14px 0 0; font-size: 14px; color: #a1a1a6; }
body.ap-dash .license .license-device {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px;
  margin: 14px 0 0 !important; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.05); font-size: 13px !important; line-height: 1.5 !important; }
body.ap-dash .license .license-device b { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #86868b; }
body.ap-dash .license-sub { padding: 12px 14px; border-radius: 14px; background: rgba(255,159,10,.10); margin-top: 14px !important; }
body.ap-dash .free-key { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
body.ap-dash .free-key .free-key-left { margin-left: 0 !important; }
body.ap-dash .free-key-note { flex-basis: 100%; font-size: 13px; color: var(--warn); }
body.ap-dash .pill { padding: 5px 12px; font-size: 12.5px; font-weight: 600; }

/* ---------- downloads ---------- */
body.ap-dash .download { margin-top: 22px; padding: 0; background: none; border-radius: 0; }
body.ap-dash .download::before {
  content: "Downloads"; display: block; margin-bottom: 14px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #86868b; }
body.ap-dash .download > div { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px !important; }
body.ap-dash .download > div > div {
  flex-direction: column; align-items: stretch !important; justify-content: space-between !important; gap: 18px !important;
  padding: 22px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); }
body.ap-dash .download h3 { margin: 0 0 4px; font-size: 18px; }
body.ap-dash .download p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
body.ap-dash .download .btn-primary { width: 100%; height: 48px; justify-content: center; gap: 8px; }
body.ap-dash .download .btn svg { width: 18px; height: 18px; }
/* fallback single download (old markup) */
body.ap-dash .download:not(:has(> div > div)) > div { display: flex !important; }

/* ---------- help boxes become collapsible ---------- */
body.ap-dash details.free-key-help { margin-top: 14px; padding: 0; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
body.ap-dash details.free-key-help summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; cursor: pointer; list-style: none;
  font-size: 15.5px; font-weight: 600; color: #f5f5f7; }
body.ap-dash details.free-key-help summary::-webkit-details-marker { display: none; }
body.ap-dash details.free-key-help summary::after {
  content: ""; width: 9px; height: 9px; flex: none; border-right: 2px solid #86868b; border-bottom: 2px solid #86868b; transform: rotate(45deg); transition: transform .25s; margin-right: 4px; }
body.ap-dash details.free-key-help[open] summary::after { transform: rotate(-135deg); }
body.ap-dash details.free-key-help > :not(summary) { margin-left: 20px; margin-right: 20px; }
body.ap-dash details.free-key-help > :last-child { margin-bottom: 20px; }
body.ap-dash details.free-key-help p { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 0; }
body.ap-dash #claimBox .key-row { margin-top: 4px; }
body.ap-dash #claimBox .key-row .btn { height: 48px; }

/* ---------- affiliate ---------- */
body.ap-dash .rate { display: inline-block; margin: 0 0 22px; padding: 6px 14px; border-radius: 980px; background: rgba(255,202,10,.14); color: #ffca0a; font-size: 14px; }
body.ap-dash .rate b { color: #ffca0a; }
body.ap-dash .stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
body.ap-dash .stats > .stat { grid-column: span 2; }
body.ap-dash .stats > .stat:nth-child(n+5) { grid-column: span 3; }
body.ap-dash .stat { padding: 20px 22px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); }
body.ap-dash .stat span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
body.ap-dash .stat b { font-size: 30px; color: #f5f5f7; }
body.ap-dash .stat.main {
  grid-column: 1 / -1 !important; padding: 28px; border: 1px solid rgba(255,202,10,.3);
  background: radial-gradient(100% 140% at 0% 0%, rgba(255,202,10,.24) 0%, rgba(255,202,10,0) 60%), linear-gradient(180deg, #241d08 0%, #141410 100%); }
body.ap-dash .stat.main b { font-size: clamp(44px, 7vw, 64px); color: #f5f5f7; letter-spacing: -.04em; }
body.ap-dash .field .row { display: flex; gap: 10px; }
body.ap-dash .field .row .input { flex: 1; min-width: 0; }
body.ap-dash .field .row .btn { flex: none; height: 48px; }
body.ap-dash .subpanel { margin: 26px 0; padding: 26px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); }
body.ap-dash .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- tables ---------- */
body.ap-dash .table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); }
body.ap-dash th { background: rgba(255,255,255,.04); color: #86868b; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
body.ap-dash td { border-top: 1px solid var(--line); color: #f5f5f7; white-space: nowrap; }
body.ap-dash tbody tr:hover td { background: rgba(255,255,255,.03); }
body.ap-dash td.strong { font-weight: 600; }
body.ap-dash .empty, body.ap-dash .empty-cell { color: var(--muted); }

/* ---------- forms ---------- */
body.ap-dash .input, body.ap-dash select.input, body.ap-dash textarea.input { background: #1f1f22; border-color: rgba(255,255,255,.14); color: #f5f5f7; }
body.ap-dash .input::placeholder { color: #6e6e73; }
body.ap-dash .stars button { color: #48484a; }
body.ap-dash .block.narrow { max-width: 640px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  body.ap-dash .page { padding-top: 32px; }
  body.ap-dash .layout > .nav { top: 60px; margin-left: -4px; margin-right: -4px; }
  body.ap-dash .nav button { padding: 9px 14px; font-size: 14px; border: 0; background: transparent; }
  body.ap-dash .nav button[aria-selected="true"] { background: #f5f5f7; }
  body.ap-dash .block { padding: 24px 18px; border-radius: 24px; }
  body.ap-dash .license { padding: 20px 16px; }
  body.ap-dash .key-row { flex-direction: column; }
  body.ap-dash .key, body.ap-dash .key-row .btn { height: 52px; width: 100%; }
  body.ap-dash .key { font-size: 14px; letter-spacing: .03em; }
  body.ap-dash .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ap-dash .stats > .stat, body.ap-dash .stats > .stat:nth-child(n+5) { grid-column: span 1; }
  body.ap-dash .stats > .stat:last-child { grid-column: 1 / -1; }
  body.ap-dash .grid-3 { grid-template-columns: 1fr; }
  body.ap-dash .field .row { flex-direction: column; }
  body.ap-dash .field .row .btn { width: 100%; }
  body.ap-dash .user-chip .uname { display: none; }
  body.ap-dash .user-chip { padding: 4px; }
}

/* ---------- one card style everywhere (same as the license card) ---------- */
body.ap-dash .download > div > div,
body.ap-dash details.free-key-help,
body.ap-dash .stat,
body.ap-dash .subpanel,
body.ap-dash .table-wrap,
body.ap-dash #updateStatusText,
body.ap-dash #changePassForm,
body.ap-dash #reviewForm,
body.ap-dash #existingReviewStatus:not(:empty),
body.ap-dash #reviewNotEligible:not([hidden]) {
  border: 1px solid rgba(255,202,10,.28);
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,202,10,.20) 0%, rgba(255,202,10,0) 60%), linear-gradient(180deg, #241d08 0%, #141410 100%);
}
body.ap-dash .stat.main {
  border-color: rgba(255,202,10,.4);
  background: radial-gradient(100% 140% at 0% 0%, rgba(255,202,10,.32) 0%, rgba(255,202,10,0) 62%), linear-gradient(180deg, #241d08 0%, #141410 100%);
}
body.ap-dash .download > div > div,
body.ap-dash .subpanel,
body.ap-dash #changePassForm,
body.ap-dash #reviewForm { border-radius: 24px; }
body.ap-dash #updateStatusText { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 18px 20px; border-radius: 18px; font-size: 15px; color: #f5f5f7; }
body.ap-dash #changePassForm, body.ap-dash #reviewForm { padding: 26px; }
body.ap-dash #existingReviewStatus:not(:empty), body.ap-dash #reviewNotEligible:not([hidden]) { padding: 16px 20px; border-radius: 18px; margin-top: 16px; }
body.ap-dash th { background: rgba(255,202,10,.08); }
body.ap-dash td { border-top-color: rgba(255,255,255,.07); }
body.ap-dash .input, body.ap-dash select.input, body.ap-dash textarea.input { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.14); }
@media (max-width: 760px) {
  body.ap-dash #changePassForm, body.ap-dash #reviewForm { padding: 20px 16px; }
}
body.ap-dash #updateStatusText { margin-top: 12px; }
body.ap-dash .block > h3 { margin: 0; }

/* ---------- logo-yellow accent ---------- */
body.ap-dash .btn-primary { background: var(--grad); color: #111100; box-shadow: 0 8px 28px rgba(255,202,10,.25); }
body.ap-dash .input:focus, body.ap-dash select.input:focus, body.ap-dash textarea.input:focus { border-color: #ffca0a !important; box-shadow: 0 0 0 3px rgba(255,202,10,.2); }
body.ap-dash .stars button.on { color: #ffca0a; }
body.ap-dash .btn-ghost:hover { border-color: #ffca0a; color: #ffca0a; }
body.ap-dash a { color: #ffd60a; }
