/* Klema admin. Values come from ui-tokens.css. */
* { box-sizing: border-box; }
html, body { height: 100%; }
body.admin { margin: 0; font: var(--ui-text-md)/1.5 var(--ui-font); color: var(--ui-ink); background: var(--ui-bg); -webkit-font-smoothing: antialiased; }
/* Moving between pages: a quick cross-fade instead of a white flash, with the
   sidebar (and the upload tray) standing still. Applies to full page loads in
   browsers that support it, and to assets/nav.js's partial page swaps. */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.platform-bar { view-transition-name: platform-bar; }
.uploads { view-transition-name: uploads; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
/* assets/nav.js: a bar along the top while a page loads, the announcement for
   screen readers, and the heading that takes focus after a page swap. */
.nav-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 300; height: 3px; background: var(--ui-primary); transform: scaleX(0); transform-origin: left; opacity: 0; pointer-events: none; }
.nav-progress.is-going { opacity: 1; transform: scaleX(.85); transition: transform 6s cubic-bezier(.08, .6, .25, 1); }
.nav-progress.is-done { transform: scaleX(1); opacity: 0; transition: transform .2s ease, opacity .25s ease .15s; }
.nav-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.main [tabindex="-1"]:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
a { color: var(--ui-primary-ink); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.muted { color: var(--ui-muted); }
.right { text-align: right; }
.icon { width: 18px; height: 18px; flex: none; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 var(--space-2); border-radius: var(--ui-radius-pill); background: var(--ui-line); color: var(--ui-ink-2); font-size: var(--ui-text-xs); font-weight: 600; vertical-align: middle; margin-left: var(--space-1-5); }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-3-5); border-radius: var(--ui-radius); border: 1px solid var(--ui-line-2); background: var(--ui-surface); color: var(--ui-ink); font: 600 var(--ui-text-sm) var(--ui-font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: var(--ui-line-strong); background: var(--ui-surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
.btn--primary:hover { background: var(--ui-primary-ink); border-color: var(--ui-primary-ink); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ui-ink-2); }
.btn--ghost:hover { background: var(--ui-fill-strong); border-color: transparent; }
.btn--danger { color: var(--ui-danger); }
.btn--dashed { border-style: dashed; background: transparent; color: var(--ui-ink-2); height: 44px; }
.btn--dashed:hover { border-color: var(--ui-primary); color: var(--ui-primary-ink); background: var(--ui-primary-soft); }
.btn--sm { height: 30px; padding: 0 var(--space-2-5); font-size: var(--ui-text-xs); }
.btn--lg { height: 46px; padding: 0 var(--space-6); font-size: var(--ui-text-lg); }
.btn--block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--ui-radius); border: 0; background: transparent; color: var(--ui-ink-2); cursor: pointer; text-decoration: none; font-size: var(--ui-text-xl); }
.icon-btn:hover { background: var(--ui-fill-strong); color: var(--ui-ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.icon-btn--danger:hover { color: var(--ui-danger); background: var(--ui-danger-soft); }
.input { width: 100%; height: 38px; padding: 0 var(--space-3); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius); background: var(--ui-surface); font: var(--ui-text-md) var(--ui-font); color: var(--ui-ink); transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: var(--space-2) var(--space-3); resize: vertical; line-height: 1.5; min-height: 70px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c7a8c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: var(--space-8); }
.input:focus, .rte__content:focus { outline: none; border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.input:disabled { background: var(--ui-fill); color: var(--ui-muted); }
.input--lg { height: 48px; font-size: var(--ui-text-xl); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: grid; place-items: center; flex: none; white-space: nowrap; padding: 0 var(--space-2-5); border: 1px solid var(--ui-line-2); border-right: 0; border-radius: var(--ui-radius) 0 0 var(--ui-radius); background: var(--ui-fill); color: var(--ui-muted); }
.input-prefix .input { flex: 1; min-width: 0; border-radius: 0 var(--ui-radius) var(--ui-radius) 0; }
.color-input { display: flex; gap: var(--space-2); }
.color-swatch { width: 44px; height: 38px; border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius); padding: 3px; background: var(--ui-surface); cursor: pointer; }
.search { position: relative; display: block; max-width: 360px; flex: 1; }
.search .icon { position: absolute; left: 11px; top: 10px; color: var(--ui-muted); }
.search .input { padding-left: var(--space-10); }
.alert { padding: var(--space-2-5) var(--space-3-5); border-radius: var(--ui-radius); margin-bottom: var(--space-3-5); font-weight: 500; }
.alert--error { background: var(--ui-danger-soft); color: var(--ui-danger-ink); border: 1px solid var(--ui-danger-line); }
.badge { display: inline-flex; align-items: center; gap: var(--space-1-5); height: 22px; padding: 0 var(--space-2); border-radius: var(--ui-radius-pill); font-size: var(--ui-text-2xs); font-weight: 600; text-transform: capitalize; background: var(--ui-fill-strong); color: var(--ui-ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--published { background: var(--ui-success-soft); color: var(--ui-success-ink); }
.badge--draft { background: var(--ui-fill); color: var(--ui-ink-2); }
.badge--changed { background: var(--ui-warning-soft); color: var(--ui-warning-ink); }
.link { font-weight: 600; text-decoration: none; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; box-sizing: border-box; padding: var(--space-4) var(--space-3); color: rgba(255, 255, 255, .86);
  background: linear-gradient(180deg, var(--ui-primary), color-mix(in srgb, var(--ui-primary) 78%, black)); }
.sidebar__brand { display: flex; align-items: center; gap: var(--space-2-5); text-decoration: none; color: #fff; padding: var(--space-1-5) var(--space-2-5) var(--space-4); }
.logo { width: 34px; height: 34px; border-radius: var(--ui-radius); background: linear-gradient(135deg, color-mix(in srgb, var(--ui-primary) 88%, white), var(--ui-primary-ink)); display: grid; place-items: center; color: #fff; }
.sidebar .logo { width: 28px; height: 28px; background: none; color: #fff; }
.sidebar .logo .icon { width: 28px; height: 28px; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar__brand-text strong { font-size: var(--ui-text-md); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__brand-text small { color: rgba(255, 255, 255, .72); font-size: var(--ui-text-xs); }
.sidebar__nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.sidebar__nav a { display: flex; align-items: center; gap: var(--space-2-5); min-height: 34px; padding: 0 var(--space-2-5); border-radius: var(--ui-radius); color: rgba(255, 255, 255, .86); text-decoration: none; font-size: var(--ui-text-sm); font-weight: 500; }
.sidebar__nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar__nav a.is-active { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sidebar__nav a .icon { width: 17px; height: 17px; color: currentColor; opacity: .9; }
.sidebar__group { font-size: var(--ui-text-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .66); padding: var(--space-3-5) var(--space-2-5) var(--space-1-5); }
/* Collapsible groups (<details>; which are closed is remembered in base.html's script) */
.sidebar__section > a + a { margin-top: 2px; }
summary.sidebar__group { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); list-style: none; cursor: pointer; user-select: none; border-radius: var(--ui-radius-sm); transition: color .12s; }
summary.sidebar__group::-webkit-details-marker { display: none; }
summary.sidebar__group:hover { color: #fff; }
summary.sidebar__group:focus-visible, .sidebar__nav a:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.sidebar__chev { flex: none; width: 14px; height: 14px; opacity: .7; transition: transform .15s ease; }
.sidebar__section:not([open]) .sidebar__chev { transform: rotate(-90deg); }
/* Opening and closing slide where the browser can animate it; elsewhere it just toggles. */
.sidebar__nav { interpolate-size: allow-keywords; }
.sidebar__section::details-content { height: 0; overflow: hidden; transition: height .18s ease, content-visibility .18s allow-discrete; }
.sidebar__section[open]::details-content { height: auto; }
@media (prefers-reduced-motion: reduce) { .sidebar__section::details-content, .sidebar__chev { transition: none; } }
/* A page within another (Series in Sermons, Roles in Users), under it while it's open. */
.sidebar__site.is-active { background: rgba(255, 255, 255, .18); color: #fff; }
.sidebar__foot { border-top: 1px solid rgba(255, 255, 255, .16); padding-top: var(--space-2-5); display: grid; gap: 2px; }
.sidebar__site { display: flex; align-items: center; gap: var(--space-2-5); width: 100%; min-height: 34px; padding: 0 var(--space-2-5); border: 0; border-radius: var(--ui-radius); background: none; color: rgba(255, 255, 255, .86); font: 500 var(--ui-text-sm) var(--ui-font); text-align: left; text-decoration: none; cursor: pointer; }
.sidebar__site .icon { width: 17px; height: 17px; color: currentColor; opacity: .9; }
.sidebar__site:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar__site:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.sidebar__user { display: flex; align-items: center; gap: var(--space-2-5); margin-top: var(--space-2); padding: var(--space-2) var(--space-1-5) 0; border-top: 1px solid rgba(255, 255, 255, .16); }
.sidebar__user form { margin: 0 0 0 auto; }
.sidebar__user .icon-btn { color: rgba(255, 255, 255, .78); }
.sidebar__user .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar__user .icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.sidebar__user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar__user-text strong { color: #fff; font-size: var(--ui-text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-text small { color: rgba(255, 255, 255, .72); }
.sidebar .avatar { background: #fff; color: var(--ui-primary); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; font-weight: 700; text-decoration: none; flex: none; }
.main { min-width: 0; }
.page { padding: var(--space-8) var(--space-10) var(--space-16); max-width: 1200px; }
.page__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-5); margin-bottom: var(--space-6); flex-wrap: wrap; }
.page__head h1 { font-size: var(--ui-text-4xl); font-weight: 500; letter-spacing: -.02em; }
.page__head p { margin: var(--space-1-5) 0 0; }
.page__actions { display: flex; gap: var(--space-2); }
.crumb { display: inline-block; color: var(--ui-muted); text-decoration: none; font-weight: 500; margin-bottom: var(--space-2); }
.crumb:hover { color: var(--ui-ink); }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .page { padding: var(--space-6) var(--space-4); } }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3-5); margin-bottom: var(--space-7); }
.dash-card { position: relative; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow); transition: transform .12s, box-shadow .12s; }
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(23,22,31,.05), 0 10px 26px rgba(23,22,31,.09); }
.dash-card__main { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--space-3); padding: var(--space-4); text-decoration: none; color: inherit; }
.dash-card__icon { grid-row: span 2; width: 42px; height: 42px; border-radius: var(--ui-radius-md); background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; }
.dash-card__icon--sm { width: 34px; height: 34px; }
.dash-card__count { font-size: var(--ui-text-3xl); font-weight: 700; line-height: 1.1; }
.dash-card__label { color: var(--ui-muted); font-weight: 500; }
.dash-card__add { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: var(--ui-radius-sm); display: grid; place-items: center; color: var(--ui-muted); }
.dash-card__add:hover { background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.panel { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow); }
.panel__head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-4); border-bottom: 1px solid var(--ui-line); }
.panel__head h2 { font-size: var(--ui-text-lg); }

/* Lists */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2-5); margin-bottom: var(--space-3-5); }
.toolbar .search { min-width: 220px; }
.toolbar__end { position: relative; margin-left: auto; }
/* Filters on the columns shown (src/columns.rs): a pill each, applied when picked. */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.filters:not(:has(*)) { display: none; }
.filter { display: inline-flex; align-items: center; gap: var(--space-1-5); height: 38px; padding: 0 var(--space-2) 0 var(--space-3); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-pill); background: var(--ui-surface); font-size: var(--ui-text-sm); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.filter:hover { border-color: var(--ui-line-strong); }
.filter:focus-within { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.filter > span { color: var(--ui-muted); font-weight: 500; }
.filter select { appearance: none; field-sizing: content; max-width: 180px; padding: 0 var(--space-5) 0 0; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c7a8c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center; color: var(--ui-ink); font: 600 var(--ui-text-sm) var(--ui-font); text-overflow: ellipsis; cursor: pointer; }
.filter select:focus { outline: none; }
.filter.is-on { border-color: var(--ui-primary); background: var(--ui-primary-soft); }
.filter.is-on > span { color: var(--ui-primary-ink); }
.filters__clear { padding: 0 var(--space-1); color: var(--ui-ink-2); font-size: var(--ui-text-sm); font-weight: 500; }
.filters__clear:hover { color: var(--ui-ink); }
/* Picking a list's columns (assets/columns.js). */
.cols-pop { position: absolute; top: calc(100% + var(--space-2)); right: 0; z-index: 30; display: flex; flex-direction: column; width: 280px; max-height: min(70vh, 520px); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-pop); }
.cols-pop.is-busy { cursor: progress; }
.cols-pop__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-bottom: 1px solid var(--ui-line); font-size: var(--ui-text-sm); }
.cols-pop__reset { padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-primary-ink); font: 600 var(--ui-text-xs) var(--ui-font); cursor: pointer; }
.cols-pop__reset:hover { background: var(--ui-primary-soft); }
.cols-pop__reset:disabled { color: var(--ui-muted); background: transparent; cursor: default; }
.cols-pop__list { flex: 1; margin: 0; padding: var(--space-1-5); overflow: auto; list-style: none; }
.cols-pop__item { display: flex; align-items: center; gap: var(--space-1-5); padding: 0 var(--space-2) 0 var(--space-1); border-radius: var(--ui-radius); font-size: var(--ui-text-sm); }
.cols-pop__item:hover { background: var(--ui-surface-2); }
.cols-pop__item label { display: flex; flex: 1; align-items: center; gap: var(--space-2-5); min-height: 34px; cursor: pointer; }
.cols-pop__item input { width: 16px; height: 16px; margin: 0; accent-color: var(--ui-primary); }
.cols-pop__item.is-locked label { color: var(--ui-ink-2); cursor: default; }
.cols-pop__grip { display: grid; place-items: center; width: 20px; color: var(--ui-muted); cursor: grab; }
.cols-pop__grip .icon { width: 14px; height: 14px; }
.cols-pop__item.is-locked .cols-pop__grip { visibility: hidden; }
.cols-pop__item.is-dragging { opacity: .4; }
.cols-pop__item.is-over { box-shadow: inset 0 2px 0 var(--ui-primary); }
.cols-pop__foot { margin: 0; padding: var(--space-2-5) var(--space-4); border-top: 1px solid var(--ui-line); color: var(--ui-muted); font-size: var(--ui-text-xs); }
.cols-pop__foot.is-error { color: var(--ui-danger); }
@media (max-width: 640px) { .cols-pop { position: fixed; top: auto; right: var(--space-4); bottom: var(--space-4); left: var(--space-4); width: auto; } .toolbar__end { margin-left: 0; } }
.table-wrap { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow); overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-muted); text-transform: uppercase; letter-spacing: .05em; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--ui-line); background: var(--ui-surface-2); }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--ui-line); vertical-align: middle; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--ui-surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table__title { font-weight: 600; color: var(--ui-ink); text-decoration: none; }
.table th[aria-sort] { color: var(--ui-ink); }
.th-sort { display: inline-flex; align-items: center; gap: var(--space-1); color: inherit; text-decoration: none; }
.th-sort .icon { width: 12px; height: 12px; opacity: 0; transition: opacity .12s; }
.th-sort:hover { color: var(--ui-ink); }
.th-sort:hover .icon { opacity: .45; }
.th-sort.is-sorted .icon { opacity: 1; }
.table__thumb { display: block; width: 44px; height: 30px; border-radius: var(--ui-radius-sm); object-fit: cover; background: var(--ui-fill); }
.table__date { white-space: nowrap; }
.table__clip { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: var(--space-10); text-align: center; color: var(--ui-muted); }
.pager { display: flex; justify-content: center; align-items: center; gap: var(--space-3-5); margin-top: var(--space-4); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); padding: var(--space-1); border-radius: var(--ui-radius-lg); transition: background .12s, outline-color .12s; outline: 2px dashed transparent; }
.media-grid.is-drag, .modal__card.is-drag { outline: 2px dashed var(--ui-primary); background: var(--ui-primary-soft); }
.media-tile { display: flex; flex-direction: column; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); overflow: hidden; text-decoration: none; color: inherit; cursor: pointer; padding: 0; text-align: left; font: inherit; transition: box-shadow .12s, border-color .12s; }
.media-tile:hover { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.media-tile img, .media-tile video, .media-tile__file { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ui-fill); }
.media-tile__file { display: grid; place-items: center; font-weight: 700; color: var(--ui-muted); }
.media-tile__name { padding: var(--space-2) var(--space-2-5); font-size: var(--ui-text-xs); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-grid--modal { max-height: 60vh; overflow: auto; }
.media-grid > .empty { grid-column: 1 / -1; }

/* Media library: folders (templates/admin/media.html, assets/media.js, src/folders.rs). */
.media-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3-5); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); min-width: 0; }
.crumbs__sep { color: var(--ui-line-strong); font-size: var(--ui-text-md); }
.crumb { display: inline-flex; align-items: center; gap: var(--space-1-5); max-width: 240px; padding: var(--space-1-5) var(--space-2-5); border-radius: var(--ui-radius); color: var(--ui-ink-2); font-size: var(--ui-text-sm); font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px dashed transparent; }
.crumb .icon { width: 15px; height: 15px; flex: none; color: var(--ui-muted); }
.crumb:hover { background: var(--ui-fill); color: var(--ui-ink); }
.crumb.is-current { color: var(--ui-ink); font-weight: 650; }
.crumb.is-drop { border-color: var(--ui-primary); background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.media-bar__search { max-width: 300px; }
.media-note { margin: calc(-1 * var(--space-1-5)) 0 var(--space-3); font-size: var(--ui-text-sm); color: var(--ui-ink-2); }
.media-lib__body { display: flex; flex-direction: column; gap: var(--space-4); min-height: 160px; padding: var(--space-1); border-radius: var(--ui-radius-lg); outline: 2px dashed transparent; transition: background .12s, outline-color .12s; }
.media-lib__body.is-drag { outline-color: var(--ui-primary); background: var(--ui-primary-soft); }
.media-lib__body .media-grid { padding: 0; }
.media-grid--folders { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.media-grid--files:empty { display: none; }
.media-lib .media-tile { position: relative; }
.media-file__open, .media-folder__open { display: flex; flex-direction: column; color: inherit; text-decoration: none; min-width: 0; }
.media-tile__where { display: flex; align-items: center; gap: var(--space-1); margin: calc(-1 * var(--space-1-5)) var(--space-2-5) var(--space-2); font-size: var(--ui-text-2xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile__where .icon { width: 11px; height: 11px; flex: none; }
.media-folder { flex-direction: row; align-items: center; }
.media-folder .media-folder__open { flex: 1; flex-direction: row; align-items: center; gap: var(--space-2-5); padding: var(--space-3) var(--space-2) var(--space-3) var(--space-3); }
.media-folder__icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--ui-radius); background: var(--ui-primary-soft); color: var(--ui-primary); }
.media-folder__icon .icon { width: 20px; height: 20px; }
.media-folder__text { display: flex; flex-direction: column; min-width: 0; }
.media-folder .media-tile__name { padding: 0; font-size: var(--ui-text-sm); font-weight: 600; color: var(--ui-ink); }
.media-folder__what { font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile__more { flex: none; margin-right: var(--space-1-5); color: var(--ui-muted); }
.media-tile__check { position: absolute; top: var(--space-1-5); left: var(--space-1-5); z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--ui-radius-sm); background: var(--ui-surface); box-shadow: var(--ui-shadow); opacity: 0; transition: opacity .12s; cursor: pointer; }
.media-tile__check input { width: 15px; height: 15px; margin: 0; accent-color: var(--ui-primary); cursor: pointer; }
.media-folder .media-tile__check { top: 50%; left: auto; right: var(--space-10); transform: translateY(-50%); box-shadow: none; }
.media-tile:hover .media-tile__check, .media-tile:focus-within .media-tile__check, .media-lib__body.is-selecting .media-tile__check, .media-tile.is-selected .media-tile__check { opacity: 1; }
.media-tile.is-selected { border-color: var(--ui-primary); box-shadow: 0 0 0 2px var(--ui-primary); }
.media-tile.is-dragging { opacity: .45; }
.media-folder.is-drop { border-color: var(--ui-primary); background: var(--ui-primary-soft); box-shadow: 0 0 0 3px var(--ui-ring); }
.media-tile[draggable="true"] { cursor: grab; }
.drag-ghost { position: fixed; top: -100px; left: -100px; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--ui-radius-pill); background: var(--ui-ink); color: #fff; font: 600 var(--ui-text-sm) var(--ui-font); }
.drag-ghost .icon { width: 16px; height: 16px; }
.select-bar { position: sticky; bottom: var(--space-4); z-index: 20; display: flex; align-items: center; gap: var(--space-2-5); width: max-content; max-width: 100%; margin: var(--space-4) auto 0; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--ui-radius-pill); background: var(--ui-ink); color: #fff; box-shadow: var(--ui-shadow-pop); font-size: var(--ui-text-sm); }
.select-bar[hidden] { display: none; }
.select-bar .btn--ghost { color: #fff; }
.select-bar .btn--ghost:hover { background: rgba(255, 255, 255, .12); }
.folder-menu { position: absolute; z-index: 60; display: flex; flex-direction: column; min-width: 180px; padding: var(--space-1-5); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-pop); }
.folder-menu .menu__item { display: flex; align-items: center; gap: var(--space-2); border: 0; background: transparent; text-align: left; padding: var(--space-1-5) var(--space-2-5); border-radius: var(--ui-radius-sm); font: var(--ui-text-sm) var(--ui-font); color: var(--ui-ink); cursor: pointer; }
.folder-menu .menu__item .icon { width: 15px; height: 15px; color: var(--ui-muted); }
.folder-menu .menu__item:hover, .folder-menu .menu__item:focus-visible { background: var(--ui-fill); outline: none; }
.folder-menu .menu__item--danger, .folder-menu .menu__item--danger .icon { color: var(--ui-danger-ink); }
.folder-menu .menu__item--danger:hover { background: var(--ui-danger-soft); }
@media (hover: none) { .media-tile__check { opacity: 1; } }
/* Folders in the image picker (admin.js pickMedia). */
.picker-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); margin: 0 0 var(--space-2-5); }
.picker-crumbs button { border: 0; background: transparent; font: inherit; cursor: pointer; }
.media-grid--modal .media-folder { cursor: pointer; padding: var(--space-3); gap: var(--space-2-5); text-align: left; }
/* A file being uploaded (assets/uploads.js): its own preview, dimmed, with progress over it */
.media-tile--pending { cursor: default; }
.media-tile--pending:hover { border-color: var(--ui-line); box-shadow: none; }
.media-tile__media { position: relative; }
.media-tile--pending img { display: block; filter: saturate(.6); opacity: .55; }
.media-tile--pending .media-tile__file { opacity: .55; }
.media-tile__progress { position: absolute; inset: 0; display: grid; place-items: center; }
.media-tile__pct { padding: var(--space-1) var(--space-2-5); border-radius: var(--ui-radius-pill); background: var(--ui-surface); box-shadow: var(--ui-shadow); font-size: var(--ui-text-xs); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ui-ink); }
.media-tile__meter { position: absolute; left: var(--space-2); right: var(--space-2); bottom: var(--space-2); height: 4px; border-radius: var(--ui-radius-pill); background: rgba(255, 255, 255, .7); overflow: hidden; }
.media-tile__meter i, .uploads__bar i, .uploads__meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ui-primary); transition: width .2s linear; }
.media-tile--pending[data-status="processing"] .media-tile__meter i, .uploads__row[data-status="processing"] .uploads__meter i { width: 40% !important; animation: indeterminate 1.1s ease-in-out infinite; }
.media-tile--pending[data-status="failed"] { border-color: var(--ui-danger-line); }
.media-tile--pending[data-status="failed"] .media-tile__pct { background: var(--ui-danger-soft); color: var(--ui-danger-ink); }
.media-tile--pending[data-status="failed"] .media-tile__meter { display: none; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Auth */
.auth-page { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at 30% 10%, color-mix(in srgb, var(--ui-primary) 25%, var(--ui-side)), var(--ui-side) 60%); }
.auth-card { width: min(420px, calc(100vw - 32px)); background: var(--ui-surface); border-radius: var(--ui-radius-xl); padding: var(--space-10) var(--space-8); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card__logo { width: 48px; height: 48px; border-radius: var(--ui-radius-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--ui-primary) 88%, white), var(--ui-primary-ink)); color: #fff; display: grid; place-items: center; margin-bottom: var(--space-4); }
.auth-card__logo .icon { width: 26px; height: 26px; }
.auth-card h1 { font-size: var(--ui-text-3xl); margin-bottom: var(--space-1); }
.auth-card .muted { margin: 0 0 var(--space-5); }
.stack { display: grid; gap: var(--space-3-5); }

