/*
 * X-Bin design v3 — shared style (R1).
 * Loaded on every page (<html data-v3>) since PM9.
 *
 * Colour values mirror apps/core/design_v3.py (a test keeps them in step).
 * Owner rules: vivid colours chosen by meaning (never dark, brown, bronze,
 * khaki or greyed-out element colours); links are never underlined.
 * Components are prefixed .x3- and only take effect inside an .x3 scope, so
 * pages not yet redesigned keep their current look.
 */

/* ---------------------------------------------------------------- tokens */

html[data-v3] {
  --x3-canvas: #F4F6FB;
  --x3-surface: #FFFFFF;
  --x3-surface-2: #F7F8FC;
  --x3-line: #E1E5EE;
  --x3-line-strong: #CBD1DD;
  --x3-ink: #0A0E14;
  --x3-ink-2: #3F4858;
  --x3-muted: #5C6573;
  --x3-focus: #7B4DFF;
  --x3-primary-fill: #571DD1;
  --x3-primary-fill-hover: #4A16BC;
  --x3-primary-on: #FFFFFF;
  --x3-primary-text: #571DD1;
  --x3-primary-tint: #EFE9FF;
  --x3-success-fill: #047857;
  --x3-success-on: #FFFFFF;
  --x3-success-text: #047857;
  --x3-success-tint: #E4F7EE;
  --x3-waiting-fill: #C2410C;
  --x3-waiting-on: #FFFFFF;
  --x3-waiting-text: #C2410C;
  --x3-waiting-tint: #FFF1E5;
  --x3-danger-fill: #D61F2C;
  --x3-danger-on: #FFFFFF;
  --x3-danger-text: #C81E2A;
  --x3-danger-tint: #FFEDEE;
  --x3-info-fill: #1D4ED8;
  --x3-info-on: #FFFFFF;
  --x3-info-text: #1D4ED8;
  --x3-info-tint: #E8F0FF;

  /* Conversion keeps the admin-managed coral («ظاهر سایت»). */
  --x3-hot-fill: var(--xbin-cta-hot-bg, #C01868);
  --x3-hot-fill-hover: var(--xbin-cta-hot-bg-hover, #E02040);
  --x3-hot-on: var(--xbin-cta-hot-text, #FFFFFF);

  --x3-radius-s: 10px;
  --x3-radius: 14px;
  --x3-radius-l: 22px;
  --x3-shadow: 0 10px 26px rgba(10, 14, 20, 0.06);
  --x3-shadow-raised: 0 16px 36px rgba(10, 14, 20, 0.12);
  --x3-font: "Vazirmatn", "IRANSans", Tahoma, sans-serif;

  /* Platform colours default to X-Bin purple; .x3-plat sets the real ones. */
  --x3-plat: var(--x3-primary-text);
  --x3-plat-tint: var(--x3-primary-tint);
  --x3-hero: linear-gradient(135deg, #8B5CF6, #571DD1);
  --x3-hero-line: linear-gradient(90deg, #8B5CF6, #571DD1);
}

html[data-v3]:not([data-theme="light"]) {
  --x3-canvas: #0A0E14;
  --x3-surface: #121826;
  --x3-surface-2: #182033;
  --x3-line: #263048;
  --x3-line-strong: #34405C;
  --x3-ink: #F4F6FB;
  --x3-ink-2: #CDD3DE;
  --x3-muted: #A4ABB8;
  --x3-focus: #A98BFF;
  --x3-primary-fill: #6A3DF0;
  --x3-primary-fill-hover: #7C55F5;
  --x3-primary-on: #FFFFFF;
  --x3-primary-text: #B9A4FF;
  --x3-primary-tint: #231A47;
  --x3-success-fill: #047857;
  --x3-success-on: #FFFFFF;
  --x3-success-text: #4ADE95;
  --x3-success-tint: #0E2B20;
  --x3-waiting-fill: #C2410C;
  --x3-waiting-on: #FFFFFF;
  --x3-waiting-text: #FDBA74;
  --x3-waiting-tint: #33200F;
  --x3-danger-fill: #D61F2C;
  --x3-danger-on: #FFFFFF;
  --x3-danger-text: #FDA4AA;
  --x3-danger-tint: #361318;
  --x3-info-fill: #1D4ED8;
  --x3-info-on: #FFFFFF;
  --x3-info-text: #93C5FD;
  --x3-info-tint: #0F1E3D;
  --x3-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  --x3-shadow-raised: 0 16px 36px rgba(0, 0, 0, 0.4);
}

/* Platform scope: the inline style from Platform.hero["style"] sets
   --x3-hero, --x3-hero-line, --x3-plat-solid («رنگ متن»),
   --x3-plat-tint-light («زمینهٔ روشن») and, for the dark theme, a vivid
   lighter --x3-plat-dark on a deep --x3-plat-tint-dark of the same hue
   (computed in platform_heroes.py; 4.5:1 tested for every platform). */
html[data-v3] .x3-plat {
  --x3-plat: var(--x3-plat-solid, #571DD1);
  --x3-plat-tint: var(--x3-plat-tint-light, #EFE9FF);
}

html[data-v3]:not([data-theme="light"]) .x3-plat {
  --x3-plat: var(--x3-plat-dark, #B9A4FF);
  --x3-plat-tint: var(--x3-plat-tint-dark, #231A47);
}

/* ----------------------------------------------------------------- scope */

.x3 {
  font-family: var(--x3-font);
  color: var(--x3-ink);
  line-height: 1.7;
  /* Persian words never split mid-word; only long URLs and handles may. */
  overflow-wrap: break-word;
  word-break: normal;
}

.x3-page {
  background: var(--x3-canvas);
}

html[data-v3] a,
html[data-v3] a:hover,
html[data-v3] a:focus,
html[data-v3] a:active,
html[data-v3] a:visited {
  text-decoration: none;
}

/* A link inside running text is told apart by more than its colour
   (WCAG 1.4.1, axe link-in-text-block): by its weight, because links are
   never given a line under them (owner rule). The consent notice and
   article text. */
html[data-v3] .analytics-consent p a,
html[data-v3] .pm6b-consent p a,
html[data-v3] .prose a {
  font-weight: 700;
}

/* The consent notice text (full and compact bar) is medium so its bold
   link stands apart. */
html[data-v3] .analytics-consent p,
html[data-v3] .pm6b-consent p {
  font-weight: 500;
}

.x3 :focus-visible {
  outline: 3px solid var(--x3-focus);
  outline-offset: 2px;
}

/* Scroll boxes contain their absolutely positioned screen-reader text, so
   it cannot escape and widen the page on phones. */
.x3-plans,
.x3-chiprow--scroll,
.x3-table-box,
.x3-btn,
.x3-check,
.x3-tag {
  position: relative;
}

.x3-break-any {
  overflow-wrap: anywhere;
}

.x3-num {
  font-variant-numeric: tabular-nums;
}

.x3-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- layout */

.x3-wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .x3-wrap {
    padding-inline: 24px;
  }
}

.x3-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.x3-stack--l {
  gap: 28px;
}

.x3-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.x3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}

.x3-table-box {
  overflow-x: auto;
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius);
}

.x3-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.x3-table th,
.x3-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--x3-line);
  text-align: start;
  white-space: nowrap;
}

.x3-table th {
  color: var(--x3-ink-2);
  font-weight: 800;
  background: var(--x3-surface-2);
}

.x3-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--x3-line-strong);
  vertical-align: middle;
}

/* ------------------------------------------------------------ text links */

.x3-link {
  color: var(--x3-primary-text);
  font-weight: 700;
}

.x3-link:hover {
  color: var(--x3-primary-fill-hover);
}

html[data-v3]:not([data-theme="light"]) .x3-link:hover {
  color: #D3C6FF;
}

.x3-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--x3-primary-text);
  font-weight: 800;
  white-space: nowrap;
}

.x3-arrow svg {
  transition: transform 160ms ease;
}

.x3-arrow:hover svg {
  transform: translateX(-3px);
}

/* ------------------------------------------------------------------ card */

.x3-card {
  background: var(--x3-surface);
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius-l);
  box-shadow: var(--x3-shadow);
  min-width: 0;
}

.x3-card--pad {
  padding: 18px;
}

@media (min-width: 768px) {
  .x3-card--pad {
    padding: 22px;
  }
}

.x3-card--interactive {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .x3-card--interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--x3-shadow-raised);
    border-color: var(--x3-line-strong);
  }
}

.x3-kicker {
  display: inline-block;
  color: var(--x3-primary-text);
  font-size: 12.5px;
  font-weight: 800;
}

.x3-h1 {
  margin: 0;
  font-size: clamp(22px, 2.4vw + 12px, 34px);
  line-height: 1.45;
  font-weight: 800;
}

.x3-h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 800;
}

.x3-h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
}

.x3-muted {
  color: var(--x3-muted);
}

/* --------------------------------------------------------------- buttons */

.x3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: max-content;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.x3-btn:disabled,
.x3-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.x3-btn--primary {
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
}

.x3-btn--primary:hover {
  background: var(--x3-primary-fill-hover);
  color: var(--x3-primary-on);
}

.x3-btn--hot {
  background: var(--x3-hot-fill);
  color: var(--x3-hot-on);
}

.x3-btn--hot:hover {
  background: var(--x3-hot-fill-hover);
  color: var(--x3-hot-on);
}

.x3-btn--ghost {
  background: var(--x3-surface);
  border-color: var(--x3-line-strong);
  color: var(--x3-ink);
}

.x3-btn--ghost:hover {
  border-color: var(--x3-primary-text);
  color: var(--x3-primary-text);
}

