/* The CMS's own pieces, where the shared style has none: the page editor beside its preview, the
   preview frame at each device width, the Pages list's domain and site rows, the media grid, the
   brand swatches, the copy rows of Connect AI. Everything else is style.css. */

.btn-row > .grow, .toolbar > .grow, .mf > .grow { flex: 1; }
.cms-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cms-pad { padding: 14px 16px; display: grid; gap: 12px; }
.cms-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cms-small { font-size: 12px; }
.cms-up { color: var(--ok); }
.cms-wait { cursor: wait; opacity: .7; }
.cms-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: var(--muted); font-size: 13px; }
.cms-note > .i { flex: none; color: var(--info); }
.cms-note-in { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-sm); font-size: 12.5px; }
.cms-note-in > .i { flex: none; color: var(--accent); }
.cms-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cms-back { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.cms-back:hover { color: var(--fg); }
.cms-back .i { width: 13px; height: 13px; }

/* ---- Pages ---- */
.cms-acts { justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
.cms-views { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cms-ext { color: var(--faint); display: inline-flex; vertical-align: -2px; }
.cms-ext:hover { color: var(--accent); }
.cms-ext .i { width: 13px; height: 13px; }
.kind.cms-child { background: none; }
.tbl tr.cms-sep td { height: 38px; background: var(--sunken); cursor: default; }
.tbl tr.cms-sep:hover td { background: var(--sunken); }
.tbl tr.cms-sep .empty { background: var(--panel); }
.tbl tr.cms-grp td { height: 44px; background: var(--raised); }
.tbl tr.cms-grp .btn-row { flex-wrap: nowrap; }
.tbl tr.cms-grp .kind { width: 24px; height: 24px; }

/* ---- the page editor ---- */
.cms-ed-page { max-width: none; }
.cms-ed { display: grid; grid-template-columns: minmax(380px, 560px) minmax(0, 1fr); gap: 16px; align-items: start; }
.cms-ed-form { min-width: 0; }
.cms-ed-form .tabs { padding: 0 8px; }
.cms-ed-body { padding: 16px; display: grid; gap: 14px; }
.cms-code { font-size: 12.5px; line-height: 1.5; tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
textarea.cms-code[data-f="html"] { min-height: 52vh; }
.cms-prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); padding-left: 10px; }
.cms-prefix .input { border: 0; background: none; padding-left: 0; box-shadow: none; }
.cms-prefix span { white-space: nowrap; font-size: 12.5px; }
.cms-site { padding: 8px 11px; border: 1px dashed var(--line); border-radius: var(--r-sm); font-size: 12.5px; color: var(--muted); }
.cms-site b { color: var(--fg); }
.cms-count { float: right; font: 11px var(--mono); }
.cms-serp { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); display: grid; gap: 3px; font-size: 12.5px; }
.cms-serp-t { color: var(--info); font-size: 16px; }
.cms-box { border: 1px solid var(--line); border-radius: var(--r-sm); }
.cms-box .rowi { cursor: pointer; }
.cms-old { text-decoration: line-through; color: var(--faint) !important; white-space: normal !important; }
#ed-unsaved[hidden] { display: none; }
.cms-pv-card { position: sticky; top: 12px; min-width: 0; overflow: hidden; }
.cms-pv-card .toolbar { flex-wrap: wrap; }
.cms-pv-card .cms-stage { height: calc(100vh - 190px); min-height: 420px; }

/* ---- the preview frame ---- */
.cms-stage { background: var(--sunken); display: grid; justify-items: center; align-items: stretch; padding: 14px; height: 70vh; overflow: auto; }
.cms-frame { width: 100%; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; transition: width .2s; }
.cms-frame.tablet { width: 820px; max-width: 100%; }
.cms-frame.mobile { width: 390px; max-width: 100%; }
.cms-frame > .empty { background: var(--panel); align-content: center; }
.cms-iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.modal.cms-pv-modal { width: min(1240px, 100%); max-height: 94vh; }
.modal.cms-pv-modal .mb { gap: 10px; }

/* ---- domains, media, brand ---- */
.cms-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.cms-fav { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; flex: none; }
.cms-sw { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.cms-sw.on { border-color: var(--fg); }
.cms-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.cms-tile { overflow: hidden; display: flex; flex-direction: column; }
.cms-thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; background: repeating-conic-gradient(var(--raised) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.cms-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cms-tile-b { padding: 10px 12px; display: grid; gap: 6px; flex: 1; align-content: start; }
.cms-tile-b .btn { justify-self: start; margin-top: 4px; }
.cms-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.cms-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.cms-brand-id { display: flex; gap: 16px; align-items: center; padding: 16px; }
.cms-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; padding: 14px 16px; }
.cms-swatch { display: grid; gap: 3px; font-size: 12.5px; }
.cms-chip { height: 56px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 4px; }
.cms-copy { display: flex; gap: 6px; align-items: center; }
.cms-copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: var(--r-sm); font-size: 12px; }
.cms-on { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.cms-set { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }

@media (max-width: 1100px) {
  .cms-ed { grid-template-columns: minmax(0, 1fr); }
  .cms-pv-card { position: static; }
}
@media (max-width: 700px) {
  .cms-two, .cms-set { grid-template-columns: minmax(0, 1fr); }
}