/* Fields */
.fields { display: grid; gap: var(--space-4); }
.field { min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: var(--space-3-5); }
.field-row > .field { flex: 1 1 calc(var(--w, 100%) - 14px); min-width: 140px; }
.field__label { display: flex; align-items: center; gap: var(--space-1); font-weight: 600; font-size: var(--ui-text-sm); color: var(--ui-ink); margin-bottom: var(--space-1-5); }
.field__label--row { justify-content: space-between; }
.field__desc { color: var(--ui-muted); font-size: var(--ui-text-xs); margin-top: var(--space-1-5); }
.field__error { color: var(--ui-danger); font-size: var(--ui-text-xs); font-weight: 500; margin-top: var(--space-1-5); }
.has-error .input, .has-error .rte { border-color: var(--ui-danger); }
.req { color: var(--ui-danger); }
.group { border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); padding: var(--space-3-5) var(--space-4) var(--space-4); margin: 0; background: var(--ui-surface-2); }
.group legend { font-weight: 700; font-size: var(--ui-text-sm); padding: 0 var(--space-1-5); }
.group > .fields { gap: var(--space-3-5); }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-2-5); cursor: pointer; font-weight: 600; font-size: var(--ui-text-sm); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 36px; height: 20px; border-radius: var(--ui-radius-pill); background: var(--ui-line-2); position: relative; transition: background .15s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ui-surface); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--ui-primary); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--ui-ring); }
.checks { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* A relationship: the chosen document opens from beside it. */
.rel__row { display: flex; align-items: center; gap: var(--space-3); }
.rel__row .input { flex: 1; min-width: 0; }
.rel__link:empty { display: none; }
.rel__open { flex: none; white-space: nowrap; font-weight: 600; color: var(--ui-primary); text-decoration: none; }
.rel__open:hover { text-decoration: underline; }
.rel--static { display: flex; align-items: center; min-height: 38px; padding: 0 var(--space-3); border: 1px dashed var(--ui-line-2); border-radius: var(--ui-radius); background: var(--ui-fill); }
.check { display: inline-flex; align-items: center; gap: var(--space-1-5); padding: var(--space-1-5) var(--space-2-5); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius); background: var(--ui-surface); cursor: pointer; }

/* Rich text */
.rte { border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius); background: var(--ui-surface); }
.rte .kte-bar { border-radius: var(--ui-radius) var(--ui-radius) 0 0; }
.rte__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: var(--space-1-5); border-bottom: 1px solid var(--ui-line); background: var(--ui-surface-2); }
.rte__btn { width: 30px; height: 28px; border: 0; background: transparent; border-radius: var(--ui-radius-sm); cursor: pointer; color: var(--ui-ink-2); display: grid; place-items: center; font: 700 var(--ui-text-xs) var(--ui-font); }
.rte__btn:hover { background: var(--ui-fill-strong); color: var(--ui-ink); }
.rte__btn .icon { width: 16px; height: 16px; }
.rte__content { min-height: 120px; max-height: 480px; overflow: auto; padding: var(--space-2-5) var(--space-3-5); border: 0; border-radius: 0; }
.prose-admin { font-size: var(--ui-text-md); line-height: 1.6; }
.prose-admin > :first-child { margin-top: 0; }
.prose-admin p { margin: 0 0 .7em; }
.prose-admin h2 { font-size: var(--ui-text-2xl); margin: 1em 0 .4em; }
.prose-admin h3 { font-size: var(--ui-text-xl); margin: 1em 0 .4em; }
.prose-admin blockquote { margin: .8em 0; padding-left: var(--space-3); border-left: 3px solid var(--ui-primary); color: var(--ui-ink-2); }
.prose-admin ul, .prose-admin ol { padding-left: 1.3em; }