.x3-btn--outline {
  background: var(--x3-surface);
  border-color: var(--x3-primary-text);
  color: var(--x3-primary-text);
}

.x3-btn--outline:hover {
  background: var(--x3-primary-tint);
}

/* «در سبد»: the plan is in the cart; pressing again removes it. */
.x3-btn--incart,
.x3-btn--incart:hover {
  background: var(--x3-success-fill);
  border-color: var(--x3-success-fill);
  color: var(--x3-success-on);
}

.x3-btn--danger {
  background: var(--x3-surface);
  border-color: var(--x3-danger-text);
  color: var(--x3-danger-text);
}

.x3-btn--sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}

.x3-btn--block {
  width: 100%;
}

.x3-btn--icon {
  min-width: 44px;
  width: 44px;
  padding: 0;
}

/* ----------------------------------------------------- pills and chips */

.x3-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

a.x3-pill:hover {
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
}

.x3-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--x3-info-tint);
  color: var(--x3-info-text);
}

.x3-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}

.x3-chip--plain::before {
  display: none;
}

.x3-chip--primary { background: var(--x3-primary-tint); color: var(--x3-primary-text); }
.x3-chip--success { background: var(--x3-success-tint); color: var(--x3-success-text); }
.x3-chip--waiting { background: var(--x3-waiting-tint); color: var(--x3-waiting-text); }
.x3-chip--danger { background: var(--x3-danger-tint); color: var(--x3-danger-text); }
.x3-chip--info { background: var(--x3-info-tint); color: var(--x3-info-text); }

/* Vivid fill variant (white text) for one strong status per screen. */
.x3-chip--solid.x3-chip--primary { background: var(--x3-primary-fill); color: var(--x3-primary-on); }
.x3-chip--solid.x3-chip--success { background: var(--x3-success-fill); color: var(--x3-success-on); }
.x3-chip--solid.x3-chip--waiting { background: var(--x3-waiting-fill); color: var(--x3-waiting-on); }
.x3-chip--solid.x3-chip--danger { background: var(--x3-danger-fill); color: var(--x3-danger-on); }
.x3-chip--solid.x3-chip--info { background: var(--x3-info-fill); color: var(--x3-info-on); }

/* Filter chip: a toggle button with aria-pressed. */
.x3-fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--x3-line-strong);
  border-radius: 999px;
  background: var(--x3-surface);
  color: var(--x3-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.x3-fchip:hover {
  border-color: var(--x3-primary-text);
}

.x3-fchip[aria-pressed="true"] {
  border-color: var(--x3-primary-text);
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
  font-weight: 800;
}

.x3-fchip-count {
  color: var(--x3-muted);
  font-size: 12px;
}

.x3-fchip[aria-pressed="true"] .x3-fchip-count {
  color: var(--x3-primary-text);
}

/* Active filter shown in the results line, with a remove cross. */
.x3-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 6px 0 12px;
  padding-inline: 12px 6px;
  border-radius: 999px;
  border: 0;
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.x3-tag svg {
  width: 14px;
  height: 14px;
}

.x3-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.x3-chiprow--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

/* -------------------------------------------------------- platform bits */

.x3-plat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.x3-plat-badge svg,
.x3-plat-badge img {
  width: 14px;
  height: 14px;
}

.x3-plat-line {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--x3-hero-line);
}

.x3-avatar {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 800;
  overflow: visible;
}

.x3-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.x3-avatar-badge {
  position: absolute;
  inset-block-start: -3px;
  inset-inline-start: -5px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--x3-surface);
  background: var(--x3-surface);
  color: var(--x3-plat);
  display: grid;
  place-items: center;
}

.x3-avatar-badge svg,
.x3-avatar-badge img {
  width: 12px;
  height: 12px;
}

/* ------------------------------------------------------- platform hero */

.x3-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--x3-radius-l);
  background: var(--x3-hero);
  color: #FFFFFF;
}

.x3-hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Scrim in the platform's own text colour keeps white text at 3:1 or more
   on every stop (tested in apps/marketplace/platform_heroes.py). */
.x3-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse 70% 80% at 50% 50%,
    color-mix(in srgb, var(--x3-plat-solid, var(--x3-plat)) 55%, transparent) 0%,
    color-mix(in srgb, var(--x3-plat-solid, var(--x3-plat)) 55%, transparent) 55%,
    transparent 100%
  );
}

.x3-hero-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 18px 24px;
  text-align: center;
}

.x3-hero-name {
  margin: 0;
  font-size: clamp(21px, 1.6vw + 14px, 30px);
  font-weight: 800;
  line-height: 1.4;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(10, 14, 20, 0.25);
}

.x3-hero-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  padding: 4px;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 12px 26px rgba(10, 14, 20, 0.2);
}

.x3-hero-avatar > span,
.x3-hero-avatar > img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--x3-plat-tint-light, #F5F1FF);
  color: var(--x3-plat-solid, #571DD1);
  font-size: 28px;
  font-weight: 800;
  object-fit: cover;
}

.x3-hero-avatar .x3-avatar-badge {
  border-color: #FFFFFF;
  background: #FFFFFF;
  color: var(--x3-plat-solid, #571DD1);
  width: 30px;
  height: 30px;
}

.x3-hero-avatar .x3-avatar-badge svg {
  width: 14px;
  height: 14px;
}

/* White labels on the hero use the platform's text colour in both themes. */
.x3-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--x3-plat-solid, #571DD1);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(10, 14, 20, 0.12);
}

a.x3-hero-label:hover {
  background: var(--x3-plat-tint-light, #F5F1FF);
}

.x3-hero-actions {
  position: absolute;
  inset-block-start: 14px;
  inset-inline-end: 14px;
  display: flex;
  gap: 8px;
}

.x3-hero-actions .x3-btn--icon {
  background: rgba(255, 255, 255, 0.92);
  color: var(--x3-plat-solid, #571DD1);
  border: 0;
}

/* ------------------------------------------------------------ stat tile */

.x3-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 10px;
  margin: 0;
}

/* <div class="x3-stat"><dt>icon + label</dt><dd>value + source</dd></div>
   inside <dl class="x3-stats">; the icon sits in the reserved start space. */
.x3-stat {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px 14px;
  padding-inline-start: 58px;
  border-radius: var(--x3-radius);
  background: var(--x3-surface);
  border: 1px solid var(--x3-line);
  min-width: 0;
}

.x3-stat-icon {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
}

.x3-stat-icon svg {
  width: 18px;
  height: 18px;
}

.x3-stat dd {
  margin: 0;
}

.x3-stat-value {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.x3-stat dt {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--x3-ink-2);
}

.x3-stat-src {
  display: block;
  font-size: 11.5px;
  color: var(--x3-muted);
}

/* ----------------------------------------------------- accordion (plans) */

.x3-acc {
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius);
  background: var(--x3-surface);
}

.x3-acc[data-selected="true"] {
  border: 2px solid var(--x3-primary-text);
  background: color-mix(in srgb, var(--x3-primary-tint) 40%, var(--x3-surface));
}

.x3-acc > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.x3-acc > summary::-webkit-details-marker {
  display: none;
}

.x3-acc > summary .x3-acc-chev {
  margin-inline-start: auto;
  flex: none;
  transition: transform 160ms ease;
}

.x3-acc[open] > summary .x3-acc-chev {
  transform: rotate(180deg);
}

/* A plan run («۲۴ ساعت») never splits across lines. */
.x3-run {
  font-weight: 600;
  white-space: nowrap;
}

.x3-acc-body {
  padding: 4px 14px 16px;
  display: grid;
  gap: 14px;
}

/* ------------------------------------------------------- bottom sheet */

.x3-sheet {
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 760px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--x3-surface);
  color: var(--x3-ink);
  box-shadow: var(--x3-shadow-raised);
}

@media (min-width: 768px) {
  .x3-sheet {
    margin: auto;
    border-radius: var(--x3-radius-l);
  }
}

.x3-sheet::backdrop {
  background: rgba(10, 14, 20, 0.5);
}

.x3-sheet[open] {
  display: flex;
  flex-direction: column;
}

.x3-sheet-grip {
  align-self: center;
  width: 44px;
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--x3-line-strong);
}

.x3-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px 8px 20px;
  padding-inline: 20px 12px;
  border-bottom: 1px solid var(--x3-line);
}

.x3-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 20px;
  display: grid;
  gap: 20px;
}

.x3-sheet-foot {
  display: flex;
  gap: 10px;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--x3-line);
}

/* ------------------------------------------------------- basket bar */

/* Lilac bar with a purple primary button (approved boards). */
.x3-basket {
  position: sticky;
  bottom: 16px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 12px;
  padding-inline-start: 16px;
  border: 1px solid color-mix(in srgb, var(--x3-primary-text) 25%, transparent);
  border-radius: 16px;
  background: var(--x3-primary-tint);
  color: var(--x3-ink);
  box-shadow: 0 10px 28px rgba(87, 29, 209, 0.14);
}

.x3-basket-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--x3-surface);
  color: var(--x3-primary-text);
  display: grid;
  place-items: center;
}

.x3-basket-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.5;
}

.x3-basket-text > strong {
  font-size: 15px;
}

.x3-basket-names {
  font-size: 12.5px;
  color: var(--x3-ink-2);
}

.x3-basket-sum {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--x3-ink-2);
}

.x3-basket-sum strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--x3-ink);
}

.x3-basket-view,
.x3-basket-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.x3-basket-view {
  padding: 0 16px;
  border: 1px solid var(--x3-primary-text);
  background: var(--x3-surface);
  color: var(--x3-primary-text);
}

