:root {
  --admin-bg: #111;
  --admin-panel: #232323;
  --admin-panel-2: #2a2a2a;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Login */
.auth-page {
  min-height: 100vh;
}

.auth-home-link { display: inline-flex; }

.auth-main {
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: center;
  padding: 54px 0 80px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .75fr);
  gap: clamp(34px, 7vw, 88px);
  align-items: center;
}

.auth-intro h1 {
  max-width: 760px;
  font-size: clamp(2.7rem, 6vw, 5.1rem);
  letter-spacing: -.06em;
}

.auth-intro > p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.08rem;
}

.auth-feature-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.auth-feature-list span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-weight: 750;
  font-size: .88rem;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(52,52,52,.97), rgba(31,31,31,.99));
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  margin-bottom: 20px;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 850;
}

.auth-tabs button.active {
  background: var(--teal);
  color: #fff;
}

.auth-form {
  display: grid;
  gap: 16px;
}

/* Only the currently selected authentication mode should be visible.
   This explicit rule prevents .auth-form { display:grid } from overriding
   the HTML hidden attribute in browsers. */
.auth-form[hidden] {
  display: none !important;
}

.auth-panel-heading {
  display: grid;
  gap: 5px;
  margin-bottom: 2px;
}

.auth-panel-heading h2 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.2;
}

.auth-panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.auth-form label,
.field {
  display: grid;
  gap: 7px;
  color: rgba(255,255,255,.88);
  font-size: .9rem;
  font-weight: 800;
}

.auth-form input,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 13px;
  background: #141414;
  color: #fff;
  font: inherit;
  outline: none;
}

.field textarea { resize: vertical; }

.auth-form input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--teal-2);
  box-shadow: 0 0 0 3px rgba(1,135,134,.14);
}

.auth-help {
  margin: 0;
  padding: 12px;
  border-radius: 13px;
  background: rgba(1,135,134,.12);
  color: var(--muted);
  font-size: .89rem;
}

.auth-message,
.admin-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: .9rem;
}

.auth-message.success,
.admin-message.success { border-color: rgba(2,167,165,.5); background: rgba(1,135,134,.13); color: #c9fffe; }
.auth-message.error,
.admin-message.error { border-color: rgba(220,80,80,.5); background: rgba(129,3,3,.18); color: #ffd0d0; }
.auth-message.warning { border-color: rgba(255,188,70,.45); background: rgba(255,188,70,.09); color: #ffe5b5; }
.auth-message.info,
.admin-message.info { border-color: rgba(100,170,255,.42); background: rgba(80,130,200,.1); color: #d8e9ff; }

/* Admin shell */
.admin-page {
  background: #121212;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px clamp(16px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(18,18,18,.94);
  backdrop-filter: blur(16px);
}

.admin-brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .84rem;
}

.admin-brand .brand-mark {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-nav a,
.admin-nav button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-nav a:hover,
.admin-nav button:hover,
.admin-nav a.active {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.admin-menu-toggle {
  display: none;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1d1d1d;
  cursor: pointer;
  font-weight: 850;
}

.admin-main {
  padding: 42px 0 80px;
}

.admin-container {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.admin-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.admin-page-head.compact {
  margin-bottom: 20px;
}

.admin-kicker {
  display: block;
  margin-bottom: 6px;
  color: #9cf5f3;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .75rem;
  font-weight: 950;
}

.admin-page-head h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.7rem);
  letter-spacing: -.05em;
}

.admin-page-head p {
  max-width: 710px;
  margin: 10px 0 0;
  color: var(--muted);
}

.admin-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #2a2a2a;
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
}

.admin-button:hover { border-color: var(--line-strong); background: #333; }
.admin-button.primary { background: var(--teal); border-color: var(--teal); }
.admin-button.secondary { background: #343434; }
.admin-button.ghost { background: transparent; }
.admin-button.danger { color: #ffb8b8; }
.admin-button.full { width: 100%; }
.admin-button:disabled { opacity: .55; cursor: wait; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stats article {
  min-height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #222;
}

.admin-stats span { color: var(--muted); font-size: .85rem; font-weight: 800; }
.admin-stats strong { font-size: 1.8rem; line-height: 1; }
.admin-stats strong a { font-size: 1rem; color: #9cf5f3; }

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background: #202020;
}

.admin-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.admin-panel h2 { font-size: 1.3rem; }
.admin-panel-head p,
.admin-panel > p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }

.admin-post-list { display: grid; gap: 9px; }
.admin-post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #292929;
}

.admin-post-main { min-width: 0; }
.admin-post-main h3 { margin: 7px 0 5px; font-size: 1.13rem; }
.admin-post-main p { margin: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 720px; font-size: .9rem; }
.admin-post-meta { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: .77rem; }
.status-badge { min-height: 25px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; font-weight: 900; }
.status-badge.published { background: rgba(1,135,134,.18); color: #affaf8; }
.status-badge.draft { background: rgba(255,255,255,.08); color: var(--muted); }
.admin-row-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }

.admin-empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
}

.admin-empty strong { color: #fff; }

/* Editor */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 18px;
  align-items: start;
}

.editor-main { min-width: 0; display: grid; gap: 16px; }
.editor-section { display: grid; gap: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field small { color: var(--soft); font-weight: 600; }
.field-label { display: block; margin-bottom: 8px; font-size: .82rem; color: var(--muted); font-weight: 850; }
.body-editor { min-height: 430px; line-height: 1.65; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: .93rem !important; }
.editor-preview-wrap { padding-top: 4px; }
.editor-preview { max-width: none; min-height: 160px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #171717; font-size: .96rem; }
.cover-preview { width: min(100%, 620px); max-height: 380px; object-fit: cover; border: 1px solid var(--line); border-radius: 16px; }

/* News-card crop editor. The source view shows the full image and an exact draggable 16:9 crop box. */
.news-card-crop-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 18px;
  align-items: start;
}

.crop-source-panel,
.crop-result-panel {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #1b1b1b;
}

.crop-source-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.crop-source-heading > div {
  display: grid;
  gap: 4px;
}

.crop-source-heading strong {
  color: #fff;
  font-size: .9rem;
}

.crop-source-heading span,
.crop-help,
.crop-result-note {
  color: var(--soft);
  font-size: .8rem;
  line-height: 1.5;
}

.crop-source-placeholder {
  min-height: 250px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(1,135,134,.16), transparent 36%),
    #121212;
  color: var(--muted);
}

.crop-source-placeholder[hidden],
.crop-source-stage[hidden] {
  display: none !important;
}

.crop-source-placeholder strong {
  color: #fff;
}

.crop-source-wrap {
  display: flex;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
}

.crop-source-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  line-height: 0;
  border-radius: 14px;
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
  background: #0d0d0d;
  user-select: none;
}

.crop-source-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.crop-selection-box {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 6px;
  box-shadow:
    0 0 0 2px rgba(1,135,134,.9),
    0 0 0 9999px rgba(0,0,0,.62);
  background-image:
    linear-gradient(to right,
      transparent 33.1%,
      rgba(255,255,255,.5) 33.1%,
      rgba(255,255,255,.5) 33.45%,
      transparent 33.45%,
      transparent 66.45%,
      rgba(255,255,255,.5) 66.45%,
      rgba(255,255,255,.5) 66.8%,
      transparent 66.8%),
    linear-gradient(to bottom,
      transparent 33.1%,
      rgba(255,255,255,.5) 33.1%,
      rgba(255,255,255,.5) 33.45%,
      transparent 33.45%,
      transparent 66.45%,
      rgba(255,255,255,.5) 66.45%,
      rgba(255,255,255,.5) 66.8%,
      transparent 66.8%);
  cursor: grab;
  touch-action: none;
  outline: none;
}

.crop-selection-box > span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .03em;
  pointer-events: none;
}

.crop-selection-box:hover,
.crop-selection-box:focus-visible {
  border-color: #fff;
  box-shadow:
    0 0 0 3px rgba(2,167,165,.95),
    0 0 0 9999px rgba(0,0,0,.62);
}

.crop-selection-box.dragging {
  cursor: grabbing;
}

.crop-help {
  margin: 12px 0 0;
}

.crop-result-panel {
  display: grid;
  gap: 10px;
}

.news-card-crop-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #111;
}

.news-card-crop-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.news-card-crop-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 70% 20%, rgba(1,135,134,.18), transparent 36%),
    #151515;
}

