/* site.css — component classes on top of Tailwind utilities.
   Brand colors come from theme.css (generated from branding.colors in the
   site config): --color-primary, --color-dark, --color-secondary,
   --color-surface, --color-text. */

/* Theme tokens. Light is the default; [data-theme="dark"] flips the
   neutrals while brand colors (primary/dark) stay put. The attribute is
   set pre-paint by the inline script in <head> (system preference or the
   editor's stored choice). */
:root {
  --zk-hover: rgba(0, 0, 0, 0.045);
  --zk-border-soft: rgba(0, 0, 0, 0.07);
  --zk-border: rgba(0, 0, 0, 0.1);
  --zk-border-strong: rgba(0, 0, 0, 0.17);
  --zk-chrome: #101725;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --color-surface: #0e1319;
  --color-text: #e7eaef;
  --color-secondary: #96a0ae;
  --zk-hover: rgba(255, 255, 255, 0.06);
  --zk-border-soft: rgba(255, 255, 255, 0.07);
  --zk-border: rgba(255, 255, 255, 0.11);
  --zk-border-strong: rgba(255, 255, 255, 0.18);
  --zk-chrome: #1a2230;
  color-scheme: dark;
}

/* ── Buttons ──────────────────────────────────────────────────────────
   Structure from the Pines button component (inline-flex centring, tracked
   text, ring-style focus); colour from this site's own tokens rather than
   Pines' neutral-950, so buttons stay on-brand.

   Two things this fixes over the old single rule:
     · display was inline-block, so a button containing an icon + label did
       not align them. inline-flex + gap does.
     · there was NO focus style anywhere. Keyboard users had nothing to see.
       :focus-visible gives a ring to keyboard users without putting one on
       every mouse click.

   Variants: .btn-primary (default), .btn-secondary, .btn-outline,
   .btn-ghost, .btn-danger.  Size: add .btn-sm.  Use with <a> or <button>. */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 120ms ease, transform 120ms ease,
              background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

/* Keyboard-only focus ring (Pines uses ring-2 + ring-offset-2) */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-outline:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary);
}

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-secondary {
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  color: var(--color-text);
}
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 14%, transparent); }

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: color-mix(in srgb, var(--color-text) 25%, transparent);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-ghost { background: transparent; color: var(--color-secondary); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text); }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8125rem; border-radius: 0.4rem; }

/* Disabled / in-flight: same treatment whichever variant */
.btn-primary[disabled], .btn-secondary[disabled], .btn-outline[disabled],
.btn-ghost[disabled], .btn-danger[disabled],
.btn-primary[aria-disabled="true"], .btn-secondary[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
  transform: none;
}

/* Respect reduced motion — no lift */
@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover, .btn-secondary:hover, .btn-outline:hover,
  .btn-ghost:hover, .btn-danger:hover { transform: none; }
}

/* htmx request spinner (hx-indicator): shown while a request is in flight —
   htmx puts .htmx-request on the element that fired the request. */
.zk-spinner {
  display: none; width: 0.85em; height: 0.85em; margin-left: 0.55em;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; vertical-align: -0.12em;
  animation: zk-spin 0.6s linear infinite;
}
.htmx-request .zk-spinner, .htmx-request.zk-spinner { display: inline-block; }
@keyframes zk-spin { to { transform: rotate(360deg); } }
.zk-form-error {
  margin-bottom: 1rem; padding: 0.7rem 0.9rem; border-radius: 0.5rem;
  font-size: 0.875rem; color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.navlink {
  color: var(--color-secondary);
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: color 120ms ease;
}
.navlink:hover { color: var(--color-text); }
.navlink-active { color: var(--color-text); font-weight: 700; }

.card {
  border: 1px solid var(--zk-border);
  border-radius: 1rem;
  padding: 1.75rem;
  background: var(--color-surface);
}

/* Responsive 16:9 video embed (rendered when a callout sets `youtube`).
   .zk-video caps the width; .zk-video-frame keeps the aspect ratio. A
   site's custom.css can add a fancy frame (border, glow, rounding). */
.zk-video { max-width: 48rem; }
.zk-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
}
.zk-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Optional Lucide icon chip at the top of a feature card (rendered when a
   feature-grid item sets `icon`). Tinted with the brand primary; a site's
   custom.css can restyle it. */
.zk-card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

/* Hero band. Default: brand gradient. With a pages.hero_image file the
   renderer sets a background-image inline (hero-image variant). */
.hero {
  background: linear-gradient(135deg, var(--color-dark), var(--color-primary));
  color: #fff;
}
.hero-image {
  background-size: cover;
  background-position: center;
}

/* Rich-text content from the PB editor (no Tailwind classes inside) */
.article { line-height: 1.75; }
.article h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; margin: 2rem 0 0.75rem; }
.article h3 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.article p { margin: 1rem 0; }
.article ul, .article ol { margin: 1rem 0; padding-left: 1.5rem; }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li { margin: 0.375rem 0; }
.article a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.article img { border-radius: 0.75rem; margin: 1.5rem 0; max-width: 100%; }
.article blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1rem;
  color: var(--color-secondary);
  font-style: italic;
  margin: 1.5rem 0;
}
.article code { font-size: 0.875em; background: var(--zk-hover); padding: 0.1em 0.35em; border-radius: 0.25em; }
/* Code blocks: wrap long commands instead of widening the page (mobile),
   and read as a proper block rather than one long inline chip. */
.article pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--zk-hover);
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  margin: 1.25rem 0;
  font-size: 0.875em;
}
.article pre code { background: none; padding: 0; font-size: 1em; }

/* ── Form fields ──────────────────────────────────────────────────────
   Pines input structure (consistent height, ring focus, explicit disabled
   and placeholder treatment) using this site's tokens. The focus ring is
   deliberately the same shape as the button ring so the whole form reads as
   one system. */
.input {
  width: 100%;
  border: 1px solid var(--zk-border-strong);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder { color: var(--color-secondary); opacity: 0.65; }
/* :not(:user-invalid) matters — without it the hover rule (four compound
   parts) outranks .input:user-invalid (two), so mousing over a field you got
   wrong quietly repaints its border grey while the red ring stays. */
.input:hover:not(:focus):not([disabled]):not(:user-invalid) {
  border-color: color-mix(in srgb, var(--color-text) 34%, transparent);
}
.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
}
.input[disabled], .input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
}

