/* KitPage — shared skeleton for every template (raw CSS, not Tailwind).
   Templates (tpl-*.css) restyle this markup; they don't add structure.
   Motion hooks: page.js sets [data-js] on <body>, .in on revealed cards and
   --mx/--my (cursor position inside a card) for spotlight effects. */

/* ── Fonts (self-hosted, OFL) ── */
@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; }
@font-face { font-family: "Markazi"; src: url("../../fonts/kitpage/markazi-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Markazi"; src: url("../../fonts/kitpage/markazi-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Markazi"; src: url("../../fonts/kitpage/markazi-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Markazi"; src: url("../../fonts/kitpage/markazi-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Lalezar"; src: url("../../fonts/kitpage/lalezar.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Lalezar"; src: url("../../fonts/kitpage/lalezar-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }

.kp {
  --accent: #6366f1;
  --accent-ink: #fff;
  --font: "Vazirmatn", Tahoma, sans-serif;
  --display: "Estedad", "Vazirmatn", Tahoma, sans-serif;
  --bg: #f4f4f6;
  --ink: #0b0c0f;
  --muted: #6b6f7b;
  --line: rgba(10, 12, 16, .08);
  --card: #fff;
  --radius: 30px;
  --gap: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.kp *, .kp *::before, .kp *::after { box-sizing: border-box; }
/* :where() keeps these at zero specificity so component colors always win. */
:where(.kp) a { color: inherit; text-decoration: none; }
:where(.kp) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.kp h1, .kp h2, .kp h3, .kp p, .kp figure { margin: 0; }
.kp img { display: block; max-width: 100%; }
.kp ::selection { background: var(--accent); color: var(--accent-ink); }
.kp-ic { width: 20px; height: 20px; flex: none; }
.kp-bi { width: 24px; height: 24px; flex: none; }

/* ── Decorative layers ── */
.kp-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.kp-bg > i { position: absolute; display: block; }
.kp-cover { position: absolute; inset: 0; background-size: cover; background-position: center; }
.kp-grain {
  position: fixed; inset: -50%; z-index: 0; pointer-events: none; opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Layout: hero beside the grid on desktop ── */
.kp-shell {
  position: relative; z-index: 1;
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 64px 28px 24px;
  display: grid; gap: 44px;
}
@media (min-width: 1024px) {
  .kp-shell { grid-template-columns: 360px minmax(0, 1fr); gap: 64px; padding-top: 84px; }
  .kp-hero { position: sticky; top: 84px; align-self: start; }
  .kp-marquee { grid-column: 1 / -1; }
}

/* ── Hero ── */
.kp-hero { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.kp-mast { display: none; }
.kp-av { position: relative; width: 120px; height: 120px; flex: none; }
.kp-av-img, .kp-av-ph { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.kp-av-ph {
  display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 42px; color: var(--accent-ink);
  background: var(--accent);
}
.kp-av-ring { position: absolute; inset: -6px; border-radius: 50%; }
.kp-id { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.kp-status {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700;
  padding: 5px 12px 5px 14px; border-radius: 99px; line-height: 1.6;
}
.kp-status i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; position: relative; }
.kp-status i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: #22c55e; opacity: .35; animation: kp-ping 2s var(--ease) infinite; }
@keyframes kp-ping { 70%, 100% { transform: scale(2.2); opacity: 0; } }
.kp-name { font-family: var(--display); font-weight: 900; font-size: clamp(38px, 5.4vw, 56px); line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.kp-w { display: inline-block; }
.kp-headline { font-size: 17px; font-weight: 600; color: var(--muted); }
.kp-loc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.kp-loc .kp-ic { width: 16px; height: 16px; }
.kp-bio { font-size: 15.5px; color: var(--muted); max-width: 44ch; line-height: 1.95; }
.kp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kp-cta, .kp-share {
  display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 22px; border-radius: 99px;
  font-weight: 800; font-size: 14.5px; white-space: nowrap;
  transition: transform .35s var(--spring), box-shadow .35s var(--ease), background .3s, color .3s;
}
.kp-cta { background: var(--ink); color: var(--bg); }
.kp-cta:hover, .kp-share:hover { transform: translateY(-2px) scale(1.02); }
.kp-cta:active, .kp-share:active { transform: scale(.97); }
.kp-share { padding: 0 18px; border: 1px solid var(--line); }
.kp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kp-chip {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  transition: transform .35s var(--spring), background .25s, color .25s;
}
.kp-chip .kp-ic { width: 19px; height: 19px; }
.kp-chip:hover { transform: translateY(-3px) rotate(-6deg); background: var(--brand); color: var(--brand-ink); }

/* ── Marquee (templates opt in) ── */
.kp-marquee { display: none; overflow: hidden; min-width: 0; }
.kp-mq-track { display: flex; width: max-content; gap: 28px; align-items: center; animation: kp-marquee 38s linear infinite; }
.kp-mq-track > * { flex: none; }
@keyframes kp-marquee { to { transform: translateX(50%); } }

/* ── Section titles & grid ── */
/* The container is the grid's PARENT: cqi in an element's own properties resolves
   against its nearest ancestor container, so rows must measure .kp-blocks. */
.kp-blocks { min-width: 0; container-type: inline-size; }
.kp-section { display: flex; align-items: center; gap: 12px; margin: 40px 2px 16px; font-family: var(--display); font-size: 18px; font-weight: 800; }
.kp-section:first-child { margin-top: 0; }
.kp-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kp-section-n { font-size: 12px; font-weight: 700; color: var(--muted); font-family: var(--font); }
.kp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: calc((100cqi - 3 * var(--gap)) / 4);
  grid-auto-flow: dense;
  gap: var(--gap);
}
.kp-sz-s { grid-column: span 1; grid-row: span 1; }
.kp-sz-w { grid-column: span 2; grid-row: span 1; }
.kp-sz-t { grid-column: span 1; grid-row: span 2; }
.kp-sz-l { grid-column: span 2; grid-row: span 2; }
@media (max-width: 640px) {
  .kp { --gap: 12px; --radius: 24px; }
  .kp-shell { padding: 40px 16px 24px; gap: 30px; }
  .kp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: calc((100cqi - var(--gap)) / 2); }
  .kp-av { width: 96px; height: 96px; }
  .kp-name { font-size: clamp(34px, 10vw, 44px); }
}

/* ── Card anatomy ── */
.kp-card {
  --i: 0; --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; isolation: isolate; min-width: 0;
  border-radius: var(--radius); background: var(--card);
  display: flex; flex-direction: column; padding: 20px;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .4s, background .4s;
}
.kp-spot {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(380px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
}
.kp-card:hover .kp-spot { opacity: 1; }
.kp-card:focus-visible, .kp-cta:focus-visible, .kp-share:focus-visible, .kp-chip:focus-visible, .kp-order:focus-visible, .kp-cbtn:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
.kp-go {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  transition: transform .5s var(--spring), background .3s, color .3s;
}
.kp-go .kp-ic { width: 16px; height: 16px; }
.kp-card:hover .kp-go { transform: rotate(-45deg); }

/* Entrance: transform only — a frozen timeline (background tab) degrades to a small offset, never hidden content. */
.kp[data-js] .kp-card { transform: translateY(26px) scale(.97); }
.kp[data-js] .kp-card.in { transform: none; transition-delay: calc(min(var(--i), 8) * 45ms); }
.kp[data-js] .kp-card.in:hover { transition-delay: 0s; }
.kp[data-js] .kp-w { transform: translateY(.45em); transition: transform .9s var(--spring); transition-delay: calc(var(--wi) * 90ms + 80ms); }
.kp[data-js].kp-ready .kp-w { transform: none; }
/* Live-preview refreshes: page.js marks everything revealed at once; just skip the motion. */
.kp[data-still] .kp-card, .kp[data-still] .kp-w { transition: none !important; }

/* Logos */
.kp-logo {
  --brand: var(--accent); --brand-ink: var(--accent-ink);
  width: 50px; height: 50px; border-radius: 16px; flex: none; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
  transition: transform .5s var(--spring);
}
.kp-logo .kp-bi { width: 24px; height: 24px; }
.kp-logo--web .kp-bi, .kp-logo--mail .kp-bi, .kp-logo--phone .kp-bi { width: 23px; height: 23px; }
.kp-logo--instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); color: #fff; }
.kp-link:hover .kp-logo { transform: rotate(-8deg) scale(1.08); }
.kp-wm { position: absolute; z-index: -1; pointer-events: none; display: none; }
.kp-wm-i { width: 100%; height: 100%; }

/* Link */
.kp-link { justify-content: space-between; }
.kp-link-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.kp-link-txt b { font-weight: 800; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-link-txt small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; unicode-bidi: plaintext; }
.kp-link.kp-sz-w { flex-direction: row; align-items: center; gap: 16px; justify-content: flex-start; }
.kp-link.kp-sz-w .kp-go { top: 50%; margin-top: -17px; }
.kp-link.kp-sz-w .kp-wm, .kp-link.kp-sz-l .kp-wm, .kp-link.kp-sz-t .kp-wm { display: block; }
.kp-link.kp-sz-w .kp-wm { width: 150px; height: 150px; left: 40px; top: 50%; margin-top: -75px; transform: rotate(-12deg); }
.kp-link.kp-sz-l .kp-wm, .kp-link.kp-sz-t .kp-wm { width: 72%; aspect-ratio: 1; left: -12%; bottom: -14%; transform: rotate(-14deg); }
.kp-link.kp-sz-l .kp-logo, .kp-link.kp-sz-t .kp-logo { width: 66px; height: 66px; border-radius: 21px; }
.kp-link.kp-sz-l .kp-logo .kp-bi, .kp-link.kp-sz-t .kp-logo .kp-bi { width: 32px; height: 32px; }
.kp-link.kp-sz-l .kp-link-txt b { font-size: 24px; font-family: var(--display); }

/* Text */
.kp-text { justify-content: flex-end; gap: 6px; }
.kp-q { position: absolute; top: 16px; right: 18px; opacity: .14; }
.kp-q-i { width: 36px; height: 36px; }
.kp-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--accent); }
.kp-text p { font-size: 15px; font-weight: 600; line-height: 1.85; }
.kp-text.kp-sz-s p { font-size: 13.5px; }
.kp-text.kp-sz-l p { font-family: var(--display); font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; line-height: 1.6; }

/* Stat */
.kp-stat { justify-content: flex-end; gap: 2px; }
.kp-stat-v { font-family: var(--display); font-weight: 900; font-size: clamp(38px, 5cqi, 64px); line-height: 1; letter-spacing: -.03em; }
.kp-stat-l { font-size: 13px; font-weight: 700; color: var(--muted); }
.kp-stat.kp-sz-l .kp-stat-v, .kp-stat.kp-sz-t .kp-stat-v { font-size: clamp(56px, 9cqi, 110px); }

/* Media (image / project / product) */
.kp-media { position: relative; overflow: hidden; flex: 1 1 auto; min-height: 0; }
.kp-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.kp-card:hover .kp-media img { transform: scale(1.06); }
.kp-image { padding: 0; }
.kp-image .kp-media { position: absolute; inset: 0; }
.kp-cap {
  position: absolute; inset-inline: 12px; bottom: 12px; z-index: 2; width: fit-content; max-width: calc(100% - 24px);
  padding: 6px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 800;
  background: rgba(255,255,255,.82); color: #111; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kp-ph { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.kp-ph-l { font-style: normal; position: absolute; font-family: var(--display); font-weight: 900; line-height: 1; pointer-events: none; }
.kp-ph-ic { width: 34px; height: 34px; position: relative; }
.kp-project, .kp-product { padding: 0; }
.kp-body { position: relative; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: none; }
.kp-body h3 { font-family: var(--display); font-size: 17px; font-weight: 800; line-height: 1.45; }
.kp-body p { font-size: 13px; color: var(--muted); line-height: 1.75; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kp-no { display: none; }
.kp-sz-s .kp-body, .kp-sz-w .kp-body { padding: 10px 14px 12px; }
.kp-sz-s .kp-body h3 { font-size: 14px; }
.kp-sz-s .kp-body p, .kp-sz-w .kp-body p { -webkit-line-clamp: 1; }
.kp-project.kp-sz-l .kp-body h3 { font-size: 22px; }
.kp-project.kp-sz-w, .kp-product.kp-sz-w { flex-direction: row; }
.kp-project.kp-sz-w .kp-media, .kp-product.kp-sz-w .kp-media { flex: 0 0 46%; }
.kp-project.kp-sz-w .kp-body, .kp-product.kp-sz-w .kp-body { flex: 1; justify-content: center; }
.kp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.kp-tags span { font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 99px; }
.kp-badge, .kp-off { position: absolute; top: 12px; z-index: 2; font-size: 11.5px; font-weight: 900; padding: 4px 11px; border-radius: 99px; }
.kp-badge { right: 12px; }
.kp-off { left: 12px; background: #ef4444; color: #fff; }
.kp-buy { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.kp-price { display: flex; flex-direction: column; line-height: 1.35; }
.kp-price b { font-family: var(--display); font-size: 18px; font-weight: 900; }
.kp-price b small { font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--muted); }
.kp-price b.kp-ask { font-size: 13px; color: var(--muted); }
.kp-price s { font-size: 12px; color: var(--muted); }
.kp-order {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 12px;
  font-size: 13px; font-weight: 900; background: var(--accent); color: var(--accent-ink);
  transition: transform .35s var(--spring), filter .25s;
}
.kp-order .kp-ic { width: 16px; height: 16px; }
.kp-order:hover { transform: translateY(-2px) scale(1.04); }
.kp-order--off { opacity: .45; cursor: not-allowed; }
.kp-sz-s .kp-order { height: 32px; padding: 0 10px; font-size: 12px; }
.kp-sz-s .kp-order span { display: none; }

/* Contact */
.kp-contact { justify-content: space-between; gap: 14px; }
.kp-contact-t { font-family: var(--display); font-size: clamp(20px, 2.4vw, 28px); font-weight: 900; line-height: 1.3; position: relative; }
.kp-contact-glow { position: absolute; z-index: -1; pointer-events: none; }
.kp-cbtns { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.kp-cbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 12px;
  font-size: 13px; font-weight: 800; transition: transform .35s var(--spring), background .25s, color .25s;
}
.kp-cbtn .kp-ic { width: 17px; height: 17px; }
.kp-cbtn:hover { transform: translateY(-2px); background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.kp-contact.kp-sz-s .kp-cbtn span { display: none; }
.kp-contact.kp-sz-s .kp-contact-t { font-size: 17px; }
.kp-muted { font-size: 13px; opacity: .7; position: relative; }

/* Empty (preview) */
.kp-empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 56px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ── Footer, dock, toast ── */
.kp-foot { position: relative; z-index: 1; display: flex; justify-content: center; padding: 32px 16px 44px; }
.kp-foot a {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 16px 7px 8px; border-radius: 99px;
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); transition: transform .35s var(--spring), color .25s;
}
.kp-foot a:hover { transform: translateY(-2px); color: var(--ink); }
.kp-foot b { color: var(--ink); font-weight: 800; }
.kp-foot-k { width: 20px; height: 20px; flex: none; color: currentColor; }
.kp-dock {
  position: fixed; z-index: 20; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: 8px; height: 52px; padding: 0 24px; border-radius: 99px;
  font-weight: 900; font-size: 14.5px; background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 20px 40px -14px var(--brand);
}
@media (max-width: 640px) {
  .kp-dock { display: inline-flex; }
  .kp[data-kind="catalog"] .kp-foot { padding-bottom: 100px; }
}
.kp-toast {
  position: fixed; z-index: 30; bottom: 24px; left: 50%; transform: translate(-50%, 16px); pointer-events: none; opacity: 0;
  padding: 10px 18px; border-radius: 14px; background: #111; color: #fff; font-size: 13px; font-weight: 700;
  transition: opacity .3s, transform .4s var(--spring);
}
.kp-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ═════════════ Phase 4: full-width rows, new blocks, theme settings ═════════════
   Everything below reads the template's variables (--card, --ink, --muted,
   --line, --accent, --radius, --display), so a block looks at home in every
   template before that template adds a single rule of its own. */

/* Full-width rows (size f) sit between grid runs and grow with their content. */
.kp-flow { position: relative; }
.kp-blocks > .kp-grid + .kp-flow, .kp-blocks > .kp-flow + .kp-grid, .kp-blocks > .kp-flow + .kp-flow { margin-top: var(--gap); }
.kp-sz-f { width: 100%; }
.kp-section-sub { margin: -8px 2px 18px; font-size: 14px; color: var(--muted); max-width: 60ch; }

/* Rich text (**bold**, [links](…), paragraphs) */
.kp-rich { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; }
.kp-rich p + p { margin-top: .7em; }
.kp-rich b { font-weight: 900; color: var(--ink); }
.kp-rich a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; font-weight: 700; }
.kp-text.kp-sz-s .kp-rich, .kp-text.kp-sz-w .kp-rich { -webkit-line-clamp: 3; }
.kp-text.kp-sz-l .kp-rich { -webkit-line-clamp: 7; }
.kp-text.kp-sz-f { padding: clamp(22px, 3.4cqi, 40px); }
.kp-text.kp-sz-f .kp-rich { display: block; overflow: visible; }
.kp-text.kp-sz-f p { font-size: 16.5px; font-weight: 500; line-height: 2.05; max-width: 72ch; }
.kp-text.kp-sz-f .kp-eyebrow { font-size: 13px; }
.kp-text.kp-sz-f .kp-q { right: auto; left: 22px; }
.kp-image.kp-sz-f { aspect-ratio: 16 / 7; }
.kp-contact.kp-sz-f { flex-direction: row; align-items: center; padding: clamp(22px, 3.4cqi, 36px); }
@container (max-width: 560px) { .kp-contact.kp-sz-f { flex-direction: column; align-items: flex-start; } }

/* ── Video: a poster until the visitor presses play (no third-party request before) ── */
.kp-video { padding: 0; color: #fff; }
.kp .kp-card.kp-video { background: #0b0b0f; } /* the poster frame is dark in every template */
.kp-video.kp-sz-f { aspect-ratio: 16 / 9; }
.kp-vid { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: inherit; color: #fff; }
.kp-vid img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.kp-vid:hover img { transform: scale(1.05); }
.kp-vid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.72)); pointer-events: none; }
.kp-vid-ph {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--accent) 65%, transparent), transparent 60%),
    radial-gradient(90% 80% at 90% 100%, color-mix(in oklab, var(--accent), #22d3ee 60%), transparent 55%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 4px),
    #0b0b0f;
}
.kp-play {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.94); color: #0b0b0f;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.6), 0 0 0 10px rgba(255,255,255,.14);
  transition: transform .45s var(--spring), box-shadow .45s var(--ease);
}
.kp-play svg { width: 30px; height: 30px; fill: currentColor; margin-left: 4px; }
.kp-vid:hover .kp-play { transform: scale(1.1); box-shadow: 0 22px 50px -12px rgba(0,0,0,.7), 0 0 0 16px rgba(255,255,255,.12); }
.kp-sz-s .kp-play, .kp-sz-w .kp-play { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.kp-sz-s .kp-play svg, .kp-sz-w .kp-play svg { width: 22px; height: 22px; }
.kp-vid-meta { position: absolute; inset-inline: 16px; bottom: 14px; z-index: 2; display: flex; flex-direction: column; line-height: 1.45; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.kp-vid-meta b { font-family: var(--display); font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-video.kp-sz-f .kp-vid-meta b, .kp-video.kp-sz-l .kp-vid-meta b { font-size: clamp(18px, 2.4cqi, 26px); }
.kp-vid-meta small { font-size: 12px; opacity: .8; font-weight: 700; }
.kp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; background: #000; }
.kp-video.kp-playing .kp-vid { visibility: hidden; }

/* ── Gallery: a scroll-snap strip + lightbox (page.js) ── */
.kp-gallery { padding: 0; }
.kp-gallery.kp-sz-f { aspect-ratio: 16 / 8; }
.kp-gal-track {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; border-radius: inherit;
}
.kp-gal-track::-webkit-scrollbar { display: none; }
.kp-gal-track:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.kp-gal-s { position: relative; flex: 0 0 100%; margin: 0; scroll-snap-align: start; overflow: hidden; }
.kp-gallery.kp-sz-f .kp-gal-track { gap: 8px; padding: 8px; scroll-padding-inline: 8px; }
.kp-gallery.kp-sz-f .kp-gal-s { flex-basis: min(72%, 560px); border-radius: calc(var(--radius) * .6); }
.kp-gal-open { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.kp-gal-s img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.kp-gal-s:hover img { transform: scale(1.04); }
.kp-gal-s figcaption {
  position: absolute; inset-inline: 12px; bottom: 12px; width: fit-content; max-width: calc(100% - 24px); padding: 5px 11px; border-radius: 11px;
  font-size: 12px; font-weight: 800; background: rgba(255,255,255,.85); color: #111; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.kp-gal-t, .kp-gal-n {
  position: absolute; top: 12px; z-index: 2; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 800;
  background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none;
}
.kp-gal-t { right: 12px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-gal-n { left: 12px; direction: rtl; }
.kp-gal-btn {
  position: absolute; top: 50%; z-index: 2; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.9); color: #111; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s, transform .35s var(--spring);
}
.kp-gal-btn .kp-ic { width: 18px; height: 18px; }
.kp-gal-prev { right: 10px; }
.kp-gal-next { left: 10px; }
.kp-gallery:hover .kp-gal-btn, .kp-gal-btn:focus-visible { opacity: 1; }
.kp-gal-btn:hover { transform: scale(1.08); }
.kp-gal-btn[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .kp-gal-btn { display: none; } }

.kp-lb {
  position: fixed; inset: 0; z-index: 50; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 8, 10, .92); color: #fff; display: grid; grid-template-rows: 1fr auto; place-items: center;
}
.kp-lb:not([open]) { display: none; }
.kp-lb::backdrop { background: transparent; }
.kp-lb img { max-width: min(94vw, 1400px); max-height: 82vh; object-fit: contain; border-radius: 12px; box-shadow: 0 40px 80px -30px #000; animation: kp-lb-in .35s var(--ease); }
@keyframes kp-lb-in { from { transform: scale(.96); } }
.kp-lb p { margin: 0 0 22px; font-size: 14px; font-weight: 700; opacity: .85; min-height: 1.5em; }
.kp-lb button { position: absolute; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; }
.kp-lb button:hover { background: rgba(255,255,255,.22); }
.kp-lb .kp-lb-x { top: 16px; left: 16px; }
.kp-lb .kp-lb-prev { right: 16px; top: 50%; margin-top: -24px; }
.kp-lb .kp-lb-next { left: 16px; top: 50%; margin-top: -24px; }
.kp-lb .kp-ic { width: 22px; height: 22px; }
.kp-lb-n { position: absolute; top: 26px; right: 24px; font-size: 13px; font-weight: 800; opacity: .75; }

/* ── Menu / price list ── */
.kp-menu { padding: clamp(20px, 3.2cqi, 36px); gap: 6px; }
.kp-menu-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.kp-menu-h h3 { font-family: var(--display); font-size: clamp(24px, 3.4cqi, 36px); font-weight: 900; line-height: 1.25; }
.kp-menu-cur { margin-inline-start: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.kp-menu-h p { flex-basis: 100%; order: 3; font-size: 14px; color: var(--muted); }
.kp-menu-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 12px -4px 0; padding: 4px; }
.kp-menu-nav::-webkit-scrollbar { display: none; }
.kp-menu-nav a { flex: none; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; font-weight: 800; transition: background .25s, color .25s, border-color .25s; }
.kp-menu-nav a:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.kp-menu-b { columns: 2 300px; column-gap: clamp(28px, 5cqi, 56px); }
.kp-mg { break-inside: avoid; padding-top: 22px; scroll-margin-top: 24px; }
.kp .kp-mg h4 { margin: 0 0 10px; font-family: var(--display); font-size: 17px; font-weight: 800; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.kp .kp-mg h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kp .kp-mg ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.kp-mi-h { display: flex; align-items: baseline; gap: 8px; }
.kp-mi-h b { font-weight: 800; font-size: 15px; min-width: 0; }
.kp-mi-h em { flex: none; font-style: normal; font-size: 10.5px; font-weight: 900; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.kp-mi-h i { flex: 1; min-width: 16px; border-bottom: 2px dotted color-mix(in srgb, currentColor 28%, transparent); transform: translateY(-5px); }
.kp-mi-p { flex: none; font-family: var(--display); font-weight: 900; font-size: 15px; white-space: nowrap; }
.kp-mi p { margin-top: 1px; font-size: 12.5px; color: var(--muted); line-height: 1.75; }

/* ── Map & address (no map iframe: a drawn map or the owner's photo) ── */
.kp-map { padding: 0; }
.kp-map-art { position: relative; flex: 1 1 auto; min-height: 90px; overflow: hidden; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.kp-map-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kp-map-streets { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: color-mix(in srgb, var(--ink) 16%, transparent); stroke-width: 7; stroke-linecap: round; }
.kp-map-minor { stroke-width: 2.2; opacity: .7; }
.kp-pin {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 46px; height: 46px; margin: -46px 0 0 -23px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--accent) 80%, #000);
}
.kp-pin .kp-ic { transform: rotate(45deg); width: 20px; height: 20px; }
.kp-pin::after { content: ""; position: absolute; left: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); opacity: .35; animation: kp-ping 2.2s var(--ease) infinite; }
.kp-map-b { position: relative; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; flex: none; }
.kp-map-b h3 { font-family: var(--display); font-size: 16px; font-weight: 800; line-height: 1.4; }
.kp-map-b p { font-size: 13px; color: var(--muted); line-height: 1.8; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.kp-routes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kp-route {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 11px; font-size: 12.5px; font-weight: 800;
  border: 1px solid var(--line); transition: transform .35s var(--spring), background .25s, color .25s, border-color .25s;
}
.kp-route .kp-ic { width: 17px; height: 17px; }
.kp-route:hover { background: var(--brand); color: var(--brand-ink); border-color: transparent; transform: translateY(-2px); }
.kp-map.kp-sz-w, .kp-map.kp-sz-f { flex-direction: row; }
.kp-map.kp-sz-w .kp-map-art { flex: 0 0 42%; }
.kp-map.kp-sz-w .kp-map-b, .kp-map.kp-sz-f .kp-map-b { flex: 1; justify-content: center; min-width: 0; }
.kp-map.kp-sz-f .kp-map-art { flex: 0 0 min(46%, 420px); min-height: 220px; }
.kp-map.kp-sz-f .kp-map-b { padding: clamp(20px, 3cqi, 32px); }
.kp-map.kp-sz-f .kp-map-b h3 { font-size: clamp(20px, 2.6cqi, 28px); }
.kp-map.kp-sz-s .kp-map-b { position: absolute; inset: auto 0 0; padding: 10px; }
.kp-map.kp-sz-s .kp-map-b p, .kp-map.kp-sz-s .kp-route span { display: none; }
.kp-map.kp-sz-s .kp-map-b h3 { font-size: 13px; }
.kp-map.kp-sz-s .kp-map-art { position: absolute; inset: 0; }
.kp-map.kp-sz-s .kp-route { width: 34px; height: 34px; padding: 0; justify-content: center; background: var(--card); }
@media (max-width: 640px) {
  .kp-map.kp-sz-t .kp-route { width: 36px; padding: 0; justify-content: center; }
  .kp-map.kp-sz-t .kp-route span { display: none; }
  .kp-map.kp-sz-t .kp-map-b p { -webkit-line-clamp: 2; }
}
@container (max-width: 560px) {
  .kp-map.kp-sz-f { flex-direction: column; }
  .kp-map.kp-sz-f .kp-map-art { flex: none; height: 180px; min-height: 0; }
}

/* ── Testimonial ── */
.kp-quote { justify-content: space-between; gap: 12px; }
.kp-quote .kp-q { right: auto; left: 18px; }
.kp .kp-quote blockquote {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.9;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
}
.kp .kp-quote.kp-sz-s blockquote { font-size: 12.5px; line-height: 1.75; -webkit-line-clamp: 3; }
.kp-quote.kp-sz-s .kp-stars, .kp-quote.kp-sz-s .kp-q { display: none; }
.kp .kp-quote.kp-sz-l blockquote, .kp .kp-quote.kp-sz-f blockquote, .kp .kp-quote.kp-sz-t blockquote {
  font-family: var(--display); font-size: clamp(19px, 2.4cqi, 28px); font-weight: 800; line-height: 1.65; -webkit-line-clamp: 8;
}
.kp .kp-quote.kp-sz-t blockquote { font-size: clamp(16px, 2cqi, 22px); }
.kp-quote.kp-sz-f { padding: clamp(24px, 3.6cqi, 40px); }
.kp-quote figcaption { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kp-qt-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.kp-qt-ini { display: grid; place-items: center; font-weight: 900; font-size: 15px; background: hsl(var(--h) 75% 86%); color: hsl(var(--h) 55% 24%); }
.kp-quote figcaption span { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.kp-quote figcaption b { font-size: 13.5px; font-weight: 800; }
.kp-quote figcaption small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-quote.kp-sz-s .kp-qt-av { display: none; }
.kp-stars { display: flex; gap: 2px; }
.kp-star { width: 16px; height: 16px; fill: color-mix(in srgb, currentColor 18%, transparent); }
.kp-star.on { fill: #f5b301; }

/* ── FAQ (native <details>; smooth open where the browser supports it) ── */
.kp-faq { padding: clamp(20px, 3.2cqi, 36px); gap: 14px; }
.kp-faq-t { font-family: var(--display); font-size: clamp(22px, 3.2cqi, 32px); font-weight: 900; line-height: 1.3; }
.kp-fqs { display: flex; flex-direction: column; }
.kp-fq { border-top: 1px solid var(--line); interpolate-size: allow-keywords; }
.kp-fq:last-child { border-bottom: 1px solid var(--line); }
.kp-fq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 2px; font-weight: 800; font-size: 15.5px; line-height: 1.7; }
.kp-fq summary::-webkit-details-marker { display: none; }
.kp-fq summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.kp-fq summary i { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); transition: transform .4s var(--spring), background .25s, color .25s; }
.kp-fq summary i::before, .kp-fq summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: currentColor; }
.kp-fq summary i::after { transform: rotate(90deg); }
.kp-fq[open] summary i { transform: rotate(135deg); background: var(--accent); color: var(--accent-ink); }
.kp-fq::details-content { height: 0; overflow: clip; transition: height .35s var(--ease), content-visibility .35s allow-discrete; }
.kp-fq[open]::details-content { height: auto; }
.kp-fq-a { padding: 0 2px 18px; color: var(--muted); font-size: 14.5px; line-height: 2; max-width: 75ch; }
.kp-fq-a .kp-rich, .kp-fq-a { display: block; overflow: visible; -webkit-line-clamp: none; }

/* ── Countdown ── */
.kp-countdown { justify-content: space-between; gap: 10px; }
.kp-cd-t { font-family: var(--display); font-size: 16px; font-weight: 800; line-height: 1.4; }
.kp-cd-units { display: flex; gap: 6px; }
.kp-cd-u { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 10px 2px 8px; border-radius: calc(var(--radius) * .45); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.kp-cd-u b { font-family: var(--display); font-weight: 900; font-size: clamp(22px, 4.4cqi, 46px); line-height: 1.1; font-variant-numeric: tabular-nums; display: inline-block; }
.kp-cd-u b.tick { animation: kp-tick .5s var(--spring); }
@keyframes kp-tick { from { transform: translateY(-35%); opacity: .3; } }
.kp-cd-u small { font-size: 11px; font-weight: 700; color: var(--muted); }
.kp-cd-when { font-size: 12px; font-weight: 600; color: var(--muted); }
.kp-cd-done { display: none; font-family: var(--display); font-size: clamp(22px, 3cqi, 32px); font-weight: 900; }
.kp-cd--over .kp-cd-units { display: none; }
.kp-cd--over .kp-cd-done { display: block; }
.kp-cd-cta, .kp-send {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 99px; width: fit-content;
  font-size: 14px; font-weight: 900; background: var(--accent); color: var(--accent-ink);
  transition: transform .35s var(--spring), filter .25s, opacity .25s;
}
.kp-cd-cta:hover, .kp-send:hover { transform: translateY(-2px) scale(1.03); }
.kp-countdown.kp-sz-s .kp-cd-u:last-child, .kp-countdown.kp-sz-s .kp-cd-when, .kp-countdown.kp-sz-s .kp-cd-cta { display: none; }
.kp-countdown.kp-sz-s .kp-cd-u { padding: 6px 1px; }
.kp-countdown.kp-sz-s .kp-cd-u b { font-size: clamp(18px, 3cqi, 26px); }
.kp-countdown.kp-sz-s .kp-cd-t { font-size: 13.5px; }
.kp-countdown.kp-sz-f, .kp-countdown.kp-sz-l { padding: clamp(22px, 3.4cqi, 36px); justify-content: center; gap: 16px; }
.kp-countdown.kp-sz-w .kp-cd-when { display: none; }
.kp-countdown.kp-sz-w .kp-cd-cta { position: absolute; top: 16px; left: 16px; height: 32px; padding: 0 14px; font-size: 12.5px; }
.kp-countdown.kp-sz-w .kp-cd-t { padding-left: 90px; }
.kp-countdown.kp-sz-f .kp-cd-t, .kp-countdown.kp-sz-l .kp-cd-t { font-size: clamp(20px, 2.8cqi, 30px); font-weight: 900; }
.kp-countdown.kp-sz-f .kp-cd-u b { font-size: clamp(34px, 6cqi, 72px); }

/* ── Lead form ── */
.kp-form { padding: clamp(22px, 3.4cqi, 40px); display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 20px clamp(24px, 4cqi, 48px); align-items: start; }
@container (max-width: 640px) { .kp-form { grid-template-columns: minmax(0, 1fr); } }
.kp-form-h { display: flex; flex-direction: column; gap: 8px; }
.kp-form-h h3 { font-family: var(--display); font-size: clamp(24px, 3.4cqi, 38px); font-weight: 900; line-height: 1.25; }
.kp-form-h p { font-size: 14.5px; color: var(--muted); line-height: 1.9; }
.kp-lead { position: relative; }
.kp-lead[inert] { opacity: .92; }
.kp-flds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kp-fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 800; min-width: 0; }
.kp-fld:has(textarea), .kp-fld:last-child:nth-child(odd) { grid-column: 1 / -1; }
.kp .kp-fld input, .kp .kp-fld textarea {
  width: 100%; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); resize: vertical; min-height: 48px;
  background: color-mix(in srgb, var(--ink) 4%, transparent); border: 1.5px solid var(--line); border-radius: calc(var(--radius) * .42);
  padding: 11px 14px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.kp .kp-fld input[dir="ltr"] { text-align: left; }
.kp .kp-fld input:focus, .kp .kp-fld textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); background: transparent; }
.kp-send { height: 50px; padding: 0 26px; margin-top: 14px; font-size: 15px; }
.kp-send .kp-ic { width: 18px; height: 18px; transform: scaleX(-1); }
.kp-send[disabled] { opacity: .6; pointer-events: none; }
.kp-form-msg { margin-top: 10px; font-size: 13.5px; font-weight: 700; min-height: 1.6em; }
.kp-form-msg.bad { color: #dc2626; }
.kp-lead.sent .kp-flds, .kp-lead.sent .kp-send { display: none; }
.kp-lead.sent .kp-form-msg { font-family: var(--display); font-size: clamp(18px, 2.4cqi, 24px); font-weight: 900; padding: 18px 0; }
.kp-lead.sent .kp-form-msg::before { content: "✓"; display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font); }
.kp-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Divider ── */
.kp-divider { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 40px; color: var(--muted); }
.kp-divider span { position: relative; z-index: 1; flex: none; padding: 3px 14px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 800; }
.kp-div-line::before, .kp-div-line::after, .kp-div-dots::before, .kp-div-dots::after { content: ""; flex: 1; height: 0; border-top: 1px solid var(--line); }
.kp-div-dots::before, .kp-div-dots::after { border-top: 3px dotted color-mix(in srgb, var(--ink) 22%, transparent); }
.kp-div-wave svg { position: absolute; inset: 50% 0 auto; width: 100%; height: 14px; margin-top: -7px; fill: none; stroke: color-mix(in srgb, var(--accent) 60%, transparent); stroke-width: 2; }
.kp-div-wave span { background: var(--bg); }
.kp-div-stars i { font-style: normal; color: var(--accent); font-size: 14px; word-spacing: 12px; }
.kp-div-space { min-height: 28px; }
.kp[data-preview] .kp-div-space { outline: 1px dashed var(--line); outline-offset: -4px; border-radius: 10px; }

/* ═════════════ Theme settings (KP-4.11) ═════════════
   `html .kp[…]` outranks each template's `.kp[data-tpl]` / `[data-tpl] .x`. */
html .kp[data-font="estedad"] { --display: "Estedad", "Vazirmatn", sans-serif; --dw: 900; }
html .kp[data-font="vazir"] { --display: "Vazirmatn", Tahoma, sans-serif; --dw: 900; }
html .kp[data-font="markazi"] { --display: "Markazi", "Vazirmatn", serif; --dw: 700; }
html .kp[data-font="lalezar"] { --display: "Lalezar", "Estedad", sans-serif; --dw: 400; }
html .kp[data-font] :is(.kp-name, .kp-section, .kp-body h3, .kp-contact-t, .kp-stat-v, .kp-menu-h h3, .kp-faq-t, .kp-form-h h3, .kp-cd-u b, .kp-cd-t, .kp-mq-track, .kp-link.kp-sz-l .kp-link-txt b, .kp-text.kp-sz-l p, .kp-price b, .kp-mi-p) {
  font-family: var(--display); font-weight: var(--dw);
}
html .kp[data-font="lalezar"] .kp-name { letter-spacing: 0; }

html .kp[data-radius="sharp"] { --radius: 4px; }
html .kp[data-radius="mid"] { --radius: 16px; }
html .kp[data-radius="round"] { --radius: 36px; }
html .kp[data-radius] :is(.kp-media, .kp-gal-s) { border-radius: calc(var(--radius) * .6); }
html .kp[data-radius] :is(.kp-image .kp-media, .kp-gallery:not(.kp-sz-f) .kp-gal-s) { border-radius: 0; }

html .kp[data-button] :is(.kp-cta, .kp-order, .kp-send, .kp-cd-cta) { transition: transform .35s var(--spring), background .25s, color .25s, box-shadow .25s; }
html .kp[data-button="fill"] :is(.kp-cta, .kp-order, .kp-send, .kp-cd-cta) {
  background: var(--accent); color: var(--accent-ink); border: 0; text-shadow: none;
  box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent) 90%, #000);
}
html .kp[data-button="outline"] :is(.kp-cta, .kp-order, .kp-send, .kp-cd-cta) {
  background: transparent; color: var(--ink); border: 0; box-shadow: inset 0 0 0 2px currentColor;
}
html .kp[data-button="outline"] :is(.kp-cta, .kp-order, .kp-send, .kp-cd-cta):hover { background: var(--ink); color: var(--bg); }
html .kp[data-button="glass"] :is(.kp-cta, .kp-order, .kp-send, .kp-cd-cta) {
  background: color-mix(in srgb, var(--accent) 22%, rgba(255,255,255,.14)); color: var(--ink); border: 0;
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 12px 26px -16px rgba(0,0,0,.45);
}

html .kp[data-bg="plain"] .kp-bg > *, html .kp[data-bg="plain"] .kp-grain { display: none; }
html .kp[data-bg="plain"] .kp-bg { background: var(--bg); }
html .kp[data-bg="gradient"] .kp-bg > i, html .kp[data-bg="gradient"] .kp-cover { display: none; }
html .kp[data-bg="gradient"] .kp-bg {
  background:
    radial-gradient(90vmax 70vmax at 100% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    radial-gradient(80vmax 60vmax at 0% 100%, color-mix(in oklab, var(--accent), #f472b6 55%) , transparent 55%),
    var(--bg);
}
html .kp[data-bg="gradient"] .kp-bg::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 62%, transparent); }
html .kp[data-bg="noise"] .kp-grain { opacity: .16; mix-blend-mode: multiply; }
html .kp[data-bg="noise"][data-tpl="aurora"] .kp-grain, html .kp[data-bg="noise"][data-tpl="glass"] .kp-grain, html .kp[data-bg="noise"][data-tpl="term"] .kp-grain { mix-blend-mode: overlay; opacity: .22; }
html .kp[data-bg="image"] .kp-bg > i { display: none; }
html .kp[data-bg="image"] .kp-cover { inset: -4%; filter: blur(2px) saturate(1.1); transform: none; }
html .kp[data-bg="image"] .kp-bg::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 58%, transparent); }

/* Colour scheme for the templates that ship both (bento, mono, soft): each
   template states its palette with light-dark(); these pick the scheme. */
.kp[data-mode="light"] { color-scheme: light; }
.kp[data-mode="dark"] { color-scheme: dark; }
.kp[data-mode="auto"] { color-scheme: light dark; }

@media (prefers-reduced-motion: reduce) {
  .kp *, .kp *::before, .kp *::after { animation: none !important; transition: none !important; }
  .kp[data-js] .kp-card, .kp[data-js] .kp-w { transform: none !important; }
}

/* ── Shop (phase 5): digital badge, buy sheet, receipt ──
   Everything reads the template's own tokens (--bg, --ink, --muted, --line,
   --accent), so the sheet and the receipt look native in all 8 templates.
   --card is never a background here: some templates make it a gradient. */
.kp-dig {
  position: absolute; bottom: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 900; padding: 4px 10px 4px 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--ink); backdrop-filter: blur(8px);
}
.kp-dig .kp-ic { width: 14px; height: 14px; }
button.kp-order { border: 0; cursor: pointer; font-family: inherit; }

.kp-pop {
  inset: auto 0 0 0; margin: 0 auto; width: min(100%, 480px); max-height: min(92dvh, 720px);
  overflow: hidden auto; overscroll-behavior: contain;
  padding: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0;
  background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.8;
  box-shadow: 0 -30px 80px -20px rgba(0, 0, 0, .45);
}
.kp-pop:popover-open { animation: kp-pop-up .42s var(--ease); }
@keyframes kp-pop-up { from { transform: translateY(40px); } }
.kp-pop::backdrop { background: rgba(8, 8, 12, .55); }
@media (min-width: 640px) {
  .kp-pop { inset: 0; margin: auto; height: fit-content; border-radius: 26px; border-bottom: 1px solid var(--line); }
}
.kp-pay {
  position: relative; padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 140px);
}
.kp-pop-x { position: absolute; top: 14px; left: 14px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.kp-pop-x .kp-ic { width: 18px; height: 18px; }
.kp-pop-k { font-size: 12px; font-weight: 900; color: var(--accent); }
.kp-pay h3 { font-family: var(--display); font-size: 22px; font-weight: 900; line-height: 1.35; padding-left: 40px; }
.kp-pop-p { font-size: 14px; color: var(--muted); }
.kp-pop-p b { font-family: var(--display); font-size: 26px; font-weight: 900; color: var(--ink); }
.kp-pop-warn, .kp-rc-warn {
  margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 700; line-height: 1.8; color: var(--ink);
  background: color-mix(in srgb, #f59e0b 16%, transparent); border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent);
}
.kp-pop-dig { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.kp-pop-dig .kp-ic { width: 17px; height: 17px; color: var(--accent); }
.kp-pay .kp-flds { grid-template-columns: minmax(0, 1fr); margin-top: 4px; }
.kp-pay .kp-send { width: 100%; margin-top: 6px; }
.kp-pay .kp-send .kp-ic, .kp-rc .kp-send .kp-ic { transform: none; }
.kp-pay .kp-form-msg { margin-top: 0; min-height: 0; }
.kp-pay .kp-form-msg:empty { display: none; }
.kp-pop-how { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.8; }
.kp-pop-how .kp-ic { width: 15px; height: 15px; margin-top: 3px; }

/* Secondary action. `html .kp` + two classes: outranks the templates' own .kp-send
   fills and the theme button settings; a template's border and offset shadow stay. */
html .kp .kp-send.kp-send--line { background: transparent; color: var(--ink); }
html .kp .kp-send.kp-send--line:not([data-tpl="pop"] *) { box-shadow: inset 0 0 0 1.5px var(--line); }
html .kp .kp-send.kp-send--line:not([data-tpl="pop"] *):hover { box-shadow: inset 0 0 0 1.5px var(--accent); }

.kp-rc-body { display: flex; flex-direction: column; }
.kp-rc { position: relative; z-index: 1; width: min(100% - 32px, 560px); margin: 0 auto; padding: 32px 0 8px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.kp-rc-seller { display: flex; align-items: center; gap: 12px; width: fit-content; }
.kp-rc-seller img, .kp-rc-seller > span:first-child { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font-weight: 900; }
.kp-rc-seller small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.kp-rc-seller b { font-family: var(--display); font-size: 17px; font-weight: 900; line-height: 1.4; }
.kp-rc-card {
  --tone: var(--accent);
  border-radius: 28px; padding: clamp(22px, 5vw, 34px); display: flex; flex-direction: column; gap: 20px;
  background: var(--bg); background-image: linear-gradient(180deg, color-mix(in srgb, var(--tone) 10%, transparent), transparent 220px);
  border: 1px solid var(--line); box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .45);
}
.kp-rc-card[data-tone="ok"] { --tone: #16a34a; }
.kp-rc-card[data-tone="bad"] { --tone: #dc2626; }
.kp-rc-card[data-tone="wait"] { --tone: #f59e0b; }
.kp-rc-state { display: flex; flex-direction: column; gap: 8px; }
.kp-rc-ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--tone); color: #fff; margin-bottom: 6px; animation: kp-rc-pop .6s var(--spring); }
.kp-rc-ic .kp-ic { width: 28px; height: 28px; stroke-width: 2.6; }
@keyframes kp-rc-pop { from { transform: scale(.6); } }
.kp-rc-state h1 { font-family: var(--display); font-size: clamp(24px, 6vw, 32px); font-weight: 900; line-height: 1.3; }
.kp-rc-state p { color: var(--muted); font-size: 14.5px; }
.kp-rc-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.kp-rc-steps li { counter-increment: s; position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; padding-inline-start: 54px; border-radius: 18px; border: 1px solid var(--line); }
.kp-rc-steps li::before { content: counter(s, persian); position: absolute; right: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 900; font-size: 13px; }
.kp-rc-steps b { font-size: 15px; }
.kp-rc-steps span { font-size: 13.5px; color: var(--muted); }
.kp-rc-steps .kp-send, .kp-rc-steps form { margin: 0; }
.kp-rc code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; font-weight: 700; unicode-bidi: isolate; }
.kp-rc-dl { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--tone) 9%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); }
.kp-rc-dl > small { font-size: 12.5px; color: var(--muted); }
.kp-rc-dl .kp-send { width: 100%; margin: 0; }
.kp-rc-file { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kp-rc-file b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.kp-rc-file small { color: var(--muted); font-size: 12px; flex: none; }
.kp-rc-rows { margin: 0; display: flex; flex-direction: column; border-top: 1px dashed var(--line); }
.kp-rc-rows > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kp-rc-rows dt { color: var(--muted); flex: none; }
.kp-rc-rows dd { margin: 0; font-weight: 800; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.kp-rc-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.kp-rc-acts .kp-send { margin: 0; }
.kp-rc-acts .kp-cbtn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 99px; font-weight: 900; font-size: 14px; background: var(--brand); color: var(--brand-ink); }
.kp-rc-keep { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.kp-rc-keep > .kp-ic { width: 15px; height: 15px; }
.kp-rc-keep span { flex: 1; min-width: 200px; }
.kp-rc-body .kp-foot { gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; align-items: center; }

/* ── Booking (KP-5.3) ── day tabs + slot grid + details. Works without JS: every
   day is listed; page.js adds .kp-bk--tabs and shows one day (.on) at a time. */
.kp-booking { padding: clamp(22px, 3.4cqi, 40px); display: flex; flex-direction: column; gap: 18px; }
.kp-bk-h { display: flex; flex-direction: column; gap: 6px; }
.kp-bk-h h3 { font-family: var(--display); font-size: clamp(22px, 3.2cqi, 34px); font-weight: 900; line-height: 1.25; }
.kp-bk-h p { font-size: 14.5px; color: var(--muted); line-height: 1.9; }
.kp-bk-h small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kp-bk-h small .kp-ic { width: 15px; height: 15px; }
.kp-bk { display: flex; flex-direction: column; gap: 14px; position: relative; }
.kp-bk[inert] { opacity: .95; }
.kp-bk-none { font-size: 14px; color: var(--muted); padding: 14px 0; }
.kp-bk-tabs { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; scrollbar-width: thin; }
.kp-bk-tabs[hidden] { display: none; }
.kp-bk-tab {
  flex: none; scroll-snap-align: start; min-width: 64px; padding: 8px 10px; border-radius: calc(var(--radius) * .45);
  display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.5;
  border: 1.5px solid var(--line); color: var(--ink); transition: background .2s, border-color .2s, transform .25s var(--spring);
}
.kp-bk-tab small { font-size: 11px; color: var(--muted); font-weight: 700; }
.kp-bk-tab b { font-family: var(--display); font-size: 20px; font-weight: 900; }
.kp-bk-tab[data-full] { opacity: .45; }
.kp-bk-tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.kp-bk-tab[aria-pressed="true"] small { color: inherit; opacity: .85; }
.kp-bk-pane { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.kp-bk-pane + .kp-bk-pane { margin-top: 12px; }
.kp-bk-pane legend { font-size: 13.5px; font-weight: 900; margin-bottom: 8px; padding: 0; }
.kp-bk--tabs .kp-bk-pane { display: none; margin: 0; }
.kp-bk--tabs .kp-bk-pane.on { display: flex; }
.kp-bk--tabs .kp-bk-pane legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.kp-bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.kp-bk-slot { position: relative; }
.kp-bk-slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kp-bk-slot span {
  display: grid; place-items: center; height: 42px; border-radius: calc(var(--radius) * .38); font-weight: 800; font-size: 14px;
  border: 1.5px solid var(--line); background: color-mix(in srgb, var(--ink) 3%, transparent); transition: all .18s;
}
.kp-bk-slot input:hover + span { border-color: var(--accent); }
.kp-bk-slot input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.kp-bk-slot input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kp-bk-slot input:disabled { cursor: not-allowed; }
.kp-bk-slot input:disabled + span { opacity: .35; text-decoration: line-through; }
.kp-bk-full { font-size: 13px; color: var(--muted); }
.kp-bk-form { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px dashed var(--line); }
.kp-bk-form .kp-send .kp-ic { transform: none; }
/* Details appear once a time is picked (where :has() exists; elsewhere they simply show). */
@supports selector(:has(*)) {
  .kp-bk:not(:has(input[name="slot"]:checked)) .kp-bk-form .kp-flds { display: none; }
}

/* ── Phase 6: hidden blocks (editor preview), stickers, mood, animated backgrounds,
   now playing, guestbook, reactions, retro counter. Template tokens only. ── */
.kp[data-preview] [data-hidden] { opacity: .38; filter: grayscale(.6); outline: 2px dashed var(--line); outline-offset: -2px; }
.kp[data-preview] [data-hidden]::after {
  content: "پنهان"; position: absolute; top: 10px; left: 10px; z-index: 5; font-size: 11px; font-weight: 900;
  padding: 2px 9px; border-radius: 99px; background: var(--ink); color: var(--bg);
}

.kp-hero { position: relative; }
.kp-stickers { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.kp-stk {
  position: absolute; width: calc(84px * var(--s, 1)); aspect-ratio: 1; margin: calc(-42px * var(--s, 1)) 0 0 calc(-42px * var(--s, 1));
  transform: rotate(var(--r, 0deg)); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18));
  animation: kp-stk-in .6s var(--spring) both;
}
.kp-stk svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes kp-stk-in { from { transform: rotate(var(--r, 0deg)) scale(.4); } }
.kp[data-still] .kp-stk { animation: none; }
.kp[data-preview] .kp-stickers { pointer-events: none; }
.kp[data-preview] .kp-stk { pointer-events: auto; cursor: grab; touch-action: none; }
.kp[data-preview] .kp-stk.drag { cursor: grabbing; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .3)); }
@media (max-width: 560px) { .kp-stk { width: calc(62px * var(--s, 1)); margin: calc(-31px * var(--s, 1)) 0 0 calc(-31px * var(--s, 1)); } }

.kp-mood {
  position: absolute; z-index: 4; bottom: -4px; inset-inline-start: calc(100% - 26px); display: inline-flex; align-items: center; gap: 6px;
  max-width: min(230px, calc(50vw - 36px)); padding: 6px 12px 6px 10px; border-radius: 4px 18px 18px 18px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .35);
  font-size: 12.5px; font-weight: 700; line-height: 1.5; white-space: nowrap; animation: kp-mood-in .7s var(--spring) .3s both;
}
.kp-mood i { font-style: normal; font-size: 18px; }
.kp-mood span { overflow: hidden; text-overflow: ellipsis; }
@keyframes kp-mood-in { from { transform: translateY(8px) scale(.8); } }
.kp[data-still] .kp-mood { animation: none; }

/* Animated backgrounds (KP-6.8): one extra layer on .kp-bg, transform-only motion.
   The global prefers-reduced-motion rule freezes them into still art. */
html .kp[data-anim] .kp-bg::before, html .kp[data-anim] .kp-bg::after { content: ""; position: absolute; pointer-events: none; }
html .kp[data-anim="flow"] .kp-bg::before {
  inset: -40%; opacity: .55;
  background: conic-gradient(from 0deg at 50% 50%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 30%,
    color-mix(in srgb, var(--accent) 25%, #38bdf8) 55%, transparent 75%, color-mix(in srgb, var(--accent) 45%, transparent));
  filter: blur(60px); animation: kp-anim-spin 38s linear infinite;
}
html .kp[data-anim="float"] .kp-bg::before, html .kp[data-anim="float"] .kp-bg::after {
  width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(50px); opacity: .5;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%);
  top: -10vmax; left: -10vmax; animation: kp-anim-float 22s ease-in-out infinite alternate;
}
html .kp[data-anim="float"] .kp-bg::after {
  top: auto; left: auto; bottom: -12vmax; right: -12vmax; animation-duration: 27s; animation-direction: alternate-reverse;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, #f472b6), transparent 70%);
}
html .kp[data-anim="stars"] .kp-bg::before {
  inset: -100% 0 0; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, var(--ink), transparent), radial-gradient(1px 1px at 90px 120px, var(--ink), transparent),
    radial-gradient(2px 2px at 160px 60px, var(--accent), transparent), radial-gradient(1px 1px at 230px 170px, var(--ink), transparent),
    radial-gradient(1.5px 1.5px at 60px 200px, var(--accent), transparent);
  background-size: 260px 240px; animation: kp-anim-drift 60s linear infinite;
}
html .kp[data-anim="stars"] .kp-bg::after { inset: 0; background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%); }
html .kp[data-anim="grid"] .kp-bg::before {
  left: -50%; right: -50%; bottom: -10%; height: 60%; opacity: .45; transform-origin: 50% 100%;
  background-image: linear-gradient(color-mix(in srgb, var(--accent) 70%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent) 1px, transparent 1px);
  background-size: 56px 56px; transform: perspective(420px) rotateX(62deg);
  mask-image: linear-gradient(transparent, #000 70%); animation: kp-anim-grid 3.2s linear infinite;
}
@keyframes kp-anim-spin { to { transform: rotate(1turn); } }
@keyframes kp-anim-float { to { transform: translate(18vmax, 22vmax) scale(1.15); } }
@keyframes kp-anim-drift { to { transform: translateY(50%); } }
@keyframes kp-anim-grid { to { background-position: 0 56px; } }

/* Now playing (KP-6.6) */
.kp-music { display: flex; align-items: center; gap: 14px; padding: 16px; min-width: 0; }
.kp-music.kp-sz-s, .kp-music.kp-sz-l { flex-direction: column; justify-content: center; text-align: center; }
.kp-mu-art { flex: none; width: 88px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; position: relative; }
.kp-music.kp-sz-s .kp-mu-art { width: 64px; }
.kp-music.kp-sz-l .kp-mu-art { width: min(62%, 220px); border-radius: 50%; animation: kp-anim-spin 9s linear infinite; }
.kp-mu-art img { width: 100%; height: 100%; object-fit: cover; }
.kp-vinyl { position: absolute; inset: 0; border-radius: 50%; background:
  radial-gradient(circle, var(--accent) 0 16%, #111 17% 19%, transparent 20%),
  repeating-radial-gradient(circle, #1a1a1a 0 2px, #0b0b0b 3px 4px); animation: kp-anim-spin 6s linear infinite; }
.kp-mu-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; }
.kp-music.kp-sz-s .kp-mu-body, .kp-music.kp-sz-l .kp-mu-body { align-items: center; }
.kp-mu-now { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; color: var(--accent); }
.kp-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.kp-eq i { width: 3px; height: 100%; background: currentColor; border-radius: 2px; transform-origin: bottom; animation: kp-eq .9s ease-in-out infinite alternate; }
.kp-eq i:nth-child(2) { animation-delay: -.3s; }
.kp-eq i:nth-child(3) { animation-delay: -.6s; }
.kp-eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes kp-eq { from { transform: scaleY(.25); } }
.kp-mu-title { font-family: var(--display); font-size: 17px; font-weight: 900; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.kp-mu-artist { font-size: 13px; color: var(--muted); }
.kp-mu-on { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.kp-mu-on .kp-ic { width: 14px; height: 14px; }

/* Guestbook (KP-6.7) */
.kp-guestbook { padding: clamp(22px, 3.4cqi, 40px); display: flex; flex-direction: column; gap: 16px; }
.kp-gb-h h3 { font-family: var(--display); font-size: clamp(22px, 3.2cqi, 34px); font-weight: 900; line-height: 1.25; }
.kp-gb-h p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.kp-gb-notes { list-style: none; margin: 0; padding: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.kp-gb-note {
  position: relative; padding: 14px 14px 12px; border-radius: 18px 6px 18px 18px; transform: rotate(calc((var(--i) - 1) * .8deg));
  background: color-mix(in oklab, hsl(var(--h) 85% 80%) 60%, #fff); color: #1b1b1b; box-shadow: 0 10px 20px -14px rgba(0, 0, 0, .4);
}
.kp-gb-note:nth-child(3n) { transform: rotate(-.9deg); }
.kp-gb-note:nth-child(3n+1) { transform: rotate(.7deg); }
.kp-gb-note i { position: absolute; top: -12px; left: -6px; font-style: normal; font-size: 22px; }
.kp-gb-note p { font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.kp-gb-note b { display: block; margin-top: 6px; font-size: 12px; opacity: .75; }
.kp-gb-empty { font-size: 13.5px; color: var(--muted); }
.kp-gb { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); padding-top: 14px; position: relative; }
.kp-gb .kp-flds { grid-template-columns: minmax(0, 1fr); }
.kp-gb-es { display: flex; gap: 6px; flex-wrap: wrap; }
.kp-gb-e { position: relative; }
.kp-gb-e input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kp-gb-e span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; border: 1.5px solid var(--line); transition: transform .25s var(--spring); }
.kp-gb-e input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); transform: scale(1.1); }
.kp-gb-e input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.kp-gb.sent .kp-flds, .kp-gb.sent .kp-send, .kp-gb.sent .kp-gb-es { display: none; }
.kp-gb .kp-send .kp-ic { transform: scaleX(-1); }

/* Reactions (KP-6.7) */
.kp-reactions { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.kp-react-t { font-size: 14.5px; font-weight: 900; }
.kp-reacts { display: flex; gap: 8px; flex-wrap: wrap; }
.kp-react {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 14px; border-radius: 99px;
  border: 1.5px solid var(--line); background: color-mix(in srgb, var(--ink) 3%, transparent); transition: transform .3s var(--spring), border-color .2s;
}
.kp-react i { font-style: normal; font-size: 21px; line-height: 1; }
.kp-react b { font-size: 13px; font-weight: 900; }
.kp-react b:empty { display: none; }
.kp-react:hover { transform: translateY(-2px) scale(1.06); border-color: var(--accent); }
.kp-react.done { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.kp-react.pop i { animation: kp-react-pop .5s var(--spring); }
@keyframes kp-react-pop { 40% { transform: scale(1.6) rotate(-12deg); } }

/* Retro counter (KP-6.9) */
.kp-counter { padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.kp-odo { display: inline-flex; gap: 3px; direction: ltr; }
/* Six digits must fit a 1×1 card on a phone: size them from the blocks container (cqi). */
.kp-odo b { display: grid; place-items: center; width: clamp(16px, 5.4cqi, 26px); height: clamp(24px, 8cqi, 38px); border-radius: 5px; font-family: ui-monospace, Consolas, monospace; font-size: clamp(14px, 4.6cqi, 22px); font-weight: 800; }
.kp-counter small { font-size: 12px; font-weight: 700; color: var(--muted); }
.kp-counter--odo .kp-odo b { background: linear-gradient(#2b2b2b 0 49%, #1a1a1a 51%); color: #f5f5f5; box-shadow: inset 0 0 0 1px #000, 0 2px 0 #000; }
.kp-counter--lcd .kp-odo { padding: 6px 8px; border-radius: 8px; background: #0f1a0f; box-shadow: inset 0 0 12px #000; }
.kp-counter--lcd .kp-odo b { width: clamp(13px, 4.4cqi, 20px); height: clamp(22px, 7cqi, 32px); background: none; color: #7dff6b; text-shadow: 0 0 8px #3aff2a; }
.kp-counter--neon .kp-odo b { background: none; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: 0 0 12px -2px var(--accent), inset 0 0 8px -2px var(--accent); text-shadow: 0 0 10px var(--accent); }

/* ── Generative cover art (render.php kp_ph_art) ──
   A seeded SVG behind the letter/icon of any image-less block. Shapes carry
   role classes; each template sets the palette (--pa…--pe, --pl line, --ps stroke). */
.kp-ph-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
.kp-ph-art .a { fill: var(--pa, hsl(var(--h) 78% 60%)); }
.kp-ph-art .b { fill: var(--pb, hsl(calc(var(--h) + 55) 82% 66%)); }
.kp-ph-art .c { fill: var(--pc, hsl(calc(var(--h) + 180) 64% 52%)); }
.kp-ph-art .d { fill: var(--pd, hsl(calc(var(--h) + 250) 60% 78%)); }
.kp-ph-art .e { fill: var(--pe, transparent); }
.kp-ph-art .ln { fill: none; stroke: var(--pl, currentColor); stroke-width: 2; opacity: .3; }
.kp-ph-art .wv { fill: none; stroke-width: 16; stroke-linecap: round; }
.kp-ph-art .wv.a { stroke: var(--pa, hsl(var(--h) 78% 60%)); }
.kp-ph-art .wv.b { stroke: var(--pb, hsl(calc(var(--h) + 55) 82% 66%)); }
.kp-ph-art .wv.c { stroke: var(--pc, hsl(calc(var(--h) + 180) 64% 52%)); }
.kp-ph-art .wv.d { stroke: var(--pd, hsl(calc(var(--h) + 250) 60% 78%)); }
.kp-ph-art .st { stroke: var(--ps, #111); stroke-width: 6; stroke-linejoin: round; }
.kp-ph > .kp-ph-l, .kp-ph > .kp-ph-ic { z-index: 1; }
/* The art drifts a little when its card is hovered (motion-safe). */
.kp-card .kp-ph-art { transition: transform 1.2s var(--ease); }
.kp-card:hover .kp-ph-art { transform: scale(1.06) rotate(-1.5deg); }
@media (prefers-reduced-motion: reduce) { .kp-card:hover .kp-ph-art { transform: none; } }
