/* =========================================================
   Appflare, Product demo system
   Self-contained, themeable UI for "Work" product showcases.
   Each page sets --p-accent / --p-accent-2 on a .pdx wrapper.
   ========================================================= */

.pdx {
  --p-accent: #6366f1;
  --p-accent-2: #8b5cf6;
  --p-glow: rgba(99, 102, 241, 0.4);
  --p-soft: rgba(99, 102, 241, 0.14);
  --p-line: rgba(255, 255, 255, 0.08);
  --p-card: rgba(255, 255, 255, 0.028);
  --p-card-2: rgba(255, 255, 255, 0.05);
  --ok: #34d399;
  --down: #fb7185;
}
.pdx [hidden] { display: none !important; }
.pd-accent-text {
  background: linear-gradient(120deg, var(--p-accent), var(--p-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Product hero ---------- */
.pd-hero {
  position: relative;
  padding-top: calc(var(--header-h) + 56px);
  padding-bottom: 8px;
  overflow: hidden;
}
.pd-hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 150%;
  z-index: -1;
  background:
    radial-gradient(closest-side, var(--p-soft), transparent 70%) 28% 8%/60% 60% no-repeat,
    radial-gradient(closest-side, var(--p-soft), transparent 70%) 80% 20%/50% 50% no-repeat;
  filter: blur(10px);
}
.pd-brandrow {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}
.pd-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  box-shadow: 0 12px 30px -10px var(--p-glow);
  color: #fff;
  flex-shrink: 0;
}
.pd-logo svg { width: 26px; height: 26px; }
.pd-logo-img {
  overflow: hidden;
  background: #0b0c10;
}
.pd-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pd-brandrow b { font-size: 1.32rem; letter-spacing: -0.01em; }
.pd-brandrow .pd-by { color: var(--muted); font-size: 0.82rem; }
.pd-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.pd-hero .pd-lede {
  margin-top: 18px;
  max-width: 60ch;
  color: var(--text-dim);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
}
.pd-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.pd-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--p-accent-2);
  padding: 6px 14px;
  border: 1px solid var(--p-line);
  border-radius: 999px;
  background: var(--p-soft);
}
.pd-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--p-accent); box-shadow: 0 0 12px var(--p-glow); }

/* Themed buttons (accent) reusing global .btn sizing */
.btn-accent {
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  color: #fff;
  box-shadow: 0 16px 40px -16px var(--p-glow);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 22px 60px -16px var(--p-glow); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--p-accent); color: #fff; transform: translateY(-2px); }

/* ---------- App window frame (browser chrome) ---------- */
.pd-app {
  position: relative;
  margin-top: 34px;
  border: 1px solid var(--p-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #0d0d15 0%, #0a0a11 100%);
  box-shadow:
    0 60px 140px -50px rgba(0, 0, 0, 0.95),
    0 0 70px -28px var(--p-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.pd-app::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--p-accent), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.45;
  pointer-events: none;
}
.pd-appbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--p-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}
.pd-dots { display: flex; gap: 7px; }
.pd-dots i { width: 11px; height: 11px; border-radius: 50%; background: #2b2b38; display: block; }
.pd-dots i:nth-child(1) { background: #ff5f57; }
.pd-dots i:nth-child(2) { background: #febc2e; }
.pd-dots i:nth-child(3) { background: #28c840; }
.pd-url {
  flex: 1;
  max-width: 360px;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--p-line);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pd-url svg { width: 13px; height: 13px; color: var(--ok); }
.pd-appnav { margin-left: auto; display: flex; gap: 18px; }
.pd-appnav a, .pd-appnav span { font-size: 0.82rem; color: var(--muted); }
.pd-appnav .on { color: var(--text); }

.pd-appbody { padding: clamp(16px, 2.4vw, 26px); }
.pd-appbody-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pd-appbody-head h2 { font-size: 1.25rem; letter-spacing: -0.01em; }
.pd-appbody-head p { color: var(--muted); font-size: 0.88rem; margin-top: 3px; }

/* ---------- Segmented control ---------- */
.pd-seg {
  display: inline-flex;
  padding: 4px;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--p-line);
  border-radius: 11px;
}
.pd-seg button {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.pd-seg button:hover { color: var(--text); }
.pd-seg button.on {
  color: #fff;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  box-shadow: 0 8px 20px -8px var(--p-glow);
}

/* ---------- KPI grid ---------- */
.pd-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.pd-kpi {
  position: relative;
  padding: 18px;
  border: 1px solid var(--p-line);
  border-radius: 14px;
  background: var(--p-card);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.pd-kpi:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--p-card-2);
}
.pd-kpi::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--p-accent), var(--p-accent-2));
  opacity: 0.85;
}
.pd-kpi .k-label { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }
.pd-kpi .k-val { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; line-height: 1; }
.pd-kpi .k-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; margin-top: 9px; }
.pd-kpi .k-delta svg { width: 13px; height: 13px; }
.k-up { color: var(--ok); }
.k-down { color: var(--down); }
.k-up.k-inv { color: var(--down); }   /* "up" that's actually bad (e.g., churn) */
.k-down.k-inv { color: var(--ok); }

/* ---------- Panels / layout ---------- */
.pd-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.pd-cols.even { grid-template-columns: 1fr 1fr; }
.pd-panel {
  border: 1px solid var(--p-line);
  border-radius: 14px;
  background: var(--p-card);
  padding: 18px 20px;
}
.pd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.pd-panel-head h3 { font-size: 0.98rem; }
.pd-panel-head .pd-tag { font-size: 0.74rem; color: var(--muted); }

