/* 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. */

.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: filter 120ms ease, transform 120ms ease;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.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 rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
  padding: 1.75rem;
  background: var(--color-surface);
}

/* 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: rgba(0,0,0,0.06); padding: 0.1em 0.35em; border-radius: 0.25em; }

.input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background: var(--color-surface);
  color: var(--color-text);
}
.input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: transparent;
}

/* 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;
}

.zk-hud {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--color-text);
  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);
}
.zk-hud-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-primary);
  animation: zk-pulse 1.6s ease infinite;
}
@keyframes zk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.zk-hud-label { font-weight: 700; }
.zk-hud-who { opacity: 0.65; font-size: 0.75rem; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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] {
  white-space: nowrap;
  overflow: hidden;
}
/* 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 rgba(0, 0, 0, 0.08);
}
.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 rgba(0, 0, 0, 0.08);
}
.zk-help-item {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.zk-help-item:hover { background: rgba(0, 0, 0, 0.07); }
.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 rgba(0, 0, 0, 0.08);
  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 rgba(0, 0, 0, 0.15);
  background: var(--color-text);
  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 rgba(0, 0, 0, 0.1);
  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; }
  #app .hero { view-transition-name: zk-hero; }
  .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); }
}
.zk-hud-btn-panel, .zk-hud-img-panel { display: flex; flex-direction: column; gap: 0.4rem; }
.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: hover ring + clickable pencil badge (Macco pattern).
   The button itself still navigates; the badge opens the HUD editor. */
.zk-editing [data-editable-btn] {
  position: relative;
  outline: 2px dashed color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 3px;
}
.zk-editing [data-editable-btn]: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(--color-text);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 120ms ease, transform 120ms ease;
  cursor: pointer;
  z-index: 5;
}
[data-editable-btn]:hover .zk-btn-badge,
.zk-btn-badge:focus-visible { opacity: 1; transform: scale(1); }
.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-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(--color-text);
  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; }

/* ── 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 rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
}
.zk-confirm-cancel:hover { background: rgba(0, 0, 0, 0.05); }

/* ── 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: rgba(0, 0, 0, 0.06); }
.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 rgba(0, 0, 0, 0.1);
  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 */

/* Edit affordances on touch: hover-revealed pencils are always visible
   (both media-query and JS-detected fallback) */
@media (hover: none), (pointer: coarse) {
  .zk-editing [data-editable-btn] .zk-btn-badge { opacity: 1; transform: scale(1); }
}
.zk-touch .zk-editing [data-editable-btn] .zk-btn-badge,
.zk-touch.zk-editing [data-editable-btn] .zk-btn-badge { opacity: 1; transform: scale(1); }

/* 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; }
}
