/* ==========================================================================
   Content studio — dashboard styles
   Reuses the design tokens from style.css and adds the admin shell,
   tables, editor and form components.
   ========================================================================== */

/* The public site's smooth anchor navigation should not animate dashboard
   page changes or explicit links to a field in a different editor. */
.admin-html { scroll-behavior: auto; }

.admin-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

[data-theme='dark'] .admin-body { color-scheme: dark; }

.admin-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}

/* ------------------------------------------------------------------ sidebar */

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 22px 18px;
  background: var(--card);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 2px;
  text-decoration: none;
  color: var(--ink);
}

.admin-brand .brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(140deg, var(--blue), var(--violet));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.admin-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.admin-brand-text strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.admin-brand-text small {
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.admin-side-link:hover {
  background: var(--bg-3);
  color: var(--ink);
}

.admin-side-link.is-active {
  background: rgba(47, 91, 255, 0.1);
  color: var(--blue);
  font-weight: 650;
}

[data-theme='dark'] .admin-side-link.is-active {
  background: rgba(91, 124, 255, 0.16);
}

.admin-side-link svg {
  flex: none;
  opacity: 0.85;
}

.admin-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.admin-side-foot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-side-foot form {
  margin: 0;
}

.admin-side-link--btn {
  background: none;
}

.admin-side-link--btn:hover {
  color: var(--coral);
}

/* -------------------------------------------------------------------- main */

.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 30px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.admin-menu-btn {
  display: none;
}

.admin-topbar-title {
  min-width: 0;
}

.admin-topbar-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.admin-topbar-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.admin-topbar-cta {
  padding: 9px 15px;
  font-size: 0.83rem;
}

.admin-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  padding: 26px 30px 60px;
}

.admin-foot {
  margin-top: auto;
  padding: 18px 30px 26px;
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-foot code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-3);
}

/* ------------------------------------------------------------------- flash */

.admin-flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 30px 0;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 550;
}

.admin-flash svg {
  flex: none;
}

.admin-flash--ok {
  background: rgba(23, 166, 115, 0.1);
  border-color: rgba(23, 166, 115, 0.3);
  color: var(--green);
}

.admin-flash--error {
  background: rgba(239, 83, 64, 0.1);
  border-color: rgba(239, 83, 64, 0.32);
  color: var(--coral);
}

.admin-flash--warn {
  background: rgba(240, 160, 32, 0.12);
  border-color: rgba(240, 160, 32, 0.32);
  color: #9a6400;
}

[data-theme='dark'] .admin-flash--warn {
  color: var(--amber);
}

.admin-flash span {
  flex: 1;
}

.admin-flash-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.admin-flash-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

/* ------------------------------------------------------------------- cards */

.admin-card {
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.012em;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-card--danger {
  border-color: rgba(239, 83, 64, 0.35);
}

.admin-muted {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.admin-empty {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-empty a {
  color: var(--blue);
  font-weight: 600;
}

.admin-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 24px;
  text-align: center;
}

/* ------------------------------------------------------------------- stats */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 14px;
  margin: 16px 30px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

a.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  border-radius: 10px;
  color: #fff;
}

.stat-icon[data-tone='blue'] {
  background: var(--blue);
}

.stat-icon[data-tone='teal'] {
  background: var(--teal);
}

.stat-icon[data-tone='amber'] {
  background: var(--amber);
}

.stat-icon[data-tone='coral'] {
  background: var(--coral);
}

.stat-icon[data-tone='violet'] {
  background: var(--violet);
}

.stat-icon[data-tone='pink'] {
  background: var(--pink);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
}

/* ------------------------------------------------------------------ lists */

.admin-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.18s var(--ease);
}

.admin-list-item:hover {
  background: var(--bg-2);
}

.admin-list-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}

.admin-list-main strong {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-main span {
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-list-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.dot-unread {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--coral);
  vertical-align: middle;
}

/* ------------------------------------------------------------------- tabs */

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.admin-tab span {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-3);
  font-size: 0.72rem;
  font-weight: 650;
}

.admin-tab:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.admin-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.admin-tab.is-active span {
  background: rgba(255, 255, 255, 0.18);
}

/* ------------------------------------------------------------------ table */