/* ---------- Funnel ---------- */
.pd-funnel { display: flex; flex-direction: column; gap: 12px; }
.pd-step { position: relative; }
.pd-step .s-top { display: flex; justify-content: space-between; font-size: 0.84rem; margin-bottom: 6px; }
.pd-step .s-top b { font-weight: 600; }
.pd-step .s-top span { color: var(--muted); }
.pd-bar {
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.pd-bar i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 9px;
  background: linear-gradient(90deg, var(--p-accent), var(--p-accent-2));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.pd-drop {
  font-size: 0.74rem;
  color: var(--down);
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pd-drop svg { width: 12px; height: 12px; }

/* ---------- A/B variants ---------- */
.pd-ab { display: grid; gap: 12px; }
.pd-variant {
  position: relative;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--p-card-2);
}
.pd-variant.win { border-color: var(--p-accent); box-shadow: 0 0 0 1px var(--p-accent) inset, 0 12px 30px -16px var(--p-glow); }
.pd-variant .v-head { display: flex; justify-content: space-between; align-items: center; }
.pd-variant .v-name { font-weight: 600; font-size: 0.9rem; }
.pd-variant .v-conv { font-size: 1.5rem; font-weight: 700; margin-top: 8px; }
.pd-variant .v-meter { height: 7px; border-radius: 5px; background: rgba(255,255,255,0.07); margin-top: 10px; overflow: hidden; }
.pd-variant .v-meter i { display: block; height: 100%; width: var(--w,0%); background: linear-gradient(90deg,var(--p-accent),var(--p-accent-2)); border-radius: 5px; transition: width 1s ease; }
.pd-win-badge {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #04120c; background: var(--ok); padding: 3px 8px; border-radius: 999px;
}

/* ---------- AI recommendations / insight ---------- */
.pd-recs { display: flex; flex-direction: column; gap: 10px; }
.pd-rec {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-card-2);
  transition: border-color 0.2s, opacity 0.2s;
}
.pd-rec .r-ico {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--p-soft); color: var(--p-accent-2);
}
.pd-rec .r-ico svg { width: 18px; height: 18px; }
.pd-rec .r-body { flex: 1; min-width: 0; }
.pd-rec .r-body b { font-size: 0.9rem; font-weight: 600; }
.pd-rec .r-body span { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.pd-rec .r-lift { font-size: 0.82rem; font-weight: 700; color: var(--ok); white-space: nowrap; }
.pd-rec.applied { border-color: var(--ok); }
.pd-rec.applied .r-apply { background: var(--ok); color: #04120c; border-color: var(--ok); }

.r-apply {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--p-line);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 7px 13px; border-radius: 9px;
  transition: all 0.2s;
  white-space: nowrap;
}
.r-apply:hover { border-color: var(--p-accent); }

.pd-ai-card {
  border: 1px solid var(--p-line);
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--p-soft), transparent 60%),
    var(--p-card);
  padding: 18px 20px;
}
.pd-ai-card .ai-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.pd-ai-card .ai-top .ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--p-accent-2);
}
.pd-ai-card .ai-top .ai-badge svg { width: 15px; height: 15px; }
.pd-ai-card .ai-narrative { font-size: 0.95rem; line-height: 1.6; color: var(--text-dim); }
.pd-ai-card .ai-narrative strong { color: var(--text); font-weight: 600; }
.pd-ai-foot { margin-top: 14px; display: flex; gap: 10px; align-items: center; }
.pd-ai-foot .ai-regen {
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--p-accent-2); background: var(--p-soft);
  border: 1px solid var(--p-line); border-radius: 9px; padding: 7px 12px;
}
.pd-ai-foot .ai-regen svg { width: 14px; height: 14px; }

/* ---------- Charts (SVG) ---------- */
.pd-chart { width: 100%; height: auto; display: block; }
.pd-chart .area { fill: var(--p-soft); transition: d 0.6s ease; }
.pd-chart .line { fill: none; stroke: var(--p-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pd-chart .grid { stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.pd-chart .dot { fill: var(--p-accent-2); }
.pd-chart-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.pd-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* Mini bar groups (cohort/support) */
.pd-bars { display: flex; align-items: stretch; gap: 8px; height: 150px; }
.pd-bars .b { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; text-align: center; }
.pd-bars .b > i {
  display: block; width: 100%;
  height: var(--h, 20%);
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--p-accent), var(--p-accent-2));
  transition: height 0.9s cubic-bezier(0.22,1,0.36,1);
}
.pd-bars .b small { font-size: 0.7rem; color: var(--muted); }

/* ---------- Takeaways ---------- */
.pd-takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pd-take {
  border: 1px solid var(--p-line);
  border-radius: 14px;
  padding: 22px;
  background: var(--p-card);
}
.pd-take .t-num { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; }
.pd-take .t-num.grad { background: linear-gradient(120deg,var(--p-accent),var(--p-accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pd-take p { margin-top: 8px; color: var(--text-dim); font-size: 0.93rem; }

/* ---------- Feature row ---------- */
.pd-features { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.pd-feature { border: 1px solid var(--p-line); border-radius: 14px; padding: 22px; background: var(--p-card); }
.pd-feature .f-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--p-soft); color: var(--p-accent-2); margin-bottom: 14px; }
.pd-feature .f-ico svg { width: 22px; height: 22px; }
.pd-feature h3 { font-size: 1.04rem; }
.pd-feature p { margin-top: 8px; color: var(--text-dim); font-size: 0.92rem; }

/* ---------- CTA band ---------- */
.pd-cta {
  position: relative;
  text-align: center;
  border: 1px solid var(--p-line);
  border-radius: 24px;
  padding: clamp(34px, 5vw, 64px);
  overflow: hidden;
  background:
    radial-gradient(80% 120% at 50% 0%, var(--p-soft), transparent 65%),
    linear-gradient(180deg, #0e0e17, #0a0a11);
}
.pd-cta h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.02em; }
.pd-cta p { margin: 14px auto 0; max-width: 56ch; color: var(--text-dim); }
.pd-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }
.pd-note { margin-top: 16px; font-size: 0.82rem; color: var(--muted); }

/* ---------- Walkthrough note ---------- */
.pd-live-flag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.74rem; color: var(--muted);
  border: 1px dashed var(--p-line); border-radius: 999px;
  padding: 5px 13px; margin-top: 16px;
}
.pd-live-flag svg { width: 13px; height: 13px; }

/* ---------- Integrations strip ---------- */
.pd-integrations { text-align: center; }
.pd-int-label { font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.pd-int-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; }
.pd-int {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.86rem; font-weight: 600; color: var(--text-dim);
  border: 1px solid var(--p-line); border-radius: 999px;
  padding: 8px 16px; background: var(--p-card);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.pd-int:hover { border-color: var(--p-accent); color: #fff; transform: translateY(-2px); }
.pd-int svg { width: 15px; height: 15px; color: var(--p-accent-2); }

/* ---------- Proof / stat band ---------- */
.pd-proof {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  border: 1px solid var(--p-line); border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.008));
}
.pd-proof .p-item { padding: 26px 20px; text-align: center; border-right: 1px solid var(--p-line); }
.pd-proof .p-item:last-child { border-right: 0; }
.pd-proof .p-num {
  font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--p-accent), var(--p-accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pd-proof .p-lbl { margin-top: 6px; font-size: 0.84rem; color: var(--muted); }

/* ---------- Split: copy + visual ---------- */
.pd-split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.pd-split + .pd-split { margin-top: clamp(48px, 7vw, 96px); }
.pd-split.reverse .pd-split-copy { order: 2; }
.pd-split-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-accent-2); margin-bottom: 14px;
}
.pd-split-copy h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.12; }
.pd-split-copy > p { margin-top: 14px; color: var(--text-dim); font-size: 1.02rem; max-width: 52ch; }
.pd-check { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.pd-check li { display: flex; gap: 11px; align-items: flex-start; font-size: 0.95rem; color: var(--text-dim); }
.pd-check li svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--p-accent-2); margin-top: 1px; }
.pd-check li b { color: var(--text); font-weight: 600; }

