.cms-admin-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.cms-admin-index,
.cms-page-editor {
  min-width: 0;
  border: 1px solid #ded6c9;
  border-radius: 10px;
  background: #fffdf8;
  color: var(--paper-ink);
}

.cms-admin-index {
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.cms-admin-index-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid #e2dacd;
  background: #f6f2e9;
}

.cms-admin-index-head div,
.cms-page-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cms-admin-index-head strong,
.cms-page-row strong {
  color: #161919;
}

.cms-admin-index-head span,
.cms-page-row span,
.cms-page-row small,
.cms-editor-footer,
.cms-settings-grid label {
  color: #68716f;
  font-size: 12px;
}

.cms-page-rows {
  display: grid;
  max-height: min(74vh, 760px);
  overflow: auto;
}

.cms-page-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid #e5ded2;
  border-radius: 0;
  background: transparent;
  color: #161919;
  text-align: left;
}

.cms-page-row:hover {
  background: #f5fbf8;
}

.cms-page-row.is-selected {
  background: #e4f2ee;
  box-shadow: inset 3px 0 0 #166f67;
}

.cms-page-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}

.cms-page-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cms-page-editor {
  display: grid;
  overflow: hidden;
}

.cms-editor-commandbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid #e2dacd;
  background: #f8f4ec;
}

.cms-editor-commandbar h3 {
  max-width: 620px;
  margin: 0;
  color: #111313;
  font-size: clamp(23px, 2.2vw, 34px);
  line-height: 1.1;
}

.cms-editor-commandbar p {
  margin: 6px 0 0;
  color: #68716f;
  font-size: 13px;
}

.cms-status-pill {
  display: inline-grid;
  min-height: 22px;
  place-items: center;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ebe6dc;
  color: #4d5552;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.cms-status-pill.is-published {
  background: #d9eee8;
  color: #11645c;
}

.cms-status-pill.is-archived {
  background: #f1ddd8;
  color: #8d332a;
}

.cms-editor-shell {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}

.cms-primary-fields,
.cms-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cms-primary-fields label,
.cms-settings-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cms-primary-fields input {
  min-height: 48px;
  font-size: 16px;
  font-weight: 800;
}

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

.cms-content-workbench {
  display: grid;
  gap: 8px;
}

.cms-rich-editor {
  min-height: 420px;
  border: 1px solid #d8d0c2;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.cms-page-editor .ql-toolbar.ql-snow {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid #d8d0c2;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #ded6c9;
  background: #fbf8f1;
}

.cms-rich-editor.ql-container.ql-snow {
  min-height: 360px;
  border: 1px solid #d8d0c2;
  border-radius: 0 0 10px 10px;
  font: 16px/1.62 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cms-rich-editor .ql-editor {
  min-height: 360px;
  padding: 22px;
  color: #151717;
}

.cms-rich-editor .ql-editor h2,
.cms-rich-editor .ql-editor h3 {
  color: #111313;
}

.cms-rich-editor-loading,
.cms-rich-editor-error {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #68716f;
  font-weight: 800;
}

.cms-rich-editor-error {
  color: #8d332a;
}

.cms-html-source {
  display: none;
  min-height: 320px;
  resize: vertical;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.cms-html-source.is-visible {
  display: block;
}

.cms-page-settings {
  border: 1px solid #ded6c9;
  border-radius: 10px;
  background: #fbf8f1;
}

.cms-page-settings summary {
  cursor: pointer;
  padding: 13px 14px;
  color: #161919;
  font-weight: 900;
}

.cms-settings-grid {
  padding: 0 14px 14px;
}

.cms-checkbox {
  align-self: end;
  min-height: 46px;
  display: flex !important;
  flex-direction: row;
  gap: 9px !important;
  align-items: center;
}

.cms-checkbox input {
  width: auto;
}

.cms-editor-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

@media (max-width: 1400px) {
  .cms-admin-workspace {
    grid-template-columns: minmax(200px, 220px) minmax(0, 1fr);
  }

  .cms-admin-index {
    position: static;
  }

  .cms-page-rows {
    grid-template-columns: 1fr;
    max-height: 720px;
  }

  .cms-page-row {
    border-right: 0;
  }

  .cms-page-editor {
    min-height: 640px;
  }
}

@media (max-width: 1100px) {
  .cms-admin-workspace,
  .cms-primary-fields,
  .cms-settings-grid {
    grid-template-columns: 1fr;
  }

  .cms-admin-index {
    position: static;
  }

  .cms-editor-commandbar {
    display: grid;
  }
}