.x3-basket-go {
  padding: 0 20px;
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
  font-weight: 800;
}

.x3-basket-go:hover {
  background: var(--x3-primary-fill-hover);
  color: var(--x3-primary-on);
}

.x3-basket-short {
  display: none;
}

@media (max-width: 767px) {
  .x3-basket {
    bottom: 76px;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 8px;
    padding-inline-start: 12px;
    border-radius: 14px;
  }

  .x3-basket-icon,
  .x3-basket-names,
  .x3-basket-view,
  .x3-basket-sum,
  .x3-basket-long {
    display: none;
  }

  .x3-basket-short {
    display: inline;
  }

  .x3-basket-text > strong {
    font-size: 13.5px;
  }

  .x3-basket-mobile-sum {
    font-size: 13px;
    color: var(--x3-ink-2);
  }

  .x3-basket-mobile-sum strong {
    font-size: 15px;
    color: var(--x3-ink);
  }

  .x3-basket-go {
    padding: 0 16px;
  }
}

/* ------------------------------------------------------------ stepper */

/* Steps share the width and never scroll sideways; a label may wrap
   between words on a phone, never inside a word. */
.x3-steps {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.x3-step {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 4px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--x3-muted);
}

@media (max-width: 479px) {
  .x3-step {
    font-size: 11px;
    padding-inline: 1px;
  }

  .x3-step-actor {
    display: none;
  }
}

/* Connector toward the next step (RTL: to the left). */
.x3-step::after {
  content: "";
  position: absolute;
  top: 13px;
  inset-inline-start: calc(50% + 16px);
  inset-inline-end: calc(-50% + 16px);
  height: 2px;
  border-radius: 2px;
  background: var(--x3-line-strong);
}

.x3-step:last-child::after {
  display: none;
}

.x3-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid var(--x3-line-strong);
  background: var(--x3-surface);
  color: var(--x3-muted);
  font-size: 12px;
  font-weight: 800;
}

.x3-step-dot svg {
  width: 14px;
  height: 14px;
}

.x3-step[data-state="done"] {
  color: var(--x3-success-text);
}

.x3-step[data-state="done"] .x3-step-dot {
  border-color: var(--x3-success-fill);
  background: var(--x3-success-fill);
  color: var(--x3-success-on);
}

.x3-step[data-state="done"]::after {
  background: var(--x3-success-fill);
}

.x3-step[data-state="current"] {
  color: var(--x3-primary-text);
  font-weight: 800;
}

.x3-step[data-state="current"] .x3-step-dot {
  border-color: var(--x3-primary-fill);
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
  box-shadow: 0 0 0 4px var(--x3-primary-tint);
}

.x3-step[data-state="stopped"] {
  color: var(--x3-danger-text);
}

.x3-step[data-state="stopped"] .x3-step-dot {
  border-color: var(--x3-danger-fill);
  background: var(--x3-danger-fill);
  color: var(--x3-danger-on);
}

.x3-step-actor {
  font-size: 11px;
  font-weight: 600;
  color: var(--x3-muted);
}

.x3-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-radius: var(--x3-radius);
  background: var(--x3-primary-tint);
  color: var(--x3-ink);
}

.x3-next-label {
  color: var(--x3-primary-text);
  font-weight: 800;
}

.x3-next .x3-btn {
  margin-inline-start: auto;
}

/* --------------------------------------------------------------- stars */

/* Stars take the platform colour (vivid, 3:1 or more on white). */
.x3-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--x3-plat);
}

.x3-stars svg {
  width: 16px;
  height: 16px;
}

.x3-stars .is-off {
  color: var(--x3-line-strong);
}

/* Star input: radio buttons, reversed so RTL fills from the right. */
.x3-stars-input {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
  border: 0;
  margin: 0;
  padding: 0;
}

.x3-stars-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.x3-stars-input label {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--x3-line-strong);
  cursor: pointer;
}

.x3-stars-input label svg {
  width: 26px;
  height: 26px;
}

.x3-stars-input input:checked ~ label,
.x3-stars-input label:hover,
.x3-stars-input label:hover ~ label {
  color: var(--x3-plat);
}

.x3-stars-input input:focus-visible + label {
  outline: 3px solid var(--x3-focus);
  outline-offset: 2px;
}

/* ------------------- placement preview (ported from the approved board) */

.x3-ps {
  display: flex;
  justify-content: center;
  margin: 0;
  direction: rtl;
  line-height: 1.6;
}

.x3-ps--stage {
  padding: 12px 0;
  border-radius: 16px;
  background: var(--x3-plat-tint-light, #F5F1FF);
}

.x3-ps-phone {
  width: 132px;
  height: 264px;
  border-radius: 22px;
  border: 5px solid #1A1530;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

.x3-ps-browser {
  width: 270px;
  height: 190px;
  border-radius: 10px;
  border: 1px solid #CBD1DD;
  background: #FFFFFF;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(10, 14, 20, 0.08);
}

.x3-ps-video {
  width: 300px;
  height: 264px;
  border-radius: 12px;
  border: 1px solid #CBD1DD;
  background: #FFFFFF;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(10, 14, 20, 0.08);
}

.x3-ps-ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EDE8F7;
}

.x3-ps-ad {
  outline: 2px solid #571DD1;
  outline-offset: -2px;
}

.x3-ps-tag,
.x3-ps-tagw {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.6;
}

.x3-ps-tag {
  background: #571DD1;
  color: #FFFFFF;
}

.x3-ps-tagw {
  background: #FFFFFF;
  color: #3F12A3;
}

.x3-ps-ln {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: #DDE3EC;
}

.x3-ps-dot {
  display: block;
  border-radius: 999px;
  background: #DDD7EA;
}

/* =========================================================== R2 market */

.x3-market {
  padding-bottom: 24px;
}

.x3-market .x3-wrap {
  max-width: 1400px;
}

.x3-market-intro {
  display: grid;
  /* One shrinkable track: an auto track grew past a 320px screen. */
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding-block: 26px 14px;
}

@media (min-width: 1024px) {
  .x3-market-intro {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
    align-items: end;
  }
}

.x3-highlight {
  color: var(--x3-primary-text);
}

.x3-search {
  display: flex;
  gap: 8px;
}

.x3-search input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--x3-line-strong);
  border-radius: var(--x3-radius);
  background: var(--x3-surface);
  color: var(--x3-ink);
  font: inherit;
  font-size: 15px;
}

.x3-search input::placeholder {
  color: var(--x3-muted);
}

.x3-search .x3-btn {
  min-height: 52px;
  border-radius: var(--x3-radius);
}

@media (max-width: 767px) {
  .x3-search .x3-btn {
    min-width: 52px;
    padding: 0;
  }

  .x3-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.x3-objectives {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 6px;
}

.x3-objectives-title {
  flex: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--x3-ink-2);
}

.x3-objectives .x3-chiprow {
  flex: 1;
  min-width: 0;
}

@media (max-width: 767px) {
  .x3-objectives {
    flex-wrap: wrap;
  }

  .x3-objectives-title {
    display: none;
  }

  .x3-objectives .x3-chiprow {
    flex-basis: 100%;
  }
}

.x3-fchip[aria-current="true"],
.x3-fchip[data-active="true"] {
  border-color: var(--x3-primary-text);
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
  font-weight: 800;
}

.x3-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-block: 10px;
}

.x3-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.x3-toolbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.x3-toolbar-sheet {
  display: none;
}

.x3-toolbar-guide {
  align-self: center;
}

@media (max-width: 767px) {
  .x3-toolbar-filters {
    display: none;
  }

  .x3-toolbar-sheet {
    display: inline-flex;
  }

  .x3-toolbar-end .x3-segment {
    display: none;
  }
}

.x3-dd {
  position: relative;
}

.x3-dd > summary {
  list-style: none;
}

.x3-dd > summary::-webkit-details-marker {
  display: none;
}

.x3-dd[open] > summary svg {
  transform: rotate(180deg);
}

.x3-dd-panel {
  position: absolute;
  z-index: 40;
  inset-block-start: calc(100% + 6px);
  inset-inline-start: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: max-content;
  max-width: min(440px, 90vw);
  padding: 12px;
  border: 1px solid var(--x3-line);
  border-radius: 16px;
  background: var(--x3-surface);
  box-shadow: var(--x3-shadow-raised);
}

.x3-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.x3-sort label {
  font-size: 13px;
  font-weight: 700;
  color: var(--x3-ink-2);
}

.x3-sort select {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--x3-line-strong);
  border-radius: 999px;
  background: var(--x3-surface);
  color: var(--x3-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
}

html.x3-js [data-x3-noscript] {
  display: none;
}

.x3-segment {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--x3-line-strong);
  border-radius: 999px;
  background: var(--x3-surface);
}

.x3-segment a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--x3-ink-2);
  font-size: 13px;
  font-weight: 800;
}

.x3-segment a[aria-current="page"] {
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
}

.x3-resultline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 6px 0 14px;
}

.x3-resultline > strong {
  font-size: 16px;
  font-weight: 800;
}

.x3-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

@media (min-width: 768px) {
  .x3-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .x3-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* -------------------------------------------------------- media card */

.x3-mcard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.x3-mcard-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.x3-mcard-logo {
  width: 52px;
  height: 52px;
}

.x3-mcard-logo > img,
.x3-mcard-logo > span:first-child {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
}

.x3-mcard-id {
  min-width: 0;
  flex: 1;
}

.x3-mcard-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.x3-mcard-name a {
  color: var(--x3-ink);
}

.x3-mcard-name a:hover {
  color: var(--x3-primary-text);
}

.x3-mcard-meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--x3-muted);
}

