/* ════════════════════════════════════════════════════════════════
   Rankbly — design system. Dark sidebar + light content, sh-* form
   controls. Shared by the dashboard, admin, profile and auth screens.
   ════════════════════════════════════════════════════════════════ */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-rgb: 79, 70, 229;
  --ink: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --bg: #f4f4f6;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -6px rgba(15, 23, 42, 0.12), 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, 0.22);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
}
.hidden {
  display: none !important;
}

/* ── App shell ── */
.cb-app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 232px;
  background: #09090b;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px 0;
  height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand img {
  width: 86px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #52525b;
  padding: 14px 10px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #a1a1aa;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition:
    color 0.15s,
    background 0.15s;
}
.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.nav-item.active {
  color: #fff;
  background: rgba(79, 70, 229, 0.32);
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sf-info {
  flex: 1;
  min-width: 0;
}
.sf-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-sub {
  font-size: 10.5px;
  color: #71717a;
  text-transform: capitalize;
}
.icon-btn {
  background: none;
  border: none;
  color: #71717a;
  cursor: pointer;
  padding: 6px;
  border-radius: 7px;
  transition:
    color 0.15s,
    background 0.15s;
  display: flex;
}
.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}

.main {
  margin-left: 232px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  min-height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 26px;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 14px;
}
.topbar h1 {
  font-size: 15px;
  font-weight: 700;
}
.topbar .sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.content {
  padding: 26px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
.mobile-menu-btn {
  display: none;
}

/* ── Cards / panels ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad {
  padding: 22px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 14px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-head p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  max-width: 560px;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 12px;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Buttons ── */
.sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  white-space: nowrap;
}
.sh-btn svg {
  width: 15px;
  height: 15px;
}
.sh-btn:hover {
  background: #f9fafb;
}
.sh-btn:active {
  transform: translateY(1px);
}
.sh-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.sh-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(var(--primary-rgb), 0.6);
}
.sh-btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.sh-btn-destructive {
  background: #fff;
  border-color: #fecaca;
  color: var(--danger);
}
.sh-btn-destructive:hover {
  background: #fef2f2;
}
.sh-btn-ghost {
  background: transparent;
  border-color: transparent;
}
.sh-btn-ghost:hover {
  background: #f3f4f6;
}
.sh-btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}
.sh-btn-lg {
  padding: 12px 22px;
  font-size: 14px;
}

/* ── Form controls ── */
.field {
  margin-bottom: 16px;
}
.field label,
.sh-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.sh-hint {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 5px;
}
.sh-input,
.sh-select,
textarea.sh-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.sh-input:focus,
.sh-select:focus,
textarea.sh-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
textarea.sh-input {
  resize: vertical;
  line-height: 1.55;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
/* Keep toggles as inline-flex even inside .field, where the generic `.field label`
   rule would otherwise force display:block and collapse the inline track to 0 width. */
.field label.toggle {
  display: inline-flex;
  margin-bottom: 0;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle .track {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.toggle input:checked + .track {
  background: var(--primary);
}
.toggle input:checked + .track::after {
  transform: translateX(17px);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.toggle-row:last-child {
  border-bottom: none;
}
.toggle-row .tr-title {
  font-size: 13.5px;
  font-weight: 600;
}
.toggle-row .tr-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green {
  background: #dcfce7;
  color: #15803d;
}
.badge-amber {
  background: #fef3c7;
  color: #b45309;
}
.badge-red {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-gray {
  background: #f3f4f6;
  color: #4b5563;
}
.badge-violet {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary-dark);
}
.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ── Tables ── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f1f4;
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tbody tr {
  transition: background 0.12s;
}
.table tbody tr:hover {
  background: #fafafa;
}
.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

/* ── Post library grid ── */
.posts-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.posts-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}
.posts-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.posts-search .sh-input {
  padding-left: 36px;
}
.posts-toolbar .sh-select {
  width: auto;
  flex: 0 0 auto;
  min-width: 150px;
}
@media (max-width: 560px) {
  .posts-toolbar .sh-select {
    flex: 1 1 auto;
  }
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.post-card-img {
  height: 132px;
  background-size: cover;
  background-position: center;
  background-color: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-img.noimg {
  color: var(--primary);
  opacity: 0.4;
}
.post-card-img.noimg svg {
  width: 38px;
  height: 38px;
}
.post-card-body {
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.post-card-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.post-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-excerpt {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.post-card-meta {
  font-size: 11px;
  color: var(--muted-2);
}
.new-card {
  border: 2px dashed var(--line);
  background: #fcfcfd;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.new-card:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.new-card svg {
  width: 26px;
  height: 26px;
}

/* ── Connections ── */
.conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.conn-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.conn-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.conn-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-weight: 800;
}
.conn-logo.wordpress {
  background: #21759b;
}
.conn-logo.shopify {
  background: #5e8e3e;
}
.conn-name {
  font-weight: 700;
  font-size: 14.5px;
}
.conn-target {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.conn-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}
.platform-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 6px;
}
.platform-opt {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.platform-opt:hover {
  border-color: var(--primary);
}
.platform-opt.sel {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
}
.platform-opt .pl-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  color: #fff;
  font-weight: 800;
}
.platform-opt .pl-name {
  font-weight: 700;
  font-size: 14px;
}
.platform-opt .pl-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Editor (two-column: form + preview) ── */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 22px;
  align-items: start;
}
.editor-preview {
  position: sticky;
  top: 86px;
}
@media (max-width: 1080px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-preview {
    position: static;
  }
}
.editor-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 400px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-color: #eef2ff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
}
/* Keep the empty upload placeholder compact — only a real header image gets the full landscape frame. */
.editor-img.noimg { aspect-ratio: auto; height: 220px; max-height: none; }
.editor-img .img-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}
.article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.article h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.25;
}
.article .a-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 12px;
}
.article .a-img {
  width: 100%;
  /* Crop to a wide banner so a square (or letterboxed) source never shows grey bars. */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin: 4px 0 18px;
}
.prose {
  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
}
.prose h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 22px 0 10px;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 8px;
}
.prose p {
  margin: 0 0 14px;
}
/* Restore list markers: Tailwind preflight resets list-style to none, so plain
   AI-generated <ul>/<ol> would render without bullets. Quill's data-list items
   keep their own ::before markers (they set list-style:none on the <li> below). */