.news-card-crop-placeholder[hidden] {
  display: none !important;
}

.news-card-crop-placeholder strong {
  color: #fff;
}

.crop-result-note {
  margin: 0;
}

.media-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.media-preview-item { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #111; }
.media-preview-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.media-preview-item button,
.media-preview-item span { position: absolute; right: 6px; bottom: 6px; min-height: 30px; padding: 0 9px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(0,0,0,.78); color: #fff; font-size: .76rem; font-weight: 850; }
.media-preview-item button { cursor: pointer; }
.media-preview-item.pending { border-color: rgba(1,135,134,.5); }
.sticky-editor-card { position: sticky; top: 86px; }
.sticky-editor-card h2 { margin-bottom: 7px; }
.sticky-editor-card > p { margin-bottom: 18px; }
.check-field { display: flex; align-items: flex-start; gap: 9px; padding: 12px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: .88rem; }
.check-field input { margin-top: 3px; accent-color: var(--teal); }
.editor-actions { display: grid; gap: 8px; }

/* Team */
.team-layout { display: grid; gap: 16px; }
.invite-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 12px; align-items: end; }
.team-columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.team-list { display: grid; gap: 8px; }
.team-row { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #292929; }
.team-row > div { min-width: 0; }
.team-row strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-row span { display: block; margin-top: 3px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 680px; }
  .auth-intro { text-align: center; }
  .auth-intro > p { margin-inline: auto; }
  .auth-feature-list { justify-content: center; }
  .editor-layout { grid-template-columns: 1fr; }
  .news-card-crop-editor { grid-template-columns: 1fr; }
  .sticky-editor-card { position: static; }
  .team-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-topbar { flex-wrap: wrap; min-height: auto; }
  .admin-menu-toggle { display: inline-flex; align-items: center; }
  .admin-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-top: 4px; }
  .admin-nav.open { display: flex; }
  .admin-nav a,
  .admin-nav button { width: 100%; justify-content: flex-start; border: 1px solid var(--line); background: #1d1d1d; }
  .admin-main { padding-top: 28px; }
  .admin-container { width: min(100% - 24px, 1180px); }
  .admin-page-head { display: grid; align-items: start; }
  .admin-page-head > .admin-button { width: 100%; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-stats article { min-height: 86px; }
  .admin-post-row { align-items: flex-start; flex-direction: column; }
  .admin-post-main { width: 100%; }
  .admin-row-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .field-grid { grid-template-columns: 1fr; }
  .media-preview-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .invite-form { grid-template-columns: 1fr; }
  .invite-form .admin-button { width: 100%; }
}

@media (max-width: 560px) {
  .auth-main { padding: 34px 0 60px; }
  .auth-layout { width: min(100% - 22px, 680px); }
  .auth-intro h1 { font-size: clamp(2.3rem, 11vw, 3.35rem); }
  .auth-card { padding: 16px; border-radius: 21px; }
  .auth-tabs { grid-template-columns: 1fr; }
  .auth-tabs button { min-height: 38px; }
  .auth-home-link { min-height: 40px; padding-inline: 12px; font-size: .82rem; }
  .admin-panel { padding: 16px; border-radius: 16px; }
  .admin-row-actions { grid-template-columns: 1fr; }
  .body-editor { min-height: 350px; }
}

/* =========================================================
   VISUAL ARTICLE BUILDER
   ========================================================= */

.article-builder-panel {
  overflow: visible;
}

.rich-editor-shell {
  display: grid;
  gap: 16px;
}

.rich-editor-toolbar {
  position: sticky;
  top: 68px;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20,20,20,.97);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
}

.rich-toolbar-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.rich-style-control select,
.rich-tool-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #292929;
  color: #fff;
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
}