.x3-mcard-plat {
  color: var(--x3-plat);
  font-weight: 800;
}

.x3-mcard-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 10px 6px;
  border-radius: var(--x3-radius);
  background: var(--x3-surface-2);
  text-align: center;
}

.x3-mcard-facts > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  min-width: 0;
  padding-inline: 4px;
}

.x3-mcard-facts > div + div {
  border-inline-start: 1px solid var(--x3-line);
}

.x3-mcard-facts dt {
  font-size: 11.5px;
  color: var(--x3-muted);
}

.x3-mcard-facts dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
}

.x3-mcard-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--x3-success-text);
}

.x3-mcard-plans {
  display: grid;
  gap: 8px;
}

.x3-mcard-plans-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.x3-mcard-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--x3-ink-2);
}

.x3-mcard-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--x3-primary-text);
}

/* Plans: one horizontal row each (name and run · price · button), stacked;
   the admin number of rows is visible and the rest scroll down. */
.x3-plans {
  --x3-plans-visible: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(var(--x3-plans-visible) * 54px + (var(--x3-plans-visible) - 1) * 8px);
  margin: 0;
  padding: 0;
  padding-inline-end: 4px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border-radius: 12px;
}

.x3-plan {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 4px;
  padding-inline-start: 12px;
  border: 1px solid var(--x3-line);
  border-radius: 12px;
  background: var(--x3-surface);
}

.x3-plan:has(.is-selected) {
  border-color: color-mix(in srgb, var(--x3-success-fill) 45%, var(--x3-surface));
  background: color-mix(in srgb, var(--x3-success-tint) 70%, var(--x3-surface));
}

.x3-plan-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.x3-plan-name {
  font-size: 13.5px;
  font-weight: 700;
}

.x3-plan-run {
  font-size: 12px;
  color: var(--x3-muted);
  white-space: nowrap;
}

.x3-plan-price {
  white-space: nowrap;
}

.x3-plan-price strong {
  font-size: 15px;
  font-weight: 800;
}

.x3-plan-unit {
  font-size: 12px;
  color: var(--x3-muted);
}

.x3-plan form {
  flex: none;
}

.x3-planbtn {
  width: 96px;
  min-width: 96px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  border-color: var(--x3-primary-text);
  background: var(--x3-surface);
  color: var(--x3-primary-text);
  font-size: 13.5px;
}

.x3-planbtn:hover {
  background: var(--x3-primary-tint);
}

.x3-planbtn .x3-planbtn-tick,
.x3-planbtn.is-selected .x3-planbtn-add {
  display: none;
}

.x3-planbtn.is-selected .x3-planbtn-tick {
  display: inline;
}

.x3-planbtn.is-selected,
.x3-planbtn.is-selected:hover {
  border-color: var(--x3-success-fill);
  background: var(--x3-success-fill);
  color: var(--x3-success-on);
}

/* Phones: name and run over the price, the button beside both. */
@media (max-width: 519px) {
  .x3-plan {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 0;
    padding-block: 6px;
  }

  .x3-plan-id {
    grid-column: 1;
    grid-row: 1;
  }

  .x3-plan-price {
    grid-column: 1;
    grid-row: 2;
  }

  .x3-plan form {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .x3-plans {
    max-height: calc(var(--x3-plans-visible) * 74px + (var(--x3-plans-visible) - 1) * 8px);
  }
}

@media (max-width: 380px) {
  .x3-planbtn {
    width: 84px;
    min-width: 84px;
  }
}

.x3-mcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--x3-line);
}

.x3-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--x3-ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.x3-check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--x3-line-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: transparent;
  background: var(--x3-surface);
}

.x3-check[aria-pressed="true"] {
  color: var(--x3-primary-text);
}

.x3-check[aria-pressed="true"] .x3-check-box {
  border-color: var(--x3-primary-fill);
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
}

/* ------------------------------------------------- pager and empty */

.x3-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.x3-pager-pages {
  display: inline-flex;
  gap: 6px;
}

.x3-pager-page {
  display: grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--x3-line);
  border-radius: 10px;
  background: var(--x3-surface);
  color: var(--x3-ink);
  font-weight: 800;
}

.x3-pager-page[aria-current="page"] {
  border-color: var(--x3-primary-fill);
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
}

.x3-pager-status {
  font-size: 12.5px;
}

@media (max-width: 767px) {
  .x3-pager-pages {
    display: none;
  }

  .x3-pager-more {
    width: 100%;
  }
}

.x3-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
}

/* -------------------------------------------- compare bar and basket */

.x3-compare-slot {
  position: sticky;
  bottom: 96px;
  z-index: 29;
  pointer-events: none;
}

.x3-compare {
  pointer-events: auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding: 8px 14px;
  border: 1px solid var(--x3-primary-text);
  border-radius: 999px;
  background: var(--x3-primary-tint);
  color: var(--x3-ink);
  box-shadow: var(--x3-shadow);
}

.x3-basket-slot {
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding-bottom: 12px;
  pointer-events: none;
}

.x3-basket-slot .x3-basket {
  position: static;
  pointer-events: auto;
}

@media (max-width: 767px) {
  .x3-compare-slot {
    bottom: 140px;
  }

  .x3-basket-slot {
    bottom: 64px;
  }
}

/* ------------------------------------------------------- filter sheet */

.x3-sheet-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}

.x3-sheet-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.x3-sheet-group legend {
  padding-bottom: 8px;
}

.x3-radiochip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.x3-radiochip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.x3-radiochip > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--x3-line-strong);
  border-radius: 999px;
  background: var(--x3-surface);
  color: var(--x3-ink);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.x3-radiochip input:checked + span {
  border-color: var(--x3-primary-text);
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
  font-weight: 800;
}

.x3-radiochip input:focus-visible + span {
  outline: 3px solid var(--x3-focus);
  outline-offset: 2px;
}

.x3-market-table th[scope="row"] {
  white-space: normal;
  min-width: 10rem;
}

.x3-compare-table th[scope="col"] {
  min-width: 11rem;
  white-space: normal;
  vertical-align: top;
}

/* ========================================================== R3 profile */
/* Values follow the approved board «پروفایل رسانه · W1-D»; light surfaces
   map to the v3 tokens so the dark theme keeps contrast. */

html[data-v3][data-theme="light"] body.x3-page--profile {
  background: #F6F6F9;
}

.x3-pf-main {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.x3-pf-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--x3-muted);
}

.x3-pf-crumbs a {
  color: var(--x3-ink-2);
}

.x3-pf-crumbs [aria-current] {
  color: var(--x3-ink);
  font-weight: 600;
}

/* ------------------------------------------------------------ hero */

.x3-pf-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 30px;
  background: var(--x3-hero);
  color: #FFFFFF;
}