/* Uploads */
.upload__empty { width: 100%; display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-3-5); border: 1px dashed var(--ui-line-2); border-radius: var(--ui-radius-md); background: var(--ui-surface-2); color: var(--ui-ink-2); cursor: pointer; font: 500 var(--ui-text-sm) var(--ui-font); }
.upload__empty:hover { border-color: var(--ui-primary); background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.upload__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-md); background: var(--ui-surface); }
.upload__item img, .upload__item video, .upload__file { width: 64px; height: 48px; object-fit: cover; border-radius: var(--ui-radius-sm); background: var(--ui-fill); display: grid; place-items: center; font-weight: 700; font-size: var(--ui-text-2xs); color: var(--ui-muted); flex: none; }
.upload__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.upload__meta strong, .upload__meta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload__actions { display: flex; gap: var(--space-1); align-items: center; }
.upload-panel { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); margin-bottom: var(--space-4); }
.upload-panel img, .upload-panel__video { max-height: 320px; border-radius: var(--ui-radius); max-width: 100%; }
.upload__warn { margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--ui-radius); background: var(--ui-warning-soft); color: var(--ui-warning-ink); font-size: var(--ui-text-sm); }
.upload-panel__pending { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.upload-panel__progress { width: min(360px, 100%); display: flex; flex-direction: column; gap: var(--space-1-5); font-size: var(--ui-text-xs); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.upload-panel__progress .uploads__meter { margin: 0; }
.upload-panel__progress[data-status="processing"] .uploads__meter i { width: 40% !important; animation: indeterminate 1.1s ease-in-out infinite; }

/* Array & block rows */
.rows { display: grid; gap: var(--space-2); margin-bottom: var(--space-2-5); }
.row-card { background: var(--ui-surface); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-md); transition: box-shadow .12s, border-color .12s; }
.row-card.is-open { box-shadow: var(--ui-shadow); }
.row-card.is-dragging { opacity: .45; }
.row-card.drop-before { box-shadow: 0 -3px 0 var(--ui-primary); }
.row-card.drop-after { box-shadow: 0 3px 0 var(--ui-primary); }
.row-card__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1-5) var(--space-2) var(--space-1-5) var(--space-1); cursor: pointer; user-select: none; min-height: 44px; }
.row-card__title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card__title small { font-weight: 400; color: var(--ui-muted); font-size: var(--ui-text-xs); overflow: hidden; text-overflow: ellipsis; }
.row-card__actions { display: flex; gap: 0; opacity: 0; transition: opacity .12s; }
.row-card__head:hover .row-card__actions, .row-card.is-open .row-card__actions { opacity: 1; }
.row-card__actions .icon-btn { width: 28px; height: 28px; }
.row-card__actions .icon { width: 16px; height: 16px; }
.row-card__body { padding: var(--space-1-5) var(--space-3-5) var(--space-4); border-top: 1px solid var(--ui-line); }
.row-card__body > .fields { padding-top: var(--space-2-5); gap: var(--space-3-5); }
.grip { color: var(--ui-line-strong); cursor: grab; display: grid; place-items: center; width: 22px; }
.grip:active { cursor: grabbing; }
.chev { color: var(--ui-muted); display: grid; place-items: center; }
.chev .icon { width: 16px; height: 16px; }
.block-card__icon { width: 30px; height: 30px; border-radius: var(--ui-radius); background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; flex: none; }
.block-card__icon .icon { width: 17px; height: 17px; }
.block-card.is-selected { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.blocks-empty { text-align: center; padding: var(--space-7) var(--space-4); border-radius: var(--ui-radius-md); background: var(--ui-surface-2); border: 1px dashed var(--ui-line-2); margin-bottom: var(--space-2-5); }
.blocks-empty p { margin: var(--space-1) 0 0; }
.add-row { margin-top: 2px; }

/* Standard edit view */
.edit { min-height: 100vh; }
.edit__head { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); padding: var(--space-6) var(--space-10) var(--space-4); background: color-mix(in srgb, var(--ui-bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ui-line); flex-wrap: wrap; }
.edit__title { display: flex; align-items: center; gap: var(--space-3); }
.edit__title h1 { font-size: var(--ui-text-3xl); font-weight: 500; letter-spacing: -.02em; }
.edit__actions { display: flex; align-items: center; gap: var(--space-2); }
.edit__body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-7); padding: var(--space-7) var(--space-10) var(--space-20); max-width: 1240px; }
.edit__main { min-width: 0; }
.edit__main > .fields { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); padding: var(--space-6); box-shadow: var(--ui-shadow); }
.edit__main > .field { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); padding: var(--space-4) var(--space-6); margin-top: var(--space-4); }
.edit__side { display: flex; flex-direction: column; gap: var(--space-4); }
.side-card { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); padding: var(--space-4); box-shadow: var(--ui-shadow); }
@media (max-width: 1000px) { .edit__body { grid-template-columns: 1fr; padding: var(--space-5); } .edit__head { padding: var(--space-4) var(--space-5) var(--space-3-5); } }
.doc-meta { display: grid; gap: var(--space-1-5); padding: var(--space-3-5) var(--space-4); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); font-size: var(--ui-text-sm); }
.doc-meta > div { display: flex; justify-content: space-between; }
.doc-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.save-state { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ui-muted); font-size: var(--ui-text-xs); font-weight: 500; margin-right: var(--space-1-5); white-space: nowrap; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-success); }
.save-state--dirty i { background: var(--ui-warning); }
.save-state--saving i { background: var(--ui-primary); animation: pulse 1s infinite; }
.save-state--error i { background: var(--ui-danger); }
.save-state--error { color: var(--ui-danger); }
@keyframes pulse { 50% { opacity: .3; } }

/* Live editor */
body.is-live { overflow: hidden; }
.live-app { display: grid; grid-template-rows: 56px 1fr; height: 100vh; }
.live__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-3); padding: 0 var(--space-3); background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); z-index: 5; }
.live__left, .live__right { display: flex; align-items: center; gap: var(--space-1-5); min-width: 0; }
.live__right { justify-content: flex-end; }
.live__title { display: flex; align-items: center; gap: var(--space-2-5); min-width: 0; margin-left: var(--space-1); }
.live__title strong { font-size: var(--ui-text-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live__center { display: flex; gap: var(--space-2); }
.seg { display: flex; background: var(--ui-fill); border-radius: var(--ui-radius); padding: 3px; gap: 2px; }
.seg__btn { width: 34px; height: 28px; border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-ink-2); display: grid; place-items: center; cursor: pointer; }
.seg__btn:hover { color: var(--ui-ink); }
.seg__btn.is-active { background: var(--ui-surface); color: var(--ui-primary-ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg__btn:disabled { opacity: .35; cursor: default; }
.live__body { display: grid; grid-template-columns: 400px 1fr; min-height: 0; }
.panel-hidden .live__body { grid-template-columns: 0 1fr; }
.panel-hidden .live__panel { visibility: hidden; }
.live__panel { display: flex; flex-direction: column; min-height: 0; background: var(--ui-surface); border-right: 1px solid var(--ui-line); }
.tabs { display: flex; gap: var(--space-1); padding: var(--space-2-5) var(--space-3-5) 0; border-bottom: 1px solid var(--ui-line); }
.tab { border: 0; background: transparent; padding: var(--space-2) var(--space-3); font: 600 var(--ui-text-sm) var(--ui-font); color: var(--ui-muted); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.tab.is-active { color: var(--ui-ink); border-bottom-color: var(--ui-primary); }
.tab:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: -2px; border-radius: var(--ui-radius-sm); }
.tab.has-error::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: var(--space-1-5); border-radius: 50%; background: var(--ui-danger); vertical-align: 2px; }
/* A field with a tab of its own (a page's Hero): its description, then its fields. */
.tab-panel__intro { margin: 0 0 var(--space-4); color: var(--ui-muted); font-size: var(--ui-text-sm); line-height: 1.45; }
.live__form { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-4) var(--space-16); }
.live__form .doc-meta { margin-top: var(--space-4); }
.live__form .doc-tools { margin-top: var(--space-3); }
.canvas { position: relative; background: var(--ui-fill-strong); background-image: radial-gradient(var(--ui-line-2) 1px, transparent 1px); background-size: 18px 18px; overflow: auto; display: flex; justify-content: center; padding: var(--space-4); min-height: 0; }
.canvas__frame { width: 100%; height: 100%; transition: width .25s ease; border-radius: var(--ui-radius-md); overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.06), 0 18px 50px rgba(30, 25, 60, .18); background: var(--ui-surface); }
.canvas__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.canvas__frame.device-tablet { width: 834px; }
.canvas__frame.device-mobile { width: 390px; }
@media (max-width: 1100px) { .live__body { grid-template-columns: 340px 1fr; } .live__center .seg:first-child { display: none; } }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(20, 18, 34, .45); display: grid; place-items: center; padding: var(--space-5); animation: fade .12s ease; }
.modal__card { width: min(520px, 100%); max-height: calc(100vh - 40px); background: var(--ui-surface); border-radius: var(--ui-radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; animation: pop .16s ease; }
.modal__card--wide { width: min(880px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-4); border-bottom: 1px solid var(--ui-line); gap: var(--space-3); }
.modal__head h2 { font-size: var(--ui-text-xl); }
.modal__body { padding: var(--space-4) var(--space-4) var(--space-5); overflow: auto; }
.modal__tools { display: flex; gap: var(--space-2-5); align-items: center; justify-content: space-between; margin-bottom: var(--space-3-5); }
.dropzone-hint { font-size: var(--ui-text-xs); margin: calc(-1 * var(--space-1-5)) 0 var(--space-3); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.block-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-2-5); }
.block-option { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--space-3); row-gap: 2px; text-align: left; padding: var(--space-3-5); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-md); background: var(--ui-surface); cursor: pointer; font: inherit; color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; }
.block-option:hover, .block-option:focus-visible { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); transform: translateY(-1px); outline: none; }
.block-option__icon { grid-row: span 2; width: 38px; height: 38px; border-radius: var(--ui-radius); background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; }
.block-option small { color: var(--ui-muted); font-size: var(--ui-text-xs); line-height: 1.35; }
/* The "Add" dialog's groups (sections, website content, layout…) */
.block-groups { display: flex; flex-direction: column; gap: var(--space-5); }
.block-group__title { margin: 0 0 var(--space-2-5); font-size: var(--ui-text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
/* What's inside a block (a section's elements): a lighter, tighter list */
.row-card__body .field--blocks .rows--blocks { gap: var(--space-1-5); }
.row-card__body .field--blocks .block-card { box-shadow: none; }
.row-card__body .field--blocks .block-card__icon { width: 24px; height: 24px; }
.row-card__body .field--blocks .block-card__icon .icon { width: 14px; height: 14px; }

/* Toasts */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: var(--space-2); justify-items: center; }
.toast { display: flex; align-items: center; gap: var(--space-3-5); background: var(--ui-side); color: #fff; padding: var(--space-2-5) var(--space-4); border-radius: var(--ui-radius-md); box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 500; animation: pop .16s ease; transition: opacity .3s, transform .3s; }
.toast--success { background: var(--ui-success-ink); }
.toast--error { background: var(--ui-danger-ink); }
.toast.is-out { opacity: 0; transform: translateY(6px); }
.toast__action { background: rgba(255,255,255,.15); border: 0; color: #fff; padding: var(--space-1-5) var(--space-2-5); border-radius: var(--ui-radius-sm); font-weight: 600; cursor: pointer; }

/* Upload tray (assets/uploads.js): every file being uploaded, bottom right, above dialogs */
.uploads { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 150; width: min(380px, calc(100vw - 2 * var(--space-4))); max-height: min(460px, calc(100vh - 2 * var(--space-5))); display: flex; flex-direction: column; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-pop); overflow: hidden; animation: pop .16s ease; }
.uploads__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-2) var(--space-2-5) var(--space-4); }
.uploads__heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uploads__title { font-size: var(--ui-text-md); font-weight: 600; }
.uploads.has-failed:not(.is-active) .uploads__title { color: var(--ui-danger-ink); }
.uploads__sub { font-size: var(--ui-text-xs); color: var(--ui-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploads__tools { display: flex; gap: 2px; }
.uploads .icon-btn { width: 28px; height: 28px; font-size: var(--ui-text-md); color: var(--ui-muted); }
.uploads .icon-btn:hover { color: var(--ui-ink); }
.uploads .icon-btn[hidden] { display: none; }
.uploads.is-min .uploads__tools .icon-btn:first-child svg { transform: rotate(180deg); }
.uploads__bar { height: 3px; background: var(--ui-fill); flex: none; }
.uploads__bar i { border-radius: 0; }
.uploads:not(.is-active) .uploads__bar i { background: var(--ui-success); }
.uploads.all-failed .uploads__bar i { background: var(--ui-danger); }
.uploads__list { list-style: none; margin: 0; padding: var(--space-1) 0; overflow: auto; overscroll-behavior: contain; }
.uploads.is-min .uploads__list, .uploads.is-min .uploads__foot { display: none; }
.uploads__row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); }
.uploads__row + .uploads__row { border-top: 1px solid var(--ui-line); }
.uploads__thumb { flex: none; width: 40px; height: 40px; border-radius: var(--ui-radius-sm); object-fit: cover; background: var(--ui-fill); }
.uploads__thumb--file { display: grid; place-items: center; font-size: var(--ui-text-2xs); font-weight: 700; color: var(--ui-muted); letter-spacing: .02em; }
.uploads__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uploads__name { font-size: var(--ui-text-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploads__status { font-size: var(--ui-text-xs); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.uploads__row[data-status="failed"] .uploads__status { color: var(--ui-danger-ink); line-height: 1.4; }
.uploads__row[data-status="done"] .uploads__status { color: var(--ui-success-ink); }
.uploads__row[data-status="canceled"] .uploads__name, .uploads__row[data-status="canceled"] .uploads__thumb { opacity: .5; }
.uploads__meter { height: 4px; margin-top: var(--space-1); border-radius: var(--ui-radius-pill); background: var(--ui-fill); overflow: hidden; }
.uploads__row:not([data-status="uploading"]):not([data-status="processing"]) .uploads__meter { display: none; }
.uploads__actions { flex: none; display: flex; align-items: center; gap: var(--space-1); }
.uploads__ok { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ui-success-soft); color: var(--ui-success-ink); font-size: var(--ui-text-xs); margin-right: var(--space-1-5); }
.uploads__view, .uploads__retry, .uploads__cancel { border: 0; background: none; padding: var(--space-1) var(--space-1-5); border-radius: var(--ui-radius-sm); font: inherit; font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-primary-ink); text-decoration: none; cursor: pointer; }
.uploads__view:hover, .uploads__retry:hover, .uploads__cancel:hover { background: var(--ui-primary-soft); }
.uploads__foot { display: flex; justify-content: flex-end; padding: var(--space-1-5) var(--space-2-5); border-top: 1px solid var(--ui-line); background: var(--ui-surface-2); }
.uploads__foot[hidden] { display: none; }
.uploads__cancel { color: var(--ui-danger-ink); }
.uploads__cancel:hover { background: var(--ui-danger-soft); }
.uploads__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) { .uploads { right: var(--space-2); left: var(--space-2); bottom: var(--space-2); width: auto; } }
@media (prefers-reduced-motion: reduce) { .uploads, .media-tile__meter i, .uploads__bar i, .uploads__meter i { animation: none; transition: none; } }