.rich-style-control select {
  min-width: 134px;
  padding: 0 34px 0 11px;
}

.rich-tool-button {
  min-width: 40px;
  padding: 0 11px;
  cursor: pointer;
}

.rich-tool-button:hover:not(:disabled),
.rich-style-control select:hover:not(:disabled) {
  border-color: var(--teal-2);
  background: #303030;
}

.rich-tool-button:disabled,
.rich-style-control select:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.rich-toolbar-help {
  color: var(--soft);
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}

.article-blocks {
  display: grid;
  gap: 12px;
}

.article-editor-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #171717;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.article-editor-block:focus-within {
  border-color: rgba(2,167,165,.62);
  box-shadow: 0 0 0 3px rgba(1,135,134,.1);
}

.article-block-topbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px 7px 13px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.035);
}

.article-block-label {
  color: var(--soft);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.article-block-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-block-controls button {
  min-height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #272727;
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.article-block-controls button:hover:not(:disabled) {
  color: #fff;
  border-color: var(--line-strong);
}

.article-block-controls button.danger:hover:not(:disabled) {
  color: #ffb8b8;
  border-color: rgba(220,80,80,.5);
  background: rgba(129,3,3,.15);
}

.article-block-controls button:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.rich-text-surface {
  min-height: 92px;
  padding: 18px;
  outline: none;
  color: rgba(255,255,255,.9);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.rich-text-surface p {
  margin: 0 0 1em;
}

.rich-text-surface p:last-child {
  margin-bottom: 0;
}

.rich-text-surface ul,
.rich-text-surface ol {
  margin: .55em 0 1em 1.4em;
  padding: 0;
}

.rich-text-surface li + li {
  margin-top: .3em;
}

.rich-text-surface div {
  margin: 0 0 1em;
}

.rich-text-surface div:last-child {
  margin-bottom: 0;
}

.rich-text-surface.heading2 {
  min-height: 84px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 900;
}

.rich-text-surface.heading3 {
  min-height: 74px;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  line-height: 1.2;
  font-weight: 880;
}

.rich-text-surface:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,.28);
  pointer-events: none;
}

.rich-text-surface a {
  color: #76e4e2;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.image-block-layout {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
  gap: 16px;
  padding: 16px;
}

.image-block-preview {
  min-height: 210px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: #101010;
}

.image-block-preview img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  max-height: 360px;
  object-fit: cover;
}

.image-block-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 24px;
  text-align: center;
}

.image-block-empty strong {
  color: #fff;
}

.image-block-empty span {
  color: var(--soft);
  font-size: .82rem;
}

.image-block-fields {
  display: grid;
  gap: 12px;
  align-content: start;
}

.image-caption-surface {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 13px;
  background: #141414;
  color: #fff;
  font: inherit;
  font-weight: 500;
  line-height: 1.55;
  outline: none;
  overflow-wrap: anywhere;
}

.image-caption-surface:focus {
  border-color: var(--teal-2);
  box-shadow: 0 0 0 3px rgba(1,135,134,.14);
}

.image-caption-surface:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,.34);
  pointer-events: none;
}