.prose ul {
  margin: 0 0 14px;
  padding-left: 24px;
  list-style: disc;
}
.prose ol {
  margin: 0 0 14px;
  padding-left: 24px;
  list-style: decimal;
}
.prose li {
  margin-bottom: 6px;
}
.prose strong {
  font-weight: 700;
}
.prose em {
  font-style: italic;
}
.prose blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 14px;
  color: var(--muted);
  margin: 0 0 14px;
  font-style: italic;
}
.prose a {
  color: var(--primary);
  text-decoration: underline;
}
.content-editor {
  width: 100%;
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ── Rich-text editor (Quill) ── */
.content-editor-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.content-editor-wrap .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  background: #fafafb;
}
.content-editor-wrap .ql-container.ql-snow {
  border: none;
  font-family: inherit;
  font-size: 15px;
}
.content-editor-wrap .ql-editor {
  min-height: 340px;
  line-height: 1.7;
  color: #1f2937;
}
.content-editor-wrap .ql-editor.ql-blank::before {
  color: var(--muted-2);
  font-style: normal;
}
.content-editor-wrap .ql-snow .ql-stroke {
  stroke: var(--muted);
}
.content-editor-wrap .ql-snow .ql-fill {
  fill: var(--muted);
}
.content-editor-wrap .ql-snow.ql-toolbar button:hover .ql-stroke,
.content-editor-wrap .ql-snow .ql-toolbar button:hover .ql-stroke {
  stroke: var(--primary);
}
.content-editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-stroke,
.content-editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-fill {
  stroke: var(--primary);
}
.content-editor-wrap .ql-snow .ql-picker.ql-expanded .ql-picker-label {
  border-color: var(--line);
}

/* Quill 2 renders bullet lists as <ol><li data-list="bullet">; show the right
   marker in the live preview before the HTML is normalized on save. */
.prose ol,
.prose ul {
  counter-reset: ql-c;
}
.prose li[data-list] {
  list-style: none;
  position: relative;
}
.prose ol li[data-list="ordered"] {
  counter-increment: ql-c;
}
.prose ol li[data-list="ordered"]::before {
  content: counter(ql-c) ". ";
  position: absolute;
  left: -1.5em;
}
.prose ol li[data-list="bullet"]::before {
  content: "•";
  position: absolute;
  left: -1em;
  color: var(--primary);
  font-weight: 700;
}
.prose .ql-align-center {
  text-align: center;
}
.prose .ql-align-right {
  text-align: right;
}
.prose .ql-align-justify {
  text-align: justify;
}
.prose img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 4px 0;
}

/* ── SEO score badge on post cards ── */
.post-card-img {
  position: relative;
}
.seo-score-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  opacity: 0.96;
}
.seo-score-badge svg {
  width: 11px;
  height: 11px;
}
.post-card-img.noimg .seo-score-badge {
  opacity: 1;
}

/* ── SEO panel (editor) ── */
.seo-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 4px 0 18px;
  background: var(--card);
  overflow: hidden;
}
.seo-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: #fafafb;
  border: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: #374151;
}
.seo-panel-toggle:hover {
  background: #f3f4f6;
}
.seo-panel-toggle svg {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  color: var(--primary);
}
.seo-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f3f4f6;
}
.seo-panel-body {
  padding: 16px;
}
.seo-panel-body.collapsed {
  display: none;
}
.seo-meter {
  height: 8px;
  border-radius: 999px;
  background: #eef0f3;
  overflow: hidden;
}
.seo-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition:
    width 0.35s ease,
    background 0.35s ease;
}
.seo-score-text {
  margin: 8px 0 12px;
}
.seo-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 16px;
}
.seo-checklist li {
  font-size: 12.5px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: #374151;
}
.seo-checklist li span {
  font-weight: 800;
  flex-shrink: 0;
}
.seo-checklist li.ok span {
  color: #16a34a;
}
.seo-checklist li.bad span {
  color: var(--danger);
}
.seo-checklist li em {
  color: var(--muted);
  font-style: normal;
}
.seo-fix-btn {
  margin-bottom: 4px;
}