/* Quick create */
.quick { min-height: 100vh; display: grid; place-items: start center; padding: var(--space-16) var(--space-5); }
.quick__card { width: min(720px, 100%); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-xl); padding: var(--space-8); box-shadow: var(--ui-shadow); display: grid; gap: var(--space-4); }
.quick__card h1 { font-size: var(--ui-text-4xl); }
.quick__card p { margin: calc(-1 * var(--space-2)) 0 var(--space-1); }
.quick__card .btn--lg { justify-self: start; }
.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.template { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-lg); padding: var(--space-2-5); background: var(--ui-surface); cursor: pointer; font: inherit; color: inherit; }
.template.is-active { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.template small { color: var(--ui-muted); }
.template__thumb { display: flex; flex-direction: column; gap: 4px; height: 110px; padding: 8px; border-radius: 8px; background: #f4f3f9; margin-bottom: 6px; overflow: hidden; }
.template__thumb i { display: block; border-radius: 4px; background: #dcd9ea; height: 14px; flex: none; }
.template__thumb .t-hero { height: 44px; background: linear-gradient(135deg, #7d6cf0, #a99ff5); }
.template__thumb .t-cards { height: 26px; background: repeating-linear-gradient(90deg, #dcd9ea 0 30%, transparent 30% 35%); }
.template__thumb .t-cta { background: #c9c3f5; }
.template__thumb .t-content { height: 30px; background: repeating-linear-gradient(180deg, #dcd9ea 0 4px, transparent 4px 8px); }
.template__thumb .t-blank { height: 100%; background: transparent; border: 2px dashed #d4d1e4; }
.template__thumb .t-hero--high { height: 58px; } .template__thumb .t-hero--medium { height: 38px; } .template__thumb .t-hero--low { height: 22px; }

/* Pictured choices (selects with appearance "tiles"), e.g. a page hero's size */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--space-2); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: var(--ui-line-strong); }
.tile.is-active { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:focus-visible) { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
.tile strong { font-size: var(--ui-text-sm); line-height: 1.3; }
.tile small { font-size: var(--ui-text-xs); color: var(--ui-muted); line-height: 1.35; }
.tile__pic { display: flex; flex-direction: column; gap: 3px; height: 72px; padding: var(--space-1-5); border-radius: var(--ui-radius-sm); background: var(--ui-fill); margin-bottom: var(--space-1-5); overflow: hidden; }
.tile__pic i { display: block; flex: none; border-radius: 2px; background: var(--ui-line-2); }
.tile__bar { height: 5px; }
.tile__line { height: 4px; width: 80%; }
.tile__line--short { width: 55%; }
.tile .tile__hero { background: linear-gradient(135deg, var(--ui-primary), color-mix(in srgb, var(--ui-primary) 50%, var(--ui-surface))); }
.tile.is-active .tile__pic { background: var(--ui-primary-soft); }
.tiles--type .tile[data-value="high"] .tile__hero { height: 76%; }
.tiles--type .tile[data-value="medium"] .tile__hero { height: 46%; }
.tiles--type .tile[data-value="low"] .tile__hero { height: 28%; }
/* A Grid block's layouts: the four bars become its cells. */
.tiles--layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles--layout .tile__pic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; gap: 3px; }
.tiles--layout .tile__pic i { width: auto; height: auto; background: var(--ui-line-2); }
.tiles--layout .tile__pic i:first-child { background: color-mix(in srgb, var(--ui-primary) 55%, var(--ui-surface)); }
.tiles--layout .tile[data-value="equal"] .tile__pic { grid-template-rows: 1fr; }
.tiles--layout .tile[data-value="equal"] .tile__pic i:nth-child(4) { display: none; }
.tiles--layout .tile[data-value="wideFirst"] .tile__pic { grid-template-columns: 2fr 1fr; }
.tiles--layout .tile[data-value="wideLast"] .tile__pic { grid-template-columns: 1fr 2fr; }
.tiles--layout .tile[data-value="feature"] .tile__pic { grid-template-columns: 2fr 1fr; }
.tiles--layout .tile[data-value="feature"] .tile__pic i:first-child { grid-row: span 2; }
.tiles--layout .tile[data-value="feature"] .tile__pic i:nth-child(4) { display: none; }
@media (max-width: 640px) { .templates { grid-template-columns: 1fr; } }
/* Grid children must be allowed to shrink so long block summaries ellipsize. */
.fields > *, .rows > *, .field-row > * { min-width: 0; }
.live__form { overflow-x: hidden; }

/* Platform admin & invites */
.platform-bar { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) var(--space-6); background: var(--ui-side); color: var(--ui-side-ink); }
.platform-bar__brand { display: flex; align-items: center; gap: var(--space-2-5); color: #fff; text-decoration: none; }
.platform-bar__right { display: flex; align-items: center; gap: var(--space-3); }
.platform-bar__right form { margin: 0; }
.platform-bar .btn--ghost { color: var(--ui-side-ink); }
.platform-bar .btn--ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
@media (max-width: 640px) {
  .platform-bar { padding: var(--space-3) var(--space-4); gap: var(--space-2); }
  .platform-bar__brand > .muted, .platform-bar__right > .muted { display: none; }
  .platform-bar__right { gap: var(--space-1); }
}
.platform .page { margin: 0 auto; }
.page--narrow { max-width: 760px; }
.platform-form, .invite-form { display: grid; gap: var(--space-4); padding: var(--space-6); margin-bottom: var(--space-4); }
.panel__title { font-weight: 700; font-size: var(--ui-text-lg); }
.panel--danger { border-color: var(--ui-danger-line); }
.btn--danger-solid { background: var(--ui-danger); border-color: var(--ui-danger); color: #fff; }
.btn--danger-solid:hover { background: var(--ui-danger-ink); border-color: var(--ui-danger-ink); }
.alert--success { background: var(--ui-success-soft); color: var(--ui-success-ink); border: 1px solid var(--ui-success-line); }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix .input { border-radius: var(--ui-radius) 0 0 var(--ui-radius); }
.input-suffix span { display: grid; place-items: center; padding: 0 var(--space-3); border: 1px solid var(--ui-line-2); border-left: 0; border-radius: 0 var(--ui-radius) var(--ui-radius) 0; background: var(--ui-fill); color: var(--ui-muted); white-space: nowrap; }
.copy-row { display: flex; gap: var(--space-2); }
.copy-row .input { flex: 1; }
.invite-result__body { display: grid; gap: var(--space-3); padding: var(--space-4); }
code { background: var(--ui-fill-strong); padding: 1px var(--space-1-5); border-radius: var(--ui-radius-xs); font-size: var(--ui-text-xs); }

/* Theme gallery */
.design-panel .live__form { padding: var(--space-4) var(--space-4) var(--space-16); }
.design-h { font-size: var(--ui-text-sm); text-transform: uppercase; letter-spacing: .08em; color: var(--ui-muted); margin: var(--space-1-5) 0 var(--space-3); }
.design-h:not(:first-child) { margin-top: var(--space-6); }
.design-desc { color: var(--ui-ink-2); margin: var(--space-3) 0 0; font-size: var(--ui-text-sm); }
.design-page { width: auto; height: 34px; font-size: var(--ui-text-sm); }
.theme-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2-5); }
.theme-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-lg); background: var(--ui-surface); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .12s, box-shadow .12s; }
.theme-card:hover { border-color: var(--ui-line-strong); }
.theme-card.is-active { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.theme-card__meta { display: flex; flex-direction: column; padding: 0 2px 2px; }
.theme-card__meta strong { display: flex; align-items: center; gap: var(--space-1-5); font-size: var(--ui-text-sm); }
.theme-card__meta small { color: var(--ui-muted); font-size: var(--ui-text-2xs); }
.design-field { margin-bottom: var(--space-4); }
.font-list { display: grid; gap: var(--space-1-5); }
.font-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: var(--space-2) var(--space-3); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius); background: var(--ui-surface); cursor: pointer; text-align: left; color: var(--ui-ink); }
.font-opt span { font-size: var(--ui-text-2xl); line-height: 1.2; }
.font-opt small { color: var(--ui-muted); font-size: var(--ui-text-2xs); }
.font-opt:hover { border-color: var(--ui-line-strong); }
.font-opt.is-active { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.seg--wide { width: 100%; }
.seg--wide .seg__btn { flex: 1; width: auto; height: 34px; display: flex; align-items: center; justify-content: center; gap: var(--space-2); font: 600 var(--ui-text-xs) var(--ui-font); }
.corner-demo { width: 16px; height: 12px; border: 2px solid currentColor; display: inline-block; }

/* Theme thumbnails */
.tthumb { --r: 6px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; gap: 5px; padding: 6px; font-family: var(--hf); border: 1px solid rgba(0,0,0,.06); }
.tthumb__bar { display: flex; align-items: center; gap: 4px; height: 10px; }
.tthumb__bar i { width: 9px; height: 9px; border-radius: 3px; background: var(--p); }
.tthumb__bar b { width: 12px; height: 3px; border-radius: 2px; background: var(--ink); opacity: .35; }
.tthumb__bar span { margin-left: auto; width: 18px; height: 7px; border-radius: 4px; background: var(--p); }
.tthumb__hero { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--r); background: linear-gradient(135deg, var(--p), color-mix(in srgb, var(--p) 45%, #120d1f)); color: #fff; }
.tthumb__txt { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tthumb__txt strong { font-size: 13px; font-weight: 700; line-height: 1; }
.tthumb__txt em { width: 46px; height: 3px; background: rgba(255,255,255,.6); border-radius: 2px; }
.tthumb__txt u { width: 22px; height: 6px; background: var(--a); border-radius: 3px; }
.tthumb__img { display: none; }
.tthumb__cards { display: flex; gap: 4px; height: 16px; }
.tthumb__cards i { flex: 1; background: var(--sf); border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.tthumb--classic .tthumb__bar { justify-content: center; } .tthumb--classic .tthumb__bar span { display: none; }
.tthumb--classic .tthumb__hero { border-radius: 0; outline: 1px solid rgba(255,255,255,.5); outline-offset: -5px; }
.tthumb--classic .tthumb__cards i { border-radius: 0; }
.tthumb--modern .tthumb__hero { background: var(--bg); color: var(--ink); justify-content: space-between; padding: 0 4px; gap: 6px; }
.tthumb--modern .tthumb__txt { align-items: flex-start; }
.tthumb--modern .tthumb__txt strong { font-size: 15px; font-weight: 800; letter-spacing: -0.04em; }
.tthumb--modern .tthumb__txt em { background: var(--ink); opacity: .25; }
.tthumb--modern .tthumb__img { display: block; width: 42%; height: 88%; border-radius: 6px; background: linear-gradient(160deg, var(--p), var(--a)); }
.tthumb--bold { color: #fff; }
.tthumb--bold .tthumb__bar b { background: #fff; }
.tthumb--bold .tthumb__bar span { background: var(--a); border-radius: 0; }
.tthumb--bold .tthumb__hero { border-radius: 0; align-items: flex-end; justify-content: flex-start; padding: 6px; background: radial-gradient(circle at 80% 10%, var(--p), transparent 70%), #000; }
.tthumb--bold .tthumb__txt { align-items: flex-start; }
.tthumb--bold .tthumb__txt strong { font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; }
.tthumb--bold .tthumb__txt u { border-radius: 0; }
.tthumb--bold .tthumb__cards i { border-radius: 0; box-shadow: none; background: var(--sf); }
.tthumb--sanctuary .tthumb__hero { background: var(--bg); color: var(--ink); justify-content: space-between; padding: 0 6px; }
.tthumb--sanctuary .tthumb__txt { align-items: flex-start; }
.tthumb--sanctuary .tthumb__txt strong { font-weight: 500; font-size: 14px; }
.tthumb--sanctuary .tthumb__txt em { background: var(--a); height: 1px; width: 24px; }
.tthumb--sanctuary .tthumb__txt u { background: var(--p); border-radius: 1px; }
.tthumb--sanctuary .tthumb__img { display: block; width: 34%; height: 92%; border-radius: 999px 999px 3px 3px; background: linear-gradient(170deg, var(--p), var(--a)); outline: 1px solid var(--a); outline-offset: 2px; }
.tthumb--warm .tthumb__hero { border-radius: 8px; }
.tthumb--warm .tthumb__cards i { border-radius: 5px; }

/* Platform: starting theme picker */
.theme-pick { border: 0; padding: 0; margin: 0; }
.theme-pick__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--space-2-5); margin-top: var(--space-1-5); }
.theme-pick__opt { position: relative; }
.theme-pick__opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-pick__card { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2); border: 1.5px solid var(--ui-line); border-radius: var(--ui-radius-md); cursor: pointer; background: var(--ui-surface); transition: border-color .15s, box-shadow .15s; }
.theme-pick__card small { color: var(--ui-muted); font-size: var(--ui-text-2xs); line-height: 1.3; }
.theme-pick__swatch { position: relative; display: flex; gap: var(--space-1); align-items: flex-start; height: 54px; border-radius: var(--ui-radius-sm); padding: var(--space-2); margin-bottom: var(--space-1-5); border: 1px solid rgba(0,0,0,.06); }
.theme-pick__swatch i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.theme-pick__swatch b { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 14px; border-radius: 3px; opacity: .9; }
.theme-pick__opt input:checked + .theme-pick__card { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-primary-soft); }
.theme-pick__opt input:focus-visible + .theme-pick__card { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
.tthumb--metro .tthumb__bar span { width: 20px; border-radius: 6px; }
.tthumb--metro .tthumb__hero { border-radius: 5px; align-items: flex-end; justify-content: flex-start; padding: 6px; background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,.1)), linear-gradient(140deg, #3a3a3e, #7d6a58); }
.tthumb--metro .tthumb__txt { align-items: flex-start; }
.tthumb--metro .tthumb__txt strong { font-size: 15px; font-weight: 800; letter-spacing: -0.07em; }
.tthumb--metro .tthumb__txt u { width: 24px; background: var(--p); border-radius: 6px; }
.tthumb--metro .tthumb__cards i { background: var(--a); box-shadow: none; border-radius: 4px; }

/* Block Content / Style tabs */
.btabs { display: flex; gap: 2px; background: var(--ui-fill); border-radius: var(--ui-radius); padding: 3px; margin-bottom: var(--space-3-5); }
.btabs__btn { flex: 1; border: 0; background: transparent; border-radius: var(--ui-radius-sm); padding: var(--space-2) var(--space-2-5); font: 600 var(--ui-text-xs) var(--ui-font); color: var(--ui-ink-2); cursor: pointer; }
.btabs__btn.is-active { background: var(--ui-surface); color: var(--ui-ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.btabs__btn span { display: inline-flex; align-items: center; gap: var(--space-1-5); }
.btabs__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-primary); display: inline-block; }

/* Style panel */
.style-panel { display: flex; flex-direction: column; gap: var(--space-2); }
.sp-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2-5); font-size: var(--ui-text-xs); }
.sp-sec { border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface); }
.sp-sec > summary { list-style: none; cursor: pointer; padding: var(--space-2-5) var(--space-3); font: 700 var(--ui-text-xs) var(--ui-font); text-transform: uppercase; letter-spacing: .06em; color: var(--ui-ink-2); display: flex; justify-content: space-between; align-items: center; }
.sp-sec > summary::-webkit-details-marker { display: none; }
.sp-sec > summary::after { content: "+"; font-size: var(--ui-text-xl); color: var(--ui-muted); font-weight: 500; }
.sp-sec[open] > summary::after { content: "–"; }
.sp-body { padding: 2px var(--space-3) var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.sp-row { display: flex; flex-direction: column; gap: var(--space-1-5); }
.sp-label { font: 600 var(--ui-text-xs) var(--ui-font); color: var(--ui-ink-2); }
.seg--style { flex-wrap: wrap; }
.seg--style .seg__btn { height: 30px; min-width: 0; padding: 0 var(--space-1-5); font-size: var(--ui-text-xs); }
.sp-size { display: flex; flex-direction: column; gap: var(--space-1-5); }
.sp-px { display: flex; align-items: center; gap: var(--space-2); font-size: var(--ui-text-xs); color: var(--ui-ink-2); }
.sp-px .input { width: 96px; }
.input--sm { height: 32px; padding: var(--space-1) var(--space-2); font-size: var(--ui-text-sm); }
.sp-colors { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5); }
.sp-swatch { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); background: var(--c, #fff); cursor: pointer; padding: 0; flex: none; }
.sp-swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ui-primary); }
.sp-swatch--none { background: linear-gradient(135deg, #fff 45%, #e0464b 45%, #e0464b 55%, #fff 55%); }
.sp-swatch--custom { background: var(--c, conic-gradient(#f44, #fd4, #4d6, #4bf, #84f, #f44)); overflow: hidden; }
.sp-swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.sp-hex { width: 92px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sp-range { width: 100%; accent-color: var(--ui-primary); }
.sp-switch { font-weight: 500; font-size: var(--ui-text-xs); }
.auth-forgot { font-weight: 500; font-size: var(--ui-text-xs); color: var(--ui-primary-ink); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }
.auth-alt { text-align: center; margin: var(--space-3-5) 0 0; font-size: var(--ui-text-sm); }
.auth-alt a { color: var(--ui-primary-ink); }
.row-gap { display: flex; gap: var(--space-2); flex-wrap: wrap; }
/* Two-step sign-in and passkeys (templates/admin/two_step.html, security/_content.html) */
.auth-card--wide { width: min(520px, calc(100vw - 32px)); margin-block: var(--space-6); }
.auth-or { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; color: var(--ui-muted); font-size: var(--ui-text-xs); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--ui-line); }
.auth-passkey .alert { margin: var(--space-3) 0 0; }
.auth-ways { display: flex; flex-direction: column; align-items: center; gap: var(--space-1-5); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--ui-line); font-size: var(--ui-text-sm); }
.auth-ways form { margin: 0; }
.auth-ways a, .link-btn { color: var(--ui-primary-ink); font: 500 var(--ui-text-sm) var(--ui-font); text-decoration: none; }
.auth-ways a:hover, .link-btn:hover { text-decoration: underline; }
.auth-ways__label { color: var(--ui-muted); font-size: var(--ui-text-xs); font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.input--code { font-variant-numeric: tabular-nums; letter-spacing: .12em; text-align: center; }
.setup-way { border-top: 1px solid var(--ui-line); padding-top: var(--space-4); margin-top: var(--space-4); }
.setup-way h2 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--ui-text-lg); margin-bottom: var(--space-1); }
.auth-card .setup-way .muted { margin-bottom: var(--space-3); }
.setup-way .field { display: block; margin-bottom: var(--space-3); }
.setup-app, .sec-app { display: grid; grid-template-columns: auto 1fr; gap: var(--space-5); align-items: center; }
.qr { width: 168px; padding: var(--space-2); background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); line-height: 0; }
.qr svg { width: 100%; height: auto; }
.setup-key { margin-top: var(--space-3); font-size: var(--ui-text-sm); }
.setup-key summary { cursor: pointer; color: var(--ui-primary-ink); font-weight: 500; }
.setup-key p { margin: var(--space-2) 0; }
.secret { display: inline-block; font-size: var(--ui-text-md); letter-spacing: .06em; padding: var(--space-1-5) var(--space-2-5); user-select: all; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); padding: var(--space-4); list-style: none; background: var(--ui-surface-2); border: 1px dashed var(--ui-line-strong); border-radius: var(--ui-radius-md); }
.codes code { background: none; padding: 0; font-size: var(--ui-text-md); letter-spacing: .04em; }
.codes__tools { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.badge--on { background: var(--ui-success-soft); color: var(--ui-success-ink); text-transform: none; }
.sec-page--platform { max-width: 760px; }
.sec-panel { margin-bottom: var(--space-5); }
.sec-panel .panel__head { justify-content: flex-start; gap: var(--space-2-5); }
.sec-body { padding: var(--space-4); }
.sec-body > p:first-child { margin-top: 0; }
.sec-intro { margin: 0; padding: var(--space-3-5) var(--space-4) 0; }
.sec-intro:empty { display: none; }
.sec-narrow { max-width: 360px; }
.sec-list { list-style: none; margin: 0; padding: var(--space-2) 0; }
.sec-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.sec-item + .sec-item { border-top: 1px solid var(--ui-line); }
.sec-item__icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--ui-radius); background: var(--ui-fill); color: var(--ui-ink-2); }
.sec-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sec-item__text small { color: var(--ui-muted); font-size: var(--ui-text-xs); }
.sec-item__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1-5); }
.sec-item__actions form { margin: 0; }
.sec-foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--ui-line); }
.sec-foot form { margin: 0; }
.sec-add { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--space-2-5); padding: var(--space-3-5) var(--space-4) var(--space-4); border-top: 1px solid var(--ui-line); }
.sec-add .field { flex: 1 1 220px; max-width: 320px; }
.sec-add[hidden] { display: none; }
.sec-confirm { margin-bottom: var(--space-5); border-color: var(--ui-warning-line); background: var(--ui-warning-soft); }
.sec-confirm h2 { font-size: var(--ui-text-lg); margin-bottom: var(--space-1); }
.sec-confirm .muted { margin: 0 0 var(--space-3); }
.two-step-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1-5); }
.two-step-card__head .badge { margin-left: auto; }
.two-step-card .muted { margin: 0 0 var(--space-3); font-size: var(--ui-text-sm); }