/* Scrim in the platform's own colour behind the centre (contrast, tested). */
.x3-pf-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse 40% 55% at 50% 42%,
    color-mix(in srgb, var(--x3-plat-solid, #571DD1) 50%, transparent) 0%,
    color-mix(in srgb, var(--x3-plat-solid, #571DD1) 30%, transparent) 60%,
    transparent 100%
  );
}

.x3-pf-hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.x3-pf-hero-actions {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  display: flex;
  gap: 8px;
}

.x3-pf-round {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: #FFFFFF;
  color: #0A0E14;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(10, 14, 20, 0.08);
  cursor: pointer;
}

.x3-pf-hero-body {
  position: relative;
  padding: 34px 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.x3-pf-hero-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--x3-plat-solid, #571DD1);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.x3-pf-avatar {
  position: relative;
  width: 128px;
  height: 128px;
}

.x3-pf-avatar-ring {
  width: 128px;
  height: 128px;
  border-radius: 999px;
  padding: 5px;
  background: #FFFFFF;
  box-shadow: 0 16px 34px rgba(10, 14, 20, 0.18);
}

.x3-pf-avatar-in {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 5px solid #FFFFFF;
  background: #FFFFFF;
  color: var(--x3-plat-solid, #571DD1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.x3-pf-avatar-in img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x3-pf-avatar-initial {
  font-size: 44px;
  font-weight: 800;
}

.x3-pf-avatar-ok,
.x3-pf-avatar-plat {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.x3-pf-avatar-ok {
  bottom: 4px;
  left: 4px;
  background: #047857;
  color: #FFFFFF;
}

.x3-pf-avatar-plat {
  top: 2px;
  right: -2px;
  background: #FFFFFF;
  color: var(--x3-plat-solid, #571DD1);
}

.x3-pf-name {
  margin: 0;
  font-size: 34px;
  line-height: 1.35;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(10, 14, 20, 0.2);
}

.x3-pf-handle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--x3-plat-solid, #571DD1);
  font-weight: 700;
}

.x3-pf-handle-plat {
  font-weight: 500;
  color: #3F4858;
}

.x3-pf-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.x3-pf-cats li {
  padding: 3px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #0A0E14;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.x3-pf-cats li.is-primary {
  background: #FFFFFF;
  color: var(--x3-plat-solid, #571DD1);
  font-weight: 800;
}

.x3-pf-stats {
  position: relative;
  margin: 0;
  padding: 0 24px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 12px;
}

/* <div><dt>icon + label</dt><dd>value</dd><dd>source</dd></div>: the value
   shows first, as on the board; the icon sits in the reserved start space. */
.x3-pf-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70px;
  padding: 14px 16px;
  padding-inline-start: 70px;
  line-height: 1.4;
  border-radius: 18px;
  background: #FFFFFF;
  color: #0A0E14;
  box-shadow: 0 8px 22px rgba(10, 14, 20, 0.12);
}

.x3-pf-stat-icon {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--x3-plat-tint-light, #F5F1FF);
  color: var(--x3-plat-solid, #571DD1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.x3-pf-stat dt {
  order: 2;
  font-size: 12.5px;
  color: #3F4858;
}

.x3-pf-stat-value {
  order: 1;
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.x3-pf-stat-src {
  order: 3;
  margin: 0;
  font-size: 11px;
  color: #5C6573;
}

/* ---------------------------------------------------------- columns */

.x3-pf-cols {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 22px;
}

.x3-pf-col-main {
  flex: 999 1 580px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.x3-pf-col-side {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Phones: plans and other channels come right after the hero (W1-D mobile). */
@media (max-width: 1023px) {
  .x3-pf-col-side {
    order: -1;
  }
}

.x3-pf-card {
  background: var(--x3-surface);
  border: 1px solid var(--x3-line);
  border-radius: 24px;
}

.x3-pf-kicker {
  font-size: 13px;
  font-weight: 800;
  color: var(--x3-plat);
}

.x3-pf-note {
  margin: 0;
  font-size: 12px;
  color: var(--x3-muted);
}

/* ------------------------------------------------------------ about */

.x3-pf-about {
  overflow: hidden;
}

.x3-pf-about-head {
  padding: 24px 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.x3-pf-about-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.45;
  font-weight: 800;
}

.x3-pf-about-text {
  margin: 0;
  max-width: 720px;
  font-size: 16px;
  color: var(--x3-ink-2);
}

.x3-pf-posts {
  padding: 22px 24px;
  display: grid;
  gap: 8px;
}

.x3-pf-posts h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.x3-pf-posts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.x3-pf-posts li > a,
.x3-pf-posts li > span,
.x3-pf-posts li > img {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: var(--x3-surface-2);
}

.x3-pf-posts img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------ rails */

.x3-pf-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.x3-pf-rail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.x3-pf-rail-head > div {
  display: flex;
  flex-direction: column;
}

.x3-pf-rail-head span {
  font-size: 12.5px;
  color: var(--x3-muted);
}

.x3-pf-rail-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.x3-pf-rail-head a,
.x3-pf-family-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
  font-weight: 700;
  font-size: 13.5px;
}

.x3-pf-rail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 12px;
}

.x3-pf-rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--x3-surface);
  border: 1px solid var(--x3-line);
  color: var(--x3-ink);
}

.x3-pf-rail-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.x3-pf-rail-meta {
  font-size: 12px;
  color: var(--x3-muted);
}

.x3-pf-rail-plat {
  font-weight: 700;
  color: var(--x3-plat);
}

.x3-pf-rail-price {
  font-size: 12px;
  color: var(--x3-ink-2);
}

/* Logo square: approved logo or initial on the category's deep colour. */
.x3-pf-logo {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
}

.x3-pf-logo > img,
.x3-pf-logo > span[role="img"]:first-child {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  object-fit: cover;
}

.x3-pf-logo--44 {
  width: 44px;
  height: 44px;
}

.x3-pf-logo--44 > img,
.x3-pf-logo--44 > span[role="img"]:first-child {
  border-radius: 13px;
  font-size: 17px;
}

.x3-pf-logo-badge {
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid var(--x3-surface);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.x3-pf-logo--44 .x3-pf-logo-badge {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------- plan picker */

.x3-pf-picker {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 14px 36px rgba(10, 14, 20, 0.07);
}

.x3-pf-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.x3-pf-picker-head > div {
  display: flex;
  flex-direction: column;
}

.x3-pf-picker-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.x3-pf-picker-head > div > span {
  color: var(--x3-muted);
  font-size: 13px;
}

.x3-pf-picker-count {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.x3-pf-plan {
  border-radius: 18px;
  border: 1px solid var(--x3-line);
  background: var(--x3-surface);
  overflow: hidden;
}

.x3-pf-plan[data-selected="true"] {
  border: 2px solid var(--x3-primary-fill);
  background: color-mix(in srgb, var(--x3-primary-tint) 35%, var(--x3-surface));
}

.x3-pf-plan > summary {
  list-style: none;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 14px;
  cursor: pointer;
}

.x3-pf-plan > summary::-webkit-details-marker {
  display: none;
}

.x3-pf-plan-box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid #A4ABB8;
  background: var(--x3-surface);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.x3-pf-plan[data-selected="true"] .x3-pf-plan-box {
  border-color: var(--x3-primary-fill);
  background: var(--x3-primary-fill);
  color: #FFFFFF;
}

.x3-pf-plan-id {
  display: flex;
  flex-direction: column;
  line-height: 1.45;
  min-width: 0;
}

.x3-pf-plan-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.x3-pf-plan-name strong {
  font-size: 15.5px;
}

.x3-pf-plan-name > span {
  padding: 0 8px;
  border-radius: 6px;
  background: var(--x3-surface-2);
  font-size: 12px;
  color: var(--x3-ink-2);
  white-space: nowrap;
}

.x3-pf-plan-state {
  font-size: 12px;
  font-weight: 600;
  color: var(--x3-muted);
}

.x3-pf-plan[data-selected="true"] .x3-pf-plan-state {
  color: var(--x3-success-text);
}

.x3-pf-plan-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
  white-space: nowrap;
}

.x3-pf-plan-price strong {
  font-size: 16px;
}

.x3-pf-plan-price span {
  font-size: 11px;
  color: var(--x3-muted);
}

.x3-pf-plan[open] .x3-pf-plan-chev {
  transform: rotate(180deg);
}

.x3-pf-plan-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 14px 16px;
  border-top: 1px solid var(--x3-line);
}

.x3-pf-plan-detail {
  display: flex;
  gap: 14px;
  padding-top: 12px;
}

.x3-pf-plan-preview {
  flex: none;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.x3-pf-plan-preview .x3-ps-phone {
  width: 104px;
  height: 208px;
  border-radius: 20px;
}

.x3-pf-plan-preview .x3-ps-browser {
  width: 150px;
  height: 120px;
}

.x3-pf-plan-preview .x3-ps-video {
  width: 150px;
  height: 140px;
}

.x3-pf-plan-zoom {
  position: absolute;
  bottom: 8px;
  right: 50%;
  transform: translateX(50%);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(26, 21, 48, 0.86);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.x3-pf-plan-specs {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.x3-pf-plan-specs > div {
  position: relative;
  min-height: 28px;
  padding-inline-start: 36px;
  line-height: 1.45;
}

.x3-pf-spec-icon {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
  display: flex;
  align-items: center;
  justify-content: center;
}

.x3-pf-plan-specs dt {
  font-size: 11.5px;
  color: var(--x3-muted);
}

.x3-pf-plan-specs dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.x3-pf-plan-reqs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.x3-pf-plan-reqs > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--x3-ink-2);
}

.x3-pf-plan-reqs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.x3-pf-plan-reqs li {
  padding: 2px 10px;
  border-radius: 8px;
  border: 1px solid var(--x3-line);
  background: var(--x3-surface-2);
  font-size: 12.5px;
}

.x3-pf-pick {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--x3-primary-fill);
  background: var(--x3-primary-fill);
  color: #FFFFFF;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.x3-pf-pick.is-selected {
  background: var(--x3-surface);
  color: var(--x3-primary-text);
  border-color: var(--x3-primary-text);
}

.x3-pf-picker-sum {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--x3-line);
}

.x3-pf-picker-sum ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.x3-pf-picker-sum li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--x3-ink-2);
}

.x3-pf-picker-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
}

.x3-pf-picker-total strong {
  font-size: 20px;
}

.x3-pf-picker-total strong > span:last-child {
  font-size: 12px;
  font-weight: 500;
  color: var(--x3-muted);
}

.x3-pf-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border-radius: 12px;
  background: var(--x3-primary-fill);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
}

.x3-pf-go:hover {
  background: var(--x3-primary-fill-hover);
  color: #FFFFFF;
}

/* ----------------------------------------------------- other channels */

.x3-pf-family {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(10, 14, 20, 0.05);
}

.x3-pf-family-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.x3-pf-family-mark {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.x3-pf-family-head > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.45;
}

.x3-pf-family-head > div > span {
  font-size: 12.5px;
  color: var(--x3-muted);
}

.x3-pf-family-head h2 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 800;
}

.x3-pf-ok {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--x3-success-tint);
  color: var(--x3-success-text);
  font-size: 11.5px;
  font-weight: 700;
}

.x3-pf-family-total {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--x3-surface-2);
}

.x3-pf-family-total > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.x3-pf-family-total > div:first-child span {
  font-size: 12.5px;
  color: var(--x3-ink-2);
}

.x3-pf-family-total > div:first-child strong {
  font-size: 16px;
  font-weight: 800;
}

.x3-pf-family-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
}

.x3-pf-family-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.x3-pf-family-list a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--x3-line);
  background: var(--x3-plat-tint);
  color: var(--x3-ink);
}

.x3-pf-family-list a > svg {
  color: var(--x3-primary-text);
}

.x3-pf-family-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.x3-pf-family-text strong {
  font-size: 14.5px;
}

.x3-pf-family-text span {
  font-size: 12px;
  color: var(--x3-muted);
}

.x3-pf-family-from {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.35;
  white-space: nowrap;
}

.x3-pf-family-from span {
  font-size: 11px;
  color: var(--x3-muted);
}

.x3-pf-family-from strong {
  font-size: 13.5px;
}

.x3-pf-family-all {
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
}

.x3-pf-basket {
  padding-bottom: 16px;
}

.x3-pv-dialog .x3-pv-stage {
  justify-items: center;
}

/* ------------------------------------------------------------ phones */