/* ── Single-column editor (live preview moved into a popup) ── */
.editor-single {
  max-width: none;
}
.preview-article {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}
.modal .preview-article h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

/* Publish target list (inside modal) */
.pub-target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 8px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.pub-target:hover {
  border-color: var(--primary);
}
.pub-target.sel {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
}
.pub-target .conn-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
}
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.pub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfcfd;
  flex-wrap: wrap;
}
.pub-row .badge {
  flex-shrink: 0;
}
.pub-row .pub-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pub-row a {
  color: var(--primary);
  font-weight: 600;
}
.pub-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pub-row-deleted {
  background: #fef2f2;
  border-color: #fecaca;
}
.pub-row-deleted .pub-name {
  color: var(--muted);
  text-decoration: line-through;
}

/* Subscription plan card (profile) */
.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  max-width: 360px;
}
.plan-card.plan-current {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.plan-name {
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-price {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.plan-per {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.plan-feats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-feats li {
  font-size: 13px;
  color: var(--muted);
  padding-left: 22px;
  position: relative;
}
.plan-feats li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}

/* Stat tiles */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat .sv {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat .sl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Empty / loading ── */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
/* inline-block so text-align:center still centers it once Tailwind's preflight sets svg{display:block} */
.empty svg {
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
/* Don't let the decorative-icon sizing leak into a button's own icon (e.g. the empty-state CTA). */
.empty .sh-btn svg {
  display: block;
  width: 15px;
  height: 15px;
  margin-bottom: 0;
  opacity: 1;
}
.empty h3 {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.center-load {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}
.spa-loading {
  flex: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spa-loading .spinner {
  width: 30px;
  height: 30px;
}
.btn-spin {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Notifications dropdown ── */
.notif-wrap {
  position: relative;
}
.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px;
  border-radius: 8px;
  color: var(--muted);
}
.notif-btn:hover {
  background: #f3f4f6;
  color: var(--ink);
}
.notif-btn svg {
  width: 19px;
  height: 19px;
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  padding: 0 3px;
}
.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 360px;
  max-width: 90vw;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 13px;
}
.notif-list {
  max-height: 340px;
  overflow-y: auto;
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f1f4;
  font-size: 13px;
}
.notif-item.unread {
  background: rgba(var(--primary-rgb), 0.04);
}
.notif-item .ni-time {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 3px;
}

/* ── Auth screens ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(var(--primary-rgb), 0.12), transparent), var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
}
.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.auth-brand img {
  width: 112px;
}
.auth-title {
  font-size: 21px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 24px;
}
.auth-card .sh-btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
}
.auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
}
.auth-foot a {
  color: var(--primary);
  font-weight: 600;
}
.auth-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ── Alerts / toast ── */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.alert-ok {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.alert-info {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: #09090b;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease;
}
.toast.ok {
  background: #15803d;
}
.toast.err {
  background: #b91c1c;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fade 0.2s ease;
}
.modal.lg {
  max-width: 620px;
}
/* The post preview reads like a published article — give it a wider measure than
   other lg modals (e.g. the support thread), without affecting them. */
.modal.lg:has(.preview-article) {
  max-width: 1200px;
}
.modal:has(.preview-article) .modal-body {
  padding: 28px 32px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  font-size: 16px;
  font-weight: 700;
}
.modal-body {
  padding: 22px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}

/* ── Subscribe banner ── */
.subscribe-banner {
  background: linear-gradient(120deg, var(--primary), #7c3aed);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
}
.subscribe-banner h3 {
  font-size: 16px;
  font-weight: 700;
}
.subscribe-banner p {
  font-size: 13px;
  opacity: 0.92;
  margin-top: 3px;
}
.subscribe-banner .sh-btn {
  background: #fff;
  color: var(--primary-dark);
  border-color: #fff;
  flex-shrink: 0;
}

.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 16px;
}
.wfull {
  width: 100%;
}

/* ── Support tickets ── */
.tk-subject {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tk-last {
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-thread-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  max-height: 52vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fbfaff, #f5f6fb);
}
.tk-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 80%;
}
.tk-msg.mine {
  align-self: flex-end;
  align-items: flex-end;
}
.tk-msg.staff {
  align-self: flex-start;
  align-items: flex-start;
}
.tk-msg-author {
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px;
}
.tk-bubble {
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}
.tk-msg.mine .tk-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.tk-msg.staff .tk-bubble {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  .sidebar.open {
    transform: none;
  }
  .main {
    margin-left: 0;
  }
  .content {
    padding: 18px;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .editor-layout {
    grid-template-columns: 1fr;
  }
}