/* Giving (admin.js givingCard, src/giving.rs): permanent addresses and QR codes. */
.giving-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1-5); }
.giving-card__head .icon { width: 16px; height: 16px; color: var(--ui-primary); }
.giving-card .muted { margin: 0 0 var(--space-2); font-size: var(--ui-text-sm); }
.giving-card__note { display: none; margin: 0 0 var(--space-2); padding: var(--space-1-5) var(--space-2-5); border-radius: var(--ui-radius-sm); background: var(--ui-warning-soft); color: var(--ui-warning-ink); font-size: var(--ui-text-xs); }
.giving-card.is-dirty .giving-card__note { display: block; }
.give-row { display: flex; gap: var(--space-3); padding: var(--space-3) 0 var(--space-1); border-top: 1px solid var(--ui-line); }
.give-row__qr { flex: none; display: block; width: 72px; height: 72px; padding: 3px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); background: #fff; }
.give-row__qr:hover { border-color: var(--ui-primary); }
.give-row__qr img { display: block; width: 100%; height: 100%; }
.give-row__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: var(--ui-text-sm); color: var(--ui-ink-2); }
.give-row__name { color: var(--ui-ink); font-size: var(--ui-text-sm); }
.give-row__status { display: flex; align-items: center; gap: var(--space-1-5); font-size: var(--ui-text-xs); }
.give-row__status i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ui-muted); }
.give-row__status--ok i { background: var(--ui-success); }
.give-row__status--warn { color: var(--ui-warning-ink); }
.give-row__status--warn i { background: var(--ui-warning); }
.give-row__status--bad { color: var(--ui-danger-ink); }
.give-row__status--bad i { background: var(--ui-danger); }
.give-row__addr { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.give-row__addr a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-primary-ink); }
.give-row__copy.btn--sm { height: 22px; padding: 0 var(--space-1-5); }
.give-row__meta, .give-row__dl { font-size: var(--ui-text-xs); color: var(--ui-muted); }
.give-row__dl { display: flex; align-items: center; gap: var(--space-1); }
.give-row__dl .icon { width: 12px; height: 12px; }
.give-row__dl a { color: var(--ui-ink-2); }
.sidebar__user a.icon-btn { margin-left: auto; }
.sidebar__user a.icon-btn + form { margin: 0; }
.sidebar__user .icon-btn.is-active { color: #fff; background: rgba(255, 255, 255, .18); }
@media (max-width: 560px) {
  .setup-app, .sec-app { grid-template-columns: 1fr; justify-items: center; }
  .codes { grid-template-columns: 1fr; }
  .sec-item { flex-wrap: wrap; }
  .sec-item__actions { width: 100%; justify-content: flex-start; padding-left: var(--space-12); }
}

.upload-panel__info { display: flex; flex-direction: column; gap: var(--space-1-5); font-size: var(--ui-text-xs); line-height: 1.45; padding: var(--space-2-5) var(--space-3); background: var(--ui-bg); border-radius: var(--ui-radius); }
.upload-panel__info .btn { align-self: flex-start; }

/* Storage use */
.storage { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); padding: var(--space-3) var(--space-4) var(--space-3-5); margin-bottom: var(--space-4); }
.storage__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; font-size: var(--ui-text-sm); margin-bottom: var(--space-2); }
.storage__bar { height: 8px; border-radius: var(--ui-radius-pill); background: var(--ui-fill-strong); overflow: hidden; }
.storage__bar span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--ui-primary); transition: width .5s ease, background-color .3s; }
.storage__note { margin: var(--space-2-5) 0 0; font-size: var(--ui-text-sm); line-height: 1.45; }
.storage--warn { background: var(--ui-warning-soft); border-color: var(--ui-warning-line); }
.storage--warn .storage__bar span { background: var(--ui-warning); }
.storage--warn .storage__note { color: var(--ui-warning-ink); }
.storage--full { background: var(--ui-danger-soft); border-color: var(--ui-danger-line); }
.storage--full .storage__bar span { background: var(--ui-danger); }
.storage--full .storage__note { color: var(--ui-danger-ink); }
.storage__bar.is-warn span { background: var(--ui-warning); }
.storage__bar.is-full span { background: var(--ui-danger); }
.field > .storage__bar { display: block; margin-top: var(--space-1); max-width: 320px; }
.nowrap { white-space: nowrap; }

/* Inbox */
.inbox-forms { display: grid; gap: var(--space-2-5); }
.inbox-form { display: flex; align-items: center; gap: var(--space-3-5); padding: var(--space-3-5) var(--space-4); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); text-decoration: none; color: inherit; box-shadow: var(--ui-shadow); }
.inbox-form:hover { border-color: var(--ui-line-2); }
.inbox-form__main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-form__main strong { font-size: var(--ui-text-lg); }
.inbox-form__counts { display: flex; align-items: center; gap: var(--space-2-5); white-space: nowrap; }
.empty-panel { padding: var(--space-7); text-align: center; display: grid; gap: var(--space-2); justify-items: center; }
.badge--s-new { background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.badge--s-open { background: var(--ui-warning-soft); color: var(--ui-warning-ink); }
.badge--s-done { background: var(--ui-fill); color: var(--ui-ink-2); }
.badge--s-confirmed { background: var(--ui-success-soft); color: var(--ui-success-ink); }
.badge--s-waitlist { background: var(--ui-warning-soft); color: var(--ui-warning-ink); }
.badge--s-cancelled { background: var(--ui-danger-soft); color: var(--ui-danger-ink); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1-5); margin-bottom: var(--space-3-5); }
.chip { display: inline-flex; align-items: center; gap: var(--space-1-5); height: 30px; padding: 0 var(--space-3); border-radius: var(--ui-radius-pill); border: 1px solid var(--ui-line-2); background: var(--ui-surface); color: var(--ui-ink-2); text-decoration: none; font-weight: 500; font-size: var(--ui-text-sm); }
.chip span { color: var(--ui-muted); font-size: var(--ui-text-xs); }
.chip.is-active { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
.chip.is-active span { color: rgba(255,255,255,.7); }
.inbox-filter { align-items: center; }
.inbox-filter .field__label { margin: 0; white-space: nowrap; }
.inbox-filter .input { max-width: 420px; }
.spots { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-bottom: var(--space-3-5); }
.spots > div { padding: var(--space-3-5) var(--space-4); border-right: 1px solid var(--ui-line); display: flex; flex-direction: column; }
.spots > div:last-child { border-right: 0; }
.spots strong { font-size: var(--ui-text-2xl); }
.spots small { color: var(--ui-muted); }
td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-4); align-items: start; }
.answer { padding: var(--space-1-5) 0; }
.answer__event { display: flex; gap: var(--space-2-5); align-items: center; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--ui-line); background: var(--ui-surface-2); }
.answers { margin: 0; }
.answers__row { padding: var(--space-3-5) var(--space-5); border-bottom: 1px solid var(--ui-line); }
.answers__row:last-child { border-bottom: 0; }
.answers dt { font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-muted); margin-bottom: var(--space-1); }
.answers dd { margin: 0; font-size: var(--ui-text-lg); white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-side { padding: var(--space-4); display: grid; gap: var(--space-3-5); margin-bottom: var(--space-2-5); }
.input--textarea { height: auto; padding: var(--space-2) var(--space-3); line-height: 1.45; resize: vertical; }
@media (max-width: 900px) { .answer-layout { grid-template-columns: 1fr; } }

/* Style tab: device switcher (linked to the preview size) */
.sp-devices { display: grid; gap: var(--space-1-5); padding: 2px 0 var(--space-2-5); border-bottom: 1px solid var(--ui-line); margin-bottom: var(--space-2); }
.sp-devices .seg__btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1-5); position: relative; }
.sp-devices .seg__btn .icon { width: 15px; height: 15px; }
.sp-devices small { font-size: var(--ui-text-xs); line-height: 1.4; }
.sp-devdot { width: 6px; height: 6px; border-radius: 50%; background: var(--ui-primary); position: absolute; top: 5px; right: 6px; }
.seg__btn.is-inherited:not(.is-active) { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ui-primary) 45%, transparent); color: var(--ui-primary-ink); }
.sp-vis { display: flex; gap: var(--space-1-5); flex-wrap: wrap; }
.sp-vis__btn { display: inline-flex; align-items: center; gap: var(--space-1-5); height: 32px; padding: 0 var(--space-3); border-radius: var(--ui-radius); border: 1px solid var(--ui-line-2); background: var(--ui-primary-soft); color: var(--ui-primary-ink); font: 500 var(--ui-text-sm) var(--ui-font); cursor: pointer; }
.sp-vis__btn .icon { width: 15px; height: 15px; }
.sp-vis__btn.is-off { background: var(--ui-surface); color: var(--ui-muted); text-decoration: line-through; }

/* Platform: church addresses */
.domain-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2-5); }
.domain-list li { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-2-5); row-gap: 2px; align-items: center; }
.domain-list li > small { grid-column: 2; }
.domain-help { grid-column: 2; font-size: var(--ui-text-xs); line-height: 1.45; color: var(--ui-warning-ink); }
.domain-pending { color: var(--ui-warning-ink); }

