.cms-wrap { max-width: 1080px; margin: 48px auto 96px; padding: 0 24px; }
.cms-wrap [hidden] { display: none !important; }
.cms-panel { min-width: 0; background: #fff; border: 1px solid var(--ink-10); padding: 28px; margin: 18px 0; }
.cms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cms-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; margin: 0 0 18px; }
.cms-field--wide { grid-column: 1 / -1; }
.cms-field label, .cms-label { font-size: 13px; font-weight: 700; }
.cms-field input, .cms-field textarea, .cms-field select { min-width: 0; max-width: 100%; width: 100%; font: inherit; padding: 12px; border: 1px solid #cdd1d1; border-radius: 3px; background: white; color: var(--ink); }
.cms-field textarea { min-height: 240px; resize: vertical; line-height: 1.8; }
.cms-field input:focus, .cms-field textarea:focus, .cms-field select:focus { outline: 2px solid var(--yellow-dim); outline-offset: 1px; }
.cms-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.cms-status { min-height: 1.5em; margin: 12px 0; color: var(--ink-60); font-size: 14px; overflow-wrap: anywhere; }
.cms-status[data-error="true"] { color: #a11; }
.cms-login { max-width: 460px; margin: 64px auto; }
.cms-list { width: 100%; border-collapse: collapse; }
.cms-list th, .cms-list td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--ink-10); vertical-align: top; overflow-wrap: anywhere; }
.cms-list th { font-size: 12px; color: var(--ink-40); }
.cms-list-actions { min-width: 180px; }
.cms-list-actions .btn { margin: 0 6px 6px 0; padding: 10px 14px; }
.cms-list-state { white-space: nowrap; }
.cms-post-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 2; font-size: 16px; }
.cms-post-image { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; margin: 28px 0; }
.cms-empty { padding: 24px; background: #f3f5f5; color: var(--ink-60); }
.cms-hint { font-size: 12px; color: var(--ink-40); line-height: 1.8; overflow-wrap: anywhere; }
.cms-admin-page .cms-wrap { margin-top: 132px; }
.cms-admin-page .cms-panel h2 { margin-bottom: 20px; font-size: 22px; }
.cms-admin-page .btn { max-width: 100%; min-height: 44px; white-space: normal; text-align: center; }
.cms-admin-page button:disabled { cursor: not-allowed; opacity: .55; }
.cms-admin-page .cms-panel, .cms-admin-page #post-form { scroll-margin-top: 100px; }
.cms-admin-page #post-summary { min-height: 100px; }
.cms-image-field { min-width: 0; margin: 12px 0 28px; padding: 20px; border: 1px solid #d9dddd; background: #fafbfb; }
.cms-image-field legend { padding: 0 8px; font-size: 16px; font-weight: 700; }
.cms-image-field input[type="file"] { font-size: 14px; background: #fff; overflow: hidden; }
.cms-image-field input[type="file"]::file-selector-button { margin: 0 10px 0 0; padding: 9px 12px; border: 1px solid #b8bebe; border-radius: 3px; background: #fff; color: #222; font: inherit; cursor: pointer; }
.cms-image-field > .cms-hint { margin: 12px 0; }
.cms-file-name { max-width: 100%; font-size: 13px; overflow-wrap: anywhere; }
.cms-image-field progress { display: block; width: 100%; height: 12px; margin: 14px 0; accent-color: #776006; }
.cms-image-preview { margin: 18px 0 10px; padding: 8px; border: 1px solid #d9dddd; background: #fff; }
.cms-image-preview img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.cms-image-preview figcaption { margin-top: 8px; color: var(--ink-40); font-size: 12px; text-align: center; }
.cms-image-url { margin: 20px 0; }
.cms-image-url summary { padding: 12px 0; color: #333; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cms-image-url .cms-field { margin: 8px 0 0; }
.news-cms-item { animation: cms-in .35s ease both; }
@keyframes cms-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .cms-wrap { padding: 0 16px; margin: 30px auto 64px; }
  .cms-admin-page .cms-wrap { margin-top: 110px; }
  .cms-admin-page .section__title { font-size: 30px; }
  .cms-panel { padding: 18px; }
  .cms-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cms-field input, .cms-field textarea, .cms-field select { font-size: 16px; }
  .cms-actions > * { width: 100%; }
  .cms-actions .btn { justify-content: center; }
  .cms-image-field { padding: 12px; }
  .cms-image-field input[type="file"] { padding: 8px; font-size: 13px; }
  .cms-image-field input[type="file"]::file-selector-button { margin-right: 6px; padding: 9px 7px; }
  .cms-list, .cms-list tbody { display: block; }
  .cms-list thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cms-list tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--ink-10); }
  .cms-list td { display: block; min-width: 0; padding: 0; border: 0; font-size: 14px; }
  .cms-list td::before { display: block; margin-bottom: 4px; color: var(--ink-40); font-size: 11px; content: attr(data-label); }
  .cms-list td:first-child, .cms-list .cms-list-actions { grid-column: 1 / -1; }
  .cms-list-actions .btn { padding: 10px 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .news-cms-item { animation: none; } }