/* Visual frame used in split sections */
.pd-visual {
  position: relative; border: 1px solid var(--p-line); border-radius: 18px;
  padding: 20px; background: linear-gradient(180deg, #0e0e18, #0a0a11);
  box-shadow: 0 40px 100px -50px rgba(0,0,0,0.9), 0 0 60px -30px var(--p-glow);
  overflow: hidden;
}
.pd-visual::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: radial-gradient(60% 50% at 80% 0%, var(--p-soft), transparent 70%);
}
.pd-visual-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; position: relative; }
.pd-visual-head b { font-size: 0.9rem; }
.pd-visual-head span { font-size: 0.74rem; color: var(--muted); }

/* Generic mini rows / list visual */
.pd-rowlist { display: grid; gap: 10px; position: relative; }
.pd-rowlist .row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-card);
}
.pd-rowlist .row .ic {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--p-soft); color: var(--p-accent-2);
}
.pd-rowlist .row .ic svg { width: 16px; height: 16px; }
.pd-rowlist .row .tx { flex: 1; min-width: 0; }
.pd-rowlist .row .tx b { display: block; font-size: 0.88rem; }
.pd-rowlist .row .tx span { font-size: 0.76rem; color: var(--muted); }
.pd-rowlist .row .val { font-size: 0.86rem; font-weight: 700; color: var(--p-accent-2); font-variant-numeric: tabular-nums; }

/* Cohort heatmap visual */
.pd-cohort { display: grid; gap: 9px; position: relative; }
.pd-cohort-row { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.pd-cohort-row .cl { width: 38px; flex-shrink: 0; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pd-cohort-row i {
  height: 26px; border-radius: 6px; flex: 0 0 auto;
  background: linear-gradient(90deg, var(--p-accent), var(--p-accent-2));
  width: calc(var(--w) * 0.42);
}
.pd-cohort-row i:nth-child(2) { opacity: 1; }
.pd-cohort-row i:nth-child(3) { opacity: 0.66; }
.pd-cohort-row i:nth-child(4) { opacity: 0.4; }
.pd-cohort-key { display: flex; justify-content: flex-end; gap: 18px; margin-top: 12px; padding-left: 44px; }
.pd-cohort-key span { font-size: 0.72rem; color: var(--muted); }

/* Floating animation for visuals */
.pd-float { animation: pdFloat 6s ease-in-out infinite; }
@keyframes pdFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Personas / who it's for ---------- */
.pd-personas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pd-persona {
  border: 1px solid var(--p-line); border-radius: 16px; padding: 24px;
  background: var(--p-card); transition: transform 0.25s ease, border-color 0.25s ease;
}
.pd-persona:hover { transform: translateY(-4px); border-color: var(--p-accent); }
.pd-persona .pe-ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2)); color: #fff;
  box-shadow: 0 12px 28px -12px var(--p-glow);
}
.pd-persona .pe-ic svg { width: 23px; height: 23px; }
.pd-persona h3 { font-size: 1.06rem; }
.pd-persona p { margin-top: 9px; color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; }

/* ---------- Section heading helper inside pdx ---------- */
.pdx .pd-sec-head { max-width: 640px; }
.pdx .pd-sec-head.center { margin-inline: auto; text-align: center; }
.pdx .pd-sec-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: -0.02em; margin-top: 16px; line-height: 1.1; }
.pdx .pd-sec-head > p { margin-top: 14px; color: var(--text-dim); font-size: 1.02rem; }

/* ---------- FAQ themed (reuses .faq from styles.css) ---------- */
.pdx .faq-item { background: var(--p-card); border-color: var(--p-line); }
.pdx .faq-q .pm { color: var(--p-accent-2); }
.pdx .faq-item.open { border-color: var(--p-accent); }

/* ---------- Themed quote ---------- */
.pd-quote {
  position: relative; border: 1px solid var(--p-line); border-radius: 20px;
  padding: clamp(28px, 4vw, 48px); max-width: 860px; margin-inline: auto;
  background: radial-gradient(90% 130% at 0% 0%, var(--p-soft), transparent 60%), var(--p-card);
}
.pd-quote .q-mark { font-size: 3.2rem; line-height: 0.6; color: var(--p-accent); font-weight: 800; }
.pd-quote blockquote { margin: 12px 0 0; font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.5; color: var(--text); letter-spacing: -0.01em; }
.pd-quote .q-author { display: flex; align-items: center; gap: 13px; margin-top: 22px; }
.pd-quote .q-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2)); }
.pd-quote .q-author b { display: block; font-size: 0.95rem; }
.pd-quote .q-author span { font-size: 0.82rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .pd-cols, .pd-cols.even { grid-template-columns: 1fr; }
  .pd-kpis { grid-template-columns: repeat(2, 1fr); }
  .pd-takeaways, .pd-features, .pd-personas { grid-template-columns: 1fr; }
  .pd-appnav { display: none; }
  .pd-proof { grid-template-columns: 1fr 1fr; }
  .pd-proof .p-item:nth-child(2) { border-right: 0; }
  .pd-split { grid-template-columns: 1fr; }
  .pd-split.reverse .pd-split-copy { order: 0; }
}
@media (max-width: 520px) {
  .pd-kpis { grid-template-columns: 1fr 1fr; }
  .pd-kpi .k-val { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-float { animation: none; }
}

/* =========================================================
   Polish layer
   ========================================================= */

/* Steady numerals so animated counters never shift width */
.pd-kpi .k-val, .pd-variant .v-conv, .pd-take .t-num, .pd-tag b,
.pd-step .s-top span, .pd-rec .r-lift, .pd-chart-endlbl {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Hero depth: faint dotted field fading toward the headline */
.pd-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask: radial-gradient(72% 60% at 50% 26%, #000 0%, transparent 72%);
  mask: radial-gradient(72% 60% at 50% 26%, #000 0%, transparent 72%);
  opacity: 0.6;
  pointer-events: none;
}

/* Panels react to hover */
.pd-panel, .pd-ai-card { transition: border-color 0.25s ease, transform 0.25s ease; }
.pd-panel:hover { border-color: var(--border-strong); }

/* Funnel bars get a soft top gloss + load shimmer */
.pd-bar i { position: relative; }
.pd-bar i::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 48%);
}
.pd-bar i::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-120%);
  animation: pdSheen 4.5s ease-in-out 0.6s infinite;
}

/* Winner variant breathes */
.pd-variant.win { animation: pdWin 3.4s ease-in-out infinite; }
@keyframes pdWin {
  0%, 100% { box-shadow: 0 0 0 1px var(--p-accent) inset, 0 12px 30px -18px var(--p-glow); }
  50% { box-shadow: 0 0 0 1px var(--p-accent) inset, 0 16px 46px -14px var(--p-glow); }
}
@keyframes pdSheen {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(360%); }
}

/* AI card: gentle diagonal sheen + live dot */
.pd-ai-card { position: relative; overflow: hidden; }
.pd-ai-card::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -40%;
  width: 35%;
  height: 140%;
  background: linear-gradient(75deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: skewX(-12deg);
  animation: aiSheen 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes aiSheen {
  0%, 62% { transform: translateX(0) skewX(-12deg); }
  100% { transform: translateX(560%) skewX(-12deg); }
}
.pd-live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 7px;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pdPulse 2.4s ease-out infinite;
}
@keyframes pdPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Recommendations nudge on hover */
.pd-rec { transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, background 0.2s ease; }
.pd-rec:hover { transform: translateX(3px); border-color: var(--border-strong); }

