@layer phpew-layout, phpew-theme;
@layer phpew-theme {
:root {
  --phpew-bp-tablet: 768px;
  --phpew-bp-desktop: 1024px;
  --phpew-bp-wide: 1920px;
}
:root {
  --phpew-bg:            #fafaf9;
  --phpew-card-bg:       #ffffff;
  --phpew-surface:       #f4f4f5;
  --phpew-fg:            #18181b;
  --phpew-muted:         #71717a;
  --phpew-subtle:        #a1a1aa;
  --phpew-border:        #e4e4e7;
  --phpew-border-strong: #d4d4d8;
  --phpew-accent:        #4f46e5;
  --phpew-accent-fg:     #ffffff;
  --phpew-accent-hover:  #4338ca;
  --phpew-accent-2:      #b45309;
  --phpew-link:          var(--phpew-accent);
  --phpew-error:         #dc2626;
  --phpew-error-hover:   #b91c1c;
  --phpew-error-bg:      #fef2f2;
  --phpew-success:       #16a34a;
  --phpew-success-bg:    #f0fdf4;
  --phpew-warning:       #d97706;
  --phpew-focus-ring:    rgba(79, 70, 229, 0.35);
  --phpew-header-bg:     rgba(255, 255, 255, 0.85);
  --phpew-shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.04);
  --phpew-shadow:        0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);

  /* Chart series, in a FIXED order that is never cycled: the ordering is the
     colour-blind-safety mechanism, not a preference. Validated as a set against
     this theme's card surface -- worst adjacent pair separates by dE 9.1 for a
     protan viewer and 19.6 for a normal-vision one. Re-ordering or substituting
     one of these without re-validating the whole set breaks that.
     A ninth series is not a ninth colour: it folds into "other". */
  --phpew-chart-1:       #2a78d6;
  --phpew-chart-2:       #eb6834;
  --phpew-chart-3:       #1baf7a;
  --phpew-chart-4:       #eda100;
  --phpew-chart-5:       #e87ba4;
  --phpew-chart-6:       #008300;
  --phpew-chart-7:       #4a3aa7;
  --phpew-chart-8:       #e34948;
  --phpew-chart-grid:    rgba(0, 0, 0, 0.08);

  /* How a chart LOOKS, as opposed to what colour its series are. Declared here
     rather than written into the component rules so the Style editor offers
     them: the shape of a bar and the weight of a line are design decisions, and
     a decision an author can only reach by hand-writing advanced CSS is one
     they do not have. */
  --phpew-chart-height:       240px;
  --phpew-chart-bar-radius:   4px;
  --phpew-chart-bar-gap:      2px;
  --phpew-chart-bar-max:      96px;
  --phpew-chart-group-gap:    1px;
  --phpew-chart-line-width:   2;
  --phpew-chart-slice-border: var(--phpew-bg);
  --phpew-chart-slice-gap:    1;
  --phpew-chart-label-color:  #ffffff;
  --phpew-chart-swatch-size:  0.7rem;
  --phpew-chart-motion:       240ms;

  --phpew-font:          ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --phpew-font-mono:     ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  --phpew-fs-xs:         0.75rem;
  --phpew-fs-sm:         0.875rem;
  --phpew-fs-base:       1rem;
  --phpew-fs-lg:         1.125rem;
  --phpew-fs-xl:         1.5rem;
  --phpew-fs-2xl:        2rem;
  --phpew-lh-tight:      1.2;
  --phpew-lh-base:       1.55;

  --phpew-radius-sm:     4px;
  --phpew-radius:        8px;
  --phpew-radius-lg:     12px;
  --phpew-gap-sm:        0.5rem;
  --phpew-gap:           1rem;
  --phpew-gap-lg:        1.5rem;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100vh; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--phpew-bg);
  color: var(--phpew-fg);
  font-family: var(--phpew-font);
  font-size: var(--phpew-fs-base);
  line-height: var(--phpew-lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.phpew-admin {
  display: flex;
  flex-direction: column;
  overflow: visible;
}
body.phpew-admin .phpew-inline-enter { display: none; }

h1, h2, h3, h4, h5 {
  margin: 1.5em 0 0.5em;
  line-height: var(--phpew-lh-tight);
  letter-spacing: -0.015em;
  font-weight: 600;
}
h1 { font-size: var(--phpew-fs-2xl); margin-top: 0; letter-spacing: -0.025em; }
h2 { font-size: var(--phpew-fs-xl); }
h3 { font-size: var(--phpew-fs-lg); }

p { margin: 0 0 1em; }
small { font-size: var(--phpew-fs-sm); color: var(--phpew-muted); }

:where(a) {
  color: var(--phpew-link);
  text-decoration: none;
  transition: color 120ms ease;
}
:where(a:hover) { text-decoration: underline; }
:where(a:focus-visible) {
  outline: 2px solid var(--phpew-focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: var(--phpew-font-mono);
  font-size: 0.9em;
  background: var(--phpew-surface);
  padding: 0.1em 0.35em;
  border-radius: var(--phpew-radius-sm);
  color: var(--phpew-fg);
}
pre {
  font-family: var(--phpew-font-mono);
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  padding: 1rem 1.25rem;
  border-radius: var(--phpew-radius);
  overflow: auto;
  font-size: var(--phpew-fs-sm);
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

hr {
  border: none;
  border-top: 1px solid var(--phpew-border);
  margin: 2rem 0;
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0;
}
dt { color: var(--phpew-muted); font-size: var(--phpew-fs-sm); font-weight: 500; }
dd { margin: 0; }


/* The site header is sticky at the top, so anything else that sticks has to
   start below it. One number, declared beside the thing it measures. */
:root {
  --phpew-header-h: 5rem;
  /* One gutter for the admin: the nav strip pads by it, the content pads by
     it, and a full-bleed toolbar breaks out of it by exactly this much. */
  --phpew-admin-gutter: 1.75rem;
}
.phpew-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: 1rem;
  align-items: center;
  padding: 0.75rem max(2rem, calc((100% - 1280px) / 2 + 2rem));
  background: var(--phpew-header-bg);
  border-bottom: 1px solid var(--phpew-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.phpew-brand {
  font-weight: 700;
  font-size: var(--phpew-fs-lg);
  color: var(--phpew-fg);
  letter-spacing: -0.02em;
  justify-self: start;
  grid-column: 1;
}
.phpew-brand:hover { text-decoration: none; color: var(--phpew-fg); }

.phpew-brand--image {
  display: inline-flex;
  align-items: center;
  padding: 0;
}
.phpew-brand--image img {
  display: block;
  height: var(--phpew-brand-img-h, 36px);
  max-height: var(--phpew-brand-img-h, 36px);
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

.phpew-theme-preview-frame {
  display: block;
  width: 100%;
  height: 55vh;
  min-height: 340px;
  margin: 0 0 1.5rem;
  border: 1px solid var(--phpew-border, #ccc);
  border-radius: var(--phpew-radius, 4px);
  background: var(--phpew-card-bg, #fff);
}

.phpew-media-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.phpew-media-picker-overlay[hidden] { display: none; }
.phpew-media-picker-panel {
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius-lg);
  padding: 1rem;
  width: min(100%, 720px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.phpew-media-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phpew-media-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.5rem;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.phpew-media-picker-tile {
  display: block;
  padding: 0.25rem;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  cursor: pointer;
  aspect-ratio: 1 / 1;
}
.phpew-media-picker-tile:hover,
.phpew-media-picker-tile:focus-visible {
  border-color: var(--phpew-accent);
  outline: none;
}
.phpew-media-picker-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--phpew-radius-sm);
}

.phpew-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  justify-self: end;
  grid-column: 3;
}

.phpew-admin-menu { position: relative; }
.phpew-admin-menu-trigger {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.phpew-admin-menu-trigger::-webkit-details-marker { display: none; }
.phpew-admin-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  min-width: 12rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border-strong);
  border-radius: var(--phpew-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 20;
}
.phpew-admin-menu-list li { margin: 0; }
.phpew-admin-menu-list a {
  display: block;
  padding: 0.4rem 0.875rem;
  color: var(--phpew-fg);
  text-decoration: none;
  font-size: var(--phpew-fs-sm);
}
.phpew-admin-menu-list a:hover { background: var(--phpew-surface); text-decoration: none; }
.phpew-admin-menu-list a.is-active { color: var(--phpew-accent); font-weight: 500; }
.phpew-admin-menu-sep {
  padding: 0.4rem 0.875rem 0.2rem;
  font-size: var(--phpew-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phpew-muted);
  border-top: 1px solid var(--phpew-border);
  margin-top: 0.25rem;
  cursor: default;
}

.phpew-admin-lifeline {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 2147483646;
  font-family: var(--phpew-font);
}
.phpew-admin-lifeline-trigger {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--phpew-card-bg);
  color: var(--phpew-fg);
  border: 1px solid var(--phpew-border-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  font-size: var(--phpew-fs-sm);
}
.phpew-admin-lifeline-trigger::-webkit-details-marker { display: none; }
.phpew-admin-lifeline-trigger:hover {
  background: var(--phpew-surface);
}
.phpew-admin-lifeline-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  min-width: 13rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border-strong);
  border-radius: var(--phpew-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.phpew-admin-lifeline-list li { margin: 0; }
.phpew-admin-lifeline-list a {
  display: block;
  padding: 0.4rem 0.875rem;
  color: var(--phpew-fg);
  text-decoration: none;
  font-size: var(--phpew-fs-sm);
}
.phpew-admin-lifeline-list a:hover {
  background: var(--phpew-surface);
  text-decoration: none;
}
.phpew-admin-lifeline-sep {
  padding: 0.4rem 0.875rem 0.2rem;
  font-size: var(--phpew-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phpew-muted);
  border-top: 1px solid var(--phpew-border);
  margin-top: 0.25rem;
  cursor: default;
}
.phpew-admin-lifeline-sep:empty { padding: 0; border-top: 1px solid var(--phpew-border); margin: 0.3rem 0; }
.phpew-nav-link {
  color: var(--phpew-muted);
  font-size: var(--phpew-fs-sm);
  font-weight: 500;
  padding: 0.4375rem 0.875rem;
  border-radius: var(--phpew-radius);
  transition: background 120ms ease, color 120ms ease;
}
.phpew-nav-link:hover {
  text-decoration: none;
  color: var(--phpew-fg);
  background: var(--phpew-surface);
}
.phpew-wiggle-link {
  color: var(--phpew-accent);
}
.phpew-wiggle-link:hover {
  color: var(--phpew-accent-hover, var(--phpew-accent));
}
/* Signing out is a POST, so the "link" is a form button dressed as one. */
.phpew-signout { display: inline; margin: 0; }
.phpew-signout button { background: none; border: 0; cursor: pointer; font-family: inherit; line-height: inherit; }
.phpew-signout button:not(.phpew-nav-link) { font: inherit; padding: 0; color: var(--phpew-link); }
.phpew-signout button:not(.phpew-nav-link):hover { text-decoration: underline; }

.phpew-page-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex-wrap: wrap;
  justify-self: center;
  grid-column: 2;
}
.phpew-page-nav-link {
  color: var(--phpew-muted);
  font-size: var(--phpew-fs-sm);
  font-weight: 500;
  padding: 0.4375rem 0.875rem;
  border-radius: var(--phpew-radius);
  transition: background 120ms ease, color 120ms ease;
}
.phpew-page-nav-link:hover {
  text-decoration: none;
  color: var(--phpew-fg);
  background: var(--phpew-surface);
}

/* A nav fold. details/summary carries the open state, the keyboard and the
   screen reader for free; the panel only needs somewhere to sit. Closing on
   blur or outside click is a JS behaviour this deliberately does not have --
   a second click on the summary closes it, and so does opening another. */
.phpew-nav-fold {
  position: relative;
}
.phpew-nav-fold > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.phpew-nav-fold > summary::-webkit-details-marker { display: none; }
.phpew-nav-fold > summary::after {
  content: "";
  width: 0.35em;
  height: 0.35em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
  transition: transform 120ms ease;
}
.phpew-nav-fold[open] > summary::after { transform: translateY(0.1em) rotate(-135deg); }
.phpew-nav-fold.is-active > summary { color: var(--phpew-fg); }
.phpew-nav-fold-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: max-content;
  padding: 0.35rem;
  background: var(--phpew-card-bg, #fff);
  border: 1px solid var(--phpew-border, #e2e8f0);
  border-radius: var(--phpew-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.phpew-nav-fold-panel .phpew-page-nav-link { white-space: nowrap; }

/* On a narrow screen the header already wraps, so the panel opens in the flow
   rather than over the top of the page it belongs to. */
@media (max-width: 767px) {
  .phpew-nav-fold-panel {
    position: static;
    border: none;
    box-shadow: none;
    background: none;
    padding: 0 0 0 0.75rem;
  }
}

.phpew-main {
  flex: 1 0 auto;
}

.phpew-main--centered {
  max-width: 1280px;
  margin: 0 auto;
}
.phpew-main--padded {
  padding: 2.5rem 2rem;
}

.phpew-footer {
  border-top: 1px solid var(--phpew-border);
  /* One line of small print, sized to one line of small print. */
  padding: 0.5rem 2rem;
  color: var(--phpew-subtle);
  text-align: center;
  font-size: var(--phpew-fs-sm);
  margin-top: auto;
}


.phpew-section { margin-bottom: 2.5rem; }
.phpew-section:last-child { margin-bottom: 0; }
.phpew-signal-host { display: contents; }
[data-phpew-sub][hidden] { display: none !important; }
.phpew-section-datasource > .phpew-section { margin-bottom: 0; }

.phpew-block-title {
  margin: 0;
  padding: 0;
}

.phpew-section-body { line-height: var(--phpew-lh-base); }


.phpew-page > h1:first-child { margin-top: 0; }

.phpew-breadcrumb {
  margin: 0 0 1rem;
  font-size: var(--phpew-fs-sm);
}
.phpew-breadcrumb a {
  color: var(--phpew-muted);
}
.phpew-breadcrumb a:hover {
  color: var(--phpew-link);
}

.phpew-list--titles .phpew-list-items {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.5rem;
}
.phpew-list--titles .phpew-list-items li {
  border: 1px solid var(--phpew-border);
  background: var(--phpew-card-bg);
  border-radius: var(--phpew-radius);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.phpew-list--titles .phpew-list-items li:hover {
  border-color: var(--phpew-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--phpew-shadow-sm);
}
.phpew-list--titles .phpew-list-items a {
  display: block;
  padding: 0.875rem 1.125rem;
  color: var(--phpew-fg);
  font-weight: 500;
}
.phpew-list--titles .phpew-list-items a:hover { text-decoration: none; }
.phpew-draft-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  background: color-mix(in srgb, var(--phpew-error, #dc2626) 15%, transparent);
  color: var(--phpew-error, #dc2626);
  margin-left: 0.5rem;
  vertical-align: middle;
}
.phpew-article {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--phpew-border);
}

.phpew-list--excerpts .phpew-list-items {
  display: grid;
  gap: 1.25rem;
  margin: 1rem 0 0;
}
.phpew-list-excerpt {
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  padding: 1rem 1.125rem;
}
.phpew-list-excerpt > a:first-child {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--phpew-fg);
  margin: 0 0 0.4rem;
}
.phpew-list-excerpt > a:first-child:hover { color: var(--phpew-accent); }
.phpew-list-excerpt .phpew-section-text { display: block; margin: 0 0 0.5rem; }
.phpew-list-excerpt > a:last-child { font-size: 0.85rem; }
.phpew-article-card { display: flex; flex-direction: column; }
.phpew-article-item-title {
  margin: 0 0 0.25rem 0;
  font-size: var(--phpew-fs-lg);
  line-height: 1.25;
}
.phpew-article-item-title a {
  color: var(--phpew-fg);
  text-decoration: none;
}
.phpew-article-item-title a:hover { color: var(--phpew-accent); }
.phpew-article-item-date {
  margin: 0 0 0.5rem 0;
  font-size: var(--phpew-fs-xs);
  color: var(--phpew-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.phpew-article-item-excerpt {
  margin: 0 0 0.75rem 0;
  font-size: var(--phpew-fs-sm);
  color: var(--phpew-fg);
  line-height: var(--phpew-lh-base);
}
.phpew-article-card .phpew-article-item-excerpt { flex: 1 1 auto; }
.phpew-article-item-more { margin: 0; font-size: var(--phpew-fs-sm); }
.phpew-article-item-more a { color: var(--phpew-accent); font-weight: 500; }

.phpew-with-sidebar {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 2rem;
  align-items: start;
}
.phpew-with-sidebar-aside {
  border-right: 1px solid var(--phpew-border);
  padding-right: 1.5rem;
}
.phpew-sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phpew-muted);
  margin: 0 0 0.75rem 0;
}
@media (max-width: 720px) {
  .phpew-with-sidebar { grid-template-columns: 1fr; }
  .phpew-with-sidebar-aside { border-right: none; padding-right: 0; }
}


main.phpew-main.login,
main.phpew-main.create-account,
main.phpew-main.forgot-password,
main.phpew-main.reset-password,
main.phpew-main.account {
  min-height: calc(100vh - 14rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
main.phpew-main.login .phpew-form,
main.phpew-main.create-account .phpew-form,
main.phpew-main.forgot-password .phpew-form,
main.phpew-main.reset-password .phpew-form,
main.phpew-main.account .phpew-form,
main.phpew-main.account dl,
main.phpew-main.account h1,
main.phpew-main.account h2,
main.phpew-main.account > p,
main.phpew-main.account .phpew-notice,
main.phpew-main.account .phpew-error,
main.phpew-main.account .phpew-success,
main.phpew-main.account .phpew-inline-form {
  width: 100%;
  max-width: 22rem;
  text-align: left;
}


.phpew-form {
  display: flex;
  flex-direction: column;
  gap: var(--phpew-gap);
  max-width: 480px;
}
.phpew-form label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: var(--phpew-fs-sm);
  font-weight: 500;
  color: var(--phpew-fg);
}
.phpew-form input,
.phpew-form textarea,
.phpew-form select {
  padding: 0.5625rem 0.875rem;
  background: var(--phpew-card-bg);
  color: var(--phpew-fg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  font: inherit;
  font-size: var(--phpew-fs-base);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.phpew-form input::placeholder,
.phpew-form textarea::placeholder { color: var(--phpew-subtle); }
.phpew-form input:focus,
.phpew-form textarea:focus,
.phpew-form select:focus {
  outline: none;
  border-color: var(--phpew-accent);
  box-shadow: 0 0 0 3px var(--phpew-focus-ring);
}
.phpew-form textarea { resize: vertical; line-height: 1.5; }

.phpew-form .phpew-checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
}
.phpew-form .phpew-checkbox input { width: auto; margin-top: 0.2rem; }
.phpew-form .phpew-checkbox span { flex: 1; }

.phpew-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


.phpew-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
  border: 1px solid var(--phpew-accent);
  border-radius: var(--phpew-radius);
  font: inherit;
  font-size: var(--phpew-fs-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
  white-space: nowrap;
}
.phpew-btn:hover {
  background: var(--phpew-accent-hover);
  border-color: var(--phpew-accent-hover);
  text-decoration: none;
  color: var(--phpew-accent-fg);
}
.phpew-btn:active { transform: translateY(1px); }
.phpew-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--phpew-focus-ring);
}
.phpew-btn.phpew-btn-danger,
.phpew-btn-danger {
  background: color-mix(in srgb, var(--phpew-error) 60%, transparent);
  border-color: color-mix(in srgb, var(--phpew-error) 60%, transparent);
}
.phpew-btn.phpew-btn-danger:hover,
.phpew-btn-danger:hover {
  background: color-mix(in srgb, var(--phpew-error) 80%, transparent);
  border-color: color-mix(in srgb, var(--phpew-error) 80%, transparent);
}
.phpew-btn.phpew-btn-success,
.phpew-btn-success {
  background: color-mix(in srgb, var(--phpew-success) 60%, transparent);
  border-color: color-mix(in srgb, var(--phpew-success) 60%, transparent);
  color: #09090b;
}
.phpew-btn.phpew-btn-success:hover,
.phpew-btn-success:hover {
  background: color-mix(in srgb, var(--phpew-success) 80%, transparent);
  border-color: color-mix(in srgb, var(--phpew-success) 80%, transparent);
}

.phpew-table form { display: inline; }

.phpew-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.375rem;
  align-items: center;
}
.phpew-action-group form { display: inline-flex; margin: 0; }
.phpew-action-group .phpew-btn { flex: 0 0 auto; }

.phpew-action-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  align-items: center;
  white-space: nowrap;
}
.phpew-action-row form { display: inline-flex; margin: 0; }
.phpew-action-row .phpew-btn { flex: 0 0 auto; padding: 0.1875rem 0.5rem; font-size: 0.6875rem; }

.phpew-datasource-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.phpew-datasource-search .phpew-admin-input { flex: 1 1 16rem; max-width: 28rem; }
.phpew-datasource-search .phpew-btn { flex: 0 0 auto; }

.phpew-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.phpew-pagination .phpew-btn { flex: 0 0 auto; padding: 0.25rem 0.625rem; font-size: 0.75rem; }
.phpew-pagination .phpew-muted { margin: 0 0.25rem; }
.phpew-page-sizes { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; }

.phpew-roles-form {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.625rem;
  align-items: center;
  white-space: nowrap;
  margin: 0;
}
.phpew-roles-form label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--phpew-fs-sm);
  font-weight: 500;
  color: var(--phpew-fg);
  cursor: pointer;
}
.phpew-roles-form .phpew-btn {
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
  margin-left: 0.25rem;
}


.phpew-card {
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  padding: 1.25rem;
  box-shadow: var(--phpew-shadow-sm);
}


.phpew-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  overflow: hidden;
  font-size: var(--phpew-fs-xs);
}
.phpew-table th, .phpew-table td {
  text-align: left;
  padding: 0.4375rem 0.75rem;
  border-bottom: 1px solid var(--phpew-border);
  vertical-align: middle;
}
.phpew-table tbody tr:last-child td,
.phpew-table tbody tr:last-child th { border-bottom: none; }
.phpew-table th {
  background: var(--phpew-surface);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phpew-muted);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.phpew-table tbody tr { transition: background 80ms ease; }
/* A tint of the text colour, never a fixed grey: links on the row stay readable in any theme. */
.phpew-table tbody tr:hover { background: color-mix(in srgb, var(--phpew-fg, currentColor) 7%, transparent); }
.phpew-table code { font-size: 0.7rem; }
.phpew-table small { font-size: 0.6875rem; }

.phpew-table th:last-child,
.phpew-table td:last-child {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}
.phpew-table .phpew-btn {
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: var(--phpew-radius-sm);
  width: 6rem;
  text-align: center;
}
.phpew-table td:last-child form + form { margin-left: 0.25rem; }


.phpew-toolbar {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}


.phpew-graph {
  margin: 0 0 1rem;
}

.phpew-graph-plot {
  height: var(--phpew-chart-height); /* the default; data-phpew-height picks another */
  display: flex;
  align-items: flex-end;
  /* Three bars sharing 1200px made each one 400 wide: not a chart, three
     colour fields. A bar is capped and the row centres what is left over. The
     key row below carries the same cap so the labels stay under their bars. */
  justify-content: center;
  /* A real gap between neighbouring fills, so two bars of a similar colour are
     still two bars. */
  gap: var(--phpew-chart-bar-gap);
  border-bottom: 1px solid var(--phpew-chart-grid);
}

/* The column holds the fill and NOTHING that competes with it for height: a
   label inside made the fill a flex item that shrank to fit beside it, and the
   percentage never applied. */
.phpew-graph-bar {
  flex: 1 1 0;
  min-width: 0;
  max-width: var(--phpew-chart-bar-max);
  align-self: stretch;
  position: relative;
}

/* One series fills the column; several share it side by side. The stack is what
   the fills are positioned against, so a grouped chart needs no other rule. */
.phpew-graph-stack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: var(--phpew-chart-group-gap);
}

.phpew-graph-fill {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  align-self: flex-end;
  /* Rounded at the data end only: the other end is the baseline, and rounding
     it would lift the bar off the number it is measured from. */
  border-radius: var(--phpew-chart-bar-radius) var(--phpew-chart-bar-radius) 0 0;
  transition: height var(--phpew-chart-motion) cubic-bezier(0.4, 0, 0.2, 1);
}

.phpew-graph[data-phpew-animate="none"] .phpew-graph-fill {
  transition: none;
}

/* The value sits at the head of its column, in ink -- never in the series
   colour. A number wearing the mark's colour is a second, worse legend. */
.phpew-graph-value {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  font: 600 var(--phpew-fs-xs) / 1 var(--phpew-font);
  color: var(--phpew-fg);
  white-space: nowrap;
}

.phpew-graph-keys {
  display: flex;
  justify-content: center;
  gap: var(--phpew-chart-bar-gap);
  padding-top: 0.35rem;
}

/* A line's key row has no bars to sit under: it labels POINTS, and the first
   and last of those sit hard against the edges of the box because a line spans
   its plot. Equal-width cells centre their labels a sixth of the way in, so
   every label but the middle one pointed at nothing. */
.phpew-graph--line .phpew-graph-keys {
  justify-content: space-between;
}

.phpew-graph--line .phpew-graph-key {
  flex: 0 1 auto;
  max-width: none;
}

.phpew-graph-key {
  flex: 1 1 0;
  min-width: 0;
  max-width: var(--phpew-chart-bar-max);
  text-align: center;
  font: var(--phpew-fs-xs) / 1.2 var(--phpew-font);
  color: var(--phpew-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phpew-graph-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* A line takes the series hue as a STROKE and a slice takes it as a FILL, both
   from the one `--phpew-graph-ink` the colour class publishes. That is why there
   is a single c1..c8 family instead of three parallel ones, and why a theme
   restyles every mark by moving the eight --phpew-chart-N it already ships. */
.phpew-graph-line {
  stroke: var(--phpew-graph-ink);
  stroke-width: var(--phpew-chart-line-width);
  stroke-linejoin: round;
  stroke-linecap: round;
  background: none;
}

/* A pie is round. preserveAspectRatio is left at its default here, and the box
   is square, because a pie stretched to its container is an ellipse and an
   ellipse lies about every slice in it. */
.phpew-graph-svg--pie {
  aspect-ratio: 1;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}

.phpew-graph-plot--pie {
  border-bottom: 0;
  justify-content: center;
  align-items: center;
}

.phpew-graph-slice {
  fill: var(--phpew-graph-ink);
  /* The gap between neighbours, in the card's own colour, so slices separate
     without a line of some third colour appearing between them. */
  stroke: var(--phpew-chart-slice-border);
  stroke-width: var(--phpew-chart-slice-gap);
  background: none;
}

.phpew-graph-slice-label {
  fill: var(--phpew-chart-label-color);
  font: 600 var(--phpew-fs-xs) / 1 var(--phpew-font);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

/* The value carriers. They hold what the runtime needs to redraw a mark that is
   not a box; nothing about them is for a reader, and the numbers they carry are
   on the page in the table. */
.phpew-graph-point,
.phpew-graph-points {
  display: none;
}

.phpew-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  padding-top: 0.5rem;
  font: var(--phpew-fs-xs) / 1.2 var(--phpew-font);
  color: var(--phpew-muted);
}

.phpew-graph-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.phpew-graph-swatch {
  width: var(--phpew-chart-swatch-size);
  height: var(--phpew-chart-swatch-size);
  border-radius: 2px;
  flex: none;
}

.phpew-graph-table {
  margin-top: 0.5rem;
  font-size: var(--phpew-fs-xs);
}

.phpew-graph-table summary {
  color: var(--phpew-muted);
  cursor: pointer;
}

/* Asked for less movement, given less movement. */
@media (prefers-reduced-motion: reduce) {
  .phpew-graph-fill {
    transition: none;
  }
}

/* Chart geometry as CLASSES. The CSP is style-src self + nonce with no
   unsafe-inline, so a style attribute is refused however it gets there --
   including one a script sets. A bar height is therefore a class, in whole
   percent: on a 240px chart one step is 2.4px. */
.phpew-graph-h0 { height: 0%; }
.phpew-graph-h1 { height: 1%; }
.phpew-graph-h2 { height: 2%; }
.phpew-graph-h3 { height: 3%; }
.phpew-graph-h4 { height: 4%; }
.phpew-graph-h5 { height: 5%; }
.phpew-graph-h6 { height: 6%; }
.phpew-graph-h7 { height: 7%; }
.phpew-graph-h8 { height: 8%; }
.phpew-graph-h9 { height: 9%; }
.phpew-graph-h10 { height: 10%; }
.phpew-graph-h11 { height: 11%; }
.phpew-graph-h12 { height: 12%; }
.phpew-graph-h13 { height: 13%; }
.phpew-graph-h14 { height: 14%; }
.phpew-graph-h15 { height: 15%; }
.phpew-graph-h16 { height: 16%; }
.phpew-graph-h17 { height: 17%; }
.phpew-graph-h18 { height: 18%; }
.phpew-graph-h19 { height: 19%; }
.phpew-graph-h20 { height: 20%; }
.phpew-graph-h21 { height: 21%; }
.phpew-graph-h22 { height: 22%; }
.phpew-graph-h23 { height: 23%; }
.phpew-graph-h24 { height: 24%; }
.phpew-graph-h25 { height: 25%; }
.phpew-graph-h26 { height: 26%; }
.phpew-graph-h27 { height: 27%; }
.phpew-graph-h28 { height: 28%; }
.phpew-graph-h29 { height: 29%; }
.phpew-graph-h30 { height: 30%; }
.phpew-graph-h31 { height: 31%; }
.phpew-graph-h32 { height: 32%; }
.phpew-graph-h33 { height: 33%; }
.phpew-graph-h34 { height: 34%; }
.phpew-graph-h35 { height: 35%; }
.phpew-graph-h36 { height: 36%; }
.phpew-graph-h37 { height: 37%; }
.phpew-graph-h38 { height: 38%; }
.phpew-graph-h39 { height: 39%; }
.phpew-graph-h40 { height: 40%; }
.phpew-graph-h41 { height: 41%; }
.phpew-graph-h42 { height: 42%; }
.phpew-graph-h43 { height: 43%; }
.phpew-graph-h44 { height: 44%; }
.phpew-graph-h45 { height: 45%; }
.phpew-graph-h46 { height: 46%; }
.phpew-graph-h47 { height: 47%; }
.phpew-graph-h48 { height: 48%; }
.phpew-graph-h49 { height: 49%; }
.phpew-graph-h50 { height: 50%; }
.phpew-graph-h51 { height: 51%; }
.phpew-graph-h52 { height: 52%; }
.phpew-graph-h53 { height: 53%; }
.phpew-graph-h54 { height: 54%; }
.phpew-graph-h55 { height: 55%; }
.phpew-graph-h56 { height: 56%; }
.phpew-graph-h57 { height: 57%; }
.phpew-graph-h58 { height: 58%; }
.phpew-graph-h59 { height: 59%; }
.phpew-graph-h60 { height: 60%; }
.phpew-graph-h61 { height: 61%; }
.phpew-graph-h62 { height: 62%; }
.phpew-graph-h63 { height: 63%; }
.phpew-graph-h64 { height: 64%; }
.phpew-graph-h65 { height: 65%; }
.phpew-graph-h66 { height: 66%; }
.phpew-graph-h67 { height: 67%; }
.phpew-graph-h68 { height: 68%; }
.phpew-graph-h69 { height: 69%; }
.phpew-graph-h70 { height: 70%; }
.phpew-graph-h71 { height: 71%; }
.phpew-graph-h72 { height: 72%; }
.phpew-graph-h73 { height: 73%; }
.phpew-graph-h74 { height: 74%; }
.phpew-graph-h75 { height: 75%; }
.phpew-graph-h76 { height: 76%; }
.phpew-graph-h77 { height: 77%; }
.phpew-graph-h78 { height: 78%; }
.phpew-graph-h79 { height: 79%; }
.phpew-graph-h80 { height: 80%; }
.phpew-graph-h81 { height: 81%; }
.phpew-graph-h82 { height: 82%; }
.phpew-graph-h83 { height: 83%; }
.phpew-graph-h84 { height: 84%; }
.phpew-graph-h85 { height: 85%; }
.phpew-graph-h86 { height: 86%; }
.phpew-graph-h87 { height: 87%; }
.phpew-graph-h88 { height: 88%; }
.phpew-graph-h89 { height: 89%; }
.phpew-graph-h90 { height: 90%; }
.phpew-graph-h91 { height: 91%; }
.phpew-graph-h92 { height: 92%; }
.phpew-graph-h93 { height: 93%; }
.phpew-graph-h94 { height: 94%; }
.phpew-graph-h95 { height: 95%; }
.phpew-graph-h96 { height: 96%; }
.phpew-graph-h97 { height: 97%; }
.phpew-graph-h98 { height: 98%; }
.phpew-graph-h99 { height: 99%; }
.phpew-graph-h100 { height: 100%; }

.phpew-graph-c1 { background: var(--phpew-chart-1); --phpew-graph-ink: var(--phpew-chart-1); }
.phpew-graph-c2 { background: var(--phpew-chart-2); --phpew-graph-ink: var(--phpew-chart-2); }
.phpew-graph-c3 { background: var(--phpew-chart-3); --phpew-graph-ink: var(--phpew-chart-3); }
.phpew-graph-c4 { background: var(--phpew-chart-4); --phpew-graph-ink: var(--phpew-chart-4); }
.phpew-graph-c5 { background: var(--phpew-chart-5); --phpew-graph-ink: var(--phpew-chart-5); }
.phpew-graph-c6 { background: var(--phpew-chart-6); --phpew-graph-ink: var(--phpew-chart-6); }
.phpew-graph-c7 { background: var(--phpew-chart-7); --phpew-graph-ink: var(--phpew-chart-7); }
.phpew-graph-c8 { background: var(--phpew-chart-8); --phpew-graph-ink: var(--phpew-chart-8); }

.phpew-graph[data-phpew-height="120"] .phpew-graph-plot { height: 120px; }
.phpew-graph[data-phpew-height="160"] .phpew-graph-plot { height: 160px; }
.phpew-graph[data-phpew-height="200"] .phpew-graph-plot { height: 200px; }
.phpew-graph[data-phpew-height="220"] .phpew-graph-plot { height: 220px; }
.phpew-graph[data-phpew-height="240"] .phpew-graph-plot { height: 240px; }
.phpew-graph[data-phpew-height="280"] .phpew-graph-plot { height: 280px; }
.phpew-graph[data-phpew-height="320"] .phpew-graph-plot { height: 320px; }
.phpew-graph[data-phpew-height="400"] .phpew-graph-plot { height: 400px; }
.phpew-graph[data-phpew-height="480"] .phpew-graph-plot { height: 480px; }

.phpew-code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  padding: 0.875rem 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}


.phpew-logs {
  width: 100%;
  box-sizing: border-box;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  padding: 1rem;
  border-radius: var(--phpew-radius);
  font-size: 0.7rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}


.phpew-error   { color: var(--phpew-error); }

.phpew-notice {
  border: 1px solid var(--phpew-border);
  background: var(--phpew-surface);
  border-radius: var(--phpew-radius);
  padding: 0.875rem 1rem;
  margin: 1rem 0;
}
.phpew-notice p { margin: 0 0 0.5rem 0; }
.phpew-notice form { margin: 0; }
.phpew-success { color: var(--phpew-success); }
.phpew-muted   { color: var(--phpew-muted); }


/* The nav runs across the top. A 200px column down the side cost every pane
   that width for the whole session, and the panes are the point. */
.phpew-admin {
  display: block;
}
.phpew-admin-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
  /* The strip owns no space below it. What follows decides how close it sits. */
  margin-bottom: 0;
  /* The strip runs edge to edge; its words line up with the panes below it. */
  padding: 0 var(--phpew-admin-gutter) 0.35rem;
  border-bottom: 1px solid var(--phpew-border);
  position: sticky;
  /* Under the site header, not on top of it. The header's height is its
     content's -- a logo, at whatever size the theme sets -- so it is measured
     rather than guessed; a guess put the nav across the middle of the logo. */
  top: var(--phpew-header-h);
  z-index: 9;
  background: var(--phpew-bg);
}
/* .phpew-admin-content's padding belongs to phpew_admin.css, which is the
   sheet that has always set it. Two sheets padding one element is how the
   toolbar ended up with 24px above it that nothing here could explain. */
.phpew-admin-nav a {
  color: var(--phpew-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--phpew-radius-sm);
  font-size: var(--phpew-fs-sm);
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}
.phpew-admin-nav a:hover {
  text-decoration: none;
  background: var(--phpew-surface);
  color: var(--phpew-fg);
}
.phpew-admin-nav a.active {
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
}
.phpew-admin-nav a { display: flex; align-items: center; gap: 0.5rem; }
/* A tab is as wide as its word; a menu row fills the panel it sits in. */
.phpew-admin-nav > a { white-space: nowrap; }
.phpew-admin-nav-menu a { width: 100%; white-space: nowrap; }
.phpew-admin-nav-badge {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 1px 7px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  border-radius: 999px;
  background: var(--phpew-surface);
  color: var(--phpew-muted);
  border: 1px solid var(--phpew-border);
  flex: 0 0 auto;
  white-space: nowrap;
}
.phpew-admin-nav a.active .phpew-admin-nav-badge {
  background: color-mix(in srgb, var(--phpew-accent-fg) 20%, transparent);
  border-color: transparent;
  color: var(--phpew-accent-fg);
}
.phpew-admin-nav-badge--pro {
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
  border-color: transparent;
}
.phpew-admin-content > h2:first-child { margin-top: 0; }
.phpew-admin-nav-group {
  position: relative;
}
.phpew-admin-nav-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.75rem;
  font-size: var(--phpew-fs-sm);
  font-weight: 600;
  color: var(--phpew-fg);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-radius: var(--phpew-radius-sm);
}
.phpew-admin-nav-group > summary::-webkit-details-marker { display: none; }
.phpew-admin-nav-group > summary::after {
  content: '▾';
  font-size: .7em;
  opacity: .6;
  transition: transform 120ms ease;
}
.phpew-admin-nav-group[open] > summary::after { transform: rotate(180deg); }
.phpew-admin-nav-group > summary:hover { background: var(--phpew-surface); }
/* Which group you are inside is worth showing; hanging it open is not. */
.phpew-admin-nav-group--current > summary { color: var(--phpew-accent); }

.phpew-admin-nav-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 40;
  min-width: 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.3rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
/* The last groups sit near the right edge, so their panels open leftward
   rather than off the page. */
.phpew-admin-nav-group:nth-last-child(-n+2) .phpew-admin-nav-menu {
  left: auto;
  right: 0;
}
.phpew-admin-nav-divider {
  height: 1px;
  background: var(--phpew-border, #3f3f46);
  margin: .5rem 0;
}

@media (max-width: 720px) {
  .phpew-main--padded { padding: 1.25rem 1rem; }
  .phpew-header { padding: 0.75rem 1.25rem; }
  .phpew-admin-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 1rem;
  }
  /* Scrolling clips an absolutely-positioned panel, so on a narrow screen the
     group opens in flow and pushes the page down instead. */
  .phpew-admin-nav-menu {
    position: static;
    box-shadow: none;
    min-width: 0;
  }
}


.phpew-layout {
  flex: 1 0 auto;
}

.phpew-area-stack {
  display: flex;
  flex-direction: column;
  gap: var(--phpew-stack-gap, 1rem);
}

.phpew-layout-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.phpew-layout-row:last-child { margin-bottom: 0; }

.phpew-layout-col { min-width: 0; }
.phpew-layout-col--w1 { flex: 1 1 0; }
.phpew-layout-col--w2 { flex: 2 1 0; }
.phpew-layout-col--w3 { flex: 3 1 0; }
.phpew-layout-col--w4 { flex: 4 1 0; }

.phpew-layout-header,
.phpew-layout-footer { padding: 1rem 0; }

.phpew-layout-error {
  padding: 0.75rem 1rem;
  background: var(--phpew-error-bg, #fef2f2);
  border: 1px solid var(--phpew-error, #dc2626);
  border-radius: 6px;
  color: var(--phpew-error, #dc2626);
  font-size: 0.875rem;
}

@media (max-width: 720px) {
  .phpew-layout-row { flex-direction: column; gap: 1rem; }
  .phpew-layout-col { flex: 1 1 auto !important; width: 100%; }
}

.phpew-admin-editor-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 56rem;
  margin: 0 0 1.5rem;
}
.phpew-admin-editor-row {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.phpew-admin-editor-row[hidden] { display: none; }
.phpew-admin-editor-label {
  font-weight: 600;
  color: var(--phpew-fg);
}
.phpew-admin-input {
  width: 100%;
  box-sizing: border-box;
  padding: .55rem .65rem;
  background: var(--phpew-surface);
  color: var(--phpew-fg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius, 4px);
  font-family: inherit;
  font-size: var(--phpew-fs-base, 1rem);
  line-height: 1.45;
}
.phpew-admin-input:focus {
  outline: 2px solid var(--phpew-accent, #6366f1);
  outline-offset: 1px;
}
.phpew-admin-input--textarea {
  resize: vertical;
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
  font-size: .9rem;
}
.phpew-admin-body {
  height: 22rem;
}
.phpew-admin-editor-error {
  color: var(--phpew-error, #dc2626);
  font-size: var(--phpew-fs-sm, .85rem);
}
.phpew-admin-editor-form {
  padding-bottom: 5rem;
}
.phpew-admin-editor-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--phpew-surface, var(--phpew-bg));
  border-top: 1px solid var(--phpew-border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, .08);
  padding: .75rem 1.25rem;
  margin-top: 0;
}
/* A notice, not a slab. It used to be a full-width bar in the flow above the
   nav, which pushed the page down, sat over the header and never went away. */
.phpew-admin-flash {
  position: fixed;
  top: calc(var(--phpew-header-h) + 3.25rem);
  right: 1.25rem;
  z-index: 8;
  max-width: min(28rem, calc(100vw - 2.5rem));
  margin: 0;
  padding: .6rem .9rem;
  font-size: var(--phpew-fs-sm);
  border-radius: var(--phpew-radius, .25rem);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transition: opacity 400ms ease;
}
.phpew-admin-flash[hidden] { display: none; }
.phpew-admin-flash--fading { opacity: 0; }
.phpew-admin-flash--success {
  background: var(--phpew-success-bg, #dcfce7);
  color:      var(--phpew-success-fg, #166534);
}
.phpew-admin-flash--error {
  background: var(--phpew-error-bg, #fee2e2);
  color:      var(--phpew-error-fg, #b91c1c);
}
/* It worked, and something still wants looking at. */
.phpew-admin-flash--warning {
  background: var(--phpew-warn-bg, #fef3c7);
  color:      var(--phpew-warn-fg, #92400e);
}
.phpew-admin-form-inline { display: inline; }

.phpew-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.phpew-video-grid-cell {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phpew-video-grid-cell > * {
  flex: 1 1 auto;
  min-height: 0;
}
.phpew-video-grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phpew-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: max-content;
  align-items: start;
  gap: 1rem;
}
.phpew-cards[data-cols="1"] { grid-template-columns: 1fr; }
.phpew-cards[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.phpew-cards[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.phpew-cards[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.phpew-cards[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }
.phpew-cards + .phpew-cards { margin-top: 1.5rem; }
.phpew-card {
  display: flex;
  flex-direction: column;
}
.phpew-card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.phpew-card-link { display: block; }
.phpew-card-link:hover .phpew-card-image { opacity: .85; }

.phpew-lb {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.phpew-lb[hidden] { display: none; }
.phpew-lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--phpew-radius, .25rem);
  box-shadow: 0 0 3rem rgba(0,0,0,.6);
}
.phpew-lb-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
}
.phpew-lb-close:hover { opacity: 1; }

.phpew-inline-form     { display: inline; }
.phpew-pill-notice     { margin: 0; padding: 0.0625rem 0.4rem; }
.phpew-stack-tight     { margin-top: 0.75rem; }
.phpew-stack-section   { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--phpew-border); }

.phpew-branding-form     { max-width: 36rem; }
.phpew-branding-fs       { border: 1px solid var(--phpew-border); border-radius: var(--phpew-radius); padding: 0.75rem 1rem; margin: 0 0 1rem; }
.phpew-branding-fs:last-child { margin-bottom: 0; }
.phpew-branding-fs legend { padding: 0 0.5rem; font-weight: 600; }
.phpew-branding-option   { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.375rem 0; cursor: pointer; }
.phpew-branding-option input[type="radio"] { margin-top: 0.25rem; flex: 0 0 auto; }
.phpew-branding-option--locked          { cursor: not-allowed; opacity: 0.7; }
.phpew-branding-option--locked strong   { color: var(--phpew-muted); }
.phpew-branding-upgrade-pill {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 1px 7px;
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  text-decoration: none;
  vertical-align: middle;
}
.phpew-branding-upgrade-pill:hover { background: var(--phpew-accent-hover); }
.phpew-branding-field    { display: flex; flex-direction: column; gap: 0.3125rem; margin: 0 0 0.75rem; }
.phpew-branding-img-row  { display: flex; gap: 0.5rem; }
.phpew-branding-height-input { max-width: 6rem; }
.phpew-branding-img-row .phpew-input { flex: 1 1 auto; }
.phpew-branding-preview {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--phpew-surface);
  border-radius: var(--phpew-radius);
  border: 1px solid var(--phpew-border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.phpew-branding-preview img {
  display: block;
  max-width: 100%;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.phpew-media-picker-head h3 { margin: 0; }
.phpew-media-picker-grid .phpew-muted,
.phpew-media-picker-grid .phpew-error { grid-column: 1 / -1; }

.phpew-pages-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.phpew-pages-fronthelp {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  background: var(--phpew-card-bg);
}
.phpew-pages-fronthelp > summary {
  cursor: pointer;
  font-weight: 600;
}
.phpew-pages-fronthelp[open] > summary { margin-bottom: 0.5rem; }
.phpew-pages-add-form { max-width: 36rem; }
.phpew-inline-form { display: inline; margin: 0; }

.phpew-tpl-fields-header {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--phpew-surface);
  border-radius: var(--phpew-radius);
}
.phpew-tpl-fields-header p { margin: 0.25rem 0 0; font-size: 0.85rem; }
.phpew-tpl-fields-settings {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
}
.phpew-tpl-fields-settings > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.phpew-tpl-fields-settings[open] > summary { margin-bottom: 0.5rem; }

.phpew-pages-content-link {
  padding: 0.6rem 0.85rem;
  margin: 0 0 1rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-left: 3px solid var(--phpew-accent);
  border-radius: var(--phpew-radius);
}
.phpew-pages-content-link small { display: block; margin-top: 0.25rem; }
.phpew-article-appears-at {
  padding: 0.5rem 0.85rem;
  margin: 0.25rem 0 1rem;
  background: var(--phpew-card-bg);
  border-radius: var(--phpew-radius);
  font-size: 0.9rem;
}
.phpew-article-justcreated {
  padding: 0.6rem 0.85rem;
  margin: 0 0 1rem;
  border-radius: var(--phpew-radius);
}
.phpew-btn--ghost {
  background: transparent;
  border: 1px solid var(--phpew-border);
  color: var(--phpew-fg);
}
.phpew-btn--ghost:hover { border-color: var(--phpew-accent); }

.phpew-form .phpew-checkbox-row,
.phpew-checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
  font-weight: normal;
}
.phpew-form .phpew-checkbox-row > input[type="checkbox"],
.phpew-checkbox-row > input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  margin: 0.2rem 0 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--phpew-border);
  box-shadow: none;
}
.phpew-checkbox-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.phpew-checkbox-row-text strong { font-weight: 600; }
.phpew-checkbox-row-text small  { color: var(--phpew-muted); font-size: 0.85rem; }

.phpew-pages-section-card {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  background: var(--phpew-card-bg);
}
.phpew-pages-section-card > summary {
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0;
}
.phpew-pages-section-card[open] > summary { margin-bottom: 0.5rem; }
.phpew-slot-table th { font-weight: 600; }

.phpew-pages-save-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.phpew-pages-save-bar-status {
  font-size: var(--phpew-fs-sm);
  color: var(--phpew-muted);
}
.phpew-pages-unsaved .phpew-pages-save-bar-status {
  color: var(--phpew-warning);
  font-weight: 500;
}

.phpew-pages-edit-nav {
  display: flex;
  gap: 1rem;
  font-size: var(--phpew-fs-sm);
  margin: 0.75rem 0 1.25rem;
  flex-wrap: wrap;
}

.phpew-warning {
  padding: 0.6rem 0.75rem;
  background: color-mix(in srgb, var(--phpew-warning, #d97706) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--phpew-warning, #d97706) 40%, transparent);
  border-radius: var(--phpew-radius);
  color: var(--phpew-fg);
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}
.phpew-slot-table td code { font-size: 0.85rem; }
.phpew-slot-no-label { font-size: 0.8rem; text-decoration: none; }

.phpew-slot-table tr[draggable="true"]:hover { background: color-mix(in srgb, var(--phpew-accent, #4f46e5) 4%, transparent); }
.phpew-slot-table tr.is-dragging { opacity: 0.45; }

.phpew-image-field { display: flex; gap: 0.5rem; align-items: stretch; }
.phpew-image-field-input { flex: 1; min-width: 0; }
.phpew-image-field-browse { flex-shrink: 0; white-space: nowrap; }

.phpew-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--phpew-radius, 0.375rem);
  background: var(--phpew-fg, #1f2937);
  color: var(--phpew-bg, #ffffff);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 28rem;
  font-size: 0.875rem;
  opacity: 1;
  transition: opacity 0.8s ease;
}
.phpew-toast--info { background: var(--phpew-accent, #4f46e5); color: var(--phpew-accent-fg, #ffffff); }
.phpew-toast.is-fading { opacity: 0; }

.phpew-roles-row { display: inline-flex; gap: 0.6rem; align-items: center; }
.phpew-roles-row label { font-size: 0.9rem; }
.phpew-users-roles-save { margin-top: 0.75rem; display: flex; justify-content: flex-end; }

.phpew-empty-slot {
  padding: 0.85rem 1rem;
  border: 1px dashed var(--phpew-border);
  border-radius: var(--phpew-radius);
  background: color-mix(in srgb, var(--phpew-accent) 6%, transparent);
  margin: 0.5rem 0;
}

.phpew-content-toolbar { display: flex; gap: 0.5rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.phpew-content-filter { display: flex; gap: 0.4rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
.phpew-content-filter input[type="search"] { min-width: 12rem; }
.phpew-content-filter select { max-width: 14rem; }
.phpew-content-add { position: relative; }
.phpew-content-add-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 14rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  padding: 0.25rem 0;
  z-index: 10;
}
.phpew-content-add-menu a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--phpew-fg);
  font-size: 0.9rem;
  text-decoration: none;
}
.phpew-content-add-menu a:hover { background: var(--phpew-surface); }
.phpew-content-add-group + .phpew-content-add-group { border-top: 1px solid var(--phpew-border); }
.phpew-content-add-group-label {
  display: block;
  padding: 0.3rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phpew-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.phpew-content-add-group-label::-webkit-details-marker { display: none; }
.phpew-content-add-group-label::before { content: '▸ '; font-size: 0.6rem; }
.phpew-content-add-group[open] > .phpew-content-add-group-label::before { content: '▾ '; }

.phpew-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--phpew-card-min, 260px), 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.phpew-template-card {
  padding: 0.85rem 1rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.phpew-template-card-name { margin: 0; font-size: 1rem; }
.phpew-template-card { position: relative; }
.phpew-template-card-head { display: flex; flex-direction: column; gap: 0.25rem; }
a.phpew-template-card-name { font-weight: 700; text-decoration: none; color: var(--phpew-fg); }
a.phpew-template-card-name:hover { color: var(--phpew-accent, #6c63ff); }
.phpew-template-card-meta > * + * { margin-left: 0.35rem; }
.phpew-template-type-badge {
  background: var(--phpew-surface);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
}
.phpew-template-card-slug {
  font-size: 0.72rem;
  color: var(--phpew-muted);
  background: var(--phpew-surface);
  padding: 1px 6px;
  border-radius: 3px;
  align-self: flex-start;
}
.phpew-template-filters { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.phpew-template-search { flex: 1 1 16rem; max-width: 28rem; }
.phpew-filter-menu { position: relative; }
.phpew-filter-count {
  display: inline-block;
  min-width: 1.1rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--phpew-accent, #6c63ff);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
}
.phpew-filter-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.3rem);
  left: 0;
  min-width: 13rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--phpew-border);
  border-radius: 6px;
  background: var(--phpew-bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.phpew-filter-clear { width: 100%; margin-bottom: 0.4rem; }
.phpew-filter-group-label {
  margin: 0.5rem 0 0.2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--phpew-muted);
}
.phpew-filter-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.2rem;
  border-radius: 4px;
  cursor: pointer;
}
.phpew-filter-option:hover { background: var(--phpew-surface); }
.phpew-template-count { margin-left: auto; font-size: 0.85rem; }
.phpew-template-card-name { margin: 0; font-size: 0.95rem; line-height: 1.3; }
.phpew-template-card-desc { margin: 0; font-size: 0.85rem; color: var(--phpew-muted); }
.phpew-template-card-meta { margin: 0; }
.phpew-template-type-badge--form {
  background: var(--phpew-accent, #6c63ff);
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
}
.phpew-template-card-actions { margin-top: auto; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.phpew-template-toggle { display: inline; margin: 0; }
.phpew-template-card--hidden { opacity: 0.55; }
.phpew-template-cat-badge {
  background: var(--phpew-surface);
  color: var(--phpew-muted);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.72rem;
}
.phpew-template-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
}
.phpew-btn--active {
  background: var(--phpew-accent);
  color: #fff;
  border-color: var(--phpew-accent);
}

.phpew-list--full .phpew-list-items > article { margin: 0 0 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--phpew-border); }
.phpew-list--full .phpew-list-items > article:last-child { border-bottom: none; }

.phpew-forum-cat-list,
.phpew-forum-thread-list    { list-style: none; margin: 0; padding: 0; }
.phpew-forum-cat-item       { display: flex; align-items: baseline; gap: 0.5rem;
                               padding: 0.6rem 0; border-bottom: 1px solid var(--phpew-border); }
.phpew-forum-cat-item:last-child { border-bottom: none; }
.phpew-forum-cat-link       { flex: 1; text-decoration: none; color: var(--phpew-fg); display: flex; flex-direction: column; gap: 0.15rem; }
.phpew-forum-cat-link:hover .phpew-forum-cat-title { color: var(--phpew-accent); }
.phpew-forum-cat-title      { font-weight: 600; }
.phpew-forum-cat-desc       { font-size: 0.82rem; color: var(--phpew-muted); }
.phpew-forum-cat-count      { font-size: 0.78rem; color: var(--phpew-muted); white-space: nowrap; }
.phpew-forum-thread-item    { padding: 0.45rem 0; border-bottom: 1px solid var(--phpew-border); font-size: 0.9rem; }
.phpew-forum-thread-item:last-child { border-bottom: none; }
.phpew-forum-thread-item a  { color: var(--phpew-fg); text-decoration: none; }
.phpew-forum-thread-item a:hover { color: var(--phpew-accent); }

.phpew-wizard-wrap         { max-width: 640px; margin: 3rem auto; padding: 0 1rem; }
.phpew-wizard-card         { background: var(--phpew-card-bg); border: 1px solid var(--phpew-border);
                              border-radius: var(--phpew-radius); padding: 2rem; }
.phpew-wizard-card--hidden { display: none; }
.phpew-wizard-heading      { margin: 0 0 0.25rem; font-size: 1.35rem; font-weight: 600; }
.phpew-wizard-hint         { margin: 0 0 0.5rem; color: var(--phpew-muted); font-size: 0.9rem; }
.phpew-wizard-input        { width: 100%; box-sizing: border-box; margin-top: 1rem; }
.phpew-wizard-type-row     { display: flex; gap: 1rem; margin-top: 1.5rem; }
.phpew-wizard-type-btn     { flex: 1; display: flex; flex-direction: column; align-items: center;
                              gap: 0.4rem; padding: 1.25rem 1rem; border: 2px solid var(--phpew-border);
                              border-radius: var(--phpew-radius); background: var(--phpew-surface);
                              cursor: pointer; color: var(--phpew-fg); text-align: center; }
.phpew-wizard-type-btn:hover { border-color: var(--phpew-accent); }
.phpew-wizard-type-btn.is-selected { border-color: var(--phpew-accent); }
.phpew-wizard-type-icon    { font-size: 2rem; line-height: 1; }
.phpew-wizard-type-label   { font-weight: 600; }
.phpew-wizard-type-desc    { font-size: 0.82rem; color: var(--phpew-muted); }
.phpew-wizard-layout-more  { text-align: right; margin-top: 0.75rem; font-size: 0.875rem; }
.phpew-wizard-more-link    { color: var(--phpew-accent); text-decoration: none; }
.phpew-wizard-more-link:hover { text-decoration: underline; }
.phpew-wizard-layout-grid  { display: grid; grid-template-columns: repeat(3, 1fr);
                              gap: 0.75rem; margin-top: 0.5rem; }
.phpew-wizard-layout-card  { border: 2px solid var(--phpew-border); border-radius: var(--phpew-radius);
                              cursor: pointer; overflow: hidden; background: var(--phpew-bg);
                              box-shadow: 0 1px 3px rgba(0,0,0,0.07);
                              transition: border-color 0.1s, box-shadow 0.1s; }
.phpew-wizard-layout-card:hover { border-color: var(--phpew-accent);
                              box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.phpew-wizard-layout-card.is-selected { border-color: var(--phpew-accent);
                              box-shadow: 0 0 0 2px var(--phpew-accent); }
.phpew-wiz-thumb           { display: flex; flex-direction: column; }
.phpew-wiz-thumb-header    { height: 8px; background: var(--phpew-border-strong); flex-shrink: 0; }
.phpew-wizard-layout-card.is-selected .phpew-wiz-thumb-header { background: var(--phpew-accent); }
.phpew-wiz-thumb-body      { display: flex; gap: 3px; padding: 4px;
                              background: var(--phpew-surface); flex: 1; }
.phpew-wiz-thumb-footer    { height: 6px; background: var(--phpew-border); flex-shrink: 0; }
.phpew-wiz-thumb-col       { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.phpew-wiz-thumb-col[data-flex="2"] { flex: 2; }
.phpew-wiz-thumb-col[data-flex="3"] { flex: 3; }
.phpew-wiz-skel            { border-radius: 2px; background: var(--phpew-border); flex-shrink: 0; }
.phpew-wiz-skel--img       { height: 22px; background: var(--phpew-border-strong); }
.phpew-wiz-skel--line      { height: 3px; }
.phpew-wiz-skel--line[data-w="80"] { width: 80%; }
.phpew-wiz-skel--line[data-w="60"] { width: 60%; }
.phpew-wizard-layout-label { font-size: 0.78rem; text-align: center; padding: 0.3rem 0.5rem 0.35rem;
                              color: var(--phpew-fg); border-top: 1px solid var(--phpew-border);
                              background: var(--phpew-card-bg); }
.phpew-wizard-form         { display: none; }
.phpew-wizard-nav          { display: flex; justify-content: space-between; margin-top: 1.5rem; }
.phpew-wizard-nav > :only-child { margin-left: auto; }
.phpew-forum-thread-meta    { font-size: 0.78rem; }

.phpew-edit-pill {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.3rem 0.85rem;
    font-size: 0.75rem;
    line-height: 1.4;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:where(body[data-admin="1"]) :where([data-section], [data-article-id]) {
    position: relative;
}
body[data-admin="1"] [data-section]:hover > .phpew-edit-pill,
body[data-admin="1"] [data-section]:focus-within > .phpew-edit-pill,
body[data-admin="1"] [data-article-id]:hover > .phpew-edit-pill,
body[data-admin="1"] [data-article-id]:focus-within > .phpew-edit-pill {
    opacity: 1;
    pointer-events: auto;
}
body[data-admin="1"] .phpew-edit-pill:hover {
    background: rgba(0, 0, 0, 1);
    text-decoration: none;
}
body.phpew-si-on .phpew-edit-pill {
    display: none !important;
}
body[data-admin="1"] [data-section]:has([data-article-id]:hover) > .phpew-edit-pill {
    opacity: 0;
    pointer-events: none;
}


.phpew-site-not-ready {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem;
  text-align: center;
}
.phpew-site-not-ready-card { max-width: 34rem; }
.phpew-site-not-ready-title {
  font-size: var(--phpew-fs-xl, 2rem);
  margin: 0 0 .5rem;
  color: var(--phpew-fg);
}
.phpew-site-not-ready-lead {
  font-size: var(--phpew-fs-lg, 1.1rem);
  color: var(--phpew-fg);
  opacity: .7;
  margin: 0 0 1.75rem;
}
.phpew-site-not-ready-owner { font-size: var(--phpew-fs-sm, .9rem); }

.phpew-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: var(--phpew-radius, 6px);
  font: 600 var(--phpew-fs-base, 1rem)/1.2 inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  overflow: hidden;
}
.phpew-button:hover { text-decoration: none; }
.phpew-button:active { transform: translateY(1px); }

.phpew-button--primary {
  background: var(--phpew-accent, #4f46e5);
  color: var(--phpew-accent-fg, #ffffff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.phpew-button--primary:hover {
  background: var(--phpew-accent-hover, var(--phpew-accent, #4f46e5));
}
.phpew-button--primary .phpew-button-label { color: inherit; }
.phpew-button:focus-visible {
  outline: 2px solid var(--phpew-focus-ring, var(--phpew-accent, #6366f1));
  outline-offset: 2px;
}

.phpew-button-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.phpew-button-image,
.phpew-button-label,
.phpew-button-pill { position: relative; z-index: 1; }

.phpew-button-image {
  flex: 0 0 auto;
  height: 1.2em;
  width: auto;
  max-width: 100%;
  display: block;
}

.phpew-button-label { display: inline-block; }

.phpew-button-pill {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  min-width: 1.2rem;
  padding: 0 0.35rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--phpew-error, #ef4444);
  color: #fff;
  font: 600 0.7rem/1 inherit;
  border-radius: 999px;
}
.phpew-button-pill:empty { display: none; }

.phpew-account-fields {
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
}
.phpew-account-field {
  display: contents;
}
.phpew-account-field-label {
  font-weight: 600;
  color: var(--phpew-muted);
}
.phpew-account-field-value {
  margin: 0;
}
.phpew-account-section {
  margin: 1.5rem 0;
}
.phpew-account-pw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: .5rem;
}
.phpew-account-pw-reset {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.phpew-account-pw-change-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 22rem;
  margin: 0 0 1rem;
}
.phpew-account-pw-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.phpew-account-pw-field input {
  width: 100%;
}
.phpew-account-pw-change-form .phpew-account-pw-change {
  align-self: flex-start;
}

.phpew-nav-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.phpew-nav-bell-count {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  min-width: 1.1rem;
  padding: 0 0.3rem;
  height: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--phpew-error, #ef4444);
  color: #fff;
  font: 600 0.65rem/1 inherit;
  border-radius: 999px;
}
.phpew-people-list { list-style: none; padding: 0; margin: 1rem 0; }
.phpew-people-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--phpew-border);
}
.phpew-people-row-link {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.phpew-people-row-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--phpew-surface);
}
.phpew-people-row-username { color: var(--phpew-muted); }
.phpew-people-row-actions { display: flex; gap: 0.4rem; }
.phpew-notifications-list { list-style: none; padding: 0; }
.phpew-notifications-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--phpew-border);
}
.phpew-notifications-row.is-unread { background: var(--phpew-card-bg); }
.phpew-notifications-when { margin-left: auto; color: var(--phpew-muted); }
.phpew-privacy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
}
.phpew-player-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.phpew-player-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--phpew-card-bg);
}

.phpew-chat {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 1rem;
  min-height: 60vh;
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius, .5rem);
  overflow: hidden;
}
.phpew-chat-inbox {
  border-right: 1px solid var(--phpew-border);
  padding: 0.75rem;
  background: var(--phpew-surface);
  overflow-y: auto;
}
.phpew-chat-inbox-list { list-style: none; padding: 0; margin: 0; }
.phpew-chat-inbox-row a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--phpew-radius, .25rem);
  color: inherit;
  text-decoration: none;
}
.phpew-chat-inbox-row.is-on a { background: var(--phpew-accent); color: var(--phpew-accent-fg); }
.phpew-chat-inbox-row.has-unread .phpew-chat-inbox-name { font-weight: 700; }
.phpew-chat-inbox-badge {
  margin-left: auto;
  background: var(--phpew-error, #ef4444);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0 0.4rem;
  min-width: 1.2rem;
  text-align: center;
}
.phpew-chat-thread {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  min-width: 0;
}
.phpew-chat-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--phpew-border);
  margin-bottom: 0.5rem;
}
.phpew-chat-messages {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.phpew-chat-message {
  max-width: 75%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--phpew-card-bg);
  position: relative;
}
.phpew-chat-message.is-mine {
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
  align-self: flex-end;
}
.phpew-chat-message.is-theirs { align-self: flex-start; }
.phpew-chat-message-when {
  display: block;
  font-size: 0.7rem;
  opacity: 0.65;
  margin-top: 0.2rem;
}
.phpew-chat-message-report {
  position: absolute;
  top: 0.1rem;
  right: -1.6rem;
}
.phpew-chat-message:not(:hover) .phpew-chat-message-report { display: none; }
.phpew-chat-send {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.phpew-chat-send textarea {
  flex: 1 1 auto;
  resize: vertical;
  padding: 0.5rem;
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius, .25rem);
  background: var(--phpew-card-bg);
  color: var(--phpew-fg);
  font: inherit;
}
.phpew-chat-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#phpew-e2e-modal-host {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}
#phpew-e2e-modal-host:empty { display: none; }
.phpew-e2e-modal {
  background: var(--phpew-card-bg, #fff);
  color: var(--phpew-fg, #111);
  padding: 1.75rem;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
}
.phpew-e2e-modal h2 { margin-top: 0; }
.phpew-e2e-choice { display: grid; gap: 0.75rem; margin-top: 1rem; }
.phpew-e2e-choice button {
  text-align: left;
  padding: 1rem;
  border: 1px solid var(--phpew-border, #ccc);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.phpew-e2e-choice button:hover { background: var(--phpew-hover-bg, rgba(0,0,0,0.05)); }
.phpew-e2e-choice button strong { display: block; margin-bottom: 0.35rem; font-size: 1.05em; }
.phpew-e2e-choice button p { margin: 0; font-size: 0.92em; opacity: 0.85; }
.phpew-e2e-phrase {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  background: var(--phpew-code-bg, rgba(0,0,0,0.05));
  padding: 1rem;
  border-radius: 6px;
  font-size: 1.05em;
  line-height: 1.6;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  word-break: break-word;
}
.phpew-e2e-actions {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
  flex-wrap: wrap;
}
.phpew-e2e-confirm {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.95em;
}
.phpew-e2e-footer { margin-top: 1rem; }
.phpew-e2e-password input[type="password"],
.phpew-e2e-password input[type="text"],
.phpew-e2e-unlock   input[type="password"],
.phpew-e2e-unlock   input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--phpew-border, #ccc);
  background: var(--phpew-input-bg, #fff);
  color: inherit;
  font: inherit;
  margin-bottom: 0.5rem;
}

body.phpew-page--phpew-media-picker .phpew-header,
body.phpew-page--phpew-media-picker .phpew-footer {
  display: none;
}

/* A field authored to hold a value rather than show one. Replaces the old
   per-field `render: false`, which produced no element at all and so could
   not be targeted, overridden, or seen in the editor's preview. */
.phpew-hidden { display: none; }

.phpew-form-section {
  margin: 0 0 1.5rem;
  max-width: 42rem;
  color: var(--phpew-fg, #111);
}

.phpew-form-heading {
  margin: 0 0 .5rem;
  font-size: var(--phpew-fs-lg, 1.3rem);
  font-weight: 700;
}

.phpew-form-intro {
  margin: 0 0 1rem;
  color: var(--phpew-muted, #555);
  font-size: var(--phpew-fs-base, 1rem);
}

.phpew-form-success {
  padding: .75rem 1rem;
  background: var(--phpew-success-bg, #f0fdf4);
  border: 1px solid var(--phpew-success, #16a34a);
  border-radius: var(--phpew-radius, 4px);
  color: var(--phpew-success, #16a34a);
}

.phpew-form-progress {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .75rem 0;
}
.phpew-form-progress[data-hidden] { display: none; }
.phpew-form-progress-bar { flex: 1; height: .9rem; }
.phpew-form-progress-text { color: var(--phpew-muted); font-size: var(--phpew-fs-sm); white-space: nowrap; }

.phpew-form-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.phpew-form-row {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.phpew-form-label {
  display: inline-flex;
  align-items: baseline;
  gap: .25rem;
  font-weight: 600;
  font-size: var(--phpew-fs-sm, .9rem);
  color: var(--phpew-fg, #111);
}

.phpew-form-row:has(> .phpew-form-label--inline) {
  flex-direction: row;
  align-items: baseline;
  gap: .5rem;
}

.phpew-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.phpew-form-required {
  color: var(--phpew-error, #dc2626);
  font-weight: 700;
}

.phpew-form-input {
  padding: .5rem .75rem;
  font-size: var(--phpew-fs-base, 1rem);
  font-family: inherit;
  background: var(--phpew-card-bg, #fff);
  color: var(--phpew-fg, #111);
  border: 1px solid var(--phpew-border, #ccc);
  border-radius: var(--phpew-radius, 4px);
  width: 100%;
  box-sizing: border-box;
}
.phpew-form-input:focus {
  outline: 2px solid var(--phpew-focus-ring, var(--phpew-accent, #6366f1));
  outline-offset: 1px;
  border-color: transparent;
}
.phpew-form-input--textarea {
  resize: vertical;
}
.phpew-form-input--checkbox {
  width: auto;
  margin-right: .5rem;
  accent-color: var(--phpew-accent, #6366f1);
}

.phpew-form-image-field {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.phpew-form-image-field .phpew-form-image-input {
  flex: 1;
}
.phpew-form-image-preview {
  display: block;
  align-self: flex-start;
  width: auto;
  height: auto;
  max-width: auto;
  max-height: 120px;
  margin-top: .5rem;
  border: 1px solid var(--phpew-border, #ccc);
  border-radius: var(--phpew-radius, 4px);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #c8c8c8 25%, transparent 25%),
    linear-gradient(-45deg, #c8c8c8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c8c8c8 75%),
    linear-gradient(-45deg, transparent 75%, #c8c8c8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.phpew-form-image-preview[hidden] {
  display: none;
}
.phpew-form-image-preview--light {
  background-color: #fff;
  background-image: none;
}
.phpew-form-image-preview--dark {
  background-color: #111;
  background-image: none;
}

.phpew-form-checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: var(--phpew-fs-sm, .9rem);
  color: var(--phpew-fg, #111);
  cursor: pointer;
}
.phpew-form-checkbox .phpew-form-input--checkbox {
  margin: 0;
  flex: 0 0 auto;
}

/* A field's `tip`: a ? beside the label with a tooltip, shown while hovered
   or focused and gone when either leaves. */
.phpew-form-label-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.phpew-form-tip {
  position: relative;
  cursor: help;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  border: 1px solid currentColor;
  opacity: .7;
}
.phpew-form-tip:hover,
.phpew-form-tip:focus { opacity: 1; }
.phpew-form-tip:focus { outline: none; }
.phpew-form-tip:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.phpew-form-tip-text {
  display: none;
  font-weight: 400;
}
.phpew-form-tip:hover .phpew-form-tip-text,
.phpew-form-tip:focus .phpew-form-tip-text { display: block; }
.phpew-form-tip-text {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + .35rem);
  width: max-content;
  max-width: min(22rem, 80vw);
  margin: 0;
  padding: .5rem .65rem;
  border-radius: .4rem;
  font-size: var(--phpew-fs-sm, .85rem);
  line-height: 1.4;
  background: var(--phpew-surface-raised, #222);
  color: var(--phpew-text, #fff);
  border: 1px solid var(--phpew-border, rgba(255, 255, 255, .2));
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.phpew-form-note {
  color: var(--phpew-muted, #555);
  font-size: var(--phpew-fs-sm, .85rem);
  margin: .15rem 0 0;
}

.phpew-form-error {
  color: var(--phpew-error, #dc2626);
  font-size: var(--phpew-fs-sm, .85rem);
  margin-top: .15rem;
}

.phpew-form-row--error .phpew-form-input {
  border-color: var(--phpew-error, #dc2626);
}

.phpew-form-submit {
  padding: .55rem 1rem;
  font-size: var(--phpew-fs-base, 1rem);
  font-weight: 600;
  background: var(--phpew-accent, #6366f1);
  color: var(--phpew-accent-fg, #fff);
  border: 1px solid var(--phpew-accent, #6366f1);
  border-radius: var(--phpew-radius, 4px);
  cursor: pointer;
  align-self: flex-start;
}
.phpew-form-submit:hover {
  background: var(--phpew-accent-hover, #4f46e5);
  border-color: var(--phpew-accent-hover, #4f46e5);
}

.phpew-admin-reply-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 42rem;
  margin: 0 0 1.5rem;
}
.phpew-admin-reply-row {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.phpew-admin-reply-label {
  font-size: var(--phpew-fs-sm, .85rem);
  font-weight: 600;
  color: var(--phpew-fg-muted, #94a3b8);
}
.phpew-admin-reply-form .phpew-admin-input {
  width: 100%;
  box-sizing: border-box;
}
.phpew-admin-reply-form .phpew-admin-textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.phpew-admin-reply-form .phpew-admin-input[disabled] {
  opacity: .7;
  cursor: not-allowed;
}
.phpew-admin-reply-form .phpew-btn {
  align-self: flex-start;
}

.phpew-admin-toolbar--filters,
.phpew-admin-toolbar--bulk,
.phpew-admin-toolbar--actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.phpew-admin-toolbar--filters { margin-bottom: 1rem; }
.phpew-admin-toolbar--bulk    { margin-bottom: .5rem; }

.phpew-admin-flash {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-radius: var(--phpew-radius, .25rem);
}
.phpew-admin-flash--success {
  background: var(--phpew-success-bg, #dcfce7);
  color:      var(--phpew-success-fg, #166534);
}
.phpew-admin-flash--error {
  background: var(--phpew-error-bg, #fee2e2);
  color:      var(--phpew-error-fg, #b91c1c);
}

.phpew-admin-meta-list { display: block; }

.phpew-admin-form-inline { display: inline; }

.phpew-form-row--inline {
  display: inline-block;
  vertical-align: bottom;
  margin-right: 12px;
}
.phpew-form-signal-btn { margin-bottom: 2px; }
.phpew-form-iframe-wrap {
  width: 100%;
  height: 460px;
  overflow: hidden;
  border: 1px solid var(--phpew-border, #d1d5db);
  border-radius: var(--phpew-radius, .25rem);
  background: #fff;
  margin-top: .5rem;
}
.phpew-form-iframe {
  width: calc(100% + 17px);
  height: 100%;
  border: 0;
  display: block;
}

.phpew-form-objlist,
.phpew-form-objfield {
  border: 1px solid var(--phpew-border, #d1d5db);
  border-radius: var(--phpew-radius, .25rem);
  padding: .75rem;
  margin: .5rem 0;
}
.phpew-form-objitem {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--phpew-border, #d1d5db);
}
.phpew-form-objitem:last-child { border-bottom: 0; }
.phpew-form-objitem .phpew-form-row { flex: 1 1 8rem; }
.phpew-form-objadd { margin-top: .5rem; }

.phpew-forum-breadcrumb {
    margin-bottom: var(--phpew-gap);
    font-size: var(--phpew-fs-sm);
    color: var(--phpew-muted);
}

.phpew-forum-breadcrumb a {
    color: var(--phpew-link);
    text-decoration: none;
}

.phpew-forum-breadcrumb a:hover {
    text-decoration: underline;
}


.phpew-forum-header {
    margin-bottom: var(--phpew-gap-lg);
}

.phpew-forum-header h1,
.phpew-forum-header h2 {
    margin: 0 0 var(--phpew-gap-sm);
    line-height: var(--phpew-lh-tight);
}

.phpew-forum-actions {
    margin-top: var(--phpew-gap-sm);
}

.phpew-forum-mod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--phpew-gap-sm);
    margin-top: var(--phpew-gap-sm);
}


.phpew-forum-meta {
    font-size: var(--phpew-fs-sm);
    color: var(--phpew-muted);
}


.phpew-forum-flag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: var(--phpew-fs-xs);
    font-weight: 600;
    vertical-align: middle;
    background: var(--phpew-surface);
    color: var(--phpew-muted);
    border: 1px solid var(--phpew-border);
}


.phpew-forum-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--phpew-gap-sm);
}

.phpew-forum-category {
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius);
    background: var(--phpew-card-bg);
    box-shadow: var(--phpew-shadow-sm);
}

.phpew-forum-category > a {
    display: block;
    padding: var(--phpew-gap);
    text-decoration: none;
    color: inherit;
}

.phpew-forum-category > a:hover {
    background: var(--phpew-surface);
    border-radius: var(--phpew-radius);
}

.phpew-forum-category h2 {
    margin: 0 0 0.25rem;
    font-size: var(--phpew-fs-lg);
    color: var(--phpew-fg);
}

.phpew-forum-category-desc {
    margin: 0 0 0.35rem;
    font-size: var(--phpew-fs-sm);
    color: var(--phpew-muted);
}


.phpew-forum-threads {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius);
    overflow: hidden;
}

.phpew-forum-thread {
    border-bottom: 1px solid var(--phpew-border);
    background: var(--phpew-card-bg);
}

.phpew-forum-thread:last-child {
    border-bottom: 0;
}

.phpew-forum-thread.is-sticky {
    background: var(--phpew-surface);
}

.phpew-forum-thread.is-locked {
    opacity: 0.8;
}

.phpew-forum-thread > a {
    display: block;
    padding: 0.65rem var(--phpew-gap);
    text-decoration: none;
    color: inherit;
}

.phpew-forum-thread > a:hover {
    background: var(--phpew-surface);
}

.phpew-forum-thread h3 {
    margin: 0 0 0.2rem;
    font-size: var(--phpew-fs-base);
    font-weight: 600;
    color: var(--phpew-fg);
}


.phpew-forum-posts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--phpew-gap);
}

.phpew-forum-post {
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius);
    background: var(--phpew-card-bg);
    box-shadow: var(--phpew-shadow-sm);
    overflow: hidden;
}

.phpew-forum-post-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem var(--phpew-gap);
    background: var(--phpew-surface);
    border-bottom: 1px solid var(--phpew-border);
    font-size: var(--phpew-fs-sm);
}

.phpew-forum-post-author {
    font-weight: 600;
    color: var(--phpew-fg);
}

.phpew-forum-post-author a {
    color: var(--phpew-link);
    text-decoration: none;
}

.phpew-forum-post-author a:hover {
    text-decoration: underline;
}

.phpew-forum-post-date,
.phpew-forum-post-edited {
    color: var(--phpew-muted);
    font-size: var(--phpew-fs-xs);
}

.phpew-forum-post-reply {
    margin-left: auto;
}


.phpew-forum-post-body {
    padding: var(--phpew-gap);
    line-height: var(--phpew-lh-base);
    color: var(--phpew-fg);
    overflow-wrap: break-word;
}

.phpew-forum-post-body p { margin: 0 0 0.75rem; }
.phpew-forum-post-body p:last-child { margin-bottom: 0; }

.phpew-forum-post-body h1,
.phpew-forum-post-body h2,
.phpew-forum-post-body h3,
.phpew-forum-post-body h4 {
    margin: 1rem 0 0.4rem;
    line-height: var(--phpew-lh-tight);
}

.phpew-forum-post-body ul,
.phpew-forum-post-body ol {
    margin: 0 0 0.75rem;
    padding-left: 1.5rem;
}

.phpew-forum-post-body li { margin-bottom: 0.2rem; }

.phpew-forum-post-body a {
    color: var(--phpew-link);
    text-decoration: underline;
}

.phpew-forum-post-body blockquote {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--phpew-border-strong);
    color: var(--phpew-muted);
    background: var(--phpew-surface);
    border-radius: 0 var(--phpew-radius-sm) var(--phpew-radius-sm) 0;
}

.phpew-forum-post-body code {
    font-family: var(--phpew-font-mono);
    font-size: 0.875em;
    background: var(--phpew-surface);
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius-sm);
    padding: 0.1em 0.35em;
}

.phpew-forum-post-body pre {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    background: var(--phpew-surface);
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius);
    overflow-x: auto;
}

.phpew-forum-post-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--phpew-fs-sm);
}

.phpew-forum-post-body img,
.phpew-forum-post-signature img {
    max-width: 100%;
    max-height: 24rem;
    height: auto;
    border-radius: var(--phpew-radius-sm);
}

.phpew-forum-embed {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: 40rem;
    margin: 0.75rem 0;
}
.phpew-forum-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--phpew-radius);
}


.phpew-forum-post-actions {
    display: flex;
    align-items: center;
    gap: var(--phpew-gap);
    padding: 0.4rem var(--phpew-gap);
    border-top: 1px solid var(--phpew-border);
    background: var(--phpew-surface);
}

.phpew-forum-votes {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.phpew-forum-vote-btn {
    background: none;
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius-sm);
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--phpew-muted);
    transition: background 120ms ease, border-color 120ms ease;
}

.phpew-forum-vote-btn:hover {
    background: var(--phpew-card-bg);
    border-color: var(--phpew-border-strong);
}

.phpew-forum-vote-up.is-active {
    background: var(--phpew-success-bg);
    border-color: var(--phpew-success);
    color: var(--phpew-success);
}

.phpew-forum-vote-down.is-active {
    background: var(--phpew-error-bg);
    border-color: var(--phpew-error);
    color: var(--phpew-error);
}

.phpew-forum-vote-score {
    font-size: var(--phpew-fs-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 1.5rem;
    text-align: center;
    color: var(--phpew-fg);
}

.phpew-forum-owner-actions {
    display: flex;
    gap: var(--phpew-gap-sm);
    margin-left: auto;
}


.phpew-forum-form {
    display: flex;
    flex-direction: column;
    gap: var(--phpew-gap);
    margin-top: var(--phpew-gap-lg);
}

.phpew-forum-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: var(--phpew-fs-sm);
    font-weight: 500;
    color: var(--phpew-fg);
}

.phpew-forum-field input[type="text"],
.phpew-forum-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius-sm);
    background: var(--phpew-surface);
    color: var(--phpew-fg);
    font-family: inherit;
    font-size: var(--phpew-fs-base);
    resize: vertical;
}

.phpew-forum-field input[type="text"]:focus,
.phpew-forum-field textarea:focus {
    outline: 2px solid var(--phpew-focus-ring);
    outline-offset: -1px;
    border-color: var(--phpew-accent);
}

.phpew-forum-form-actions {
    display: flex;
    gap: var(--phpew-gap-sm);
    align-items: center;
}

.phpew-forum-format-hint {
    margin: 0;
    font-size: var(--phpew-fs-xs);
}


.phpew-forum-md-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.phpew-forum-md-toolbar button {
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius-sm);
    background: var(--phpew-card-bg);
    color: var(--phpew-fg);
    font-size: var(--phpew-fs-xs);
    font-family: inherit;
    cursor: pointer;
    line-height: 1.4;
}

.phpew-forum-md-toolbar button:hover {
    background: var(--phpew-surface);
    border-color: var(--phpew-border-strong);
}

.phpew-forum-md-toolbar-upload {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius-sm);
    background: var(--phpew-card-bg);
    color: var(--phpew-fg);
    font-size: var(--phpew-fs-xs);
    cursor: pointer;
    line-height: 1.4;
    user-select: none;
}

.phpew-forum-md-toolbar-upload:hover {
    background: var(--phpew-surface);
    border-color: var(--phpew-border-strong);
}

.phpew-forum-md-toolbar-upload input[type="file"] {
    display: none;
}

.phpew-forum-md-toolbar-upload.is-uploading {
    opacity: 0.6;
    pointer-events: none;
}

.phpew-forum-md-toolbar-upload.is-error {
    border-color: var(--phpew-danger, #c0392b);
    color: var(--phpew-danger, #c0392b);
}

.phpew-forum-preview {
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius-sm);
    background: var(--phpew-surface);
    min-height: 4rem;
}


.phpew-forum-search {
    display: flex;
    gap: var(--phpew-gap-sm);
    margin-bottom: var(--phpew-gap-lg);
}

.phpew-forum-search-input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius-sm);
    background: var(--phpew-surface);
    color: var(--phpew-fg);
    font-size: var(--phpew-fs-base);
    font-family: inherit;
}

.phpew-forum-search-input:focus {
    outline: 2px solid var(--phpew-focus-ring);
    outline-offset: -1px;
    border-color: var(--phpew-accent);
}

.phpew-forum-search-section {
    margin-bottom: var(--phpew-gap-lg);
}

.phpew-forum-search-section h2 {
    margin: 0 0 var(--phpew-gap-sm);
    font-size: var(--phpew-fs-base);
    color: var(--phpew-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.phpew-forum-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--phpew-border);
    border-radius: var(--phpew-radius);
    overflow: hidden;
}

.phpew-forum-search-list li {
    padding: 0.5rem var(--phpew-gap);
    border-bottom: 1px solid var(--phpew-border);
    background: var(--phpew-card-bg);
}

.phpew-forum-search-list li:last-child {
    border-bottom: 0;
}

.phpew-forum-search-list a {
    color: var(--phpew-link);
    text-decoration: none;
}

.phpew-forum-search-list a:hover {
    text-decoration: underline;
}

.phpew-forum-search-post-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.phpew-forum-search-post-meta {
    font-size: var(--phpew-fs-xs);
    color: var(--phpew-muted);
}

.phpew-forum-search-post-snippet {
    font-size: var(--phpew-fs-sm);
    color: var(--phpew-fg);
}


.phpew-forum-stats {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem var(--phpew-gap);
    margin: 0 0 var(--phpew-gap-lg);
    font-size: var(--phpew-fs-sm);
}

.phpew-forum-stats dt {
    color: var(--phpew-muted);
    font-weight: 500;
}

.phpew-forum-stats dd {
    margin: 0;
    color: var(--phpew-fg);
}

.phpew-forum-stats-section {
    margin-bottom: var(--phpew-gap-lg);
}

.phpew-forum-stats-section h2 {
    margin: 0 0 var(--phpew-gap-sm);
    font-size: var(--phpew-fs-base);
    color: var(--phpew-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.phpew-forum-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.phpew-forum-stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: var(--phpew-fs-sm);
}

.phpew-forum-stats-list a {
    color: var(--phpew-link);
    text-decoration: none;
}

.phpew-forum-stats-list a:hover {
    text-decoration: underline;
}


.phpew-forum-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.phpew-forum-sidebar-list a {
    font-size: var(--phpew-fs-sm);
    color: var(--phpew-link);
    text-decoration: none;
}

.phpew-forum-sidebar-list a:hover {
    text-decoration: underline;
}


.phpew-forum-pagination {
    display: flex;
    align-items: center;
    gap: var(--phpew-gap-sm);
    margin: var(--phpew-gap) 0;
    font-size: var(--phpew-fs-sm);
}

.phpew-forum-pagination-info {
    color: var(--phpew-muted);
}

.phpew-forum-pagination .phpew-btn[aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
}


.phpew-forum-report-link {
    margin-left: auto;
    font-size: var(--phpew-fs-xs);
    color: var(--phpew-muted);
}

.phpew-forum-report-link:hover {
    color: var(--phpew-error);
}


.phpew-forum-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.phpew-forum-avatar-lg {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.phpew-forum-header:has(.phpew-forum-avatar-lg) {
    display: flex;
    align-items: center;
    gap: var(--phpew-gap);
    flex-wrap: wrap;
}

.phpew-forum-header:has(.phpew-forum-avatar-lg) h1 {
    margin-bottom: 0;
}


.phpew-forum-level {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: var(--phpew-fs-xs);
    font-weight: 600;
    background: var(--phpew-surface);
    border: 1px solid var(--phpew-border);
    color: var(--phpew-muted);
    white-space: nowrap;
}

.phpew-forum-level-icon {
    line-height: 1;
}


.phpew-forum-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.phpew-forum-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: var(--phpew-fs-xs);
    font-weight: 600;
    background: var(--phpew-surface);
    border: 1px solid var(--phpew-accent);
    color: var(--phpew-fg);
    white-space: nowrap;
}


.phpew-forum-badge-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--phpew-gap-sm);
}

.phpew-forum-badge-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.phpew-forum-badge-name {
    font-size: var(--phpew-fs-sm);
    font-weight: 500;
    color: var(--phpew-fg);
}

.phpew-forum-badge-count {
    font-size: var(--phpew-fs-xs);
    color: var(--phpew-muted);
}


.phpew-forum-subcategories {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--phpew-border);
}

.phpew-forum-subcategory + .phpew-forum-subcategory {
    border-top: 1px solid var(--phpew-border);
}

.phpew-forum-subcategory > a {
    display: flex;
    align-items: baseline;
    gap: var(--phpew-gap-sm);
    padding: 0.4rem var(--phpew-gap) 0.4rem calc(var(--phpew-gap) * 2);
    text-decoration: none;
    color: inherit;
    font-size: var(--phpew-fs-sm);
}

.phpew-forum-subcategory > a:hover {
    background: var(--phpew-surface);
}

.phpew-forum-subcategory-title {
    font-weight: 500;
    color: var(--phpew-link);
}


@media (max-width: 600px) {
    .phpew-forum-post-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .phpew-forum-post-reply {
        margin-left: 0;
    }
    .phpew-forum-post-actions {
        flex-wrap: wrap;
    }
    .phpew-forum-owner-actions {
        margin-left: 0;
    }
    .phpew-forum-stats {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
    .phpew-forum-stats dt {
        margin-top: 0.4rem;
    }
}

.phpew-forum-edit-profile {
    margin-left: auto;
    align-self: center;
}
.phpew-forum-profile-form .phpew-avatar-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 150px;
    padding: 1.25rem;
    border: 2px dashed var(--phpew-border, rgba(128, 128, 128, 0.4));
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.phpew-forum-profile-form .phpew-avatar-drop.is-dragover {
    border-color: var(--phpew-accent, #66ccff);
    background: var(--phpew-accent-soft, rgba(102, 204, 255, 0.08));
}
.phpew-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--phpew-surface-2, rgba(128, 128, 128, 0.12));
}
.phpew-avatar-drop-hint {
    color: var(--phpew-muted, #8a8a8a);
    font-size: 0.9rem;
}
.phpew-avatar-browse {
    text-decoration: underline;
}
.phpew-forum-post-signature {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--phpew-border, rgba(128, 128, 128, 0.25));
    font-size: 0.85em;
    color: var(--phpew-muted, #8a8a8a);
}
.phpew-forum-post-signature p {
    margin: 0.2rem 0;
}
.phpew-forum-bio-body {
    line-height: 1.55;
}
.phpew-account-forum-profile {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}
.phpew-account-forum-profile-fields {
    flex: 1 1 240px;
    margin: 0;
}

.phpew-ds-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--phpew-card-min, 320px), 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.phpew-ds-group {
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  padding: 0.875rem 1rem 1rem;
}
.phpew-ds-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.5rem 0;
}
.phpew-ds-group-title {
  margin: 0;
  font-size: var(--phpew-fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phpew-muted);
}
.phpew-btn-ghost {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--phpew-accent);
  cursor: pointer;
  font-weight: 500;
}
.phpew-btn-ghost:hover { text-decoration: underline; }
.phpew-ds-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.phpew-ds-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--phpew-border);
}
.phpew-ds-row:last-child { border-bottom: none; }
.phpew-ds-toggle {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
  font-weight: 400;
}
.phpew-ds-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}
.phpew-ds-name {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
}
.phpew-ds-label {
  font-weight: 600;
  color: var(--phpew-fg);
  font-size: var(--phpew-fs-sm);
  line-height: 1.2;
}
.phpew-ds-slug {
  font-size: 0.6875rem;
  color: var(--phpew-muted);
  font-family: var(--phpew-font-mono);
  background: none;
  padding: 0;
}
.phpew-ds-count {
  flex: 0 0 auto;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--phpew-accent-fg);
  background: var(--phpew-accent);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: auto;
}
.phpew-ds-count--empty {
  background: var(--phpew-surface);
  color: var(--phpew-muted);
  font-weight: 400;
}
.phpew-ds-tpl {
  flex: 0 0 auto;
  font-size: 0.6875rem;
  color: var(--phpew-muted);
  font-family: var(--phpew-font-mono);
  background: var(--phpew-surface);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.phpew-ds-actions {
  margin: 1rem 0 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--phpew-border);
}


.ppl-intro       { margin-top: 0; }
.ppl-drag-col    { width: 2rem; }
.ppl-empty-cell  { padding: 0.75rem; }
.ppl-actions     { gap: 0.5rem; }
.ppl-drag        { cursor: grab; color: var(--phpew-muted); }
.ppl-drag:active { cursor: grabbing; }


.phpew-inline           { display: inline; }
.phpew-hidden           { display: none; }
.phpew-indent           { margin-left: 1rem; }
.phpew-mt-lg            { margin-top: 2rem; }
.phpew-mb-sm            { margin-bottom: 0.5rem; }
.phpew-text-success     { color: var(--phpew-success, #22c55e); }
.phpew-form--narrow     { max-width: 28rem; }
.phpew-notice--inline   { margin: 0; padding: 0.1rem 0.4rem; }
.phpew-inline-label     { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.phpew-form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--phpew-bg);
  border-top: 1px solid var(--phpew-border);
  padding: 0.75rem 0;
  margin-top: 1.5rem;
}
.phpew-form-actions--tight { gap: 0.75rem; display: flex; }
.phpew-template-desc-field { flex: 1 1 300px; }
.phpew-col-w2           { width: 2rem; }

#ppl-table              { width: 100%; table-layout: fixed; }
#ppl-table th:nth-child(2), #ppl-table td:nth-child(2) { width: 20%; }
#ppl-table th:nth-child(3), #ppl-table td:nth-child(3) { width: 28%; }
#ppl-table th:nth-child(4), #ppl-table td:nth-child(4) { width: 32%; }
#ppl-table input,
#ppl-table select       { width: 100%; box-sizing: border-box; }

.phpew-behaviors-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.375rem;
  align-items: center;
}


.phpew-content-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}

/* A list's Table / Cards switch (the layout_switch field). */
.phpew-section-field--layout_switch {
  display: inline-flex;
  margin: 0 0 0.75rem;
  gap: 0;
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: 6px;
  overflow: hidden;
}
.phpew-section-field--layout_switch .phpew-btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--phpew-border, #ddd);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}
.phpew-section-field--layout_switch .phpew-btn:last-child { border-right: none; }
.phpew-section-field--layout_switch .phpew-btn--active {
  background: var(--phpew-accent, #2563eb);
  color: var(--phpew-accent-fg, #fff);
}

.phpew-content-empty { padding: 2rem; text-align: center; }

.phpew-content-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--phpew-card-min, 240px), 1fr));
  gap: 1.25rem;
}

.phpew-content-card {
  display: flex;
  flex-direction: column;
  background: var(--phpew-card-bg, #fff);
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
  position: relative;
}
.phpew-content-card:hover {
  border-color: var(--phpew-accent, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--phpew-fg, #000) 10%, transparent);
}

.phpew-content-card-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--phpew-surface, #f4f4f5);
  overflow: hidden;
  text-decoration: none;
}
/* The picture is a link into the editor, and fills the frame like the img. */
.phpew-content-card-thumb > a {
  display: block;
  width: 100%;
  height: 100%;
}
.phpew-content-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.phpew-content-card-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--phpew-fg, #111) 25%, var(--phpew-surface, #f4f4f5));
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
}

.phpew-content-card-status {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.phpew-content-card--live .phpew-content-card-status {
  background: color-mix(in srgb, var(--phpew-success, #16a34a) 22%, var(--phpew-card-bg, #fff));
  color: var(--phpew-success, #16a34a);
}
.phpew-content-card--draft .phpew-content-card-status {
  background: color-mix(in srgb, var(--phpew-muted, #6b7280) 22%, var(--phpew-card-bg, #fff));
  color: var(--phpew-muted, #6b7280);
}
.phpew-content-card-featured {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: color-mix(in srgb, var(--phpew-accent, #f59e0b) 22%, var(--phpew-card-bg, #fff));
  color: var(--phpew-accent, #f59e0b);
}
.phpew-content-card:has(.phpew-content-card-featured) {
  border-color: var(--phpew-accent, #f59e0b);
}
/* The bulk tick sits in the top-left corner, so the pill moves over. */
.phpew-content-card:has(> .phpew-content-card-select) .phpew-content-card-featured {
  left: 2.4rem;
}
.phpew-content-filter-featured {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--phpew-fs-sm, 0.875rem);
  white-space: nowrap;
  cursor: pointer;
}
.phpew-admin-editor-row--checkboxes {
  display: flex;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.phpew-admin-editor-row--checkboxes .phpew-admin-checkbox-heading {
  flex-basis: 100%;
  margin: 0 0 0.15rem;
}
.phpew-admin-checkbox-row {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}

.phpew-content-card-body {
  padding: 0.85rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.phpew-content-card-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phpew-accent, #2563eb);
}
.phpew-content-card-title {
  font-size: 1rem;
  line-height: 1.25;
  margin: 0;
  font-weight: 700;
}
a.phpew-content-card-title {
  color: var(--phpew-fg, #111);
  text-decoration: none;
}
a.phpew-content-card-title:hover { color: var(--phpew-accent, #2563eb); }
.phpew-content-card-slug {
  font-size: 0.75rem;
  color: var(--phpew-muted, #6b7280);
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
}
.phpew-content-card-appears {
  font-size: 0.75rem;
  color: var(--phpew-accent, #2563eb);
  text-decoration: none;
  margin-top: 0.15rem;
}
.phpew-content-card-appears:hover { text-decoration: underline; }

/* ══ A card's height is the card's, not its longest word's ═════════════════
   Every text part of a card wrapped freely, so narrowing the column did not
   make a card smaller: it made it TALLER. A three-word template name became
   three lines, a slug became a paragraph of monospace, and the two buttons
   stopped sharing a row and stacked. At the small end of the size slider the
   tiles were several times taller than they were wide.

   Each part is given the number of lines it is worth instead. The card then
   shrinks in both directions at once, which is what "smaller card" means. */
.phpew-content-card-type,
.phpew-content-card-slug,
.phpew-template-card-meta {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phpew-content-card-title,
.phpew-template-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* The badge floats over the thumbnail, so it has no column to be bounded by
   and ran off the edge of a narrow card. */
.phpew-content-card-status,
.phpew-content-card-featured {
  max-width: calc(100% - 1rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phpew-content-card-actions {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.9rem 0.9rem;
  /* Two narrow buttons beside each other, not two wide ones stacked: wrapping
     is what turned the action row into two rows on every card at once. */
  flex-wrap: nowrap;
}

/* Below a certain width a card cannot carry everything it carries at full
   size, and clamping alone still leaves it twice as tall as it is wide. So it
   drops what it can spare: the slug and the type label are both repeated in
   the editor one click away, the title and the two buttons are not.

   Keyed to the CARD's own width rather than the viewport's, so it holds for a
   small card in a wide window and a large card in a narrow region alike. The
   size slider and the region width both go through it without knowing it is
   there. */
.phpew-content-card,
.phpew-template-card {
  container-type: inline-size;
}
@container (max-width: 11rem) {
  /* What a small card DROPS is the chrome: the state pill, and the buttons.
     Both are recoverable -- the thumbnail is still a link into the editor, and
     state is what the list and the filters are for.

     What it KEEPS is the answer to "what is this": the type, and the slug.
     The slug rather than the title, because at this size a title truncates to
     something that identifies nothing while a slug is already short by
     construction. The title comes back at full size, where it fits. */
  .phpew-content-card-status,
  .phpew-content-card-featured,
  .phpew-content-card-actions,
  .phpew-content-card-appears,
  .phpew-content-card-title,
  .phpew-template-card-desc {
    display: none;
  }
  /* The identifier is the whole point of a small card, so it gets two lines
     rather than an ellipsis that would eat half of it. */
  .phpew-content-card-slug {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }
  .phpew-content-card-type {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .phpew-content-card-body {
    padding: 0.45rem 0.5rem 0.5rem;
    gap: 0.2rem;
  }
  .phpew-content-card-thumb-fallback {
    font-size: 1.75rem;
  }
}
.phpew-content-card-actions .phpew-btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}
.phpew-content-card-actions form { flex: 1; display: flex; }
.phpew-content-card-actions form button { width: 100%; }


.phpew-behaviors-history,
.phpewstyle-history {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: 6px;
  background: var(--phpew-surface, #f4f4f5);
}
.phpew-behaviors-history summary,
.phpewstyle-history summary {
  cursor: pointer;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.phpew-behaviors-history-table,
.phpewstyle-history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.phpew-behaviors-history-table th,
.phpewstyle-history-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phpew-muted, #6b7280);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--phpew-border, #ddd);
}
.phpew-behaviors-history-table td,
.phpewstyle-history-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px dashed var(--phpew-border, #ddd);
  vertical-align: top;
}
.phpew-behaviors-history-preview,
.phpewstyle-history-preview {
  font-size: 0.75rem;
  color: var(--phpew-muted, #6b7280);
  display: block;
  max-width: 60ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phpewstyle-history-heading {
  margin: 1rem 0 0.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phpew-muted, #6b7280);
}
.phpewstyle-history-blurb {
  font-size: 0.8rem;
  color: var(--phpew-muted, #6b7280);
  margin: 0.25rem 0 0.75rem;
}
.phpewstyle-history-restore { display: inline; }

.phpew-section-heading {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

.phpew-form-fields-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.phpew-form-field-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: 4px;
}
.phpew-form-field-row-handle {
  cursor: grab;
  padding: 0.25rem 0.25rem 0 0;
  color: var(--phpew-muted-color, #999);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}
.phpew-form-field-row-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}
.phpew-form-field-options-row { display: none; }
.phpew-form-field-row[data-type="select"]      .phpew-form-field-options-row,
.phpew-form-field-row[data-type="multiselect"] .phpew-form-field-options-row,
.phpew-form-field-row[data-type="radio"]       .phpew-form-field-options-row {
  display: block;
}
.phpew-form-field-file-row { display: none; }
.phpew-form-field-row[data-type="file"] .phpew-form-field-file-row { display: block; }
.phpew-form-field-jack-row { display: none; }
.phpew-form-field-row[data-type="jack"] .phpew-form-field-jack-row { display: block; }
.phpew-form-field-jack-send,
.phpew-form-field-jack-receive { display: none; }
.phpew-form-field-jack-row[data-jackdir="send"]    .phpew-form-field-jack-send,
.phpew-form-field-jack-row[data-jackdir="receive"] .phpew-form-field-jack-receive { display: block; }
.phpew-auto-reply-fields[data-hidden] { display: none; }

.phpew-wizard-step3 {
  max-width: 640px;
}
.phpew-wizard-step3-header {
  margin-bottom: 1.5rem;
}
.phpew-wizard-step-label {
  font-size: var(--phpew-fs-sm, 0.875rem);
  color: var(--phpew-muted-color, #888);
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.phpew-wizard-slots {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.phpew-wizard-slot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.phpew-wizard-slot-label {
  font-weight: 600;
  font-size: var(--phpew-fs-sm, 0.875rem);
}
.phpew-wizard-slot-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.phpew-wizard-slot-select {
  flex: 1;
}
.phpew-wizard-step3-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}
.phpew-wizard-skip {
  font-size: var(--phpew-fs-sm, 0.875rem);
}
.phpew-btn--lg {
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
}

.phpew-input-w-xs { width: 8rem; }
.phpew-input-w-sm { width: 20rem; }
.phpew-input-w-md { width: 24rem; }
.phpew-input-w-lg { width: 28rem; }
.phpew-input-w-xl { width: 36rem; max-width: 100%; }
.phpew-flex-row   { display: flex; gap: 0.5rem; align-items: center; }
.phpew-filter-row { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 1rem; }
.phpew-hr-spaced  { margin: 1.5rem 0; }
.phpew-nowrap     { white-space: nowrap; }
.phpew-cell-actions { white-space: nowrap; display: flex; gap: 0.25rem; }
.phpew-btn-sp     { margin-right: 0.25rem; }
.phpew-muted-sm   { color: var(--phpew-muted, #888); font-size: 0.85em; }
.phpew-weight-normal { font-weight: normal; }
.phpew-mt-row     { margin: 0.25rem 0 1rem; }
.phpew-mb-1       { margin-bottom: 1rem; }
.phpew-mb-q       { margin-bottom: 0.25rem; }


/* No space above the first thing under the nav strip: a pane's own toolbar
   runs flush against it, and a pane that wants air asks for it. The side
   padding is the admin gutter, which the strip pads by and the toolbar breaks
   out of -- one number, so the three of them line up. */
.phpew-admin-content {
  --pane-gap: 1.25rem;
  padding: 0 var(--phpew-admin-gutter, 1.75rem) 4rem;
}
.phpew-admin-content > h1:first-child,
.phpew-admin-content > h2:first-child { margin-top: 1.25rem; }

/* ══ A bar is one row ══════════════════════════════════════════════════════
   Every toolbar in the admin was written to sit across a page: the trailing
   cluster pushed to the far edge so the two ends line up with the column's
   margins, and its controls inheriting `.phpew-admin-input`'s `width: 100%`,
   which is right in a stacked form and wrong in a row.

   Together those two make a bar fall apart as it gets wider. One search box
   claims the whole line, everything after it wraps, and the Content toolbar
   stands four rows tall with a canyon down the middle. Docked in a region,
   which is often twice a column's width, it was 193px of chrome above the
   thing you came to look at.

   The bar spreads in exactly three ways in this codebase, so all three are
   undone here rather than a pane at a time: an `auto` margin on the trailing
   cluster, a spacer element, and `space-between` on the bar. The Studio's own
   toolbar already had to undo the width rule for itself, which is the tell
   that it belonged here and not there.

   A bar written after this is covered without being named, as long as it
   spreads the same ways and carries one of these class names. */
.phpew-admin-content :is(
  .phpew-content-toolbar,
  .phpew-content-bulk-bar,
  .phpew-pages-toolbar,
  .phpew-pane-toolbar,
  .phpew-template-filters,
  .phpew-admin-header,
  .phpew-form-actions,
  .phpew-toolbar
) {
  justify-content: flex-start;
}
.phpew-admin-content :is(
  .phpew-content-toolbar,
  .phpew-content-bulk-bar,
  .phpew-pages-toolbar,
  .phpew-pane-toolbar,
  .phpew-template-filters,
  .phpew-admin-header,
  .phpew-form-actions,
  .phpew-toolbar
) > * {
  margin-left: 0;
  margin-right: 0;
}
.phpew-admin-content :is(.phpew-spacer, .phpew-content-bulk-spacer) {
  display: none;
}
/* A control in a bar is as wide as it needs to be. The search keeps a floor so
   it stays usable and a ceiling so it cannot take the row back. */
.phpew-admin-content :is(
  .phpew-content-toolbar,
  .phpew-content-bulk-bar,
  .phpew-pages-toolbar,
  .phpew-pane-toolbar,
  .phpew-template-filters,
  .phpew-admin-header,
  .phpew-form-actions,
  .phpew-toolbar
) :is(input, select, textarea, .phpew-admin-input) {
  width: auto;
}
.phpew-admin-content :is(
  .phpew-content-toolbar,
  .phpew-content-bulk-bar,
  .phpew-pages-toolbar,
  .phpew-pane-toolbar,
  .phpew-template-filters,
  .phpew-admin-header,
  .phpew-form-actions,
  .phpew-toolbar
) :is(input[type="search"], input[type="text"]) {
  flex: 1 1 12rem;
  min-width: 8rem;
  max-width: 22rem;
}
.phpew-admin-content :is(
  .phpew-content-toolbar,
  .phpew-content-bulk-bar,
  .phpew-pages-toolbar,
  .phpew-pane-toolbar,
  .phpew-template-filters,
  .phpew-admin-header,
  .phpew-form-actions,
  .phpew-toolbar
) select {
  max-width: 12rem;
}

/* A pane's name, what you can do, and a `?` holding the explanation. */
.phpew-pane-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem 0 0.75rem;
}
/* It is the first thing in the pane, so there is nothing above it to be
   separated from. */
.phpew-pane-head:first-child { margin-top: 0; }
.phpew-pane-head .phpew-pane-title {
  margin: 0 0.35rem 0 0;
  padding: 0;
  border: 0;
  font-size: 1.15rem;
  font-weight: 600;
}
/* Two classes, because .phpew-btn's own padding is one class too and loads
   from a different sheet: at equal weight it kept its 1.125rem sides and
   squeezed the glyph inside to nothing. */
.phpew-btn.phpew-pane-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  min-width: 1.7rem;
  padding: 0;
  gap: 0;
  line-height: 0;
}
.phpew-btn.phpew-pane-icon svg { display: block; }
.phpew-pane-help {
  margin: -0.35rem 0 0.9rem;
  max-width: 60rem;
  font-size: var(--phpew-fs-sm);
  line-height: 1.55;
}
.phpew-pane-help[hidden] { display: none; }

.phpew-admin-content > h2:first-of-type,
.phpew-admin-content > h1:first-of-type {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--phpew-fg);
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--phpew-border);
}
.phpew-admin-content > h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--phpew-fg);
}
.phpew-admin-content > h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phpew-muted);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}
.phpew-admin-content > h2 + p,
.phpew-admin-content > h1 + p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--phpew-muted);
  font-size: var(--phpew-fs-sm);
  line-height: 1.55;
  max-width: 60rem;
}

.phpew-admin-content > h2 + p code,
.phpew-admin-content > h1 + p code,
.phpew-admin-content p code {
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-size: 0.85em;
}

.phpew-admin-content .phpew-admin-editor-label {
  display: block;
  font-size: var(--phpew-fs-sm);
  font-weight: 600;
  color: var(--phpew-fg);
  margin-top: 1rem;
}
.phpew-admin-content form > p {
  margin: 0.5rem 0 1rem;
}

.phpew-admin-content input[type="text"],
.phpew-admin-content input[type="email"],
.phpew-admin-content input[type="password"],
.phpew-admin-content input[type="url"],
.phpew-admin-content input[type="number"],
.phpew-admin-content input[type="search"],
.phpew-admin-content input[type="date"],
.phpew-admin-content input[type="datetime-local"],
.phpew-admin-content input[type="time"],
.phpew-admin-content select,
.phpew-admin-content textarea {
  font: inherit;
  color: var(--phpew-fg);
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  line-height: 1.4;
  margin-top: 0.35rem;
  transition: border-color 80ms ease, box-shadow 80ms ease;
}
.phpew-admin-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):focus-visible,
.phpew-admin-content select:focus-visible,
.phpew-admin-content textarea:focus-visible {
  outline: none;
  border-color: var(--phpew-accent);
  box-shadow: 0 0 0 3px var(--phpew-focus-ring);
}
.phpew-admin-content textarea {
  min-height: 6rem;
  resize: vertical;
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
  font-size: 0.85em;
}

.phpew-admin-content .phpew-table {
  margin: 0.5rem 0 1.5rem;
}
.phpew-admin-content table:not([class]) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  overflow: hidden;
  font-size: var(--phpew-fs-sm);
  margin: 0.5rem 0 1.5rem;
}
.phpew-admin-content table:not([class]) th,
.phpew-admin-content table:not([class]) td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--phpew-border);
}
.phpew-admin-content table:not([class]) th {
  background: var(--phpew-surface);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phpew-muted);
}
.phpew-admin-content table:not([class]) tbody tr:last-child td { border-bottom: none; }
.phpew-admin-content table:not([class]) tbody tr:hover {
  background: color-mix(in srgb, var(--phpew-fg, currentColor) 7%, transparent);
}

.phpew-card {
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  padding: 1rem 1.125rem;
  margin: 0.5rem 0 1.25rem;
}
.phpew-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -0.25rem 0 0.5rem;
}
.phpew-card-title {
  margin: 0;
  font-size: var(--phpew-fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phpew-muted);
}

.phpew-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--phpew-card-bg);
  border: 1px dashed var(--phpew-border);
  border-radius: var(--phpew-radius);
  color: var(--phpew-muted);
  font-size: var(--phpew-fs-sm);
  margin: 0.5rem 0 1.25rem;
}

.phpew-admin-content .phpew-notice {
  margin: 0.75rem 0;
  padding: 0.625rem 0.875rem;
  border-radius: var(--phpew-radius);
  border-left: 3px solid var(--phpew-border);
  background: var(--phpew-surface);
  font-size: var(--phpew-fs-sm);
}
.phpew-admin-content .phpew-notice--ok    { border-left-color: var(--phpew-success); }
.phpew-admin-content .phpew-notice--warn  { border-left-color: var(--phpew-warning, #d97706); }
.phpew-admin-content .phpew-notice--error { border-left-color: var(--phpew-error); }

.phpew-admin-content .phpew-notice--inline {
  display: inline-block;
  margin: 0;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--phpew-border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.55;
  vertical-align: baseline;
  background: transparent;
}
.phpew-admin-content .phpew-notice--inline.phpew-notice--ok {
  color: var(--phpew-success);
  border-color: color-mix(in srgb, var(--phpew-success) 45%, transparent);
  background: color-mix(in srgb, var(--phpew-success) 14%, transparent);
}
.phpew-admin-content .phpew-notice--inline.phpew-notice--warn {
  color: var(--phpew-warning, #d97706);
  border-color: color-mix(in srgb, var(--phpew-warning, #d97706) 45%, transparent);
  background: color-mix(in srgb, var(--phpew-warning, #d97706) 14%, transparent);
}
.phpew-admin-content .phpew-notice--inline.phpew-notice--error {
  color: var(--phpew-error);
  border-color: color-mix(in srgb, var(--phpew-error) 45%, transparent);
  background: color-mix(in srgb, var(--phpew-error) 14%, transparent);
}

.phpew-btn--ghost {
  background: transparent;
  color: var(--phpew-fg);
  border-color: var(--phpew-border);
}
.phpew-btn--ghost:hover {
  background: var(--phpew-surface);
  border-color: var(--phpew-border);
  color: var(--phpew-fg);
}
.phpew-btn--sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.phpew-admin-table th,
.phpew-admin-table td { padding: 0.55rem 0.85rem; }
.phpew-admin-table td { vertical-align: middle; }
.phpew-admin-table .phpew-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.phpew-admin-table .phpew-table-actions form { display: inline-flex; margin: 0; }
.phpew-admin-table .phpew-table-actions .phpew-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 6px;
}
.phpew-admin-table .phpew-table-actions .phpew-btn--toggle { min-width: 5.75rem; }
.phpew-admin-table .phpew-table-actions .phpew-btn--danger {
  color: var(--phpew-error);
  background: color-mix(in srgb, var(--phpew-error) 12%, transparent);
  border-color: color-mix(in srgb, var(--phpew-error) 40%, transparent);
}
.phpew-admin-table .phpew-table-actions .phpew-btn--danger:hover {
  background: color-mix(in srgb, var(--phpew-error) 22%, transparent);
  border-color: color-mix(in srgb, var(--phpew-error) 60%, transparent);
}

.phpew-admin-content .phpew-form-actions {
  padding: 0.85rem 0;
  border-top: 1px solid var(--phpew-border);
  background: color-mix(in srgb, var(--phpew-bg) 95%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: 0 -8px 16px -12px color-mix(in srgb, var(--phpew-fg) 25%, transparent);
}

.phpew-pane-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0.25rem 0 1rem;
  padding: 0.625rem 0.75rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
}
.phpew-pane-toolbar > .phpew-spacer { flex: 1; }
.phpew-pane-toolbar input,
.phpew-pane-toolbar select { margin-top: 0; }

.phpew-content-bulk-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.75rem;
  background: var(--phpew-card-bg, #fff);
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: 8px;
}
.phpew-content-bulk-bar .phpew-content-bulk-spacer { flex: 1; }
.phpew-content-bulk-bar button[disabled] { opacity: 0.45; cursor: not-allowed; }

.phpew-content-card-select {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 3;
  display: inline-flex;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  cursor: pointer;
}
.phpew-content-card-select input { margin: 0; cursor: pointer; }

/* Snazy admin-pane styles. Bundled into the active theme stylesheet at
   boot via ThemeManager::addExtensionCss() (Snazy\Admin\Css::register). */

/* ── Signup page (apex tenant) ───────────────────────────────────────── */

.snazy-signup {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.snazy-signup-title    { font-size: 2.5rem; margin: 0 0 .5rem; }
.snazy-signup-tagline  { font-size: 1.15rem; color: var(--phpew-muted); margin: 0 0 2.5rem; }

.snazy-signup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.snazy-signup-row    { display: flex; flex-direction: column; gap: .25rem; }
.snazy-signup-row[hidden] { display: none; }
.snazy-signup-row label { font-weight: 600; }
.snazy-signup-row small { color: var(--phpew-muted); }
.snazy-signup-row input {
  padding: .65rem .75rem;
  background: var(--phpew-surface);
  color: var(--phpew-fg);
  border: 1px solid var(--phpew-border);
  border-radius: 4px;
  font-size: 1rem;
}
.snazy-signup-row input:focus { outline: 2px solid var(--phpew-accent); }

.snazy-signup-btn {
  /* inline-flex (not the <a> default of inline) so vertical padding is
     contained in the button box. As a raw inline <a> -- e.g. the upgrade
     pane, which isn't a flex container -- inline padding bleeds upward and
     overlaps the element above it ("Continue to payment" over the Card row). */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.25rem;
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
  border: 0;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.snazy-signup-btn:hover { background: var(--phpew-accent-hover); }

.snazy-signup-flash       { padding: .75rem 1rem; border-radius: 4px; margin: 0 0 1.5rem; }
.snazy-signup-flash--err  { background: color-mix(in srgb, var(--phpew-error) 25%, transparent); color: var(--phpew-error); }
.snazy-signup-flash--ok   { background: color-mix(in srgb, var(--phpew-success) 25%, transparent); color: var(--phpew-success); }

.snazy-signup-plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}
.snazy-signup-plan-card {
  position: relative;
  padding: 1rem 1.125rem;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: normal;
  transition: border-color 120ms ease, background 120ms ease;
}
.snazy-signup-plan-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.snazy-signup-plan-card:hover { border-color: var(--phpew-accent); }
.snazy-signup-plan-card.is-selected {
  border-color: var(--phpew-accent);
  background: color-mix(in srgb, var(--phpew-accent) 12%, transparent);
}
.snazy-signup-plan-card-name  { display: block; font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.snazy-signup-plan-card-price { display: block; font-size: .95rem; opacity: .85; }
.snazy-signup-plan-card-blurb { display: block; font-size: .8rem; opacity: .65; margin-top: .5rem; }

.snazy-signup-billing {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--phpew-border);
  border-radius: 6px;
  overflow: hidden;
}
.snazy-signup-billing label {
  padding: .5rem .85rem;
  cursor: pointer;
  font-weight: 500;
}
.snazy-signup-billing label.is-selected {
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
}
.snazy-signup-billing input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.snazy-signup-save-badge {
  display: inline-block;
  margin-left: .375rem;
  padding: 1px 6px;
  background: var(--phpew-success);
  color: #fff;
  font-size: .7rem;
  border-radius: 999px;
  vertical-align: middle;
}

.snazy-signup-overlay { display: none; }
.snazy-signup-overlay.is-active {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.snazy-signup-overlay-card {
  background: var(--phpew-card-bg);
  padding: 2rem 2.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.snazy-signup-spinner {
  width: 48px; height: 48px;
  margin: 0 auto 1rem;
  border: 4px solid var(--phpew-border);
  border-top-color: var(--phpew-accent);
  border-radius: 50%;
  animation: snazy-signup-spin 0.8s linear infinite;
}
@keyframes snazy-signup-spin { to { transform: rotate(360deg); } }

.snazy-signup-price-strike {
  color: var(--phpew-muted);
  text-decoration: line-through;
  font-weight: 400;
  opacity: 0.7;
  margin-right: 0.125rem;
}

.snazy-signup-billing-inline {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--phpew-border);
}
.snazy-signup-billing-opt {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .65rem;
  border: 1px solid var(--phpew-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  background: var(--phpew-card-bg);
}
.snazy-signup-billing-opt:hover { border-color: var(--phpew-accent); }
.snazy-signup-billing-opt.is-selected {
  border-color: var(--phpew-accent);
  background: color-mix(in srgb, var(--phpew-accent) 15%, transparent);
}
.snazy-signup-billing-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.snazy-signup-pay-opts {
  display: flex;
  gap: .5rem;
  margin-top: .35rem;
}
.snazy-signup-pay-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem .65rem;
  border: 1px solid var(--phpew-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  background: var(--phpew-card-bg);
}
.snazy-signup-pay-opt:hover { border-color: var(--phpew-accent); }
.snazy-signup-pay-opt.is-selected {
  border-color: var(--phpew-accent);
  background: color-mix(in srgb, var(--phpew-accent) 15%, transparent);
}
.snazy-signup-pay-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.snazy-signup-save-badge--inline {
  background: var(--phpew-accent);
}

.snazy-signup-compare {
  border: 1px solid var(--phpew-border);
  border-radius: 6px;
  padding: .75rem 1rem;
  background: var(--phpew-card-bg);
}
.snazy-signup-compare summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
}
.snazy-signup-compare[open] summary { margin-bottom: .75rem; }
.snazy-signup-feature-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.snazy-signup-feature-table th,
.snazy-signup-feature-table td {
  padding: .4rem .6rem;
  text-align: left;
  border-bottom: 1px solid var(--phpew-border);
}
.snazy-signup-feature-table thead th {
  font-weight: 700;
  text-align: center;
}
.snazy-signup-feature-table thead th:first-child { text-align: left; }
.snazy-signup-feature-table tbody td:not(:first-child) {
  text-align: center;
  font-size: .85rem;
}
.snazy-signup-feature-table tbody tr:last-child td { border-bottom: none; }

.snazy-usage-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.snazy-usage-table th,
.snazy-usage-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--phpew-border);
  text-align: left;
  vertical-align: middle;
}
.snazy-usage-table thead th {
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--phpew-muted);
}
.snazy-usage-table tbody td:nth-child(2),
.snazy-usage-table tbody td:nth-child(3),
.snazy-usage-table tbody td:nth-child(4) {
  font-variant-numeric: tabular-nums;
  font-size: .95rem;
}
.snazy-usage-bar-cell { width: 40%; }

/* Capacity pane — compact tables that size to their content instead of
   spanning the full page (the usage table is 100% wide for its 5 columns). */
.snazy-capacity-table {
  width: 100%;
  max-width: 54rem;
  border-collapse: collapse;
  margin: .5rem 0 1rem;
}
.snazy-capacity-table th,
.snazy-capacity-table td {
  padding: .35rem 1.25rem .35rem .5rem;
  border-bottom: 1px solid var(--phpew-border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.snazy-capacity-table thead th {
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--phpew-muted);
}
.snazy-capacity-table th:not(:first-child),
.snazy-capacity-table td:not(:first-child) {
  text-align: right;
  padding-right: .5rem;
  font-variant-numeric: tabular-nums;
}

/* Capacity trend charts — inline SVG, coloured via these classes (no inline
   styles / no script, so CSP-safe). */
.snazy-chart {
  width: 100%;
  max-width: 54rem;
  height: auto;
  display: block;
  margin: .25rem 0 1.25rem;
}
.snazy-chart-grid { stroke: var(--phpew-border); stroke-width: 1; }
.snazy-chart-line { fill: none; stroke-width: 2; }
.snazy-chart-line--req   { stroke: var(--phpew-muted); }
.snazy-chart-line--human { stroke: #2563eb; }
.snazy-chart-line--load  { stroke: #2563eb; }
.snazy-chart-dot--req   { fill: var(--phpew-muted); }
.snazy-chart-dot--human { fill: #2563eb; }
.snazy-chart-dot--load  { fill: #2563eb; }
.snazy-chart-label { fill: var(--phpew-muted); font-size: 11px; }
.snazy-chart-label--end { text-anchor: end; }
.snazy-chart-legend { margin: .25rem 0; font-size: .85rem; color: var(--phpew-muted); }
.snazy-chart-key { margin-right: 1rem; }
.snazy-chart-key::before {
  content: '';
  display: inline-block;
  width: .8rem;
  height: .2rem;
  margin-right: .35rem;
  vertical-align: middle;
  border-radius: 2px;
}
.snazy-chart-key--req::before   { background: var(--phpew-muted); }
.snazy-chart-key--human::before { background: #2563eb; }
.snazy-chart-key--load::before  { background: #2563eb; }

/* Per-customer line palette (cycled by index). */
.snazy-chart-line--c0 { stroke: #2563eb; } .snazy-chart-dot--c0 { fill: #2563eb; } .snazy-chart-key--c0::before { background: #2563eb; }
.snazy-chart-line--c1 { stroke: #e6194b; } .snazy-chart-dot--c1 { fill: #e6194b; } .snazy-chart-key--c1::before { background: #e6194b; }
.snazy-chart-line--c2 { stroke: #3cb44b; } .snazy-chart-dot--c2 { fill: #3cb44b; } .snazy-chart-key--c2::before { background: #3cb44b; }
.snazy-chart-line--c3 { stroke: #f58231; } .snazy-chart-dot--c3 { fill: #f58231; } .snazy-chart-key--c3::before { background: #f58231; }
.snazy-chart-line--c4 { stroke: #911eb4; } .snazy-chart-dot--c4 { fill: #911eb4; } .snazy-chart-key--c4::before { background: #911eb4; }
.snazy-chart-line--c5 { stroke: #00b8d4; } .snazy-chart-dot--c5 { fill: #00b8d4; } .snazy-chart-key--c5::before { background: #00b8d4; }
.snazy-chart-line--c6 { stroke: #f032e6; } .snazy-chart-dot--c6 { fill: #f032e6; } .snazy-chart-key--c6::before { background: #f032e6; }
.snazy-chart-line--c7 { stroke: #9a6324; } .snazy-chart-dot--c7 { fill: #9a6324; } .snazy-chart-key--c7::before { background: #9a6324; }
.snazy-chart-line--c8 { stroke: #469990; } .snazy-chart-dot--c8 { fill: #469990; } .snazy-chart-key--c8::before { background: #469990; }
.snazy-chart-line--c9 { stroke: #808000; } .snazy-chart-dot--c9 { fill: #808000; } .snazy-chart-key--c9::before { background: #808000; }
.snazy-usage-bar {
  height: 8px;
  background: var(--phpew-border);
  border-radius: 999px;
  overflow: hidden;
}
.snazy-usage-bar-fill {
  height: 100%;
  background: var(--phpew-accent);
  transition: width .25s ease;
  width: 0;
}
.snazy-usage-row.is-warning  .snazy-usage-bar-fill { background: #d97706; }
.snazy-usage-row.is-critical .snazy-usage-bar-fill { background: var(--phpew-error); }
.snazy-usage-upsell {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--phpew-accent) 12%, transparent);
  border-radius: 6px;
  border-left: 3px solid var(--phpew-accent);
}

.snazy-signup-auto-slug {
  padding: .75rem 1rem;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: 6px;
  font-size: 1rem;
}
.snazy-signup-auto-slug code {
  background: none;
  padding: 0;
  color: var(--phpew-fg);
}
.snazy-signup-auto-slug code #snazy-sample-slug {
  color: var(--phpew-muted);
  font-style: italic;
}

/* Upgrade gate block (rendered inside a pane when Free hits a Pro feature). */
.snazy-upgrade-block {
  margin: 2rem auto;
  max-width: 32rem;
  padding: 2rem 2.5rem;
  text-align: center;
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: 8px;
}
.snazy-upgrade-block-icon  { font-size: 2.5rem; margin-bottom: .5rem; }
.snazy-upgrade-block-title { margin: 0 0 .5rem; }
.snazy-upgrade-block-body  { color: var(--phpew-muted); margin: 0 0 1.5rem; }

/* Upgrade page (full ?page=upgrade view). */
.snazy-upgrade-page {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.snazy-upgrade-lead {
  font-size: 1.1rem;
  color: var(--phpew-muted);
  margin: 0 0 2rem;
}
.snazy-upgrade-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin: 0 0 2rem;
}
.snazy-upgrade-feature-table tbody tr.is-highlighted {
  background: color-mix(in srgb, var(--phpew-accent) 12%, transparent);
}
.snazy-upgrade-feature-table tbody tr.is-highlighted td strong {
  color: var(--phpew-accent);
}
.snazy-upgrade-cta {
  margin: 2rem 0 0;
  text-align: center;
}

/* ── Account-first signup additions ─────────────────────────────────────── */
.snazy-signup-check { display: flex; align-items: flex-start; gap: .5rem; font-size: var(--phpew-fs-sm); cursor: pointer; }
.snazy-signup-check input { margin-top: .15rem; }
.snazy-signup-code-input {
    font-size: 1.75rem; letter-spacing: .6rem; text-align: center; font-family: ui-monospace, monospace;
}
.snazy-signup-linkbtn {
    background: none; border: none; padding: 0; color: var(--phpew-accent);
    text-decoration: underline; cursor: pointer; font: inherit;
}
.snazy-signup-plan-card.is-disabled { opacity: .5; cursor: not-allowed; }

/* Your sites: one card per site. Header (name + host + plan pill), an
   optional address-editor row (Pro), then a wrapping actions row — so the
   inline address field never competes with the site name for width. */
.snazy-sites .snazy-sites-list {
    list-style: none; margin: 0 0 1.5rem; padding: 0;
    display: flex; flex-direction: column; gap: .85rem;
}
.snazy-site-card {
    display: flex; flex-direction: column; gap: .85rem;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--phpew-border, rgba(0,0,0,.12));
    border-radius: .75rem;
    background: var(--phpew-card-bg, var(--phpew-surface, #fff));
}
.snazy-site-card--pending { opacity: .75; border-style: dashed; }

.snazy-site-card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.snazy-site-titles { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.snazy-site-name { font-size: 1.15rem; font-weight: 700; line-height: 1.2; color: var(--phpew-fg); }
.snazy-site-host { color: var(--phpew-muted); font-size: var(--phpew-fs-sm, .85rem); word-break: break-all; }

.snazy-site-plan {
    flex: none; align-self: flex-start;
    padding: .2rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    background: var(--phpew-surface, #f4f4f5); color: var(--phpew-muted);
    border: 1px solid var(--phpew-border);
}
.snazy-site-plan--pro {
    background: color-mix(in srgb, var(--phpew-accent) 14%, transparent);
    color: var(--phpew-accent);
    border-color: color-mix(in srgb, var(--phpew-accent) 35%, transparent);
}

.snazy-site-pending { margin: 0; color: var(--phpew-error); font-weight: 600; font-size: var(--phpew-fs-sm); }

.snazy-site-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.snazy-site-actions form { margin: 0; }
.snazy-site-card .snazy-signup-btn { margin: 0; width: auto; padding: .5rem 1.15rem; font-size: .92rem; }
.snazy-site-note { color: var(--phpew-muted); font-size: var(--phpew-fs-sm); align-self: center; }
/* Destructive action (Remove site) — distinct from the accent primary. */
.snazy-signup-btn--danger {
    background: transparent;
    color: var(--phpew-error);
    border: 1px solid color-mix(in srgb, var(--phpew-error) 50%, var(--phpew-border));
    font-weight: 500;
}
.snazy-signup-btn--danger:hover {
    background: var(--phpew-error);
    color: #fff;
    border-color: var(--phpew-error);
}
/* Secondary (ghost) button -- used for "Re-roll address" beside the primary Open. */
.snazy-signup-btn--ghost {
    background: transparent;
    color: var(--phpew-accent);
    border: 1px solid var(--phpew-border-strong, var(--phpew-border));
    font-weight: 500;
}
.snazy-signup-btn--ghost:hover {
    background: color-mix(in srgb, var(--phpew-accent) 12%, transparent);
}
/* Pro "change address" row: [ new-address ][.snazy.com] [Change]. Its own
   line under the header, so the field can grow without squeezing anything. */
.snazy-site-address { display: flex; align-items: center; gap: .5rem; margin: 0; flex-wrap: wrap; }
.snazy-slug-field {
    display: inline-flex; align-items: center; flex: 1 1 15rem; min-width: 0;
    border: 1px solid var(--phpew-border-strong, var(--phpew-border));
    border-radius: 6px; overflow: hidden; background: var(--phpew-bg);
}
.snazy-slug-field:focus-within { outline: 2px solid var(--phpew-accent); outline-offset: 1px; }
.snazy-slug-input {
    flex: 1; border: 0; padding: .5rem .6rem; background: transparent; color: inherit;
    font: inherit; min-width: 0; outline: none;
}
.snazy-slug-suffix { padding: .5rem .6rem .5rem 0; color: var(--phpew-muted); white-space: nowrap; }

/* Account → Connected apps: cross-site OAuth grant table */
.snazy-connected-apps .snazy-signup-sub { color: var(--phpew-muted); margin: -.4rem 0 1.4rem; }
.snazy-connected-apps .snazy-muted { color: var(--phpew-muted); }
.snazy-connected-apps .snazy-empty { padding: 1.5rem; border: 1px dashed var(--phpew-border, rgba(0,0,0,.14)); border-radius: var(--phpew-radius, .5rem); }
.snazy-connected-apps .snazy-empty p { margin: 0 0 .5rem; }
.snazy-apps-table { width: 100%; border-collapse: collapse; }
.snazy-apps-table th, .snazy-apps-table td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--phpew-border, rgba(0,0,0,.1)); vertical-align: middle; }
.snazy-apps-table th { font-size: var(--phpew-fs-sm, .82rem); text-transform: uppercase; letter-spacing: .04em; color: var(--phpew-muted); }
.snazy-apps-app strong { font-weight: 650; }
.snazy-apps-revoke { margin: 0; }
.snazy-btn--danger { background: transparent; border: 1px solid rgba(200,40,40,.55); color: #c62828; padding: .4rem .9rem; border-radius: var(--phpew-radius, .375rem); font: inherit; font-weight: 600; cursor: pointer; }
.snazy-btn--danger:hover { background: rgba(200,40,40,.1); }
@media (max-width: 720px) {
    .snazy-apps-table thead { display: none; }
    .snazy-apps-table tr { display: block; border: 1px solid var(--phpew-border, rgba(0,0,0,.12)); border-radius: var(--phpew-radius, .5rem); margin-bottom: .7rem; padding: .5rem .75rem; }
    .snazy-apps-table td { display: flex; justify-content: space-between; gap: 1rem; border: none; padding: .3rem 0; }
}

/* ─────────────────────────────────────────────────────────────────────────
 * Snazy starter sites — CSS
 *
 * Layered into the active theme stylesheet via
 * ThemeManager::addExtensionCss(). Three concerns:
 *
 *   1. Per-layout visual variants  (.phpew-layout-snazy-*)
 *   2. Per-block responsive spec   (.phpew-section--snazy-*)
 *   3. Wizard + edit-pill UI       (.snazy-wizard-*, .snazy-edit-pill, .snazy-banner-*)
 *
 * Viewport tiers (matching Page::VIEWPORT_KEYS):
 *   mobile  < 768
 *   tablet  768–1023
 *   desktop 1024–1279
 *   wide    ≥ 1280
 *
 * No min-height / min-width — per CLAUDE.md rule.
 * ───────────────────────────────────────────────────────────────────────── */


/* ── Layout variants (v2 named-grid) ──────────────────────────────────────
 * JsonLayoutRenderer emits a `.phpew-layout-<slug>` CSS grid plus one
 * `[data-area]` wrapper per named area. The grid tracks come from the
 * layout definition (+ the renderer's minmax(0,1fr) column default), so
 * nothing here touches column sizing — these rules only dress the areas:
 * a centered content column, section rhythm, and the per-layout full-bleed
 * / sidebar treatments. All of it is overridable from the style editor. */

.phpew-layout-snazy-tall-marketing,
.phpew-layout-snazy-tall-marketing-6row,
.phpew-layout-snazy-split-hero,
.phpew-layout-snazy-cinema-gallery,
.phpew-layout-snazy-simple-page,
.phpew-layout-snazy-contact-page,
.phpew-layout-snazy-single,
.phpew-layout-snazy-sidebar-cv {
    --snazy-gutter: 0;
    --snazy-section-gap: 2.5rem;
    --snazy-content-max: 100%;
}

/* Stacked layouts: every area is a centered content column with vertical
 * section rhythm and a side gutter. Sections that need to span full width
 * (heroes, press/CTA bands, galleries) do it themselves via the `full-bleed`
 * behavior, which breaks out from THIS centered column to the viewport via
 * negative-margin math. That math needs a centered, constrained origin — so
 * every area stays constrained+centered here. Forcing an area full-width in
 * the layout is what made the breakout overflow. The layout constrains; the
 * behavior owns the bleed. */
.phpew-layout-snazy-tall-marketing > [data-area],
.phpew-layout-snazy-tall-marketing-6row > [data-area],
.phpew-layout-snazy-split-hero > [data-area],
.phpew-layout-snazy-cinema-gallery > [data-area],
.phpew-layout-snazy-simple-page > [data-area],
.phpew-layout-snazy-contact-page > [data-area],
.phpew-layout-snazy-single > [data-area] {
    box-sizing: border-box;
    width: 100%;
    max-width: calc(var(--snazy-content-max) + 2 * var(--snazy-gutter));
    margin-inline: auto;
    padding: var(--snazy-section-gap) var(--snazy-gutter);
}

/* Hero (first area) abuts the chrome — no top padding. */
.phpew-layout-snazy-tall-marketing > [data-area]:first-child,
.phpew-layout-snazy-tall-marketing-6row > [data-area]:first-child,
.phpew-layout-snazy-split-hero > [data-area]:first-child,
.phpew-layout-snazy-cinema-gallery > [data-area]:first-child,
.phpew-layout-snazy-simple-page > [data-area]:first-child,
.phpew-layout-snazy-contact-page > [data-area]:first-child {
    padding-top: 0;
}

/* ── Split Hero — the hero block splits into a side-by-side text / image
 * grid. The area stays constrained (above); the hero's own `full-bleed`
 * behavior takes it to viewport width, and this only lays out the two
 * halves inside it. */
.phpew-layout-snazy-split-hero > [data-area="hero"] .phpew-section--snazy-hero {
    display: grid;
    grid-template-columns: 5fr 6fr;
    gap: 0;
    align-items: stretch;
    padding: 0;
}
.phpew-layout-snazy-split-hero > [data-area="hero"] .phpew-section--snazy-hero .phpew-section-body,
.phpew-layout-snazy-split-hero > [data-area="hero"] .phpew-section--snazy-hero.phpew-section-body {
    padding: 4rem var(--snazy-gutter);
    align-self: center;
}
.phpew-layout-snazy-split-hero > [data-area="hero"] .phpew-section--snazy-hero img.phpew-section-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Sidebar CV ──────────────────────────────────────────────────────────
 * The grid columns (1:3) come from the layout definition. Center + cap the
 * whole grid, give it section rhythm, and make the sidebar sticky. */
.phpew-layout-snazy-sidebar-cv {
    box-sizing: border-box;
    max-width: calc(var(--snazy-content-max) + 2 * var(--snazy-gutter));
    margin-inline: auto;
    padding: var(--snazy-section-gap) var(--snazy-gutter);
}
.phpew-layout-snazy-sidebar-cv > [data-area="sidebar"] {
    position: sticky;
    top: 2rem;
    align-self: start;
}


/* ── Per-block responsive spec ──────────────────────────────────────────── */

/* Hero — image is rendered by Renderer as a plain <img> tag inside the
 * section body. We absolutely position it behind text + CTAs and overlay
 * a dark gradient for legibility. Generous padding (no min-height) gives
 * the hero its standing height. */
.phpew-section--snazy-hero {
    position: relative;
    overflow: hidden;
    padding: 0;
    color: var(--phpew-accent-fg, #fff);
    /* Solid backdrop behind the (often transparent PNG) hero image so its
     * gaps don't show the page background through. The ACCENT token, not a
     * baked navy -- the picked theme owns the hero's tint. */
    background-color: var(--phpew-accent, #0a1f4d);
}
.phpew-section--snazy-hero .phpew-section-body,
.phpew-section--snazy-hero.phpew-section-body {
    position: relative;
    text-align: center;
    padding: 9rem 1.5rem 7rem;
    z-index: 1;
}
.phpew-section--snazy-hero .phpew-section-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    margin: 0;
}
.phpew-section--snazy-hero .phpew-section-heading {
    color: var(--phpew-accent-fg, #fff);
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 auto 1.25rem;
    max-width: 48rem;
    border: 0;          /* themes add border-top on h1 — kill it inside the hero */
    padding: 0;
    background: transparent;
}
.phpew-section--snazy-hero .phpew-section-subheading {
    color: color-mix(in srgb, var(--phpew-accent-fg, #fff) 88%, transparent);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    max-width: 38rem;
    margin: 0 auto 2.25rem;
}
.phpew-section--snazy-hero .phpew-section-link {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    margin: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s, background 0.15s;
    background: var(--phpew-accent-fg, #fff);
    color: var(--phpew-accent, #0f1c3d);
}
.phpew-section--snazy-hero .phpew-section-link:nth-of-type(2) {
    background: transparent;
    color: var(--phpew-accent-fg, #fff);
    border: 2px solid color-mix(in srgb, var(--phpew-accent-fg, #fff) 65%, transparent);
}
.phpew-section--snazy-hero .phpew-section-link:hover {
    transform: translateY(-1px);
}

@media (max-width: 767px) {
    .phpew-section--snazy-hero .phpew-section-body,
.phpew-section--snazy-hero.phpew-section-body {
        padding: 5rem 1rem 4rem;
    }
    .phpew-section--snazy-hero .phpew-section-link {
        display: block;
        margin: 0.5rem auto;
        max-width: 16rem;
    }
}

/* Services grid / Testimonials grid — fluid tracks, partial rows
 * collapse instead of leaving empty cells. auto-fit means "as many
 * tracks of >=18rem as fit"; if the source returns 2 items, you get
 * 2 tracks (3rd empty track is collapsed away). minmax(min(...))
 * keeps tracks from overflowing on narrow viewports. */
.phpew-section--snazy-services-grid .phpew-section-datasource--cards,
.phpew-section--snazy-testimonials-grid .phpew-section-datasource--cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
    gap: 2rem;
    align-items: stretch;
    justify-content: center;
}
/* The second selector is the generic card fallback: any child block in the
 * grid that is not a `service` (the datasource lists whatever content the
 * author pointed it at) still gets the card surface. It used to name the
 * grid twice, matching only a grid nested in a grid, so those cards
 * rendered bare (#74). */
.phpew-section--snazy-services-grid .phpew-section--service,
.phpew-section--snazy-services-grid .phpew-section-datasource--cards > .phpew-section,
.phpew-section--snazy-testimonials-grid .phpew-section--testimonial {
    margin: 0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: var(--snazy-card-bg, rgba(128, 128, 128, 0.07));
    height: 100%;
    /* Make the card a flex column so the body can fill its full height.
     * Without this, the body shrinks to content and margin-top: auto on
     * the avatar has no spare space to expand into — only cards whose
     * content already fills the grid track would push the avatar down. */
    display: flex;
    flex-direction: column;
}
.phpew-section--snazy-services-grid .phpew-section--service .phpew-section-body,
.phpew-section--snazy-testimonials-grid .phpew-section--testimonial .phpew-section-body,
.phpew-section--snazy-services-grid .phpew-section--service.phpew-section-body,
.phpew-section--snazy-testimonials-grid .phpew-section--testimonial.phpew-section-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

/* Testimonial cards: avatar = small circle anchored to the byline, NOT a
 * full-width image dominating the card. */
.phpew-section--snazy-testimonials-grid .phpew-section--testimonial .phpew-section-field--textarea {
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    order: 1;
}
.phpew-section--snazy-testimonials-grid .phpew-section--testimonial img.phpew-section-image {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    order: 3;
    align-self: flex-start;
    /* Pin the avatar (and everything ordered after it — name, role) to
     * the bottom of the card so cards with shorter and longer quotes
     * line up their bylines. margin-top: auto on the *earliest* element
     * of the bottom group is the trick; later siblings stack under it. */
    margin-top: auto;
}
.phpew-section--snazy-testimonials-grid .phpew-section--testimonial .phpew-section-text:nth-of-type(1) {
    font-weight: 600;
    order: 4;
}
.phpew-section--snazy-testimonials-grid .phpew-section--testimonial .phpew-section-text:nth-of-type(2) {
    opacity: 0.7;
    font-size: 0.9rem;
    order: 5;
}
/* services/testimonials use auto-fit minmax above — responsive without
 * media queries. Only the gap shrinks at narrow widths. */
@media (max-width: 767px) {
    .phpew-section--snazy-services-grid .phpew-section-datasource--cards,
    .phpew-section--snazy-testimonials-grid .phpew-section-datasource--cards {
        gap: 1.5rem;
    }
}

/* Pricing table — fluid tracks. Hide an unused 3rd track when only
 * 2 tiers are configured (auto-fit collapses empty tracks). */
.phpew-section--snazy-pricing-table .phpew-section-datasource--cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
    gap: 1.5rem;
    align-items: stretch;
    justify-content: center;
}
.phpew-section--snazy-pricing-table .phpew-section--pricing_tier {
    margin: 0;
    padding: 2rem 1.5rem;
    border-radius: 0.5rem;
    background: var(--snazy-card-bg, rgba(128, 128, 128, 0.07));
    text-align: center;
}
.phpew-section--snazy-pricing-table .phpew-section--pricing_tier .phpew-section-body,
.phpew-section--snazy-pricing-table .phpew-section--pricing_tier.phpew-section-body {
    padding: 0;
}
.phpew-section--snazy-pricing-table .phpew-section--pricing_tier .phpew-section-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}
.phpew-section--snazy-pricing-table .phpew-section--pricing_tier .phpew-section-list-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}
.phpew-section--snazy-pricing-table .phpew-section-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    border-radius: 0.375rem;
    background: #508cf0;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
/* auto-fit already collapses to 1 track at narrow widths via the
 * minmax(min(18rem, 100%), 1fr) recipe — no media query needed. */

/* Menu section + gallery — auto-fit minmax. */
.phpew-section--snazy-menu-section .phpew-section-datasource--cards,
.phpew-section--snazy-menu-section .phpew-section-datasource {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
    gap: 1.5rem;
    justify-content: center;
}
/* Menu item cards: padded surface, image capped, category as small
 * pill, price pinned to bottom-right. The menu_item template renders
 * fields in fixed order — name (text), description (longtext), price
 * (text), image, category (text) — so positional child selectors
 * (nth-child) are the reliable way to address each one. */
.phpew-section--snazy-menu-section .phpew-section--menu_item {
    margin: 0;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background: var(--snazy-card-bg, rgba(128, 128, 128, 0.07));
    display: flex;
    flex-direction: column;
    height: 100%;
}
.phpew-section--snazy-menu-section .phpew-section--menu_item .phpew-section-body,
.phpew-section--snazy-menu-section .phpew-section--menu_item.phpew-section-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
/* Field-by-field ordering via nth-child on the body's direct children.
 * Order: image at top → category pill → name → description → price. */
.phpew-section--snazy-menu-section .phpew-section--menu_item .phpew-section-body > :nth-child(4),
.phpew-section--snazy-menu-section .phpew-section--menu_item.phpew-section-body > :nth-child(4) {
    /* image */
    width: 100%;
    height: 8rem;
    object-fit: cover;
    border-radius: 0.375rem;
    margin: 0;
    order: 1;
}
.phpew-section--snazy-menu-section .phpew-section--menu_item .phpew-section-body > :nth-child(5),
.phpew-section--snazy-menu-section .phpew-section--menu_item.phpew-section-body > :nth-child(5) {
    /* category — small uppercase pill */
    align-self: flex-start;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.18);
    opacity: 0.85;
    order: 2;
}
.phpew-section--snazy-menu-section .phpew-section--menu_item .phpew-section-body > :nth-child(1),
.phpew-section--snazy-menu-section .phpew-section--menu_item.phpew-section-body > :nth-child(1) {
    /* name */
    font-weight: 600;
    font-size: 1.1rem;
    order: 3;
}
.phpew-section--snazy-menu-section .phpew-section--menu_item .phpew-section-body > :nth-child(2),
.phpew-section--snazy-menu-section .phpew-section--menu_item.phpew-section-body > :nth-child(2) {
    /* description */
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.4;
    order: 4;
}
.phpew-section--snazy-menu-section .phpew-section--menu_item .phpew-section-body > :nth-child(3),
.phpew-section--snazy-menu-section .phpew-section--menu_item.phpew-section-body > :nth-child(3) {
    /* price — pinned to bottom-right */
    margin-top: auto;
    align-self: flex-end;
    font-weight: 600;
    font-size: 1.05rem;
    order: 5;
}

/* About block — two-column on wide screens (text left, image right),
 * stacks on narrow. Body is the grid container so the image stays a
 * direct child; section wraps everything as a normal block. Avoids
 * display: contents which Chrome's grid placement doesn't always
 * honour reliably across browsers. */
/* About-block: proper two-column card — text column on the left,
 * image on the right. Float-right doesn't work because the image
 * is LAST in the DOM and CSS float only affects siblings that come
 * AFTER it; nothing wraps. Grid approach previously failed because
 * `grid-row: 1 / span 99` + row gap multiplied empty implicit row
 * gaps (98 × 0.6rem ≈ 1000px) into phantom vertical space.
 *
 * Fix: 2-column grid, text auto-flows into col 1, image spans all
 * col-2 rows. Row gap set to 0 so the implicit empty tracks
 * created by span 99 contribute zero space; text spacing comes
 * from per-element margin-bottom instead. */
.phpew-section--snazy-about-block .phpew-section-body,
.phpew-section--snazy-about-block.phpew-section-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(28rem, 45%);
    /* Row gap ZERO — see comment above; gap-on-implicit-rows was
     * the 1232px-tall-section bug. Column gap stays at 2rem. */
    gap: 0 2rem;
    align-content: start;
}
.phpew-section--snazy-about-block .phpew-section-body > :not(img),
.phpew-section--snazy-about-block.phpew-section-body > :not(img) {
    grid-column: 1;
    /* Spacing between text elements via margin instead of grid gap. */
    margin: 0 0 0.6rem;
}
.phpew-section--snazy-about-block .phpew-section-body > img.phpew-section-image,
.phpew-section--snazy-about-block.phpew-section-body > img.phpew-section-image {
    grid-column: 2;
    grid-row: 1 / span 99;
    align-self: stretch;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 0.5rem;
    margin: 0;
}
@media (max-width: 767px) {
    .phpew-section--snazy-about-block .phpew-section-body,
.phpew-section--snazy-about-block.phpew-section-body {
        grid-template-columns: 1fr;
    }
    .phpew-section--snazy-about-block .phpew-section-body > img.phpew-section-image,
.phpew-section--snazy-about-block.phpew-section-body > img.phpew-section-image {
        grid-column: 1;
        grid-row: auto;
        max-height: 16rem;
        margin-top: 1rem;
    }
}
.phpew-section--snazy-gallery .phpew-section-datasource--cards,
.phpew-section--snazy-gallery .phpew-section-datasource {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
    gap: 0.5rem;
}

/* Logo wall — fluid tracks via auto-fit so a partial row centres
 * cleanly. Each card is a tight, fixed-height tile so the wall reads
 * as a row of marks, not a stack of paragraphs. */
.phpew-section--snazy-logo-wall .phpew-section-datasource--cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
    gap: 1.5rem 2rem;
    align-items: center;
    justify-items: center;
    justify-content: center;
}
.phpew-section--snazy-logo-wall .phpew-section--logo_wall_item {
    margin: 0;
    padding: 0;
    width: 100%;
}
.phpew-section--snazy-logo-wall .phpew-section--logo_wall_item .phpew-section-body,
.phpew-section--snazy-logo-wall .phpew-section--logo_wall_item.phpew-section-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.phpew-section--snazy-logo-wall img.phpew-section-image {
    max-height: 2.75rem;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0;
    opacity: 0.85;
}
/* auto-fit minmax above handles responsive — no media queries needed. */

/* Locations list — each card is a 2-column shape (info left, photo
 * right) so a single location doesn't render as a stack of bare
 * text above a billboard-sized photo. Same row pattern as the
 * about-block: zero row gap so an image spanning many rows doesn't
 * multiply gap into phantom space; spacing between info fields
 * comes from per-element margin instead. */
.phpew-section--snazy-locations-list .phpew-section-datasource--cards,
.phpew-section--snazy-locations-list .phpew-section-datasource {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(28rem, 100%), 1fr));
    gap: 1.5rem;
    justify-content: center;
}
.phpew-section--snazy-locations-list .phpew-section--location {
    margin: 0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: var(--snazy-card-bg, rgba(128, 128, 128, 0.07));
}
.phpew-section--snazy-locations-list .phpew-section--location .phpew-section-body,
.phpew-section--snazy-locations-list .phpew-section--location.phpew-section-body {
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(14rem, 40%);
    gap: 0 1.5rem;
    align-content: start;
}
.phpew-section--snazy-locations-list .phpew-section--location .phpew-section-body > :not(img),
.phpew-section--snazy-locations-list .phpew-section--location.phpew-section-body > :not(img) {
    grid-column: 1;
    margin: 0 0 0.4rem;
}
.phpew-section--snazy-locations-list .phpew-section--location .phpew-section-body > .phpew-section-text:first-of-type,
.phpew-section--snazy-locations-list .phpew-section--location.phpew-section-body > .phpew-section-text:first-of-type {
    /* location name — slightly larger, sits at the top */
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}
.phpew-section--snazy-locations-list .phpew-section--location .phpew-section-body > .phpew-section-longtext,
.phpew-section--snazy-locations-list .phpew-section--location.phpew-section-body > .phpew-section-longtext {
    /* address + hours render with <br> — keep them readable. */
    line-height: 1.45;
    font-size: 0.95rem;
}
.phpew-section--snazy-locations-list .phpew-section--location .phpew-section-body > img.phpew-section-image,
.phpew-section--snazy-locations-list .phpew-section--location.phpew-section-body > img.phpew-section-image {
    grid-column: 2;
    grid-row: 1 / span 99;
    align-self: start;
    width: 100%;
    max-height: 12rem;
    object-fit: cover;
    border-radius: 0.375rem;
    margin: 0;
}
@media (max-width: 767px) {
    .phpew-section--snazy-locations-list .phpew-section--location .phpew-section-body,
.phpew-section--snazy-locations-list .phpew-section--location.phpew-section-body {
        grid-template-columns: 1fr;
    }
    .phpew-section--snazy-locations-list .phpew-section--location .phpew-section-body > img.phpew-section-image,
.phpew-section--snazy-locations-list .phpew-section--location.phpew-section-body > img.phpew-section-image {
        grid-column: 1;
        grid-row: auto;
        max-height: 10rem;
        margin-top: 0.75rem;
    }
}

/* Stats strip, team grid, press mentions — auto-fit minmax. Partial
 * rows centre; empty tracks collapse. */
.phpew-section--snazy-stats-strip .phpew-section-datasource--cards,
.phpew-section--snazy-stats-strip .phpew-section-datasource {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
    gap: 2rem;
    text-align: center;
    justify-content: center;
}
.phpew-section--snazy-team-grid .phpew-section-datasource--cards,
.phpew-section--snazy-team-grid .phpew-section-datasource {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
    gap: 2rem;
    justify-content: center;
}
/* FAQ items: question bold + slightly larger so it visually leads
 * the answer paragraph. Without per-card styling both fields rendered
 * as plain text with no hierarchy and ran together. Each item
 * separated by a hairline divider to make the list scannable. */
.phpew-section--snazy-faq-section .phpew-section-datasource--cards,
.phpew-section--snazy-faq-section .phpew-section-datasource {
    display: flex;
    flex-direction: column;
}
.phpew-section--snazy-faq-section .phpew-section--faq_item {
    margin: 0;
    padding: 1.1rem 0;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}
.phpew-section--snazy-faq-section .phpew-section--faq_item:first-child {
    border-top: 0;
}
.phpew-section--snazy-faq-section .phpew-section--faq_item .phpew-section-body,
.phpew-section--snazy-faq-section .phpew-section--faq_item.phpew-section-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.phpew-section--snazy-faq-section .phpew-section--faq_item .phpew-section-text {
    font-weight: 600;
    font-size: 1.05rem;
}
.phpew-section--snazy-faq-section .phpew-section--faq_item .phpew-section-longtext {
    font-size: 0.95rem;
    line-height: 1.55;
    opacity: 0.85;
}

/* Team cards: avatar at top (small + circular), name bold below,
 * role small + muted on its own line, bio underneath. Without per-
 * card styling the name and role smushed onto one line as bare
 * spans with the avatar dropping to the bottom of the card. */
.phpew-section--snazy-team-grid .phpew-section--team_member {
    margin: 0;
    text-align: center;
}
.phpew-section--snazy-team-grid .phpew-section--team_member .phpew-section-body,
.phpew-section--snazy-team-grid .phpew-section--team_member.phpew-section-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.phpew-section--snazy-team-grid .phpew-section--team_member img.phpew-section-image {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 0 0.5rem;
    order: 1;
}
.phpew-section--snazy-team-grid .phpew-section--team_member .phpew-section-text:nth-of-type(1) {
    /* name */
    font-weight: 600;
    font-size: 1.05rem;
    order: 2;
}
.phpew-section--snazy-team-grid .phpew-section--team_member .phpew-section-text:nth-of-type(2) {
    /* role */
    font-size: 0.85rem;
    opacity: 0.75;
    margin-bottom: 0.5rem;
    order: 3;
}
.phpew-section--snazy-team-grid .phpew-section--team_member .phpew-section-longtext {
    /* bio */
    font-size: 0.92rem;
    line-height: 1.45;
    opacity: 0.9;
    order: 4;
}
.phpew-section--snazy-press-mentions .phpew-section-datasource--cards,
.phpew-section--snazy-press-mentions .phpew-section-datasource {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
    gap: 1.5rem;
    justify-content: center;
}
/* Press-mention cards: clear hierarchy — small uppercase publication
 * + muted date at top, bold headline, italic pull quote. Without
 * per-card styling the four fields rendered as bare lines of text
 * with no visual rhythm. Card surface from --snazy-card-bg so
 * it stays visible against any backdrop. */
.phpew-section--snazy-press-mentions .phpew-section--press_mention {
    margin: 0;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background: var(--snazy-card-bg, rgba(128, 128, 128, 0.07));
    display: flex;
    flex-direction: column;
    height: 100%;
}
.phpew-section--snazy-press-mentions .phpew-section--press_mention .phpew-section-body,
.phpew-section--snazy-press-mentions .phpew-section--press_mention.phpew-section-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}
.phpew-section--snazy-press-mentions .phpew-section--press_mention .phpew-section-text:first-of-type {
    /* publication — small uppercase label */
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
}
.phpew-section--snazy-press-mentions .phpew-section--press_mention .phpew-section-field--date {
    font-size: 0.78rem;
    opacity: 0.6;
    margin-bottom: 0.25rem;
}
.phpew-section--snazy-press-mentions .phpew-section--press_mention .phpew-section-text:nth-of-type(2) {
    /* headline — bold body-size lead */
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
}
.phpew-section--snazy-press-mentions .phpew-section--press_mention .phpew-section-longtext {
    /* pull quote — italic + slight indent + accent border */
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.45;
    opacity: 0.85;
    padding-left: 0.75rem;
    border-left: 2px solid color-mix(in srgb, currentColor 25%, transparent);
    margin-top: 0.25rem;
}

/* Split-hero mobile collapse. Same selectors as the desktop rule above
 * (layout class > [data-area] > section); the old row/col targets matched
 * nothing the renderer emits, so phones kept the 5fr/6fr split. 767px is Viewport's mobile bound. */
@media (max-width: 767px) {
    .phpew-layout-snazy-split-hero > [data-area="hero"] .phpew-section--snazy-hero {
        grid-template-columns: 1fr;
    }
    .phpew-layout-snazy-split-hero > [data-area="hero"] .phpew-section--snazy-hero img.phpew-section-image {
        max-height: 16rem;
    }
}

/* Sidebar-CV mobile collapse. The column stack itself comes from the
 * layout definition's `mobile` grid (sidebar over main); this only releases
 * the sticky sidebar so it scrolls with the page instead of pinning the
 * top of a phone screen. */
@media (max-width: 767px) {
    .phpew-layout-snazy-sidebar-cv > [data-area="sidebar"] {
        position: static;
    }
}

/* CTA block */
.phpew-section--snazy-call-to-action {
    text-align: center;
    padding: 4rem var(--snazy-gutter);
    border-radius: 0.5rem;
    /* --snazy-cta-bg from the template's `background` field (css_var).
     * Applied via color-mix so the picker controls the *hue* — the
     * tint is mixed onto the surrounding card surface at fixed alpha
     * so chosen colours never produce an unreadable fully-opaque block.
     * Unset → no tint (inherits parent surface). */
    background: color-mix(in srgb, var(--snazy-cta-bg, transparent) 18%, transparent);
}
.phpew-section--snazy-call-to-action .phpew-section-heading {
    font-size: clamp(1.75rem, 4vw, 3rem);
    margin: 0 0 0.75rem;
}
.phpew-section--snazy-call-to-action .phpew-section-link {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    margin: 1rem 0.5rem 0;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 600;
    /* Solid accent button. Without the bg+fg pair the link inherited
     * the theme's body text colour (just black/dark text in light
     * themes), reading as plain text rather than a button. */
    background: var(--phpew-accent, #4f46e5);
    color: var(--phpew-accent-fg, #ffffff);
}
.phpew-section--snazy-call-to-action .phpew-section-link:hover {
    background: var(--phpew-accent-hover, var(--phpew-accent, #4338ca));
}


/* Edit-pill UI moved into phpew-core (phpew_light.css). Class name is now
 * .phpew-edit-pill — same behaviour, ships with every phpew site. */


/* ── Skip-for-now banner ────────────────────────────────────────────────── */
.snazy-starter-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin: 0 0 1rem 0;
    border-radius: 0.375rem;
    background: rgba(80, 140, 240, 0.12);
    border-left: 3px solid #508cf0;
}
.snazy-starter-banner-text {
    flex: 1;
}
.snazy-starter-banner-cta {
    text-decoration: none;
    font-weight: 600;
    color: inherit;
}
.snazy-starter-banner-dismiss {
    background: transparent;
    border: 0;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}
.snazy-starter-banner-dismiss:hover {
    opacity: 1;
}


/* ── Wizard UI ──────────────────────────────────────────────────────────── */
.snazy-wizard-wrap {
    max-width: 56rem;
    margin: 3rem auto;
    padding: 0 1rem;
}
.snazy-wizard-step {
    display: none;
}
.snazy-wizard-step.is-active {
    display: block;
}
.snazy-wizard-heading {
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}
.snazy-wizard-hint {
    opacity: 0.75;
    margin: 0 0 2rem;
}

/* Step 1 — starter cards */
.snazy-wizard-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.snazy-wizard-card {
    display: block;
    text-align: left;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: rgba(128, 128, 128, 0.08);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.15s, transform 0.15s;
}
.snazy-wizard-card:hover {
    border-color: rgba(80, 140, 240, 0.5);
    transform: translateY(-2px);
}
.snazy-wizard-card.is-selected {
    border-color: #508cf0;
}
.snazy-wizard-card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: rgba(128, 128, 128, 0.2);
}
.snazy-wizard-card-body {
    padding: 0.75rem 1rem 1rem;
}
.snazy-wizard-card-title {
    font-weight: 600;
    margin: 0 0 0.25rem;
}
.snazy-wizard-card-tagline {
    font-size: 0.85rem;
    opacity: 0.75;
    margin: 0;
}

.snazy-wizard-exits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
    text-align: center;
}
.snazy-wizard-exit-link {
    text-decoration: none;
    opacity: 0.7;
    font-size: 0.9rem;
}
.snazy-wizard-exit-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Step 2 — theme swatches */
.snazy-wizard-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.snazy-wizard-theme-card {
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: rgba(128, 128, 128, 0.08);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    /* Force colour inheritance — the card is a <button> and Chromium
     * doesn't propagate body's `color` into form elements; without
     * this the label below the swatch falls back to the UA's
     * `buttontext` system colour (white in dark UA, illegible on
     * light themes like Slate/Mint/Citrus). */
    color: inherit;
    font: inherit;
}
/* Same reasoning for the pack-picker buttons on step 1 — they're
 * <button> elements too, so the title/tagline inside need explicit
 * inheritance. */
.snazy-wizard-card {
    color: inherit;
    font: inherit;
}
.snazy-wizard-theme-card.is-selected {
    border-color: #508cf0;
}
.snazy-wizard-theme-preview {
    padding: 0.85rem 0.9rem 0.7rem;
    border-bottom: 1px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 9rem;
    /* bg / colour / border-color all set inline from theme tokens */
}
.snazy-wizard-theme-preview-heading {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
}
.snazy-wizard-theme-preview-text {
    font-size: 0.78rem;
    line-height: 1.35;
    /* colour set inline (muted token) */
}
.snazy-wizard-theme-preview-btn-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}
.snazy-wizard-theme-preview-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
}
.snazy-wizard-theme-preview-link {
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.snazy-wizard-theme-preview-chips {
    display: flex;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.5rem;
}
.snazy-wizard-theme-preview-chip {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.snazy-wizard-theme-label {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    text-align: center;
}
.snazy-wizard-theme-more {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Step 3 — site name */
.snazy-wizard-name-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1.1rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(128, 128, 128, 0.4);
    background: rgba(128, 128, 128, 0.05);
    color: inherit;
    margin-bottom: 0.5rem;
}
.snazy-wizard-name-input:focus {
    outline: 2px solid #508cf0;
    outline-offset: 2px;
}

/* Wizard nav */
.snazy-wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}
.snazy-wizard-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background: rgba(128, 128, 128, 0.15);
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}
.snazy-wizard-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.snazy-wizard-btn--primary {
    background: #508cf0;
    color: #fff;
}
.snazy-wizard-btn--primary:hover:not(:disabled) {
    background: #3a78dc;
}

/* Re-apply destructive confirm */
.snazy-wizard-confirm-input {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: monospace;
    border: 1px solid rgba(220, 80, 80, 0.5);
    border-radius: 0.25rem;
    background: rgba(220, 80, 80, 0.05);
    color: inherit;
}
.snazy-wizard-confirm-warning {
    color: #c33;
    margin: 1rem 0 0.5rem;
}

/* ── Portfolio + featured project ─────────────────────────────────────────
 * These card treatments shipped as behaviors (auto-fit-card-track,
 * image-card-with-thumbs, featured-project, showcase-with-thumb-column)
 * and went with the behavior layer, leaving both templates rendering
 * bare (#69). They are section CSS now, on the column wrappers the
 * templates emit (Builder wraps each `columns` entry in a div of that
 * class) and the data attributes they promote (card-thumb-count,
 * card-layout). Empty image slots are not rendered at all, so the thumb
 * grid only ever holds what the author filled in. */

/* Featured project: head / feature + thumbs / foot. */
.phpew-section--snazy-featured-project .phpew-section-body,
.phpew-section--snazy-featured-project.phpew-section-body {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas:
        "head    head"
        "feature thumbs"
        "foot    foot";
    gap: 1.25rem 1.5rem;
    align-items: start;
}
.phpew-section--snazy-featured-project .snazy-featured-project-head    { grid-area: head; }
.phpew-section--snazy-featured-project .snazy-featured-project-feature { grid-area: feature; }
.phpew-section--snazy-featured-project .snazy-featured-project-thumbs  { grid-area: thumbs; }
.phpew-section--snazy-featured-project .snazy-featured-project-foot    { grid-area: foot; }

.phpew-section--snazy-featured-project .snazy-featured-project-head .phpew-section-heading {
    margin: 0 0 0.5rem;
}
.phpew-section--snazy-featured-project .snazy-featured-project-feature img.phpew-section-image,
.phpew-section--snazy-featured-project .snazy-featured-project-thumbs img.phpew-section-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.5rem;
    margin: 0;
}
.phpew-section--snazy-featured-project .snazy-featured-project-feature img.phpew-section-image {
    aspect-ratio: 3 / 2;
}
.phpew-section--snazy-featured-project .snazy-featured-project-thumbs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
/* Fewer thumbnails, bigger thumbnails: 1-2 stack in one column, 5-6 go three-up. */
.phpew-section--snazy-featured-project[data-card-thumb-count="1"] .snazy-featured-project-thumbs,
.phpew-section--snazy-featured-project[data-card-thumb-count="2"] .snazy-featured-project-thumbs {
    grid-template-columns: minmax(0, 1fr);
}
.phpew-section--snazy-featured-project[data-card-thumb-count="5"] .snazy-featured-project-thumbs,
.phpew-section--snazy-featured-project[data-card-thumb-count="6"] .snazy-featured-project-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.phpew-section--snazy-featured-project .snazy-featured-project-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: baseline;
    justify-content: space-between;
}
.phpew-section--snazy-featured-project .snazy-featured-project-foot .phpew-section-text {
    /* tags */
    font-size: 0.9rem;
    opacity: 0.75;
    margin: 0;
}
.phpew-section--snazy-featured-project .snazy-featured-project-foot .phpew-section-link {
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid currentColor;
}

/* Portfolio grid: image-only cards, auto-fit like the other grids. */
.phpew-section--snazy-portfolio-grid .phpew-section-datasource--cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
    gap: 1.5rem;
    align-items: start;
}
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item {
    margin: 0;
    padding: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--snazy-card-bg, rgba(128, 128, 128, 0.07));
}
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item .phpew-section-body,
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item.phpew-section-body {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 0.5rem;
    padding: 0.5rem;
}
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item[data-card-layout="feature-right"] .snazy-portfolio-card-feature {
    order: 2;
}
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item[data-card-layout="feature-small"] .phpew-section-body,
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item[data-card-layout="feature-small"].phpew-section-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item img.phpew-section-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.25rem;
    margin: 0;
}
.phpew-section--snazy-portfolio-grid .snazy-portfolio-card-thumbs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-content: start;
}
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item[data-card-thumb-count="1"] .snazy-portfolio-card-thumbs,
.phpew-section--snazy-portfolio-grid .phpew-section--portfolio_item[data-card-thumb-count="2"] .snazy-portfolio-card-thumbs {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 767px) {
    .phpew-section--snazy-featured-project .phpew-section-body,
    .phpew-section--snazy-featured-project.phpew-section-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "head" "feature" "thumbs" "foot";
    }
    .phpew-section--snazy-featured-project .snazy-featured-project-thumbs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ── Upgrade page (?page=upgrade — the Free vs Pro upsell) ────────────────
 * Rendered by Snazy\PlanComparisonDatasource::renderUpgradeBody into the
 * snazy-single layout's one area. Header + two plan cards + the computed
 * feature matrix (Pro column emphasised). Tokens only, so it themes. */
.snazy-upgrade {
    max-width: 62rem;
    margin-inline: auto;
}
.snazy-upgrade-note {
    background: var(--phpew-success-bg, #ecfdf5);
    border: 1px solid var(--phpew-success, #10b981);
    color: var(--phpew-fg, #111);
    border-radius: var(--phpew-radius, 8px);
    padding: 0.75rem 1rem;
    margin-bottom: 1.75rem;
    font-size: var(--phpew-fs-sm, 0.9rem);
}
.snazy-upgrade-head { margin-bottom: 2rem; }
.snazy-upgrade-title {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}
.snazy-upgrade-lead {
    font-size: var(--phpew-fs-lg, 1.15rem);
    color: var(--phpew-muted, #6b7280);
    max-width: 42rem;
    margin: 0;
}

/* Plan cards */
.snazy-upgrade-plans {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.75rem;
    align-items: stretch;
}
.snazy-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--phpew-border, #e5e7eb);
    border-radius: var(--phpew-radius-lg, 14px);
    background: var(--phpew-card-bg, #fff);
    padding: 1.6rem;
}
.snazy-plan--pro {
    border-color: var(--phpew-accent, #4f46e5);
    box-shadow: 0 0 0 1px var(--phpew-accent, #4f46e5),
                0 16px 34px -16px color-mix(in srgb, var(--phpew-accent, #4f46e5) 55%, transparent);
}
.snazy-plan-flag {
    position: absolute;
    top: -0.72rem;
    right: 1.25rem;
    background: var(--phpew-accent, #4f46e5);
    color: var(--phpew-accent-fg, #fff);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
}
.snazy-plan-name {
    font-size: var(--phpew-fs-sm, 0.85rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--phpew-muted, #6b7280);
}
.snazy-plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-top: 0.4rem;
}
.snazy-plan-per {
    font-size: var(--phpew-fs-sm, 0.85rem);
    font-weight: 500;
    color: var(--phpew-muted, #6b7280);
}
.snazy-plan-pitch {
    margin: 0.8rem 0 0;
    color: var(--phpew-muted, #6b7280);
    font-size: var(--phpew-fs-sm, 0.9rem);
}
.snazy-plan-quotas {
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}
.snazy-plan-quotas li {
    position: relative;
    padding-left: 1.5rem;
    font-size: var(--phpew-fs-sm, 0.9rem);
}
.snazy-plan-quotas li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--phpew-success, #10b981);
    font-weight: 700;
}
.snazy-plan-cta {
    margin-top: auto;
    justify-content: center;
    padding: 0.72rem 1rem;
    font-size: 1rem;
}
.snazy-plan-cta:not(:first-of-type),
.snazy-plan-quotas + .snazy-plan-cta { margin-top: 1.4rem; }

/* Feature matrix */
.snazy-upgrade-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--phpew-fs-base, 1rem);
}
.snazy-upgrade-matrix thead th {
    text-align: left;
    font-size: var(--phpew-fs-sm, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--phpew-muted, #6b7280);
    padding: 0 1rem 0.7rem;
    border-bottom: 2px solid var(--phpew-border-strong, #d1d5db);
}
.snazy-upgrade-matrix thead th:not(:first-child) { text-align: center; width: 6.5rem; }
.snazy-upgrade-matrix thead th.is-pro { color: var(--phpew-accent, #4f46e5); }
.snazy-upgrade-matrix td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--phpew-border, #eee);
    vertical-align: middle;
}
.snazy-upgrade-matrix tbody tr:hover { background: var(--phpew-subtle, rgba(0,0,0,0.02)); }
.snazy-mx-feature { vertical-align: top; }
.snazy-mx-feature strong { display: block; font-size: 1rem; }
.snazy-mx-desc {
    display: block;
    margin-top: 0.15rem;
    color: var(--phpew-muted, #6b7280);
    font-size: var(--phpew-fs-sm, 0.85rem);
}
.snazy-mx-cell { text-align: center; font-size: 1.15rem; }
.snazy-mx-cell.is-pro {
    background: color-mix(in srgb, var(--phpew-accent, #4f46e5) 7%, transparent);
}
.snazy-upgrade-matrix tbody tr:last-child .snazy-mx-cell.is-pro {
    border-bottom-left-radius: var(--phpew-radius, 6px);
    border-bottom-right-radius: var(--phpew-radius, 6px);
}
.snazy-mx-yes { color: var(--phpew-success, #10b981); font-weight: 700; }
.snazy-mx-no { color: var(--phpew-border-strong, #cbd5e1); }

@media (max-width: 640px) {
    .snazy-upgrade-plans { grid-template-columns: 1fr; }
    .snazy-upgrade-matrix thead th:not(:first-child) { width: 3.5rem; }
    .snazy-mx-desc { display: none; }
}

/* phpew/store — public-page styles.
 * Folded into the theme stylesheet by StoreRoutes::register()
 * via ThemeManager::addExtensionCss(), so it inherits theme tokens
 * and can be overridden by site-level Advanced CSS.
 *
 * Class prefix is `pst-` (PHPew STore) to avoid collisions.
 */

/* Storefront — Customer Portal (signed-in subscriber) */
.pst-portal-form {
    margin-top: .5rem;
}

/* Platform billing page (apex tenant subscription management) */
.pst-billing-container {
    max-width: 640px;
    margin: 3rem auto;
}
.pst-billing-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Admin panes ──────────────────────────────────────────────────────────
 * Width modifiers + small utilities used across StoreConfigPane,
 * ProductsPane, ConnectPane, OrdersPane, SubscriptionsPane,
 * PlatformBillingPane. Atomic so panes can compose widths inline
 * without each one defining its own bespoke class.
 */
.pst-w-6    { width: 6rem; }
.pst-w-8    { width: 8rem; }
.pst-w-16   { width: 16rem; }
.pst-w-24   { width: 24rem; }
.pst-w-28   { width: 28rem; }
.pst-w-36   { width: 36rem; }
.pst-w-full { width: 100%; }

.pst-textarea-sm { width: 100%; height: 4rem; }

.pst-hr          { margin: 1.5rem 0; }
.pst-mt-3        { margin-top: .75rem; }
.pst-list-indent { margin: .25rem 0 .75rem 1.5rem; }

.pst-form-inline { display: inline; }
.pst-self-end    { align-self: flex-end; }
.pst-actions-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
/* Inline status pill — self-contained, NOT layered on .phpew-notice (which is a
   block banner and renders as a floating button inside a table cell). */
.pst-pill {
  display: inline-block;
  margin: 0;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .8125rem;
  line-height: 1.4;
  font-weight: 500;
  border: 1px solid transparent;
}
.pst-pill--ok    { background: rgba(34, 160, 90, .15);  color: #1c7c46; border-color: rgba(34, 160, 90, .35); }
.pst-pill--warn  { background: rgba(200, 140, 0, .15);  color: #9a6a00; border-color: rgba(200, 140, 0, .35); }
.pst-pill--error { background: rgba(200, 60, 60, .15);  color: #a23030; border-color: rgba(200, 60, 60, .35); }

/* ── Add-Product wizard ─────────────────────────────────────────────── */

.pst-wizard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1rem 0 2rem;
  max-width: 48rem;
}
.pst-wiz-step {
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  padding: 1rem 1.25rem 1.25rem;
}
.pst-wiz-step[hidden] { display: none; }

.pst-wiz-step-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.875rem 0;
}
.pst-wiz-step-head h3 {
  margin: 0;
  font-size: var(--phpew-fs-lg);
  font-weight: 600;
}
.pst-wiz-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--phpew-accent);
  color: var(--phpew-accent-fg);
  font-weight: 700;
  font-size: var(--phpew-fs-sm);
  flex: 0 0 auto;
}

.pst-wiz-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.625rem;
}
.pst-wiz-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--phpew-fg);
  transition: border-color 120ms ease, background 120ms ease;
}
.pst-wiz-card:hover { border-color: var(--phpew-accent); }
.pst-wiz-card.is-selected {
  border-color: var(--phpew-accent);
  background: color-mix(in srgb, var(--phpew-accent) 12%, transparent);
}
.pst-wiz-card-title { font-weight: 700; font-size: var(--phpew-fs-base); }
.pst-wiz-card-sub   { font-size: var(--phpew-fs-xs); color: var(--phpew-muted); }

.pst-wiz-field      { display: flex; flex-direction: column; gap: 0.3125rem; margin-bottom: 0.875rem; }
.pst-wiz-field:last-child { margin-bottom: 0; }
.pst-wiz-field label { font-weight: 600; font-size: var(--phpew-fs-sm); }
.pst-wiz-input {
  padding: 0.5rem 0.75rem;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  color: var(--phpew-fg);
  font: inherit;
  font-size: var(--phpew-fs-sm);
}
.pst-wiz-textarea { min-height: 4rem; resize: vertical; }

.pst-wiz-img-row { display: flex; gap: 0.5rem; }
.pst-wiz-img-row .pst-wiz-input { flex: 1 1 auto; }
.pst-wiz-img-preview {
  display: block;
  max-height: 120px;
  max-width: 100%;
  margin-top: 0.625rem;
  padding: 0.5rem;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  object-fit: contain;
}

.pst-wiz-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .pst-wiz-price-row { grid-template-columns: 1fr; } }
.pst-wiz-price-input {
  display: inline-flex;
  align-items: stretch;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
}
.pst-wiz-price-input .pst-wiz-input {
  border: none;
  background: transparent;
  min-width: 0;
  width: 100%;
}
.pst-wiz-price-sym, .pst-wiz-price-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.625rem;
  color: var(--phpew-muted);
  font-size: var(--phpew-fs-sm);
  font-weight: 500;
  white-space: nowrap;
}

.pst-wiz-submit {
  display: flex;
  justify-content: flex-start;
}

.pst-wiz-list-title { margin-top: 2rem; font-size: var(--phpew-fs-lg); }

/* ── Payments setup wizard ──────────────────────────────────────────── */

.pst-setup-block {
  background: var(--phpew-card-bg);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  padding: 1rem 1.25rem 1.25rem;
  max-width: 48rem;
}
.pst-setup-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 0.875rem 0;
}
.pst-setup-head h3 { margin: 0; font-size: var(--phpew-fs-lg); font-weight: 600; }

.pst-mode-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--phpew-fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 999px;
}
.pst-mode-badge--test {
  background: color-mix(in srgb, var(--phpew-warning) 18%, transparent);
  color: var(--phpew-warning);
  border: 1px solid color-mix(in srgb, var(--phpew-warning) 45%, transparent);
}
.pst-mode-badge--live {
  background: color-mix(in srgb, var(--phpew-success) 18%, transparent);
  color: var(--phpew-success);
  border: 1px solid color-mix(in srgb, var(--phpew-success) 45%, transparent);
}

.pst-setup-form { display: flex; flex-direction: column; gap: 0.875rem; }
.pst-setup-field { display: flex; flex-direction: column; gap: 0.3125rem; }
.pst-setup-field label { font-weight: 600; font-size: var(--phpew-fs-sm); }
.pst-setup-input {
  padding: 0.5rem 0.75rem;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  color: var(--phpew-fg);
  font: inherit;
  font-size: var(--phpew-fs-sm);
}

.pst-setup-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.375rem 1rem;
  margin: 0 0 1rem 0;
  font-size: var(--phpew-fs-sm);
}
.pst-setup-dl dt { color: var(--phpew-muted); font-weight: 600; }
.pst-setup-dl dd { margin: 0; color: var(--phpew-fg); }
.pst-setup-dl code {
  background: var(--phpew-surface);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--phpew-font-mono);
  font-size: var(--phpew-fs-xs);
}

.pst-setup-edit { display: inline-block; }
.pst-setup-edit summary {
  cursor: pointer;
  list-style: none;
}
.pst-setup-edit summary::-webkit-details-marker { display: none; }

.pst-setup-url {
  display: inline-block;
  margin: 0.25rem 0 0.5rem 0;
  padding: 0.375rem 0.625rem;
  background: var(--phpew-surface);
  border: 1px solid var(--phpew-border);
  border-radius: var(--phpew-radius);
  font-family: var(--phpew-font-mono);
  font-size: var(--phpew-fs-xs);
  user-select: all;
}

/* ── Wizard helpers (no inline style="" allowed under CSP) ──────────── */
.pst-inline-form     { display: inline; }
.pst-stack-tight     { margin-top: 0.75rem; }
.pst-media-picker-msg { grid-column: 1 / -1; }
.pst-setup-edit-form  { margin-top: 0.75rem; }
.pst-setup-webhook    { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--phpew-border); }
.pst-paypal-block     { margin-top: 1.5rem; }
.pst-paypal-block .pst-setup-form { margin-top: 0.75rem; }
.pst-setup-webhook h4 { margin: 0 0 0.5rem 0; }

.phpew-admin-editor {
  margin: 0;
  padding: 0.75rem;
  color: var(--phpew-fg, #111);
  font-family: var(--phpew-font, system-ui, sans-serif);
}

.phpew-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--phpew-border, #ddd);
}
.phpew-admin-header h1 {
  margin: 0;
  font-size: var(--phpew-fs-xl, 1.5rem);
}


.phpew-admin-notice {
  padding: 0.6rem 1rem;
  border-radius: var(--phpew-radius, 4px);
  margin-bottom: 1rem;
  font-size: var(--phpew-fs-sm, 0.9rem);
}
.phpew-admin-notice--ok {
  background: var(--phpew-success-bg, #f0fdf4);
  border: 1px solid var(--phpew-success, #16a34a);
  color: var(--phpew-success, #16a34a);
}
.phpew-admin-notice--error {
  background: var(--phpew-error-bg, #fef2f2);
  border: 1px solid var(--phpew-error, #dc2626);
  color: var(--phpew-error, #dc2626);
}
.phpew-admin-notice--error[hidden] { display: none; }
.phpew-admin-notice--warn {
  background: var(--phpew-error-bg, #fffbeb);
  border: 1px solid var(--phpew-warning, #d97706);
  color: var(--phpew-warning, #92400e);
}


.phpew-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--phpew-fs-sm, 0.9rem);
  color: var(--phpew-fg, #111);
}
.phpew-table th,
.phpew-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--phpew-border, #ddd);
}
.phpew-table th {
  font-weight: 600;
  color: var(--phpew-muted, #6b7280);
  font-size: var(--phpew-fs-xs, 0.8rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* A tint of the text colour, never a fixed grey: links on the row stay readable in any theme. */
.phpew-table tbody tr:hover {
  background: color-mix(in srgb, var(--phpew-fg, currentColor) 7%, transparent);
}
.phpew-admin-actions {
  white-space: nowrap;
}
.phpew-admin-template-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--phpew-radius-sm, 3px);
  background: var(--phpew-subtle, #eef);
  color: var(--phpew-fg, #111);
  font-size: var(--phpew-fs-xs, 0.8rem);
  font-weight: 500;
}
.phpew-admin-badge-deprecated {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--phpew-radius-sm, 3px);
  background: var(--phpew-warning, #f59e0b);
  color: #1f2937;
  font-size: var(--phpew-fs-xs, 0.8rem);
  font-weight: 700;
}


.phpew-admin-toolbar {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--phpew-border, #ddd);
}
/* Four fields, two rows: Name and Type, then Description and Category. Sized
   to what they need rather than to the width available. */
.phpew-admin-toolbar-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  align-items: start;
  flex: 1;
  max-width: 46rem;
}
.phpew-admin-toolbar-meta .phpew-admin-label { margin: 0; }
.phpew-admin-toolbar-meta small { line-height: 1.3; }
@media (max-width: 40rem) {
  .phpew-admin-toolbar-meta { grid-template-columns: minmax(0, 1fr); }
}
.phpew-admin-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.phpew-admin-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: var(--phpew-fs-sm, 0.9rem);
  font-weight: 600;
  color: var(--phpew-fg, #111);
  min-width: 180px;
}
.phpew-admin-label[hidden] { display: none; }
.phpew-admin-label small {
  font-weight: 400;
  color: var(--phpew-muted, #6b7280);
  font-size: var(--phpew-fs-xs, 0.8rem);
}

.phpew-admin-input,
.phpew-admin-fields input[type="text"],
.phpew-admin-fields input[type="url"],
.phpew-admin-fields input[type="number"],
.phpew-admin-fields textarea,
.phpew-admin-fields select {
  padding: 0.5rem 0.75rem;
  font-size: var(--phpew-fs-base, 1rem);
  font-family: inherit;
  background: var(--phpew-card-bg, #fff);
  color: var(--phpew-fg, #111);
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius, 4px);
  box-sizing: border-box;
}
.phpew-admin-input::placeholder,
.phpew-admin-fields input::placeholder,
.phpew-admin-fields textarea::placeholder {
  color: var(--phpew-muted, #9ca3af);
  opacity: 0.7;
}
.phpew-admin-input:focus,
.phpew-admin-fields input:focus,
.phpew-admin-fields textarea:focus,
.phpew-admin-fields select:focus {
  outline: 2px solid var(--phpew-focus-ring, var(--phpew-accent, #6366f1));
  outline-offset: 1px;
  border-color: transparent;
}
.phpew-admin-input--textarea,
.phpew-admin-fields textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--phpew-font, inherit);
}
.phpew-image-field {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.phpew-image-field-input {
  flex: 1;
  min-width: 0;
}
.phpew-image-field-browse {
  flex-shrink: 0;
  white-space: nowrap;
}

.phpew-admin-input--number {
  width: 120px;
}
.phpew-admin-input--sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  max-width: 200px;
}
.phpew-admin-checkbox-text {
  margin-left: 0.4rem;
  font-weight: 400;
}
.phpew-admin-input--color {
  padding: 0.2rem;
  width: 48px;
  height: 34px;
  cursor: pointer;
}
.phpew-admin-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--phpew-accent, #6366f1);
}


.phpew-admin-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-height: 500px;
}
.phpew-admin-split--swapped .phpew-admin-split-pane--fields  { order: 2; }
.phpew-admin-split--swapped .phpew-admin-split-pane--preview { order: 1; }

.phpew-admin-split-pane--preview {
  position: sticky;
  top: 1rem;
  align-self: start;
  height: calc(100vh - 2rem);
}
.phpew-admin-split-pane--fields {
  align-self: start;
}
.phpew-admin-split--preview-folded {
  grid-template-columns: 1fr;
  max-width: 60rem;
}
.phpew-admin-split--preview-folded .phpew-admin-split-pane--preview {
  position: static;
  height: auto;
}
.phpew-admin-split--preview-folded .phpew-admin-preview-frame {
  display: none;
}

.phpew-admin-split-pane {
  display: flex;
  flex-direction: column;
  background: var(--phpew-card-bg, #fff);
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius, 4px);
  overflow: hidden;
}

.phpew-admin-pane-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--phpew-surface, var(--phpew-subtle, #f9fafb));
  border-bottom: 1px solid var(--phpew-border, #ddd);
}
.phpew-admin-pane-title {
  margin: 0;
  font-size: var(--phpew-fs-xs, 0.8rem);
  font-weight: 600;
  color: var(--phpew-muted, #374151);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.phpew-admin-pane-title small {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.phpew-admin-btn-mini {
  font-size: var(--phpew-fs-xs, 0.75rem);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius-sm, 3px);
  background: var(--phpew-card-bg, #fff);
  color: var(--phpew-fg, #111);
  cursor: pointer;
  font-family: inherit;
}
.phpew-admin-btn-mini:hover {
  background: var(--phpew-subtle, rgba(0, 0, 0, 0.04));
}

.phpew-admin-fields {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
  background: var(--phpew-card-bg, #fff);
}
.phpew-admin-fields-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem;
  background: var(--phpew-surface, var(--phpew-subtle, #f9fafb));
  border-top: 1px solid var(--phpew-border, #ddd);
}
.phpew-admin-field-row {
  margin-bottom: 0.85rem;
}
.phpew-admin-field-row .phpew-admin-label {
  width: 100%;
  min-width: 0;
}
.phpew-admin-field-row .phpew-admin-input,
.phpew-admin-field-row input[type="text"],
.phpew-admin-field-row input[type="url"],
.phpew-admin-field-row input[type="number"],
.phpew-admin-field-row textarea,
.phpew-admin-field-row select {
  width: 100%;
}

.phpew-admin-preview-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--phpew-bg, #fff);
}


.phpew-section {
  padding: 1rem;
  color: var(--phpew-fg, #111);
}
.phpew-section-body {
  font-size: var(--phpew-fs-base, 1rem);
}
.phpew-section-error {
  padding: 0.6rem 0.9rem;
  background: var(--phpew-error-bg, #fef2f2);
  border: 1px solid var(--phpew-error, #dc2626);
  border-radius: var(--phpew-radius, 4px);
  color: var(--phpew-error, #dc2626);
  font-size: var(--phpew-fs-sm, 0.85rem);
}


.phpew-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: var(--phpew-radius, 4px);
  border: 1px solid var(--phpew-border, #ddd);
  background: var(--phpew-card-bg, #fff);
  color: var(--phpew-fg, #111);
  font-size: var(--phpew-fs-sm, 0.875rem);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.phpew-btn:hover {
  background: var(--phpew-subtle, #f3f4f6);
}
.phpew-btn--primary {
  background: var(--phpew-accent, #6366f1);
  border-color: var(--phpew-accent, #6366f1);
  color: var(--phpew-accent-fg, #fff);
}
.phpew-btn--primary:hover {
  background: var(--phpew-accent-hover, #4f46e5);
  border-color: var(--phpew-accent-hover, #4f46e5);
}
.phpew-btn--danger {
  background: transparent;
  border-color: var(--phpew-error, #dc2626);
  color: var(--phpew-error, #dc2626);
}
.phpew-btn--danger:hover {
  background: var(--phpew-error-bg, #fef2f2);
}
.phpew-muted {
  color: var(--phpew-muted, #6b7280);
  font-size: var(--phpew-fs-xs, 0.82rem);
}


.pt-fields-section {
  margin-top: 1rem;
}

.pt-field-row {
  margin: 0.6rem 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius, 4px);
  background: var(--phpew-card-bg, #fff);
}

.pt-field-head {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--phpew-border, #ddd);
}
.pt-field-toggle {
  align-self: center;
  padding: 0.25rem 0.55rem;
  min-width: auto;
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
}
/* A row's delete is a small mark in the corner, not a button competing with
   the field's own controls for attention. */
.pt-field-remove {
  margin-left: auto;
  align-self: center;
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: var(--phpew-radius, 4px);
  border: 1px solid var(--phpew-border, #e4e4e7);
  background: transparent;
  color: var(--phpew-muted, #71717a);
  cursor: pointer;
}
.pt-field-remove {
  background: color-mix(in srgb, var(--pt-group-hue, transparent) 14%, transparent);
  border-color: color-mix(in srgb, var(--pt-group-hue, var(--phpew-border, #e4e4e7)) 30%, transparent);
}
.pt-field-remove:hover,
.pt-field-remove:focus-visible {
  background: color-mix(in srgb, var(--phpew-error, #dc2626) 14%, transparent);
  border-color: var(--phpew-error, #dc2626);
  color: var(--phpew-error, #dc2626);
}

.pt-field-row--collapsed .pt-field-head {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.pt-field-head .phpew-admin-label { min-width: 140px; flex: 1; }
.pt-field-head .pt-field-type { min-width: 140px; }

.pt-field-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pt-field-body[hidden] {
  display: none;
}
.pt-field-render-wrap {
  flex-direction: row !important;
  align-items: center;
  font-weight: 400;
}
.pt-field-options {
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
  font-size: var(--phpew-fs-sm, 0.875rem);
}

.pt-field-typed-host {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.25rem 0;
  padding: 0.5rem 0.65rem;
  border: 1px dashed var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius, 4px);
  background: color-mix(in srgb, var(--phpew-fg, #000) 3%, transparent);
}
.pt-field-typed-host[hidden] { display: none; }

/* A game_header's working state: declared by its game type, shown, not edited. */
.pt-field-game-state[hidden] { display: none; }
.pt-field-game-state-list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  font-size: var(--phpew-fs-sm, 0.875rem);
  color: var(--phpew-muted, #666);
}
.pt-field-game-state-list code { color: var(--phpew-fg, #111); }
.pt-field-typed { display: flex; flex-direction: column; gap: 0.4rem; }
.pt-field-typed-summary {
  font-size: var(--phpew-fs-sm, 0.825rem);
  color: var(--phpew-muted, #6b7280);
  line-height: 1.4;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--phpew-border, #ddd);
  margin-bottom: 0.1rem;
}

.pt-subfields-editor {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pt-subfields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.pt-subfields-title {
  font-weight: 600;
  font-size: var(--phpew-fs-sm, 0.875rem);
  color: var(--phpew-fg, inherit);
}
.pt-subfields-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--phpew-border, #ddd);
}

.pt-fieldmap-editor { display: flex; flex-direction: column; gap: 0.4rem; }
.pt-fieldmap-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--phpew-border, #ddd);
}
.pt-fieldmap-row > .phpew-admin-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
  font-weight: 600;
}
.pt-fieldmap-row > .phpew-admin-label > input {
  flex: 1;
  font-family: var(--phpew-font);
  font-weight: 400;
}
.pt-field-checkbox-default {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}

.pt-field-help {
  margin-top: 0.4rem;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid var(--phpew-accent, #2563eb);
  background: color-mix(in srgb, var(--phpew-accent, #2563eb) 6%, transparent);
  font-size: var(--phpew-fs-sm, 0.8125rem);
  line-height: 1.4;
  border-radius: 0 var(--phpew-radius, 4px) var(--phpew-radius, 4px) 0;
}
.pt-field-help-summary { color: var(--phpew-fg, inherit); }
.pt-field-help-keys {
  margin: 0.4rem 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.15rem 0.6rem;
}
.pt-field-help-keys dt {
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
  font-weight: 600;
  color: var(--phpew-accent, #2563eb);
}
.pt-field-help-keys dd {
  margin: 0;
  color: var(--phpew-muted, inherit);
}


.phpew-admin-form-fields-editor {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.phpew-admin-form-fields-row {
  display: flex;
  gap: .6rem;
  align-items: flex-end;
  padding: .5rem;
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius, 4px);
  background: var(--phpew-card-bg, transparent);
}
.phpew-admin-form-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr 1fr;
  gap: .5rem;
  flex: 1;
}
.phpew-admin-form-fields-row-actions {
  display: flex;
  gap: .25rem;
  align-items: center;
}
.phpew-admin-form-fields-required {
  flex-direction: row !important;
  align-items: center;
  font-weight: 400;
}
@media (max-width: 800px) {
  .phpew-admin-form-fields-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .phpew-admin-split { grid-template-columns: 1fr; }
  .phpew-admin-split-pane--preview { position: static; height: auto; }
  .phpew-admin-preview-frame { min-height: 300px; }
}


.phpew-admin-group-editor {
  border: 1px solid var(--phpew-border, #3f3f46);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  background: rgba(255,255,255,0.02);
}
.phpew-admin-group-editor > .phpew-admin-field-row { margin: 0.3rem 0; }

.phpew-admin-list-editor {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.3rem 0;
}
.phpew-admin-list-rows {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.phpew-admin-list-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.phpew-admin-list-row > .phpew-admin-input,
.phpew-admin-list-row > input { flex: 1 1 auto; }
.phpew-btn--mini {
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
}

.phpew-admin-input--json {
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
  font-size: 0.8rem;
}

.phpew-section-group {
  border: 1px solid var(--phpew-border, #3f3f46);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  margin: 0.3rem 0;
}
.phpew-section-group > legend { font-weight: 600; padding: 0 0.3rem; }
.phpew-section-group-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.phpew-section-group-label {
  font-weight: 600;
  color: var(--phpew-muted, #71717a);
  min-width: 6rem;
}
.phpew-section-list { margin: 0.25rem 0; padding-left: 1.25rem; }
.phpew-section-list--empty { color: var(--phpew-muted, #71717a); font-style: italic; }
.phpew-section-json {
  background: rgba(0,0,0,0.3);
  color: var(--phpew-fg, #e4e4e7);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  overflow-x: auto;
}

.phpew-admin-input--section-ref { min-width: 16rem; }
.phpew-section-ref {
  display: inline-flex;
  gap: 0.4rem;
  align-items: baseline;
  font-family: var(--phpew-font-mono, ui-monospace, monospace);
  font-size: 0.85rem;
}
.phpew-section-ref-template {
  color: var(--phpew-muted, #71717a);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.phpew-section-ref-title { color: var(--phpew-fg, #e4e4e7); }
.phpew-section-ref--empty,
.phpew-section-ref--missing { color: var(--phpew-error, #dc2626); font-style: italic; }

.phpew-admin-repeater-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.phpew-admin-repeater-map {
  border: 1px solid var(--phpew-border, #3f3f46);
  border-radius: var(--phpew-radius, .25rem);
  padding: 0.75rem;
  margin-top: 0.25rem;
}
.phpew-admin-repeater-map legend {
  padding: 0 0.4rem;
  font-size: var(--phpew-fs-sm, .85rem);
  color: var(--phpew-muted, #71717a);
}
.phpew-admin-repeater-map-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.4rem 0;
}
.phpew-admin-repeater-map-label {
  flex: 0 0 8rem;
  font-size: var(--phpew-fs-sm, .85rem);
  color: var(--phpew-muted, #71717a);
}


.phpew-admin-pane-title-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.phpew-source-empty {
  padding: 1rem 0.75rem;
}
.phpew-source-entry {
  padding: 0.75rem;
  border-bottom: 1px solid var(--phpew-border, #ddd);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.phpew-source-badge {
  display: inline-block;
  font-size: var(--phpew-fs-xs, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--phpew-accent, #6366f1) 15%, var(--phpew-card-bg, #fff));
  color: var(--phpew-accent, #6366f1);
}
.phpew-source-badge--advanced {
  background: color-mix(in srgb, var(--phpew-warning, #f59e0b) 15%, var(--phpew-card-bg, #fff));
  color: var(--phpew-warning, #b45309);
}
.phpew-source-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.phpew-source-card-thumb {
  width: 3.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: var(--phpew-radius-sm, 3px);
  flex-shrink: 0;
}
.phpew-source-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.phpew-source-card-title {
  font-size: var(--phpew-fs-sm, 0.875rem);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phpew-source-card-meta {
  font-size: var(--phpew-fs-xs, 0.75rem);
}
.phpew-source-remove {
  align-self: flex-start;
  font-size: var(--phpew-fs-xs, 0.75rem);
  background: none;
  border: none;
  color: var(--phpew-danger, #ef4444);
  cursor: pointer;
  padding: 0;
}
.phpew-source-remove:hover { text-decoration: underline; }
.phpew-source-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.phpew-source-vis {
  font-size: var(--phpew-fs-xs, 0.75rem);
  padding: 0.15rem 0.5rem 0.15rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--phpew-border, #cbd5e1);
  background: var(--phpew-surface, #fff) no-repeat 0.5rem center / 0.75rem;
  color: var(--phpew-muted, #64748b);
  cursor: pointer;
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.phpew-source-vis--off {
  color: var(--phpew-muted, #94a3b8);
  border-style: dashed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-10-8-10-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 10 8 10 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}
.phpew-source-entry--hidden {
  opacity: 0.55;
}
.phpew-source-entry--hidden .phpew-source-badge,
.phpew-source-entry--hidden [class$="-title"] {
  text-decoration: line-through;
}

.phpew-source-jack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--phpew-border, #e2e8f0);
}
.phpew-jack-toggle {
  font-size: var(--phpew-fs-xs, 0.75rem);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--phpew-border, #cbd5e1);
  background: var(--phpew-surface, #fff);
  color: var(--phpew-muted, #64748b);
  cursor: pointer;
  line-height: 1.4;
}
.phpew-jack-toggle:hover { border-color: var(--phpew-accent, #6366f1); }
.phpew-jack-toggle--send    { border-color: #1D9E75; color: #1D9E75; background: rgba(29,158,117,.08); }
.phpew-jack-toggle--receive { border-color: #6366f1; color: #6366f1; background: rgba(99,102,241,.08); }
.phpew-jack-toggle--both    { border-color: #ba7517; color: #ba7517; background: rgba(186,117,23,.08); }
.phpew-jack-pill {
  font-size: var(--phpew-fs-xs, 0.72rem);
  font-family: monospace;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(99,102,241,.1);
  color: #6366f1;
}
.phpew-jack-pill--send { background: rgba(29,158,117,.12); color: #1D9E75; }
.phpew-jack-pill--dead { background: rgba(192,57,43,.1); color: #c0392b; }
.phpew-jack-verb {
  font-size: var(--phpew-fs-xs, 0.75rem);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--phpew-border, #cbd5e1);
  background: var(--phpew-surface, #fff);
}
/* A setting is a name above a box. The name is what the placeholder used to
   have to carry, which is why every placeholder had become a sentence. */
.phpew-jack-param-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 12rem;
  flex: 1 1 12rem;
}
.phpew-jack-param-label {
  font-size: var(--phpew-fs-xs, 0.75rem);
  color: var(--phpew-muted, #71717a);
  line-height: 1.2;
}
.phpew-jack-param {
  font-size: var(--phpew-fs-xs, 0.75rem);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--phpew-border, #cbd5e1);
  background: var(--phpew-surface, #fff);
  min-width: 12rem;
  flex: 1 1 12rem;
}
/* Inside a labelled row the input is the row's only child that grows, and the
   row already carries the width. */
.phpew-jack-param-row .phpew-jack-param { min-width: 0; flex: 1 1 auto; }
.phpew-jack-cordnote {
  flex-basis: 100%;
  font-size: var(--phpew-fs-xs, 0.75rem);
  color: var(--phpew-muted, #71717a);
  text-decoration: none;
}
.phpew-jack-cordnote:hover { color: var(--phpew-fg, #18181b); text-decoration: underline; }
.phpew-jack-fieldnote {
  flex-basis: 100%;
  font-size: var(--phpew-fs-xs, 0.75rem);
  color: var(--phpew-muted, #71717a);
  padding: 0.3rem 0.45rem;
  border-left: 2px solid var(--phpew-accent, #6366f1);
  background: var(--phpew-surface, #fafafa);
  border-radius: 0 4px 4px 0;
}
.phpew-jack-fieldnote a { color: var(--phpew-accent, #6366f1); }

.pt-field-signals {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--phpew-border, #e4e4e7);
  border-radius: 6px;
  background: var(--phpew-surface, #fafafa);
}
.pt-field-signals-title {
  font-size: var(--phpew-fs-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--phpew-muted, #71717a);
  margin-bottom: 0.35rem;
}
.pt-field-signals-detail {
  margin: 0.25rem 0 0.5rem 0.85rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--phpew-border, #e4e4e7);
}
.pt-field-signals-check { display: flex; align-items: center; gap: 0.4rem; }

.pt-field-typed-row[hidden] { display: none; }
/* The two blocks with the most area were carrying the most weight: the help
   sat in a filled box and the pills were solid buttons, both reading as
   loudly as the controls. Both go quiet -- no fill, thin border, muted until
   the pointer arrives -- so the row's own values are the only filled things
   in it. */
/* The type's summary is a footnote about the row, not a heading over it: the
   controls come first and it explains them afterwards. The typed form is a
   flex column, so ordering it last beats depending on append order. */
.pt-field-typed-summary {
  order: 99;
  background: none;
  border: 0;
  border-top: 1px dashed var(--phpew-border, #ddd);
  padding: 0.35rem 0 0;
  margin-top: 0.15rem;
  color: var(--phpew-muted, #71717a);
}
/* The pills take their card's hue rather than a neutral outline, a step above
   the 7% the card sits at so they lift off it without becoming a second thing
   to look at. */
.pt-config-attach {
  background: color-mix(in srgb, var(--pt-group-hue, transparent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--pt-group-hue, var(--phpew-border, #e4e4e7)) 30%, transparent);
  color: var(--phpew-muted, #71717a);
  font-weight: 500;
  padding: 0.22rem 0.55rem;
}
.pt-config-attach:hover,
.pt-config-attach:focus-visible {
  background: color-mix(in srgb, var(--pt-group-hue, transparent) 26%, transparent);
  border-color: color-mix(in srgb, var(--pt-group-hue, var(--phpew-fg, #52525b)) 60%, transparent);
  color: var(--phpew-fg, inherit);
}
.pt-config-attach-bar { border-top: 0; padding-top: 0.15rem; }
.pt-field-row { margin-bottom: 0.9rem; }
.pt-field-moves { display: inline-flex; flex-direction: column; gap: 1px; align-self: center; }
.pt-field-move {
  width: 1.35rem;
  height: 0.95rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  line-height: 1;
  border-radius: 3px;
  cursor: pointer;
  /* Same step off the card as the pills take, so every control in a row
     belongs to the same hue rather than to a neutral system laid over it. */
  background: color-mix(in srgb, var(--pt-group-hue, transparent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--pt-group-hue, var(--phpew-border, #e4e4e7)) 30%, transparent);
  color: var(--phpew-muted, #71717a);
}
.pt-field-move:hover,
.pt-field-move:focus-visible {
  background: color-mix(in srgb, var(--pt-group-hue, transparent) 26%, transparent);
  border-color: color-mix(in srgb, var(--pt-group-hue, var(--phpew-fg, #52525b)) 60%, transparent);
  color: var(--phpew-fg, inherit);
}

/* A row is tinted by its type's group, so a long field list shows where one
   kind of field ends and the next begins before anything is read. Mixed into
   the surface rather than set outright, so it lands the same on either theme
   and stays a hint rather than a colour. */
.pt-field-row[data-group] {
  background: color-mix(in srgb, var(--pt-group-hue, transparent) 7%, var(--phpew-surface, transparent));
  border-left: 3px solid color-mix(in srgb, var(--pt-group-hue, transparent) 55%, transparent);
}
.pt-field-row[data-group="text"]        { --pt-group-hue: #64748b; }
.pt-field-row[data-group="form"]        { --pt-group-hue: #8b5cf6; }
.pt-field-row[data-group="input"]       { --pt-group-hue: #6366f1; }
.pt-field-row[data-group="choice"]      { --pt-group-hue: #0ea5e9; }
.pt-field-row[data-group="data"]        { --pt-group-hue: #14b8a6; }
.pt-field-row[data-group="media"]       { --pt-group-hue: #ec4899; }
.pt-field-row[data-group="reference"]   { --pt-group-hue: #f59e0b; }
.pt-field-row[data-group="structure"]   { --pt-group-hue: #a3a3a3; }
.pt-field-row[data-group="interactive"] { --pt-group-hue: #22c55e; }
.pt-field-row[data-group="chrome"]      { --pt-group-hue: #78716c; }
.pt-field-body { gap: 0.55rem; }

/* Hierarchy inside a row: the key IS the field, so it reads first. The
   captions over Key and Type name two obvious controls and recede; the help
   and the pills sit quieter still. */
.pt-field-head .pt-field-key,
.pt-field-head .pt-field-type {
  font-size: var(--phpew-fs-md, 1rem);
  font-weight: 600;
}
.pt-field-head > .phpew-admin-label {
  font-size: var(--phpew-fs-xs, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--phpew-muted, #71717a);
}
.pt-field-typed-summary,
.pt-field-typed-row small {
  font-size: var(--phpew-fs-xs, 0.75rem);
}
.pt-config-attach { font-size: var(--phpew-fs-sm, 0.8rem); }
.pt-field-typed-row > .phpew-admin-label {
  font-size: var(--phpew-fs-sm, 0.8rem);
  font-weight: 600;
}

/* An attached control's remove sits in its corner, clear of the help text. */
.pt-field-typed-row,
.pt-field-signals,
.pt-field-class-wrap { position: relative; }
/* The remove is absolute, so anything holding one has to be its origin --
   otherwise it resolves against some outer ancestor and leaves the block it
   belongs to looking like it cannot be removed. */
.pt-field-signals .pt-config-detach,
.pt-field-class-wrap .pt-config-detach { top: 0.35rem; right: 0.35rem; }
.pt-field-class-wrap { padding-right: 2rem; }
/* Box first, words beside it, on one line -- and the words keep the weight
   the stacked captions have so a checkbox row does not read as lighter than
   the controls around it. */
.pt-config-check {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 0.45rem;
  padding-right: 1.8rem;
}
.pt-config-check input[type="checkbox"] { flex: 0 0 auto; margin: 0; }
.pt-config-check span { font-weight: 600; }
.pt-config-detach { position: absolute; top: 0; right: 0; margin: 0; }
.pt-config-remove { margin-left: 0; align-self: center; }
.pt-config-ref { display: block; }
.pt-config-group {
  margin: 0.2rem 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--phpew-border, #e4e4e7);
  border-radius: 6px;
  background: var(--phpew-surface, #fafafa);
}
.pt-config-group-title {
  font-size: var(--phpew-fs-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--phpew-muted, #71717a);
  margin-bottom: 0.35rem;
}
.pt-config-group-toggle { display: flex; align-items: center; gap: 0.4rem; }
.pt-config-group-body { display: flex; flex-direction: column; gap: 0.4rem; }
.pt-config-group-body[hidden] { display: none; }
.pt-config-list, .pt-config-pairs { display: flex; flex-direction: column; gap: 0.4rem; }
.pt-config-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.pt-config-list-item > .pt-config-group { flex: 1; }
.pt-config-pairs-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.4rem;
  align-items: center;
}
.pt-config-add { align-self: flex-start; margin-top: 0.4rem; }
.pt-config-attach-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--phpew-border, #ddd);
}
.pt-config-attach-bar[hidden] { display: none; }
/* .phpew-btn sets display: inline-flex, which outranks the hidden attribute,
   so every one of these needs saying explicitly or an attached control keeps
   offering to be added. */
.pt-config-attach[hidden],
.pt-config-detach[hidden],
.pt-field-remove[hidden],
.pt-field-move[hidden],
.pt-field-signals[hidden] { display: none; }
.phpew-source-edit {
  align-self: flex-start;
  font-size: var(--phpew-fs-xs, 0.75rem);
  color: var(--phpew-accent, #6366f1);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.phpew-source-edit:hover { text-decoration: underline; }

.phpew-source-advanced-json {
  font-size: 0.7rem;
  background: var(--phpew-subtle, #f9fafb);
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius-sm, 3px);
  padding: 0.4rem 0.6rem;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.phpew-source-missing {
  font-size: var(--phpew-fs-sm, 0.875rem);
}

.phpew-source-picker {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.phpew-source-tabs {
  display: flex;
  border-bottom: 1px solid var(--phpew-border, #ddd);
}
.phpew-source-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: var(--phpew-fs-sm, 0.875rem);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--phpew-muted, #6b7280);
}
.phpew-source-tab--active {
  border-bottom-color: var(--phpew-accent, #6366f1);
  color: var(--phpew-fg, #111);
  font-weight: 600;
}
.phpew-source-panel {
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.phpew-source-panel[hidden] { display: none; }
.phpew-source-search {
  width: 100%;
  box-sizing: border-box;
}
.phpew-source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--phpew-border, #ddd);
  border-radius: var(--phpew-radius-sm, 3px);
}
.phpew-source-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid var(--phpew-border, #ddd);
  transition: background 0.1s;
}
.phpew-source-list-item:last-child { border-bottom: none; }
.phpew-source-list-item--active {
  background: color-mix(in srgb, var(--phpew-accent, #6366f1) 14%, var(--phpew-card-bg, #fff));
}
.phpew-source-list-item:hover {
  background: color-mix(in srgb, var(--phpew-accent, #6366f1) 8%, var(--phpew-card-bg, #fff));
}
.phpew-source-list-thumb {
  width: 3rem;
  height: 2rem;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.phpew-source-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.phpew-source-list-title {
  font-size: var(--phpew-fs-sm, 0.875rem);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phpew-source-list-meta {
  font-size: var(--phpew-fs-xs, 0.75rem);
}
.phpew-source-list-empty {
  padding: 0.75rem;
}
.phpew-source-picker-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--phpew-border, #ddd);
}
.phpew-source-show-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0;
  font-size: var(--phpew-fs-sm, 0.875rem);
  color: var(--phpew-muted, #888);
  cursor: pointer;
}

.phpew-source-renderer { display: block; margin-top: 0.5rem; }
.phpew-source-usebtn   { margin-top: 0.5rem; }

.phpew-source-fieldmap { margin-top: 0.6rem; }
.phpew-source-fieldmap-title { font-size: 0.8rem; font-weight: 600; color: var(--phpew-fg-muted, #94a3b8); margin-bottom: 0.35rem; }
.phpew-source-fieldmap-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.phpew-source-fieldmap-key { flex: 0 0 9rem; font-family: var(--phpew-font-mono, monospace); font-size: 0.8rem; }
.phpew-source-fieldmap-row .phpew-admin-input { flex: 1 1 auto; }

.phpew-source-entry + .phpew-source-entry {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--phpew-border, #e2e8f0);
}
.phpew-source-reorder {
  font-size: var(--phpew-fs-xs, 0.75rem);
  line-height: 1;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--phpew-card-bg, #fff);
  color: var(--phpew-fg, #111);
  border: 1px solid var(--phpew-border, #cbd5e1);
  border-radius: 0.25rem;
  cursor: pointer;
}
.phpew-source-reorder:disabled { opacity: 0.4; cursor: not-allowed; }
.phpew-source-reorder:hover:not(:disabled) { background: var(--phpew-surface, #f1f5f9); }

.phpew-source-listopts { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.12); }
.phpew-source-toggle { display: flex; align-items: center; gap: .4rem; }
.phpew-source-rowactions { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0; }
.phpew-rowaction { display: flex; gap: .4rem; align-items: center; }
.phpew-rowaction .pt-ra-action { flex: 1 1 40%; }
.phpew-rowaction .pt-ra-label, .phpew-rowaction .pt-ra-confirm { flex: 1 1 25%; }


:root {
  --phpew-bg: #f5f1e8;
  --phpew-card-bg: #fbf8f0;
  --phpew-surface: #ede7d6;
  --phpew-fg: #1a1a1a;
  --phpew-muted: #5c5c5c;
  --phpew-border: #d6cfba;
  --phpew-border-strong: #1a1a1a;
  --phpew-accent: #1e40af;
  --phpew-accent-hover: #1e3a8a;
  --phpew-focus-ring: rgba(30, 64, 175, 0.32);
  --phpew-header-bg: rgba(245, 241, 232, 0.9);
  --phpew-font: ui-monospace, "JetBrains Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  --phpew-radius-sm: 2px;
  --phpew-radius: 2px;
  --phpew-radius-lg: 2px;
}

}

/* ═══════════════════════════════════════════════════════════════════════════
 * just femme + dandy
 *
 * Written against the markup PHPew actually emits, which is worth stating
 * because it is not what you would guess:
 *
 *   <div class="phpew-section phpew-section--<block>" data-area="...">
 *     <div class="phpew-section-multi">              <- only when >1 input
 *       <section class="phpew-section--<template> phpew-content--<slug>
 *                       phpew-section-body">
 *         <img data-phpew-field="photo">             <- one node per field
 *         <h2  data-phpew-field="name">
 *
 * Two things follow. First, a single-input block collapses ALL of those
 * classes onto one element (no separate body div), so never write
 * `.phpew-section--x .phpew-section-body` — it matches nothing. Second, the
 * per-field hook is the `data-phpew-field` attribute, not a class.
 *
 * No JS anywhere. Every bit of motion and state is CSS.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Brand ────────────────────────────────────────────────────────────── */
:root {
  /* The palette FOLLOWS the theme's tokens instead of hardcoding a ground. These
   * were fixed near-black values, so the design fought the theme rather than
   * wearing it: switching to a light theme left a dark page painted over cream
   * tokens. Everything derives now, so changing the active theme reskins the
   * whole design with no CSS edit. `--jfd-ink` means "the ground", not "black" --
   * on a light theme it IS the cream. */
  --jfd-ink:      var(--phpew-bg, #0b0a0c);
  /* The portrait mat has to read as a printed object ON the ground, so it is
   * deliberately not the ground colour. card-bg plus a hairline does that on a
   * light theme and stays near-white on a dark one. */
  --jfd-paper:    var(--phpew-card-bg, #f7f2ee);
  /* How the blurred cover art behind the opening spread is treated: a dark theme
   * knocks it back, a light one has to lift it or the band turns to mud. */
  --jfd-wash:     brightness(1.1) saturate(1.45);
  --jfd-wash-opacity: 0.45;
  --jfd-fg:       var(--phpew-fg, #f7f2ee);
  --jfd-muted:    var(--phpew-muted, #a89fa6);

  --jfd-pink:     #feace6;   /* sampled from the logo art      */
  --jfd-hot:      #ff2e93;   /* the loud one                   */
  --jfd-acid:     #d8ff3e;

  --jfd-accent:   var(--phpew-accent, var(--jfd-hot));
  --jfd-accent-2: var(--phpew-accent-2, var(--jfd-pink));

  /* Their wordmark is a rounded geometric sans. Closest approximation with no
   * webfont request. */
  --jfd-display: "Futura", "Century Gothic", "Avenir Next", "Trebuchet MS",
                 ui-rounded, system-ui, sans-serif;
  --jfd-text:    "Inter", "Helvetica Neue", -apple-system, "Segoe UI", sans-serif;

  --jfd-gutter: clamp(1.25rem, 4vw, 5rem);
  --jfd-max:    76rem;

  /* The logo's dot screen as a tiling gradient. */
  --jfd-halftone:
    radial-gradient(circle at 50% 50%, currentColor 1.1px, transparent 1.2px)
    0 0 / 7px 7px;
}

/* ── 2. Page ground ─────────────────────────────────────────────────────── */
.phpew-page {
  //background: var(--jfd-ink);
  //color: var(--jfd-fg);
  font-family: var(--jfd-text);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* The cover band bleeds past its column; clip rather than raise a scrollbar.
   * `clip` (not `hidden`) keeps the sticky header working. */
  overflow-x: clip;
}

/* ── 2b. Per-issue skin ──────────────────────────────────────────────────
 * PHPew puts `phpew-page--<slug>` on the <body>, so each volume re-skins the
 * whole site from two variables. Adding volume 07 is one block here.
 * Accents are sampled from the cover art by _sample_accent.py — the most
 * saturated colour, which on these covers is the flat type of the cover lines.
 * A starting point, not a verdict: override by hand freely. */
/* The homepage IS the current issue, so it wears the current issue's skin.
 * When volume 07 lands, move `--home` onto that block. */
.phpew-page--home,
.phpew-page--volume-06 {
  //--jfd-accent: #30b040;
  //--jfd-accent-2: #6ede7c;
 // --jfd-cover-art: url("https://s3.us-east-2.amazonaws.com/just-femme-and-dandy-bucket-300272448281-us-east-2-an/2b83e3839253/uploads/site/11a21282-jfdvol06-cover-ver2c-01.webp");
}
.phpew-page--vol-01-inaugural {
  //--jfd-accent: #f0c040;
  //--jfd-accent-2: #ffdc7d;
  --jfd-cover-art: url("https://s3.us-east-2.amazonaws.com/just-femme-and-dandy-bucket-300272448281-us-east-2-an/2b83e3839253/uploads/site/40052bb9-jfd_vol01_cover.webp");
}

/* ── 3. Chrome ─────────────────────────────────────────────────────────── */
.phpew-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2rem;
  padding: 1rem var(--jfd-gutter);
  background: color-mix(in oklab, var(--jfd-ink) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid color-mix(in oklab, var(--jfd-fg) 14%, transparent);
}
.phpew-brand {
  font-family: var(--jfd-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  letter-spacing: -0.03em;
  text-transform: lowercase;
  color: var(--jfd-fg);
  text-decoration: none;
  margin-right: auto;
}
.phpew-brand::after {
  content: "";
  display: inline-block;
  width: 0.5em; height: 0.5em;
  margin-left: 0.35em;
  border-radius: 50%;
  background: var(--jfd-accent);
}
.phpew-page-nav, .phpew-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: baseline; }
.phpew-page-nav-link, .phpew-nav-link {
  font-family: var(--jfd-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jfd-muted);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.phpew-page-nav-link:hover, .phpew-nav-link:hover,
.phpew-page-nav-link.is-active {
  color: var(--jfd-fg);
  border-bottom-color: var(--jfd-accent);
}
.phpew-btn, .phpew-nav-signup {
  font-family: var(--jfd-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--jfd-accent);
  color: var(--jfd-ink);
  text-decoration: none;
  border: 0;
  transition: transform 0.18s, background 0.18s;
}
.phpew-btn:hover, .phpew-nav-signup:hover {
  transform: translateY(-1px);
  background: var(--jfd-accent-2);
}

/* ── 4. Block rhythm ───────────────────────────────────────────────────────
 * Padding sits on the outer block; the content well is the multi wrapper when
 * there is one, or the block itself when a single input collapsed it. */
.phpew-main > .phpew-section,
.phpew-layout > .phpew-section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  padding-inline: var(--jfd-gutter);
}
.phpew-main > .phpew-section > .phpew-section-multi {
  max-width: var(--jfd-max);
  margin-inline: auto;
}
.phpew-main > .phpew-section--jfd-cover { padding: 0; }

/* ── 5. Type ─────────────────────────────────────────────────────────────── */
.phpew-section-heading {
  font-family: var(--jfd-display);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-transform: lowercase;
  text-wrap: balance;
  margin: 0 0 1rem;
}
.phpew-section-markdown p { margin: 0 0 1.35em; }
.phpew-section-markdown a { color: var(--jfd-accent-2); text-underline-offset: 0.2em; }
.phpew-section-markdown a:hover { color: var(--jfd-accent); }

/* ── 6. Cover ──────────────────────────────────────────────────────────────
 * Their cover art is a FINISHED magazine cover — wordmark, cover lines and all.
 * Overlaying site type on it fights the artwork, so it is presented as the
 * object it is: a printed thing standing on the page, billing set beside it.
 * A blurred copy of the same art tints the band behind, so each issue colours
 * its own opening spread. */
.phpew-section--jfd-cover {
  position: relative;
  min-height: min(88svh, 56rem);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  align-items: center;
  gap: 0 clamp(2rem, 6vw, 6rem);
  /* Constrain the spread to the same 76rem measure the rest of the site uses.
   * Without this the art column keeps growing with the viewport while the type
   * is capped by its clamp, so on a wide screen the cover swallows the page and
   * the headline looks tiny next to it. The blurred ground still runs full width
   * because it is painted by ::before on the full-bleed section. */
  padding-block: clamp(3rem, 7vw, 6rem);
  padding-inline: max(var(--jfd-gutter), calc((100% - var(--jfd-max)) / 2));
  overflow: hidden;
  isolation: isolate;
}
/* Belt and braces: the artwork never exceeds a sensible printed-object size. */
.phpew-section--jfd-cover .jfd-cover-art { max-width: 32rem; justify-self: end; }
.phpew-section--jfd-cover .jfd-cover-art {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
}
.phpew-section--jfd-cover [data-phpew-field="issue"],
.phpew-section--jfd-cover [data-phpew-field="headline"],
.phpew-section--jfd-cover [data-phpew-field="standfirst"] { grid-column: 2; }
.phpew-section--jfd-cover .jfd-cover-art img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow:
    0 0.15rem 0 color-mix(in oklab, var(--jfd-fg) 20%, transparent),
    0 2rem 5rem rgba(0, 0, 0, 0.75);
  rotate: -1.2deg;
  transition: rotate 0.4s ease, translate 0.4s ease;
}
.phpew-section--jfd-cover .jfd-cover-art:hover img { rotate: 0deg; translate: 0 -0.5rem; }
.phpew-section--jfd-cover::before {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -2;
  background-image: var(--jfd-cover-art);
  background-size: cover;
  background-position: center 20%;
  filter: blur(60px) var(--jfd-wash, saturate(1.6) brightness(0.5));
  opacity: 0.75;
}
.phpew-section--jfd-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top,
    var(--jfd-ink) 1%,
    color-mix(in oklab, var(--jfd-ink) 45%, transparent) 55%,
    color-mix(in oklab, var(--jfd-ink) 70%, transparent));
}
.phpew-section--jfd-cover [data-phpew-field="issue"] {
  font-family: var(--jfd-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--jfd-accent);
  align-self: end;
}
.phpew-section--jfd-cover [data-phpew-field="headline"] {
  font-size: clamp(2.5rem, 1rem + 6vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
  margin: 0.5rem 0 1rem;
  max-width: 14ch;
}
.phpew-section--jfd-cover [data-phpew-field="standfirst"] {
  font-size: clamp(1.1rem, 0.95rem + 0.5vw, 1.6rem);
  line-height: 1.45;
  color: color-mix(in oklab, var(--jfd-fg) 82%, transparent);
  max-width: 42ch;
  align-self: start;
}

/* ── 7. Masthead ───────────────────────────────────────────────────────────
 * Portraits framed, bios adjacent. The frame is a real object: paper mat,
 * halftone edge, a slight rotation alternating down the column so the page
 * reads hand-assembled rather than gridded. Rows alternate side.
 *
 * The frame needs a wrapper element, so the template declares one on the image
 * field (`wrapper: {tag: div, class: jfd-frame}`) — a pseudo-element cannot
 * render on a replaced <img>. */
.phpew-section--jfd-masthead .phpew-section-multi {
  display: grid;
  gap: clamp(4rem, 9vw, 8rem);
}
/* `grid-auto-rows: min-content` is the important line. Without it the rows are
 * sized by the portrait (which spans all of them), so the six text fields get
 * spread down a very tall column with big dead gaps between name and pronouns.
 * Sides alternate by reassigning COLUMNS, not by flipping `direction` -- the rtl
 * trick reorders auto-placed items and scattered the fields on even rows. */
.phpew-section--jfd-member {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  grid-auto-rows: min-content;
  /* Six text rows at their natural height, then a filler row that soaks up the
   * portrait's leftover height. Without the filler, the frame (which spans every
   * row) pushes its extra height into the text tracks and the block drifts down
   * the photo instead of starting level with its top edge. */
  grid-template-rows: repeat(6, min-content) 1fr;
  align-content: start;
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: 0;
}
.phpew-section--jfd-member .jfd-frame {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
}
.phpew-section--jfd-member > :not(.jfd-frame) { grid-column: 2; }
.phpew-section--jfd-member:nth-child(even) .jfd-frame { grid-column: 2; }
.phpew-section--jfd-member:nth-child(even) > :not(.jfd-frame) { grid-column: 1; }

/* `margin-inline` buys room for the rotation: a rotated box's bounding width
 * grows with its HEIGHT, and these are tall portraits. Without it they punch
 * straight through the page gutter. */
.jfd-frame {
  position: relative;
  margin-inline: 1.25rem;
  padding: 0.9rem 0.9rem 3.25rem;
  background: var(--jfd-paper);
  box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.55);
  rotate: -1.2deg;
  transition: rotate 0.35s ease, translate 0.35s ease;
}
.phpew-section--jfd-member:nth-child(even) .jfd-frame { rotate: 1.4deg; }
.jfd-frame:hover { rotate: 0deg; translate: 0 -0.4rem; }
.jfd-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.03);
}
/* Halftone bleed along the mat's bottom edge — the logo motif, quietly. */
.jfd-frame::after {
  content: "";
  position: absolute;
  left: 0.9rem; right: 0.9rem; bottom: 1.1rem;
  height: 1.4rem;
  color: var(--jfd-accent);
  background: var(--jfd-halftone);
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to right, #000, transparent 72%);
          mask-image: linear-gradient(to right, #000, transparent 72%);
}

.phpew-section--jfd-member [data-phpew-field="name"] {
  font-size: clamp(1.75rem, 1rem + 2.6vw, 3rem);
  line-height: 0.98;
  margin: 0 0 0.6rem;
  align-self: start;
}
.phpew-section--jfd-member [data-phpew-field="pronouns"] {
  justify-self: start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--jfd-accent) 55%, transparent);
  color: var(--jfd-accent);
  margin-bottom: 0.9rem;
}
.phpew-section--jfd-member [data-phpew-field="role"] {
  font-family: var(--jfd-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jfd-accent-2);
  margin-bottom: 1.1rem;
}
.phpew-section--jfd-member [data-phpew-field="bio"] { max-width: 48ch; }
.phpew-section--jfd-member [data-phpew-field="likes"] {
  border-left: 2px solid var(--jfd-accent);
  padding-left: 1rem;
  font-style: italic;
  color: color-mix(in oklab, var(--jfd-fg) 84%, transparent);
  max-width: 48ch;
  margin-bottom: 1rem;
}
.phpew-section--jfd-member [data-phpew-field="astrology"] {
  font-family: var(--jfd-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--jfd-muted);
}

/* ── 8. Table of contents ──────────────────────────────────────────────────
 * Departments are the spine of the magazine, so they get oversized heads and a
 * numbered index; pieces are an editorial list whose rows shift on hover. */
.phpew-section--jfd-toc { counter-reset: jfd-dept; }
.phpew-section--jfd-toc .phpew-section-markdown,
.phpew-section--jfd-toc .phpew-section-prose {
  max-width: var(--jfd-max);
  margin-inline: auto;
}
.phpew-section--jfd-toc h2,
.phpew-section--jfd-toc h3 {
  position: relative;
  counter-increment: jfd-dept;
  font-family: var(--jfd-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 1rem + 3.4vw, 3.25rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  margin: clamp(3rem, 6vw, 5rem) 0 1.25rem;
  padding-bottom: 0.6rem;
  padding-right: 4.5ch;              /* keeps a long name clear of the folio */
  border-bottom: 2px solid var(--jfd-accent);
  color: var(--jfd-accent);          /* the department carries the issue colour */
}
.phpew-section--jfd-toc h2:first-child,
.phpew-section--jfd-toc h3:first-child { margin-top: 0; }
.phpew-section--jfd-toc h2::after,
.phpew-section--jfd-toc h3::after {
  /* The folio number, set as a real display numeral rather than a caption.
   * Sits on the baseline of the rule and is knocked back so it reads as a page
   * number behind the department, not as a second heading competing with it. */
  content: counter(jfd-dept, decimal-leading-zero);
  position: absolute;
  right: 0;
  bottom: 0.6rem;                    /* matches the head's padding-bottom, so the
                                      * numeral rests ON the rule, not across it */
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 0.78;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: color-mix(in oklab, var(--jfd-accent) 38%, transparent);
  pointer-events: none;
}
.phpew-section--jfd-toc ul { list-style: none; margin: 0; padding: 0; }
.phpew-section--jfd-toc li { margin: 0; }
.phpew-section--jfd-toc li a {
  display: block;
  padding: 1.1rem 0;
  border-bottom: 1px solid color-mix(in oklab, var(--jfd-fg) 12%, transparent);
  text-decoration: none;
  color: var(--jfd-fg);
  font-family: var(--jfd-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1rem + 1vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  text-wrap: balance;
  transition: padding-left 0.22s ease, color 0.22s;
}
.phpew-section--jfd-toc li a:hover { padding-left: 1rem; color: var(--jfd-accent-2); }
.phpew-section--jfd-toc li em {
  display: block;
  font-family: var(--jfd-text);
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jfd-muted);
  margin-top: 0.45rem;
}

/* ── 9. The piece ──────────────────────────────────────────────────────────
 * A long read of 1,000-2,500 words, so the reading column is the whole job.
 * The horizontal offset sits on the SECTION so `100%` resolves against the
 * full-width block and reproduces exactly where a centred 76rem well starts.
 * That keeps the piece's left edge on the same line as the masthead and
 * contents at every viewport, while the column itself stays 56rem. */
.phpew-main > .phpew-section--jfd-piece {
  padding-inline: max(var(--jfd-gutter), calc((100% - var(--jfd-max)) / 2 + var(--jfd-gutter)));
}
.phpew-section--jfd-piece > * { max-width: 56rem; }
.phpew-section--jfd-piece [data-phpew-field="title"] {
  font-size: clamp(2.25rem, 1rem + 5.5vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.phpew-section--jfd-piece [data-phpew-field="contributor"] {
  display: block;
  font-family: var(--jfd-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jfd-accent);
  margin-bottom: 2.5rem;
}
.phpew-section--jfd-piece .phpew-section-prose > p:first-of-type::first-letter,
.phpew-section--jfd-piece .phpew-section-markdown > p:first-of-type::first-letter {
  float: left;
  font-family: var(--jfd-display);
  font-size: 4.2em;
  line-height: 0.78;
  font-weight: 700;
  padding: 0.06em 0.09em 0 0;
  color: var(--jfd-accent);
}
.phpew-section--jfd-piece blockquote {
  margin: 2.5rem 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--jfd-accent);
  font-family: var(--jfd-display);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--jfd-accent-2);
}
/* Images default to WRAPPED, not full-bleed: most of what runs inside these
 * essays is a reference image or a snapshot, and blowing those up strands them
 * on the black ground. They alternate sides and the prose closes around them.
 * `.jfd-fig-wide` opts a real photograph into the full width; `.jfd-fig-small`
 * is assigned at import to anything under 700px so it is never upscaled. */
.phpew-section--jfd-piece figure {
  float: right;
  width: min(19rem, 46%);
  margin: 0.45rem 0 1.5rem 2rem;
  shape-margin: 1.5rem;
}
.phpew-section--jfd-piece figure:nth-of-type(even) {
  float: left;
  margin: 0.45rem 2rem 1.5rem 0;
}
.phpew-section--jfd-piece figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 34rem;
  object-fit: contain;
}
.phpew-section--jfd-piece figure.jfd-fig-small { width: min(15rem, 38%); }
.phpew-section--jfd-piece figure.jfd-fig-small img { max-height: 22rem; }
.phpew-section--jfd-piece figure.jfd-fig-wide {
  float: none;
  width: min(68rem, 88vw);
  margin: 3rem 0;
}
.phpew-section--jfd-piece figure.jfd-fig-wide img { max-height: none; }
.phpew-section--jfd-piece figcaption {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--jfd-muted);
  margin-top: 0.75rem;
  max-width: 46ch;
}
/* A hard stop so the next block never starts beside a dangling image. */
.phpew-section--jfd-piece::after { content: ""; display: block; clear: both; }

/* ── 10. Gallery strip ─────────────────────────────────────────────────────
 * Horizontal scroll-snap, CSS only, no carousel script. The scrollbar is part
 * of the design: it reads as a progress rail under the strip. Standard
 * properties first (Firefox, Chrome 121+), ::-webkit- for older Blink. `auto`
 * not `thin` — thin caps Firefox at a hairline and this rail is meant to show. */
.phpew-section--jfd-gallery .phpew-section-multi {
  max-width: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(34rem, 78vw);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1.5rem;
  scrollbar-width: auto;
  scrollbar-color: var(--jfd-accent) color-mix(in oklab, var(--jfd-fg) 14%, transparent);
}
.phpew-section--jfd-gallery .phpew-section-multi > * { scroll-snap-align: center; }
.phpew-section--jfd-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.phpew-section--jfd-gallery .phpew-section-multi::-webkit-scrollbar { height: 12px; }
/* Drop the platform stepper arrows — they are what make a styled scrollbar
 * still read as an OS scrollbar rather than a rail. */
.phpew-section--jfd-gallery .phpew-section-multi::-webkit-scrollbar-button {
  display: none; width: 0; height: 0;
}
.phpew-section--jfd-gallery .phpew-section-multi::-webkit-scrollbar-track {
  background: color-mix(in oklab, var(--jfd-fg) 14%, transparent);
}
.phpew-section--jfd-gallery .phpew-section-multi::-webkit-scrollbar-thumb {
  background: var(--jfd-accent);
  border-radius: 0;
}
.phpew-section--jfd-gallery .phpew-section-multi:hover::-webkit-scrollbar-thumb {
  background: var(--jfd-accent-2);
}

/* ── 11. Footer ────────────────────────────────────────────────────────── */
.phpew-footer {
  position: relative;
  padding: clamp(3rem, 6vw, 5rem) var(--jfd-gutter);
  border-top: 1px solid color-mix(in oklab, var(--jfd-fg) 14%, transparent);
  color: var(--jfd-muted);
  font-size: 0.875rem;
}
.phpew-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6rem;
  color: var(--jfd-accent);
  background: var(--jfd-halftone);
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
          mask-image: linear-gradient(to bottom, #000, transparent);
  pointer-events: none;
}
.phpew-footer a { color: var(--jfd-accent-2); }

/* ── 12. Narrow screens ────────────────────────────────────────────────── */
@media (max-width: 48rem) {
  .phpew-section--jfd-cover {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .phpew-section--jfd-cover .jfd-cover-art { grid-column: 1; grid-row: auto; }
  .phpew-section--jfd-cover [data-phpew-field="issue"],
  .phpew-section--jfd-cover [data-phpew-field="headline"],
  .phpew-section--jfd-cover [data-phpew-field="standfirst"] { grid-column: 1; }
  .phpew-section--jfd-member { grid-template-columns: 1fr; }
  .phpew-section--jfd-member .jfd-frame,
  .phpew-section--jfd-member:nth-child(even) .jfd-frame {
    grid-column: 1;
    grid-row: auto;
    margin-bottom: 1.5rem;
  }
  .phpew-section--jfd-member > :not(.jfd-frame),
  .phpew-section--jfd-member:nth-child(even) > :not(.jfd-frame) { grid-column: 1; }
  /* Wrapping a 46%-wide image around a phone measure leaves ~15 characters a
   * line. Unfloat and let images sit on their own. */
  .phpew-section--jfd-piece figure,
  .phpew-section--jfd-piece figure:nth-of-type(even),
  .phpew-section--jfd-piece figure.jfd-fig-wide {
    float: none;
    width: 100%;
    margin: 2rem 0;
  }
}

/* ── 13. Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .jfd-frame,
  .phpew-section--jfd-cover .jfd-cover-art img,
  .phpew-section--jfd-toc li a,
  .phpew-btn { transition: none; }
  .jfd-frame { rotate: 0deg; }
}

/* ── 14. Contrast guards ───────────────────────────────────────────────────
 * The parent theme is phpew-LIGHT (parentage cannot be changed from here), so
 * its base stylesheet assumes dark text on light surfaces. These rules pin the
 * few interactive states where that assumption showed through as pale-on-pale.
 *
 * The rule of thumb: anything that takes an accent BACKGROUND gets ink text;
 * anything on the page ground gets paper text. Never let both go light. */

/* Nav links are text, not pills. The base sheet was filling them on hover,
 * leaving white type on pale pink. */
.phpew-nav-link:hover,
.phpew-nav-link:focus-visible,
.phpew-page-nav-link:hover,
.phpew-page-nav-link:focus-visible {
  background: transparent;
  color: var(--jfd-fg);
}

/* Any filled button, in any state, keeps ink-on-accent. */
.phpew-btn,
.phpew-btn:hover,
.phpew-btn:focus-visible,
.phpew-btn:active,
.phpew-nav-signup,
.phpew-nav-signup:hover,
button.phpew-btn:hover {
  color: var(--jfd-ink);
}
.phpew-btn:hover,
.phpew-nav-signup:hover,
button.phpew-btn:hover { background: var(--jfd-accent-2); }

/* Cards and panels: the forum board list was reading as white slabs on black
 * because the light parent ships #ffffff here. */
.phpew-card,
.phpew-panel,
.phpew-forum-category,
.phpew-forum-thread,
.phpew-forum-post {
  background: var(--phpew-card-bg, #141216);
  color: var(--jfd-fg);
  border: 1px solid color-mix(in oklab, var(--jfd-fg) 12%, transparent);
}
.phpew-card a, .phpew-panel a,
.phpew-forum-category a, .phpew-forum-thread a { color: var(--jfd-accent-2); }

/* Form fields inherit the dark ground rather than the light parent's white. */
input, textarea, select {
  background: color-mix(in oklab, var(--jfd-fg) 6%, transparent);
  color: var(--jfd-fg);
  border: 1px solid color-mix(in oklab, var(--jfd-fg) 20%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--jfd-muted); }

/* A visible focus ring everywhere, since several of these states now share a
 * background with their container. */
a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--jfd-accent);
  outline-offset: 2px;
}

/* ── 15. Images inside a markdown body ─────────────────────────────────────
 * Markdown emits a bare <img> wrapped in its own <p>, not a <figure>, so the
 * figure rules above never catch it. Float the PARAGRAPH (the img alone cannot
 * carry the wrap, since its parent p would still take a full line) and let the
 * prose close around it, alternating sides down the piece.
 *
 * `:has()` is the whole mechanism here; without it images simply stack full
 * width, which is a fine fallback rather than a broken one. */
.phpew-section--jfd-piece [data-phpew-field="body"] p:has(> img) {
  float: right;
  width: min(19rem, 46%);
  margin: 0.45rem 0 1.25rem 2rem;
  shape-margin: 1.5rem;
}
.phpew-section--jfd-piece [data-phpew-field="body"] p:has(> img):nth-of-type(even) {
  float: left;
  margin: 0.45rem 2rem 1.25rem 0;
}
.phpew-section--jfd-piece [data-phpew-field="body"] p > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30rem;
  object-fit: contain;
}
/* Clear at the end of the body so the footer never rides up beside an image. */
.phpew-section--jfd-piece [data-phpew-field="body"]::after {
  content: "";
  display: block;
  clear: both;
}

/* Long reads: give the markdown body the same measure and rhythm the rest of
 * the piece uses. */
.phpew-section--jfd-piece [data-phpew-field="body"] p { margin: 0 0 1.35em; }
.phpew-section--jfd-piece [data-phpew-field="body"] a {
  color: var(--jfd-accent-2);
  text-underline-offset: 0.2em;
}
.phpew-section--jfd-piece [data-phpew-field="body"] a:hover { color: var(--jfd-accent); }

@media (max-width: 48rem) {
  .phpew-section--jfd-piece [data-phpew-field="body"] p:has(> img),
  .phpew-section--jfd-piece [data-phpew-field="body"] p:has(> img):nth-of-type(even) {
    float: none;
    width: 100%;
    margin: 2rem 0;
  }
}

/* ── 16. Back-issue skins ──────────────────────────────────────────────────
 * One block per volume, same mechanism as vol 06: PHPew puts `phpew-page--<slug>`
 * on the <body>, so each issue re-skins the whole site from its own two variables.
 *
 * Accents are sampled from each cover by _sample_accent.py and then lifted to a
 * readability floor. A raw sample can come back very dark (vol 05's splash gives
 * #a00000), which is fine as artwork and unreadable as heading type on near-black.
 * Volume 01's block is defined earlier in this sheet. */
.phpew-page--vol-02-rebirth {
  --jfd-accent: #f08010;
  --jfd-accent-2: #ffa54a;
  /* Canonical CDN URL. The static1.squarespace.com form 301-redirects here; an
   * <img> follows it but the background-image in this rule is better off direct. */
  --jfd-cover-art: url("https://images.squarespace-cdn.com/content/5f2383e524da5648a132c283/1643821811151-KPZXGXZFW5W1DT6QU0HV/jfd2-cover.png");
}
/* 03 and 05 have no cover artwork anywhere in the capture -- only the full-bleed
 * gradient they used as a splash. It still tints the band behind the contents;
 * there is simply no printed object to stand on the page. */
.phpew-page--vol-03-sustain {
  --jfd-accent: #f0e040;
  --jfd-accent-2: #fff37d;
  --jfd-cover-art: url("https://s3.us-east-2.amazonaws.com/just-femme-and-dandy-bucket-300272448281-us-east-2-an/2b83e3839253/uploads/site/jfd3-cover.webp");
}
.phpew-page--vol-04-survive {
  --jfd-accent: #bd3356;
  --jfd-accent-2: #de6e8a;
  --jfd-cover-art: url("https://s3.us-east-2.amazonaws.com/just-femme-and-dandy-bucket-300272448281-us-east-2-an/2b83e3839253/uploads/site/0b32e0ac-cover.webp");
}
.phpew-page--vol-05-resurrect {
  --jfd-accent: #bd0000;
  --jfd-accent-2: #d12f2f;
  --jfd-cover-art: url("https://s3.us-east-2.amazonaws.com/just-femme-and-dandy-bucket-300272448281-us-east-2-an/2b83e3839253/uploads/site/jfd5-cover.webp");
}

/* A volume page with no cover block needs its own top spacing, since the cover
 * band is what normally clears the sticky header. */
.phpew-main > .phpew-section--vol-03-sustain-contents,
.phpew-main > .phpew-section--vol-05-resurrect-contents {
  padding-top: clamp(6rem, 11vw, 10rem);
}

/* ══════════════════════════════════════════════════════════════════════════
 * 17. Light-theme adaptation
 *
 * The palette above now derives from the theme's tokens, so the ground, text
 * and mat follow whatever theme is active. What could NOT derive are the
 * places where a value only makes sense against a dark ground -- a scrim that
 * fades to black, a wash that knocks the cover art back, ink-coloured type on
 * a filled button. Those are corrected here.
 *
 * Appended rather than edited in place on purpose: the sheet has mixed CRLF/LF
 * line endings (admin textarea vs API writes), which makes multi-line matching
 * unreliable. Equal specificity + later position wins, which is enough.
 * ══════════════════════════════════════════════════════════════════════════ */

/* The blurred cover band. On cream it has to be lifted, not darkened. */
.phpew-section--jfd-cover::before { opacity: var(--jfd-wash-opacity, 0.75); }

/* The scrim under the cover billing fades to the GROUND, whatever it is. */
.phpew-section--jfd-cover::after {
  background: linear-gradient(to top,
    var(--jfd-ink) 1%,
    color-mix(in oklab, var(--jfd-ink) 55%, transparent) 55%,
    color-mix(in oklab, var(--jfd-ink) 78%, transparent));
}

/* The portrait mat sits ON a cream page now, so it needs an edge to read as a
 * print rather than dissolving into the background. */
.jfd-frame {
  border: 1px solid color-mix(in oklab, var(--jfd-fg) 10%, transparent);
  box-shadow: 0 1rem 2.5rem color-mix(in oklab, var(--jfd-fg) 18%, transparent);
}

/* Filled controls take the theme's own on-accent colour. Previously pinned to
 * `--jfd-ink`, which was fine when ink meant near-black and is wrong now that
 * it means the page ground. */
.phpew-btn,
.phpew-btn:hover,
.phpew-btn:focus-visible,
.phpew-btn:active,
.phpew-nav-signup,
.phpew-nav-signup:hover,
button.phpew-btn:hover { color: var(--phpew-accent-fg, #fff); }

/* Shadows tuned for a dark page are invisible on cream; these are ink-based. */
.phpew-section--jfd-cover .jfd-cover-art img {
  box-shadow:
    0 0.15rem 0 color-mix(in oklab, var(--jfd-fg) 12%, transparent),
    0 1.5rem 3.5rem color-mix(in oklab, var(--jfd-fg) 22%, transparent);
}

/* ── Per-issue accents, recomputed for the cream ground ────────────────────
 * The earlier values were sampled from each cover then LIFTED for legibility
 * on near-black. On cream they have to go the other way. Each is darkened
 * along its own hue until it clears WCAG AA (4.5:1) against #f5f1e8, so the
 * issue keeps its identity and the type stays readable. Measured contrast is
 * noted per line. */
.phpew-page--vol-01-inaugural { --jfd-accent: #846923; --jfd-accent-2: #a8842c; } /* 4.6:1 */
/* Vol 02 is picked by hand, not sampled. Its cover is a hot-pink-to-orange
 * rainbow border, and "most frequent saturated colour" landed on the orange
 * band (28.5k px) barely ahead of red (26.4k) -- which darkened to brown and
 * read as nothing. Frequency finds the biggest area, not the character. */
.phpew-page--vol-02-rebirth   { --jfd-accent: #cf1f77; --jfd-accent-2: #a81760; } /* 4.5:1 */
.phpew-page--vol-03-sustain   { --jfd-accent: #776f20; --jfd-accent-2: #968b28; } /* 4.6:1 */
.phpew-page--vol-04-survive   { --jfd-accent: #b03050; --jfd-accent-2: #c93a5c; } /* 5.5:1 */
.phpew-page--vol-05-resurrect { --jfd-accent: #a00000; --jfd-accent-2: #c40000; } /* 7.5:1 */
.phpew-page--home,
.phpew-page--volume-06        { --jfd-accent: #227d2d; --jfd-accent-2: #2a9c38; } /* 4.6:1 */

/* ══════════════════════════════════════════════════════════════════════════
 * 18. Per-issue skin on PIECE pages, and readable links
 *
 * Volume pages carry `phpew-page--vol-01-inaugural`, but every piece has its
 * own slug, so none of the volume rules reached them and all 195 pieces fell
 * back to the house accent. PHPew also emits `data-page="<slug>"` on the body,
 * and JFD's slugs are prefixed by issue number, so a prefix match puts each
 * piece in its own issue's colour without touching any content.
 * ══════════════════════════════════════════════════════════════════════════ */
[data-page^="01"], [data-page^="vol-01"] {
  --jfd-accent: #846923; --jfd-accent-2: #6b551c;
}
[data-page^="02"], [data-page^="vol-02"] {
  --jfd-accent: #cf1f77; --jfd-accent-2: #a81760;
}
[data-page^="03"], [data-page^="vol-03"], [data-page="letter-from-the-editor-vol3"] {
  --jfd-accent: #776f20; --jfd-accent-2: #5f5919;
}
[data-page^="04"], [data-page^="vol-04"], [data-page="letter-from-the-editor-person"],
[data-page="for-us-by-us"] {
  --jfd-accent: #b03050; --jfd-accent-2: #8f2741;
}
[data-page^="05"], [data-page^="vol-05"], [data-page="letter-from-the-editor-vol05"] {
  --jfd-accent: #a00000; --jfd-accent-2: #820000;
}
[data-page^="06"], [data-page="volume-06"], [data-page="home"] {
  --jfd-accent: #227d2d; --jfd-accent-2: #1b6424;
}

/* Links in running prose take the CONTRAST-CHECKED accent, not accent-2.
 * accent-2 is the lighter partner used for large display type; at body size on
 * cream it was landing around 3:1 -- the pale pink that started this. Underline
 * them too: colour alone is not a link affordance. */
.phpew-section--jfd-piece [data-phpew-field="body"] a,
.phpew-section-markdown a,
.phpew-section-prose a,
.phpew-content--jfd-member [data-phpew-field="bio"] a {
  color: var(--jfd-accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}
.phpew-section--jfd-piece [data-phpew-field="body"] a:hover,
.phpew-section-markdown a:hover,
.phpew-section-prose a:hover,
.phpew-content--jfd-member [data-phpew-field="bio"] a:hover {
  color: var(--jfd-accent-2);
  text-decoration-thickness: 2px;
}

/* The contents list is a nav, not prose -- it keeps the plain treatment and
 * gets its emphasis from size and the hover shift instead. */
.phpew-section--jfd-toc li a { text-decoration: none; color: var(--jfd-fg); }

/* ══════════════════════════════════════════════════════════════════════════
 * 19. Per-issue accents, final — picked, not sampled
 *
 * The sampler ("most frequent strongly-saturated colour") works on a cover with
 * a clear brand colour, and fails on anything polychrome: on vol 02's rainbow
 * border it found the widest band, and on vol 03 -- whose only surviving art is
 * a soft yellow-green splash, no cover was ever published -- it returned a muddy
 * olive. It also produced two near-identical browns across six issues.
 *
 * These are chosen by hand instead. Each is a colour genuinely present in that
 * issue's own artwork, each darkened along its own hue until it clears WCAG AA
 * against the cream ground, and the six are spread across the wheel so no two
 * issues read alike. Ratio noted per line.
 * ══════════════════════════════════════════════════════════════════════════ */
.phpew-page--vol-01-inaugural, [data-page^="01"], [data-page^="vol-01"] {
  --jfd-accent: #1d4ed8;  /* blue: the arch on its cover runs blue/lime/orange/pink */
  --jfd-accent-2: #1c4cd3;                                                  /* 6.0:1 */
}
.phpew-page--vol-02-rebirth, [data-page^="02"], [data-page^="vol-02"] {
  --jfd-accent: #cc1e7d;  /* magenta: the hot-pink edge of its rainbow border */
  --jfd-accent-2: #a81967;                                                  /* 4.6:1 */
}
.phpew-page--vol-03-sustain, [data-page^="03"], [data-page^="vol-03"],
[data-page="letter-from-the-editor-vol3"] {
  --jfd-accent: #a3590c;  /* burnt orange: the orange blooms in its splash */
  --jfd-accent-2: #894b0a;                                                  /* 4.7:1 */
}
.phpew-page--vol-04-survive, [data-page^="04"], [data-page^="vol-04"],
[data-page="letter-from-the-editor-person"], [data-page="for-us-by-us"] {
  --jfd-accent: #b03050;  /* wine: the figures on the survive cover */
  --jfd-accent-2: #a62d4b;                                                  /* 5.5:1 */
}
.phpew-page--vol-05-resurrect, [data-page^="05"], [data-page^="vol-05"],
[data-page="letter-from-the-editor-vol05"] {
  --jfd-accent: #c81010;  /* red: its splash is entirely red and orange */
  --jfd-accent-2: #b40e0e;                                                  /* 5.3:1 */
}
.phpew-page--home, .phpew-page--volume-06, [data-page^="06"],
[data-page="volume-06"], [data-page="home"] {
  --jfd-accent: #227d2d;  /* green: the colour its cover lines are actually set in */
  --jfd-accent-2: #1d6926;                                                  /* 4.6:1 */
}

/* ── 20. Portraits are never cropped ───────────────────────────────────────
 * The frame forced `aspect-ratio: 3/4` with `object-fit: cover`, so any
 * portrait that was not natively 3:4 got trimmed -- Addie's is 2500x3750 (2:3)
 * and lost the top of her head. Faces are the one thing you cannot crop for
 * tidiness. Portraits now keep their own proportions and the frames vary in
 * height, which suits a wall of prints better than a uniform grid anyway. */
.jfd-frame img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

/* ── 21. The archive as covers ─────────────────────────────────────────────
 * Same jfd-cover content as each issue's opening spread, reused as a card. The
 * spread rules assume one full-viewport cover per page, so everything scoped
 * inside the archive gets reset: no min-height, no blurred ground, no scrim.
 * The billing (issue line, title, "27 pieces across 9 departments") sits under
 * the artwork instead of beside it. */
.phpew-section--jfd-archive .phpew-section-multi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  max-width: var(--jfd-max);
  margin-inline: auto;
}
.phpew-section--jfd-archive .phpew-section--jfd-cover {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: visible;
  isolation: auto;
}
.phpew-section--jfd-archive .phpew-section--jfd-cover::before,
.phpew-section--jfd-archive .phpew-section--jfd-cover::after { content: none; }

.phpew-section--jfd-archive .jfd-cover-art { max-width: none; margin-bottom: 1.1rem; }
.phpew-section--jfd-archive .jfd-cover-art img {
  rotate: -1deg;
  transition: rotate 0.35s ease, translate 0.35s ease, box-shadow 0.35s ease;
}
.phpew-section--jfd-archive .phpew-section--jfd-cover:hover .jfd-cover-art img {
  rotate: 0deg;
  translate: 0 -0.4rem;
  box-shadow: 0 2rem 4rem color-mix(in oklab, var(--jfd-fg) 30%, transparent);
}
.phpew-section--jfd-archive [data-phpew-field="issue"] {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
}
.phpew-section--jfd-archive [data-phpew-field="headline"] {
  font-size: clamp(1.5rem, 1rem + 1.4vw, 2.25rem);
  max-width: none;
  margin: 0.35rem 0 0.5rem;
}
.phpew-section--jfd-archive [data-phpew-field="standfirst"] {
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: none;
  color: var(--jfd-muted);
}
/* The link is a real anchor for keyboard and screen readers; stretching it over
 * the card makes the whole thing clickable without wrapping the markup in one. */
.phpew-section--jfd-archive [data-phpew-field="link"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  font-size: 0;
  text-decoration: none;
}
.phpew-section--jfd-archive [data-phpew-field="link"]:focus-visible {
  outline: 2px solid var(--jfd-accent);
  outline-offset: 4px;
}

/* ── 22. House colours, and a spectrum on the masthead ─────────────────────
 * Pages that are not an issue (masthead, archive, about, forum) fell through to
 * the theme's stock navy + amber, which is the least queer pairing available.
 * The house accent is now the magazine's own fuchsia, with electric violet as
 * its partner -- both taken to WCAG AA on the cream ground.
 *
 * These sit on :root, NOT on .phpew-page, and that is load-bearing. Both
 * selectors score (0,1,0), and this block was appended AFTER the per-issue
 * accents in section 2b -- so on .phpew-page it won every tie and every volume
 * except 03/04/05 (re-declared later still) rendered in the house fuchsia.
 * Volume 01 was blue in the stylesheet and pink on the page. On :root the value
 * reaches the body by INHERITANCE instead, and an inherited value loses to any
 * rule that matches the body directly. The house colour becomes what it was
 * always meant to be: the fallback, not the winner. */
.phpew-page {
  /* the two house declarations moved down onto :root, see the note above */
}
:root {
  --jfd-accent: #cc1e7d;    /* fuchsia — the logo's pink, taken to AA   4.6:1 */
  --jfd-accent-2: #7c3aed;  /* electric violet                          5.1:1 */
}

/* The masthead runs the full spectrum rather than one accent repeated eight
 * times. Each person's pronoun pill takes the next colour round the wheel, so
 * the page reads as a rainbow down the column -- which is the point of a queer
 * masthead. Every value clears AA on cream, so this is decoration that costs
 * nothing in legibility. */
.phpew-section--jfd-member:nth-child(8n+1) { --jfd-pill: #d61f1f; } /* red     */
.phpew-section--jfd-member:nth-child(8n+2) { --jfd-pill: #b35c00; } /* orange  */
.phpew-section--jfd-member:nth-child(8n+3) { --jfd-pill: #8a6a00; } /* amber   */
.phpew-section--jfd-member:nth-child(8n+4) { --jfd-pill: #227d2d; } /* green   */
.phpew-section--jfd-member:nth-child(8n+5) { --jfd-pill: #0f7b7b; } /* teal    */
.phpew-section--jfd-member:nth-child(8n+6) { --jfd-pill: #1d4ed8; } /* blue    */
.phpew-section--jfd-member:nth-child(8n+7) { --jfd-pill: #7c3aed; } /* violet  */
.phpew-section--jfd-member:nth-child(8n+8) { --jfd-pill: #cc1e7d; } /* fuchsia */

.phpew-section--jfd-member [data-phpew-field="pronouns"] {
  color: var(--jfd-pill, var(--jfd-accent));
  border-color: color-mix(in oklab, var(--jfd-pill, var(--jfd-accent)) 60%, transparent);
  background: color-mix(in oklab, var(--jfd-pill, var(--jfd-accent)) 8%, transparent);
}
.phpew-section--jfd-member [data-phpew-field="role"] {
  color: var(--jfd-pill, var(--jfd-accent-2));
}
.phpew-section--jfd-member [data-phpew-field="likes"] {
  border-left-color: var(--jfd-pill, var(--jfd-accent));
}
.jfd-frame::after { color: var(--jfd-pill, var(--jfd-accent)); }

/* ── 23. The cover link is an archive-only affordance ──────────────────────
 * jfd-cover is used twice: as an issue's opening spread and as an archive card.
 * The link only means something on the card -- on the issue's own page you are
 * already there, so it rendered as a stray "Read volume 06" in the middle of
 * the spread. Hidden by default, restored (and stretched over the card) inside
 * the archive. Order matters: these two selectors have equal specificity, so
 * the re-enable has to come second. */
.phpew-section--jfd-cover [data-phpew-field="link"] { display: none; }

.phpew-section--jfd-archive [data-phpew-field="link"] {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  font-size: 0;
  text-decoration: none;
}
.phpew-section--jfd-archive [data-phpew-field="link"]:focus-visible {
  outline: 2px solid var(--jfd-accent);
  outline-offset: 4px;
}

/* ── 24. About page ────────────────────────────────────────────────────────
 * It reuses the contents template, which styles h3 as an oversized department
 * head with a folio numeral. That is right for an issue's table of contents and
 * wrong for running prose, so on this page they become plain subheads and the
 * body takes a reading measure. */
.phpew-page--about .phpew-section--jfd-about h3 {
  font-size: clamp(1.35rem, 1rem + 1vw, 1.85rem);
  color: var(--jfd-accent);
  border-bottom: 0;
  padding-right: 0;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0.75rem;
}
.phpew-page--about .phpew-section--jfd-about h3::after { content: none; }
.phpew-page--about .phpew-section--jfd-about .phpew-section-markdown {
  max-width: 46rem;
  margin-inline: 0;
}
.phpew-page--about .phpew-section--jfd-about p { margin: 0 0 1.35em; }
.phpew-page--about .phpew-section--jfd-about strong { color: var(--jfd-fg); }

/* ── 25. Volumes 03 and 05, now that their covers exist ────────────────────
 * Both were sampled off a splash gradient because no cover art had survived the
 * scrape -- vol 03 came back a muddy olive. With the real covers in hand the
 * accents are picked from the artwork itself, and the blurred band behind each
 * opening spread points at the cover rather than the old background.
 *
 * Vol 04 also moves here: its cover is 53k pixels of violet against 9k of red,
 * so violet is plainly its colour, and taking it frees red for vol 05. The six
 * issues now sit at six distinct points on the wheel. */
.phpew-page--vol-03-sustain, [data-page^="03"], [data-page^="vol-03"],
[data-page="letter-from-the-editor-vol3"] {
  --jfd-accent: #467a13;    /* the green ground and chartreuse border   4.6:1 */
  --jfd-accent-2: #3a660f;
  --jfd-cover-art: url("https://s3.us-east-2.amazonaws.com/just-femme-and-dandy-bucket-300272448281-us-east-2-an/2b83e3839253/uploads/site/jfd3-cover.webp");
}
.phpew-page--vol-04-survive, [data-page^="04"], [data-page^="vol-04"],
[data-page="letter-from-the-editor-person"], [data-page="for-us-by-us"] {
  --jfd-accent: #7c3aed;    /* violet: the purple ground, its dominant  5.1:1 */
  --jfd-accent-2: #6c33ce;
}
.phpew-page--vol-05-resurrect, [data-page^="05"], [data-page^="vol-05"],
[data-page="letter-from-the-editor-vol05"] {
  --jfd-accent: #d61f1f;    /* red: the coral script and the wings      4.6:1 */
  --jfd-accent-2: #b21919;
  --jfd-cover-art: url("https://s3.us-east-2.amazonaws.com/just-femme-and-dandy-bucket-300272448281-us-east-2-an/2b83e3839253/uploads/site/jfd5-cover.webp");
}

/* ── 28. Breadcrumbs ───────────────────────────────────────────────────────
 * The complaint these answer: you land on a piece from a search result or a
 * shared link, and the only route back into the issue is the browser's back
 * button. Every piece and page now carries the same trail above and below its
 * body, so the way out is in reach at both ends of a 2,000-word read.
 *
 * The trail is a markdown field, so it arrives as one <p> of <a>s separated by
 * literal slashes. The section sits directly in the layout grid, which means
 * the first job is undoing the generic block padding — a crumb rail is chrome,
 * not a section, and the 7rem of block padding every other section takes would
 * strand it in open space. */
.phpew-layout > .phpew-section--jfd-crumb {
  padding-block: 0;
  padding-inline: max(var(--jfd-gutter), calc((100% - var(--jfd-max)) / 2));
}
/* A piece's reading column starts one gutter further in than the standard well
 * (see section 9), so its crumbs have to follow it or they hang off the left
 * edge of the text they belong to. Only the piece does this — the masthead
 * shares the same layout but the standard measure. */
.phpew-layout:has(> .phpew-main > .phpew-section--jfd-piece) > .phpew-section--jfd-crumb {
  padding-inline: max(var(--jfd-gutter), calc((100% - var(--jfd-max)) / 2 + var(--jfd-gutter)));
}

.phpew-section--jfd-crumb [data-phpew-field="trail"] p {
  margin: 0;
  font-family: var(--jfd-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jfd-muted);
  /* Three crumbs plus a long volume title overruns a phone. The loose leading
   * lets it wrap onto a second line instead of raising a scrollbar. */
  line-height: 1.9;
}
.phpew-section--jfd-crumb a {
  color: var(--jfd-muted);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.phpew-section--jfd-crumb a:hover {
  color: var(--jfd-accent);
  border-bottom-color: var(--jfd-accent);
}
/* The last crumb is the page's own parent — the one you actually came for. */
.phpew-section--jfd-crumb a:last-of-type { color: var(--jfd-fg); }

/* Above the fold it stays quiet: tucked under the sticky header, over the
 * title, taking no more room than it needs. */
.phpew-section--jfd-crumb[data-area="crumb-top"] {
  padding-top: clamp(1.25rem, 3vw, 2rem);
}
/* At the foot of the read it is the main event, so it gets a rule and air. */
.phpew-section--jfd-crumb[data-area="crumb-bottom"] {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-block: clamp(1.5rem, 3vw, 2.25rem) clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid color-mix(in oklab, var(--jfd-fg) 14%, transparent);
}
/* An arrow on the bottom trail only. At the end of a piece the gesture is
 * "take me back out", not "where am I". */
.phpew-section--jfd-crumb[data-area="crumb-bottom"] [data-phpew-field="trail"] p::before {
  content: "\2191\00a0\00a0";
  color: var(--jfd-accent);
}

@media (prefers-reduced-motion: reduce) {
  .phpew-section--jfd-crumb a { transition: none; }
}

/* Section 18 pins prose links to accent + underline. A crumb is navigation,
 * not prose, so it opts back out — otherwise the trail reads as three links
 * in the middle of a sentence. */
.phpew-section--jfd-crumb .phpew-section-markdown a { text-decoration: none; }
.phpew-section--jfd-crumb .phpew-section-markdown a:hover {
  text-decoration: none;
  color: var(--jfd-accent);
}

/* ── 29. Linked images in a markdown body ──────────────────────────────────
 * Section 15 catches `p > img`. An image the author wrapped in a link lands as
 * `p > a > img`, which matched none of it — so those rendered at natural size,
 * up to 1,500px, and pushed a horizontal scrollbar onto every piece carrying
 * one. Same treatment, one level deeper. */
.phpew-section--jfd-piece [data-phpew-field="body"] p:has(> a > img) {
  float: right;
  width: min(19rem, 46%);
  margin: 0.45rem 0 1.25rem 2rem;
  shape-margin: 1.5rem;
}
.phpew-section--jfd-piece [data-phpew-field="body"] p:has(> a > img):nth-of-type(even) {
  float: left;
  margin: 0.45rem 2rem 1.25rem 0;
}
/* The anchor is inline by default, so it would not take the img's height and
 * the link target would be a sliver of the picture. */
.phpew-section--jfd-piece [data-phpew-field="body"] p > a:has(> img) { display: block; }
.phpew-section--jfd-piece [data-phpew-field="body"] p > a > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30rem;
  object-fit: contain;
}
@media (max-width: 48rem) {
  .phpew-section--jfd-piece [data-phpew-field="body"] p:has(> a > img),
  .phpew-section--jfd-piece [data-phpew-field="body"] p:has(> a > img):nth-of-type(even) {
    float: none;
    width: 100%;
    margin: 2rem 0;
  }
}

/* ── 30. The about page ────────────────────────────────────────────────────
 * Two faults, one visual: the body copy sat in a 46rem column pinned hard to
 * the left gutter with the rest of the page empty beside it, and it opened
 * cold — no mark, no title, just prose. Section 24 capped the measure and set
 * `margin-inline: 0`, but nothing ever put the SECTION in the 76rem well, so
 * "flush left in the well" came out as "flush left on the screen", left of
 * even the breadcrumb above it.
 *
 * The well goes on the section. The column stays left-aligned inside it, which
 * is what you want for a long read — a centred 46rem column would float free
 * of the crumb and the nav and belong to nothing. */
.phpew-layout > .phpew-section--jfd-about,
.phpew-layout > .phpew-section--jfd-about-head {
  padding-inline: max(var(--jfd-gutter), calc((100% - var(--jfd-max)) / 2));
}
.phpew-layout > .phpew-section--jfd-about-head { padding-bottom: 0; }
.phpew-layout > .phpew-section--jfd-about { padding-top: clamp(2rem, 5vw, 3.5rem); }

/* The mark. Their logo is a finished square with the wordmark already in it, so
 * it is presented as an object rather than used as a page title — set at a size
 * that reads as a stamp on the page, not a banner across it. */
.phpew-section--jfd-about-head {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: end;
  gap: 0 clamp(2rem, 5vw, 4rem);
}
.jfd-about-mark {
  grid-column: 1;
  grid-row: 1 / -1;
  width: clamp(15rem, 44vw, 36rem);
  align-self: center;
}
.jfd-about-mark img {
  display: block;
  width: 100%;
  height: auto;
  rotate: -1.5deg;
  /* The mark is a transparent cut-out, so box-shadow would paint a rectangle
   * behind the artwork. drop-shadow follows the alpha channel instead. */
  filter: drop-shadow(0 1rem 2rem color-mix(in oklab, var(--jfd-ink) 18%, transparent));
  transition: rotate 0.4s ease;
}
.jfd-about-mark:hover img { rotate: 0deg; }

.phpew-section--jfd-about-head [data-phpew-field="headline"],
.phpew-section--jfd-about-head [data-phpew-field="standfirst"] { grid-column: 2; }
.phpew-section--jfd-about-head [data-phpew-field="headline"] {
  font-family: var(--jfd-display);
  font-weight: 700;
  font-size: clamp(3rem, 1rem + 8vw, 8rem);
  line-height: 0.85;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  color: var(--jfd-accent);
  margin: 0;
  align-self: end;
}
.phpew-section--jfd-about-head [data-phpew-field="standfirst"] {
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.35rem);
  line-height: 1.45;
  color: var(--jfd-muted);
  max-width: 34ch;
  margin-top: 1rem;
  align-self: start;
}

/* Below the mark's own width the two columns stop being a pairing and start
   being a squeeze. Stack, and let the mark lead. */
@media (max-width: 48rem) {
  .phpew-section--jfd-about-head { grid-template-columns: 1fr; }
  .jfd-about-mark {
    grid-row: auto;
    width: clamp(11rem, 62vw, 20rem);
    margin-bottom: 1.5rem;
  }
  .phpew-section--jfd-about-head [data-phpew-field="headline"],
  .phpew-section--jfd-about-head [data-phpew-field="standfirst"] { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .jfd-about-mark img { transition: none; rotate: 0deg; }
}

#jfd-about-header-mark {
    /* The box has to hold its size before the file arrives: a lazily loaded
       image in a zero-height flex item never enters the viewport, so it never
       loads, so it stays zero-height. */
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    max-width: 100%;
    object-fit: contain;
    transform: none;
    z-index: auto;
    opacity: 1;
}

.phpew-content--jfd-about-header {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: clamp(1.5rem, 4vw, 3.5rem);
    row-gap: 0.5rem;
    align-items: center;
    max-width: var(--jfd-max);
    margin-inline: auto;
    transform: none;
}

.phpew-content--jfd-about-header > div.jfd-about-mark {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(20rem, 100%);
    aspect-ratio: 1;
    transform: none;
}

#jfd-about-header-headline {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    display: block;
    margin: 0;
    transform: none;
}

#jfd-about-header-standfirst {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    display: block;
    width: 100%;
    transform: none;
}

@media (max-width: 767px) {
.phpew-content--jfd-about-header {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    justify-items: start;
}
.phpew-content--jfd-about-header > div.jfd-about-mark {
    grid-column: 1;
    grid-row: 1;
    width: min(14rem, 60%);
}
#jfd-about-header-headline { grid-column: 1; grid-row: 2; }
#jfd-about-header-standfirst { grid-column: 1; grid-row: 3; }
}

.phpew-content--jfd-about-body > div.phpew-section-markdown.phpew-section-markdown--jfd-about-body > p:nth-of-type(1) {
    background: #f5f1e8bc;
    z-index: 2;
    position: relative;
}

/* ── 12. Contests ────────────────────────────────────────────────────────── */
/* One card per contest, laid out as a single wrapping flex row: the pieces that
 * want a line of their own claim the full width, and the short facts (opens,
 * closes, prize, fee, theme) fall into a strip together. `order` sets the
 * reading order here rather than the template's field order, so an editor can
 * add a field later without the page rearranging itself. Their labels are
 * generated text: the renderer emits the value alone, and a bare date with no
 * word in front of it is a riddle. */
.phpew-section--jfd-contest {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1.5rem;
  row-gap: 1rem;
  max-width: var(--jfd-max);
  margin-inline: auto;
  margin-block-end: clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.75rem, 4vw, 3.25rem);
  background: var(--jfd-paper);
  border: 1px solid color-mix(in srgb, var(--jfd-fg) 16%, transparent);
  border-radius: 2px;
}

.phpew-section--jfd-contest > * { flex: 1 0 100%; }

.phpew-section--jfd-contest [data-phpew-field="name"] {
  order: 1;
  flex: 1 1 auto;
  margin: 0;
  font-family: var(--jfd-display);
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--jfd-accent);
  text-transform: lowercase;
}

/* The status is the first thing an editor changes and the first thing a
 * visitor needs, so it rides beside the title rather than under it. */
.phpew-section--jfd-contest [data-phpew-field="status"] {
  order: 2;
  flex: 0 0 auto;
  align-self: center;
  padding: 0.3rem 0.85rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--jfd-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jfd-muted);
}
.phpew-section--jfd-contest:has([data-phpew-field="status"]) [data-phpew-field="status"] { white-space: nowrap; }

.phpew-section--jfd-contest [data-phpew-field="standfirst"] {
  order: 3;
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.45;
  color: var(--jfd-fg);
  border-block-end: 1px solid color-mix(in srgb, var(--jfd-fg) 14%, transparent);
  padding-block-end: 1.25rem;
}

/* The facts strip. */
.phpew-section--jfd-contest [data-phpew-field="opens"],
.phpew-section--jfd-contest [data-phpew-field="closes"],
.phpew-section--jfd-contest [data-phpew-field="prize"],
.phpew-section--jfd-contest [data-phpew-field="fee"],
.phpew-section--jfd-contest [data-phpew-field="theme"] {
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--jfd-text);
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--jfd-fg);
}
.phpew-section--jfd-contest [data-phpew-field="opens"]  { order: 4; }
.phpew-section--jfd-contest [data-phpew-field="closes"] { order: 5; }
.phpew-section--jfd-contest [data-phpew-field="prize"]  { order: 6; }
.phpew-section--jfd-contest [data-phpew-field="fee"]    { order: 7; }
.phpew-section--jfd-contest [data-phpew-field="theme"]  { order: 8; }

.phpew-section--jfd-contest [data-phpew-field="opens"]::before  { content: "opens "; }
.phpew-section--jfd-contest [data-phpew-field="closes"]::before { content: "closes "; }
.phpew-section--jfd-contest [data-phpew-field="prize"]::before  { content: "prize "; }
.phpew-section--jfd-contest [data-phpew-field="fee"]::before    { content: "reading fee "; }
.phpew-section--jfd-contest [data-phpew-field="theme"]::before  { content: "theme "; }

.phpew-section--jfd-contest [data-phpew-field="opens"]::before,
.phpew-section--jfd-contest [data-phpew-field="closes"]::before,
.phpew-section--jfd-contest [data-phpew-field="prize"]::before,
.phpew-section--jfd-contest [data-phpew-field="fee"]::before,
.phpew-section--jfd-contest [data-phpew-field="theme"]::before {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jfd-muted);
}

.phpew-section--jfd-contest [data-phpew-field="body"] {
  order: 9;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.6;
}
.phpew-section--jfd-contest [data-phpew-field="body"] h2 {
  font-family: var(--jfd-display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  text-transform: lowercase;
  color: var(--jfd-accent-2);
  margin: 2em 0 0.6em;
}
.phpew-section--jfd-contest [data-phpew-field="body"] p { margin: 0 0 1.2em; }
.phpew-section--jfd-contest [data-phpew-field="body"] strong { color: var(--jfd-accent); }

/* Entering is the point of the page, so the link is a target, not a sentence. */
.phpew-section--jfd-contest [data-phpew-field="submit_url"] {
  order: 10;
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.9rem 2.25rem;
  background: var(--jfd-accent);
  color: var(--jfd-paper);
  font-family: var(--jfd-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  text-decoration: none;
  border-radius: 999px;
  transition: background 120ms ease, transform 120ms ease;
}
.phpew-section--jfd-contest [data-phpew-field="submit_url"]:hover {
  background: var(--jfd-accent-2);
  transform: translateY(-1px);
}
.phpew-section--jfd-contest [data-phpew-field="submit_url"]:focus-visible {
  outline: 3px solid var(--jfd-accent-2);
  outline-offset: 3px;
}

/* The judge is a person, so their name and their life sit together, set apart
 * from the call the way a contributor note sits apart from a piece. */
.phpew-section--jfd-contest [data-phpew-field="judge"] {
  order: 11;
  flex: 1 0 100%;
  margin: 1.5rem 0 0;
  font-family: var(--jfd-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--jfd-fg);
}
.phpew-section--jfd-contest [data-phpew-field="judge"]::before {
  content: "judged by";
  display: block;
  font-family: var(--jfd-text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jfd-muted);
  margin-block-end: 0.25rem;
}
.phpew-section--jfd-contest [data-phpew-field="judge_bio"] {
  order: 12;
  max-width: 58ch;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--jfd-muted);
}
.phpew-section--jfd-contest [data-phpew-field="judge_bio"] p { margin: 0 0 0.9em; }

.phpew-section--jfd-contest [data-phpew-field="contact"] {
  order: 13;
  margin: 0.5rem 0 0;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid color-mix(in srgb, var(--jfd-fg) 14%, transparent);
  font-size: 0.9rem;
  color: var(--jfd-muted);
}
.phpew-section--jfd-contest [data-phpew-field="contact"]::before {
  content: "questions ";
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* A closed contest should not shout in the accent colour or invite entries. */
.phpew-section--jfd-contest:has([data-phpew-field="status"]:not(:empty)) { --jfd-contest-live: 1; }
.phpew-page--contests .phpew-section--jfd-contest + .phpew-section--jfd-contest { margin-block-start: 0; }

@media (max-width: 767px) {
  .phpew-section--jfd-contest { column-gap: 1rem; }
  .phpew-section--jfd-contest [data-phpew-field="submit_url"] { flex: 1 0 100%; text-align: center; }
}