.admin-table-card {
  padding: 6px 0;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.admin-table th {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: var(--bg-2);
}

.admin-table-title {
  display: block;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
}

.admin-table-title:hover {
  color: var(--blue);
}

.admin-table-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-table-date {
  color: var(--ink-2);
  white-space: nowrap;
}

.col-actions {
  width: 1%;
  white-space: nowrap;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-row-actions form {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.badge--published {
  background: rgba(23, 166, 115, 0.14);
  color: var(--green);
}

.badge--draft {
  background: rgba(240, 160, 32, 0.16);
  color: #9a6400;
}

[data-theme='dark'] .badge--draft {
  color: var(--amber);
}

/* ------------------------------------------------------------------ buttons */

/* Shared dashboard variants use theme tokens instead of the browser's grey
   button defaults. Keep contrast in both schemes, including focus and hover. */
.admin-body .btn-ghost {
  border-color: var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.admin-body .btn-ghost:hover {
  border-color: var(--blue);
  background: var(--bg-3);
  color: var(--blue);
}
.admin-body .btn-danger {
  border-color: color-mix(in srgb, var(--coral) 40%, transparent);
  background: color-mix(in srgb, var(--coral) 12%, var(--card));
  color: var(--coral);
}
.admin-body .btn-danger:hover {
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
}
.admin-body .btn:focus-visible,
.admin-body .icon-btn:focus-visible,
.admin-body .admin-page-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.admin-body .admin-field input[type='file']::file-selector-button {
  background: var(--bg-3);
  color: var(--blue);
  border-color: var(--blue);
}

.icon-btn--sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.icon-btn--danger:hover {
  color: var(--coral);
  background: rgba(239, 83, 64, 0.12);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.8rem;
}

.btn-quiet-danger {
  color: var(--coral);
}

.btn-quiet-danger:hover {
  background: rgba(239, 83, 64, 0.1);
  border-color: rgba(239, 83, 64, 0.35);
}

.admin-btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
}

/* ------------------------------------------------------------------- forms */

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.admin-field:last-child {
  margin-bottom: 0;
}

.admin-field label,
.admin-field > span {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-field input[type='text'],
.admin-field input[type='email'],
.admin-field input[type='url'],
.admin-field input[type='tel'],
.admin-field input[type='date'],
.admin-field input[type='password'],
.admin-field select,
.admin-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--card);
  box-shadow: var(--ring);
}

.admin-field textarea {
  resize: vertical;
  min-height: 70px;
}

.admin-field--split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}

.admin-field--narrow {
  max-width: 110px;
}

.admin-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-field-row .admin-field {
  margin-bottom: 0;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.field-hint code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--bg-3);
}

.field-error {
  margin: 0;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 550;
}

.input-title {
  font-family: var(--font-display) !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 10px;
}

/* ------------------------------------------------------------------ editor */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.editor-main,
.editor-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.editor-side {
  position: sticky;
  top: 88px;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.editor-stats {
  color: var(--muted);
  font-size: 0.76rem;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin: 12px 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}

.editor-toolbar button {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.editor-toolbar button:hover {
  background: var(--card);
  color: var(--ink);
}

.editor-toolbar-sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line-strong);
}

.editor-preview-toggle {
  margin-left: auto;
  padding: 0 12px !important;
  border: 1px solid var(--line-strong) !important;
  background: var(--card) !important;
  font-size: 0.75rem !important;
}

.editor-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.editor-split.is-preview-off {
  grid-template-columns: minmax(0, 1fr);
}

.editor-split.is-preview-off .editor-preview {
  display: none;
}

.editor-pane textarea {
  width: 100%;
  min-height: 460px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.7;
  resize: vertical;
}

.editor-pane textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--ring);
}

.editor-preview {
  min-height: 460px;
  max-height: 720px;
  padding: 16px 18px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.editor-preview h1,
.editor-preview h2,
.editor-preview h3 {
  margin: 1.1em 0 0.4em;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.3;
}

.editor-preview h1 {
  font-size: 1.35rem;
}

.editor-preview h2 {
  font-size: 1.18rem;
}

.editor-preview h3 {
  font-size: 1.04rem;
}

.editor-preview > *:first-child {
  margin-top: 0;
}

.editor-preview p {
  margin: 0 0 0.85em;
}

.editor-preview blockquote {
  margin: 1em 0;
  padding-left: 14px;
  border-left: 3px solid var(--violet);
  color: var(--ink);
  font-style: italic;
}

.editor-preview ul,
.editor-preview ol {
  margin: 0 0 0.85em;
  padding-left: 1.3em;
}

.editor-preview code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-3);
  font-size: 0.86em;
}

