/* ============================================================
   CalcVerse console — styles for the server-backed control room.
   Everything is namespaced under .cv-root / .cv-login / .cv-modal so the
   console can share style.css with the public site without fighting it.
   ============================================================ */

/* ---------- shell ---------- */
.cv-root {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px 20px 90px;
}

.cv-side {
  position: sticky;
  top: 82px;
  background: linear-gradient(180deg, #121a2e 0%, #0b1120 100%);
  border: 1px solid #1e293b;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 16px 12px 14px;
  color: #cbd5e1;
  max-height: calc(100vh - 100px);
  overflow: auto;
}
.cv-side-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px 14px; margin-bottom: 8px;
  border-bottom: 1px solid #1e293b;
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.01em;
}
.cv-side-brand:hover { text-decoration: none; color: #fff; }
.cv-side-brand em { font-style: normal; color: #a5b4fc; }
.cv-mark {
  width: 28px; height: 28px; flex: none; border-radius: 9px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 17px; font-weight: 800;
}

.cv-nav { display: flex; flex-direction: column; }
.cv-nav-group { margin-bottom: 14px; }
.cv-nav-group > span {
  display: block; padding: 0 10px 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #64748b;
}
.cv-nav a {
  display: block; padding: 8px 11px; margin: 1px 0;
  border-radius: 9px; color: #cbd5e1; font-size: 13.5px; font-weight: 600;
  border-left: 2px solid transparent;
}
.cv-nav a:hover { background: #1b2740; color: #fff; text-decoration: none; }
.cv-nav a.on { background: #223052; color: #fff; border-left-color: #818cf8; }

.cv-side-foot { border-top: 1px solid #1e293b; padding-top: 10px; }
.cv-side-foot .cv-kpi-mini { padding: 5px 8px; }
.cv-kpi-mini b { display: block; font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cv-kpi-mini span { font-size: 11px; color: #7c8aa5; }
.cv-kpi-mini.warn b { color: #fbbf24; }
.cv-kpi-mini.bad b { color: #f87171; }

.cv-main { min-width: 0; }
.cv-top {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  padding: 2px 2px 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.cv-crumb h2 { font-size: 22px; letter-spacing: -.02em; line-height: 1.25; }
.cv-crumb p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.cv-top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.cv-user { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.cv-user b { font-weight: 700; }
.cv-role {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 20px; background: #eef2ff; color: #4338ca;
}
.cv-role.admin { background: #f1f5f9; color: #0f172a; }
.cv-role.viewer { background: #f1f5f9; color: #64748b; }

.cv-body { min-width: 0; }

/* ---------- cards, grids ---------- */
.cv-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.cv-card > h3 { font-size: 15.5px; margin-bottom: 12px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.cv-card > h3 .cv-dim { font-weight: 500; font-size: 12.5px; }
.cv-card.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; padding: 13px; }
.cv-card.ed { padding: 20px; }
.cv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.cv-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.cv-small { font-size: 12px; }
.cv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.cv-kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px 15px;
}
.cv-kpi b { display: block; font-size: 25px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cv-kpi > span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; color: var(--muted); margin-top: 1px; }
.cv-kpi em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.cv-sect { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 10px; }
.cv-card > .cv-sect:first-child, .cv-card.ed .cv-sect:first-child { margin-top: 0; }

/* ---------- tables ---------- */
.cv-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cv-t th {
  text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
.cv-t td { padding: 9px 10px; border-bottom: 1px solid #eef0f6; vertical-align: middle; }
.cv-t.tight td { padding: 7px 10px; }
.cv-t tr:hover td { background: #fafbfe; }
.cv-t tr.dim td { opacity: .58; }
.cv-t tr.me td { background: #f5f7ff; }
.cv-t td.r, .cv-t th.r { text-align: right; font-variant-numeric: tabular-nums; }
.cv-t td.chk, .cv-t th.chk { width: 30px; padding-right: 0; }
.cv-t .strong { font-weight: 650; color: var(--ink); }
.cv-t .sub { color: var(--muted); font-size: 11.5px; }
.cv-t input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.cv-t select, .cv-t input[type="text"], .cv-t input:not([type]) {
  max-width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px;
  font: inherit; font-size: 13px; background: #fff; outline: none;
}
.cv-t input:focus, .cv-t select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.cv-t .nowrap { white-space: nowrap; }

/* ---------- badges ---------- */
.cv-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: #f1f5f9; color: #475569; text-transform: lowercase;
}
.cv-badge.published, .cv-badge.live { background: #ecfdf5; color: #047857; }
.cv-badge.review, .cv-badge.warn { background: #fffbeb; color: #b45309; }
.cv-badge.unlisted, .cv-badge.mute { background: #f1f5f9; color: #64748b; }
.cv-badge.removed, .cv-badge.bad { background: #fef2f2; color: #b91c1c; }
.cv-badge.edited { background: #eef2ff; color: #4338ca; }
.cv-badge.custom { background: #f5f3ff; color: #6d28d9; }
.cv-badge.moved { background: #ecfeff; color: #0e7490; }
.cv-badge.act { background: #f1f5f9; color: #334155; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- buttons ---------- */
.cv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 650;
  cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap;
}
.cv-btn:hover { background: #f6f7fb; border-color: #d3d9e6; text-decoration: none; }
.cv-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, .22); }
.cv-btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.cv-btn.primary:hover { filter: brightness(1.07); }
.cv-btn.danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.cv-btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
.cv-btn.ghost { background: transparent; }
.cv-btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.cv-btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 7px; }
.cv-btn.block { width: 100%; }
.cv-btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }
.cv-btn[disabled]:hover { background: #fff; border-color: var(--border); }
.cv-linkbtn { font-size: 12.5px; font-weight: 650; color: var(--brand); white-space: nowrap; }
.cv-x {
  width: 26px; height: 26px; flex: none; border: 1px solid var(--border); border-radius: 7px;
  background: #fff; color: #94a3b8; font-size: 13px; line-height: 1; cursor: pointer;
}
.cv-x:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.cv-x[disabled] { opacity: .35; cursor: not-allowed; }
.cv-x[disabled]:hover { background: #fff; border-color: var(--border); color: #94a3b8; }

/* ---------- forms ---------- */
.cv-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 16px; }
.cv-form.inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.cv-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.cv-f { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cv-f input, .cv-f textarea, .cv-f select,
.cv-form input, .cv-form textarea, .cv-form select {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  border: 1.5px solid var(--border); border-radius: 9px; background: #fff;
  font: inherit; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink);
  outline: none; resize: vertical;
}
.cv-f input:focus, .cv-f textarea:focus, .cv-f select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.cv-f input[disabled], .cv-f textarea[disabled], .cv-f select[disabled] { background: #f8fafc; color: #94a3b8; }
.cv-f small { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); line-height: 1.45; }
.cv-f.inline2 { display: flex; align-items: flex-start; gap: 9px; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cv-f.inline2 input[type="checkbox"] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand); }
.cv-f.inline2 small { flex-basis: 100%; margin-top: 0; }
.cv-check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.cv-check-inline input { accent-color: var(--brand); }
.cv-form .cv-full { grid-column: 1 / -1; }
.cv-rowhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cv-rowhead h3 { margin: 0; }
.cv-listrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.cv-listrow:first-of-type { border-top: 0; }
.cv-listrow > div { min-width: 0; }
.cv-listrow .cv-dim { margin-top: 3px; font-size: 12.5px; }
.cv-listrow .r { display: flex; gap: 7px; align-items: center; flex: none; }
.cv-catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; margin: 6px 0; }
.cv-catbox { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.cv-catbox input { width: auto; flex: none; margin: 0; }

/* filter widgets inside .cv-card.filters */
.cv-card.filters input, .cv-card.filters select {
  padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 9px;
  font: inherit; font-size: 13.5px; background: #fff; outline: none;
}
.cv-card.filters input:focus, .cv-card.filters select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.cv-card.filters select { max-width: 210px; }
.grow { flex: 1 1 240px; min-width: 170px; }

/* ---------- editor rows ---------- */
.cv-rows-head, .cv-row {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) 92px 74px 116px 104px 30px;
}
.cv-rows-head { padding: 0 2px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.cv-row { margin-bottom: 8px; }
.cv-row.out { grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) 74px 116px 30px; }
.cv-row.band { grid-template-columns: 120px minmax(0, 1fr) 30px; }
.cv-row.field { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) 92px 74px 116px 104px 30px; }
.cv-row input, .cv-row select {
  width: 100%; min-width: 0; padding: 7px 9px; border: 1.5px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 13px; background: #fff; outline: none;
}
.cv-row input.k { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.cv-row input.sm { text-align: right; }
.cv-row input:focus, .cv-row select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.cv-row .fixed { font-size: 12px; padding: 0 4px; }
.cv-opts { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; margin: 0 0 2px; background: #fafbfe; border: 1px dashed var(--border); border-radius: 10px; }
.cv-opt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 120px 26px; gap: 8px; }
.cv-opt input { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: 12.5px; outline: none; }
.cv-rows-head + .cv-dim, .cv-row + .cv-btn.xs { margin-top: 6px; }
.note { display: block; margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; }
.mini { font-size: 11.5px; }

/* guide blocks + faqs */
.cv-block { border: 1px solid var(--border); border-radius: 11px; padding: 12px; margin-bottom: 11px; background: #fff; }
.cv-block-top { display: flex; gap: 9px; align-items: center; margin-bottom: 8px; }
.cv-block-top input { flex: 1; min-width: 0; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 650; outline: none; }
.cv-block-top textarea, .cv-block textarea, .cv-faq textarea {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px;
  font: inherit; font-size: 13.5px; line-height: 1.6; outline: none; resize: vertical;
}
.cv-block textarea:focus, .cv-faq textarea:focus, .cv-block-top input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.cv-block-acts { display: flex; gap: 5px; align-items: center; }
.cv-block .mini { display: block; margin-top: 6px; }
.cv-faq { border: 1px solid var(--border); border-radius: 11px; padding: 12px; margin-bottom: 11px; position: relative; background: #fafbff; }
.cv-faq input { width: 100%; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 650; margin-bottom: 8px; outline: none; }
.cv-faq textarea { background: #fff; }
.cv-faq .cv-x { position: absolute; top: 12px; right: 12px; }

.cv-test { border: 1px solid var(--border); border-radius: 11px; padding: 14px; background: #fafbfe; }
#testVals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
#testVals label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#testVals input { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1.5px solid var(--border); border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--ink); text-transform: none; letter-spacing: 0; outline: none; }
.cv-out {
  margin: 12px 0 0; padding: 12px 13px; border-radius: 10px; background: #0f172a; color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto;
}
.cv-out.bad { background: #2b1113; color: #fecaca; }

/* editor header + tabs */
.cv-ed-top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.cv-ed-top h3 { font-size: 20px; letter-spacing: -.02em; margin: 2px 0 3px; display: flex; align-items: center; gap: 9px; }
.cv-ed-top p { font-size: 13px; margin: 0; }
.cv-ed-actions { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.cv-ed-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.cv-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.cv-tabs button {
  padding: 9px 13px; border: none; border-bottom: 2px solid transparent; background: none;
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer;
}
.cv-tabs button:hover { color: var(--ink); }
.cv-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.cv-tabs-meta { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ---------- SERP preview ---------- */
.cv-serp { border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.cv-serp span { font-size: 12.5px; color: #4d5156; }
.cv-serp a { font-size: 18px; color: #1a0dab; line-height: 1.3; text-decoration: none; }
.cv-serp em { font-style: normal; font-size: 13px; color: #4d5156; line-height: 1.5; }
.cv-counts { display: flex; gap: 16px; margin-top: 9px; font-size: 12px; }
.cv-counts .ok { color: #047857; }
.cv-counts .warn { color: #b45309; }
.cv-counts .bad { color: #b91c1c; }

/* ---------- bulk bar + pager ---------- */
.cv-bulk {
  display: none; gap: 10px; align-items: center; flex-wrap: wrap;
  position: sticky; bottom: 12px; z-index: 20;
  background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b; border-radius: 12px;
  padding: 10px 13px; margin-top: 14px; box-shadow: var(--shadow-lg); font-size: 13.5px;
}
.cv-bulk.on { display: flex; }
.cv-bulk b { color: #a5b4fc; }
.cv-bulk select { padding: 6px 9px; border: 1px solid #334155; border-radius: 8px; background: #172033; color: #e2e8f0; font: inherit; font-size: 13px; outline: none; }
.cv-bulk .cv-btn { background: #172033; border-color: #334155; color: #e2e8f0; }
.cv-bulk .cv-btn:hover { background: #223052; }
.cv-bulk .cv-btn.danger { border-color: #7f1d1d; color: #fca5a5; }
.cv-bulk .cv-btn.ghost { background: transparent; border-color: transparent; color: #94a3b8; }
.cv-pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--muted); }
.cv-pager-btns { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; }

/* ---------- overview extras ---------- */
.cv-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; margin-bottom: 8px; font-size: 13.5px; color: var(--ink); }
.cv-check:hover { text-decoration: none; border-color: #c7d2fe; }
.cv-check i { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: #cbd5e1; }
.cv-check.ok i { background: var(--accent); }
.cv-check.warn i { background: #f59e0b; }
.cv-check.bad i { background: #ef4444; }
.cv-feed { list-style: none; margin: 0 0 12px; padding: 0; }
.cv-feed li { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #eef0f6; font-size: 13px; }
.cv-feed li:last-child { border-bottom: none; }
.cv-feed b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 650; color: var(--brand); }
.cv-feed span { color: var(--ink); }
.cv-feed em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--muted); }
.cv-catbars { display: flex; flex-direction: column; gap: 7px; }
.cv-catbar { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(0, 4fr) 62px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink); padding: 3px 0; }
.cv-catbar:hover { text-decoration: none; background: #fafbfe; }
.cv-catbar em { font-style: normal; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.cv-catbar i { display: block; height: 8px; border-radius: 6px; background: #eef0f6; overflow: hidden; }
.cv-catbar i b { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.cv-catbar span em { color: #b45309; font-style: italic; }
.cv-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cv-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cv-legend .d1 { background: #6366f1; }
.cv-legend .d2 { background: #22c55e; }
.cv-legend .d3 { background: #f59e0b; }
.cv-spark { display: block; width: 100%; height: 150px; }

/* ---------- SEO tab ---------- */
.cv-filelist { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.cv-file { display: flex; gap: 12px; align-items: center; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 13px; color: var(--ink); }
.cv-file:hover { text-decoration: none; border-color: #c7d2fe; background: #fafbff; }
.cv-file .cv-file-n { margin-left: auto; color: var(--muted); font-size: 12px; }
.cv-rebuild { margin-top: 12px; font-size: 13px; }
.cv-rebuild pre { margin-top: 8px; padding: 11px; border-radius: 9px; background: #0f172a; color: #cbd5e1; font-size: 12px; max-height: 240px; overflow: auto; white-space: pre-wrap; }
.cv-preview pre { margin: 0; padding: 12px; border-radius: 10px; background: #0f172a; color: #cbd5e1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.cv-preview b { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.cv-pick { display: flex; gap: 8px; margin-top: 12px; }
.cv-pick input { flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 9px; font: inherit; outline: none; }
.cv-pick input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }

/* ---------- page copy list ---------- */
.cv-pagelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.cv-pagelist.three { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 3px 14px; }
.cv-pagelist li { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 13.5px; }
.cv-pagelist a { color: var(--ink); text-transform: capitalize; }
.cv-pagelist a:hover { color: var(--brand); text-decoration: none; }
.cv-pagelist a.edited { font-weight: 700; color: var(--brand); }
.cv-pagelist .cv-badge { margin-left: auto; }

/* ---------- misc utilities ---------- */
.cv-dim { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.cv-wrap { max-width: 620px; margin: 60px auto; padding: 0 20px; }
.cv-empty { text-align: center; padding: 34px 22px; }
.cv-empty h2, .cv-empty h3 { font-size: 17px; margin-bottom: 6px; }
.cv-empty.bad { border-color: #fecaca; background: #fff7f7; }
.cv-empty .cv-btn { margin-top: 14px; }
.cv-notice { border-left: 3px solid #f59e0b; background: #fffbeb; color: #92400e; font-size: 13.5px; padding: 12px 14px; }
.cv-notice.bad { border-left-color: #ef4444; background: #fef2f2; color: #b91c1c; }
.cv-loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 40px 0; color: var(--muted); font-size: 13.5px; }
.cv-loading span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c7d2fe; border-top-color: var(--brand); animation: cvspin .7s linear infinite; }
@keyframes cvspin { to { transform: rotate(360deg); } }
.cv-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.cv-toolbar label { display: inline-flex; gap: 7px; align-items: center; font-weight: 650; color: var(--ink); }
.cv-toolbar select { padding: 6px 9px; border: 1.5px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; background: #fff; outline: none; }
.cv-subfilter { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.cv-subfilter input { flex: 1; min-width: 200px; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 9px; font: inherit; font-size: 13.5px; outline: none; }
.cv-subfilter select { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 9px; font: inherit; font-size: 13.5px; background: #fff; outline: none; }
.cv-subfilter input:focus, .cv-subfilter select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.cv-card code { background: #f1f3f9; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.cv-file input[type="file"] { font-size: 13px; margin-bottom: 10px; }
#imText, .cv-card textarea { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font: inherit; font-size: 13.5px; outline: none; resize: vertical; }
#imText:focus, .cv-card textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }

/* ---------- toasts ---------- */
.cv-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 400; display: flex; flex-direction: column; gap: 9px; max-width: min(420px, 84vw); }
.cv-toast {
  display: flex; gap: 12px; align-items: center;
  background: #0f172a; color: #f1f5f9; border-radius: 11px; padding: 12px 15px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); border-left: 3px solid var(--accent);
  animation: cvin .22s ease-out;
}
.cv-toast.bad { border-left-color: #ef4444; }
.cv-toast.out { opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; }
.cv-toast button { margin-left: auto; background: #223052; color: #a5b4fc; border: none; border-radius: 7px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cv-toast button:hover { background: #2e3f68; color: #fff; }
@keyframes cvin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- modal ---------- */
.cv-modal { position: fixed; inset: 0; z-index: 500; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.cv-modal-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 24px; max-width: 480px; width: 100%; }
.cv-modal-card.danger { border-top: 3px solid #ef4444; }
.cv-modal-card h3 { font-size: 18px; letter-spacing: -.01em; margin-bottom: 8px; }
.cv-modal-card p { font-size: 14px; color: #475569; line-height: 1.65; }
.cv-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- login ---------- */
.cv-login { display: grid; place-items: center; padding: 56px 20px 90px; }
.cv-login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px; }
.cv-login-mark { width: 46px; height: 46px; border-radius: 13px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 25px; font-weight: 800; margin-bottom: 16px; }
.cv-login-card h1 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 4px; }
.cv-login-card p { font-size: 13.5px; margin-bottom: 20px; }
.cv-login-card label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 13px; }
.cv-login-card input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; font-size: 14.5px; color: var(--ink); text-transform: none; letter-spacing: 0; outline: none; }
.cv-login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.cv-login-card .cv-btn { margin-top: 6px; }

/* ---------- executive author cards & dashboard additions ---------- */
.cv-author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.cv-author-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cv-author-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
  border-color: #cbd5e1;
}
.cv-ac-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cv-ac-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.cv-ac-avatar {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #e0e7ff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.cv-ac-avatar.ph {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .04em;
}
.cv-ac-verified {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #10b981;
  color: #fff;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  font-weight: 900;
}
.cv-ac-meta {
  flex: 1;
  min-width: 0;
}
.cv-ac-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cv-ac-name a {
  color: inherit;
  text-decoration: none;
}
.cv-ac-name a:hover {
  color: var(--brand, #4f46e5);
}
.cv-ac-role {
  font-size: 13px;
  color: var(--brand, #4f46e5);
  font-weight: 600;
  line-height: 1.35;
}
.cv-ac-cred {
  font-size: 12.5px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}
.cv-ac-stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  font-size: 12.5px;
}
.cv-ac-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand, #4f46e5);
  font-weight: 750;
}
.cv-ac-desk {
  background: #eef2ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 650;
}
.cv-ac-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.cv-ac-chips .chip {
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
}
.cv-ac-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.cv-ac-actions .cv-btn {
  font-size: 12px;
  padding: 4px 9px;
}
.cv-ac-actions .cv-link-out {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted, #64748b);
  text-decoration: none;
  font-weight: 600;
}
.cv-ac-actions .cv-link-out:hover {
  color: var(--brand, #4f46e5);
}

/* Byline Live Preview in Editor */
.cv-byline-preview-box {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.cv-byline-preview-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mini author chip in engines table */
.cv-auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 2px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 650;
  color: #1e293b;
  text-decoration: none;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .15s, background .15s;
}
.cv-auth-chip:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
  text-decoration: none;
}
.cv-mini-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.cv-mini-avatar.ph {
  background: #6366f1;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .cv-rows-head, .cv-row.field { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 78px 62px 100px 92px 28px; }
}
@media (max-width: 940px) {
  .cv-root { grid-template-columns: 1fr; padding: 16px 14px 80px; }
  .cv-side { position: static; max-height: none; }
  .cv-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .cv-nav-group { margin-bottom: 0; display: flex; gap: 4px; }
  .cv-nav-group > span { display: none; }
  .cv-nav a { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .cv-nav a.on { border-bottom-color: #818cf8; }
  .cv-side-foot { display: flex; gap: 16px; flex-wrap: wrap; }
  .cv-rows-head { display: none; }
  .cv-row, .cv-row.field, .cv-row.out, .cv-row.band { grid-template-columns: repeat(2, minmax(0, 1fr)) 28px; }
  /* minmax(0, 1fr), not 1fr: a 1fr track takes its floor from the card's min-content, and a card
     holding a wide .cv-t table reports a min-content wider than the phone — so the whole grid
     pushed the document sideways instead of letting the table scroll inside itself. */
  .cv-cols { grid-template-columns: minmax(0, 1fr); }
  .cv-cols > *, .cv-grid > *, .cv-card > * { min-width: 0; }
}

/* ---------- phone ----------
   The 940 breakpoint already stacks the shell, so what is left for a real phone is the wide
   machinery: tables scroll inside themselves instead of stretching the document, every control
   reaches a thumb-sized hit area, and form fields are 16px because iOS zooms a smaller one the
   moment it takes focus. */
@media (max-width: 940px) {
  .cv-t { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cv-top-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .cv-crumb h2 { font-size: 19px; }
  .cv-btn { min-height: 40px; }
  .cv-btn.sm { min-height: 40px; }
  .cv-btn.xs { min-height: 34px; padding: 5px 9px; }
  /* The bulk-select checkboxes are the only row-wide tap target on a phone; the browser default
     is a 13px box, which is a miss more often than a hit. */
  .cv-t .chk input { width: 19px; height: 19px; }
  .cv-nav a { min-height: 42px; display: flex; align-items: center; }
  /* Every field in a view, not just the styled forms: the taxonomy grid edits names and slugs in
     bare table-cell inputs, and the audit/team pickers inherit 13px selects. iOS zooms the whole
     page zooms the moment such a field takes focus. The !important is load-bearing — a dozen
     per-component rules (.cv-t select, .cv-row input, .cv-subfilter …) out-specify a plain container rule. */
  .cv-body input, .cv-body select, .cv-body textarea,
  .cv-modal input, .cv-modal select, .cv-modal textarea,
  .cv-login-card input { font-size: 16px !important; }
  .cv-body input:not([type=checkbox]):not([type=radio]),
  .cv-modal input:not([type=checkbox]),
  .cv-body select, .cv-modal select { min-height: 40px; }
  .cv-card.filters select { max-width: none; flex: 1 1 140px; }
  .cv-ed-actions { margin-left: 0; width: 100%; }
  .cv-ed-actions .cv-btn { flex: 1 1 auto; }
  .cv-catbar { grid-template-columns: minmax(84px, 1.2fr) minmax(0, 3fr) 52px; }
  .cv-modal { padding: 12px; }
  .cv-modal-card { padding: 18px; }
  .cv-modal-actions { flex-wrap: wrap; }
  .cv-modal-actions .cv-btn { flex: 1 1 40%; }
  .cv-toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .cv-bulk { bottom: 8px; gap: 8px; padding: 10px 11px; }
}

@media (max-width: 560px) {
  .cv-root { padding: 12px 12px 84px; gap: 14px; }
  .cv-grid { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
  .cv-row, .cv-row.field, .cv-row.out, .cv-row.band { grid-template-columns: minmax(0, 1fr) 30px; }
  .cv-opt { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 26px; }
  .cv-side { padding: 12px 10px; }
  .cv-pager-btns { margin-left: 0; }
  .cv-spark { height: 118px; }
}

@media (hover: none) {
  .cv-t tr:hover td, .cv-catbar:hover { background: transparent; }
  .cv-btn:not(.primary):hover { background: #fff; border-color: var(--border); }
  .cv-btn.primary:hover { filter: none; }
}

/* Ad manager: the placement picker is a card grid, not a list, because six labelled tiles read
   faster than six checkboxes. The preview mirrors the frame visitors see so an admin can spot a
   broken house layout before saving. */
.cv-pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.cv-pl { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.cv-pl:hover { border-color: var(--brand); }
.cv-pl input { align-self: flex-start; margin: 0 0 4px; }
.cv-pl b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cv-pl span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.cv-ad-preview { position: relative; margin-top: 12px; padding: 22px 14px 12px; border: 1.5px dashed var(--border); border-radius: 10px; background: #f7f8fc; min-height: 90px; }
.cv-ad-preview .cv-ad-label { position: absolute; top: 6px; left: 12px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
