/* Editor-only chrome for edit/preview mode. Loaded by the public layout only
   when editor_mode? / preview_mode? is true, so public visitors never get it. */

/* Chrome heights shared by the editor bar, the toolbar strip and the body
   offsets. On narrow screens the bar wraps its language chips onto a second
   row — but only when the page renders chips at all (locale-scoped pages
   have none), hence the :has() guard. */
:root {
  --cms-bar-h: 3.3rem;
  --cms-strip-h: 3.4rem;
}

@media (max-width: 1200px) {
  :root:has(.cms-editor-bar [data-editor-bar-langs]) {
    --cms-bar-h: 5.85rem;
  }
}

/* !important: the bar offset must survive every site stylesheet — e.g.
   masterybits sets `body.public-site--masterybits { padding: 10px }` in a
   mobile media query, which out-specifies a bare class selector and would
   slide the site's header under the fixed bar. Editor chrome always wins
   over site styling. */
.public-site--editing {
  padding-top: var(--cms-bar-h) !important;
}

/* Edit mode with rich-text blocks: reserve a strip below the bar where the
   active block's formatting toolbar docks (see the .tiptap-toolbar rules),
   so the toolbar never covers content and stays put while scrolling.
   Preview mode renders no editables and keeps the plain bar offset. */
.public-site--editing:has(.editable--rich_text) {
  padding-top: calc(var(--cms-bar-h) + var(--cms-strip-h)) !important;
}

/* The strip's face — also visible while no rich-text block is active, so
   content scrolling under the reserved space never shows through. */
.public-site--editing:has(.editable--rich_text)::before {
  content: "";
  position: fixed;
  inset: var(--cms-bar-h) 0 auto 0;
  height: var(--cms-strip-h);
  z-index: 994;
  border-bottom: 1px solid #d8e1de;
  background: #fff;
}

/* Keep focus- and anchor-scrolling clear of the fixed chrome. */
html:has(.public-site--editing) {
  scroll-padding-top: calc(var(--cms-bar-h) + var(--cms-strip-h) + 0.75rem);
}

.cms-editor-bar {
  --editor-bg: #f8faf9;
  --editor-border: #d8e1de;
  --editor-text: #17211e;
  --editor-muted: #5f6f69;
  --editor-soft: #eef3f1;
  --editor-soft-hover: #e2ebe8;
  --editor-accent: #0d766d;
  --editor-navy: #163b50;
  --editor-navy-soft: #e9eff5;
  --editor-ok: #2f8b57;
  --editor-warn: #b57910;
  --editor-bad: #b84b43;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  border-bottom: 1px solid var(--editor-border);
  background: var(--editor-bg);
  color: var(--editor-text);
  font: 0.9rem/1 ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 1px 12px rgba(15, 35, 31, 0.08);
}

/* One row: page navigation left, language chips (with their action menu)
   in the middle, edit/preview right. */
.cms-editor-bar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.25rem;
  padding: 0 1rem;
}

.cms-editor-bar__group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.cms-editor-bar__title {
  font-weight: 700;
}

/* The title must SHRINK (ellipsize) when the row gets tight instead of
   painting over its neighbors: every link in the chain from the flex row
   down to the ellipsized span needs its automatic min-content size lifted. */
.cms-page-dropdown {
  --dropdown-menu-top: calc(100% + 0.45rem);
  --dropdown-menu-max-height: min(28rem, calc(100vh - 5rem));
  min-width: 0;
}

.cms-page-dropdown .dropdown-toggle {
  max-width: 100%;
}

/* Edit/preview + publish must never squeeze — the title and the scrollable
   chip row absorb the shortage. */
.cms-editor-bar__row > .cms-editor-bar__group:last-child {
  flex: none;
}

.cms-editor-bar__title-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: min(24rem, 34vw);
  padding: 0.28rem 0.45rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--editor-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.cms-editor-bar__title-button:hover,
.cms-editor-bar__title-button:focus-visible {
  background: var(--editor-soft);
  outline: none;
}

.cms-editor-bar__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progressive disclosure (classes set by editor_bar_controller, which
   measures what actually fits — CSS alone cannot detect overflow):
   a clipped title trades the "…" for a gradual fade-out, the "Back" label
   yields to the title, and the language group labels ("Source", "Public")
   plus the current chip's status word yield to the chips. */
.cms-editor-bar.is-title-clipped .cms-editor-bar__title-text {
  text-overflow: clip;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 1.25rem), transparent);
  mask-image: linear-gradient(to right, black calc(100% - 1.25rem), transparent);
}