.editor-preview pre {
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--bg-3);
}

.editor-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.editor-placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------- cover picker */

.cover-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--bg-2);
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px;
}

.image-pick {
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--bg-3);
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.image-pick img {
  width: 100%;
  height: 52px;
  object-fit: cover;
}

.image-pick:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.image-pick.is-active {
  border-color: var(--blue);
}

/* --------------------------------------------------------------- messages */

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.message-card {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.message-card.is-unread {
  border-left: 3px solid var(--blue);
}

.message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.message-who {
  display: flex;
  align-items: center;
  gap: 11px;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--teal), var(--blue));
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
}

.message-who strong {
  display: block;
  font-size: 0.9rem;
}

.message-who a {
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.message-who a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.message-time {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.message-body {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-line;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-actions form {
  margin: 0;
}

.message-card.is-read {
  opacity: 0.86;
}

/* ----------------------------------------------------------------- profile */

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.social-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
}

.social-row-grid {
  display: grid;
  grid-template-columns: 130px minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.social-row .admin-field {
  margin-bottom: 0;
}

.social-row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 2px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.switch input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* ---------------------------------------------------------- certifications */

.cert-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.cert-card-admin {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cert-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cert-badge-admin {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--amber), var(--coral));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.cert-card-title {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.3;
}

.cert-card-issuer {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.cert-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.cert-card-actions form {
  margin: 0;
}

/* -------------------------------------------------------------- quick grid */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.quick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}

.quick:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--card);
}

.quick svg {
  color: var(--blue);
  margin-bottom: 4px;
}

.quick strong {
  font-size: 0.88rem;
}

.quick span {
  color: var(--muted);
  font-size: 0.76rem;
}

/* ------------------------------------------------------------------ login */

.admin-login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at 20% 10%, rgba(47, 91, 255, 0.12), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(122, 92, 240, 0.14), transparent 55%), var(--bg);
}

.admin-login {
  width: 100%;
  max-width: 400px;
}

.admin-login-card {
  padding: 34px 30px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.admin-login-eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.admin-login-card h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.025em;
}

.admin-login-lede {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.6;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-login-error {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(239, 83, 64, 0.1);
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 550;
}

.admin-login-hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.admin-login-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-3);
  color: var(--ink);
}

.admin-login-back {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  text-decoration: none;
}

.admin-login-back:hover {
  color: var(--ink);
}

.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;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: start;
  }

  .social-row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .social-row-side {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: 258px;
    transform: translateX(-100%);
    transition: transform 0.26s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .admin-sidebar.is-open {
    transform: none;
  }

  .admin-menu-btn {
    display: grid;
  }

  .admin-topbar {
    padding: 14px 18px;
  }

  .admin-content,
  .stat-grid {
    padding-left: 18px;
    padding-right: 18px;
  }

  .stat-grid {
    margin-left: 0;
    margin-right: 0;
  }

  .admin-flash {
    margin-left: 18px;
    margin-right: 18px;
  }

  .editor-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-preview {
    min-height: 240px;
    max-height: 420px;
  }

  .admin-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 620px) {
  .admin-topbar-title p {
    display: none;
  }

  .admin-topbar-cta span {
    display: none;
  }

  .admin-topbar-cta {
    padding: 9px 11px;
  }

  .admin-field--split,
  .admin-field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .social-row-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-sidebar,
  .quick,
  .stat-card,
  .post-card {
    transition: none;
  }
}

/* ==========================================================================
   Setup wizard
   ========================================================================== */

.setup-body {
  display: block;
  min-height: 100vh;
  padding: 40px 20px 64px;
  background: radial-gradient(circle at 15% 5%, rgba(47, 91, 255, 0.1), transparent 50%),
    radial-gradient(circle at 90% 95%, rgba(122, 92, 240, 0.12), transparent 55%), var(--bg);
}

.setup {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.setup-head {
  margin-bottom: 20px;
}

.setup-eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.setup-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.setup-step.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.setup-step.is-done {
  color: var(--green);
}

.setup-step-num {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--bg-3);
  font-size: 0.68rem;
  font-weight: 700;
}

.setup-step.is-active .setup-step-num {
  background: var(--blue);
  color: #fff;
}

.setup-step.is-done .setup-step-num {
  background: rgba(23, 166, 115, 0.16);
  color: var(--green);
}