/* Rich text editor (assets/editor.js); its toolbar styles come with it. */
.rte { --ink: #1f1f2b; --muted: #6d6d80; --line: #e6e5ef; --radius: 10px; --btn-radius: 999px; --on-brand: #fff; --brand-ink: color-mix(in srgb, var(--brand) 75%, black); }
.rte:focus-within { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.kte-content { min-height: 140px; max-height: 560px; overflow: auto; padding: 12px 16px; }
.kte-content > :first-child { margin-top: 0; }
.kte-content h2 { font-size: 1.45rem; margin: 1em 0 .4em; }
.kte-content h3 { font-size: 1.2rem; margin: 1em 0 .4em; }
.kte-content h4 { font-size: 1.02rem; margin: 1em 0 .4em; }
.kte-content blockquote { border-left: 3px solid var(--accent, #d9a441); margin: 1em 0; padding: .1em 0 .1em 1em; color: var(--ink); font-style: italic; }
.kte-content hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.kte-content .t-sm { font-size: .875em; } .kte-content .t-lg { font-size: 1.25em; } .kte-content .t-xl { font-size: 1.6em; line-height: 1.3; }
.kte-content .c-brand { color: var(--brand); } .kte-content .c-accent { color: var(--accent); } .kte-content .c-ink { color: var(--ink); } .kte-content .c-muted { color: var(--muted); }
.kte-content .c-white { color: #fff; background: #3a3a48; border-radius: 3px; }
.kte-content mark { padding: 0 .15em; border-radius: .2em; color: inherit; }
.kte-content .h-yellow { background: #fff1a8; } .kte-content .h-brand { background: color-mix(in srgb, var(--brand) 18%, transparent); } .kte-content .h-accent { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.kte-content .ta-center { text-align: center; } .kte-content .ta-right { text-align: right; }
.kte-content a { color: var(--brand); }
.kte-content a.rt-button { display: inline-block; padding: .55em 1.2em; border-radius: var(--btn-radius); background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none; }
.kte-content .rt-img { margin: 1em 0; } .kte-content .rt-img img { display: block; width: 100%; height: auto; border-radius: 6px; }
.kte-content .rt-img figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.kte-content .rt-img--center { width: min(100%, 420px); margin-left: auto; margin-right: auto; }
.kte-content .rt-img--left { float: left; width: 40%; margin: .2em 1em .6em 0; } .kte-content .rt-img--right { float: right; width: 40%; margin: .2em 0 .6em 1em; }
.kte-content::after { content: ""; display: table; clear: both; }
.kte-content .rt-embed { aspect-ratio: 16 / 9; margin: 1em 0; border-radius: 6px; overflow: hidden; background: #111; }
.kte-content .rt-embed iframe { width: 100%; height: 100%; border: 0; }
.kte-content .rt-embed--spotify { aspect-ratio: auto; height: 352px; background: transparent; } .kte-content .rt-embed--compact { height: 152px; }

/* A role's permissions (admin.js: permissionGrid) */
.perm-grid-wrap { overflow-x: auto; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); }
.perm-grid { width: 100%; border-collapse: collapse; font-size: var(--ui-text-sm); }
.perm-grid th, .perm-grid td { padding: var(--space-2) var(--space-2-5); border-bottom: 1px solid var(--ui-line); text-align: center; white-space: nowrap; }
.perm-grid thead th { font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-muted); background: var(--ui-surface-2); }
.perm-grid thead th:first-child, .perm-grid tbody th { text-align: left; }
.perm-grid tbody tr:last-child th, .perm-grid tbody tr:last-child td { border-bottom: 0; }
.perm-grid tbody tr.is-on { background: color-mix(in srgb, var(--ui-primary-soft) 45%, transparent); }
.perm-grid__row { display: inline-flex; align-items: center; gap: var(--space-2); border: 0; background: none; padding: 0; font: 600 var(--ui-text-sm) var(--ui-font); color: var(--ui-ink); cursor: pointer; }
.perm-grid__row .icon { width: 16px; height: 16px; color: var(--ui-muted); }
.perm-grid__cell { display: inline-grid; place-items: center; width: 28px; height: 28px; cursor: pointer; }
.perm-grid__cell input { width: 16px; height: 16px; accent-color: var(--ui-primary); cursor: pointer; }
.perm-grid__na { color: var(--ui-line-strong); }
.draft-only { font-size: var(--ui-text-xs); }
.json-view { margin: 0; padding: var(--space-2-5); background: var(--ui-fill); border-radius: var(--ui-radius-sm); font-size: var(--ui-text-xs); overflow: auto; max-height: 240px; }

/* Languages (admin.js: localeSwitch, translatedField) */
.seg--lang .seg__btn { width: auto; min-width: 38px; padding: 0 var(--space-2); font: 700 var(--ui-text-xs) var(--ui-font); letter-spacing: .04em; }
.seg--lang .seg__btn.is-active { background: var(--ui-surface); color: var(--ui-ink); box-shadow: 0 1px 2px rgba(23,22,31,.1); }
.lang-badge { margin-left: auto; font: 700 var(--ui-text-2xs)/1 var(--ui-font); letter-spacing: .05em; padding: 3px var(--space-1-5); border-radius: 999px; background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.lang-badge--all { background: var(--ui-fill); color: var(--ui-muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.alert--lang { display: flex; gap: var(--space-2); align-items: flex-start; background: var(--ui-primary-soft); color: var(--ui-ink); border: 0; }
.alert--lang .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--ui-primary-ink); }
.rte-untranslated { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--ui-text-xs); }

/* Platform → Logs */
.logs td { vertical-align: top; }
.logs__level { text-transform: lowercase; }
.logs__level--error { background: var(--ui-danger-soft); color: var(--ui-danger-ink); }
.logs__level--warn { background: var(--ui-warning-soft); color: var(--ui-warning-ink); }
.logs__level--info { background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.logs__what { min-width: 280px; }
.logs__text { overflow-wrap: anywhere; white-space: pre-wrap; }
.logs__text--request { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--ui-text-sm); }
.logs__fields { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2-5); margin-top: var(--space-1); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--ui-text-xs); color: var(--ui-muted); overflow-wrap: anywhere; }
.logs__target { opacity: .7; }

/* ------------------------------------------------------------------ dashboard
   Widgets on a 4-column grid that each person arranges (templates/admin/
   dashboard.html, assets/dashboard.js). Each widget's body is a size
   container, so what it shows adapts to its size. */
.dash { max-width: 1240px; }
.dash__head { align-items: flex-end; margin-bottom: var(--space-5); }
.dash__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dash__period { display: inline-flex; background: var(--ui-fill); border-radius: var(--ui-radius); padding: 3px; gap: 2px; }
.dash__period-item { height: 30px; padding: 0 var(--space-3); border-radius: var(--ui-radius-sm); display: inline-flex; align-items: center; font-weight: 600; font-size: var(--ui-text-sm); color: var(--ui-ink-2); text-decoration: none; white-space: nowrap; }
.dash__period-item:hover { color: var(--ui-ink); }
.dash__period-item.is-on { background: var(--ui-surface); color: var(--ui-ink); box-shadow: 0 1px 2px rgba(23, 22, 31, .1); }
.dash.is-editing .dash__period, .dash.is-editing [data-dash-edit], .dash.is-editing .dash__site { display: none; }
.dash__editbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); margin-bottom: var(--space-5); background: var(--ui-primary-soft); border: 1px solid color-mix(in srgb, var(--ui-primary) 18%, transparent); border-radius: var(--ui-radius-lg); }
.dash__editbar[hidden] { display: none; }
.dash__editbar-text strong { display: block; }
.dash__editbar-text span { color: var(--ui-ink-2); font-size: var(--ui-text-sm); }
.dash__editbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5); }
.dash__editbar .btn--ghost:hover { background: color-mix(in srgb, var(--ui-primary) 10%, transparent); }
.dash__sep { width: 1px; height: 24px; background: color-mix(in srgb, var(--ui-primary) 22%, transparent); margin: 0 var(--space-1); }
.dash__wrap { container: dash / inline-size; }
.dash__board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 132px; gap: var(--space-4); grid-auto-flow: row dense; }
.dash.is-editing .dash__board { background-image: radial-gradient(circle, var(--ui-line-strong) 1px, transparent 1.6px); background-size: var(--space-4) var(--space-4); outline: 1px dashed var(--ui-line-2); outline-offset: var(--space-2); border-radius: 2px; }
.dw--w1 { grid-column: span 1; } .dw--w2 { grid-column: span 2; } .dw--w3 { grid-column: span 3; } .dw--w4 { grid-column: span 4; }
.dw--h1 { grid-row: span 1; } .dw--h2 { grid-row: span 2; } .dw--h3 { grid-row: span 3; } .dw--h4 { grid-row: span 4; }
@container dash (max-width: 740px) { .dash__board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash__board > .dw--w3, .dash__board > .dw--w4 { grid-column: span 2; } }
@container dash (max-width: 480px) { .dash__board { grid-template-columns: minmax(0, 1fr); } .dash__board > .dw--w2, .dash__board > .dw--w3, .dash__board > .dw--w4 { grid-column: span 1; } }
.dash__addtile { border: 1.5px dashed var(--ui-line-strong); border-radius: var(--ui-radius-lg); background: rgba(255, 255, 255, .6); color: var(--ui-ink-2); font: 600 var(--ui-text-sm) var(--ui-font); display: flex; align-items: center; justify-content: center; gap: var(--space-2); cursor: pointer; }
.dash__addtile:hover { border-color: var(--ui-primary); color: var(--ui-primary-ink); background: var(--ui-primary-soft); }
.dash__addtile[hidden] { display: none; }
.dash__empty { grid-column: 1 / -1; grid-row: span 2; border: 1.5px dashed var(--ui-line-strong); border-radius: var(--ui-radius-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2-5); text-align: center; padding: var(--space-6); }
.dash__empty[hidden] { display: none; }

/* A widget */
.dw { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow); transition: box-shadow .15s, border-color .15s, opacity .15s; }
.dw__head { display: flex; align-items: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-2) 0 var(--space-4); flex: none; border-radius: var(--ui-radius-lg) var(--ui-radius-lg) 0 0; }
.dw__title { margin: 0; font-size: var(--ui-text-md); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dw__count { font-size: var(--ui-text-2xs); font-weight: 700; line-height: 18px; padding: 0 var(--space-1-5); border-radius: var(--ui-radius-pill); background: var(--ui-primary-soft); color: var(--ui-primary-ink); flex: none; }
.dw__note { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--ui-text-2xs); color: var(--ui-muted); white-space: nowrap; }
.dw__note .icon { width: 12px; height: 12px; }
.dw__more { border: 0; background: none; padding: 2px var(--space-1-5); font: 600 var(--ui-text-xs) var(--ui-font); color: var(--ui-muted); border-radius: var(--ui-radius-sm); white-space: nowrap; }
.dw__more[hidden] { display: none; }
.dw__more[data-links-edit] { cursor: pointer; }
.dw__more[data-links-edit]:hover { color: var(--ui-primary-ink); background: var(--ui-primary-soft); }
.dw__actions { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.dw__link { font-size: var(--ui-text-xs); font-weight: 600; padding: var(--space-1) var(--space-2); border-radius: var(--ui-radius-sm); color: var(--ui-primary-ink); text-decoration: none; white-space: nowrap; }
.dw__link:hover { background: var(--ui-primary-soft); }
.dw__btn { width: 30px; height: 30px; color: var(--ui-muted); }
.dw__btn .icon { width: 16px; height: 16px; }
.dw__grip, .dw__edit, .dw__resize { display: none; }
.dw__body { flex: 1; min-height: 0; padding: 0 var(--space-4) var(--space-3-5); overflow: hidden; display: flex; flex-direction: column; container-type: size; }
.dw__sec { flex: none; display: flex; align-items: baseline; gap: var(--space-1-5); font-size: var(--ui-text-2xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.dw__sec-hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.dw__sec-hint::before { content: "· "; }
.dw__blank { flex: 1; display: flex; align-items: center; gap: var(--space-3); color: var(--ui-ink-2); font-size: var(--ui-text-sm); }
.dw__blank p { margin: 0; max-width: 52ch; }
.dw__blank-icon { width: 40px; height: 40px; border-radius: var(--ui-radius-md); background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; flex: none; }
.dw__blank-text { color: var(--ui-muted); font-size: var(--ui-text-sm); margin: 0; }
.dw__blank-text[hidden] { display: none; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ui-primary-ink); cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Customizing */
.is-editing .dw { border-color: var(--ui-line-2); }
.is-editing .dw:hover { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.is-editing .dw__head { cursor: grab; background: var(--ui-surface-2); border-bottom: 1px solid var(--ui-line); padding-left: var(--space-1-5); }
.is-editing .dw__head:active { cursor: grabbing; }
.is-editing .dw__grip { display: grid; place-items: center; width: 20px; color: var(--ui-muted); flex: none; }
.is-editing .dw__grip .icon { width: 16px; height: 16px; }
.is-editing .dw__edit { display: inline-grid; }
.is-editing .dw__resize { display: grid; }
.is-editing .dw__link, .is-editing .dw__head [data-links-edit], .is-editing .dw__more { display: none; }
.is-editing .dw__body { pointer-events: none; user-select: none; }
.dw.is-dragging { opacity: .35; }
.dw.is-over, .dw.is-resizing { border-color: var(--ui-primary); box-shadow: 0 0 0 3px var(--ui-ring); }
.dw.is-over::before { content: ""; position: absolute; inset: -1px; z-index: 3; border: 2px dashed var(--ui-primary); border-radius: var(--ui-radius-lg); background: color-mix(in srgb, var(--ui-primary-soft) 85%, transparent); pointer-events: none; }
.dw.is-over::after { content: "Drop to swap"; position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); padding: var(--space-1-5) var(--space-3); border-radius: var(--ui-radius-pill); background: var(--ui-primary); color: var(--ui-on-primary); font-weight: 600; white-space: nowrap; pointer-events: none; }
.dw.is-resizing::after { content: attr(data-size); position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); background: var(--ui-ink); color: #fff; font-weight: 700; padding: var(--space-1-5) var(--space-3); border-radius: var(--ui-radius-pill); pointer-events: none; font-variant-numeric: tabular-nums; }
.dw.is-new { animation: dw-flash 1.6s ease-out; }
@keyframes dw-flash { from { box-shadow: 0 0 0 8px color-mix(in srgb, var(--ui-primary) 35%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }
.dw__resize { position: absolute; right: 3px; bottom: 3px; z-index: 4; width: 26px; height: 26px; place-items: center; border: 0; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-line-strong); cursor: nwse-resize; touch-action: none; }
.dw__resize:hover, .dw.is-resizing .dw__resize { color: var(--ui-primary); background: var(--ui-primary-soft); }
.dw__resize .icon { width: 16px; height: 16px; }
.dw-menu { position: absolute; top: 40px; right: var(--space-2); z-index: 30; display: flex; flex-direction: column; min-width: 180px; padding: var(--space-1-5); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-pop); }
.dw-menu button { border: 0; background: transparent; text-align: left; padding: var(--space-1-5) var(--space-2-5); border-radius: var(--ui-radius-sm); font: var(--ui-text-sm) var(--ui-font); color: var(--ui-ink); cursor: pointer; }
.dw-menu button:hover, .dw-menu button:focus-visible { background: var(--ui-fill); outline: none; }
.dw-menu button:disabled { color: var(--ui-line-strong); cursor: default; background: transparent; }
.dw-menu hr { border: 0; border-top: 1px solid var(--ui-line); margin: var(--space-1) 0; }
.dw-menu .is-danger { color: var(--ui-danger-ink); }
.dw-menu .is-danger:hover, .dw-menu .is-danger:focus-visible { background: var(--ui-danger-soft); }

/* What a widget shows at its size */
.dw__body .dw-small, .dw__body .dw-short { display: none; }
@container (max-height: 150px) { .dw__body .dw-tall, .dw__body .dw-big { display: none; } .dw__body .dw-short { display: flex; } .dw__body .dw-small { display: block; } }
@container (max-width: 380px) { .dw__body .dw-big, .dw__body .dw-roomy, .dw__body .dw-wide { display: none; } .dw__body .dw-small { display: block; } }
@container (max-width: 699px) { .dw__body .dw-wide { display: none; } }
@container (max-width: 380px) and (max-height: 150px) { .dw__body .dw-roomy-or-tall { display: none; } }

/* Numbers */
.stat__value { font-size: var(--ui-text-4xl); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.stat__label { display: flex; align-items: center; gap: var(--space-1-5); margin-top: 2px; font-size: var(--ui-text-xs); color: var(--ui-muted); }
.stat__row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.delta { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 var(--space-2); margin-bottom: 3px; border-radius: var(--ui-radius-pill); font-size: var(--ui-text-xs); font-weight: 600; white-space: nowrap; }
.delta .icon { width: 12px; height: 12px; }
.delta--up { background: var(--ui-success-soft); color: var(--ui-success-ink); }
.delta--down { background: var(--ui-danger-soft); color: var(--ui-danger-ink); }
.delta--flat { background: var(--ui-fill); color: var(--ui-ink-2); }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.key--1 { background: var(--ui-chart-1); }
.key--2 { background: var(--ui-chart-2); }
.key--3 { background: var(--ui-chart-3); }
.dw .badge { text-transform: none; }
.badge:has(.icon)::before { display: none; }
.badge .icon { width: 12px; height: 12px; }
.meter { display: block; height: 6px; border-radius: var(--ui-radius-pill); background: var(--ui-primary-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ui-primary); border-radius: var(--ui-radius-pill); }
.meter--full { background: var(--ui-warning-soft); }
.meter--full > span { background: var(--ui-warning); }

/* Graphs */
.chart, .cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 22px; }
.chart:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 4px; border-radius: var(--ui-radius-sm); }
.chart__y { position: relative; font-size: var(--ui-text-2xs); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.chart__y span { position: absolute; right: var(--space-2); transform: translateY(-50%); line-height: 1; }
.chart__plot { position: relative; min-height: 0; }
.chart__grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--ui-fill); }
.chart__grid--base { background: var(--ui-line-2); transform: translateY(-1px); }
.chart__plot svg, .spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart__area { fill: var(--ui-chart-1); fill-opacity: .1; stroke: none; }
.chart__line { fill: none; stroke: var(--ui-chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart__dot { position: absolute; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--ui-chart-1); box-shadow: 0 0 0 2px var(--ui-surface); transform: translate(-50%, -50%); pointer-events: none; }
.chart__cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ui-line-strong); pointer-events: none; }
.chart__tip { position: absolute; top: 0; z-index: 2; padding: var(--space-1-5) var(--space-2-5); background: var(--ui-side); color: #fff; border-radius: var(--ui-radius); font-size: var(--ui-text-xs); white-space: nowrap; pointer-events: none; box-shadow: var(--ui-shadow-pop); transform: translateX(12px); }
.chart__tip.is-left { transform: translateX(calc(-100% - 12px)); }
.chart__tip strong { display: block; font-size: var(--ui-text-md); }
.chart__tip span, .chart__tip-row { color: var(--ui-side-ink); }
.chart__tip-row { display: flex; align-items: center; gap: var(--space-1-5); }
.chart__tip-row strong { display: inline; color: #fff; font-size: var(--ui-text-sm); }
.chart__tip-key { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.chart__tip-key--1 { background: var(--ui-chart-1); }
.chart__tip-key--2 { background: var(--ui-chart-2); }
.chart__tip-key--3 { background: var(--ui-chart-3); }
.chart__x { position: relative; font-size: var(--ui-text-2xs); color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.chart__x span { position: absolute; top: 6px; white-space: nowrap; transform: translateX(-50%); }
.chart__x .x0 { transform: none; }
.chart__x .x2 { transform: translateX(-100%); }
.spark { position: relative; flex: 1; min-height: 36px; min-width: 80px; align-self: stretch; }
.cols__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.cols__band { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: var(--ui-radius-xs); }
.cols__band.is-on { background: color-mix(in srgb, var(--ui-primary) 7%, transparent); }
.cols__stack { width: 100%; max-width: 24px; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.cols__seg { flex: 1 1 0; min-height: 2px; }
.cols__seg--1 { background: var(--ui-chart-1); }
.cols__seg--2 { background: var(--ui-chart-2); }
.cols__seg--3 { background: var(--ui-chart-3); }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2-5); min-height: 0; overflow: hidden; }
.bars--tight { gap: var(--space-2); }
.bars__row { flex: none; }
.bars__line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); font-size: var(--ui-text-sm); }
.bars__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bars__val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ui-ink-2); white-space: nowrap; }
.bars__bar { display: block; height: 8px; margin-top: var(--space-1); border-radius: 0 4px 4px 0; background: var(--ui-chart-1); min-width: 3px; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.rows__item { flex: none; display: flex; align-items: center; gap: var(--space-2); min-height: 36px; border-top: 1px solid var(--ui-line); font-size: var(--ui-text-sm); }
.rows__item:first-child { border-top: 0; }
.rows__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--ui-ink); text-decoration: none; }
a.rows__name:hover { color: var(--ui-primary-ink); }
.rows__val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ui-ink-2); min-width: 24px; text-align: right; }
.rows__meta { color: var(--ui-muted); font-size: var(--ui-text-xs); white-space: nowrap; }

