/* KitPage editor (/pro/app) + landing (/pro). Raw CSS, not Tailwind-processed. */

@font-face { font-family: "Estedad"; src: url("../fonts/kitpage/estedad-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/kitpage/vazirmatn-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

.kpa {
  --a: #6d5dfc;
  --a2: #22d3ee;
  --ink: #0e1017;
  --ink-2: #3b3f4d;
  --muted: #7b8091;
  --line: #e9e9ef;
  --bg: #f6f6f9;
  --panel: #ffffff;
  --r: 16px;
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 14px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.kpa *, .kpa *::before, .kpa *::after { box-sizing: border-box; }
.kpa button, .kpa input, .kpa textarea, .kpa select { font: inherit; color: inherit; }
.kpa a { color: inherit; }
.kpa svg { flex: none; }
.kpa [hidden] { display: none !important; }

/* ── Boot ── */
.kpa-boot { min-height: 100vh; display: grid; place-items: center; }
.kpa-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--a); animation: kpa-spin .8s linear infinite; }
@keyframes kpa-spin { to { transform: rotate(360deg); } }

/* ── Primitives ── */
.kpa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 900; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--a), color-mix(in oklab, var(--a), #ec4899 35%));
  box-shadow: 0 10px 24px -12px var(--a), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s, filter .2s, box-shadow .2s;
  text-decoration: none; white-space: nowrap;
}
.kpa-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.kpa-btn:active { transform: scale(.98); }
.kpa-btn:disabled { opacity: .55; cursor: default; transform: none; }
.kpa-btn--ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.kpa-btn--ghost:hover { border-color: #d4d4de; filter: none; }
.kpa-btn--dark { background: var(--ink); box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.kpa-btn--sm { height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.kpa-btn--block { width: 100%; }
.kpa-icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s;
}
.kpa-icon-btn:hover { background: #f0f0f5; color: var(--ink); }
.kpa-icon-btn--danger:hover { background: #fef2f2; color: #dc2626; }
.kpa-btn:focus-visible, .kpa-icon-btn:focus-visible, .kpa-tab:focus-visible, .kpa-choice:focus-visible { outline: 3px solid color-mix(in srgb, var(--a) 45%, transparent); outline-offset: 2px; }

.kpa-field { display: flex; flex-direction: column; gap: 6px; }
.kpa-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.kpa-label small { font-weight: 500; color: var(--muted); }
.kpa-input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fbfbfd; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.kpa-input { height: auto; min-height: 92px; padding: 10px 14px; resize: vertical; line-height: 1.8; }
.kpa-input:focus { border-color: var(--a); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 14%, transparent); }
.kpa-input[dir="ltr"] { text-align: left; }
.kpa-prefix { position: relative; }
.kpa-prefix > span {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--muted); direction: ltr; pointer-events: none;
}
.kpa-hint { font-size: 12px; color: var(--muted); min-height: 1.4em; }
.kpa-hint.ok { color: #059669; }
.kpa-hint.bad { color: #dc2626; }
.kpa-err { font-size: 13px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 8px 12px; }
.kpa-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpa-stack { display: flex; flex-direction: column; gap: 14px; }

/* ── Auth screen ── */
.kpa-auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.kpa-auth-art {
  position: relative; overflow: hidden; background: #0a0a12; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 40px;
}
.kpa-auth-art::before, .kpa-auth-art::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .6;
}
.kpa-auth-art::before { width: 520px; height: 520px; background: var(--a); top: -160px; right: -120px; animation: kpa-float 18s ease-in-out infinite alternate; }
.kpa-auth-art::after { width: 420px; height: 420px; background: #06b6d4; bottom: -160px; left: -100px; opacity: .45; animation: kpa-float 22s ease-in-out infinite alternate-reverse; }
@keyframes kpa-float { to { transform: translate(-60px, 80px) scale(1.15); } }
.kpa-auth-art > * { position: relative; z-index: 1; }
.kpa-logo { font-family: "Estedad", sans-serif; display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 17px; text-decoration: none; }
.kpa-logo i {
  font-style: normal; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--a), #ec4899); color: #fff; font-size: 16px;
  box-shadow: 0 8px 20px -8px var(--a);
}
.kpa-auth-art h1 { font-family: "Estedad", sans-serif; font-size: clamp(30px, 3.4vw, 46px); font-weight: 900; line-height: 1.35; margin: 0 0 14px; letter-spacing: -.02em; }
.kpa-auth-art h1 em { font-style: normal; background: linear-gradient(90deg, #a5b4fc, #f0abfc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpa-auth-art p { color: #b6b6c8; max-width: 44ch; margin: 0; font-size: 15px; }
.kpa-mock { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 74px; gap: 10px; max-width: 460px; margin-top: 32px; }
.kpa-mock div {
  border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(10px); animation: kpa-bob 6s ease-in-out infinite;
}
.kpa-mock div:nth-child(1) { grid-column: span 2; grid-row: span 2; background: linear-gradient(145deg, rgba(109,93,252,.55), rgba(236,72,153,.35)); }
.kpa-mock div:nth-child(2) { background: #229ed9; animation-delay: -1s; }
.kpa-mock div:nth-child(3) { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 95%); animation-delay: -2s; }
.kpa-mock div:nth-child(4) { grid-column: span 2; animation-delay: -3s; }
.kpa-mock div:nth-child(5) { grid-column: span 2; background: rgba(255,255,255,.92); animation-delay: -4s; }
.kpa-mock div:nth-child(6) { grid-column: span 2; background: linear-gradient(135deg, #22d3ee55, #6d5dfc55); animation-delay: -5s; }
@keyframes kpa-bob { 50% { transform: translateY(-6px); } }
.kpa-auth-main { display: grid; place-items: center; padding: 32px 20px; }
.kpa-card {
  width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; padding: 28px; box-shadow: 0 30px 60px -40px rgba(20,20,50,.35);
}
.kpa-card h2 { margin: 0 0 4px; font-family: "Estedad", sans-serif; font-size: 22px; font-weight: 900; }
.kpa-card > p { margin: 0 0 20px; color: var(--muted); }
.kpa-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #f1f1f6; border-radius: 14px; margin-bottom: 20px; }
.kpa-seg button { height: 38px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .2s; }
.kpa-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -2px rgba(0,0,0,.12); }
.kpa-pw { position: relative; }
.kpa-pw .kpa-icon-btn { position: absolute; left: 6px; top: 6px; }
@media (max-width: 900px) {
  .kpa-auth { grid-template-columns: 1fr; }
  .kpa-auth-art { padding: 28px 20px 32px; }
  .kpa-mock { display: none; }
  .kpa-auth-art h1 { font-family: "Estedad", sans-serif; font-size: 26px; margin-top: 24px; }
}

/* ── Onboarding wizard ── */
.kpa-wiz { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 28px 16px 60px; background:
  radial-gradient(900px 400px at 80% -10%, color-mix(in srgb, var(--a) 16%, transparent), transparent),
  radial-gradient(700px 360px at 0% 0%, #22d3ee22, transparent), var(--bg); }
.kpa-wiz-top { width: 100%; max-width: 1080px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.kpa-steps { display: flex; gap: 6px; }
.kpa-steps i { width: 28px; height: 6px; border-radius: 99px; background: #dcdce6; transition: background .3s, width .3s; }
.kpa-steps i.on { background: var(--a); width: 44px; }
.kpa-wiz-body { width: 100%; max-width: 1080px; animation: kpa-in .45s cubic-bezier(.2,.8,.2,1); }
@keyframes kpa-in { from { transform: translateY(12px); } }
.kpa-wiz h2 { font-family: "Estedad", sans-serif; font-size: clamp(24px, 3vw, 34px); font-weight: 900; margin: 0 0 6px; letter-spacing: -.01em; }
.kpa-wiz-body > p { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
.kpa-wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.kpa-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .kpa-choices { grid-template-columns: 1fr; } }
.kpa-choice {
  text-align: right; border: 2px solid var(--line); background: var(--panel); border-radius: 22px; padding: 18px;
  cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.kpa-choice:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -28px rgba(30,30,80,.4); }
.kpa-choice[aria-pressed="true"] { border-color: var(--a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 14%, transparent); }
.kpa-choice b { font-size: 16px; font-weight: 900; }
.kpa-choice span { color: var(--muted); font-size: 13px; }
.kpa-choice-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.kpa-tpl-mock { height: 150px; border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-auto-rows: 1fr; gap: 6px; padding: 10px; }
.kpa-tpl-mock i { border-radius: 9px; }
.kpa-tpl-mock i:first-child { grid-column: span 2; grid-row: span 2; }
.kpa-tpl-mock[data-t="bento"] { background: #f3f3f5; }
.kpa-tpl-mock[data-t="bento"] i { background: #fff; box-shadow: 0 4px 10px -6px rgba(0,0,0,.2); }
.kpa-tpl-mock[data-t="bento"] i:first-child { background: linear-gradient(145deg, #a5b4fc, #c4b5fd); }
.kpa-tpl-mock[data-t="aurora"] { background: radial-gradient(circle at 80% 0, #6d5dfc 0, transparent 60%), radial-gradient(circle at 0 100%, #06b6d4aa 0, transparent 55%), #0a0a12; }
.kpa-tpl-mock[data-t="aurora"] i { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.kpa-tpl-mock[data-t="mono"] { background: #fafaf8; }
.kpa-tpl-mock[data-t="mono"] i { background: #fff; border: 1px solid #d4d4d0; border-radius: 2px; }
.kpa-tpl-mock[data-t="mono"] i:first-child { background: #111; }

/* ── Editor layout ── */
.kpa-ed { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 60px 1fr; }
.kpa-top {
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); z-index: 5;
}
.kpa-top .kpa-logo { font-size: 15px; }
.kpa-top .kpa-logo i { width: 32px; height: 32px; border-radius: 10px; font-size: 14px; }
.kpa-url {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 6px 0 12px; border-radius: 11px;
  background: #f3f3f8; border: 1px solid var(--line); direction: ltr; font-size: 13px; color: var(--ink-2); min-width: 0;
}
.kpa-url b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpa-status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kpa-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.kpa-status[data-s="saving"]::before { background: #f59e0b; animation: kpa-pulse 1s infinite; }
.kpa-status[data-s="error"]::before { background: #ef4444; }
@keyframes kpa-pulse { 50% { opacity: .3; } }
.kpa-top-sp { flex: 1; }
.kpa-main { display: grid; grid-template-columns: 440px 1fr; min-height: 0; }
.kpa-side { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.kpa-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.kpa-tab {
  flex: 1; height: 38px; border: 0; border-radius: 11px; background: transparent; cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s, color .2s;
}
.kpa-tab:hover { color: var(--ink); }
.kpa-tab[aria-selected="true"] { background: color-mix(in srgb, var(--a) 10%, #fff); color: var(--a); }
.kpa-pane { flex: 1; overflow-y: auto; padding: 18px 18px 40px; }
.kpa-h { font-size: 13px; font-weight: 900; color: var(--ink); margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.kpa-h:first-child { margin-top: 0; }

.kpa-stage {
  position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center;
  background-color: #eeeef3; background-image: radial-gradient(#d9d9e2 1px, transparent 1px); background-size: 18px 18px;
  padding: 18px;
}
.kpa-stage-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.kpa-device-seg { display: flex; gap: 2px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.kpa-device-seg button { width: 38px; height: 32px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.kpa-device-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.kpa-device {
  flex: 1; min-height: 0; width: 100%; max-width: 100%; border-radius: 22px; overflow: hidden; background: #fff;
  box-shadow: 0 40px 80px -40px rgba(20,20,60,.45), 0 0 0 1px rgba(0,0,0,.06);
  transition: max-width .45s cubic-bezier(.2,.8,.2,1), border-radius .45s;
}
.kpa-device[data-d="mobile"] { max-width: 390px; border-radius: 42px; box-shadow: 0 40px 80px -40px rgba(20,20,60,.5), 0 0 0 10px #0e1017, 0 0 0 11px #2a2d38; margin: 10px 0; }
.kpa-device iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* ── Block list ── */
.kpa-add {
  width: 100%; height: 50px; border-radius: 14px; border: 1.5px dashed #cfcfe0; background: #fbfbff; cursor: pointer;
  font-weight: 900; color: var(--a); display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s;
}
.kpa-add:hover { border-color: var(--a); background: color-mix(in srgb, var(--a) 6%, #fff); }
.kpa-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; animation: kpa-in .3s; }
.kpa-pick {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; transition: all .2s;
}
.kpa-pick:hover { border-color: var(--a); transform: translateY(-2px); box-shadow: 0 12px 24px -18px var(--a); }
.kpa-pick i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-style: normal; }
.kpa-blocks { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.kpa-blk { border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: box-shadow .2s, border-color .2s, transform .2s; }
.kpa-blk.open { border-color: color-mix(in srgb, var(--a) 40%, var(--line)); box-shadow: 0 16px 36px -28px rgba(40,40,100,.55); }
.kpa-blk.dragging { opacity: .5; }
.kpa-blk.drop-before { box-shadow: 0 -3px 0 var(--a); }
.kpa-blk.drop-after { box-shadow: 0 3px 0 var(--a); }
.kpa-blk.flash { animation: kpa-flash 1.2s; }
@keyframes kpa-flash { 0%, 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 30%, transparent); } }
.kpa-blk-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 6px; cursor: pointer; }
.kpa-grip { cursor: grab; color: #b4b4c4; padding: 4px; display: grid; place-items: center; }
.kpa-grip:active { cursor: grabbing; }
.kpa-blk-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.kpa-blk-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.kpa-blk-t b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpa-blk-t small { font-size: 11.5px; color: var(--muted); }
.kpa-blk-body { padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #f1f1f5; padding-top: 14px; }
.kpa-blk-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpa-sizes { display: inline-flex; gap: 4px; padding: 3px; background: #f3f3f8; border-radius: 11px; }
.kpa-sizes button { width: 36px; height: 30px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.kpa-sizes button[aria-pressed="true"] { background: #fff; color: var(--a); box-shadow: 0 2px 6px -2px rgba(0,0,0,.15); }
.kpa-sizes svg rect { fill: currentColor; }

/* Image picker */
.kpa-img { display: flex; gap: 12px; align-items: center; }
.kpa-img-thumb {
  width: 72px; height: 72px; border-radius: 14px; flex: none; background: #f1f1f6 center/cover no-repeat; border: 1px solid var(--line);
  display: grid; place-items: center; color: #b0b0c2; overflow: hidden;
}
.kpa-img-thumb.round { border-radius: 50%; width: 84px; height: 84px; }
.kpa-img-ctl { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.kpa-img-ctl .kpa-btn { align-self: flex-start; }
.kpa-img.busy .kpa-img-thumb { animation: kpa-pulse 1s infinite; }

/* Appearance */
.kpa-tpls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpa-tpls .kpa-choice { padding: 8px 8px 10px; border-radius: 20px; gap: 4px; }
.kpa-tpls .kpa-choice b { font-size: 13.5px; padding-inline: 4px; }
.kpa-tpls .kpa-choice span { font-size: 11.5px; padding-inline: 4px; }
.kpa-tpls .kpa-thumb { height: 230px; }

/* Live template thumbnail: a real render, scaled into a phone-shaped frame. */
.kpa-thumb {
  --s: .4;
  position: relative; height: 260px; border-radius: 14px; overflow: hidden; background: #ececf2;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.kpa-thumb::before {
  content: ""; position: absolute; inset: 0; z-index: 1; transition: opacity .4s;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%) 0 0 / 200% 100%, #ececf2;
  animation: kpa-shimmer 1.4s linear infinite;
}
.kpa-thumb.ready::before { opacity: 0; animation: none; pointer-events: none; }
@keyframes kpa-shimmer { to { background-position: -200% 0; } }
.kpa-thumb iframe {
  position: absolute; top: 0; right: 0; width: 390px; height: calc(100% / var(--s)); border: 0;
  transform: scale(var(--s)); transform-origin: top right; pointer-events: none;
}
.kpa-choice[aria-pressed="true"] .kpa-thumb { box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 12px 30px -16px var(--a); }
.kpa-choices--tpl { grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpa-choices--tpl .kpa-choice { padding: 8px 8px 12px; gap: 6px; }
.kpa-choices--tpl .kpa-thumb { height: 300px; }
.kpa-choices--tpl .kpa-choice b, .kpa-choices--tpl .kpa-choice span { padding-inline: 4px; }
@media (max-width: 1000px) { .kpa-choices--tpl { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .kpa-choices--tpl { grid-template-columns: repeat(2, 1fr); } .kpa-choices--tpl .kpa-thumb { height: 240px; } }
.kpa-swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kpa-sw {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .2s;
}
.kpa-sw:hover { transform: scale(1.1); }
.kpa-sw[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sw); }
.kpa-sw-custom { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 1px dashed #c4c4d4; position: relative; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.kpa-sw-custom input { position: absolute; inset: -8px; width: 50px; height: 50px; opacity: 0; cursor: pointer; }

/* Switch */
.kpa-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.kpa-switch b { display: block; font-size: 13.5px; }
.kpa-switch small { color: var(--muted); font-size: 12px; }
.kpa-switch input { appearance: none; width: 46px; height: 26px; border-radius: 99px; background: #d4d4de; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.kpa-switch input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.kpa-switch input:checked { background: #10b981; }
.kpa-switch input:checked::after { transform: translateX(-20px); }
.kpa-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpa-stat div { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--a) 7%, #fff), #fff); }
.kpa-stat b { display: block; font-size: 22px; font-weight: 900; }
.kpa-stat small { color: var(--muted); font-size: 12px; }

/* Stale-save modal */
.kpa-stale { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(14,16,23,.45); backdrop-filter: blur(6px); }
.kpa-stale p { color: var(--muted); margin: 0 0 18px; }

/* Toast */
.kpa-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 14px; font-weight: 700; font-size: 13px;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: all .3s cubic-bezier(.2,.8,.2,1);
}
.kpa-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Mobile editor: one pane at a time, switched from a bottom bar. */
.kpa-mswitch { display: none; }
@media (max-width: 980px) {
  .kpa-main { grid-template-columns: 1fr; }
  .kpa-main[data-view="edit"] .kpa-stage, .kpa-main[data-view="preview"] .kpa-side { display: none; }
  .kpa-side { border-left: 0; }
  .kpa-pane { padding-bottom: 96px; }
  .kpa-stage { padding: 12px 12px 84px; }
  .kpa-device[data-d="mobile"] { box-shadow: 0 30px 60px -30px rgba(20,20,60,.5), 0 0 0 6px #0e1017; border-radius: 36px; margin: 6px 0; }
  .kpa-mswitch {
    display: flex; position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 20;
    padding: 4px; gap: 4px; border-radius: 16px; background: var(--ink); box-shadow: 0 16px 40px -12px rgba(0,0,0,.5);
  }
  .kpa-mswitch button { white-space: nowrap; height: 42px; padding: 0 20px; border: 0; border-radius: 12px; background: transparent; color: #a6a6b8; font-weight: 900; cursor: pointer; }
  .kpa-mswitch button[aria-pressed="true"] { background: #fff; color: var(--ink); }
  .kpa-top .kpa-url, .kpa-top .kpa-hide-m { display: none; }
  .kpa-device-seg { display: none; }
}

/* ═════════════════ Landing (/pro) ═════════════════ */
.kpl { background: #fff; }
/* Safety net only — the real fixes are the minmax(0, 1fr) tracks below. clip (not hidden)
   creates no scroll container, so the sticky TOC keeps working. */
html:has(> body.kpl), body.kpl { overflow-x: clip; }
.kpl-nav {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(10,10,18,.72); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.kpl-links { display: flex; gap: 22px; margin-inline-start: 18px; }
.kpl-links a, .kpl-login { color: #c7c7d6; text-decoration: none; font-weight: 700; font-size: 13.5px; transition: color .2s; }
.kpl-links a:hover, .kpl-login:hover { color: #fff; }
.kpl-nav-cta { margin-inline-start: auto; display: flex; align-items: center; gap: 16px; }
@media (max-width: 720px) { .kpl-links { display: none; } }

.kpl-hero {
  --glow: #6366f1;
  position: relative; overflow: hidden; background: #07060d; color: #fff; padding: 56px 20px 64px;
}
.kpl-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.kpl-hero-bg i { position: absolute; border-radius: 50%; filter: blur(110px); transition: background 1.2s var(--kpl-ease, ease); }
.kpl-hero-bg i:nth-child(1) { width: 720px; height: 720px; background: var(--glow); opacity: .55; top: -220px; left: 4%; animation: kpa-float 20s ease-in-out infinite alternate; }
.kpl-hero-bg i:nth-child(2) { width: 520px; height: 520px; background: color-mix(in oklab, var(--glow), #22d3ee 60%); opacity: .3; bottom: -200px; left: 38%; animation: kpa-float 24s ease-in-out infinite alternate-reverse; }
.kpl-hero-bg i:nth-child(3) { width: 420px; height: 420px; background: color-mix(in oklab, var(--glow), #ec4899 55%); opacity: .25; top: 10%; right: -120px; animation: kpa-float 28s ease-in-out infinite alternate; }
.kpl-hero-bg::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000, transparent 75%); }
.kpl-hero-grid { position: relative; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.kpl-hero-in { text-align: right; }
.kpl-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 99px; font-size: 12.5px; color: #d4d4e4; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.kpl-pill b { background: linear-gradient(135deg, #6d5dfc, #ec4899); color: #fff; padding: 1px 10px; border-radius: 99px; font-size: 11.5px; }
.kpl-hero h1 { font-family: "Estedad", "Vazirmatn", sans-serif; font-size: clamp(46px, 7.4vw, 96px); line-height: 1.12; font-weight: 900; letter-spacing: -.03em; margin: 22px 0 20px; }
.kpl-hero h1 em {
  font-style: normal;
  background: linear-gradient(95deg, #fff 10%, color-mix(in oklab, var(--glow), #fff 30%) 55%, #fff 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpl-hero-in > p { color: #b8b8cc; font-size: clamp(15px, 1.5vw, 18px); max-width: 52ch; margin: 0 0 30px; line-height: 2; }
.kpl-ltr { color: #fff; font-weight: 700; }
.kpl-claim { display: flex; gap: 8px; max-width: 540px; padding: 6px; border-radius: 20px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--glow) 60%, transparent); }
.kpl-claim-in { flex: 1; display: flex; align-items: center; direction: ltr; padding-left: 14px; min-width: 0; }
.kpl-claim-in span { color: #9a9ab0; font-size: 14px; white-space: nowrap; }
.kpl-claim-in input { flex: 1; min-width: 0; height: 50px; border: 0; background: transparent; color: #fff; font-size: 15px; font-weight: 700; outline: none; }
.kpl-claim .kpa-btn { height: 50px; border-radius: 15px; padding: 0 22px; }
.kpl-proof { list-style: none; padding: 0; margin: 26px 0 0; display: flex; gap: 26px; flex-wrap: wrap; color: #9a9ab0; font-size: 13px; }
.kpl-proof b { display: block; font-family: "Estedad", sans-serif; font-size: 28px; font-weight: 900; color: #fff; line-height: 1.1; }

.kpl-stage { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.kpl-device {
  --w: 340px;
  position: relative; width: var(--w); height: 690px; border-radius: 54px; overflow: hidden; background: #111;
  box-shadow: 0 0 0 10px #15141c, 0 0 0 11px #2e2d38, 0 60px 120px -40px rgba(0,0,0,.9), 0 0 140px -30px var(--glow);
  transition: box-shadow 1.2s;
}
.kpl-device::after { content: ""; position: absolute; top: 12px; left: 50%; width: 96px; height: 28px; margin-left: -48px; border-radius: 99px; background: #000; z-index: 3; pointer-events: none; }
.kpl-device iframe {
  position: absolute; top: 0; right: 0; width: 390px; height: calc(690px / (340 / 390)); border: 0;
  transform: scale(calc(340 / 390)); transform-origin: top right;
  opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s;
}
.kpl-device iframe[data-on] { opacity: 1; visibility: visible; transition: opacity .6s; }
.kpl-switch { display: flex; gap: 6px; padding: 5px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); flex-wrap: wrap; justify-content: center; }
.kpl-switch button {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-radius: 99px;
  background: transparent; color: #a9a9bd; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .3s, color .3s;
}
.kpl-switch button i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.kpl-switch button:hover { color: #fff; }
.kpl-switch button[aria-selected="true"] { background: #fff; color: #0b0b12; }
@media (max-width: 960px) {
  .kpl-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .kpl-hero-in { text-align: center; }
  .kpl-hero-in > p { margin-inline: auto; }
  .kpl-claim { margin: 0 auto; }
  .kpl-proof { justify-content: center; }
}
@media (max-width: 520px) {
  .kpl-claim { flex-direction: column; }
  .kpl-claim .kpa-btn { width: 100%; }
  .kpl-device { transform: scale(.88); transform-origin: top center; margin-bottom: -80px; }
}

/* Template gallery: five phones in a snapping row */
.kpl-sec--wide { max-width: 1320px; }
.kpl-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 222px; gap: 22px; overflow-x: auto; padding: 20px 8px 30px; scroll-snap-type: x mandatory; justify-content: safe center; scrollbar-width: thin; }
.kpl-gal { margin: 0; scroll-snap-align: center; display: flex; flex-direction: column; gap: 14px; }
.kpl-gal-phone {
  position: relative; width: 222px; height: 456px; border-radius: 36px; overflow: hidden; background: #111;
  box-shadow: 0 0 0 7px #16161f, 0 30px 60px -30px rgba(20,20,60,.55); transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.kpl-gal:hover .kpl-gal-phone { transform: translateY(-10px) rotate(-1.5deg); }
.kpl-gal-phone iframe { position: absolute; top: 0; right: 0; width: 390px; height: calc(456px / (222 / 390)); border: 0; transform: scale(calc(222 / 390)); transform-origin: top right; pointer-events: none; }
.kpl-gal figcaption { text-align: center; display: flex; flex-direction: column; }
.kpl-gal figcaption b { font-size: 16px; font-weight: 900; }
.kpl-gal figcaption span { font-size: 12.5px; color: var(--muted); }

.kpl-sec { max-width: 1120px; margin: 0 auto; padding: 90px 20px 10px; }
.kpl-sec h2, .kpl-final h2 { font-family: "Estedad", sans-serif; font-size: clamp(26px, 3.6vw, 40px); font-weight: 900; letter-spacing: -.02em; text-align: center; margin: 0 0 12px; }
.kpl-lead { text-align: center; color: var(--muted); max-width: 60ch; margin: 0 auto 36px; font-size: 16px; }
.kpl-uses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .kpl-uses { grid-template-columns: 1fr; } }
.kpl-use {
  position: relative; overflow: hidden; padding: 26px; border-radius: 26px; border: 1px solid var(--line);
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 9%, #fff), #fff 55%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.kpl-use:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -40px var(--c); }
.kpl-use i { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-style: normal; font-size: 22px; color: #fff; background: var(--c); box-shadow: 0 14px 28px -14px var(--c); }
.kpl-use h3 { font-size: 20px; font-weight: 900; margin: 18px 0 8px; }
.kpl-use p { color: var(--ink-2); margin: 0; }

.kpl-bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 170px; gap: 14px; margin-top: 36px; }
.kpl-f { border-radius: 24px; padding: 22px; background: #f6f6fa; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.kpl-f b { font-size: 17px; font-weight: 900; }
.kpl-f p { margin: 0; color: var(--muted); font-size: 13.5px; }
.kpl-f--l { grid-column: span 2; grid-row: span 2; color: #fff; border: 0; background:
  radial-gradient(circle at 85% 10%, #ec489988, transparent 45%), radial-gradient(circle at 10% 90%, #06b6d488, transparent 50%), linear-gradient(135deg, #6d5dfc, #4338ca); }
.kpl-f--l b { font-size: 26px; }
.kpl-f--l p { color: #e0e0ff; font-size: 15px; max-width: 40ch; }
.kpl-f--w { grid-column: span 2; background: #0e1017; color: #fff; border: 0; }
.kpl-f--w p { color: #a6a6b8; }
@media (max-width: 860px) {
  .kpl-bento { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .kpl-f { min-height: 150px; }
  .kpl-f--l, .kpl-f--w { grid-column: span 2; grid-row: auto; min-height: 220px; }
}

.kpl-steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.kpl-steps li { counter-increment: s; padding: 24px; border-radius: 22px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.kpl-steps li::before { content: counter(s, persian); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; color: var(--a); background: color-mix(in srgb, var(--a) 10%, #fff); margin-bottom: 8px; }
.kpl-steps b { font-size: 17px; font-weight: 900; }
.kpl-steps span { color: var(--muted); }
@media (max-width: 760px) { .kpl-steps { grid-template-columns: 1fr; } }

/* Long-form guide: sticky TOC + prose */
.kpl-article { max-width: 1120px; margin: 0 auto; padding: 90px 20px 10px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; }
.kpl-toc { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fafaff; }
.kpl-toc b { font-family: "Estedad", sans-serif; font-weight: 900; }
.kpl-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: t; }
.kpl-toc li { counter-increment: t; }
.kpl-toc a { display: flex; gap: 8px; padding: 6px 8px; border-radius: 10px; font-size: 13px; color: var(--ink-2); text-decoration: none; transition: background .2s, color .2s; }
.kpl-toc a::before { content: counter(t, persian); color: var(--a); font-weight: 900; }
.kpl-toc a:hover { background: color-mix(in srgb, var(--a) 8%, #fff); color: var(--a); }
.kpl-prose { min-width: 0; max-width: 740px; font-size: 16px; line-height: 2.1; color: var(--ink-2); }
.kpl-prose h2 { font-family: "Estedad", sans-serif; font-size: clamp(24px, 3vw, 32px); font-weight: 900; color: var(--ink); letter-spacing: -.01em; line-height: 1.4; margin: 56px 0 14px; scroll-margin-top: 90px; }
.kpl-prose h2:first-child { margin-top: 0; }
.kpl-prose p { margin: 0 0 16px; }
.kpl-prose strong { color: var(--ink); }
.kpl-answer { font-size: 17.5px; padding: 18px 22px; border-radius: 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--a) 9%, #fff), #fff); border: 1px solid color-mix(in srgb, var(--a) 18%, var(--line)); }
.kpl-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; margin: 20px 0; }
.kpl-table table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13.5px; line-height: 1.7; }
.kpl-table th, .kpl-table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); }
.kpl-table thead th { background: #f6f6fb; font-weight: 900; color: var(--ink); white-space: nowrap; }
.kpl-table thead th:nth-child(2) { background: var(--ink); color: #fff; }
.kpl-table tbody th { font-weight: 700; color: var(--ink); }
.kpl-table tbody tr:last-child > * { border-bottom: 0; }
.kpl-table td:nth-child(2) { background: color-mix(in srgb, var(--a) 6%, #fff); font-weight: 800; }
.kpl-table td.y::before, .kpl-table td.n::before, .kpl-table td.m::before { display: inline-block; width: 18px; font-weight: 900; }
.kpl-table td.y::before { content: "✓"; color: #059669; }
.kpl-table td.n::before { content: "✕"; color: #dc2626; }
.kpl-table td.m::before { content: "~"; color: #d97706; }
.kpl-list { padding-inline-start: 22px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.kpl-list li::marker { color: var(--a); font-weight: 900; }
.kpl-howto { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; counter-reset: h; }
.kpl-howto li { counter-increment: h; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; line-height: 1.8; }
.kpl-howto li::before { content: counter(h, persian); grid-row: span 2; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--a), #ec4899); }
.kpl-howto b { color: var(--ink); }
.kpl-howto span { font-size: 14px; }
.kpl-jobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 20px; }
.kpl-jobs div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 4px; line-height: 1.8; transition: border-color .25s, transform .25s; }
.kpl-jobs div:hover { border-color: var(--a); transform: translateY(-2px); }
.kpl-jobs b { color: var(--ink); font-size: 15px; }
.kpl-jobs span { font-size: 13px; }
.kpl-cta-line { font-weight: 700; color: var(--ink); }
.kpl-cta-line a { color: var(--a); font-weight: 900; }
@media (max-width: 960px) {
  /* minmax(0, …): a plain 1fr track grows to the table's min-width instead of letting it scroll. */
  .kpl-article { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 70px; }
  .kpl-toc { position: static; }
  .kpl-jobs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .kpl-jobs { grid-template-columns: 1fr; } }

.kpl-faq { max-width: 760px; margin: 30px auto 0; display: flex; flex-direction: column; gap: 10px; }
.kpl-faq details { border: 1px solid var(--line); border-radius: 18px; padding: 4px 20px; background: #fff; transition: box-shadow .25s; }
.kpl-faq details[open] { box-shadow: 0 20px 40px -32px rgba(40,40,100,.5); }
.kpl-faq summary { cursor: pointer; font-weight: 900; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.kpl-faq summary::-webkit-details-marker { display: none; }
.kpl-faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--a); transition: transform .25s; }
.kpl-faq details[open] summary::after { transform: rotate(45deg); }
.kpl-faq p { margin: 0 0 16px; color: var(--ink-2); }

.kpl-final { margin: 90px 20px 0; padding: 70px 20px; border-radius: 36px; text-align: center; color: #fff; background:
  radial-gradient(circle at 80% 0, #ec489977, transparent 50%), radial-gradient(circle at 0 100%, #06b6d466, transparent 50%), #0a0a12; }
.kpl-final p { color: #b8b8cc; margin: 0 0 26px; }
@media (min-width: 1200px) { .kpl-final { max-width: 1120px; margin-inline: auto; } }
.kpl-foot { text-align: center; padding: 36px 20px 44px; color: var(--muted); font-size: 13px; }
.kpl-foot a { color: var(--ink); font-weight: 700; text-decoration: none; }

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