.setup-card {
  padding: 32px 30px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.setup-card h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.setup-lede {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.62;
}

.setup-card .admin-field {
  margin-bottom: 16px;
}

.setup-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 83, 64, 0.3);
  border-radius: 10px;
  background: rgba(239, 83, 64, 0.09);
  color: var(--coral);
  font-size: 0.83rem;
  font-weight: 550;
  line-height: 1.5;
}

.setup-error svg {
  flex: none;
  margin-top: 1px;
}

.setup-choice-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.setup-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.setup-choice:hover {
  border-color: var(--ink-2);
}

.setup-choice.is-selected {
  border-color: var(--blue);
  background: var(--card);
  box-shadow: var(--ring);
}

.setup-choice input {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--blue);
  cursor: pointer;
}

.setup-choice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.setup-choice-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
}

.setup-choice-title svg {
  color: var(--blue);
}

.setup-choice-desc {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.55;
}

.setup-choice-desc code,
.setup-card code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-3);
  color: var(--ink-2);
  font-size: 0.92em;
}

.setup-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(23, 166, 115, 0.14);
  color: var(--green);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.setup-tag--muted {
  background: var(--bg-3);
  color: var(--muted);
}

.setup-uri {
  margin-bottom: 16px;
}

.setup-mode {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.setup-mode legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.setup-mode-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 9px;
}

.setup-mode-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.setup-mode-option:hover {
  border-color: var(--ink-2);
}

.setup-mode-option.is-selected {
  border-color: var(--blue);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--ring);
}

.setup-mode-option input {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.setup-fields {
  margin-bottom: 16px;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 14px;
  margin-bottom: 10px;
}

.setup-grid .admin-field {
  margin-bottom: 0;
}

.setup-field--wide {
  grid-column: 1 / -1;
}

.setup-fields .field-hint code {
  word-break: break-all;
}

@media (max-width: 560px) {
  .setup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .setup-field--wide {
    grid-column: auto;
  }
}

.setup-test {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.setup-test-result {
  flex: 1;
  min-width: 200px;
  margin: 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.setup-test-result.is-ok {
  color: var(--green);
}

.setup-test-result.is-error {
  color: var(--coral);
}

.setup-test-result.is-pending {
  color: var(--ink-2);
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.setup-optional {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: none;
}

.setup-foot {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.setup-meter {
  overflow: hidden;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--bg-3);
}

.setup-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 0.25s var(--ease), background 0.25s var(--ease);
}

.setup-meter span[data-strength='2'] {
  background: var(--amber);
}

.setup-meter span[data-strength='3'] {
  background: var(--teal);
}

.setup-meter span[data-strength='4'] {
  background: var(--green);
}

.setup-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(240, 160, 32, 0.1);
  color: var(--ink-2);
  font-size: 0.79rem;
  line-height: 1.55;
}

.setup-note svg {
  flex: none;
  margin-top: 2px;
  color: var(--amber);
}

.setup-note--center {
  justify-content: center;
  text-align: center;
  background: var(--bg-2);
}

.setup-done {
  text-align: center;
}

.setup-done-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(23, 166, 115, 0.14);
  color: var(--green);
}

.setup-done .setup-lede {
  margin-bottom: 20px;
}

.setup-summary {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  text-align: left;
}

.setup-summary div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.setup-summary dt {
  flex: 0 0 110px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.setup-summary dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 550;
  word-break: break-word;
}

.setup-summary-uri {
  display: block;
  width: 100%;
  margin-top: 2px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

.setup-done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.admin-login-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(23, 166, 115, 0.1);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 550;
}

@media (max-width: 560px) {
  .setup-body {
    padding: 24px 14px 48px;
  }

  .setup-card {
    padding: 24px 20px 20px;
  }

  .setup-step-label {
    display: none;
  }

  .setup-step.is-active .setup-step-label {
    display: inline;
  }

  .setup-actions {
    flex-direction: column-reverse;
  }

  .setup-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .setup-summary dt {
    flex-basis: 100%;
  }
}

/* ------------------------------------------------- certificate documents */

.doc-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
}

.doc-current.is-empty {
  border-style: dashed;
}

.doc-current-thumb {
  width: 96px;
  height: 68px;
  object-fit: cover;
  object-position: top center;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card);
}

.doc-current-tile {
  display: grid;
  place-items: center;
  width: 96px;
  height: 68px;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--violet);
}

