body.cms {
  display: block;
  font-size: 16px;
  min-height: 100dvh;
}
.cms-top {
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--paper);
  align-items: center;
}
.cms-top strong {
  font-size: 22px;
}
.cms-top nav,
.cms-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cms-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 36px 28px 64px;
}
.cms-member {
  max-width: 880px;
}
.cms-eyebrow {
  font: 12px var(--font-data);
  letter-spacing: 2px;
  color: var(--muted);
}
.cms h1 {
  font-size: 36px;
  line-height: 1.3;
  margin: 10px 0 16px;
}
.cms h2 {
  font-size: 23px;
  margin: 0 0 16px;
}
.cms p {
  line-height: 1.8;
}
.cms-muted {
  color: var(--muted);
}
.cms-panel {
  background: var(--paper);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  margin-top: 24px;
}
.cms-panel.vip-panel {
  border-top: 5px solid var(--yellow);
}
.cms-purchase {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.cms-panel > .cms-purchase:only-child {
  margin: 0;
  padding: 0;
  border: 0;
}
.cms-purchase > div {
  flex: 1;
  min-width: 0;
}
.cms-purchase h3 {
  font-size: 20px;
  margin: 0;
}
@media (max-width: 600px) {
  .cms-purchase {
    flex-direction: column;
    align-items: stretch;
  }
  .cms-purchase .bundle-code {
    align-self: center;
  }
}
.cms-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.cms-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
  min-width: 0;
}
.cms-field label {
  font-weight: 600;
  font-size: 14px;
}
.cms-field input,
.cms-field textarea,
.cms-field select,
.cms-search input,
.cms-search select {
  font: inherit;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.cms-field textarea {
  resize: none;
  max-height: 400px;
  overflow: auto;
}
.cms-field textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.cms-field small {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  min-height: 0;
}
.cms-field small:empty {
  display: none;
}
.cms-field .field-error {
  color: var(--warning);
}
.cms-field [aria-invalid="true"] {
  border-color: var(--warning);
  background: var(--warning-bg);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap input[type="password"],
.input-wrap:has(.reveal) input {
  padding-right: 68px;
}
.reveal {
  position: absolute;
  right: 4px;
  padding: 10px;
  background: var(--page);
  border-radius: 7px;
  font-size: 13px;
}
.cms-error {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning);
  color: var(--warning);
  padding: 12px 16px;
  overflow-wrap: anywhere;
}
.cms-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.cms-tabs a {
  padding: 12px 18px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 600;
}
.cms-tabs a[aria-current="page"] {
  background: var(--yellow);
  border-color: var(--yellow);
}
.cms-search {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 20px;
}
.cms-search label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}
.cms-search .search-box {
  flex: 1;
  min-width: 220px;
}
.cms-search .search-box > div {
  display: flex;
  gap: 8px;
}
.cms-search select {
  min-width: 160px;
  width: auto;
}
.cms-search button {
  min-height: 46px;
}
.cms-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.cms table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  min-width: 700px;
}
.cms th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  background: var(--page);
  white-space: nowrap;
}
.cms td,
.cms th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.cms tr:last-child td {
  border-bottom: 0;
}
.cms td .button {
  font-size: 12px;
  min-height: 38px;
  padding: 8px 12px;
}
.cms td input[type="checkbox"],
.cms th input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}
.cms-title-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 230px;
}
.cms-title-cell img {
  width: 64px;
  height: 40px;
  object-fit: cover;
  background: var(--lcd);
  border-radius: 5px;
}
.cms-title-cell small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.cms-badge {
  display: inline-block;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.cms-badge.vip {
  background: var(--yellow-soft);
}
.cms-list-status {
  min-height: 28px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}
.cms-pagination {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cms-bulk {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 60px;
  margin-top: 12px;
}
.cms dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px;
  max-width: min(660px, calc(100% - 32px));
  width: 100%;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
}
.cms dialog::backdrop {
  background: rgb(34 39 32 / 0.55);
}
.cms-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 20px;
}
.cms-dialog-head .button {
  padding: 8px 12px;
}
.cms #notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 14px 20px;
  border-radius: 10px;
  z-index: 100;
  max-width: calc(100% - 32px);
}
.cms .button {
  min-height: 44px;
}
.cms code {
  font: 14px var(--font-data);
  overflow-wrap: anywhere;
}
.cms-help {
  border-left: 4px solid var(--yellow);
  padding: 8px 18px;
  margin: 24px 0;
}
.cms-link {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cms .skip-link {
  left: 20px;
}
.cms-empty {
  padding: 32px;
  text-align: center;
}
.cms input[readonly] {
  background: var(--page);
}
@media (max-width: 700px) {
  .cms-top {
    padding: 16px;
    align-items: start;
  }
  .cms-top strong {
    font-size: 18px;
  }
  .cms-top nav {
    gap: 8px;
    font-size: 13px;
  }
  .cms-shell {
    padding: 24px 16px 48px;
  }
  .cms h1 {
    font-size: 28px;
  }
  .cms-cols {
    grid-template-columns: 1fr;
  }
  .cms-panel {
    padding: 20px;
  }
  .cms-tabs {
    gap: 6px;
  }
  .cms-tabs a {
    padding: 10px 12px;
    font-size: 14px;
  }
  .cms-table-wrap {
    border-radius: 8px;
  }
  .cms dialog {
    padding: 20px;
  }
  .cms-search .search-box {
    min-width: 100%;
  }
  .cms-search select {
    width: 100%;
  }
  .cms-actions .button {
    flex: 1;
    white-space: nowrap;
  }
  .cms-actions {
    align-items: stretch;
  }
  .cms-bulk {
    font-size: 14px;
  }
  .cms-top nav .button {
    padding: 8px 10px;
    font-size: 12px;
  }
}
/* Keep the clear control stable while the search field grows. */
.cms-search .search-box button {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 60px;
}

.cms-resource-list {
  margin: 20px 0;
}
.cms-resource-list summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
}
.cms-resource-list summary:hover {
  color: var(--focus);
}
.cms-resource-list summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.cms-resource-list td {
  overflow-wrap: anywhere;
}