/* Richer chart: gradient area fill + glowing endpoint */
.pd-chart .area { fill: url(#pdArea); transition: none; }
.pd-chart .dot.end {
  fill: var(--p-accent-2);
  stroke: #0a0a11;
  stroke-width: 3;
  filter: drop-shadow(0 0 7px var(--p-glow));
}
.pd-chart .dot.end-halo { fill: var(--p-accent); opacity: 0.25; animation: pdDot 2.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pdDot {
  0% { transform: scale(0.8); opacity: 0.35; }
  70% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}
.pd-chart-endlbl { fill: var(--text); font-size: 13px; font-weight: 700; }

/* Feature + takeaway cards lift */
.pd-take, .pd-feature { transition: transform 0.25s ease, border-color 0.25s ease; }
.pd-take:hover, .pd-feature:hover { transform: translateY(-4px); border-color: var(--border-strong); }

/* Accessible focus states */
.pd-seg button:focus-visible,
.r-apply:focus-visible,
.ai-regen:focus-visible,
.pdx .btn:focus-visible,
.pdx a:focus-visible {
  outline: 2px solid var(--p-accent);
  outline-offset: 3px;
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .pd-bar i, .pd-variant .v-meter i, .pd-bars .b > i { transition: none; }
  .pd-bar i::after, .pd-variant.win, .pd-ai-card::after, .pd-live,
  .pd-chart .dot.end-halo { animation: none; }
}

/* =========================================================
   Sentinel, AI QA Test Runner
   ========================================================= */
.sn-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sn-toolbar .btn-sm { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; font-size: 0.86rem; }
.sn-toolbar .btn-sm svg { width: 14px; height: 14px; }
.sn-muted { font-size: 0.78rem; color: var(--muted); }

.sn-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
.sn-tests-wrap { min-width: 0; }
.sn-filter {
  display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.sn-filter button {
  font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid var(--p-line); padding: 6px 12px;
  border-radius: 9px; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.sn-filter button.on { color: #fff; border-color: var(--p-accent); background: var(--p-soft); }
.sn-filter button span {
  display: inline-block; margin-left: 5px; font-size: 0.68rem; padding: 1px 6px;
  border-radius: 999px; background: rgba(255,255,255,0.08);
}
.sn-filter button.on span { background: var(--p-accent); color: #fff; }

.sn-suite { margin-bottom: 14px; }
.sn-suite-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 8px; font-size: 0.76rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.sn-suite-head b { color: var(--text-dim); font-weight: 700; }

.sn-test {
  display: flex; align-items: center; gap: 11px; width: 100%;
  text-align: left; font: inherit; cursor: pointer;
  border: 1px solid var(--p-line); border-radius: 12px;
  padding: 11px 13px; margin-bottom: 7px;
  background: var(--p-card); color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.sn-test:last-child { margin-bottom: 0; }
.sn-test:hover { border-color: var(--border-strong); transform: translateX(2px); }
.sn-test.selected { border-color: var(--p-accent); background: var(--p-soft); box-shadow: 0 0 0 1px var(--p-soft); }
.sn-test.is-running { opacity: 0.65; pointer-events: none; }

.sn-st {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
}
.sn-st svg { width: 14px; height: 14px; }
.sn-pass { background: rgba(52,211,153,0.16); color: var(--ok); }
.sn-fail { background: rgba(251,113,133,0.16); color: var(--down); }
.sn-pending { background: rgba(255,255,255,0.06); color: var(--muted); }

.sn-test-body { flex: 1; min-width: 0; }
.sn-test-body b { display: block; font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.sn-test-meta { font-size: 0.72rem; color: var(--muted); }
.sn-fix-pill {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--down); background: rgba(251,113,133,0.12); border: 1px solid rgba(251,113,133,0.28);
  border-radius: 6px; padding: 3px 8px; flex-shrink: 0;
}

/* Side panel: phone preview + fix */
.sn-side { display: flex; flex-direction: column; gap: 14px; }
.sn-phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sn-device-lbl { font-size: 0.72rem; color: var(--muted); text-align: center; }

.sn-phone {
  position: relative; width: 168px;
  border: 3px solid #2a2a38; border-radius: 28px;
  background: #0a0a10; padding: 10px 8px 12px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.8), 0 0 40px -16px var(--p-glow);
}
.sn-phone.sn-dev-pro { width: 178px; border-radius: 32px; }
.sn-phone.sn-dev-ipad { width: 210px; border-radius: 22px; padding: 12px 10px 14px; }
.sn-phone-notch {
  width: 56px; height: 5px; border-radius: 999px; background: #2a2a38;
  margin: 0 auto 8px;
}
.sn-phone.sn-dev-ipad .sn-phone-notch { display: none; }

.sn-phone-screen {
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #12121c, #0d0d14);
  border: 1px solid rgba(255,255,255,0.06);
  min-height: 280px;
}
.sn-phone.sn-dev-ipad .sn-phone-screen { min-height: 260px; border-radius: 14px; }

.sn-scr-bar {
  display: flex; align-items: center; gap: 4px; padding: 8px 10px 6px;
  font-size: 0.55rem; color: var(--muted);
}
.sn-scr-bar i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: 0.5; }
.sn-scr-bar span { margin-left: auto; font-weight: 600; }
.sn-scr-body { padding: 8px 12px 14px; }
.sn-scr-title { font-size: 0.72rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.sn-scr-field { height: 22px; border-radius: 6px; background: rgba(255,255,255,0.06); margin-bottom: 7px; border: 1px solid var(--p-line); }
.sn-scr-field.short { width: 65%; }
.sn-scr-btn {
  margin-top: 14px; padding: 9px; border-radius: 9px; text-align: center;
  font-size: 0.62rem; font-weight: 700;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2)); color: #fff;
}
.sn-scr-row { display: flex; justify-content: space-between; font-size: 0.58rem; color: var(--text-dim); margin-bottom: 6px; }
.sn-scr-row b { color: var(--text); }
.sn-scr-plan {
  padding: 8px; border-radius: 8px; font-size: 0.6rem; font-weight: 600;
  border: 1px solid var(--p-line); margin-bottom: 6px; color: var(--text-dim);
}
.sn-scr-plan:first-of-type { border-color: var(--p-accent); color: var(--text); background: var(--p-soft); }
.sn-scr-link { font-size: 0.55rem; color: var(--muted); text-align: center; margin-top: 8px; }
.sn-scr-note { font-size: 0.55rem; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.sn-scr-chart { display: flex; align-items: flex-end; gap: 5px; height: 80px; margin-top: 12px; }
.sn-scr-chart i {
  flex: 1; height: var(--h); border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--p-accent-2), var(--p-accent)); opacity: 0.7;
}

.sn-hotspot { position: relative; transition: box-shadow 0.3s; }
.sn-hotspot.on {
  box-shadow: 0 0 0 2px var(--down), 0 0 16px rgba(251,113,133,0.45);
  animation: snHotspot 1.6s ease-in-out infinite;
}
@keyframes snHotspot {
  0%, 100% { box-shadow: 0 0 0 2px var(--down), 0 0 12px rgba(251,113,133,0.35); }
  50% { box-shadow: 0 0 0 3px var(--down), 0 0 22px rgba(251,113,133,0.55); }
}
.sn-phone-glow {
  position: absolute; inset: -8px; border-radius: 34px; pointer-events: none; opacity: 0;
  border: 2px solid var(--down); transition: opacity 0.3s;
}
.sn-phone-glow.on { opacity: 1; animation: snGlow 2s ease-in-out infinite; }
@keyframes snGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.sn-fix-panel .pd-panel-head { margin-bottom: 10px; }
.sn-fix-issue { font-size: 0.86rem; color: var(--text-dim); line-height: 1.55; margin: 0 0 12px; }
.sn-fix-code {
  font-size: 0.76rem; line-height: 1.55; color: var(--muted);
  background: rgba(0,0,0,0.35); border: 1px solid var(--p-line);
  border-radius: 10px; padding: 12px; margin-bottom: 14px;
  white-space: pre-wrap; word-break: break-word;
}
.sn-fix-hint { font-size: 0.84rem; color: var(--muted); line-height: 1.55; margin: 0; }
.sn-apply-fix { width: 100%; justify-content: center; }

@media (max-width: 980px) {
  .sn-layout { grid-template-columns: 1fr; }
  .sn-side { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .sn-phone-wrap { flex: 0 0 auto; }
  .sn-fix-panel, .sn-fix-empty { flex: 1; min-width: 240px; }
}
@media (max-width: 560px) {
  .sn-side { flex-direction: column; align-items: stretch; }
  .sn-toolbar { width: 100%; }
  .sn-toolbar .pd-seg { flex: 1; }
  .sn-toolbar .pd-seg button { flex: 1; padding: 7px 6px; font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sn-hotspot.on, .sn-phone-glow.on { animation: none; }
}

/* =========================================================
   Prism Studio (working content repurposing app)
   ========================================================= */
.ps-page { min-height: 100vh; background: #0a0a10; }
.ps-page .site-header { border-bottom: 1px solid var(--border); }
/* Ensure the hidden attribute always wins over explicit display values */
.ps-page [hidden] { display: none !important; }
.ps-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 20px) 24px 40px;
}
.ps-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ps-topbar-left { display: flex; align-items: center; gap: 12px; }
.ps-topbar-left b { font-size: 1.08rem; }
.ps-topbar-left span { font-size: 0.82rem; color: var(--muted); }
.ps-logo-sm {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  box-shadow: 0 10px 24px -10px var(--p-glow);
}
.ps-logo-sm svg { width: 20px; height: 20px; }
.ps-topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ps-topbar-actions .btn-sm { padding: 9px 16px; font-size: 0.88rem; }

.ps-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-height: calc(100vh - var(--header-h) - 120px);
}
.ps-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--p-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #0d0d15, #0a0a11);
  overflow: hidden;
  min-height: 520px;
}
.ps-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--p-line);
  background: rgba(255, 255, 255, 0.02);
}
.ps-pane-head h2 { font-size: 0.98rem; }
.ps-pane-head .ps-meta { font-size: 0.78rem; color: var(--muted); }

.ps-mode { display: inline-flex; padding: 3px; gap: 3px; background: rgba(255,255,255,0.04); border: 1px solid var(--p-line); border-radius: 10px; }
.ps-mode button {
  font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; padding: 7px 12px; border-radius: 8px; cursor: pointer;
}
.ps-mode button.on { color: #fff; background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2)); }

.ps-pane-body { flex: 1; display: flex; flex-direction: column; padding: 16px 18px 18px; min-height: 0; }
.ps-view { display: none; flex: 1; flex-direction: column; min-height: 0; }
.ps-view.on { display: flex; }

.ps-field { margin-bottom: 12px; }
.ps-field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.ps-input, .ps-textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--p-line);
  border-radius: 12px;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ps-input:focus, .ps-textarea:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--p-soft);
}
.ps-textarea { flex: 1; min-height: 280px; line-height: 1.65; }
.ps-textarea.ps-lg { min-height: 340px; }