.doc-current-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.doc-current-info strong {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-current-info span {
  color: var(--muted);
  font-size: 0.76rem;
}

.doc-current-remove {
  width: 100%;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.doc-current.is-empty .doc-current-remove {
  display: none;
}

.doc-current-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-field input[type='file'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
}

.admin-field input[type='file']:hover {
  border-color: var(--blue);
  color: var(--ink);
}

.admin-field input[type='file']::file-selector-button {
  margin-right: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.doc-picker {
  margin: 4px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
}

.doc-picker legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.doc-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.doc-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 9px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.doc-pick:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.doc-pick.is-active,
.doc-pick:has(input:checked) {
  border-color: var(--blue);
}

.doc-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.doc-pick img {
  width: 100%;
  height: 66px;
  object-fit: cover;
  object-position: top center;
  border-radius: 5px;
}

.doc-pick-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 66px;
  border-radius: 5px;
  background: var(--bg-3);
  color: var(--violet);
  font-size: 0.74rem;
  font-weight: 650;
}

.doc-pick-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s var(--ease);
}

.doc-chip:hover {
  border-color: var(--line-strong);
}

.doc-chip img {
  width: 38px;
  height: 48px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.doc-chip-tile {
  display: grid;
  place-items: center;
  width: 38px;
  height: 48px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--violet);
}

.doc-chip-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.doc-chip-text strong {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-chip-text span {
  color: var(--muted);
  font-size: 0.72rem;
}

.doc-chip > svg {
  flex: none;
  color: var(--muted);
}

/* ------------------------------------------------------------- appearance */

.appearance-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

/* One custom property per accent, so every preview reads the same source. */
[data-accent='blue'] {
  --accent: var(--blue);
}

[data-accent='teal'] {
  --accent: var(--teal);
}

[data-accent='amber'] {
  --accent: var(--amber);
}

[data-accent='coral'] {
  --accent: var(--coral);
}

[data-accent='pink'] {
  --accent: var(--pink);
}

[data-accent='violet'] {
  --accent: var(--violet);
}

.accent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accent-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.accent-preview {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 60%);
  box-shadow: 0 10px 20px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.accent-body {
  flex: 1;
  min-width: 0;
}

.accent-title {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.accent-hint {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 450;
}

.accent-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.accent-swatch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.accent-swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.accent-swatch-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.accent-swatch:hover .accent-swatch-dot {
  transform: scale(1.09);
}

.accent-swatch input:checked + .accent-swatch-dot {
  box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--accent);
}

.accent-swatch input:focus-visible + .accent-swatch-dot {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.accent-changed {
  flex: none;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.accent-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}

.accent-mini {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.accent-mini-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 60%);
  box-shadow: 0 8px 16px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.accent-mini-title {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.accent-mini-bar {
  display: block;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 24%, var(--bg-3));
  transition: background 0.25s var(--ease);
}

.admin-form-actions--split {
  align-items: center;
  justify-content: space-between;
}

.admin-form-actions--split .field-hint {
  margin: 0;
  max-width: 46ch;
}

.admin-form-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 620px) {
  .accent-row {
    flex-wrap: wrap;
  }

  .admin-form-actions--split {
    align-items: flex-start;
  }
}

/* ------------------------------------------------------------ posts tools */

.posts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.posts-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.posts-search-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  height: 36px;
  min-width: 210px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--muted);
}

.posts-search-field:focus-within {
  border-color: var(--blue);
  background: var(--card);
}

.posts-search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
}

.posts-search-field input:focus {
  outline: none;
}

.posts-search select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
}

.posts-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.posts-bulk-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.posts-bulk-count[data-has-selection='true'] {
  color: var(--ink);
}

.posts-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.col-check {
  width: 1%;
  padding-right: 0 !important;
}

.col-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}

.pin-mark {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  color: var(--amber);
  vertical-align: -1px;
}

.admin-table-meta--dim {
  opacity: 0.72;
}

.icon-btn.is-on {
  color: var(--amber);
}

.posts-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.posts-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.posts-foot-link {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 0;
}

.admin-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.admin-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.admin-page-btn:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.admin-page-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.admin-page-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------------------------------------------------------------- topics */

.admin-lede {
  margin: 0 0 16px;
  max-width: 68ch;
}

.admin-count-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 650;
}

.admin-columns--even {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topic-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
}

.topic-row:hover {
  background: var(--bg-2);
}

.topic-form {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.topic-form input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
}

.topic-form input:hover {
  border-color: var(--line);
}

.topic-form input:focus {
  border-color: var(--blue);
  background: var(--card);
  outline: none;
}