.cms-editor-bar.is-nav-tight .cms-editor-bar__back .cms-editor-bar__label {
  display: none;
}

.cms-editor-bar.is-langs-tight .cms-editor-bar__group-label,
.cms-editor-bar.is-langs-tight .cms-lang__state {
  display: none;
}

.cms-page-dropdown .dropdown-menu {
  min-width: 18rem;
}

.cms-page-dropdown .dropdown-menu a.cms-page-dropdown__item {
  display: grid;
  gap: 0.18rem;
  min-width: 18rem;
}

.cms-page-dropdown .dropdown-menu a.cms-page-dropdown__item[hidden] {
  display: none;
}

.cms-page-dropdown__name {
  color: var(--editor-text);
  font-weight: 800;
}

.cms-page-dropdown__path {
  color: var(--editor-muted);
  font-size: 0.78rem;
}

.cms-editor-bar__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--editor-text);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  background: var(--editor-soft);
  font-weight: 700;
  white-space: nowrap;
}

.cms-editor-bar__back:hover {
  background: var(--editor-soft-hover);
}

.cms-editor-bar__back .icon {
  --icon-size: 1rem;
}

/* Autosave state next to the title: "Saving…" while an editable form is
   in flight, then "Saved" / "Not saved" (driven by save_indicator_controller). */