/* Website visits */
.vz { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; min-height: 0; }
.vz__top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-1-5) var(--space-3); }
.vz__vs { padding-bottom: var(--space-1); font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; }
.vz__side { margin-left: auto; display: flex; gap: var(--space-6); }
.vz__meta { text-align: right; font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; }
.vz__meta strong { display: block; color: var(--ui-ink); font-size: var(--ui-text-sm); font-weight: 600; }
@container (max-height: 150px) { .vz { flex-direction: row; align-items: center; gap: var(--space-4); } }

/* Form answers & sign-ups */
.an { display: flex; flex-direction: column; gap: var(--space-3-5); flex: 1; min-height: 0; }
.an__stats { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-7); flex: none; }
.an__main { display: flex; flex-direction: column; gap: var(--space-3-5); flex: 1; min-height: 0; }
.an__forms { display: flex; flex-direction: column; gap: var(--space-1-5); flex: 1 1 0; min-height: 0; min-width: 0; }
@container (min-width: 700px) { .an__main { flex-direction: row; gap: var(--space-6); } .an__main > .cols { flex: 1 1 0; min-width: 0; } .an__forms { flex: 0 1 300px; } }
@container (max-height: 300px) and (min-width: 381px) and (max-width: 699px) { .an__forms { display: none; } }

/* Upcoming events */
.ev { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; overflow: hidden; flex: 1; }
.ev__row { flex: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) 170px; gap: var(--space-3); align-items: center; }
.ev__date { width: 44px; height: 50px; border-radius: var(--ui-radius-md); background: var(--ui-surface-2); border: 1px solid var(--ui-line); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ev__date span { font-size: var(--ui-text-2xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ui-muted); }
.ev__date span:last-child { font-weight: 500; letter-spacing: 0; text-transform: none; }
.ev__date strong { font-size: var(--ui-text-2xl); }
.ev__title { display: block; font-weight: 600; color: var(--ui-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.ev__title:hover { color: var(--ui-primary-ink); }
.ev__meta { font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev__spots { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--ui-text-xs); color: var(--ui-ink-2); text-decoration: none; }
.ev__spots:hover .ev__spotline > span:first-child { color: var(--ui-primary-ink); }
.ev__spotline { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1-5); }
.ev__wait { color: var(--ui-warning-ink); font-weight: 600; }
@container (max-width: 480px) { .ev__row { grid-template-columns: 44px minmax(0, 1fr); } .ev__spots { grid-column: 2; } }

/* To do */
.td { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.td__summary { flex-direction: column; }
.td__cols { display: flex; flex-direction: column; gap: var(--space-4); flex: 1; min-height: 0; }
.td__col { display: flex; flex-direction: column; gap: var(--space-1-5); flex: 0 1 auto; max-height: 60%; min-height: 0; min-width: 0; }
.td__col--team { flex: 1 1 0; max-height: none; }
@container (min-width: 700px) { .td__cols { flex-direction: row; gap: var(--space-6); } .td__col { flex: 1 1 0; max-height: none; } }
@container (max-height: 300px) and (max-width: 699px) { .td__col--team { display: none; } }
.td__needs, .td__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; flex: 0 1 auto; }
.td__need, .td__clear { flex: none; display: flex; align-items: center; gap: var(--space-2-5); min-height: 32px; font-size: var(--ui-text-sm); }
.td__clear { color: var(--ui-success-ink); font-weight: 600; }
.td__ico { width: 24px; height: 24px; border-radius: 7px; background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; flex: none; }
.td__ico .icon { width: 14px; height: 14px; }
.td__ico--warn { background: var(--ui-warning-soft); color: var(--ui-warning-ink); }
.td__text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td__act { font-size: var(--ui-text-xs); font-weight: 600; white-space: nowrap; color: var(--ui-primary-ink); text-decoration: none; }
.td__item { flex: none; display: flex; align-items: center; gap: var(--space-2); min-height: 30px; font-size: var(--ui-text-sm); }
.td__check { display: flex; align-items: center; gap: var(--space-2); flex: 1; min-width: 0; cursor: pointer; }
.td__check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ui-primary); flex: none; cursor: pointer; }
.td__check span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td__item.is-done .td__check span { color: var(--ui-muted); text-decoration: line-through; }
.td__who { font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; }
.td__del { width: 24px; height: 24px; opacity: 0; }
.td__del .icon { width: 14px; height: 14px; }
.td__item:hover .td__del, .td__del:focus-visible { opacity: 1; }
@media (hover: none) { .td__del { opacity: 1; } }
.td__add { flex: none; display: flex; gap: var(--space-1-5); margin-top: var(--space-1); }
.td__add .input { height: 32px; font-size: var(--ui-text-sm); }

/* Content activity, Team & storage */
.ct, .tm { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; min-height: 0; }
.mini3 { flex: none; display: flex; gap: var(--space-2-5); }
.mini { flex: 1 1 0; min-width: 0; padding: var(--space-2) var(--space-2-5); background: var(--ui-surface-2); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); }
.mini__v { font-size: var(--ui-text-2xl); font-weight: 700; line-height: 1.2; }
.mini__l { font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct__more { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; min-height: 0; }
.ct__types, .ct__drafts { display: flex; flex-direction: column; gap: var(--space-2); flex: 1 1 0; min-height: 0; min-width: 0; }
@container (min-width: 700px) { .ct__more { flex-direction: row; gap: var(--space-6); } }
@container (max-height: 300px) and (max-width: 699px) { .ct__drafts { display: none; } }
.tm__blocks { flex: none; display: flex; }
.tm__block { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1-5); padding: 0 var(--space-5); border-left: 1px solid var(--ui-line); }
.tm__block:first-child { padding-left: 0; border-left: 0; }
.tm__v { font-size: var(--ui-text-2xl); font-weight: 700; line-height: 1.2; white-space: nowrap; }
.tm__v span { font-size: var(--ui-text-sm); font-weight: 500; color: var(--ui-muted); }
.tm__sub { font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm__sub--wrap { white-space: normal; }
.tm__export { display: inline-flex; align-items: center; gap: var(--space-1-5); font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-primary-ink); text-decoration: none; }
.tm__export .icon { width: 14px; height: 14px; }
@container (max-width: 960px) { .tm__block--extra { display: none; } }
@container (max-width: 700px) { .tm__block--signins { display: none; } }
@container (max-width: 380px) { .tm__block--people { display: none; } }
.dw-avatars { display: flex; }
.dw-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: var(--ui-text-2xs); font-weight: 700; background: var(--ui-primary-soft); color: var(--ui-primary-ink); box-shadow: 0 0 0 2px var(--ui-surface); }
.dw-avatars .dw-avatar + .dw-avatar { margin-left: calc(-1 * var(--space-1)); }
.dw-avatar--1 { background: var(--ui-success-soft); color: var(--ui-success-ink); }
.dw-avatar--2 { background: var(--ui-warning-soft); color: var(--ui-warning-ink); }
.dw-avatar--3 { background: var(--ui-fill-strong); color: var(--ui-ink-2); }

/* Quick links, At a glance */
.ql { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); grid-auto-rows: 66px; gap: var(--space-2); flex: 1; min-height: 0; overflow: hidden; align-content: start; }
.ql__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1-5); min-width: 0; min-height: 0; padding: var(--space-1-5); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface-2); color: var(--ui-ink); font-weight: 600; font-size: var(--ui-text-sm); text-align: center; text-decoration: none; }
.ql__item:hover { border-color: var(--ui-primary); background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.ql__icon { width: 28px; height: 28px; border-radius: var(--ui-radius-sm); background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; flex: none; }
.ql__icon .icon { width: 16px; height: 16px; }
.ql__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ql__badge { position: absolute; top: 6px; right: 6px; padding: 0 var(--space-1-5); border-radius: var(--ui-radius-pill); background: var(--ui-primary); color: #fff; font-size: var(--ui-text-2xs); font-weight: 700; line-height: 16px; }
@container (max-width: 300px) { .ql { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 36px; gap: var(--space-1-5); } .ql__item { flex-direction: row; justify-content: flex-start; gap: var(--space-2-5); padding: var(--space-1) var(--space-2-5) var(--space-1) var(--space-1); text-align: left; } .ql__badge { position: static; margin-left: auto; } }
.gl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 58px; gap: var(--space-2); align-content: start; min-height: 0; overflow: hidden; flex: 1; }
.gl__item { position: relative; display: flex; min-width: 0; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); }
.gl__item:hover { border-color: var(--ui-primary); }
.gl__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-2) var(--space-2-5); color: var(--ui-ink); text-decoration: none; }
.gl__n { display: block; font-size: var(--ui-text-xl); font-weight: 700; line-height: 1.15; }
.gl__l { display: block; font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl__add { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: var(--ui-radius-sm); display: grid; place-items: center; color: var(--ui-muted); }
.gl__add:hover { background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.gl__add .icon { width: 14px; height: 14px; }

/* Add a widget, quick links editor */
.dash-drawer { position: fixed; inset: 0; z-index: 150; }
.dash-drawer[hidden] { display: none; }
.dash-drawer__scrim { position: absolute; inset: 0; background: rgba(21, 20, 31, .35); }
.dash-drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 100%); display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); overflow: auto; background: var(--ui-surface); box-shadow: -10px 0 30px rgba(20, 20, 40, .16); }
.dash-drawer__panel p { margin: 0; }
.dash-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dash-drawer__head h2 { margin: 0; font-size: var(--ui-text-xl); }
.dash-drawer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.dash-drawer__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2-5) var(--space-3); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); }
.dash-drawer__icon { width: 36px; height: 36px; border-radius: var(--ui-radius-md); background: var(--ui-primary-soft); color: var(--ui-primary-ink); display: grid; place-items: center; flex: none; }
.dash-drawer__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-drawer__text strong { font-size: var(--ui-text-sm); }
.dash-drawer__text span { font-size: var(--ui-text-xs); color: var(--ui-muted); }
.dash-drawer__added { display: none; align-items: center; gap: var(--space-1); font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-success-ink); white-space: nowrap; }
.dash-drawer__added .icon { width: 14px; height: 14px; }
.dash-drawer__item.is-added .dash-drawer__added { display: inline-flex; }
.dash-drawer__item.is-added [data-catalog-add] { display: none; }
.dash-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 48px); padding: 0; border: 0; background: transparent; }
.dash-dialog::backdrop { background: rgba(21, 20, 31, .45); }
.dash-dialog__card { display: flex; flex-direction: column; gap: var(--space-3-5); padding: var(--space-5) var(--space-6) var(--space-6); background: var(--ui-surface); border-radius: var(--ui-radius-xl); box-shadow: var(--ui-shadow-pop); }
.dash-dialog__card p { margin: 0; }
.dash-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dash-dialog__head h2 { margin: 0; font-size: var(--ui-text-xl); }
.dash-dialog__foot { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-1); }
.dash-dialog__error { color: var(--ui-danger-ink); font-size: var(--ui-text-sm); }
.dash-dialog__error[hidden] { display: none; }
.qle { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); }
.qle__row { display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-1-5) var(--space-1-5) var(--space-1-5) var(--space-2-5); border-top: 1px solid var(--ui-line); }
.qle__row:first-child { border-top: 0; }
.qle__label { font-weight: 600; font-size: var(--ui-text-sm); white-space: nowrap; }
.qle__where { flex: 1; min-width: 0; color: var(--ui-muted); font-size: var(--ui-text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qle__row .icon-btn { width: 28px; height: 28px; }
.qle__row .icon-btn .icon { width: 15px; height: 15px; }
.qle__empty { padding: var(--space-3); color: var(--ui-muted); font-size: var(--ui-text-sm); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1-5); }
.chip { display: inline-flex; align-items: center; gap: var(--space-1-5); height: 30px; padding: 0 var(--space-2-5); border: 1px dashed var(--ui-line-strong); border-radius: var(--ui-radius-pill); background: var(--ui-surface); font: 600 var(--ui-text-xs) var(--ui-font); color: var(--ui-ink-2); cursor: pointer; }
.chip:hover { border-style: solid; border-color: var(--ui-primary); background: var(--ui-primary-soft); color: var(--ui-primary-ink); }
.chip .icon { width: 14px; height: 14px; }
.qle__custom { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: var(--space-2); align-items: end; }
.qle__custom .field { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-ink-2); }
@media (max-width: 560px) { .qle__custom { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .dw { transition: none; } .dw.is-new { animation: none; } }
[data-fit] > [hidden] { display: none !important; }

/* The platform admin's dashboard (templates/platform/dashboard.html) */
.hs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: 66px; gap: var(--space-2) var(--space-4); flex: 1; min-height: 0; overflow: hidden; align-content: start; }
.hs__item { display: flex; align-items: flex-start; gap: var(--space-2-5); min-width: 0; }
.hs__dot { width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ui-fill); color: var(--ui-muted); }
.hs__dot .icon { width: 13px; height: 13px; }
.hs__dot--ok { background: var(--ui-success-soft); color: var(--ui-success-ink); }
.hs__dot--warn { background: var(--ui-warning-soft); color: var(--ui-warning-ink); }
.hs__dot--bad { background: var(--ui-danger-soft); color: var(--ui-danger-ink); }
.hs__text { min-width: 0; }
.hs__v { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.act__head, .act__row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 104px 44px; gap: var(--space-2); align-items: center; }
.act__head { flex: none; padding-bottom: var(--space-1); border-bottom: 1px solid var(--ui-line); font-size: var(--ui-text-2xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.act__head > :last-child, .act__row > :last-child { text-align: right; }
.act__name { min-width: 0; display: flex; align-items: center; gap: var(--space-1-5); }
.act__rows { flex: 1; }
@container (max-width: 380px) { .act__head, .act__row { grid-template-columns: minmax(0, 1fr) auto; } }
.side-split { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; min-height: 0; }
.side-split__side { display: none; flex-direction: column; gap: var(--space-2); min-height: 0; min-width: 0; }
@container (min-width: 700px) { .side-split { flex-direction: row; gap: var(--space-6); } .side-split > .chart { flex: 1 1 0; min-width: 0; } .side-split__side { display: flex; flex: 0 1 300px; } }
@container (min-height: 340px) and (max-width: 699px) { .side-split__side { display: flex; flex: 0 1 auto; max-height: 45%; } }
.badge--error { background: var(--ui-danger-soft); color: var(--ui-danger-ink); }
.st__warn { color: var(--ui-warning-ink); font-weight: 600; }
.bars__bar--warn { background: var(--ui-warning); }
.ob { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; overflow: hidden; flex: 1; }
.ob__row { flex: none; display: flex; flex-direction: column; gap: var(--space-1); }
.ob__line { display: flex; align-items: baseline; gap: var(--space-2); }
.ob__next { font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter--done > span { background: var(--ui-success); }
.ft { display: flex; flex-direction: column; gap: var(--space-4); flex: 1; min-height: 0; }
.ft__col { display: flex; flex-direction: column; gap: var(--space-2); flex: 1 1 0; min-height: 0; min-width: 0; }
@container (min-width: 700px) { .ft { flex-direction: row; gap: var(--space-6); } }
@container (max-height: 300px) and (max-width: 699px) { .ft__col + .ft__col { display: none; } }
.platform-churches { margin-top: var(--space-10); }
.platform-churches h2 { margin: 0; font-size: var(--ui-text-2xl); }

/* ------------------------------------------------------------------ the page editor: structure · page · settings
   Edge to edge: the structure tree on the left, the page in the middle and the
   selected thing's settings on the right, in the person's look (assets/look.js). */
.ed { height: 100vh; color: var(--ui-ink); background: var(--ui-surface); }
.ed__window { display: flex; height: 100%; overflow: hidden; background: var(--ui-surface); }

/* The structure */
.ed__tree { flex: none; width: 256px; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--ui-line);
  background: radial-gradient(150% 50% at 0% 0%, color-mix(in srgb, var(--ui-primary) 17%, transparent), transparent 75%), var(--ui-surface); }
.ed__brand { display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-5) var(--space-5) var(--space-3-5); min-width: 0; }
.ed__brand > .icon { flex: none; width: 28px; height: 28px; color: var(--ui-primary); }
.ed__brand > div { min-width: 0; }
.ed__brand strong { display: block; font-size: var(--ui-text-md); letter-spacing: -.01em; }
.ed__brand small { display: block; font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--space-3) var(--space-3); display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.ed-tree__label { padding: var(--space-3-5) var(--space-2-5) var(--space-1-5); font-size: var(--ui-text-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.ed-tree__row { --depth: 0; display: flex; align-items: center; padding-left: calc(var(--depth) * var(--space-4)); }
.ed-tree__chev, .ed-tree__gap { flex: none; width: 18px; }
.ed-tree__chev { display: grid; place-items: center; height: 34px; padding: 0; border: 0; border-radius: var(--ui-radius-sm); background: none; color: var(--ui-muted); cursor: pointer; }
.ed-tree__chev .icon { width: 12px; height: 12px; transition: transform .15s; }
.ed-tree__chev[aria-expanded="true"] .icon { transform: rotate(90deg); }
.ed-tree__chev:hover { color: var(--ui-ink); }
.ed-tree__item { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2-5); height: 34px; padding: 0 var(--space-2-5); border: 0; border-radius: var(--ui-radius); background: none; color: var(--ui-ink-2); font: var(--ui-text-sm) var(--ui-font); text-align: left; cursor: pointer; }
.ed-tree__item:hover { background: var(--ui-fill); }
.ed-tree__item.is-top { color: var(--ui-ink); font-weight: 500; }
.ed-tree__item.is-selected { background: var(--ui-primary-soft); color: var(--ui-ink); font-weight: 500; }
.ed-tree__item > .icon { flex: none; width: 17px; height: 17px; color: var(--ui-primary); }
.ed-tree__item.has-error::after { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-danger); }
.ed-tree__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A block's row: drag it among its siblings; its delete button shows on hover (and when it has focus). */
.ed-tree__row.is-block { position: relative; border-radius: var(--ui-radius); }
.ed-tree__tools { position: absolute; top: 50%; right: var(--space-1); transform: translateY(-50%); display: none; align-items: center; gap: 1px; }
.ed-tree__row.is-block:hover .ed-tree__tools, .ed-tree__row.is-block:focus-within .ed-tree__tools { display: flex; }
.ed-tree__row.is-block:hover .ed-tree__item, .ed-tree__row.is-block:focus-within .ed-tree__item { padding-right: var(--space-14); }
.ed-tree__grip { display: grid; place-items: center; width: 22px; height: 26px; color: var(--ui-muted); cursor: grab; }
.ed-tree__grip .icon { width: 14px; height: 14px; }
.ed-tree__del { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--ui-radius-sm); background: none; color: var(--ui-muted); cursor: pointer; }
.ed-tree__del .icon { width: 15px; height: 15px; }
.ed-tree__del:hover { background: var(--ui-danger-soft); color: var(--ui-danger); }
.ed-tree__del:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: -2px; }
.ed-tree__row.is-dragging { opacity: .4; }
.ed-tree__row.drop-before { box-shadow: 0 -2px 0 var(--ui-primary); }
.ed-tree__row.drop-after { box-shadow: 0 2px 0 var(--ui-primary); }
.ed-tree__add { --depth: 0; flex: none; display: flex; align-items: center; gap: var(--space-2-5); height: 34px; padding: 0 var(--space-2-5) 0 calc(var(--depth) * var(--space-4) + var(--space-7)); border: 0; border-radius: var(--ui-radius); background: none; color: var(--ui-muted); font: var(--ui-text-sm) var(--ui-font); text-align: left; cursor: pointer; }
.ed-tree__add .icon { flex: none; width: 15px; height: 15px; }
.ed-tree__add:hover { background: var(--ui-fill); color: var(--ui-ink); }
.ed-tree__add--top { color: var(--ui-primary); font-weight: 500; }
.ed-tree__add--top:hover { color: var(--ui-primary-ink); }
.ed__tree-foot { flex: none; margin: 0 var(--space-3); padding: var(--space-1) 0 var(--space-3); border-top: 1px solid var(--ui-line); display: flex; flex-direction: column; gap: 2px; }

