:root {
  color-scheme: dark;
  --bg: #171717;
  --panel: #292826;
  --panel-soft: #33312e;
  --text: #f2ead9;
  --muted: #c9c3ba;
  --line: rgba(242, 234, 217, 0.17);
  --green: #e8d4a6;
  --green-deep: #403b30;
  --amber: #d8c18c;
  --red: #ffb4a7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* Keep closed dialogs hidden despite their grid layout. */
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0%, #302e29 0, var(--bg) 42%); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.backoffice-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 80px; }
body.is-profile-editor-open #profile-form { width: min(1180px, calc(100vw - 48px)); max-width: 1180px; margin-inline: calc(50% - min(50vw - 24px, 590px)); }
.backoffice-header { position: relative; min-height: 74px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; font-weight: 700; letter-spacing: -.08em; }
.brand-mobile { display: none; }
.header-account { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 0.82rem; }
.header-account a { color: var(--green); font-weight: 750; }
@media (min-width: 761px) {
  .backoffice-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .backoffice-header .brand { grid-column: 1; grid-row: 1; }
  .backoffice-header .header-account { display: none; }
  .backoffice-header .mobile-actions-toggle { grid-column: 2; grid-row: 1; justify-self: end; }
}
.backoffice-intro { max-width: 720px; padding: 64px 0 36px; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 0.73rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-family: Georgia, serif; font-size: clamp(2.3rem, 6vw, 5.2rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.045em; }
.backoffice-intro > p:last-child { max-width: 560px; margin-bottom: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.state-card { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); }
.state-card.is-error { border-color: rgba(255, 180, 167, 0.5); color: var(--red); }
.state-card a { display: inline-flex; margin-top: 18px; color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.access-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  margin-top: clamp(32px, 9vh, 96px);
  padding: clamp(26px, 4vw, 44px);
  border-color: rgba(232, 212, 166, 0.34);
  background: linear-gradient(135deg, rgba(51, 49, 46, 0.96), rgba(41, 40, 38, 0.98));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
}
.access-card.is-login { border-color: rgba(232, 212, 166, 0.58); }
.access-card.is-error { border-color: rgba(255, 180, 167, 0.52); }
.access-card-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(232, 212, 166, 0.36);
  border-radius: 15px;
  background: rgba(232, 212, 166, 0.1);
  color: var(--green);
}
.access-card.is-error .access-card-icon {
  border-color: rgba(255, 180, 167, 0.34);
  background: rgba(255, 180, 167, 0.1);
  color: var(--red);
}
.access-card-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.access-card-content { min-width: 0; }
.access-card-title { margin: 0; color: var(--text); font-family: Georgia, serif; font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.035em; }
.access-card-message { max-width: 650px; margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.access-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.access-card-action { margin: 0 !important; text-decoration: none !important; }
.access-card-action.secondary-button { background: rgba(244, 239, 231, 0.025); }
.access-card a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.access-card.is-loading .access-card-icon svg { animation: access-pulse 1.4s ease-in-out infinite; }
@keyframes access-pulse {
  0%, 100% { opacity: 0.48; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1); }
}
.editor-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.save-message { min-height: 1.3em; margin: 0; color: var(--muted); font-size: 0.85rem; }
.save-message.is-success { color: var(--green); }
.save-message.is-error { color: var(--red); }
.toolbar-actions { position: relative; display: flex; align-items: center; gap: 10px; }
.backoffice-shell .mobile-actions-toggle {
  display: inline-flex;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-color: rgba(232, 212, 166, 0.62);
  font-size: 1.15rem;
  line-height: 1;
}
.backoffice-shell .profile-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16, 20, 16, 0.98);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}
.backoffice-shell .profile-action-menu.is-open { display: flex; }
.backoffice-shell .profile-action-menu > * { width: 100%; min-width: 0; justify-content: flex-start; }
.backoffice-shell .mobile-actions-backdrop { display: none; }
.draft-actions { display: flex; align-items: center; gap: 10px; }
.primary-button, .secondary-button, .small-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 800; }
.primary-button { padding: 12px 18px; background: var(--green); color: #102116; }
.primary-button:disabled {
  border-color: rgba(168, 176, 166, 0.22);
  background: rgba(168, 176, 166, 0.16);
  color: rgba(244, 239, 231, 0.42);
  cursor: not-allowed;
  filter: none;
  opacity: 1;
}
.pending-modifications { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; font-size: .78rem; font-weight: 850; white-space: nowrap; pointer-events: none; }
.secondary-button { padding: 11px 15px; border-color: var(--line); color: var(--text); }
.publish-button { padding: 12px 18px; border: 1px solid var(--green); border-radius: 8px; background: var(--green-deep); color: var(--green); cursor: pointer; font: inherit; font-weight: 800; }
.publish-button:disabled { cursor: not-allowed; opacity: 0.45; }
.small-button { padding: 8px 11px; border-color: var(--line); background: transparent; color: var(--green); font-size: 0.78rem; }
.primary-button:not(:disabled):hover, .secondary-button:hover, .small-button:hover, .publish-button:not(:disabled):hover { filter: brightness(1.1); }
.visual-editor { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.visual-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 0; }
.visual-editor-heading-copy { min-width: 0; flex: 1 1 auto; }
.visual-editor-kicker-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.visual-editor-heading-tools { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; }
.published-version-picker { position: relative; flex: 0 0 auto; }
.published-version { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--green); cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 850; }
.published-version:hover, .published-version:focus-visible, .published-version[aria-expanded="true"] { border-color: var(--line); background: rgba(232, 212, 166, 0.08); outline: none; }
.published-version-menu { position: absolute; z-index: 8; top: calc(100% + 6px); right: 0; display: grid; min-width: 210px; max-height: 280px; overflow: auto; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: rgba(16, 20, 16, 0.98); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36); }
.published-version-menu[hidden] { display: none; }
.published-version-option { display: grid; gap: 2px; width: 100%; padding: 8px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; font-size: 0.76rem; }
.published-version-option:hover, .published-version-option:focus-visible, .published-version-option.is-current { background: rgba(232, 212, 166, 0.12); outline: none; }
.published-version-option-title { color: var(--green); font-weight: 850; }
.published-version-option-meta { color: var(--muted); font-size: 0.68rem; }
.published-version-empty { padding: 8px 9px; color: var(--muted); font-size: 0.72rem; }
.visual-editor-heading h2 { margin-bottom: 6px; }
.visual-editor-heading .helper-text { margin: 0; }
.editor-mode-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--green); border-radius: 999px; background: var(--green-deep); color: var(--green); cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 850; white-space: nowrap; }
.visual-editor-heading-tools .editor-mode-toggle { position: static; }
.editor-mode-toggle.is-real-preview { border-color: var(--amber); background: rgba(216, 177, 95, 0.12); color: var(--amber); }
.editor-mode-icon { font-size: 1rem; line-height: 1; }
.visual-editor-stage { position: relative; min-height: min(780px, 78vh); overflow: visible; border: 1px solid var(--line); border-radius: 12px; background: #090908; }
.visual-editor-stage iframe { display: block; width: 100%; height: min(780px, 78vh); min-height: 560px; border: 0; background: #090908; }
.selection-toolbar { position: absolute; z-index: 5; top: 0; left: 0; display: flex; align-items: center; padding: 5px; border: 1px solid rgba(232, 212, 166, 0.56); border-radius: 10px; background: rgba(16, 20, 16, 0.95); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35); pointer-events: auto; transition: top 120ms ease, left 120ms ease; }
.selection-toolbar-actions { display: flex; align-items: center; gap: 4px; }
.selection-toolbar-actions button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; }
.selection-toolbar-actions svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.selection-toolbar-actions button:hover, .selection-toolbar-actions button:focus-visible { border-color: var(--green); color: var(--green); outline: none; }
.link-block-type-toolbar { position: absolute; z-index: 5; top: 0; left: 0; display: flex; flex-wrap: wrap; gap: 4px; max-width: min(620px, calc(100% - 16px)); padding: 6px; border: 1px solid rgba(232, 212, 166, 0.56); border-radius: 10px; background: rgba(16, 20, 16, 0.97); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35); }
.link-block-type-toolbar button { display: grid; width: 34px; height: 34px; place-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; }
.link-block-type-toolbar button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.link-block-type-toolbar button:hover, .link-block-type-toolbar button:focus-visible { border-color: var(--green); color: var(--green); outline: none; }
.inline-color-picker { position: fixed; z-index: 9; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.editor-mode-status { position: absolute; right: 14px; bottom: 12px; z-index: 3; margin: 0; padding: 6px 9px; border-radius: 999px; background: rgba(16, 20, 16, 0.82); color: var(--muted); font-size: 0.7rem; pointer-events: none; }
.inline-link-editor { position: absolute; z-index: 6; top: 0; left: 0; display: grid; gap: 5px; width: min(300px, calc(100% - 16px)); padding: 8px 10px 9px; border: 1px solid rgba(232, 212, 166, 0.56); border-radius: 8px; background: rgba(16, 20, 16, 0.97); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34); pointer-events: auto; transition: top 120ms ease, left 120ms ease; }
.inline-link-editor label { color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.inline-link-editor input { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #101410; color: var(--text); font-size: 0.78rem; }
.visual-editor-panel { position: absolute; z-index: 7; top: 0; left: 0; width: min(620px, calc(100% - 16px)); max-height: min(620px, 78vh); margin: 0; overflow: auto; padding: 14px; border: 1px solid rgba(232, 212, 166, 0.56); border-radius: 12px; background: rgba(16, 20, 16, 0.98); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44); pointer-events: auto; }
.visual-editor-panel-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.visual-editor-panel-header h2 { margin: 2px 0 0; font-size: 1rem; }
.visual-editor-panel-header .eyebrow { margin-bottom: 4px; }
.visual-editor-panel > .helper-text { margin: 10px 0 14px; }
.visual-editor-panel.is-minimal-contact-editor { width: min(360px, calc(100% - 16px)); padding: 9px; }
.visual-editor-panel.is-minimal-external-link-editor { width: min(360px, calc(100% - 16px)); padding: 9px; }
.visual-editor-panel.is-minimal-contact-editor .visual-editor-panel-header > div,
.visual-editor-panel.is-minimal-contact-editor > .helper-text,
.visual-editor-panel.is-minimal-external-link-editor .visual-editor-panel-header > div,
.visual-editor-panel.is-minimal-external-link-editor > .helper-text { display: none; }
.visual-editor-panel.is-empty-social-slot-editor > .visual-editor-panel-actions { display: none; }
.visual-editor-panel .close-button { flex: 0 0 auto; width: 32px; height: 32px; font-size: 1.3rem; }
.visual-editor-panel-content { display: grid; gap: 12px; }
.visual-editor-panel-content > .helper-text { margin: 0; }
.visual-editor-panel-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.visual-editor-panel-actions .primary-button { min-height: 38px; padding: 8px 14px; font-size: .78rem; }
.inline-editor-fields { display: grid; gap: 10px; }
.inline-editor-fields label { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.inline-editor-fields input, .inline-editor-fields select, .inline-editor-fields textarea { box-sizing: border-box; min-height: 38px; padding: 8px 10px; }
.inline-editor-link-type-field,
.inline-editor-link-label-field,
.inline-editor-link-url-field { position: static; width: 100%; }
.visual-editor-panel.is-minimal-external-link-editor .inline-editor-link-type-field select { width: 100%; }
.inline-editor-fields textarea { min-height: 84px; }
.inline-editor-plain-field { display: block; width: 100%; }
.inline-editor-plain-field input { width: 100%; box-sizing: border-box; min-height: 42px; padding: 9px 11px; }
.inline-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-editor-actions .primary-button, .inline-editor-actions .secondary-button, .inline-editor-actions .small-button { min-height: 36px; padding: 8px 11px; font-size: .76rem; }
.inline-editor-check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: .8rem; font-weight: 750; cursor: pointer; }
.inline-editor-section { display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(232, 212, 166, 0.2); border-radius: 9px; background: rgba(51, 49, 46, 0.7); }
.inline-editor-section h3 { margin: 0; color: var(--text); font-size: .78rem; }
.inline-editor-section > .helper-text { margin: 0; }
.inline-media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.inline-media-choice { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #0c0e0c; cursor: pointer; }
.inline-media-choice input { position: absolute; z-index: 2; top: 5px; left: 5px; width: 15px; height: 15px; accent-color: var(--green); }
.inline-media-choice img, .inline-media-choice video { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity 160ms ease; }
.inline-media-choice input:checked ~ img, .inline-media-choice input:checked ~ video { opacity: 1; }
.inline-media-choice:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.inline-media-choice.is-associated { border-color: rgba(216, 177, 95, .68); }
.inline-media-choice small { position: absolute; right: 4px; bottom: 4px; left: 4px; overflow: hidden; padding: 3px 4px; border-radius: 4px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.inline-media-empty { margin: 0; color: var(--muted); font-size: .76rem; }
.inline-media-upload { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.inline-media-upload input[type="file"] { min-width: 0; max-width: 100%; color: var(--muted); font-size: .72rem; }
.inline-repeater-list { display: grid; gap: 8px; }
.inline-repeater-row { display: grid; grid-template-columns: minmax(100px, .34fr) minmax(100px, .38fr) minmax(0, 1fr) auto; align-items: end; gap: 7px; }
.inline-repeater-row label { display: grid; gap: 5px; color: var(--muted); font-size: .7rem; font-weight: 750; }
.inline-repeater-row input, .inline-repeater-row select { box-sizing: border-box; min-height: 36px; padding: 7px 8px; }
.inline-repeater-row .remove-button { width: 34px; height: 36px; }
.inline-status { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.inline-status.is-success { color: var(--green); }
.inline-status.is-error { color: var(--red); }
.inline-color-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.inline-color-fields label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .72rem; }
.inline-color-fields input[type="color"] { width: 34px; height: 30px; }
.visual-editor-panel .rs6939-submission { font-size: .75rem; }
.visual-editor-panel .rs6939-form-row { align-items: center; flex-wrap: wrap; }
.visual-editor-panel .rs6939-form-row .rs6939-file-name { flex-basis: calc(100% - 60px); }
.visual-editor-panel .rs6939-form-row button { width: 100%; }
.google-business-editor { display: grid; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid rgba(232, 212, 166, 0.38); border-radius: 12px; background: rgba(216, 193, 140, 0.07); }
.google-business-editor h2 { margin: 4px 0 0; }
.google-business-form { display: grid; gap: 8px; }
.google-business-form label { color: var(--muted); font-size: 0.82rem; font-weight: 750; }
.google-business-form-row { display: flex; gap: 10px; }
.google-business-form-row input { flex: 1; min-width: 0; }
.rs6939-editor { display: grid; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid rgba(216, 177, 95, 0.42); border-radius: 12px; background: rgba(216, 177, 95, 0.07); }
.rs6939-editor h2 { margin: 4px 0 0; }
.rs6939-upload-form { display: grid; gap: 8px; }
.rs6939-upload-form label { color: var(--muted); font-size: 0.82rem; font-weight: 750; }
.rs6939-form-row { display: flex; align-items: center; gap: 10px; }
.rs6939-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.rs6939-file-picker { display: inline-grid; flex: 0 0 48px; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 10px; color: var(--gold); cursor: pointer; }
.rs6939-file-picker:hover, .rs6939-file-input:focus-visible + .rs6939-file-picker { border-color: var(--gold); background: rgba(216, 177, 95, 0.1); }
.rs6939-file-picker svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.rs6939-file-name { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.rs6939-current, .rs6939-history { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rs6939-submission { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(16, 20, 16, 0.5); }
.rs6939-submission a { color: var(--green); overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; }
.rs6939-meta { color: var(--muted); font-size: 0.78rem; }
.rs6939-history-title { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; font-weight: 750; }
.rs6939-rejection { flex-basis: 100%; margin: 2px 0 0; color: var(--red); font-size: 0.8rem; }
.like-settings-editor { display: grid; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid rgba(232, 212, 166, 0.38); border-radius: 12px; background: rgba(216, 193, 140, 0.07); }
.like-settings-editor h2 { margin: 4px 0 0; }
.like-visibility-control { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 0.84rem; font-weight: 750; cursor: pointer; }
.communication-editor { display: grid; gap: 14px; margin: 0 0 18px; padding: 16px; border: 1px solid rgba(216, 177, 95, 0.42); border-radius: 12px; background: rgba(216, 177, 95, 0.07); }
.communication-editor h2 { margin: 4px 0 0; }
.communication-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.communication-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 0.82rem; font-weight: 750; }
.communication-fields input { width: 100%; }
.visual-editor-stage.is-real-preview .editor-mode-status { color: var(--amber); }
.cover-media-editor { display: grid; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid rgba(231, 139, 71, 0.48); border-radius: 12px; background: rgba(231, 139, 71, 0.07); }
.cover-media-editor h2 { margin: 4px 0 0; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.editor-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: rgba(41, 40, 38, 0.94); }
.editor-card-wide { grid-column: 1 / -1; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
h2 { margin-bottom: 0; font-size: 1.05rem; }
.account-lock { padding: 6px 9px; border: 1px solid rgba(232, 212, 166, 0.25); border-radius: 999px; color: var(--green); font-size: 0.7rem; font-weight: 750; white-space: nowrap; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
label > span, .repeater-row label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 0.76rem; font-weight: 750; }
.field-wide { grid-column: 1 / -1; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="color"], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #101410; color: var(--text); outline: none; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], select { min-height: 44px; padding: 10px 12px; }
textarea { min-height: 108px; padding: 10px 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(232, 212, 166, 0.12); }
.input-prefix { display: flex; align-items: center; min-height: 44px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #101410; }
.input-prefix > span { flex: 0 0 auto; margin: 0; padding-left: 12px; color: var(--muted); font-size: 0.78rem; }
.input-prefix input { min-width: 0; border: 0; border-radius: 0; background: transparent; }
.color-input { display: flex; align-items: center; gap: 10px; }
input[type="color"] { width: 44px; height: 44px; padding: 4px; cursor: pointer; }
output { color: var(--muted); font-size: 0.8rem; }
.field-indication { min-height: 44px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #101410; color: var(--muted); }
.helper-text { margin: 12px 0 0; color: var(--muted); font-size: 0.78rem; }
.repeater-list { display: grid; gap: 10px; }
.repeater-row { display: grid; grid-template-columns: minmax(120px, 0.32fr) minmax(130px, 0.42fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.repeater-row.contact-row { grid-template-columns: minmax(110px, 0.33fr) minmax(0, 1fr) auto; }
.remove-button { width: 38px; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.remove-button:hover { border-color: var(--red); color: var(--red); }
.visibility-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.visibility-grid label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); color: var(--text); font-size: 0.82rem; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--green); }
.media-sections { display: grid; gap: 20px; }
.media-section h3 { margin: 0 0 10px; font-size: 0.88rem; }
.media-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.media-choice { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #0c0e0c; cursor: pointer; }
.media-choice input { position: absolute; z-index: 2; top: 7px; left: 7px; width: 16px; height: 16px; }
.media-choice img, .media-choice video { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0.5; transition: opacity 160ms ease; }
.media-choice input:checked ~ img, .media-choice input:checked ~ video { opacity: 1; }
.media-choice:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.media-empty { margin: 0; color: var(--muted); font-size: 0.82rem; }
.preview-modal { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(5, 5, 5, 0.82); }
.preview-dialog { width: min(1180px, 100%); height: min(880px, 94vh); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45); }
.preview-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.preview-header h2 { margin: 0; }
.close-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.preview-dialog iframe { width: 100%; flex: 1; border: 0; background: var(--bg); }
.history-dialog { max-height: min(880px, 94vh); }
.history-content { overflow: auto; padding: 20px; }
.history-section + .history-section { margin-top: 26px; }
.history-section h3 { margin: 0 0 12px; font-size: 0.92rem; }
.history-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.history-item { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.history-item-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.history-item-title { margin: 0; font-weight: 800; }
.history-item-meta { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; }
.history-item-fields { margin: 10px 0 0; color: var(--text); font-size: 0.8rem; line-height: 1.45; }
.history-item details { margin-top: 10px; color: var(--green); font-size: 0.78rem; }
.history-item summary { cursor: pointer; }
.history-item pre { max-height: 240px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 8px; background: #101410; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.history-empty { margin: 0; color: var(--muted); }
body.is-preview-open { overflow: hidden; }
body.is-history-open { overflow: hidden; }

@media (max-width: 760px) {
  .backoffice-shell { width: min(100% - 28px, 600px); }
  .backoffice-header { align-items: start; padding: 18px 0; }
  .header-account { align-items: end; flex-direction: column; gap: 4px; text-align: right; }
  .backoffice-intro { padding: 45px 0 28px; }
  .access-card { grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
  .access-card-icon { width: 46px; height: 46px; border-radius: 13px; }
  .access-card-icon svg { width: 25px; height: 25px; }
  .access-card-actions { align-items: stretch; flex-direction: column; }
  .access-card-action { width: 100%; }
  .editor-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: stretch; }
  .toolbar-actions > * { flex: 1; }
  .google-business-form-row { align-items: stretch; flex-direction: column; }
  .rs6939-form-row { align-items: stretch; flex-direction: column; }
  .visual-editor { padding: 0; }
  .visual-editor-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }
  .visual-editor-heading-copy { grid-column: 1; min-width: 0; }
  .visual-editor-heading-copy .eyebrow { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .visual-editor-heading-tools { grid-column: 3; grid-row: 1; justify-self: end; }
  .visual-editor-heading-tools .editor-mode-toggle { width: auto; min-height: 38px; padding: 8px 12px; }
  .visual-editor-heading-tools .editor-mode-icon { display: none; }
  .published-version { grid-column: 2; grid-row: 1; justify-self: center; }
  .inline-link-fields { grid-template-columns: 1fr; }
  .visual-editor-stage { min-height: 72vh; }
  .visual-editor-stage iframe { height: 72vh; min-height: 520px; }
  .selection-toolbar-actions { gap: 3px; }
  .selection-toolbar-actions button { width: 34px; height: 34px; padding: 6px; }
  .link-block-type-toolbar { max-width: calc(100% - 16px); }
  .communication-fields { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-card-wide { grid-column: auto; }
  .media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cover-media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .toolbar-actions { flex-wrap: wrap; }
  .toolbar-actions > * { flex: 1 1 auto; }
}

@media (max-width: 480px) {
  .editor-card { padding: 18px; }
  .fields-grid, .repeater-row, .repeater-row.contact-row { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .repeater-row .remove-button { width: 100%; }
  .card-heading { flex-direction: column; }
  .account-lock { white-space: normal; }
}

@media (max-width: 600px) and (orientation: portrait) {
  :root { --mobile-backoffice-header-height: 48px; }
  body.is-mobile-actions-open { overflow: hidden; }
  body.is-profile-editor-open {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .backoffice-shell { padding-bottom: 220px; }
  body.is-profile-editor-open .backoffice-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }
  .backoffice-header {
    position: sticky;
    top: 0;
    z-index: 26;
    min-height: calc(var(--mobile-backoffice-header-height) + env(safe-area-inset-top));
    align-items: center;
    gap: 8px;
    margin: 0 -14px;
    padding: env(safe-area-inset-top) 14px 0;
    border-bottom-color: rgba(244, 239, 231, 0.1);
    background: rgba(23, 23, 23, 0.97);
  }
  body.is-profile-editor-open .backoffice-header {
    margin-inline: 0;
    flex: 0 0 calc(var(--mobile-backoffice-header-height) + env(safe-area-inset-top));
  }
  .backoffice-header .brand { min-width: 0; overflow: hidden; font-size: .88rem; text-overflow: ellipsis; }
  .brand-mobile { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .header-account { display: none; }
  .brand-desktop { display: none; }
  .brand-mobile { display: inline; }
  .backoffice-shell .mobile-actions-toggle {
    position: static;
    flex: 0 0 36px;
    display: inline-flex;
    width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0;
    border-radius: 9px;
    background: rgba(16, 20, 16, 0.96);
    box-shadow: none;
    font-size: 1.08rem;
  }
  .mobile-actions-toggle[aria-expanded="true"] { border-color: var(--green); color: var(--green); }
  .visual-editor-heading {
    position: sticky;
    top: calc(var(--mobile-backoffice-header-height) + env(safe-area-inset-top));
    z-index: 25;
    margin: 0;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    background: rgba(18, 22, 19, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  body.is-profile-editor-open #profile-form {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
    margin-inline: 0;
  }
  body.is-profile-editor-open .visual-editor-heading {
    position: relative;
    top: auto;
    z-index: 25;
    flex: 0 0 auto;
    order: 0;
  }
  body.is-profile-editor-open .visual-editor {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    order: 1;
  }
  body.is-profile-editor-open .visual-editor-stage {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }
  body.is-profile-editor-open .visual-editor-stage iframe {
    height: 100%;
    min-height: 0;
  }
  .visual-editor-heading .eyebrow { font-size: .65rem; letter-spacing: .08em; }
  .visual-editor-heading-tools .editor-mode-toggle { min-height: 32px; padding: 6px 9px; font-size: .76rem; }
  .published-version { min-height: 30px; padding: 4px 6px; font-size: .76rem; }
  .editor-toolbar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 15;
    flex: 0 0 auto;
    order: 2;
    align-items: stretch;
    margin: 0 -14px;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(16, 20, 16, 0.97);
    box-shadow: 0 -14px 32px rgba(0, 0, 0, 0.28);
  }
  .editor-toolbar > div:first-child .eyebrow { display: none; }
  .editor-toolbar > div:first-child,
  .editor-toolbar .save-message { min-height: 0; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .backoffice-shell .profile-action-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    align-content: start;
    gap: 10px;
    width: min(86vw, 320px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(max(18px, env(safe-area-inset-top)) + 58px) 18px max(18px, env(safe-area-inset-bottom));
    border-right: 1px solid rgba(232, 212, 166, 0.34);
    background: rgba(23, 23, 23, 0.98);
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.38);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-105%);
    transition: transform 220ms ease, opacity 180ms ease;
  }
  .profile-action-menu.is-open {
    display: grid;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
  .profile-action-menu > * { width: 100%; min-width: 0; justify-content: flex-start; }
  .backoffice-shell .mobile-actions-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(5, 7, 5, 0.58);
    cursor: pointer;
  }
  .draft-actions { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px; }
  .draft-actions > * { min-width: 0; }
  .draft-actions button { width: 100%; }
  .visual-editor-panel { width: calc(100% - 16px); max-height: min(56vh, 520px); }
  .inline-repeater-row { grid-template-columns: 1fr; }
  .inline-repeater-row .remove-button { width: 100%; }
  .inline-color-fields { grid-template-columns: 1fr; }
}
.asset-field { display: grid; gap: .6rem; }
.asset-thumb { width: 5rem; height: 5rem; object-fit: cover; border-radius: .75rem; border: 1px solid var(--line, #ddd); }
.asset-preview { max-width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: .75rem; background: #101410; }
.asset-preview img, .asset-preview video { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.cover-media-choices { display: grid; gap: 10px; }
.cover-media-heading { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 750; }
.cover-media-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.cover-media-choice { position: relative; aspect-ratio: 16 / 8; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #0c0e0c; cursor: pointer; }
.cover-media-choice input { position: absolute; z-index: 2; top: 7px; left: 7px; width: 16px; height: 16px; accent-color: var(--green); }
.cover-media-choice img, .cover-media-choice video { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .54; transition: opacity 160ms ease; }
.cover-media-choice input:checked ~ img, .cover-media-choice input:checked ~ video { opacity: 1; }
.cover-media-choice:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.cover-media-empty { margin: 0; color: var(--muted); font-size: .78rem; }
.cover-media-fallback-note { margin: 0; color: var(--amber); font-size: .78rem; line-height: 1.45; }
.artist-name-preview { padding: 18px; border-radius: 8px; font-size: 1.25rem; font-weight: 800; }

/* Carry the landing page's charcoal, cream, and warm gold palette into the editor. */
.header-account a, .save-message.is-success, .small-button, .published-version-option-title,
.rs6939-submission a, .history-item details { color: var(--amber); }
.backoffice-shell .profile-action-menu,
.published-version-menu { border-radius: 16px; background: rgba(23, 23, 23, .98); }
.state-card, .access-card, .editor-card, .cover-media-editor, .google-business-editor,
.rs6939-editor, .like-settings-editor, .communication-editor {
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}
.access-card {
  border-color: rgba(232, 212, 166, .34);
  background: linear-gradient(145deg, rgba(51, 49, 46, .96), rgba(41, 40, 38, .98));
}
.access-card.is-login { border-color: rgba(232, 212, 166, .58); }
.access-card-icon {
  border-color: rgba(232, 212, 166, .36);
  border-radius: 17px;
  background: rgba(232, 212, 166, .1);
}
.primary-button {
  border-color: #f8e9c8;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3e5c4, #ddc895);
  box-shadow: inset 0 1px rgba(255, 255, 255, .82), 0 6px 15px rgba(0, 0, 0, .2);
  color: #1d1b17;
}
.primary-button:not(:disabled):hover { filter: brightness(1.07); }
.secondary-button, .small-button, .publish-button {
  min-height: 42px;
  border-radius: 999px;
}
.secondary-button { background: linear-gradient(145deg, #2b2a28, #222220); }
.secondary-button:hover, .small-button:hover, .publish-button:not(:disabled):hover { border-color: var(--amber); }
.publish-button { border-color: var(--amber); background: rgba(216, 193, 140, .12); color: var(--amber); }
.editor-mode-toggle { border-color: var(--amber); border-radius: 999px; background: rgba(216, 193, 140, .12); color: var(--amber); }
.editor-mode-toggle.is-real-preview { border-color: var(--amber); background: rgba(216, 193, 140, .18); color: var(--amber); }
.visual-editor-stage, .preview-dialog { border-radius: 18px; }
.editor-card { background: linear-gradient(150deg, rgba(43, 42, 40, .98), rgba(34, 34, 32, .98)); }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], select, textarea,
.input-prefix, .field-indication {
  border-radius: 14px;
  background-color: #222220;
}
.backoffice-header .brand { transition: color 180ms ease; }
.backoffice-header .brand:hover { color: var(--amber); }