.cms-editor-bar__saved {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--editor-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.cms-editor-bar__saved.is-saving {
  opacity: 0.7;
}

.cms-editor-bar__saved::before {
  font-weight: 800;
}

.cms-editor-bar__saved.is-saved::before {
  content: "✓";
  color: var(--editor-ok);
}

.cms-editor-bar__saved.is-failed::before {
  content: "!";
  color: var(--editor-bad);
}

/* Edit | Preview segmented control: shows the current mode and how to
   switch it in one place. */
.cms-editor-bar__seg {
  display: inline-flex;
  gap: 0.18rem;
  padding: 0.18rem;
  border-radius: 8px;
  background: var(--editor-soft-hover);
}

.cms-editor-bar__seg-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.26rem 0.65rem;
  border-radius: 6px;
  color: var(--editor-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.cms-editor-bar__seg-item .icon {
  --icon-size: 1rem;
}

.cms-editor-bar__seg-item.is-on {
  background: #fff;
  color: var(--editor-text);
  box-shadow: 0 1px 3px rgba(15, 35, 31, 0.16);
}

.cms-editor-bar__seg-item:not(.is-on):hover {
  color: var(--editor-text);
}

.cms-editor-bar__publish {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 6px;
  background: var(--editor-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Swap wrapper around the publish control of locale-scoped pages
   (save_indicator replaces it after autosaves); contents so neither the
   wrapper nor the button_to form participates in the flex layout. */
.cms-editor-bar__slot,
.cms-editor-bar__slot form {
  display: contents;
}

/* Everything is published: the button stays as a calm, inert landmark. */
.cms-editor-bar__publish:disabled {
  background: var(--editor-soft-hover);
  color: var(--editor-muted);
  cursor: default;
}

/* Editable affordances: a subtle outline on hover so editors see what's editable. */
.public-site--editing .editable {
  outline: 1px dashed transparent;
  outline-offset: 3px;
  transition: outline-color 0.12s ease;
}

.public-site--editing .editable:hover,
.public-site--editing .editable:focus-within {
  outline-color: #0d766d;
}

.public-site--editing .editable .ProseMirror {
  caret-color: #0d766d;
  min-width: 1ch;
}

.public-site--editing .editable .ProseMirror:focus {
  outline: 2px solid #0d766d;
  outline-offset: 2px;
}

.public-site--editing .editable--plain_text .ProseMirror {
  padding-inline: 0.16em;
}

/* Faluninfo edit-mode nav: the row is tuned to the pixel (see header.css
   :lang(de) notes), so the caret padding above is enough to make flex
   shrink the items and wrap long labels onto two lines. Drop it — the nav
   is edited in place (flyouts open on :focus-within). Unlayered on
   purpose — the site's own stylesheet sits in a cascade layer and could
   never override the rule above. */
.public-site--editing .fi-site--editing .fi-nav .editable--plain_text .ProseMirror {
  padding-inline: 0;
}

/* Faluninfo edit-mode info sidebar: the editor chain (turbo-frame > form >
   ProseMirror div > p) is block-level, which pushes the story labels onto
   the line below their "01 |" list numbers — render the whole chain inline.
   The caret padding goes too (same reasoning as the fi-nav rule above: the
   ~210px column wraps single-line labels onto two lines otherwise). */
.public-site--editing .fii-sidebar turbo-frame,
.public-site--editing .fii-sidebar turbo-frame form,
.public-site--editing .fii-sidebar .editable--plain_text .ProseMirror,
.public-site--editing .fii-sidebar .editable--plain_text .ProseMirror p {
  display: inline;
}

.public-site--editing .fii-sidebar .editable--plain_text .ProseMirror {
  padding-inline: 0;
}

.public-site--editing .editable--plain_text .ProseMirror p {
  margin: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-shadow: inherit;
  text-transform: inherit;
}

.public-site--editing .editable--rich_text .ProseMirror {
  min-height: 2.5rem;
  padding: 0.25rem 0.4rem;
}

/* Faluninfo story/info pages float image cards into the following section's
   text. That section's rich-text editor is a contenteditable block whose
   border box extends underneath the float, and contenteditable blocks
   hit-test their whole box — so clicks on the card would focus the
   neighboring editor instead of the card's own. Positioning the float
   with a z-index lifts it above that editor in paint (and thus hit-test)
   order — position alone is not enough, since the ProseMirror element is
   itself positioned and comes later in the DOM. */
.public-site--editing .fii-imgcard {
  position: relative;
  z-index: 1;
}

.public-site--editing.public-site--galeb .galeb-article-body .editable--rich_text .ProseMirror {
  min-height: 0;
  padding: 0;
}

.public-site--editing.public-site--galeb .galeb-article-body .editable--rich_text [data-tiptap-image] {
  padding: 0;
  border-radius: 0;
}

.public-site--editing.public-site--galeb .galeb-article-body .editable--rich_text [data-tiptap-image] img {
  border-radius: 0;
  padding: 0;
}

/* Rich-text formatting toolbar: the active block's toolbar docks into the
   fixed strip below the editor bar (the ::before face above), so it stays
   visible while scrolling and never covers content. Blitz's :bar layout is a
   single flex row whose controller tucks icons that don't fit into the "…"
   menu — the same responsive pattern Trovaro uses — so one strip works from
   desktop down to phones. The generous inline padding centers the icons over
   a 76rem content column on wide screens; every icon still fits there, so
   the padding never eats into the overflow measurement. These rules are
   unlayered on purpose and override Blitz's layered bar layout. */
.public-site--editing .editable--rich_text .tiptap-toolbar {
  display: none;
  position: fixed;
  inset: var(--cms-bar-h) 0 auto 0;
  z-index: 995;
  width: auto;
  height: var(--cms-strip-h);
  align-items: center;
  padding: 0 max(0.75rem, calc((100vw - 76rem) / 2));
  font-size: 1rem;
  color: #1f2d29;
}

.public-site--editing .editable--rich_text.is-toolbar-active .tiptap-toolbar {
  display: flex;
}

/* Language chips with per-locale status dots. The current chip trades its
   dot for a plain-words status. Selection is the ONLY border/fill effect;
   the internal locale's role comes from its labelled group + navy tint
   (same color family as the adopt-content action it feeds), so the two
   signals never compete. */
.cms-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--editor-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

/* Caret on the current chip announcing its action menu. */
.cms-lang > .icon {
  --icon-size: 0.8rem;
  opacity: 0.8;
}

.cms-lang:hover {
  background: var(--editor-soft-hover);
}

.cms-lang.is-current {
  background: #fff;
  border-color: var(--editor-accent);
  color: var(--editor-accent);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(13, 118, 109, 0.18);
}

.cms-lang.is-current:hover {
  background: #fff;
}

.cms-lang--src {
  background: var(--editor-navy-soft);
  color: var(--editor-navy);
}

.cms-lang--src:hover {
  background: #dde8f0;
}

.cms-lang--src.is-current {
  background: #fff;
  border-color: var(--editor-accent);
  color: var(--editor-accent);
}

/* Read-only chips stay pale on purpose — the "your languages" group carries
   the full-contrast text, so responsibility is visible at a glance. */
.cms-lang--locked {
  color: var(--editor-muted);
  opacity: 0.6;
}

.cms-lang__state {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.9;
}

.cms-lang__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.cms-lang--published .cms-lang__dot { background: var(--editor-ok); }
.cms-lang--draft .cms-lang__dot { background: var(--editor-warn); }
.cms-lang--missing .cms-lang__dot { background: var(--editor-bad); }

.cms-editor-bar__language-list {
  flex: 1 1 auto;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 0.85rem;
}

.cms-editor-bar__group-label {
  color: var(--editor-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cms-editor-bar__divider {
  /* flex: none — a 1px flex item has a 0px min-content size and would be
     shrunk to invisibility once the chip row overflows. */
  flex: none;
  align-self: stretch;
  width: 1px;
  margin: 0.45rem 0.3rem;
  background: var(--editor-border);
}

/* "?" toggle explaining the status dots (and the source group, if any). */
.cms-editor-bar__legend-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--editor-soft-hover);
  color: var(--editor-muted);
  cursor: pointer;
}

.cms-editor-bar__legend-toggle:hover {
  background: #fff;
  color: var(--editor-text);
}

.cms-editor-bar__legend-toggle .icon {
  --icon-size: 0.95rem;
}

.cms-lang-legend .dropdown-menu {
  min-width: 17rem;
  padding-block: 0.35rem;
}

.cms-legend__title,
.cms-lang-menu__head {
  padding: 0.45rem 0.85rem 0.2rem;
  color: var(--editor-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cms-legend__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  color: var(--editor-text);
  font-size: 0.85rem;
  line-height: 1.35;
}

.cms-legend__dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.cms-legend__dot--published { background: var(--editor-ok); }
.cms-legend__dot--draft { background: var(--editor-warn); }
.cms-legend__dot--missing { background: var(--editor-bad); }

/* Action menu of the selected language chip: publish (when drafted), the
   per-locale page settings dialog, plus adopt-content — translate
   (recommended) and 1:1 copy — in one place, each with a one-line
   explanation of what it does. */
.cms-lang-menu {
  --dropdown-menu-top: calc(100% + 0.45rem);
  display: inline-flex;
}

.cms-lang-menu .dropdown-menu {
  min-width: 17rem;
}

.cms-lang-menu .dropdown-menu :is(button, a) {
  padding-block: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--editor-text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.cms-lang-menu__settings,
.cms-lang-menu .dropdown-menu button.cms-lang-menu__publish {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.cms-lang-menu__settings .icon,
.cms-lang-menu__publish .icon {
  --icon-size: 1rem;
  color: var(--editor-muted);
}

.cms-lang-menu__tag {
  margin-left: 0.5rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #e3f0ee;
  color: var(--editor-accent);
  font-size: 0.68rem;
  font-weight: 800;
}

.cms-lang-menu__note {
  margin: 0;
  padding: 0.2rem 0.85rem 0.5rem;
  max-width: 19rem;
  color: var(--editor-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
}

.cms-lang-menu__sep {
  margin: 0.25rem 0.6rem;
  border-top: 1px solid var(--editor-border);
}

.cms-editor-bar__switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--editor-accent);
  text-decoration: none;
  padding: 0.38rem 0.65rem;
  border-radius: 6px;
  font-weight: 800;
  white-space: nowrap;
}

.cms-editor-bar__switch .icon {
  --icon-size: 1rem;
}

.cms-editor-bar__switch:hover {
  background: var(--editor-soft);
}

/* Blitz dialog used by the editor bar for page / locale settings. The
   turbo-frame wrapping the dialog content is inline by default, so a
   width on the inner div doesn't propagate to <dialog> — size the
   dialog itself instead. */
dialog:has(.dialog-content--page-settings) {
  width: min(56rem, 92vw);
}

.cms-translation-dialog {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(23, 33, 30, 0.35);
  backdrop-filter: blur(2px);
}

.cms-translation-dialog__panel {
  width: min(32rem, 100%);
  padding: 1.25rem;
  border-radius: 8px;
  background: #fff;
  color: var(--editor-text);
  box-shadow: 0 24px 70px rgba(10, 20, 18, 0.28);
  font: 0.95rem/1.45 ui-sans-serif, system-ui, sans-serif;
}

.cms-translation-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.cms-translation-dialog__header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.cms-translation-dialog__close {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--editor-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.cms-translation-dialog__close:hover {
  background: var(--editor-soft);
  color: var(--editor-text);
}

.cms-translation-dialog__message {
  margin: 0 0 0.9rem;
  color: var(--editor-text);
}

.cms-translation-progress {
  height: 1.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--editor-soft);
}

.cms-translation-progress__bar {
  min-width: 2.5rem;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--editor-accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  transition: width 0.25s ease;
}

.cms-translation-dialog__meta {
  margin: 0.85rem 0 0;
  color: var(--editor-muted);
}

.cms-translation-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1rem;
}

.cms-translation-dialog__primary,
.cms-translation-dialog__secondary {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 0;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.cms-translation-dialog__primary {
  background: var(--editor-accent);
  color: #fff;
}

.cms-translation-dialog__secondary {
  background: var(--editor-soft);
  color: var(--editor-text);
}

/* Editor-only strip above a site header: toggles the layout's "menu
   editing" class so the mobile burger expands statically and its editable
   blocks (which have no desktop surface) become reachable. Sits outside
   .cms-editor-bar, hence literal palette values. */
.cms-nav-edit-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px dashed #9db4ae;
  border-inline: 0;
  background: #f8faf9;
  color: #0d766d;
  font: 700 0.85rem/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.cms-nav-edit-toggle:hover {
  background: #e2ebe8;
}

.cms-nav-edit-toggle .icon {
  --icon-size: 1rem;
}

/* The two labels swap with the surrounding "menu editing" state class,
   which site layouts set on their root element (e.g. .fi-site). */
.cms-nav-edit-toggle__close,
.cms-site-menu-editing .cms-nav-edit-toggle__open {
  display: none;
}

.cms-nav-edit-toggle__open,
.cms-site-menu-editing .cms-nav-edit-toggle__close {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------------------------------------------------------------------------
   Responsive editor bar. These media blocks OVERRIDE base rules of equal
   specificity, so they must stay at the end of the file — cascade order is
   what makes them win. */

/* Tablet and below (the bar gets tight well before phone widths — a long
   page title plus seven chips overflow around ~1100px): the language chips
   wrap onto their own second row (side-scrollable when many), keeping
   navigation left and edit/preview right on the first row. --cms-bar-h
   switches with this breakpoint (declared at the top of the file) so the
   body offset follows. */
@media (max-width: 1200px) {
  /* Grid instead of flex wrapping: navigation and edit/preview share the
     first row, the chips get the second. Column 1 is minmax(0, 1fr), so the
     title shrinks (and fades) naturally — no viewport-math caps needed. */
  .cms-editor-bar__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    height: auto;
    gap: 0 0.6rem;
    padding: 0 0.75rem;
  }

  .cms-editor-bar__row > .cms-editor-bar__group {
    height: 3.25rem;
    min-width: 0;
  }

  .cms-editor-bar__row > .cms-editor-bar__group:first-child {
    grid-area: 1 / 1;
  }

  .cms-editor-bar__row > .cms-editor-bar__group:last-child {
    grid-area: 1 / 2;
  }

  /* Must come after the __group height rule (same specificity): the chip
     row is 2.6rem, and --cms-bar-h = 3.25 + 2.6 = 5.85rem depends on it —
     if the group height won, the bar would overlap the toolbar strip. */
  .cms-editor-bar__row > .cms-editor-bar__language-list {
    grid-area: 2 / 1 / 3 / -1;
    height: 2.6rem;
    padding-bottom: 0.35rem;
  }

  .cms-editor-bar__title-button {
    max-width: none;
  }

  /* The title is the designated shrinker in the navigation group; the
     autosave label keeps its size. */
  .cms-editor-bar__saved {
    flex: none;
  }
}

/* Phones: icon-only edit/preview controls, tighter gaps and a smaller font
   in the chip row. The "Back" label, the chip group labels and the
   plain-words status are NOT hidden here — editor_bar_controller measures
   and hides them only when they would actually crowd out the title or the
   chips (see the is-nav-tight / is-langs-tight rules above). */
@media (max-width: 600px) {
  .cms-editor-bar__seg .cms-editor-bar__label {
    display: none;
  }

  .cms-editor-bar__language-list {
    gap: 0.1rem;
    font-size: 0.8rem;
  }

  .cms-lang {
    gap: 0.25rem;
    padding-inline: 0.4rem;
  }

  .cms-editor-bar__divider {
    margin-inline: 0.15rem;
  }
}

/* Sections switched off for the current language (per-locale boolean page
   settings). They keep rendering in edit mode so their content stays
   editable, but are dimmed and preceded by a note — public visitors and
   preview mode never see them at all. */
.cms-section-note {
  max-width: 71rem;
  margin: 0.75rem auto;
  padding: 0.6rem 0.9rem;
  border: 1px dashed rgb(0 0 0 / 0.3);
  border-radius: 0.4rem;
  background: rgb(0 0 0 / 0.04);
  color: inherit;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  text-align: center;
}

.cms-section--off {
  opacity: 0.55;
  filter: grayscale(0.6);
}