.topic-count {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.admin-switch-row {
  margin: 2px 0 4px;
  white-space: normal;
}

/* Settings page: a labelled switch and a small fact list, reusing the form look. */
.admin-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}

.admin-switch input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  flex: none;
}

.settings-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0;
}

.settings-facts div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}

.settings-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-facts dd {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink);
  word-break: break-word;
}

.editor-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.editor-secondary .btn {
  flex: 1;
  justify-content: center;
}

/* ----------------------------------------------------------- quick links */

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}

.quick-link:hover {
  border-color: var(--blue);
  background: var(--card);
  color: var(--ink);
}

/* -------------------------------------------------- database unavailable */

.setup-diagnostic {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--coral);
  border-radius: 10px;
  background: var(--bg-2);
}

.setup-diagnostic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 0.84rem;
}

.setup-diagnostic-row span {
  min-width: 74px;
  color: var(--muted);
  font-weight: 600;
}

.setup-diagnostic-row code {
  word-break: break-all;
}

.setup-diagnostic-row--error strong {
  color: var(--coral);
  font-weight: 600;
}

.setup-subhead {
  margin: 20px 0 12px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------- blog button link */

.blog-button-card {
  margin-top: 18px;
}

.blog-button-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.blog-button-field {
  flex: 1 1 320px;
  margin-bottom: 0;
}

.blog-button-field input {
  width: 100%;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.86rem;
}

/* -------------------------------------------------------- toolkit editor */

/*
 * The toolkit reads as one list, not as a form: a picker at the top, then a row
 * per tool — drag handle, the mark in its own colour, the name and what the
 * logo resolved to, and a way to remove it. The row is a grid, so a long tool
 * name wraps inside its cell instead of pushing the row apart.
 */

.toolkit-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 5%, var(--card)), var(--card));
}

.toolkit-picker .admin-field {
  margin: 0;
}

.toolkit-picker input {
  width: 100%;
}

.toolkit-picker-add {
  height: 38px;
  white-space: nowrap;
}

.toolkit-list {
  display: grid;
  gap: 6px;
}

/* The empty state: a hint in place of the rows, never next to a blank one. */
.toolkit-list[data-enhanced][data-empty] > .toolkit-row {
  display: none;
}

.toolkit-list[data-enhanced][data-empty]::after {
  content: attr(data-empty-hint);
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.toolkit-row {
  display: grid;
  /* Grip · mark · name and logo · remove. The hidden `toolIcon` input is also a
     child but `display: none`, so it takes no cell. */
  grid-template-columns: 16px 40px minmax(0, 1fr) 30px;
  grid-auto-flow: row;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s var(--ease);
}

/* The hidden logo value is a grid item with no box: it must not take a cell. */
.toolkit-row > input[type='hidden'] {
  display: none;
}

.toolkit-row:hover {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
}

.toolkit-row:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent);
}

.toolkit-row.is-dragging {
  opacity: 0.55;
  border-style: dashed;
}

.toolkit-row.is-new {
  animation: toolkit-arrive 0.9s var(--ease);
}

@keyframes toolkit-arrive {
  from {
    background: color-mix(in srgb, var(--blue) 12%, var(--card));
  }
  to {
    background: var(--card);
  }
}

.toolkit-grip {
  display: grid;
  place-items: center;
  height: 28px;
  color: var(--line-strong);
  cursor: grab;
}

.toolkit-grip:active {
  cursor: grabbing;
}

.toolkit-row:hover .toolkit-grip {
  color: var(--muted);
}

/* The mark is also the button: click it to choose a different logo. */
.toolkit-preview {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}

.toolkit-preview:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
}

.toolkit-preview:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.toolkit-preview.is-brand {
  border-style: solid;
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: color-mix(in srgb, var(--brand) 12%, var(--card));
  color: var(--brand);
}

.toolkit-brand {
  display: grid;
  place-items: center;
  line-height: 0;
}

.toolkit-initials {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.toolkit-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.toolkit-fields input {
  width: 100%;
  min-width: 0;
  font-weight: 550;
}

.toolkit-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  font-size: 0.74rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
}

.toolkit-meta [data-tool-logo-name] {
  font-weight: 600;
  color: var(--blue);
}

.toolkit-meta [data-tool-logo-name].is-auto {
  color: var(--muted);
}

.toolkit-meta-hint {
  color: var(--muted);
}