/* :user-invalid, NOT :invalid — :invalid matches every empty required field
   the moment the page loads, so a pristine form would render all-red before
   anyone has typed. :user-invalid only applies after the user has interacted
   with the field (or tried to submit), which is the behaviour people expect. */
.input:user-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px color-mix(in srgb, #dc2626 18%, transparent);
}
.input:user-invalid + .zk-field-hint { color: #dc2626; }

/* The error mark is not decoration. This site's --color-primary is red, so a
   focused field and a wrong one are the same colour — and colour alone is not
   an accessible error signal anyway (WCAG 1.4.1). The glyph is what actually
   distinguishes them. Not on textarea/select: it would sit over the text or
   the native chevron. */
input.input:user-invalid {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.zk-field-hint { display: block; margin-top: 0.3rem; font-size: 0.75rem; color: var(--color-secondary); }
textarea.input { min-height: 7rem; resize: vertical; }

/* SPA page transition — route() re-runs this animation on every render */
.page-enter { animation: zk-page-enter 240ms ease both; }
@keyframes zk-page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page-enter { animation: none; }
}

/* Honeypot — visually gone, still in the DOM for bots to find */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Edit mode (js/edit.js — Cmd/Ctrl+J) ─────────────────────────────── */
.zk-editing [data-editable] {
  outline: 2px dashed color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 4px;
  border-radius: 0.25rem;
  cursor: text;
  transition: outline-color 120ms ease;
}
.zk-editing [data-editable]:hover,
.zk-editing [data-editable]:focus {
  outline-color: var(--color-primary);
  outline-style: solid;
}

/* Field HUD is contextual — hidden until a text/image/button/card is active */
.zk-hud.zk-hud-hidden { display: none !important; }

.zk-hud {
  position: fixed;
  /* Positioned by JS (applyHudPosition / drag); starts bottom-center */
  bottom: 1.25rem;
  left: 0;
  right: auto;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--zk-chrome);
  color: #fff;
  padding: 0.625rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: calc(100vw - 2rem);
}

/* ── Mode chrome: top editing rail (not a floating pill) ───────────── */
.zk-modebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  user-select: none;
}
.zk-modebar.zk-modebar-hidden { display: none !important; }

/* Push page content below the rail while editing */
html.zk-modebar-on body {
  padding-top: 2.75rem;
}