/* Phones follow «پروفایل رسانه · W1-D · موبایل». */
@media (max-width: 519px) {
  .x3-pf-main {
    padding: 12px 16px 0;
    gap: 16px;
  }

  .x3-pf-crumbs {
    font-size: 12.5px;
    gap: 6px;
  }

  .x3-pf-hero-actions {
    top: 12px;
    left: 12px;
    gap: 6px;
  }

  .x3-pf-hero-chip,
  .x3-pf-handle-plat,
  .x3-pf-stat-src {
    display: none;
  }

  .x3-pf-hero-body {
    gap: 8px;
  }

  .x3-pf-avatar-ring {
    padding: 4px;
  }

  .x3-pf-avatar-in {
    border-width: 4px;
  }

  .x3-pf-avatar-ok,
  .x3-pf-avatar-plat {
    width: 30px;
    height: 30px;
  }

  .x3-pf-handle {
    min-height: 40px;
  }

  .x3-pf-cats li {
    padding: 2px 12px;
    font-size: 12.5px;
  }

  .x3-pf-stat {
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(10, 14, 20, 0.1);
  }

  .x3-pf-stat-value {
    font-size: 16px;
  }

  .x3-pf-stat dt {
    font-size: 11.5px;
  }

  .x3-pf-stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .x3-pf-hero {
    border-radius: 24px;
  }

  .x3-pf-hero-body {
    padding: 24px 16px 18px;
  }

  .x3-pf-avatar,
  .x3-pf-avatar-ring {
    width: 104px;
    height: 104px;
  }

  .x3-pf-name {
    font-size: 26px;
  }

  .x3-pf-stats {
    padding: 0 12px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .x3-pf-stat {
    min-height: 60px;
    padding: 12px;
    padding-inline-start: 58px;
  }

  .x3-pf-stat-icon {
    inset-inline-start: 12px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .x3-pf-picker,
  .x3-pf-family {
    padding: 16px;
  }

  .x3-pf-about-head {
    padding: 18px;
  }

  .x3-pf-about-head h2 {
    font-size: 20px;
  }
}

/* ============================================ R2 market · board values */
/* Matches «بازار رسانه · ویترین فشرده» (approved board) exactly; the
   owner's change keeps «هدف تبلیغ» as the first drop-down in the bar. */

.x3-market .x3-search {
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--x3-line-strong);
  border-radius: 14px;
  background: var(--x3-surface);
}

.x3-market .x3-search input {
  min-height: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 12px;
  outline-offset: -2px;
}

.x3-market .x3-search .x3-btn {
  min-height: 44px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
}

.x3-market-intro .x3-kicker {
  font-size: 13px;
  font-weight: 700;
}

.x3-market-intro .x3-h1 {
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.x3-market-intro p {
  font-size: 15px;
  max-width: 560px;
}

.x3-toolbar {
  margin-block: 0;
  padding: 10px 12px;
  border: 1px solid var(--x3-line);
  border-radius: 14px;
  background: var(--x3-surface);
  gap: 8px;
}

.x3-market .x3-toolbar-wrap {
  padding-block: 6px;
}

.x3-toolbar .x3-dd > summary.x3-fchip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border-color: var(--x3-line-strong);
  font-weight: 600;
  gap: 8px;
}

.x3-toolbar .x3-dd > summary.x3-fchip[data-active="true"] {
  border-color: var(--x3-primary-fill);
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
  font-weight: 700;
}

.x3-toolbar .x3-sort label {
  font-weight: 400;
  color: var(--x3-muted);
}

.x3-toolbar .x3-sort select {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 600;
}

.x3-toolbar .x3-segment {
  gap: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
}

.x3-toolbar .x3-segment a {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 0;
  color: var(--x3-ink);
  font-weight: 600;
}

.x3-toolbar .x3-segment a[aria-current="page"] {
  background: var(--x3-ink);
  color: var(--x3-surface);
}

.x3-toolbar-sheet {
  min-height: 44px;
  border-radius: 10px;
}

.x3-resultline > strong {
  padding-inline-end: 8px;
}

.x3-resultline .x3-tag {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--x3-line-strong);
  background: var(--x3-surface);
  color: var(--x3-ink);
  font-weight: 400;
}

.x3-resultline .x3-tag svg {
  width: 12px;
  height: 12px;
}

.x3-resultline .x3-link {
  padding: 0 8px;
  font-weight: 600;
}

.x3-mcard.x3-card {
  border-radius: 16px;
  box-shadow: none;
}

.x3-mcard-head {
  align-items: flex-start;
}

.x3-mcard-logo {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
  font-size: 22px;
  font-weight: 800;
}

.x3-mcard-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x3-mcard-name {
  font-size: 17px;
  font-weight: 700;
}

.x3-mcard-facts {
  padding: 10px 4px;
  border-radius: 12px;
}

.x3-mcard-facts > div {
  gap: 0;
  align-items: center;
}

.x3-mcard-facts dd {
  font-size: 16px;
}

.x3-mcard-facts dt {
  font-size: 12px;
}

.x3-mcard-ok {
  font-size: 13px;
  font-weight: 700;
  min-height: 27px;
}

/* ============================ R3 profile content sections (board values) */

/* «مخاطب · به اعلام ناشر» box inside the hero. */
.x3-pf-aud {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  margin-top: 6px;
  border-radius: 18px;
  background: #FFFFFF;
  color: #0A0E14;
  box-shadow: 0 10px 24px rgba(10, 14, 20, 0.14);
  overflow: hidden;
}

.x3-pf-aud-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--x3-plat-tint-light, #F5F1FF);
  color: var(--x3-plat-solid, #571DD1);
  font-size: 12.5px;
  font-weight: 800;
}

.x3-pf-aud dl {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

.x3-pf-aud dl > div {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 16px;
  padding-inline-start: 43px;
  border-inline-start: 1px solid #F0F1F5;
  line-height: 1.35;
}

.x3-pf-aud dt {
  font-size: 11.5px;
  color: #5C6573;
}

.x3-pf-aud dt > span {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--x3-plat-solid, #571DD1);
}

.x3-pf-aud dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

/* «مناسب برای این رسانه» / «پذیرفته نمی‌شود». */
.x3-pf-about-head:has(+ .x3-pf-fit) {
  border-bottom: 1px solid var(--x3-line);
}

.x3-pf-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
  padding: 20px 24px;
}

.x3-pf-fit > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
}

.x3-pf-fit h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.x3-pf-fit ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.x3-pf-fit li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.x3-pf-fit-yes {
  background: #F1FAF6;
}

.x3-pf-fit-yes h3 {
  color: #04603F;
}

.x3-pf-fit-yes svg {
  flex: none;
  color: #047857;
}

.x3-pf-fit-no {
  background: #FBF1F3;
}

.x3-pf-fit-no h3 {
  color: #9F1239;
}

.x3-pf-fit-no svg {
  flex: none;
  color: #BE123C;
}

html[data-v3]:not([data-theme="light"]) .x3-pf-fit-yes {
  background: var(--x3-success-tint);
}

html[data-v3]:not([data-theme="light"]) .x3-pf-fit-yes h3,
html[data-v3]:not([data-theme="light"]) .x3-pf-fit-yes svg {
  color: var(--x3-success-text);
}

html[data-v3]:not([data-theme="light"]) .x3-pf-fit-no {
  background: var(--x3-danger-tint);
}

html[data-v3]:not([data-theme="light"]) .x3-pf-fit-no h3,
html[data-v3]:not([data-theme="light"]) .x3-pf-fit-no svg {
  color: var(--x3-danger-text);
}

/* «نظر مشتریان». */
.x3-pf-reviews {
  overflow: hidden;
}

.x3-pf-rv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 22px 24px 16px;
}

.x3-pf-rv-head > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 560px;
}

.x3-pf-rv-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.x3-pf-rv-write {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--x3-primary-fill);
  background: var(--x3-surface);
  color: var(--x3-primary-text);
  font-weight: 700;
  white-space: nowrap;
}

.x3-pf-rv-write.is-off {
  border-color: var(--x3-line-strong);
  color: var(--x3-muted);
  cursor: not-allowed;
}

.x3-pf-rv-aspects {
  list-style: none;
  margin: 0;
  padding: 0 24px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.x3-pf-rv-aspects li {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--x3-plat-tint);
  border: 1px solid color-mix(in srgb, var(--x3-plat) 15%, transparent);
}

.x3-pf-rv-aspects li > span:first-child {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--x3-surface);
  color: var(--x3-plat);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(10, 14, 20, 0.06);
}

.x3-pf-rv-aspects li > strong {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 700;
}

.x3-pf-rv-score {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--x3-surface);
  border: 1px solid color-mix(in srgb, var(--x3-plat) 15%, transparent);
  color: var(--x3-plat);
}

.x3-pf-rv-score strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--x3-ink);
}

.x3-pf-rv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-block: 1px solid var(--x3-line);
  background: var(--x3-surface-2);
}

.x3-pf-rv-bar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.x3-pf-rv-bar > div a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #DDE0E8;
  background: var(--x3-surface);
  color: var(--x3-ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.x3-pf-rv-bar > div a[aria-current="true"] {
  border-color: var(--x3-ink);
  background: var(--x3-ink);
  color: var(--x3-surface);
}

.x3-pf-rv-gap {
  flex: 1 1 auto;
}

.x3-pf-rv-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.x3-pf-rv-sort label {
  font-size: 13px;
  color: var(--x3-muted);
}

.x3-pf-rv-sort select {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #DDE0E8;
  background: var(--x3-surface);
  color: var(--x3-ink);
  font: inherit;
  font-size: 13px;
}

.x3-pf-rv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.x3-pf-rv-list > li {
  display: flex;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--x3-line);
}