.ps-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--p-line);
}
.ps-wordcount { font-size: 0.78rem; color: var(--muted); }

.ps-empty {
  flex: 1; display: grid; place-content: center; text-align: center;
  padding: 40px 24px; color: var(--muted);
}
.ps-empty svg { width: 48px; height: 48px; margin: 0 auto 14px; opacity: 0.45; }
.ps-empty p { max-width: 28ch; margin: 0 auto; font-size: 0.92rem; line-height: 1.5; }

.ps-out-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 12px; border-bottom: 1px solid var(--p-line); }
.ps-out-tabs button {
  font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid transparent; padding: 7px 13px; border-radius: 9px; cursor: pointer;
}
.ps-out-tabs button.on { color: #fff; border-color: var(--p-line); background: var(--p-soft); }
.ps-out-tabs button .ps-badge {
  display: inline-block; margin-left: 5px; font-size: 0.68rem; padding: 1px 6px;
  border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--muted);
}
.ps-out-tabs button.on .ps-badge { background: var(--p-accent); color: #fff; }

.ps-out-body { flex: 1; overflow-y: auto; padding: 16px 18px 18px; min-height: 0; }
.ps-out-panel { display: none; }
.ps-out-panel.on { display: block; }

.ps-card {
  position: relative;
  border: 1px solid var(--p-line);
  border-radius: 13px;
  padding: 16px;
  background: var(--p-card);
  margin-bottom: 12px;
}
.ps-card:last-child { margin-bottom: 0; }
.ps-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ps-card-head b { font-size: 0.84rem; color: var(--p-accent-2); letter-spacing: 0.02em; }
.ps-card-head span { font-size: 0.72rem; color: var(--muted); }
.ps-card pre, .ps-card .ps-copytext {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 0.92rem; line-height: 1.6; color: var(--text-dim);
  margin: 0;
}
.ps-copy {
  font: inherit; font-size: 0.74rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text); background: rgba(255,255,255,0.06);
  border: 1px solid var(--p-line); border-radius: 8px; padding: 5px 10px;
  transition: border-color 0.2s, background 0.2s;
}
.ps-copy:hover { border-color: var(--p-accent); }
.ps-copy.done { color: var(--ok); border-color: var(--ok); }

.ps-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 11px 18px; border-radius: 11px; font-size: 0.88rem; font-weight: 600;
  background: #14141f; border: 1px solid var(--border-strong); color: var(--text);
  box-shadow: var(--shadow); z-index: 200; opacity: 0; transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}