/* The page and the bar above it */
.ed__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5) var(--space-6) var(--space-6); background: var(--ui-bg); }
.ed__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.ed__heading { min-width: 0; }
.ed__back { display: inline-flex; align-items: center; gap: var(--space-1-5); color: var(--ui-primary); font-size: var(--ui-text-sm); font-weight: 500; text-decoration: none; }
.ed__back .icon { width: 15px; height: 15px; }
.ed__back:hover { color: var(--ui-primary-ink); }
.ed__title { display: flex; align-items: center; gap: var(--space-2-5); margin-top: var(--space-1-5); min-width: 0; }
.ed__title h1 { margin: 0; font-size: var(--ui-text-4xl); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ed__tools .seg { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); }
.ed__tools .seg__btn { height: 30px; }
.ed__tools .seg__btn.is-active { background: var(--ui-primary-soft); color: var(--ui-primary); box-shadow: none; }
.ed__tools .seg--lang .seg__btn { width: auto; padding: 0 var(--space-2-5); font: 600 var(--ui-text-xs) var(--ui-font); }
.ed__actions { display: flex; align-items: center; gap: var(--space-2); }
.ed__actions .btn { height: 38px; border-radius: var(--ui-radius-md); }
.ed__actions .btn:not(.btn--primary) { border-color: var(--ui-line-2); }
.ed__body { flex: 1; min-height: 0; display: flex; gap: var(--space-4); }
.ed__canvas { flex: 1; min-width: 0; display: flex; align-items: flex-start; overflow: auto; scrollbar-width: thin; }
.ed__zoom { height: 38px; padding: 0 var(--space-2); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface); color: var(--ui-ink-2); font: 500 var(--ui-text-xs) var(--ui-font); cursor: pointer; }
.ed__zoom:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 1px; }
/* admin.js fitFrame sizes the frame and scales the page inside it to the device's width. */
.ed__canvas .canvas__frame { flex: none; margin-inline: auto; width: 100%; height: 100%; box-sizing: border-box; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-xl); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); background: var(--ui-surface); transition: width .25s ease; }
.ed__canvas .canvas__frame iframe { max-width: none; }

/* The settings of what's selected */
.ed__panel { flex: none; width: 340px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-xl); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.ed-panel__head { flex: none; display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-4) var(--space-3) var(--space-3-5) var(--space-5); }
.ed-panel__name { flex: 1; min-width: 0; }
.ed-panel__crumb { font-size: var(--ui-text-xs); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-panel__title { margin: var(--space-1) 0 0; font-size: var(--ui-text-xl); font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-panel__tools { flex: none; display: flex; gap: 2px; }
.ed-panel__tools .icon-btn { width: 30px; height: 30px; color: var(--ui-muted); }
.ed-panel__tools .icon { width: 16px; height: 16px; }
.ed-panel__body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 var(--space-4) var(--space-6); scrollbar-width: thin; }
.ed-panel__body > .fields, .ed-block > .fields, .ed-panel__body > .tab-panel > .fields { gap: var(--space-2-5); }
/* Each setting in a card of its own */
.ed-panel__body > .fields > .field, .ed-panel__body > .fields > .field-row > .field,
.ed-block > .fields > .field, .ed-block > .fields > .field-row > .field,
.ed-panel__body > .tab-panel > .fields > .field, .ed-panel__body > .tab-panel > .fields > .field-row > .field {
  padding: var(--space-3-5); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); }
.ed-panel__body .field__label { font-weight: 500; }
.ed-panel__body > .fields > .field > .field__label, .ed-block > .fields > .field > .field__label, .ed-panel__body > .tab-panel > .fields > .field > .field__label { margin-bottom: var(--space-2-5); }
.ed-panel__body .field-row { gap: var(--space-2-5); }
.ed-panel__body .doc-meta, .ed-panel__body .doc-tools { margin-top: var(--space-3); }
.ed-panel__body .tab-panel__intro { margin-bottom: var(--space-3); }
.ed-panel__body .btabs { position: sticky; top: 0; z-index: 2; margin: 0 calc(-1 * var(--space-4)) var(--space-3); padding: 3px; border-radius: 0; background: var(--ui-surface); box-shadow: 0 1px 0 var(--ui-line); }
.ed-panel__body .btabs__btn { border-radius: var(--ui-radius-sm); }
.ed-panel__body .btabs__btn.is-active { background: var(--ui-primary-soft); color: var(--ui-primary); box-shadow: none; }
.ed-panel__foot { flex: none; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--ui-line); }
.ed-panel__foot[hidden] { display: none; }
.ed--closed .ed__panel { display: none; }
.ed-panel__close { flex: none; width: 30px; height: 30px; margin-left: var(--space-1); color: var(--ui-muted); }
.ed-panel__close .icon { width: 16px; height: 16px; }
.ed-block { display: flex; flex-direction: column; gap: var(--space-2-5); }
.ed-kids { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-3-5); border-radius: var(--ui-radius-lg); background: var(--ui-surface-2); color: var(--ui-ink-2); font-size: var(--ui-text-sm); }
.ed-note { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-3-5); border-radius: var(--ui-radius-lg); background: var(--ui-surface-2); color: var(--ui-ink-2); font-size: var(--ui-text-sm); line-height: 1.5; }
.ed-theme { display: flex; flex-direction: column; gap: var(--space-2); }
.ed-link { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3-5); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); color: var(--ui-ink); font-weight: 500; font-size: var(--ui-text-sm); text-decoration: none; }
.ed-link:hover { border-color: var(--ui-line-strong); background: var(--ui-surface-2); }
.ed-link .icon { width: 15px; height: 15px; color: var(--ui-muted); }
/* Settings: what isn't in the menu, in sections of cards */
.settings-sec { margin-top: var(--space-6); }
.settings-sec__title { margin: 0 0 var(--space-3); font-size: var(--ui-text-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.settings-card { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-xl); background: var(--ui-surface); color: var(--ui-ink); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.settings-card { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.settings-card:hover { border-color: var(--ui-line-strong); box-shadow: var(--ui-shadow); }
.settings-card:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
.settings-card__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--ui-radius-md); background: var(--ui-primary-soft); color: var(--ui-primary); }
.settings-card__icon .icon { width: 18px; height: 18px; }
.settings-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.settings-card__text strong { font-size: var(--ui-text-md); font-weight: 600; }
.settings-card__text small { color: var(--ui-muted); font-size: var(--ui-text-sm); line-height: 1.45; }
.settings-card__go { flex: none; width: 16px; height: 16px; margin-top: var(--space-2-5); color: var(--ui-muted); }

/* The Add dialog's tabs (Sections, From your website…) */
.block-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--ui-radius-md); background: var(--ui-fill); }
.block-tabs__btn { display: inline-flex; align-items: center; gap: var(--space-1-5); padding: var(--space-1-5) var(--space-3); border: 0; border-radius: var(--ui-radius); background: transparent; color: var(--ui-ink-2); font: 500 var(--ui-text-sm) var(--ui-font); cursor: pointer; }
.block-tabs__btn small { color: var(--ui-muted); font-size: var(--ui-text-2xs); font-weight: 600; }
.block-tabs__btn:hover { color: var(--ui-ink); }
.block-tabs__btn.is-active { background: var(--ui-surface); color: var(--ui-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .1), 0 0 0 1px rgba(15, 23, 42, .04); }
.block-tabs__btn:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 1px; }
.block-option[hidden] { display: none; }
.block-groups.has-tabs .block-group__title { display: none; }
.block-groups.has-tabs.is-searching .block-group__title { display: block; }

/* Editor look */
.ed-looks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.ed-look { --la: #0a2fb8; --lb: #2f63f0; display: flex; align-items: center; gap: var(--space-2-5); min-height: 44px; padding: var(--space-1-5) var(--space-2-5); border: 1.5px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface); color: var(--ui-ink); font: 500 var(--ui-text-sm) var(--ui-font); text-align: left; cursor: pointer; }
.ed-look:hover { border-color: var(--ui-line-strong); }
.ed-look.is-active { border-color: var(--ui-ink); }
.ed-look i { flex: none; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--la), var(--lb)); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .1); }
.ed-look-custom { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-3-5); padding-top: var(--space-3-5); border-top: 1px solid var(--ui-line); font-size: var(--ui-text-sm); color: var(--ui-ink-2); }
.ed-look-custom > span { flex: 1; font-weight: 500; color: var(--ui-ink); }
.ed-look-colour { display: inline-flex; align-items: center; gap: var(--space-1-5); }
.kd--look .kd__card { width: min(520px, calc(100vw - 2 * var(--space-4))); }
.ed-looks-wrap { margin-top: var(--space-3); }
.ed-look-colour input { width: 34px; height: 28px; padding: 0; border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-sm); background: none; cursor: pointer; }

@media (max-width: 1180px) {
  .ed__tree { width: 224px; }
  .ed__panel { width: 300px; }
  .ed__main { padding: var(--space-4); }
}
/* Small screens: one column that scrolls, the page in the middle. */
@media (max-width: 860px) {
  body.is-live { overflow: auto; }
  .ed { height: auto; min-height: 100vh; }
  .ed__window { flex-direction: column; height: auto; }
  .ed__tree { width: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--ui-line); }
  .ed__body { flex-direction: column; }
  .ed__canvas { height: 70vh; }
  .ed__panel { width: auto; max-height: 80vh; }
}