.x3-pf-rv-av {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.x3-pf-rv-av--1 { background: #EFE9FF; color: #571DD1; }
.x3-pf-rv-av--2 { background: #E3F2FB; color: #0E5A8A; }
.x3-pf-rv-av--3 { background: #E3F5EE; color: #04603F; }
.x3-pf-rv-av--4 { background: #FFF0F7; color: #A3196E; }

.x3-pf-rv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.x3-pf-rv-who,
.x3-pf-rv-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.x3-pf-rv-who strong {
  font-size: 14.5px;
}

.x3-pf-rv-meta .x3-stars svg {
  width: 15px;
  height: 15px;
}

.x3-pf-rv-plan {
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--x3-surface-2);
  font-size: 12px;
  color: var(--x3-ink-2);
}

.x3-pf-rv-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--x3-ink);
}

.x3-pf-rv-reply {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--x3-surface-2);
  border-inline-start: 3px solid var(--x3-plat);
}

.x3-pf-rv-reply > span {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.x3-pf-rv-reply > div {
  display: flex;
  flex-direction: column;
  line-height: 1.7;
}

.x3-pf-rv-reply strong {
  font-size: 12.5px;
}

.x3-pf-rv-reply span {
  font-size: 13.5px;
  color: var(--x3-ink-2);
}

.x3-pf-rv-actions {
  display: flex;
  gap: 6px;
}

.x3-pf-rv-actions button,
.x3-pf-rv-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--x3-ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.x3-pf-rv-actions button[aria-pressed="true"] {
  color: var(--x3-primary-text);
  background: var(--x3-primary-tint);
}

.x3-pf-rv-actions .is-quiet {
  color: var(--x3-muted);
  font-weight: 400;
}

.x3-pf-rv-more {
  padding: 16px 24px 20px;
  display: flex;
  justify-content: center;
}

.x3-pf-rv-more a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid #DDE0E8;
  background: var(--x3-surface);
  color: var(--x3-ink);
  font-weight: 700;
}

@media (max-width: 519px) {
  .x3-pf-aud {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-top: 4px;
  }

  .x3-pf-aud dl {
    flex-direction: column;
  }

  .x3-pf-aud dl > div {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 14px;
    padding-inline-start: 41px;
    border-inline-start: 0;
    border-top: 1px solid #F0F1F5;
  }

  .x3-pf-aud dt {
    font-size: 12.5px;
  }

  .x3-pf-aud dt > span {
    inset-inline-start: 14px;
  }

  .x3-pf-aud dd {
    font-size: 13.5px;
  }

  .x3-pf-rv-head,
  .x3-pf-rv-list > li {
    padding-inline: 16px;
  }

  .x3-pf-rv-aspects,
  .x3-pf-rv-bar {
    padding-inline: 16px;
  }

  .x3-pf-fit {
    padding: 16px;
  }
}

/* -------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .x3 *,
  .x3 *::before,
  .x3 *::after {
    transition: none !important;
    animation: none !important;
  }

  .x3-card--interactive:hover {
    transform: none;
  }
}

/* ============================ Profile hero «طرح ۲ب» (owner, 2026-11-22)
   docs/prototypes/marketplace-profile/hero-2b.html: a white card with a
   slim platform-colour band on top, a large logo in a platform-colour ring
   with a soft shadow, the name centred, then the audience row and small,
   tight stat tiles. Colours follow the platform tokens in both themes. */

.x3-pf-hero {
  border: 1px solid var(--x3-line);
  border-radius: 24px;
  background: var(--x3-surface);
  color: var(--x3-ink);
}

.x3-pf-hero::before {
  display: none;
}

.x3-pf-cover {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 124px;
  background:
    radial-gradient(circle at 12% -40%, rgba(255, 255, 255, 0.35), transparent 46%),
    var(--x3-hero);
}

.x3-pf-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    color-mix(in srgb, var(--x3-surface) 28%, transparent)
  );
}

.x3-pf-hero-actions {
  top: 16px;
  left: 16px;
  gap: 8px;
}

.x3-pf-round {
  width: 40px;
  height: 40px;
  border: 0;
  background: var(--x3-surface);
  color: var(--x3-ink-2);
  box-shadow: none;
}

.x3-pf-hero-body {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 22px 24px 18px;
  text-align: center;
}

.x3-pf-hero-body > .x3-pf-avatar {
  margin-top: 4px;
}

.x3-pf-avatar,
.x3-pf-avatar-ring {
  flex: none;
  width: 132px;
  height: 132px;
}

.x3-pf-avatar-ring {
  padding: 4px;
  background: var(--x3-plat);
  box-shadow:
    0 0 0 4px var(--x3-surface),
    0 14px 28px rgba(46, 42, 69, 0.24),
    0 3px 8px rgba(46, 42, 69, 0.14);
}

.x3-pf-avatar-in {
  border: 3px solid var(--x3-surface);
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
}

.x3-pf-avatar-in svg {
  width: 48px;
  height: 48px;
}

.x3-pf-avatar-initial {
  font-size: 44px;
}

.x3-pf-avatar-ok,
.x3-pf-avatar-plat {
  inset: auto;
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--x3-surface);
}

.x3-pf-avatar-ok svg {
  width: 13px;
  height: 13px;
}

.x3-pf-avatar-plat svg {
  width: 14px;
  height: 14px;
}

.x3-pf-avatar-ok {
  bottom: 2px;
  right: -2px;
  background: #047857;
  color: #FFFFFF;
}

.x3-pf-avatar-plat {
  top: 0;
  left: -2px;
  background: var(--x3-surface);
  color: var(--x3-plat);
}

/* Name, handle and tags are centred one under another. */
.x3-pf-id {
  display: contents;
}

.x3-pf-hero .x3-pf-hero-chip {
  display: inline-flex;
  padding: 3px 12px;
  border: 0;
  background: var(--x3-surface);
  color: var(--x3-plat);
  font-size: 12.5px;
  font-weight: 700;
}

.x3-pf-name {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--x3-ink);
  text-shadow: none;
}

.x3-pf-handle {
  display: inline-flex;
  min-height: 0;
  padding: 4px 14px;
  border: 1px solid var(--x3-line);
  background: var(--x3-surface);
  color: var(--x3-plat);
  font-size: 13.5px;
  font-weight: 600;
}

.x3-pf-hero .x3-pf-handle-plat {
  display: inline;
  color: var(--x3-muted);
  font-weight: 400;
}

.x3-pf-cats {
  justify-content: center;
  margin-top: 4px;
}

.x3-pf-cats li {
  padding: 2px 12px;
  border: 1px solid var(--x3-line);
  background: var(--x3-surface);
  color: var(--x3-ink-2);
  font-size: 12.5px;
  font-weight: 500;
}

.x3-pf-cats li.is-primary {
  border-color: transparent;
  background: var(--x3-plat-solid, #571DD1);
  color: #FFFFFF;
  font-weight: 700;
}

/* Audience: one bordered row, centred under the tags. */
.x3-pf-hero .x3-pf-aud {
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: 0 auto 18px;
  border: 1px solid var(--x3-line);
  border-radius: 14px;
  background: var(--x3-surface);
  color: var(--x3-ink);
  box-shadow: none;
}

.x3-pf-hero .x3-pf-aud-head {
  padding: 8px 14px;
  background: var(--x3-plat-tint);
  color: var(--x3-plat);
  font-weight: 700;
  white-space: nowrap;
}

.x3-pf-hero .x3-pf-aud dl > div {
  padding: 6px 16px;
  padding-inline-start: 43px;
  border-color: var(--x3-line);
}

.x3-pf-hero .x3-pf-aud dt {
  color: var(--x3-muted);
}

.x3-pf-hero .x3-pf-aud dt > span {
  color: var(--x3-plat);
}

.x3-pf-hero .x3-pf-aud dd {
  font-size: 13px;
  font-weight: 700;
}

/* Stats: small tiles on a soft tint; icon, then value, label and source. */
.x3-pf-stats {
  gap: 8px;
  padding: 0 16px 16px;
  border: 0;
  background: none;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
}

.x3-pf-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  gap: 0 9px;
  min-height: 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--x3-surface-2);
  color: var(--x3-ink);
  box-shadow: none;
}

.x3-pf-stat dt {
  display: contents;
}

.x3-pf-stat-icon {
  position: static;
  grid-row: 1 / 4;
  transform: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--x3-surface);
  color: var(--x3-plat);
}

.x3-pf-stat-icon svg {
  width: 16px;
  height: 16px;
}

.x3-pf-stat-label {
  grid-column: 2;
  grid-row: 2;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--x3-ink);
}

.x3-pf-stat-value {
  grid-column: 2;
  grid-row: 1;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--x3-plat);
}

.x3-pf-hero .x3-pf-stat-src {
  display: block;
  grid-column: 2;
  grid-row: 3;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--x3-muted);
}

@media (max-width: 860px) {
  .x3-pf-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 14px 14px;
  }

  .x3-pf-stat:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .x3-pf-stat:first-child {
    grid-column: 1 / -1;
  }

  .x3-pf-hero .x3-pf-aud {
    flex-direction: column;
    align-items: stretch;
    max-width: calc(100% - 28px);
  }

  .x3-pf-hero .x3-pf-aud dl {
    flex-direction: column;
  }

  .x3-pf-hero .x3-pf-aud dl > div {
    border-inline-start: 0;
    border-top: 1px solid var(--x3-line);
  }

  .x3-pf-name {
    font-size: 24px;
  }
}