.ps-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.ps-loading { opacity: 0.55; pointer-events: none; }
.ps-spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff;
  border-radius: 50%; animation: psSpin 0.7s linear infinite; vertical-align: -2px; margin-right: 6px;
}
@keyframes psSpin { to { transform: rotate(360deg); } }

/* Showcase: prism beam split visual */
.ps-beam {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 24px 20px 28px;
}
.ps-beam-src {
  border: 1px solid var(--p-line);
  border-radius: 12px;
  padding: 16px;
  background: var(--p-card);
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.ps-beam-src b { display: block; color: var(--text); font-size: 0.78rem; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.ps-beam-mid {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  box-shadow: 0 0 30px var(--p-glow);
  color: #fff;
}
.ps-beam-mid::before {
  content: "";
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 var(--p-glow);
  animation: beamPulse 2.8s ease-out infinite;
}
@keyframes beamPulse {
  0% { box-shadow: 0 0 0 0 var(--p-glow); }
  70% { box-shadow: 0 0 0 16px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
.ps-beam-mid svg { width: 22px; height: 22px; }
.ps-beam-outs { display: grid; gap: 8px; }
.ps-beam-out {
  border: 1px solid var(--p-line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--p-card-2);
  transition: border-color 0.25s ease, transform 0.25s ease;
  animation: beamOutIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: calc(var(--bi, 0) * 120ms + 0.2s);
}
.ps-beam-out:hover { border-color: var(--p-accent); transform: translateX(3px); }
.ps-beam-out strong { display: block; color: var(--p-accent-2); font-size: 0.72rem; margin-bottom: 3px; }
@keyframes beamOutIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ps-beam-mid::before { animation: none; }
  .ps-beam-out { animation: none; }
}

/* Tone selector in output header */
.ps-tone-wrap { display: flex; align-items: center; gap: 9px; }
.ps-tone-label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.ps-tone button { padding: 6px 11px; font-size: 0.78rem; }

/* Output action bar (copy tab / export) */
.ps-out-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid var(--p-line);
  background: rgba(255, 255, 255, 0.015);
}
.ps-out-bar-info { font-size: 0.78rem; color: var(--muted); }
.ps-out-bar-actions { display: flex; gap: 8px; }
.ps-out-bar .ps-copy svg { width: 13px; height: 13px; }

/* Card title row with platform icon + char counter */
.ps-card-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ps-card-ico { width: 16px; height: 16px; color: var(--p-accent-2); flex-shrink: 0; }
.ps-card-head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ps-chars {
  font-size: 0.72rem; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ps-chars.near { color: #fbbf24; }
.ps-chars.over { color: var(--down); font-weight: 700; }

/* Staggered card entrance */
.ps-out-panel.on .ps-card {
  animation: psCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes psCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Loading skeleton */
.ps-skeleton { padding: 16px 18px; }
.ps-sk-card {
  border: 1px solid var(--p-line); border-radius: 13px;
  padding: 16px; margin-bottom: 12px; background: var(--p-card);
}
.ps-sk-line {
  display: block; height: 11px; border-radius: 6px; margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 37%, rgba(255,255,255,0.05) 63%);
  background-size: 400% 100%;
  animation: psShimmer 1.3s ease-in-out infinite;
}
.ps-sk-line:last-child { margin-bottom: 0; }
.ps-sk-line.w40 { width: 40%; } .ps-sk-line.w60 { width: 60%; }
.ps-sk-line.w70 { width: 70%; } .ps-sk-line.w80 { width: 80%; } .ps-sk-line.w90 { width: 90%; }
@keyframes psShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Keyboard hint + empty hint + kbd chips */
.ps-kbd-hint { font-size: 0.76rem; color: var(--muted); }
.ps-empty-hint { display: block; margin-top: 14px; font-size: 0.78rem; color: var(--muted); opacity: 0.8; }
kbd {
  font-family: inherit; font-size: 0.72rem; font-weight: 600;
  background: rgba(255,255,255,0.08); border: 1px solid var(--p-line);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text-dim);
}

@media (max-width: 980px) {
  .ps-layout { grid-template-columns: 1fr; min-height: auto; }
  .ps-pane { min-height: 420px; }
  .ps-beam { grid-template-columns: 1fr; }
  .ps-beam-mid { margin: 0 auto; transform: rotate(90deg); }
  .ps-pane-head { align-items: flex-start; }
}
@media (max-width: 560px) {
  .ps-kbd-hint { display: none; }
  .ps-out-bar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .ps-out-panel.on .ps-card { animation: none; }
  .ps-sk-line { animation: none; }
}

/* =========================================================
   KEYMELO — static ASO showcase (no live dashboard)
   ========================================================= */
.km-showcase {
  position: relative;
  margin-top: 34px;
  border: 1px solid var(--p-line);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 100% 0%, var(--p-soft), transparent 55%),
    linear-gradient(180deg, #0e0e18, #0a0a11);
  box-shadow: 0 50px 120px -60px rgba(0,0,0,0.85), 0 0 80px -40px var(--p-glow);
}
.km-showcase-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 22px clamp(18px, 3vw, 28px) 0;
}
.km-kw-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.km-kw-title { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.km-country {
  font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--p-accent-2); border: 1px solid var(--p-line); border-radius: 8px;
  padding: 6px 12px; background: rgba(255,255,255,0.03);
}
.km-scores {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin: 20px clamp(18px, 3vw, 28px) 0;
  border: 1px solid var(--p-line); border-radius: 16px; overflow: hidden;
  background: var(--p-line);
}
.km-score { padding: 18px 16px; background: var(--p-card); text-align: center; }
.km-score .s-lbl { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.km-score .s-val { margin-top: 8px; font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.km-score .s-sub { margin-top: 6px; font-size: 0.78rem; color: var(--text-dim); }
.km-score .s-val.pop { color: #60a5fa; }
.km-score .s-val.diff { color: #fb923c; }
.km-score .s-val.km { color: #34d399; }
.km-apps { padding: 22px clamp(18px, 3vw, 28px) 26px; }
.km-apps-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.km-apps-head b { font-size: 0.92rem; }
.km-apps-head span { font-size: 0.78rem; color: var(--muted); }
.km-app-list { border: 1px solid var(--p-line); border-radius: 14px; overflow: hidden; }
.km-app-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--p-line); background: var(--p-card);
}
.km-app-row:last-child { border-bottom: 0; }
.km-app-row:nth-child(even) { background: rgba(255,255,255,0.015); }
.km-rank { width: 26px; text-align: right; font-size: 0.78rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.km-app-name { flex: 1; min-width: 0; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-app-meta { display: flex; align-items: center; gap: 10px; font-size: 0.76rem; color: var(--muted); flex-shrink: 0; }
.km-app-meta .star { color: #fbbf24; font-weight: 600; }
.km-rank-panel {
  border: 1px solid var(--p-line); border-radius: 18px; padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.008));
}
.km-rank-panel h4 { font-size: 0.92rem; margin-bottom: 14px; }
.km-track { display: grid; gap: 10px; }
.km-track-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-card);
}
.km-track-row b { font-size: 0.86rem; }
.km-track-row small { color: var(--muted); font-size: 0.74rem; }
.km-pill {
  display: inline-flex; align-items: center; gap: 3px; font-size: 0.72rem; font-weight: 700;
  font-variant-numeric: tabular-nums; border-radius: 999px; padding: 4px 9px;
}
.km-pill.up { color: var(--ok); background: rgba(52,211,153,0.12); }
.km-pill.down { color: var(--down); background: rgba(251,113,133,0.12); }
.km-pill.flat { color: var(--muted); background: rgba(255,255,255,0.06); }
.km-spark { width: 72px; height: 28px; flex-shrink: 0; }
.km-spark polyline { fill: none; stroke: var(--p-accent-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.km-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.km-method {
  border: 1px solid var(--p-line); border-radius: 14px; padding: 20px; background: var(--p-card);
}
.km-method h4 { font-size: 0.95rem; }
.km-method p { margin-top: 8px; font-size: 0.88rem; color: var(--text-dim); line-height: 1.55; }
@media (max-width: 760px) {
  .km-scores, .km-method-grid { grid-template-columns: 1fr; }
  .km-track-row { grid-template-columns: 1fr auto; }
  .km-spark { display: none; }
}

/* ---------- Flare iOS app builder ---------- */
.fl-build {
  margin-top: 38px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
}
.fl-console {
  border: 1px solid var(--p-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  padding: 20px;
  min-width: 0;
}
.fl-console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.fl-console-head b { font-size: 0.95rem; }
.fl-console-head span { font-size: 0.74rem; color: var(--muted); }
.fl-prompt {
  width: 100%; min-height: 88px; resize: vertical;
  border: 1px solid var(--p-line); border-radius: 12px;
  background: rgba(0,0,0,0.28); color: var(--text);
  padding: 12px 14px; font: inherit; line-height: 1.55;
}
.fl-prompt::placeholder { color: var(--muted); }
.fl-build-bar { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.fl-build-bar button {
  height: 36px; padding: 0 14px; border-radius: 9px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--p-line); background: rgba(255,255,255,0.04); color: var(--text);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.fl-build-bar button.on, .fl-build-bar button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  color: #fff; box-shadow: 0 12px 28px -14px var(--p-glow);
}
.fl-steps-list { margin-top: 18px; display: grid; gap: 8px; }
.fl-step-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--p-line); border-radius: 11px;
  padding: 10px 12px; font-size: 0.82rem; color: var(--text-dim);
  transition: border-color .2s, background .2s;
}
.fl-step-row.done { color: var(--text); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.06); }
.fl-step-row.active { border-color: var(--p-accent); background: var(--p-soft); color: var(--text); }
.fl-step-row .fl-ic {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.68rem; font-weight: 800;
  background: rgba(255,255,255,0.06); color: var(--muted);
}
.fl-step-row.done .fl-ic { background: rgba(52,211,153,.2); color: var(--ok, #34d399); }
.fl-step-row.active .fl-ic { background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2)); color: #fff; }
.fl-device-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.fl-phone {
  width: clamp(258px, 30vw, 288px);
  border-radius: 46px;
  padding: 12px;
  background: linear-gradient(155deg, #20222b, #0c0d12);
  border: 1px solid var(--p-line);
  box-shadow: 0 50px 100px -50px var(--p-glow), inset 0 0 0 2px rgba(255,255,255,0.04);
  position: relative;
}
.fl-phone::after {
  content: "";
  position: absolute; z-index: 4;
  top: 24px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 24px; border-radius: 999px;
  background: #050609;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.fl-phone-screen {
  border-radius: 34px; overflow: hidden;
  background: linear-gradient(180deg, #0e1017, #090a0f);
  border: 1px solid rgba(255,255,255,0.06);
  height: clamp(520px, 58vw, 568px);
  display: flex; flex-direction: column;
}
/* Flare preview chrome */
.fl-prev-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 40px 16px 12px;
  border-bottom: 1px solid var(--p-line);
  flex-shrink: 0;
}
.fl-prev-bar .fl-prev-title {
  flex: 1; text-align: center; font-size: 0.92rem; font-weight: 800; letter-spacing: -0.01em;
}
.fl-prev-bar svg { width: 18px; height: 18px; display: block; }
.fl-prev-back { color: var(--p-accent-2); }
.fl-prev-gear { color: var(--text-dim); }
/* Generated app card (nested preview) */
.fl-app-frame {
  flex: 1; min-height: 0; margin: 10px 10px 0;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #14161e, #0c0d13);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column;
}
.fl-app-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 2px; font-size: 0.62rem; font-weight: 800; color: var(--text);
  flex-shrink: 0;
}
.fl-app-status .sig { display: inline-flex; gap: 4px; align-items: center; color: var(--text); }
.fl-app-status .sig svg { width: 15px; height: 12px; display: block; }
.fl-scr { display: none; flex-direction: column; flex: 1; min-height: 0; padding: 10px 13px 0; overflow: hidden; }
.fl-scr.on { display: flex; }
.fl-scr-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fl-scr-bar .fl-app-ico {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: #fff;
  background: #0b0c10; overflow: hidden;
}
.fl-scr-bar .fl-app-ico svg { width: 15px; height: 15px; }
.fl-scr-bar .fl-app-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fl-scr-bar b { font-size: 0.84rem; }
.fl-scr-title { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 5px; }
.fl-scr-sub { font-size: 0.7rem; color: var(--muted); margin-bottom: 12px; line-height: 1.45; }
.fl-scr-card {
  border: 1px solid var(--p-line); border-radius: 11px; padding: 10px 11px;
  background: rgba(255,255,255,0.03); margin-bottom: 8px;
}
.fl-scr-card b { display: block; font-size: 0.76rem; margin-bottom: 3px; }
.fl-scr-card span { font-size: 0.68rem; color: var(--muted); line-height: 1.4; }
.fl-scr-nav {
  display: flex; justify-content: space-around; gap: 4px;
  margin-top: auto; padding: 9px 4px; border-top: 1px solid var(--p-line);
}
.fl-scr-nav i { font-style: normal; font-size: 0.58rem; color: var(--muted); text-align: center; }
.fl-scr-nav i.on { color: var(--p-accent-2); font-weight: 800; }
/* Flare edit input */
.fl-edit-bar { display: flex; align-items: center; gap: 8px; padding: 12px; flex-shrink: 0; }
.fl-edit-input {
  flex: 1; height: 38px; display: flex; align-items: center;
  padding: 0 14px; border-radius: 999px; font-size: 0.74rem; color: var(--muted);
  background: rgba(255,255,255,0.05); border: 1px solid var(--p-line);
}
.fl-edit-expand {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  box-shadow: 0 12px 26px -14px var(--p-glow);
}
.fl-edit-expand svg { width: 17px; height: 17px; }
.fl-device-lbl { font-size: 0.72rem; color: var(--muted); }
@media (max-width: 900px) {
  .fl-build { grid-template-columns: 1fr; }
  .fl-device-wrap { order: -1; }
}

/* ---------- Appform iPad showcase ---------- */
.af-showcase {
  margin-top: 38px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
}
.af-ipad {
  position: relative;
  border-radius: 26px;
  padding: 16px;
  background: linear-gradient(155deg, #1b1d24, #0e0f14);
  border: 1px solid var(--p-line);
  box-shadow: 0 40px 90px -50px var(--p-glow), inset 0 0 0 2px rgba(255,255,255,0.03);
}
.af-ipad::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transform: translateY(-50%);
}
.af-screen {
  border-radius: 14px;
  overflow: hidden;
  background: #0b0c10;
  border: 1px solid var(--p-line);
}
.af-scr-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--p-line);
  font-size: 0.74rem;
  color: var(--muted);
}
.af-scr-bar .af-back { color: var(--p-accent-2); font-weight: 600; }
.af-scr-bar .af-sync {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ok, #34d399);
  font-weight: 600;
}
.af-scr-bar .af-sync::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok, #34d399);
  box-shadow: 0 0 8px var(--ok, #34d399);
}
.af-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.af-form-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.af-form-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.af-field { display: flex; flex-direction: column; gap: 6px; }
.af-field label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.af-input {
  height: 34px; border-radius: 9px;
  border: 1px solid var(--p-line);
  background: rgba(255,255,255,0.03);
  display: flex; align-items: center; padding: 0 12px;
  font-size: 0.82rem; color: var(--text);
}
.af-input.filled { border-color: var(--p-accent); color: var(--text); }
.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.af-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.af-check {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; color: var(--text-dim);
  border: 1px solid var(--p-line); border-radius: 8px; padding: 7px 11px;
}
.af-check .bx {
  width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid var(--p-line); display: grid; place-items: center;
}
.af-check.on { color: var(--text); border-color: var(--p-accent); }
.af-check.on .bx { background: var(--p-accent); border-color: var(--p-accent); }
.af-check.on .bx svg { width: 11px; height: 11px; color: #fff; }
.af-sign {
  height: 70px; border-radius: 10px;
  border: 1px dashed var(--p-line);
  background: rgba(255,255,255,0.02);
  display: grid; place-items: center;
  position: relative;
}
.af-sign svg { width: 120px; height: 40px; }
.af-sign svg path { fill: none; stroke: var(--p-accent-2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.af-sign .af-sign-lbl { position: absolute; bottom: 5px; right: 10px; font-size: 0.66rem; color: var(--muted); }
.af-photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.af-photo {
  aspect-ratio: 4/3; border-radius: 9px;
  border: 1px solid var(--p-line);
  background: linear-gradient(135deg, var(--p-soft), transparent);
  display: grid; place-items: center;
}
.af-photo svg { width: 20px; height: 20px; color: var(--p-accent-2); }
.af-photo.add { border-style: dashed; }
.af-submit {
  height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  color: #fff; font-weight: 700; font-size: 0.86rem;
  display: grid; place-items: center;
  box-shadow: 0 16px 36px -16px var(--p-glow);
}
.af-flow { display: flex; flex-direction: column; gap: 12px; }
.af-flow-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--p-line); border-radius: 13px;
  padding: 14px 16px; background: var(--p-card);
}
.af-flow-item .af-fi-ico {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
}
.af-flow-item .af-fi-ico svg { width: 20px; height: 20px; }
.af-flow-item b { font-size: 0.92rem; }
.af-flow-item span { display: block; font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; line-height: 1.45; }
.af-flow-arrow { display: grid; place-items: center; color: var(--muted); }
.af-flow-arrow svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .af-showcase { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .af-row, .af-photo-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Summa bookkeeping dashboard ---------- */
.sm-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; align-items: start; }
.sm-txn-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; padding-right: 4px; }
.sm-txn {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center;
  border: 1px solid var(--p-line); border-radius: 12px; padding: 12px 14px;
  background: rgba(255,255,255,0.02); cursor: pointer; transition: border-color .2s, background .2s;
}
.sm-txn:hover, .sm-txn.on { border-color: var(--p-accent); background: var(--p-soft); }
.sm-txn-ico {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--p-accent), color-mix(in srgb, var(--p-accent-2) 70%, #7c3aed));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.sm-txn-main b { display: block; font-size: 0.9rem; }
.sm-txn-main span { font-size: 0.74rem; color: var(--muted); }
.sm-cat {
  font-size: 0.72rem; font-weight: 600; border-radius: 999px; padding: 4px 10px;
  border: 1px solid var(--p-line); color: var(--text-dim); white-space: nowrap;
}
.sm-cat.ok { color: var(--ok, #34d399); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.sm-cat.review { color: #fbbf24; border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.sm-amt { font-size: 0.92rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-amt.out { color: var(--text); }
.sm-amt.in { color: var(--ok, #34d399); }
.sm-side { display: flex; flex-direction: column; gap: 14px; }
.sm-pack {
  border: 1px solid var(--p-line); border-radius: 14px; padding: 16px;
  background: linear-gradient(180deg, var(--p-soft), transparent);
}
.sm-pack h4 { font-size: 0.95rem; margin-bottom: 10px; }
.sm-pack-list { display: grid; gap: 8px; }
.sm-pack-item {
  display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--text-dim);
}
.sm-pack-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--p-accent-2); }
.sm-pack-item b { color: var(--text); font-weight: 600; }
.sm-pack-btn {
  margin-top: 14px; width: 100%; height: 40px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
  color: #fff; font-weight: 700; font-size: 0.86rem; cursor: pointer;
  box-shadow: 0 14px 32px -14px var(--p-glow);
  transition: transform .2s, box-shadow .2s;
}
.sm-pack-btn:hover { transform: translateY(-1px); }
.sm-receipt {
  border: 1px solid var(--p-line); border-radius: 12px; padding: 12px;
  background: var(--p-card);
}
.sm-receipt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sm-receipt-head b { font-size: 0.84rem; }
.sm-receipt-head span { font-size: 0.72rem; color: var(--muted); }
.sm-receipt p { font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; }
.sm-receipt .sm-match { margin-top: 8px; font-size: 0.72rem; color: var(--ok, #34d399); font-weight: 600; }
.sm-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--p-card); border: 1px solid var(--p-accent); border-radius: 12px;
  padding: 12px 18px; font-size: 0.88rem; color: var(--text);
  box-shadow: 0 20px 50px -20px var(--p-glow); opacity: 0; pointer-events: none;
  transition: transform .35s ease, opacity .35s ease; z-index: 200;
}
.sm-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (max-width: 900px) {
  .sm-layout { grid-template-columns: 1fr; }
  .sm-txn-list { max-height: none; }
}