.toolkit-count {
  margin: 0;
}

.toolkit-card {
  margin-top: 18px;
}

/* ---- the logo picker ---- */

.logo-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(640px, 82vh);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(8, 14, 30, 0.45);
  overflow: hidden;
}

.logo-dialog::backdrop {
  background: rgba(9, 13, 24, 0.45);
  backdrop-filter: blur(2px);
}

.logo-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}

.logo-dialog-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.logo-dialog-head p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.logo-dialog input[type='search'] {
  width: calc(100% - 36px);
  margin: 0 18px 12px;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 6px;
  max-height: 340px;
  padding: 0 18px 14px;
  overflow-y: auto;
}

.logo-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--brand, var(--ink));
  font: inherit;
  font-size: 0.74rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.logo-option:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--card));
}

.logo-option.is-chosen {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--card));
  box-shadow: inset 0 0 0 1px var(--brand);
}

.logo-option .toolkit-brand {
  color: var(--brand);
}

.logo-option-name {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-grid-empty {
  grid-column: 1 / -1;
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.logo-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

@media (max-width: 720px) {
  .toolkit-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .toolkit-picker-add {
    justify-self: start;
  }

  .toolkit-row {
    grid-template-columns: 14px 38px minmax(0, 1fr) 28px;
  }

  .toolkit-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .toolkit-meta-hint {
    display: none;
  }
}

/* Live database health on Settings — a dot plus one word, matching the
   diagnostics block above it rather than inventing a new visual language. */
.settings-health {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.settings-health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.settings-health.is-up .settings-health-dot {
  background: #22a06b;
  box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.16);
}

.settings-health.is-down .settings-health-dot {
  background: #d64545;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.16);
}

/* --------------------------------------------------------------- sections
   One card per section of the front page. The jump nav is a filled button row
   so it reads as navigation rather than another form, and a hidden section is
   flagged in place instead of disappearing from the editor. */

.section-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.section-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.section-jump-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.section-jump-link em {
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  color: var(--ink-2);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-jump-link.is-hidden-section {
  opacity: 0.62;
}

.section-editor-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
  vertical-align: -6px;
}

.section-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.section-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Page composer and media library */
.page-intro { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-intro p { flex-basis: 100%; margin: 0; }
.component-list { display: grid; gap: 16px; margin-bottom: 16px; }
.component-row { padding: 22px; }
.component-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.component-row-head > div { flex: 1; min-width: 180px; }
.component-row-head h2 { font-size: 1rem; margin: 0 0 4px; }
.component-row-head small { color: var(--muted); }
.component-grip { cursor: grab; font-size: 22px; color: var(--muted); }
.component-actions { display: inline-flex; margin-left: auto; }
.component-add { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.component-add select { max-width: 210px; }
.media-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.media-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.media-item { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.media-thumb { height: 155px; display: flex; justify-content: center; align-items: center; background: var(--bg-3); }
.media-thumb img, .media-thumb video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-file-icon { font-size: 22px; font-weight: 700; color: var(--muted); }
.media-item-info { display: grid; gap: 7px; padding: 13px; overflow-wrap: anywhere; }
.media-item-info small { color: var(--muted); }
.media-item-info details summary { cursor: pointer; }
.media-item-info details form { display: grid; gap: 8px; margin-top: 12px; }
.media-item-info details input, .media-item-info details textarea { width: 100%; }
@media (max-width: 650px) { .component-row-head { flex-wrap: wrap; } .component-add select { max-width: 100%; } }
/* Section tabs use the public section's saved accent in both themes. The
   header and footer have no configurable accent and use the blue fallback. */
.admin-side-group { margin: 5px 0; }
.admin-side-group .admin-side-section {
  border: 1px solid var(--accent);
  color: var(--ink);
  font-weight: 650;
}
.admin-side-group .admin-side-section:hover { background: var(--bg-3); }
.admin-side-group .admin-side-section.is-active,
.admin-side-group .admin-side-section.is-active:hover {
  background: var(--accent);
  color: #fff;
}
.admin-side-group[data-accent='teal'] .admin-side-section.is-active,
.admin-side-group[data-accent='amber'] .admin-side-section.is-active,
.admin-side-group[data-accent='coral'] .admin-side-section.is-active,
.admin-side-group[data-accent='pink'] .admin-side-section.is-active,
[data-theme='dark'] .admin-side-group .admin-side-section.is-active {
  color: #10141f;
}
.admin-side-children {
  margin: 3px 0 8px 13px;
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
}
.admin-side-children .admin-side-sub {
  padding: 6px 10px;
  font-size: 0.79rem;
  line-height: 1.35;
}
.admin-side-children .admin-side-sub.is-active {
  background: var(--bg-3);
  color: var(--accent);
  font-weight: 650;
}
.admin-side-more summary { cursor: pointer; padding: 12px 20px; font-size: .83rem; color: var(--muted); }
/* WordPress-inspired post workspace and 90%-screen media picker */
.post-editor-tabs { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 12px; }
.post-editor-tabs [aria-pressed=true] { background: var(--blue); color: #fff; }
.editor-split.is-visual { display: block; }
.editor-split.is-visual .editor-pane { display: none; }
.editor-split.is-visual .editor-preview { min-height: 420px; width: 100%; max-height: none; overflow: auto; outline: none; cursor: text; }
.editor-split.is-visual .editor-preview:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.feature-image-picker { position: relative; }
.feature-image-add { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; border: 0; border-radius: 50%; width: 38px; height: 38px; background: var(--blue); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 4px 16px #0005; }
.feature-image-add:hover, .feature-image-add:focus-visible { background: color-mix(in srgb, var(--blue) 80%, var(--ink)); transform: scale(1.07); }
.post-media-dialog { width: 90vw; max-width: none; height: 90vh; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--card); box-shadow: 0 30px 90px #0008; }
.post-media-dialog::backdrop { background: #07111cc9; }
.post-media-shell { display: flex; flex-direction: column; height: 100%; padding: clamp(16px, 2vw, 28px); }
.post-media-head, .post-media-tools { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.post-media-head h2, .post-media-head p { margin: 0; }
.post-media-tools { margin: 20px 0 8px; }
.post-media-tools form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.post-media-tools input[type=search] { max-width: 300px; }
.post-media-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; gap: 12px; padding: 8px; }
.post-media-tile { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: inherit; padding: 8px; cursor: pointer; text-align: left; }
.post-media-tile:hover, .post-media-tile:focus-visible { outline: 2px solid var(--blue); }
.post-media-tile img, .post-media-tile > span { display: grid; place-items: center; width: 100%; height: 130px; object-fit: contain; background: var(--bg-3); border-radius: 6px; font-weight: 700; }
.post-media-tile small { display: block; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .post-media-dialog { width: 90vw; height: 90dvh; } }
.project-editor { margin: 16px 0; }
.project-editor h2 { margin: 0 0 14px; }
.project-editor > .admin-field, .project-editor > .admin-field-row { margin-bottom: 14px; }
.revision-body { white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; max-height: 320px; overflow-y: auto; }

/* Categories live with toolkit rows; changing one never changes its logo. */
.toolkit-fields {
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 0.8fr);
  gap: 5px 12px;
}
.toolkit-category-label { min-width: 0; }
.toolkit-category-label select {
  width: 100%;
  min-width: 0;
  padding: 7px 28px 7px 9px;
  font-size: 0.8rem;
}
.toolkit-fields .toolkit-meta { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .toolkit-fields { grid-template-columns: minmax(0, 1fr); }
  .toolkit-fields .toolkit-meta { grid-column: 1; }
}

/* Component editors are usable in place; their existing forms still submit to
   their own endpoints, without nesting a form inside the page-composer form. */
.page-section-settings { display: grid; gap: 14px; margin-bottom: 16px; }
.page-section-settings h2 { margin: 0; font-size: 1.05rem; }
.page-section-settings-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.component-inline { margin-top: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-2); }
.component-inline summary { padding: 13px 16px; color: var(--blue); font-weight: 650; cursor: pointer; }
.component-inline summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.component-inline iframe { display: block; width: 100%; height: min(70vh, 720px); min-height: 340px; border: 0; border-top: 1px solid var(--line); background: var(--card); }
.component-inline .field-hint { padding: 0 16px 10px; }
.admin-embedded .admin-sidebar, .admin-embedded .admin-topbar,
.admin-embedded .admin-foot, .admin-embedded .skip-link { display: none !important; }
.admin-embedded .admin-shell { display: block; min-height: 0; }
.admin-embedded .admin-main { display: block; background: var(--card); }
.admin-embedded .admin-content { max-width: none; padding: 12px; gap: 14px; }
.admin-embedded .admin-content > a:first-child { display: none; }
.admin-embedded .admin-card { box-shadow: none; }