.zk-modebar-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.85rem 0.4rem 0.75rem;
  background: color-mix(in srgb, var(--color-surface, #fff) 92%, var(--color-text, #111));
  border-bottom: 1px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--color-text, #111) 4%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
:root.dark .zk-modebar-rail,
.dark .zk-modebar-rail {
  background: rgba(20, 20, 22, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  color: #f5f5f5;
}

.zk-modebar-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.zk-modebar-mark {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--color-primary, #ed2024);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #ed2024) 22%, transparent);
  flex-shrink: 0;
}
.zk-modebar-status {
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: inherit;
}
.zk-modebar-hint {
  font-size: 0.75rem;
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .zk-modebar-hint { display: none; }
}

.zk-modebar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.zk-modebar-menuwrap {
  position: relative;
}
.zk-modebar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  opacity: 0.85;
  transition: background 120ms ease, opacity 120ms ease;
}
.zk-modebar-btn:hover {
  background: color-mix(in srgb, var(--color-text, #111) 8%, transparent);
  opacity: 1;
}
:root.dark .zk-modebar-btn:hover,
.dark .zk-modebar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.zk-modebar-btn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--color-text, #111) 10%, transparent);
  opacity: 1;
}
.zk-modebar-chev { opacity: 0.45; }
.zk-modebar-divider {
  width: 1px;
  height: 1.1rem;
  margin: 0 0.2rem;
  background: color-mix(in srgb, var(--color-text, #111) 14%, transparent);
}
.zk-modebar-exit { opacity: 0.65; }
.zk-modebar-exit:hover {
  background: color-mix(in srgb, #ef4444 14%, transparent);
  color: #b91c1c;
  opacity: 1;
}
:root.dark .zk-modebar-exit:hover,
.dark .zk-modebar-exit:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.zk-modebar-dirty {
  color: #b45309;
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  opacity: 1;
  font-weight: 600;
}
.zk-modebar-dirty:hover {
  background: color-mix(in srgb, #f59e0b 26%, transparent);
}
:root.dark .zk-modebar-dirty,
.dark .zk-modebar-dirty {
  color: #fbbf24;
}

.zk-modebar-draft {
  color: #a16207;
  opacity: 1;
}
:root.dark .zk-modebar-draft,
.dark .zk-modebar-draft {
  color: #fcd34d;
}

.zk-modebar-popups {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 5;
  min-width: 15rem;
}
.zk-modebar-menu {
  overflow: hidden;
  border-radius: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
  background: var(--color-surface, #fff);
  color: var(--color-text, #111);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}
:root.dark .zk-modebar-menu,
.dark .zk-modebar-menu {
  background: #1c1c1e;
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
.zk-modebar-menuitem {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text, #111) 8%, transparent);
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-size: 0.875rem;
}
.zk-modebar-menuitem:last-child { border-bottom: 0; }
.zk-modebar-menuitem:hover {
  background: color-mix(in srgb, var(--color-text, #111) 6%, transparent);
}
:root.dark .zk-modebar-menuitem:hover,
.dark .zk-modebar-menuitem:hover {
  background: rgba(255, 255, 255, 0.06);
}
.zk-modebar-mi-icon { flex-shrink: 0; opacity: 0.7; }
.zk-modebar-menuitem[data-zk-mi-analytics] .zk-modebar-mi-icon { color: #7c6cf0; opacity: 1; }
.zk-modebar-menuitem[data-zk-mi-seo] .zk-modebar-mi-icon { color: #14b8a6; opacity: 1; }
.zk-modebar-mi-text { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.zk-modebar-mi-title { font-weight: 600; }
.zk-modebar-mi-sub { font-size: 0.75rem; opacity: 0.5; }

.zk-hud-status { opacity: 0.7; min-width: 0; }
.zk-hud-sep {
  width: 1px;
  height: 1.25rem;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.zk-hud-formats { display: flex; align-items: center; gap: 0.25rem; }
.zk-fmt { min-width: 1.75rem; padding-left: 0.45rem; padding-right: 0.45rem; font-weight: 700; }
.zk-fmt-on { background: rgba(255, 255, 255, 0.2) !important; }
.zk-editing [data-editable].zk-active {
  outline-color: var(--color-primary);
  outline-style: solid;
  outline-width: 2px;
}
.zk-editing [data-editable][data-zk-singleline] {
  /* Single-VALUE fields (Enter is blocked in edit.js) — but long values
     must still wrap visually or they blow the layout out sideways */
  overflow-wrap: break-word;
}
/* Keep empty paragraphs visible while editing (so caret has a line) */
.zk-editing [data-editable-kind="html"] p:empty::before,
.zk-editing [data-editable-kind="html"] p:has(> br:only-child)::before {
  content: "";
  display: inline-block;
  min-height: 1em;
}
.zk-btn.w-full, .btn-primary.w-full { width: 100%; text-align: center; }
.zk-btn.w-full { display: block; }

.zk-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  transition: background 120ms ease;
}
.zk-btn:hover { background: rgba(255, 255, 255, 0.12); }
.zk-btn-save { background: var(--color-primary); border-color: var(--color-primary); }
.zk-btn-save:disabled { opacity: 0.45; cursor: default; }
.zk-btn-save:hover:not(:disabled) { filter: brightness(1.1); background: var(--color-primary); }

.zk-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.zk-card {
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 1rem;
  padding: 1.75rem;
  width: 100%;
  max-width: 22rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.zk-card-title { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
.zk-card-sub { font-size: 0.8125rem; color: var(--color-secondary); margin-top: 0.25rem; }
.zk-error { font-size: 0.8125rem; color: #dc2626; }

/* ── Z-button launcher (js/z-button.js) ──────────────────────────────── */
.zk-zroot { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 55; }
.zk-zwrap { position: relative; }
.zk-zbtn {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: #ed2024;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(237, 32, 36, 0.45);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.zk-zbtn:hover { transform: scale(1.12); box-shadow: 0 10px 28px rgba(237, 32, 36, 0.55); }
.zk-zsvg { width: 1.65rem; height: 1.65rem; position: relative; }
.zk-zping {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ed2024;
  animation: zk-zpulse 2s cubic-bezier(0, 0, 0.2, 1) 1;
  pointer-events: none;
}
.zk-zbtn:hover .zk-zping { animation: zk-zpulse 2s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes zk-zpulse {
  0% { transform: scale(1); opacity: 0.55; }
  75%, 100% { transform: scale(1.85); opacity: 0; }
}
.zk-zbadge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fff;
}
.zk-zbadge-inline {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zk-zdot {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #ed2024;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(237, 32, 36, 0.5);
  animation: zk-zdot 3s ease-in-out infinite alternate;
}
@keyframes zk-zdot {
  from { opacity: 0.55; }
  to { opacity: 1; }
}
.zk-zbackdrop { position: fixed; inset: 0; z-index: 5; background: transparent; border: none; cursor: default; }
.zk-zmenu {
  position: absolute;
  bottom: 3.5rem;
  right: 0;
  z-index: 20;
  width: 15rem;
  border-radius: 0.75rem;
  background: #262626;
  border: 1px solid #404040;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.zk-zitem {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e5e5e5;
  background: transparent;
  border: none;
  border-top: 1px solid #404040;
  cursor: pointer;
  text-align: left;
}
.zk-zitem:first-child { border-top: none; }
.zk-zitem:hover { background: #333; }
.zk-zitem-help { color: #4ade80; }
.zk-zitem-row { justify-content: space-between; }
.zk-zitem-kbd { display: flex; gap: 0.25rem; opacity: 0.7; }
.zk-kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: #525252;
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  color: #e5e5e5;
}
.zk-zitem-muted { color: #a3a3a3; font-weight: 500; }
.zk-zitem-danger { color: #f87171; font-weight: 500; }

/* Panels (help / entries / support / activity) */
.zk-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1rem;
}
@media (min-width: 768px) {
  .zk-panel-overlay { align-items: center; justify-content: center; padding: 1.5rem; }
}
.zk-panel {
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  max-width: 28rem;
  max-height: min(85vh, 40rem);
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.zk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--zk-border-soft);
}
.zk-panel-title { font-weight: 800; font-size: 1rem; }
.zk-panel-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  padding: 0 0.25rem;
}
.zk-panel-close:hover { opacity: 1; }
.zk-panel-body { padding: 1rem 1.25rem; overflow: auto; flex: 1; }
.zk-panel-foot {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--zk-border-soft);
}
.zk-help-item {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--zk-hover);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.zk-help-item:hover { background: var(--zk-border-soft); }
.zk-help-body { padding: 0.5rem 0.25rem 0.75rem; }
.zk-entry-btn {
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--zk-border-soft);
  background: var(--color-surface);
  cursor: pointer;
}
.zk-entry-btn:hover { border-color: var(--color-primary); }
.zk-entry-meta { display: block; font-size: 0.7rem; opacity: 0.55; margin-top: 0.15rem; }
.zk-entry-spam .zk-entry-btn { opacity: 0.65; }
.zk-btn-dark {
  border: 1px solid var(--zk-border-strong);
  background: var(--zk-chrome);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.zk-btn-dark:hover { filter: brightness(1.1); }

/* ── Pages / Navigation / Settings panels ─────────────────────────── */
.zk-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--zk-border);
  border-radius: 0.6rem;
  background: var(--color-surface);
}
.zk-row .input { padding: 0.35rem 0.55rem; font-size: 0.8125rem; }
.zk-btn-dark[disabled] { opacity: 0.35; cursor: default; }
.zk-danger { color: #dc2626; }
.zk-newpage { margin-bottom: 0.25rem; }

/* ── Hero image editing ───────────────────────────────────────────── */
.zk-editing [data-zk-hero] { position: relative; }
.zk-hero-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
}
.zk-hero-btn:hover { background: rgba(0, 0, 0, 0.65); }

/* Clickable images while editing */
.zk-editing [data-editable] img {
  cursor: pointer;
  outline: 2px dashed color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 3px;
}
.zk-editing [data-editable] img:hover { outline-color: var(--color-primary); }

/* ── View-transition navigation ───────────────────────────────────────
   The compositor snapshots the old page, we swap the DOM, and the new
   page animates in. Three coordinated pieces:
   1. #app content: old lifts away, new rises in (spring-ish ease-out)
   2. .hero: its own named snapshot, so the banner MORPHS geometry
      between pages instead of crossfading
   3. .navlink-active::after: the nav underline slides to the new item
   Browsers without the API (or reduced-motion users) get the plain
   .page-enter fade instead — see swapApp() in js/site.js. */
@media (prefers-reduced-motion: no-preference) {
  #app { view-transition-name: zk-app; }
  /* DIRECT child only. `.hero` is reused as a 16:9 aspect-ratio utility on
     blog post card images, so `#app .hero` matched the page hero AND every
     card — four claimants on /blog. Duplicate names abort the whole
     transition ("Unexpected duplicate view-transition-name: zk-hero"), which
     is why any navigation touching the blog had no animation at all while
     home <-> elsewhere worked fine. */
  #app > .hero { view-transition-name: zk-hero; }
  /* view-transition-name MUST be unique in the document. The nav is rendered
     TWICE (desktop [data-nav] + mobile [data-nav-mobile]) and a group can have
     an active child as well as an active heading, so an unscoped rule left
     2-4 elements all claiming zk-navline and the browser aborted the whole
     transition:  InvalidStateError: Transition was aborted because of invalid
     state.  That is why blog -> contact had no transition at all, while routes
     that happened to have a single claimant still animated.
     Scope it to the desktop nav's TOP-LEVEL active item — at most one. */
  nav[data-nav] > .navlink-active::after,
  nav[data-nav] > .zk-navgroup > summary.navlink-active::after {
    view-transition-name: zk-navline;
  }
}

/* Header/footer are identical across pages — freeze the root so only
   the named pieces animate (kills the whole-page crossfade flash). */
::view-transition-old(root),
::view-transition-new(root) { animation: none; }

::view-transition-old(zk-app) {
  animation: zk-vt-out 150ms cubic-bezier(0.4, 0, 1, 1) both;
}
::view-transition-new(zk-app) {
  animation: zk-vt-in 320ms cubic-bezier(0.16, 1, 0.3, 1) 50ms both;
}
@keyframes zk-vt-out {
  to { opacity: 0; transform: translateY(-12px); }
}
@keyframes zk-vt-in {
  from { opacity: 0; transform: translateY(18px); }
}

/* Hero morph: interpolate the group's box, stretch snapshots to fill so
   different hero heights blend instead of jump-cutting. */
::view-transition-group(zk-hero) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(zk-hero),
::view-transition-new(zk-hero) {
  height: 100%;
  overflow: clip;
}

/* Nav underline slides between items */
.navlink { position: relative; }
.navlink-active::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
}
::view-transition-group(zk-navline) {
  animation-duration: 340ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── top progress bar (slow navigations only) ─────────────────────── */
.zk-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
}
.zk-progress-run {
  opacity: 1;
  animation: zk-progress-crawl 1.4s cubic-bezier(0.2, 0.6, 0.3, 1) both;
}
.zk-progress-done {
  animation: none;
  transform: scaleX(1);
  opacity: 0;
  transition: transform 180ms ease-out, opacity 300ms ease-out 120ms;
}
@keyframes zk-progress-crawl {
  0% { transform: scaleX(0); }
  60% { transform: scaleX(0.65); }
  100% { transform: scaleX(0.88); }
}

/* ── HUD editors: buttons + images ────────────────────────────────────
   Clicking an editable button/image morphs the HUD bar into a small
   editor card with inputs for that element type. */
.zk-hud { transition: width 200ms cubic-bezier(0.16, 1, 0.3, 1); }
.zk-hud-main { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.zk-hud.zk-hud-expanded {
  flex-direction: column;
  align-items: stretch;
  width: 320px;
  max-width: calc(100vw - 2rem);
  border-radius: 1rem;
  animation: zk-hud-pop 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Draggable: grab anywhere that isn't a control (position persists) */
.zk-hud { cursor: grab; touch-action: none; }
.zk-hud.zk-hud-dragging { cursor: grabbing; }
.zk-hud.zk-hud-dragging * { pointer-events: none; }
.zk-hud button { cursor: pointer; }
.zk-hud-input { cursor: text; }
@keyframes zk-hud-pop {
  from { opacity: 0.6; transform: translateY(6px) scale(0.97); }
}
/* Modal scroll lock (set by window.zkScrollLock while a panel/confirm is
   open). position:fixed is the only thing iOS Safari respects for touch
   scrolling; the inline top offset preserves the visual position. */
body.zk-scroll-lock {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.zk-hud-btn-panel, .zk-hud-card-panel, .zk-hud-img-panel { display: flex; flex-direction: column; gap: 0.4rem; }
[data-zk-cardf-link-rows] { display: flex; flex-direction: column; gap: 0.4rem; }
.zk-hud-textarea { resize: vertical; min-height: 4.25rem; font-family: inherit; line-height: 1.4; }
.zk-hud-panel-title { font-weight: 700; font-size: 0.8125rem; margin-bottom: 0.1rem; }
.zk-hud-lbl { font-size: 0.6875rem; opacity: 0.55; margin-top: 0.15rem; }
.zk-hud-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding: 0.45rem 0.6rem;
  font-size: 0.8125rem;
}
.zk-hud-input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: transparent;
}
.zk-hud-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.zk-hud-panel-actions {
  display: flex;
  flex-wrap: wrap; /* extra buttons drop to the next line, never clip */
  gap: 0.4rem;
  margin-top: 0.35rem;
  min-width: 0;
}
.zk-hud-panel-actions .zk-btn,
.zk-hud-panel-actions .zk-hud-primary { white-space: nowrap; }
.zk-hud-primary {
  flex: 1;
  border-radius: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
.zk-hud-primary:hover { filter: brightness(1.1); }
.zk-hud-danger { color: #f87171; }

/* Editable buttons & cards: ring + always-visible pencil badge (Macco
   pattern). The element itself still navigates; the badge opens the HUD
   editor. */
.zk-editing [data-editable-btn],
.zk-editing [data-editable-card] {
  position: relative;
  outline: 2px dashed color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 3px;
}
.zk-editing [data-editable-btn]:hover,
.zk-editing [data-editable-card]:hover { outline-color: var(--color-primary); }
.zk-btn-badge {
  position: absolute;
  top: -0.7rem;
  right: -0.7rem;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: 999px;
  background: var(--zk-chrome);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  z-index: 5;
}
.zk-btn-badge:hover { filter: brightness(1.4); }

/* Tailwind v4 layers its utilities, so our unlayered display:flex above
   would beat its .hidden — hide HUD sections explicitly. */
.zk-hud-main.hidden,
.zk-hud-btn-panel.hidden,
.zk-hud-card-panel.hidden,
[data-zk-cardf-link-rows].hidden,
.zk-hud-img-panel.hidden { display: none; }

/* ── Lucide icons ─────────────────────────────────────────────────────
   <i data-lucide> becomes an inline SVG (classes carry over). Buttons
   that hold icon + label render as flex rows. */
.zk-zitem svg, .zk-btn svg, .zk-btn-dark svg,
.zk-hud-primary svg, .zk-fmt svg { flex-shrink: 0; }
.zk-zitem-label { display: flex; align-items: center; gap: 0.75rem; }
.zk-btn, .zk-btn-dark, .zk-hud-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.zk-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
}
.zk-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.zk-btn-badge svg { width: 0.85rem; height: 0.85rem; }
/* Filled rating stars (overrides Lucide's fill="none" attribute) */
.zk-star { fill: currentColor; }

/* Checkbox rows inside HUD panels */
.zk-hud-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  margin-top: 0.15rem;
  cursor: pointer;
}
.zk-hud-check input { accent-color: var(--color-primary); }

/* ── toasts ──────────────────────────────────────────────────────────── */
.zk-toasts {
  position: fixed;
  top: 4.75rem;
  right: 1.25rem;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.zk-toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 20rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--zk-chrome);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.zk-toast-in { opacity: 1; transform: none; }
.zk-toast svg { flex-shrink: 0; }
.zk-toast-success svg { color: #4ade80; }
.zk-toast-error svg { color: #f87171; }
.zk-toast-info svg { color: #93c5fd; }

/* Checkbox row inside panel list rows */
.zk-row-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  opacity: 0.8;
  cursor: pointer;
}
.zk-row-check input { accent-color: var(--color-primary); }

/* Blog cards (padding lives on the inner div so covers bleed edge-to-edge;
   Tailwind's layered p-0 can't override the unlayered .card padding) */
.zk-post-card { padding: 0; overflow: hidden; }

/* ── image-tiles section ───────────────────────────────────────────────
   Circular photo tiles for a services/category row. The photograph IS the
   card: no border, no body copy, label sits over a dark veil that deepens
   on hover while the image scales behind it. Column count comes from the
   section (--zk-tile-cols) so 3 tiles don't stretch across a 5-up grid. */
.zk-tiles {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
  .zk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .zk-tiles { grid-template-columns: repeat(var(--zk-tile-cols, 3), minmax(0, 1fr)); }
}

.zk-tile-link { display: block; text-decoration: none; }

.zk-tile {
  position: relative;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 203px;
  overflow: hidden;
  border-radius: 9999px;
  display: grid;
  place-items: center;
}
@media (min-width: 1024px) { .zk-tile { max-width: none; } }

.zk-tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.zk-tile-veil {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  transition: background-color 500ms ease;
}

.zk-tile-label {
  position: relative;
  z-index: 1;
  padding: 0 0.75rem;
  text-align: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.zk-tile-link:hover .zk-tile-img { transform: scale(1.1); }
.zk-tile-link:hover .zk-tile-veil { background: rgb(0 0 0 / 0.6); }

@media (prefers-reduced-motion: reduce) {
  .zk-tile-img { transition: none; }
  .zk-tile-link:hover .zk-tile-img { transform: none; }
}

/* ── styled confirmations ────────────────────────────────────────────── */
.zk-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.zk-confirm { max-width: 20rem; animation: zk-hud-pop 180ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.zk-confirm-actions { display: flex; gap: 0.5rem; margin-top: 1.1rem; }
.zk-confirm-danger {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #dc2626;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.zk-confirm-danger:hover { background: #b91c1c; }
.zk-confirm-cancel {
  border: 1px solid var(--zk-border-strong);
  border-radius: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
}
.zk-confirm-cancel:hover { background: var(--zk-hover); }

/* ── HUD draft chip ──────────────────────────────────────────────────── */
.zk-hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  cursor: pointer;
  transition: background 120ms ease;
}
.zk-hud-chip:hover { background: rgba(245, 158, 11, 0.35); }
.zk-hud-chip.hidden { display: none; }

/* Header stays rock-solid during view transitions: its own named
   snapshot, old hidden instantly, new shown instantly — no crossfade
   dip while #app animates. */
@media (prefers-reduced-motion: no-preference) {
  body > header { view-transition-name: zk-header; }
}
::view-transition-old(zk-header) { display: none; }
::view-transition-new(zk-header) { animation: none; }

/* "You're viewing this" highlight in the Pages/Posts panels */
.zk-row-current {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.zk-here-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  color: var(--color-primary);
}

/* Focal-point slider in the HUD image editor */
.zk-hud-range {
  width: 100%;
  margin-top: 0.35rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */

/* Hamburger nav: <details> disclosure, no JS required. site.js folds it
   shut after boosted navigations. */
.zk-mnav { position: relative; }
.zk-mnav summary { list-style: none; }
.zk-mnav summary::-webkit-details-marker { display: none; }
.zk-mnav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--color-text);
}
.zk-mnav-btn:active { background: var(--zk-border-soft); }
.zk-mnav .zk-mnav-close-icon { display: none; }
.zk-mnav[open] .zk-mnav-open-icon { display: none; }
.zk-mnav[open] .zk-mnav-close-icon { display: block; }
.zk-mnav-panel {
  position: fixed;
  top: 4rem; /* below the h-16 header */
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-bottom: 1px solid var(--zk-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0.75rem 0.75rem;
  animation: zk-mnav-in 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes zk-mnav-in {
  from { opacity: 0; transform: translateY(-6px); }
}
.zk-mnav-panel .navlink {
  display: block;
  padding: 0.8rem 0.875rem; /* ≥44px touch target */
  font-size: 1rem;
  border-radius: 0.5rem;
}
.zk-mnav-panel .navlink-active { background: color-mix(in srgb, var(--color-primary) 10%, transparent); }
.zk-mnav-panel .navlink-active::after { display: none; } /* underline is a desktop cue */

/* HUD as a fixed bottom bar on small screens (class set by edit.js;
   dragging disabled there) */
.zk-hud.zk-hud-mobile {
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  max-width: none;
  border-radius: 1rem 1rem 0 0;
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
  cursor: default;
}
.zk-hud-mobile .zk-hud-main {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.45rem;
}
.zk-hud-mobile .zk-hud-who { display: none; } /* declutter: essentials only */
.zk-hud-mobile.zk-hud-expanded {
  width: auto;
  border-radius: 1rem 1rem 0 0;
  animation: zk-mnav-in 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 640px) {
  /* iOS zooms the page into any input under 16px — keep them at 16px */
  .input, .zk-hud-input { font-size: 16px; }

  /* Toasts span the width under the header */
  .zk-toasts { left: 1rem; right: 1rem; top: 4.5rem; }
  .zk-toast { max-width: none; width: 100%; }

  /* Panel rows: let action clusters wrap instead of crowding */
  .zk-row { flex-wrap: wrap; }

  /* Z button sits above the bottom-bar HUD while editing */
  .zk-editing .zk-zroot { bottom: 5.5rem; }
}

/* ── shadcn-style panel primitives ───────────────────────────────────
   Flat divided lists (content first), ghost icon buttons, quiet badges,
   and a per-row action menu — replaces the card-per-row + labeled
   button clusters. */
.zk-list { display: flex; flex-direction: column; }
.zk-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.zk-item + .zk-item { border-top: 1px solid var(--zk-border-soft); }
.zk-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 0.5rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 0.5rem;
}
.zk-item-main:hover { background: var(--zk-hover); }
.zk-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.zk-item-sub { font-size: 0.75rem; color: var(--color-secondary); max-width: 100%; }
.zk-item-muted .zk-item-title { color: var(--color-secondary); font-weight: 400; }
.zk-item-time { font-size: 0.6875rem; color: var(--color-secondary); flex-shrink: 0; padding-right: 0.25rem; }

.zk-ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-text);
  opacity: 0.65;
  cursor: pointer;
  flex-shrink: 0;
}
.zk-ibtn:hover { background: var(--zk-border-soft); opacity: 1; }
.zk-ibtn[disabled] { opacity: 0.25; cursor: default; }

.zk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6563rem;
  font-weight: 600;
  line-height: 1.4;
  flex-shrink: 0;
}
.zk-badge-draft { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.zk-badge-new { background: color-mix(in srgb, var(--color-primary) 14%, transparent); color: var(--color-primary); }
.zk-badge-open { background: color-mix(in srgb, var(--color-secondary) 14%, transparent); color: var(--color-secondary); }
.zk-badge-spam { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

.zk-dot-current {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--color-primary);
  flex-shrink: 0;
}

/* Row action menu (kebab) */
.zk-actmenu {
  position: absolute;
  right: 0.25rem;
  top: calc(100% - 0.35rem);
  z-index: 30;
  min-width: 11rem;
  background: var(--color-surface);
  border: 1px solid var(--zk-border);
  border-radius: 0.6rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  padding: 0.25rem;
  animation: zk-hud-pop 140ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.zk-actmenu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  background: transparent;
  border-radius: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.zk-actmenu-item:hover { background: var(--zk-hover); }
.zk-actmenu-item svg { opacity: 0.6; flex-shrink: 0; }
.zk-actmenu-danger { color: #dc2626; }
.zk-actmenu-danger svg { opacity: 1; }

/* Detail view (entries) */
.zk-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 0.4rem;
  margin-left: -0.4rem;
}
.zk-back:hover { background: var(--zk-hover); color: var(--color-text); }
.zk-message {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  background: var(--zk-hover);
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
  line-height: 1.6;
}
.zk-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--zk-border-strong);
  background: transparent;
  color: var(--color-text);
}
.zk-btn-sm:hover { background: var(--zk-hover); }
.zk-btn-sm-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.zk-btn-sm-primary:hover { background: var(--color-primary); filter: brightness(1.1); }
.zk-btn-sm-danger { border-color: transparent; color: #dc2626; }
.zk-btn-sm-danger:hover { background: rgba(220, 38, 38, 0.08); }

/* Inline expanding editor rows (Navigation) */
.zk-item-editor {
  padding: 0.25rem 0.5rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Inline warning inside a panel — used by the Notifications panel when no
   active email recipient exists, so "nobody is being told" can't look like
   a working configuration. */
.zk-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
}
.zk-note-warn {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.3);
}
:root.dark .zk-note-warn,
.dark .zk-note-warn {
  color: #fbbf24;
}
.zk-hidden { display: none !important; }


/* ── dark theme overrides for utility-classed chrome ────────────────── */
[data-theme="dark"] body > header {
  background: rgba(14, 19, 25, 0.92);
  border-color: var(--zk-border-soft);
}
[data-theme="dark"] body > footer { background: #0a0e14; }
[data-theme="dark"] #app [class*="bg-black/"] { background-color: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .zk-mnav-panel { border-color: var(--zk-border-soft); }

/* Theme toggle (header): moon in light, sun in dark */
.zk-theme-btn { color: var(--color-text); }
.zk-theme-btn .zk-icon-sun { display: none; }
[data-theme="dark"] .zk-theme-btn .zk-icon-sun { display: block; }
[data-theme="dark"] .zk-theme-btn .zk-icon-moon { display: none; }

/* ── visitor journey (entries detail) ────────────────────────────────── */
.zk-plabel {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
}
.zk-journey { margin-top: 0.5rem; display: flex; flex-direction: column; }
.zk-journey li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--zk-border-soft);
  font-size: 0.8125rem;
}
.zk-journey-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zk-journey-dur { color: var(--color-secondary); font-size: 0.75rem; flex-shrink: 0; }

/* ── CRM lead view (entries detail) ──────────────────────────────────── */
.zk-lead-head { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; }
.zk-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.zk-seg-row { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.9rem; }
.zk-seg {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--zk-border-strong);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  color: var(--color-secondary);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.zk-seg:hover { background: var(--zk-hover); }
.zk-seg-on {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.zk-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem 1rem;
  margin-top: 0.6rem;
}
.zk-field { display: flex; gap: 0.5rem; min-width: 0; font-size: 0.8125rem; }
.zk-field > svg { opacity: 0.45; flex-shrink: 0; margin-top: 0.15rem; }
.zk-field-label {
  display: block;
  font-size: 0.6563rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-secondary);
}
.zk-field-value { display: block; overflow-wrap: anywhere; margin-top: 0.1rem; }
.zk-field-sub {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  opacity: 0.55;
  margin-top: 0.15rem;
}

/* Journey timeline: dots + connector line, CRM activity style */
.zk-tl { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.zk-tl-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.34rem 0 0.34rem 1.25rem;
  font-size: 0.8125rem;
}
.zk-tl-item::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--zk-border);
}
.zk-tl-item:first-child::before { top: 50%; }
.zk-tl-item:last-child::before { bottom: 50%; }
.zk-tl-dot {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: var(--color-surface);
  border: 2px solid var(--color-secondary);
}
.zk-tl-last .zk-tl-dot { background: var(--color-primary); border-color: var(--color-primary); }
.zk-tl-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zk-tl-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-secondary);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.zk-tl-last .zk-tl-meta { color: var(--color-primary); font-weight: 600; }

/* ── Entries: Apple Mail layout ──────────────────────────────────────── */
.zk-panel-overlay-wide { padding: 0.75rem; }
@media (min-width: 768px) { .zk-panel-overlay-wide { padding: 2.5rem; } }
.zk-panel-wide {
  max-width: 72rem;
  width: 100%;
  height: 88vh;
  max-height: 88vh;
}
.zk-panel-wide .zk-panel-body { padding: 0; display: flex; overflow: hidden; }

.zk-mail { display: flex; flex: 1; min-height: 0; width: 100%; }
.zk-mail-list {
  width: 22rem;
  flex-shrink: 0;
  border-right: 1px solid var(--zk-border-soft);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.zk-mail-list-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--color-surface);
  padding: 0.4rem 1rem;
  min-height: 2.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-secondary);
  border-bottom: 1px solid var(--zk-border-soft);
}
.zk-mail-list-head .zk-btn-sm.zk-hidden { display: none; }
.zk-mail-detail {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 0.75rem 1.5rem 1.75rem;
}
.zk-mail-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--color-secondary);
  opacity: 0.7;
}
.zk-ibtn .zk-danger { color: #dc2626; }
/* Entry actions sit in the panel title bar, next to the close button */
.zk-panel-head .zk-panel-title { flex: 1; min-width: 0; }
.zk-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.9rem;
}

/* Message rows */
.zk-mrow {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem 0.7rem 0.45rem;
  border: 0;
  border-bottom: 1px solid var(--zk-border-soft);
  background: transparent;
  cursor: pointer;
}
.zk-mrow:hover { background: var(--zk-hover); }
.zk-mrow-sel { background: color-mix(in srgb, var(--color-primary) 11%, transparent); }
.zk-mrow-muted .zk-mrow-name, .zk-mrow-muted .zk-mrow-prev { color: var(--color-secondary); }
.zk-mrow-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 0.95rem;
}
.zk-mrow-dot-on { background: var(--color-primary); }
.zk-avatar-sm { width: 2.25rem; height: 2.25rem; font-size: 0.8125rem; }
.zk-mrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.zk-mrow-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.zk-mrow-name { font-size: 0.875rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zk-mrow-unread { font-weight: 700; }
.zk-mrow-time {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: var(--color-secondary);
  flex-shrink: 0;
}
.zk-mrow-sub { font-size: 0.72rem; color: var(--color-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zk-mrow-prev {
  font-size: 0.78rem;
  color: var(--color-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Desktop: split view — back button + chevrons are mobile affordances */
@media (min-width: 768px) {
  .zk-mail .zk-back { display: none; }
  .zk-mrow-chev { display: none; }
}

/* Mobile: iOS-Mail push-in — one pane at a time */
@media (max-width: 767px) {
  .zk-panel-wide { height: 92vh; max-height: 92vh; }
  .zk-mail-list { width: 100%; border-right: 0; }
  .zk-mail-detail { display: none; padding: 0.5rem 1rem 1.25rem; }
  .zk-mail-showing-detail .zk-mail-list { display: none; }
  .zk-mail-showing-detail .zk-mail-detail { display: block; animation: zk-mnav-in 200ms cubic-bezier(0.16, 1, 0.3, 1) both; }
}

/* ── hero video background (Skiv) ────────────────────────────────────── */
.hero-media { position: relative; overflow: hidden; }
.zk-hero-video { position: absolute; inset: 0; }
.zk-hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(240vh, 100%);
  height: max(100vw, 100%);
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}
.zk-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35));
}
.zk-hero-content { position: relative; z-index: 1; }

/* Video picker rows in the hero media editor */
.zk-video-list { display: flex; flex-direction: column; max-height: 11rem; overflow-y: auto; }
.zk-video-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 0.8125rem;
  text-align: left;
  border-radius: 0.45rem;
  cursor: pointer;
}
.zk-video-item:hover { background: rgba(255, 255, 255, 0.1); }
.zk-video-item svg { opacity: 0.6; flex-shrink: 0; }
.zk-video-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zk-video-dur { font-size: 0.7rem; opacity: 0.6; flex-shrink: 0; }
.zk-video-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.zk-video-id {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  opacity: 0.8;
}


/* ── Social & SEO share card (z-button openPageSeo) ─────────────────── */
.zk-seo-card {
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
  background: var(--color-surface, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.zk-seo-card-img {
  aspect-ratio: 1.91 / 1;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.zk-seo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.zk-seo-card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8125rem;
}
.zk-seo-card-body { padding: 0.85rem 1rem 1rem; }
.zk-seo-card-host {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  opacity: 0.45;
  margin: 0 0 0.25rem;
}
.zk-seo-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zk-seo-card-desc {
  font-size: 0.8125rem;
  line-height: 1.4;
  opacity: 0.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dark .zk-seo-card,
:root.dark .zk-seo-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: #141416;
}

/* ── Support Wizard (Big Dog parity) ─────────────────────────────────── */
.zk-sw-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
@media (min-width: 640px) {
  .zk-sw-root { align-items: center; padding: 1rem; }
}
.zk-sw-root.zk-sw-recording { background: transparent; }
.zk-sw-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}
.zk-sw-recording .zk-sw-backdrop,
.zk-sw-recording .zk-sw-modal { display: none; }

.zk-sw-modal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 28rem;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 1rem 1rem 0 0;
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
  background: var(--color-surface, #fff);
  color: var(--color-text, #111);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}
@media (min-width: 640px) {
  .zk-sw-modal { border-radius: 1rem; }
}
.dark .zk-sw-modal,
:root.dark .zk-sw-modal {
  background: #17171a;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}

.zk-sw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text, #111) 10%, transparent);
}
.zk-sw-head-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.zk-sw-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary, #ed2024);
}
.zk-sw-title { font-size: 1.125rem; font-weight: 800; line-height: 1.2; margin: 0; }
.zk-sw-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
  background: transparent;
  color: inherit;
  border-radius: 0.5rem;
  padding: 0.35rem;
  cursor: pointer;
  opacity: 0.75;
}
.zk-sw-iconbtn:hover { opacity: 1; background: color-mix(in srgb, var(--color-text, #111) 6%, transparent); }

.zk-sw-body { padding: 1rem 1.15rem; overflow: auto; flex: 1; min-height: 0; }
.zk-sw-foot {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid color-mix(in srgb, var(--color-text, #111) 10%, transparent);
}
.zk-sw-prompt { font-size: 0.875rem; opacity: 0.65; margin: 0 0 0.75rem; }
.zk-sw-choices { display: flex; flex-direction: column; gap: 0.65rem; }
.zk-sw-choice {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  border: 2px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
  border-radius: 0.85rem;
  background: transparent;
  color: inherit;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.zk-sw-choice:hover { background: color-mix(in srgb, var(--color-text, #111) 5%, transparent); }
.zk-sw-cat-bug:hover { border-color: #f87171; }
.zk-sw-cat-feature:hover { border-color: #60a5fa; }
.zk-sw-cat-help:hover { border-color: #4ade80; }
.zk-sw-emoji { font-size: 1.5rem; line-height: 1; }
.zk-sw-choice-title { display: block; font-size: 0.875rem; font-weight: 650; }
.zk-sw-choice-desc { display: block; font-size: 0.75rem; opacity: 0.55; margin-top: 0.1rem; }
.zk-sw-method-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.zk-sw-m-audio .zk-sw-method-icon { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.zk-sw-m-video .zk-sw-method-icon { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.zk-sw-m-screen .zk-sw-method-icon { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.zk-sw-m-type .zk-sw-method-icon { background: color-mix(in srgb, var(--color-text, #111) 8%, transparent); opacity: 0.85; }

.zk-sw-compose { display: flex; flex-direction: column; gap: 0.75rem; }
.zk-sw-textarea { width: 100%; resize: none; font: inherit; }
.zk-sw-attach {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  width: fit-content;
}
.zk-sw-attach:hover { opacity: 1; }
.zk-sw-files { display: flex; flex-direction: column; gap: 0.4rem; }
.zk-sw-files-label { font-size: 0.75rem; font-weight: 600; opacity: 0.55; margin: 0; }
.zk-sw-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 10%, transparent);
  border-radius: 0.55rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.75rem;
}
.zk-sw-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.zk-sw-tech {
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 10%, transparent);
  border-radius: 0.55rem;
  font-size: 0.75rem;
  opacity: 0.85;
}
.zk-sw-tech summary {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  list-style: none;
}
.zk-sw-tech summary::-webkit-details-marker { display: none; }
.zk-sw-tech-body {
  border-top: 1px solid color-mix(in srgb, var(--color-text, #111) 10%, transparent);
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0.85;
  word-break: break-word;
}
.zk-sw-tech-body p { margin: 0; }
.zk-sw-err {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-size: 0.875rem;
}
.zk-sw-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.85;
}
.zk-sw-done-icon { color: #22c55e; }
.zk-sw-link {
  color: var(--color-primary, #ed2024);
  font-weight: 650;
  font-size: 0.875rem;
  text-decoration: none;
}
.zk-sw-link:hover { text-decoration: underline; }
.zk-sw-muted { opacity: 0.6; }

.zk-sw-recbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #ef4444;
  margin: 0;
}
.zk-sw-live {
  overflow: hidden;
  border-radius: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
}
.zk-sw-live video {
  display: block;
  width: 100%;
  max-height: 12rem;
  background: #000;
  object-fit: cover;
}

.zk-sw-pill {
  position: fixed;
  right: 1rem;
  bottom: 5.5rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-text, #111) 12%, transparent);
  background: var(--color-surface, #fff);
  color: var(--color-text, #111);
  padding: 0.55rem 0.85rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  font-size: 0.875rem;
  font-weight: 650;
}
.dark .zk-sw-pill,
:root.dark .zk-sw-pill {
  background: #1c1c1e;
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.12);
}
.zk-sw-pill-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #ef4444;
  animation: zk-pulse 1.2s ease infinite;
}
.zk-sw-pill-stop {
  border: 0;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.zk-sw-pill-stop:hover { filter: brightness(1.08); }

.zk-sw-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--color-primary, #ed2024) 12%, transparent);
  font-weight: 700;
  text-decoration: none !important;
}
.zk-sw-card-link:hover {
  background: color-mix(in srgb, var(--color-primary, #ed2024) 20%, transparent);
}

/* ── Two-level nav (see navHtml) ──────────────────────────────────────
   A <details> disclosure styled as a dropdown. Native so it opens with
   JavaScript disabled; Alpine only closes it on outside-click / Escape.
   The Pines dropdown look, on a progressive-enhancement base.            */
.zk-navgroup { position: relative; }
.zk-navgroup > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.zk-navgroup > summary::-webkit-details-marker { display: none; }
.zk-navgroup-chev { transition: transform 0.18s ease; opacity: 0.65; }
.zk-navgroup[open] .zk-navgroup-chev { transform: rotate(180deg); }

.zk-navgroup-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 60;
  min-width: 13rem;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-radius: 0.6rem;
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  background: var(--color-surface);
  box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.35);
}
.zk-navgroup-item {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.zk-navgroup-item:hover {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
}
.zk-navgroup-item.navlink-active { color: var(--color-primary); font-weight: 600; }

/* A CLOSED group must hide its panel. This needs saying explicitly: the rule
   above sets `display: flex` on .zk-navgroup-panel, which overrides the way
   browsers hide the contents of a closed <details>. On desktop the panel is
   absolutely positioned so the breakage was invisible; in the mobile menu it
   is in normal flow, so every submenu rendered permanently expanded (82px
   tall with the group shut). */
.zk-navgroup:not([open]) > .zk-navgroup-panel { display: none; }

/* Mobile: the panel is already inside the <details> nav, so flatten it */
.zk-mnav-panel .zk-navgroup { display: block; }
/* The summary carries .navlink, and `.zk-mnav-panel .navlink { display: block }`
   above outranks `.zk-navgroup > summary` (0,2,0 vs 0,1,1) — so the flex
   layout was being dropped and the chevron wrapped onto its own line under
   the label. Restate display here, where the selector is specific enough. */
.zk-mnav-panel .zk-navgroup > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.zk-mnav-panel .zk-navgroup-panel {
  position: static;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding-left: 0.75rem;
}