.image-caption-surface a {
  color: #76e4e2;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.add-block-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.add-block-bar > span {
  margin-right: 4px;
  color: var(--soft);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-button.small {
  min-height: 38px;
  padding: 0 12px;
  font-size: .82rem;
}

@media (max-width: 760px) {
  .rich-editor-toolbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .rich-toolbar-group {
    width: 100%;
  }

  .rich-style-control {
    flex: 1 1 140px;
  }

  .rich-style-control select {
    width: 100%;
  }

  .rich-toolbar-help {
    white-space: normal;
  }

  .image-block-layout {
    grid-template-columns: 1fr;
  }

  .image-block-preview,
  .image-block-preview img {
    min-height: 180px;
  }

  .article-block-topbar {
    align-items: flex-start;
  }

  .article-block-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .rich-tool-button {
    flex: 1 1 auto;
  }

  .add-block-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .add-block-bar > span {
    margin: 0 0 2px;
  }

  .add-block-bar .admin-button {
    width: 100%;
  }

  .rich-text-surface {
    padding: 15px;
  }
}

/* ========================================================================== 
   Motobomb publishing workspace refresh
   A focused, WordPress-inspired editor shell without changing the CMS data model.
   ========================================================================== */

.editor-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.editor-admin-main {
  min-height: calc(100vh - 68px);
  background: #111;
}

.editor-workspace-form {
  min-height: calc(100vh - 68px);
}

.editor-document-bar {
  position: sticky;
  top: 68px;
  z-index: 42;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(420px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 9px clamp(14px, 2.3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: rgba(20,20,20,.97);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  backdrop-filter: blur(18px);
}

.editor-document-left,
.editor-document-actions,
.preview-toolbar-actions,
.preview-device-switcher {
  display: flex;
  align-items: center;
}

.editor-document-left { gap: 13px; min-width: 0; }
.editor-document-actions { justify-content: flex-end; gap: 7px; min-width: 0; }

.editor-back-button {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 850;
}

.editor-back-button:hover { background: rgba(255,255,255,.06); color: #fff; }

.editor-document-status { min-width: 0; display: grid; gap: 2px; }
.editor-document-status strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.editor-document-status span { color: var(--soft); font-size: .72rem; font-weight: 700; }
.editor-document-status span.unsaved { color: #ffe1a1; }

.editor-document-centre {
  color: var(--soft);
  font-size: .76rem;
  font-weight: 750;
  white-space: nowrap;
}

.editor-toolbar-button,
.editor-save-button,
.editor-publish-button {
  min-height: 40px;
  border-radius: 9px;
  padding-inline: 13px;
  font-size: .82rem;
}

.editor-inserter-wrap { position: relative; }

.editor-inserter-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 80;
  width: min(320px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #242424;
  box-shadow: 0 22px 60px rgba(0,0,0,.48);
}

.editor-inserter-popover[hidden] { display: none !important; }
.editor-inserter-popover > strong { display: block; padding: 7px 8px 9px; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.editor-inserter-popover button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.editor-inserter-popover button:hover { background: rgba(255,255,255,.07); }
.editor-inserter-popover button > span:last-child { display: grid; gap: 2px; }
.editor-inserter-popover b { font-size: .88rem; }
.editor-inserter-popover small { color: var(--soft); font-size: .74rem; }
.inserter-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #181818;
  color: #9cf5f3;
  font-size: .78rem;
  font-weight: 900;
}

.editor-workspace {
  width: min(1460px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.editor-workspace-form.settings-hidden .editor-workspace { grid-template-columns: minmax(0,1fr); }
.editor-workspace-form.settings-hidden .editor-settings { display: none; }

.editor-canvas {
  width: min(860px, calc(100% - 40px));
  min-width: 0;
  margin: 34px auto 90px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: #191919;
  box-shadow: 0 24px 70px rgba(0,0,0,.2);
}

.editor-title-area {
  padding: 2px 0 26px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.editor-title-input,
.editor-excerpt-input {
  width: 100%;
  resize: none;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  font-family: inherit !important;
}

.editor-title-input {
  min-height: 64px;
  font-size: clamp(2.4rem, 5vw, 4.35rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -.052em;
  font-weight: 950 !important;
}
.editor-title-input::placeholder { color: rgba(255,255,255,.24); }

.editor-excerpt-input {
  min-height: 54px;
  margin-top: 15px;
  color: rgba(255,255,255,.62) !important;
  font-size: 1.04rem !important;
  line-height: 1.55 !important;
  font-weight: 500 !important;
}
.editor-excerpt-input::placeholder { color: rgba(255,255,255,.29); }

.wordpress-editor-shell { margin-top: 24px; }
.wordpress-editor-shell .rich-editor-toolbar {
  top: 139px;
  margin: 0 0 18px;
  border-radius: 10px;
  box-shadow: none;
}

.wordpress-editor-shell .article-blocks { gap: 8px; }
.wordpress-editor-shell .article-editor-block {
  overflow: visible;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.wordpress-editor-shell .article-editor-block:hover { border-color: rgba(255,255,255,.08); }
.wordpress-editor-shell .article-editor-block:focus-within {
  border-color: rgba(2,167,165,.55);
  box-shadow: 0 0 0 2px rgba(1,135,134,.09);
  background: rgba(255,255,255,.018);
}

.wordpress-editor-shell .article-block-topbar {
  min-height: 34px;
  padding: 4px 6px 4px 11px;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: rgba(255,255,255,.035);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .14s ease, transform .14s ease;
}
.wordpress-editor-shell .article-editor-block:hover .article-block-topbar,
.wordpress-editor-shell .article-editor-block:focus-within .article-block-topbar { opacity: 1; transform: translateY(0); }

.wordpress-editor-shell .rich-text-surface { min-height: 72px; padding: 10px 12px 16px; }
.wordpress-editor-shell .rich-text-surface.paragraph { font-size: 1.05rem; line-height: 1.78; }
.wordpress-editor-shell .rich-text-surface.heading2 { padding-top: 8px; font-size: clamp(1.75rem, 3.4vw, 2.55rem); }
.wordpress-editor-shell .rich-text-surface.heading3 { padding-top: 8px; font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
.wordpress-editor-shell .image-block-layout { padding: 12px; }

.editor-inline-inserter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.editor-inserter-line { height: 1px; background: rgba(255,255,255,.08); }
.editor-inline-buttons { display: flex; align-items: center; gap: 5px; }
.editor-inline-buttons button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}
.editor-inline-buttons button:hover { border-color: var(--teal-2); color: #fff; }

.editor-settings {
  position: sticky;
  top: 130px;
  height: calc(100vh - 130px);
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #181818;
}

.editor-settings-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}
.editor-settings-head > div { display: grid; gap: 2px; }
.editor-settings-head strong { font-size: .92rem; }
.editor-settings-head span { color: var(--soft); font-size: .72rem; }
.editor-settings-close,
.editor-modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 400 1.5rem/1 system-ui;
  cursor: pointer;
}
.editor-settings-close:hover,
.editor-modal-close:hover { color: #fff; background: rgba(255,255,255,.06); }

.editor-settings-scroll {
  height: calc(100% - 68px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.editor-settings-section {
  display: grid;
  gap: 14px;
  padding: 19px 17px;
  border-bottom: 1px solid var(--line);
}
.settings-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section-heading > strong { font-size: .88rem; }
.settings-help { margin: -5px 0 0; color: var(--soft); font-size: .78rem; line-height: 1.55; }
.editor-settings-helpbox { background: rgba(1,135,134,.065); }
.editor-settings-helpbox p { margin: -5px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.6; }

.settings-card-preview {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101010;
}
.settings-card-preview img { width: 100%; height: 100%; object-fit: cover; }
.settings-card-placeholder { color: var(--soft); font-size: .78rem; }
.settings-card-placeholder[hidden] { display: none !important; }

.editor-settings-backdrop { display: none; }
.editor-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  width: min(360px, calc(100% - 36px));
  margin: 0;
  box-shadow: 0 18px 48px rgba(0,0,0,.38);
}

.editor-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(9px);
}
.editor-modal-layer[hidden] { display: none !important; }
.editor-modal-open { overflow: hidden; }
.editor-modal {
  width: min(1120px, 100%);
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #1b1b1b;
  box-shadow: 0 30px 90px rgba(0,0,0,.56);
}
.editor-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.editor-modal-head h2 { margin: 0; font-size: 1.55rem; }
.editor-modal-head p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.editor-modal-body { min-height: 0; overflow: auto; padding: 18px; }
.editor-modal-footer { display: flex; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--line); }
.crop-modal-body { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(270px,.7fr); gap: 18px; align-items: start; }

.preview-modal-layer { padding: 12px; }
.preview-modal { width: min(1540px,100%); height: calc(100vh - 24px); max-height: none; grid-template-rows: auto minmax(0,1fr); border-radius: 14px; }
.editor-preview-toolbar {
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: #1b1b1b;
}
.preview-toolbar-title { display: grid; gap: 2px; }
.preview-toolbar-title strong { font-size: .88rem; }
.preview-toolbar-title span { color: var(--soft); font-size: .7rem; }
.preview-device-switcher { gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #121212; }
.preview-device-switcher button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
}
.preview-device-switcher button.active { background: #303030; color: #fff; }
.preview-toolbar-actions { justify-content: flex-end; gap: 7px; }
.editor-preview-stage {
  min-height: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px;
  background: #0d0d0d;
}
.preview-device-frame {
  height: 100%;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid #444;
  border-radius: 10px;
  background: #121212;
  box-shadow: 0 24px 70px rgba(0,0,0,.4);
  transition: width .22s ease;
}
.preview-device-frame.desktop { width: min(100%, 1280px); }
.preview-device-frame.tablet { width: 768px; max-width: 100%; }
.preview-device-frame.mobile { width: 390px; max-width: 100%; }
.preview-device-frame iframe { width: 100%; height: 100%; min-height: 620px; display: block; border: 0; background: #121212; }

@media (max-width: 1180px) {
  .editor-document-bar { grid-template-columns: minmax(170px,.8fr) auto minmax(390px,1.2fr); gap: 10px; }
  .editor-document-centre { font-size: .7rem; }
  .editor-workspace { grid-template-columns: minmax(0,1fr) 330px; }
}

@media (max-width: 980px) {
  .editor-document-bar {
    top: 68px;
    grid-template-columns: 1fr auto;
    min-height: 60px;
  }
  .editor-document-centre { display: none; }
  .editor-document-actions { grid-column: 2; }
  .editor-document-status { display: none; }
  .editor-back-button span { display: none; }
  .editor-workspace { display: block; }
  .editor-canvas { width: min(820px, calc(100% - 28px)); margin-top: 22px; }
  .editor-settings {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 160;
    width: min(420px, 94vw);
    height: 100dvh;
    border-left: 1px solid var(--line-strong);
    transform: translateX(105%);
    transition: transform .2s ease;
    box-shadow: -24px 0 70px rgba(0,0,0,.5);
  }
  .editor-settings.open { transform: translateX(0); }
  .editor-workspace-form.settings-hidden .editor-settings { display: block; }
  .editor-settings-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: block;
    background: rgba(0,0,0,.58);
    backdrop-filter: blur(4px);
  }
  .editor-drawer-open { overflow: hidden; }
  .crop-modal-body { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .editor-admin-main { min-height: 100vh; }
  .editor-document-bar {
    top: 68px;
    padding: 8px 10px;
    gap: 6px;
  }
  .editor-document-left { gap: 3px; }
  .editor-document-actions { gap: 4px; }
  .editor-toolbar-button,
  .editor-save-button,
  .editor-publish-button { min-height: 38px; padding-inline: 10px; font-size: .76rem; }
  .editor-toolbar-button span { display: none; }
  .editor-save-button { display: none; }
  .editor-canvas {
    width: 100%;
    margin: 0 0 70px;
    padding: 24px 16px 36px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }
  .editor-title-input { font-size: clamp(2.15rem, 11vw, 3.3rem) !important; }
  .editor-excerpt-input { font-size: .98rem !important; }
  .wordpress-editor-shell .rich-editor-toolbar {
    position: sticky;
    top: 128px;
    z-index: 35;
    margin-inline: -8px;
    padding: 7px;
    border-radius: 9px;
    align-items: center;
    flex-direction: row;
  }
  .wordpress-editor-shell .rich-toolbar-help { display: none; }
  .wordpress-editor-shell .article-block-topbar { opacity: 1; transform: none; }
  .wordpress-editor-shell .rich-text-surface { padding-inline: 8px; }
  .editor-inline-inserter { grid-template-columns: 1fr; }
  .editor-inserter-line { display: none; }
  .editor-inline-buttons { display: grid; grid-template-columns: repeat(3,1fr); }
  .editor-inline-buttons button { width: 100%; }
  .editor-preview-toolbar {
    grid-template-columns: 1fr auto;
    padding: 8px;
  }
  .preview-toolbar-title { display: none; }
  .preview-device-switcher { justify-self: start; }
  .preview-toolbar-actions { justify-self: end; }
  .preview-toolbar-actions #viewPublishedPost { display: none; }
  .editor-preview-stage { padding: 8px; }
  .preview-device-frame { height: 100%; min-height: 520px; }
  .preview-device-frame iframe { min-height: 520px; }
  .editor-modal-layer { padding: 0; }
  .editor-modal { width: 100%; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
  .crop-modal-body { padding: 12px; }
}

@media (max-width: 480px) {
  .editor-document-actions #toggleSettingsButton { padding-inline: 8px; }
  .preview-device-switcher button { padding: 0 8px; }
  .editor-title-area { padding-bottom: 20px; }
  .wordpress-editor-shell { margin-top: 18px; }
  .wordpress-editor-shell .rich-style-control { min-width: 104px; flex: 1 1 104px; }
  .wordpress-editor-shell .rich-tool-button { min-width: 36px; padding: 0 8px; }
}

/* Post library refinements */
.admin-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-post-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.admin-stat-filter {
  min-height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #222;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.admin-stat-filter span { color: var(--muted); font-size: .85rem; font-weight: 800; }
.admin-stat-filter strong { font-size: 1.8rem; line-height: 1; }
.admin-stat-filter:hover,
.admin-stat-filter.active { border-color: rgba(2,167,165,.65); background: rgba(1,135,134,.09); }
.posts-library-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.posts-library-toolbar h2 { margin: 0; }
.posts-library-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
.post-search { width: min(390px,100%); }
.post-search input { min-height: 44px; }
.library-post-row { display: grid; grid-template-columns: 108px minmax(0,1fr) auto; align-items: center; }
.admin-post-thumbnail { width: 108px; aspect-ratio: 16/9; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #151515; }
.admin-post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.admin-post-thumbnail.empty { display: grid; place-items: center; color: #9cf5f3; font-size: 1.25rem; font-weight: 950; }
.admin-post-main h3 a { color: #fff; }
.admin-post-main h3 a:hover { color: #9cf5f3; }

@media (max-width: 760px) {
  .admin-posts-head { align-items: stretch; }
  .admin-head-actions { justify-content: stretch; }
  .admin-head-actions .admin-button { flex: 1 1 auto; }
  .admin-post-stats { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  .admin-stat-filter { min-height: 82px; padding: 12px; border-radius: 14px; }
  .admin-stat-filter strong { font-size: 1.45rem; }
  .posts-library-toolbar { align-items: stretch; flex-direction: column; }
  .post-search { width: 100%; }
  .library-post-row { grid-template-columns: 82px minmax(0,1fr); gap: 12px; align-items: start; }
  .admin-post-thumbnail { width: 82px; }
  .library-post-row .admin-row-actions { grid-column: 1 / -1; width: 100%; justify-content: stretch; }
  .library-post-row .admin-row-actions .admin-button { flex: 1 1 auto; min-width: 0; }
  .admin-post-main p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .admin-post-meta { flex-wrap: wrap; gap: 6px 9px; }
}

/* Hidden must win over component display declarations. */
.admin-page [hidden] { display: none !important; }
.mobile-label { display: none; }
@media (max-width: 760px) {
  #blockInserterButton { display: none; }
  .editor-save-button { display: inline-flex; }
  .editor-save-button .desktop-label { display: none; }
  .editor-save-button .mobile-label { display: inline; }
}

/* Motobomb publishing suite additions */
.publish-options { display:grid; gap:9px; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.publish-options > strong { font-size:.82rem; }
.radio-field { display:flex; align-items:flex-start; gap:9px; color:var(--muted); font-size:.82rem; cursor:pointer; }
.radio-field input { margin-top:3px; accent-color:#02a7a5; }
.schedule-field { margin-top:4px; }
.status-badge.scheduled { color:#ffe2a3; border-color:rgba(255,177,61,.42); background:rgba(255,177,61,.09); }

.keyword-entry-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; margin-top:10px; }
.keyword-entry-row input { min-width:0; }
.keyword-chip-list { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.keyword-chip { display:inline-flex; align-items:center; gap:6px; min-height:30px; padding:4px 7px 4px 10px; border:1px solid var(--line); border-radius:999px; background:#171717; color:#eee; font-size:.73rem; }
.keyword-chip.focus { border-color:rgba(2,167,165,.5); background:rgba(1,135,134,.10); }
.keyword-chip.focus::before { content:"Focus"; color:#9cf5f3; font-size:.58rem; font-weight:950; letter-spacing:.08em; text-transform:uppercase; }
.keyword-chip button { width:22px; height:22px; border:0; border-radius:50%; background:transparent; color:var(--muted); cursor:pointer; }
.keyword-empty { color:var(--soft); font-size:.78rem; }
.seo-score-badge { padding:4px 8px; border:1px solid var(--line); border-radius:999px; font-size:.7rem; font-weight:950; }
.seo-score-badge.good { color:#97efbe; border-color:rgba(74,222,128,.38); background:rgba(74,222,128,.08); }
.seo-score-badge.okay { color:#ffe2a3; border-color:rgba(255,177,61,.38); background:rgba(255,177,61,.08); }
.seo-score-badge.needs-work { color:#ffb4b4; border-color:rgba(239,68,68,.35); background:rgba(239,68,68,.08); }
.seo-checklist { display:grid; gap:6px; margin-top:11px; }
.seo-check { display:grid; grid-template-columns:18px minmax(0,1fr); gap:7px; color:var(--muted); font-size:.74rem; line-height:1.35; }
.seo-check.pass { color:#d7f9e5; }
.seo-check.pass > span:first-child { color:#75e4a3; }

.post-stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.post-stat-grid > div { display:grid; gap:4px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#181818; }
.post-stat-grid span { color:var(--soft); font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.post-stat-grid strong { font-size:1.5rem; }

/* Insert a new block exactly where the writer wants it. */
.block-insertion-point { display:grid; grid-template-columns:minmax(10px,1fr) auto minmax(10px,1fr); align-items:center; gap:8px; min-height:28px; margin:1px 0; }
.block-insertion-line { height:1px; background:transparent; transition:background .15s ease; }
.block-insertion-menu { position:relative; }
.block-insertion-menu summary { list-style:none; cursor:pointer; opacity:.18; padding:4px 9px; border:1px solid transparent; border-radius:999px; color:var(--soft); font-size:.67rem; font-weight:850; white-space:nowrap; transition:opacity .15s ease,border-color .15s ease,background .15s ease; }
.block-insertion-menu summary::-webkit-details-marker { display:none; }
.block-insertion-point:hover .block-insertion-menu summary,
.block-insertion-menu[open] summary,
.block-insertion-menu summary:focus-visible { opacity:1; border-color:var(--line); background:#181818; }
.block-insertion-point:hover .block-insertion-line,
.block-insertion-menu[open] ~ .block-insertion-line { background:var(--line); }
.block-insertion-actions { position:absolute; z-index:60; left:50%; top:calc(100% + 6px); transform:translateX(-50%); display:flex; gap:5px; padding:6px; border:1px solid var(--line-strong); border-radius:11px; background:#171717; box-shadow:0 14px 34px rgba(0,0,0,.38); }
.block-insertion-actions button { min-height:34px; padding:0 9px; border:1px solid var(--line); border-radius:8px; background:#232323; color:#fff; font:inherit; font-size:.7rem; font-weight:850; cursor:pointer; white-space:nowrap; }
.block-insertion-actions button:hover { border-color:rgba(2,167,165,.55); background:rgba(1,135,134,.12); }
.editor-inline-inserter { display:none !important; }

.video-block-layout { display:grid; grid-template-columns:minmax(260px,.9fr) minmax(260px,1.1fr); gap:18px; padding:14px 12px 18px; }
.video-block-preview { min-height:180px; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:#101010; }
.video-block-preview .article-video { margin:0; }
.video-block-preview .article-video-frame { border:0; border-radius:0; }
.video-block-preview .article-video-link { margin:0; border:0; border-radius:0; }

@media (max-width:760px) {
  .block-insertion-point { min-height:38px; }
  .block-insertion-menu summary { opacity:.68; font-size:.7rem; }
  .block-insertion-actions { position:fixed; left:10px; right:10px; bottom:12px; top:auto; transform:none; justify-content:space-between; flex-wrap:wrap; z-index:220; }
  .block-insertion-actions button { flex:1 1 calc(33.333% - 6px); }
  .video-block-layout { grid-template-columns:1fr; padding-inline:8px; }
  .keyword-entry-row { grid-template-columns:1fr; }
}
.admin-post-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
@media (max-width:760px) { .admin-post-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.admin-two-column { display:grid; grid-template-columns:minmax(300px,.75fr) minmax(0,1.25fr); gap:18px; align-items:start; }
.admin-form-stack { display:grid; gap:13px; }
.social-admin-platform { width:100%; height:100%; display:grid; place-items:center; font-size:.65rem; font-weight:900; text-transform:uppercase; color:#9cf5f3; }
@media(max-width:900px){.admin-two-column{grid-template-columns:1fr}}
.narrow-admin { width:min(900px,calc(100% - 28px)); margin-inline:auto; }
.admin-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.video-admin-preview { min-height:220px; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:#101010; }
.video-admin-preview .article-video { margin:0; }
.video-admin-preview .article-video-frame { border:0; border-radius:0; }
@media(max-width:620px){.admin-form-grid{grid-template-columns:1fr}}
.mailing-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
.mailing-admin-grid { grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr); }
.subscriber-list { display:grid; gap:8px; }
.subscriber-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.subscriber-row:last-child { border-bottom:0; }
.subscriber-row > div { min-width:0; display:grid; gap:3px; }
.subscriber-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.subscriber-row span:not(.status-badge) { color:var(--soft); font-size:.7rem; }
.compact-mailing-row { grid-template-columns:minmax(0,1fr) auto; }
.mail-rich-editor { min-height:260px; padding:15px; border:1px solid var(--line-strong); border-radius:12px; background:#151515; color:#fff; line-height:1.7; outline:none; }
.mail-rich-editor:focus { border-color:rgba(2,167,165,.6); box-shadow:0 0 0 3px rgba(2,167,165,.08); }
.mail-rich-editor p { margin:0 0 1em; }
@media(max-width:900px){.mailing-admin-grid{grid-template-columns:1fr}.mailing-stats{grid-template-columns:1fr 1fr 1fr}}
@media(max-width:620px){.mailing-stats{grid-template-columns:1fr}.compact-mailing-row{grid-template-columns:1fr}.subscriber-row{align-items:flex-start;flex-direction:column}}

.mail-rich-toolbar{display:flex;gap:.4rem;flex-wrap:wrap;margin:.35rem 0 .5rem}.mail-rich-toolbar button{min-width:42px;border:1px solid var(--admin-border,#394149);background:#171b20;color:#fff;border-radius:8px;padding:.5rem .7rem;cursor:pointer}.mail-rich-toolbar button:hover{border-color:var(--teal,#32d3c8);color:var(--teal,#32d3c8)}

/* Manual mailing queue visibility */
.mail-queue-countdown{font-weight:750;color:#bdeeee;font-variant-numeric:tabular-nums;}
.mail-queue-status{display:grid;gap:4px;padding:12px 14px;border:1px solid rgba(100,170,255,.35);border-radius:12px;background:rgba(80,130,200,.09);color:#d8e9ff;}
.mail-queue-status strong{font-size:.9rem;color:#fff;}
.mail-queue-status span{font-size:.8rem;line-height:1.45;color:var(--soft);font-variant-numeric:tabular-nums;}
.mail-queue-status.sent{border-color:rgba(2,167,165,.45);background:rgba(1,135,134,.1);}
.mail-queue-status.failed{border-color:rgba(220,80,80,.45);background:rgba(129,3,3,.14);}
.mail-queue-status.scheduled{border-color:rgba(255,190,70,.35);background:rgba(145,95,5,.11);}

/* Advertising & sponsorship admin */
.advertising-stats .admin-stat-filter{cursor:default}.advertising-admin-grid{display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);gap:18px;margin:18px 0}.advertising-enquiries-panel,.advertising-campaigns-panel{min-width:0}.admin-inline-select{background:#121519;color:#fff;border:1px solid rgba(255,255,255,.13);border-radius:10px;padding:9px 11px;font:inherit}.advertising-enquiry-list,.advertising-campaign-list{display:grid;gap:12px}.advertising-enquiry-card,.advertising-campaign-card{padding:15px;border:1px solid rgba(255,255,255,.1);border-radius:15px;background:#15181c}.advertising-card-top{display:flex;justify-content:space-between;gap:16px;align-items:start}.advertising-card-top h3{margin:7px 0 4px;font-size:1rem}.advertising-card-top p{margin:0;color:#aeb5bd;font-size:.84rem}.advertising-enquiry-meta,.advertising-campaign-meta{display:flex;gap:7px 14px;flex-wrap:wrap;margin:11px 0;color:#bac0c7;font-size:.78rem}.advertising-enquiry-meta span,.advertising-campaign-meta span{background:#0f1215;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:6px 8px}.advertising-enquiry-message{white-space:pre-wrap;color:#d2d6db;font-size:.86rem;line-height:1.55;border-left:2px solid rgba(1,135,134,.6);padding-left:10px}.advertising-price{white-space:nowrap;color:#8be5df;font-size:.96rem}.ad-invoice-pill{font-size:.68rem;font-weight:800;padding:5px 7px;border-radius:999px;background:#292e35;color:#c8ced5}.ad-invoice-pill.paid{background:rgba(1,135,134,.2);color:#8be5df}.ad-invoice-pill.sent{background:rgba(86,126,199,.19);color:#b7cdf4}.ad-invoice-pill.overdue{background:rgba(190,43,60,.2);color:#ff9cab}.advertising-editor-panel{margin-top:18px}.advertising-editor-heading,.advertising-creative-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px}.advertising-editor-heading h2,.advertising-creative-head h3{margin:.35rem 0 .25rem}.admin-form-grid{display:grid;gap:14px}.admin-form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.admin-divider{border:0;border-top:1px solid rgba(255,255,255,.1);margin:6px 0}.advertising-creative-preview{max-width:480px;padding:10px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:#101316}.advertising-creative-preview img{display:block;max-width:100%;max-height:260px;object-fit:contain;border-radius:8px}.admin-message.success{color:#8be5df}.admin-message.error{color:#ff9cab}
@media(max-width:1050px){.advertising-admin-grid{grid-template-columns:1fr}.admin-form-grid.three{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.admin-form-grid.two,.admin-form-grid.three{grid-template-columns:1fr}.advertising-card-top,.advertising-editor-heading,.advertising-creative-head{flex-direction:column}.advertising-price{margin-top:3px}}
.status-badge.rejected{background:rgba(190,43,60,.18);color:#ff9cab;border-color:rgba(190,43,60,.34)}
