.cms-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 25px;
}
.cms-tabs a {
  font-size: 13px;
  padding: 10px 15px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}
.cms-tabs a.selected {
  background: var(--soft);
  border-color: #c8a1ae;
  color: var(--burgundy);
  font-weight: 600;
}
.cms-guide {
  padding: 20px 23px;
  background: #edf1f6;
  border: 1px solid #dce4ed;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 14px;
}
.cms-guide p {
  font-size: 13px;
  margin: 9px 0 0;
  line-height: 1.8;
}
.cms-group {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 17px;
  padding: 0 24px 20px;
}
.cms-group > summary {
  padding: 20px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
}
.cms-group:not([open]) {
  padding-bottom: 0;
}
.cms-image-editor {
  display: flex;
  align-items: center;
  gap: 25px;
  background: var(--paper);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 20px 0;
}
.cms-image-editor img {
  width: 140px;
  height: 115px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
}
.cms-image-editor > div {
  flex: 1;
  min-width: 0;
}
.cms-image-editor .field {
  margin: 0 0 8px;
}
.cms-image-editor input {
  font-size: 12px;
}
.cms-image-editor small {
  font-size: 11px;
}
.upload-feedback {
  font-size: 12px;
  margin: 7px 0 0;
}
.cms-repeat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin: 18px 0;
}
.cms-repeat h3 {
  font-size: 14px;
}
.cms-repeat .text-button {
  font-size: 12px !important;
}
.cms-save {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 18px 0;
  position: sticky;
  bottom: 0;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: blur(10px);
  z-index: 3;
}
.cms-subheading {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 25px;
}
.cms-colors {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}
.cms-colors .field {
  font-size: 12px;
}
.cms-colors input {
  width: 100%;
  height: 50px;
}
.cms-history,
.copy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.cms-history small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}
.copy-row > div {
  min-width: 0;
  flex: 1;
}
.copy-row p {
  margin: 6px 0;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.copy-row small {
  font-size: 10px;
}
.copy-new-value {
  font-size: 13px;
  color: var(--burgundy);
  padding: 7px 10px;
  background: var(--soft);
  border-radius: 5px;
  overflow-wrap: anywhere;
}
#copy-search {
  max-width: 600px;
}
#cms-editor {
  max-width: 1100px;
}
.home-page .button:hover {
  transform: translateY(-1px);
}
@media (max-width: 700px) {
  .cms-tabs {
    gap: 6px;
  }
  .cms-tabs a {
    font-size: 11px;
    padding: 8px 10px;
  }
  .cms-group {
    padding: 0 18px 18px;
  }
  .cms-group > summary {
    font-size: 14px;
  }
  .cms-image-editor {
    flex-direction: column;
    align-items: stretch;
    padding: 15px;
    gap: 15px;
  }
  .cms-image-editor img {
    width: 100%;
    height: 140px;
  }
  .cms-colors {
    grid-template-columns: repeat(2, 1fr);
  }
  .cms-save {
    bottom: 54px;
    flex-wrap: wrap;
  }
  .cms-save .button {
    font-size: 12px;
  }
  .cms-history,
  .copy-row {
    gap: 12px;
  }
  .copy-row .button {
    font-size: 11px;
  }
  .cms-guide {
    padding: 17px;
  }
  .cms-repeat {
    padding: 15px;
  }
}
/* Text wrappers keep layout and actions intact; only edit mode adds affordances. */
sez-copy { display: contents; }
.cms-editing sez-copy:not([data-cms-skip] sez-copy),
.cms-editing option[data-cms-key] { cursor: text; }
.cms-editing sez-copy:not([data-cms-skip] sez-copy) { display: inline; outline: 1px dashed #8d506455; outline-offset: 3px; }
.cms-editing sez-copy:not([data-cms-skip] sez-copy):hover { background: #f5dce5; outline-color: #85354a; }
.cms-editing sez-copy:empty { display: inline-block; min-width: 1.4em; min-height: 1em; }
#cms-floating { position:fixed; z-index:80; bottom:18px; right:18px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; max-width:calc(100vw - 36px); padding:12px; border:1px solid #ccd5df; border-radius:12px; background:#fff; color:#172b43; box-shadow:0 5px 22px #0002; font-size:12px; }
#cms-floating button { cursor:pointer; border:0; border-radius:6px; padding:9px; background:#172b43; color:#fff; }
#cms-floating small { flex-basis:100%; }
#cms-floating small:empty { display:none; }
#cms-dialog { width:min(650px,calc(100vw - 32px)); max-height:85vh; overflow:auto; }
#cms-dialog textarea { white-space:pre-wrap; }
.cms-pick-list { display:grid; gap:10px; }
.cms-pick-list button { display:block; text-align:left; white-space:pre-wrap; }
.cms-pick-list span { display:block; margin-top:5px; font-weight:400; }
.copy-row p,.copy-new-value { white-space:pre-wrap; }
@media(max-width:700px){#cms-floating{bottom:64px;right:8px;max-width:calc(100vw - 16px)}}