@media (max-width: 519px) {
  .x3-pf-hero {
    border-radius: 20px;
  }

  .x3-pf-cover {
    height: 104px;
  }

  .x3-pf-hero-actions {
    top: 12px;
    left: 12px;
  }

  .x3-pf-hero-body {
    padding: 18px 16px 14px;
  }

  .x3-pf-avatar,
  .x3-pf-avatar-ring {
    width: 116px;
    height: 116px;
  }
}

/* «ذخیره» beside share; filled in the platform colour once saved. */
.x3-pf-save {
  display: contents;
}

.x3-pf-hero-actions a.x3-pf-round {
  text-decoration: none;
}

.x3-pf-round[aria-pressed="true"] {
  color: var(--x3-plat);
}

/* Plan tick box picks the plan (v3.js); a 44px touch area around it. */
.x3-pf-plan-box {
  position: relative;
  cursor: pointer;
}

.x3-pf-plan-box::after {
  content: "";
  position: absolute;
  inset: -11px;
}

/* «نظر مشتریان» updates in place (HTMX): the list dims while loading and
   «نمایش … نظر دیگر» shows a spinner. */
.x3-pf-rv-list {
  transition: opacity 0.15s ease;
}

.x3-pf-reviews:has(.htmx-request) .x3-pf-rv-list {
  opacity: 0.55;
}

.x3-pf-reviews .htmx-request {
  cursor: progress;
}

.x3-pf-rv-more a {
  gap: 8px;
}

.x3-pf-rv-spin,
.x3-pf-rv-more-busy {
  display: none;
}

.x3-pf-rv-more a.htmx-request .x3-pf-rv-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--x3-primary-tint);
  border-top-color: var(--x3-primary-fill);
  animation: x3-spin 0.8s linear infinite;
}

.x3-pf-rv-more a.htmx-request .x3-pf-rv-more-idle {
  display: none;
}

.x3-pf-rv-more a.htmx-request .x3-pf-rv-more-busy {
  display: inline;
}

.x3-pf-rv-done {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  color: var(--x3-success-text);
}

@keyframes x3-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .x3-pf-rv-more a.htmx-request .x3-pf-rv-spin {
    animation-duration: 2.4s;
  }

  .x3-pf-rv-list {
    transition: none;
  }
}

/* ------------------------------------------------- campaign pages (R4) */

.x3-camp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}

.x3-camp {
  display: grid;
  gap: 12px;
  align-content: start;
}

.x3-camp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
}

.x3-camp-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--x3-ink);
  overflow-wrap: break-word;
  min-width: 0;
}

.x3-camp-title--l {
  font-size: 19px;
}

.x3-camp-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.x3-camp-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--x3-muted);
}

.x3-small {
  font-size: 12px;
  margin: 0;
}

.x3-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--x3-line);
  overflow: hidden;
}

.x3-bar > i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--x3-success-fill);
}

.x3-next--waiting {
  background: var(--x3-waiting-tint);
}

.x3-next--waiting .x3-next-label {
  color: var(--x3-waiting-text);
}

.x3-camp-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .x3-camp-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

.x3-hist {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
}

.x3-hist li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--x3-line);
  font-size: 13px;
}

.x3-hist li:last-child {
  border-bottom: 0;
}

.x3-hist i {
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--x3-primary-fill);
}

.x3-complain > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
}

.x3-complain > summary::-webkit-details-marker {
  display: none;
}

.x3-complain[open] > summary {
  margin-bottom: 10px;
}

/* The old shared form body keeps working under v3: no card in a card. */
.x3-content-body > div > form.card,
.x3-content-body > div > section.card {
  max-width: none;
  border-radius: var(--x3-radius-l);
  border-color: var(--x3-line);
  background: var(--x3-surface);
}

/* The invoice column is 320px: its content may not widen it. */
.x3-invoice {
  min-width: 0;
}

.x3-invoice .card {
  border-radius: var(--x3-radius-l);
  border-color: var(--x3-line);
  background: var(--x3-surface);
}


/* V12: ten steps do not fit with labels on a phone; the dots stay and the
   next-action box names the step now in progress. */
@media (max-width: 639px) {
  .x3-steps--many .x3-step > span:not(.x3-step-dot):not(.x3-sr) {
    display: none;
  }
}

.x3-deadline {
  font-weight: 600;
  color: var(--x3-waiting-text);
}

.x3-log {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

/* ------------------------------------------------- panel home (section 8) */

.x3-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.x3-home-figure {
  font-size: 22px;
  font-weight: 700;
  color: var(--x3-ink);
}

/* ------------------------------------------- «پیشخوان» account prompts */
/* The account prompts of the retired home: confirm a contact first, else
   «تکمیل حساب کاربری» with what is missing and how far along it is. */

.x3-home-completion {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--x3-ink);
}

.x3-home-completion:hover {
  border-color: var(--x3-primary-text);
}

.x3-home-completion-percent {
  font-size: 20px;
  font-weight: 700;
  color: var(--x3-primary-text);
}

.x3-home-completion-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.x3-home-completion-copy strong {
  font-size: 15px;
  font-weight: 600;
}

.x3-home-completion-bar {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--x3-line);
}

.x3-home-completion-bar > span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--x3-primary-fill);
}

/* ------------------------------------------------- sign-in pages (section 8) */
/* One clean card, no side panel: phone or email, a code, nothing to distract.
   Pure restyle: every form, field and test id stays as it is. */

html[data-v3] .auth-page {
  padding-block: 28px 40px;
  background: var(--x3-canvas);
}

html[data-v3] .auth-layout {
  max-width: 30rem;
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius-l);
  background: var(--x3-surface);
  box-shadow: var(--x3-shadow);
}

html[data-v3] .auth-layout:has(.auth-brand) {
  border-radius: var(--x3-radius-l);
}

html[data-v3] .auth-layout .auth-aside {
  display: none;
}

html[data-v3] .auth-form-panel {
  padding: 28px 22px;
}

html[data-v3] .auth-form-heading h1 {
  font-size: 22px;
  /* Owner weight rule (ui-ux-design-system.md): the sign-in heading is 600. */
  font-weight: 600;
  color: var(--x3-ink);
}

html[data-v3] .auth-form-heading p {
  color: var(--x3-muted);
}

html[data-v3] .auth-form-content input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
html[data-v3] .auth-form-content select {
  border: 1px solid var(--x3-line-strong);
  border-radius: var(--x3-radius-s);
  background: var(--x3-surface);
  color: var(--x3-ink);
}

html[data-v3] .auth-form-content input:focus-visible,
html[data-v3] .auth-form-content select:focus-visible {
  outline: 3px solid var(--x3-focus);
  outline-offset: 1px;
}

html[data-v3] .auth-layout .btn-primary {
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
  border-radius: var(--x3-radius-s);
  font-weight: 600;
}

html[data-v3] .auth-layout .btn-primary:hover {
  background: var(--x3-primary-fill-hover);
}

/* ------------------------------------------------- «پنل عملیات» (section 8) */
/* Restyle only: the queue forms, decisions and test ids are untouched.
   Colour follows urgency: calm purple for the tabs, orange once a queue is
   past 24 hours, red for the count that needs attention now. */

html[data-v3] .operator-console-summary {
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius-l);
  background: var(--x3-surface);
  box-shadow: var(--x3-shadow);
}

html[data-v3] .operator-summary-metrics dd {
  font-weight: 700;
  color: var(--x3-ink);
}

html[data-v3] .operator-summary-metrics .operator-summary-alert {
  color: var(--x3-danger-text);
}

html[data-v3] .queue-tabs {
  gap: 8px;
}

html[data-v3] .queue-tab {
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius);
  background: var(--x3-surface);
  color: var(--x3-ink);
}

html[data-v3] .queue-tab.is-active {
  border-color: var(--x3-primary-fill);
  background: var(--x3-primary-tint);
  color: var(--x3-primary-text);
}

html[data-v3] .queue-tab .status-chip {
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
  font-weight: 600;
}

html[data-v3] .queue-age {
  color: var(--x3-muted);
}

html[data-v3] .queue-age.is-overdue {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--x3-waiting-tint);
  color: var(--x3-waiting-text);
  font-weight: 600;
}

html[data-v3] .operator-queue-table th {
  background: var(--x3-surface-2);
  color: var(--x3-ink-2);
  font-weight: 600;
}

/* ------------------------------------------- publisher media page (section 8) */
/* Restyle only: forms, uploads and test ids stay. Rounded cards from the v3
   tokens; the primary button takes the action colour. */

html[data-v3] .publisher-manage-placement,
html[data-v3] .publisher-manage-tariff,
html[data-v3] .publisher-manage-brand-row,
html[data-v3] .publisher-manage-ownership-box {
  border: 1px solid var(--x3-line);
  border-radius: var(--x3-radius);
  background: var(--x3-surface);
}

html[data-v3] .publisher-manage-facts__item {
  border-radius: var(--x3-radius-s);
  background: var(--x3-surface-2);
}

html[data-v3] .publisher-media-page .btn-primary {
  background: var(--x3-primary-fill);
  color: var(--x3-primary-on);
  border-radius: var(--x3-radius-s);
  font-weight: 600;
}

html[data-v3] .publisher-media-page .btn-primary:hover {
  background: var(--x3-primary-fill-hover);
}

/* Plain inputs inside v3 pages (home search, article search, offers, rename). */
html[data-v3] .x3 input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
html[data-v3] .x3 select {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--x3-line-strong);
  border-radius: var(--x3-radius-s);
  background: var(--x3-surface);
  color: var(--x3-ink);
}

html[data-v3] .x3 input::placeholder {
  color: var(--x3-muted);
  opacity: 1;
}
