/* Eden Solutions · blog editor chrome: top bar, block palette, settings and the editing marks on the page.
   The article itself comes from blog/blog.css, unchanged. Colours are the brand-book tokens from styles.css. */

.app [hidden] { display: none !important; }
/* Block palette: collapsed by default (icons only); the top button opens it with the block names */
.app { --app-bar: 60px; --app-palette: 64px; background: var(--canvas); }
.app.palette-open { --app-palette: 232px; }

/* Buttons */
.app-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: 999px;
  background: var(--brand); color: var(--white); font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.app-btn:hover { background: var(--brand-hover); }
.app-btn--honey { background: var(--accent); color: var(--ink); }
.app-btn--honey:hover { background: var(--accent-hover); }
.app-btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.app-btn--ghost:hover { background: var(--veil-10); }
.app-btn[aria-pressed="true"] { background: var(--on-dark); color: var(--ink); }
.app-link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
.app-muted { color: var(--slate); font-size: 15px; }
.app :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.app-bar {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--app-bar); display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--ink); color: var(--on-dark); font-size: 15px;
}
.app-brand { display: flex; align-items: center; gap: 10px; color: var(--on-dark); text-decoration: none; font-weight: 700; font-size: 17px; }
.app-brand small { display: block; font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-muted); }
.app-list .app-bar { justify-content: space-between; }
.app-back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--dark-line); background: none; color: var(--on-dark); font-size: 20px; cursor: pointer; }
.app-back:hover { background: var(--veil-10); }
.app-bar__title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-langs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--dark-line); border-radius: 999px; }
.app-langs button { min-width: 44px; height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--on-dark-muted); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; cursor: pointer; }
.app-langs button[aria-selected="true"] { background: var(--on-dark); color: var(--ink); }
.app-langs button.is-missing { font-weight: 500; color: var(--on-dark-dim); }
.app-langs button:hover:not([aria-selected="true"]) { color: var(--on-dark); }
.app-saved { color: var(--on-dark-label); font-size: 13px; white-space: nowrap; }
.app-bar__actions { display: flex; gap: 8px; }

/* Article list */
.app-list__body { max-width: 960px; margin: 0 auto; padding: calc(var(--app-bar) + 40px) 16px 64px; display: grid; gap: 12px; }
.app-list__body h1 { font-size: 36px; line-height: 1.1; }
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.app-card { position: relative; background: var(--white); border: 1px solid var(--divider); border-radius: 16px; }
.app-card__open { display: grid; gap: 10px; width: 100%; padding: 20px 20px 48px; border: 0; background: none; text-align: left; color: var(--ink); cursor: pointer; border-radius: 16px; }
.app-card__open:hover { background: var(--surface-alt); }
.app-card__cat { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.app-card__title { font-size: 20px; font-weight: 700; line-height: 1.25; }
.app-card__meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; color: var(--slate); }
.app-card__more { position: absolute; left: 20px; bottom: 16px; }
.app-chip { padding: 2px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--ink); font-weight: 600; }
.app-chip--ready { background: var(--accent); }
.app-chip--review { background: var(--on-dark); }
.app-chip--live { background: #1E6B3A; color: var(--white); }
.app-list__extra { display: flex; flex-wrap: wrap; gap: 8px; }
.app-list__extra .app-btn--ghost { color: var(--ink); }
.app-list__extra:not(:has(button:not([hidden]))) { display: none; }
.app-user { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--dark-line); border-radius: 999px; background: none; color: var(--on-dark); font-size: 13px; white-space: nowrap; cursor: pointer; }
.app-user:hover { background: var(--veil-10); }

/* Editor: palette on the left, page in the middle */
.app-palette {
  position: fixed; top: var(--app-bar); bottom: 0; left: 0; z-index: 30; width: var(--app-palette); overflow-y: auto;
  padding: 18px 14px 24px; background: var(--white); border-right: 1px solid var(--divider);
}
.app-palette__title { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate); }
.app-palette__hint { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--slate); }
.app-palette__list { display: grid; gap: 4px; margin-top: 14px; }
.app-block {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--ink); font-size: 14px; font-weight: 500; text-align: left; cursor: grab;
}
.app-block:hover { background: var(--canvas); border-color: var(--divider); }
.app-block svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-palette__toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 36px; margin-bottom: 10px;
  border: 1px solid var(--divider); border-radius: 10px; background: var(--white); color: var(--slate); font-size: 13px; font-weight: 600; cursor: pointer;
}
.app-palette__toggle:hover { color: var(--ink); border-color: var(--slate); }
.app-palette__toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.palette-open .app-palette__toggle svg { transform: rotate(180deg); }
.app:not(.palette-open) .app-palette { padding-inline: 10px; }
.app:not(.palette-open) .app-palette__title, .app:not(.palette-open) .app-palette__hint, .app:not(.palette-open) .app-block span, .app:not(.palette-open) .app-palette__toggle span { display: none; }
.app:not(.palette-open) .app-block { justify-content: center; padding: 10px 0; }
/* In preview the palette goes away: only the page shows */
.is-preview .app-palette { display: none; }
.is-preview .app-canvas { padding-left: 0; }

.app-canvas { padding: var(--app-bar) 0 0 var(--app-palette); min-height: 100vh; }
/* Room on the left of the article for the block handles */
.post.is-editing .wrap { padding-left: 64px; }
.app-devices { display: flex; justify-content: center; gap: 4px; padding: 12px; background: var(--surface-alt); }
.app-devices button { padding: 6px 14px; border: 1px solid var(--divider); border-radius: 999px; background: var(--white); color: var(--ink); font-size: 14px; cursor: pointer; }
.app-devices button[aria-pressed="true"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.app-frame { display: block; width: 100%; height: calc(100vh - var(--app-bar) - 58px); border: 0; background: var(--white); }
.app-frame.is-phone { width: 390px; margin: 16px auto; height: calc(100vh - var(--app-bar) - 90px); border: 1px solid var(--divider); border-radius: 24px; box-shadow: 0 24px 48px -24px var(--ink-35); }

/* Page in edit mode */
.post.is-editing .ed-blocks { gap: 18px; }
/* Every block sits in a wrapper here: the column keeps its width, wide content (tables) scrolls inside its own box */
.post.is-editing .ed-blocks { grid-template-columns: minmax(0, 1fr); }
.post.is-editing .ed-block { min-width: 0; }
.post.is-editing .ed-section:not(:first-child) { margin-top: 38px; }
/* Progress panel in the editor: only the table of contents is live (it is edited in place) */
.post.is-editing .side .comb, .post.is-editing .side .reset { pointer-events: none; }
.post.is-editing .side .reset { opacity: 0.5; }
.ed-toc-hint { font-size: 13px; line-height: 1.4; color: var(--b-muted); }
.post .toc .ed-toc-item { display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 0; border-radius: 8px; font-size: var(--b-step--1); }
.post .toc .ed-toc-item:hover, .post .toc .ed-toc-item:focus-within { background: var(--b-surface-2); }
.ed-toc__go { flex: none; min-width: 28px; height: 28px; padding: 0 4px; border: 0; border-radius: 6px; background: none; color: var(--b-muted); font: inherit; font-weight: 600; cursor: pointer; }
.ed-toc__go:hover { color: var(--b-fg); text-decoration: underline; }
.post.is-editing .toc .ed-toc__label { flex: 1; min-width: 0; padding: 4px 2px; }
/* Without a label of its own the entry shows the section title: same colour, so it does not look switched off */
.post.is-editing .toc .ed-toc__label:empty::before { color: var(--b-fg); opacity: 1; }
.ed-toc__off { flex: 1; min-width: 0; padding: 4px 2px; color: var(--b-muted); text-decoration: line-through; text-decoration-color: var(--b-line); }
.ed-toc__toggle { flex: none; padding: 4px 8px; border: 1px solid var(--b-line); border-radius: 999px; background: var(--b-surface); color: var(--b-muted); font-size: 12px; font-weight: 600; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.ed-toc-item:hover .ed-toc__toggle, .ed-toc-item:focus-within .ed-toc__toggle, .ed-toc-item.is-off .ed-toc__toggle { opacity: 1; }
.ed-toc-item.is-off .ed-toc__toggle { color: var(--b-blue); border-color: var(--b-blue); }
/* A link that leads nowhere */
.post.is-editing a.ed-broken { color: #9B1C1C; text-decoration: underline wavy #9B1C1C; text-underline-offset: 4px; }
.ed-block { position: relative; border-radius: 10px; outline: 1px dashed transparent; outline-offset: 8px; transition: outline-color 0.15s; }
.ed-block:hover, .ed-block:focus-within { outline-color: var(--divider); }
.ed-tools {
  position: absolute; z-index: 5; top: -14px; right: 0; display: flex; gap: 2px; align-items: center; padding: 2px; border-radius: 8px;
  background: var(--white); border: 1px solid var(--divider); box-shadow: 0 6px 16px -10px var(--ink-35); opacity: 0; transition: opacity 0.15s;
  font-size: 12px; line-height: 1;
}
.ed-block:hover > .ed-tools, .ed-block:focus-within > .ed-tools { opacity: 1; }
.ed-tools button { padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.ed-tools button:hover { background: var(--surface-alt); }
.ed-tools .ed-danger { color: #9B1C1C; }
.ed-tools__name { padding: 0 6px; color: var(--slate); }
.ed-tools__select { padding: 5px 6px; border: 1px solid var(--divider); border-radius: 6px; background: var(--white); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
/* A section's own icon text is typed into the hexagon: its placeholder in light ink on the navy cell */
.post.is-editing .step-hex b[data-f]:empty::before { color: var(--b-hero-fg); opacity: 0.5; font-weight: 700; }
.ed-grip, .ed-item-grip { cursor: grab; letter-spacing: -2px; }
/* The block handle also sits on the left, as in Notion, so blocks can be dragged without finding the toolbar */
.ed-block > .ed-tools .ed-grip { position: absolute; left: -44px; top: 14px; width: 28px; height: 28px; padding: 0; border-radius: 6px; background: var(--white); border: 1px solid var(--divider); color: var(--slate); font-size: 14px; }
.ed-ghost { opacity: 0.35; outline: 2px dashed var(--accent) !important; }
.app-block.sortable-ghost, .ed-blocks > .app-block { display: block; height: 4px; padding: 0; overflow: hidden; border-radius: 2px; background: var(--accent); }

/* Editable fields */
.post.is-editing [data-f] { border-radius: 4px; cursor: text; min-width: 2ch; }
.post.is-editing [data-f]:hover { box-shadow: 0 0 0 1px var(--divider); }
.post.is-editing [data-f]:focus { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.post.is-editing [data-f]:empty::before { content: attr(data-ph); color: var(--b-muted); opacity: 0.65; font-weight: 400; pointer-events: none; }
.post.is-editing .b-hero [data-f]:empty::before { color: var(--h-muted); }
.post.is-editing .b-cta [data-f]:empty::before { color: var(--b-hero-muted); }
.post.is-editing .b-hero [data-f]:hover:not(:focus) { box-shadow: none; outline: 1px solid rgba(191, 212, 238, 0.35); }
.post.is-editing .item-title, .post.is-editing .item-body { display: block; }
.post.is-editing .checklist .ck { cursor: default; }
.post.is-editing .checklist input { cursor: default; }
.ed-label { font-size: 13px; color: var(--b-muted); }
.ed-label span { font-weight: 600; }
.ed-link { display: block; justify-self: start; margin-top: -6px; padding: 2px 8px; border-radius: 6px; background: var(--veil-10); color: var(--b-hero-muted); font-size: 13px; }
.ed-link::before { content: "↗ "; }
.ed-variants .ed-variant { display: grid; gap: 10px; }
.ed-variants .ed-variant + .ed-variant { margin-top: 8px; }

/* List items: handle and delete, on the right */
.ed-item-host { position: relative; }
.ed-item-tools {
  position: absolute; top: 6px; right: 6px; z-index: 4; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s;
  user-select: none;
}
.ed-item-host:hover > .ed-item-tools, .ed-item-host:focus-within > .ed-item-tools { opacity: 1; }
.ed-item-tools button { width: 26px; height: 26px; border: 1px solid var(--divider); border-radius: 6px; background: var(--white); color: var(--slate); font-size: 14px; line-height: 1; cursor: pointer; }
.ed-item-tools button:hover { color: var(--ink); border-color: var(--slate); }
.b-hero .ed-item-tools button { background: var(--ink); color: var(--on-dark-muted); border-color: var(--dark-line); }
.ed-add {
  justify-self: start; padding: 6px 14px; border: 1px dashed var(--b-line); border-radius: 999px; background: none;
  color: var(--b-blue); font-size: 14px; font-weight: 600; cursor: pointer;
}
.ed-add:hover { border-color: var(--b-blue); background: var(--b-surface); }
.b-hero .ed-add, .b-cta .ed-add { color: var(--b-hero-muted); border-color: rgba(191, 212, 238, 0.35); }
.ed-drop { display: grid; place-items: center; min-height: 160px; padding: 24px; border: 2px dashed var(--b-line); border-radius: var(--b-radius); color: var(--b-muted); text-align: center; }
.ed-drop button { background: none; border: 0; padding: 0; color: var(--b-blue); text-decoration: underline; cursor: pointer; font: inherit; }

/* Formatting toolbar */
.app-fmt { position: fixed; z-index: 60; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--ink); box-shadow: 0 12px 24px -12px var(--ink-35); }
.app-fmt button { min-width: 34px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--on-dark); font-size: 14px; cursor: pointer; }
.app-fmt button:hover { background: var(--veil-14); }
.app-fmt .app-fmt__url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-dark-muted); text-decoration: underline; text-underline-offset: 3px; }
.app-fmt .app-fmt__url.is-broken { color: #F6B8B2; }
/* Link window */
.app-linkdlg { max-width: 520px; }
.app-linkdlg h2 { margin-bottom: 0; }
.app-linkdlg__err { padding: 10px 12px; border-radius: 10px; background: #FDECEA; color: #9B1C1C; font-size: 14px; }
.app-linkdlg__actions { flex-wrap: wrap; align-items: center; }
.app-linkdlg__actions .app-link { margin-right: auto; }
.app-linkdlg__actions .app-link + .app-link { margin-right: auto; margin-left: 0; }
/* Phones: "+ Bloc" opens the palette as a sheet (see the media query at the end) */
.app-fab, .app-shade { display: none; }

/* Settings: a large window over the page; the article behind updates at once */
.app-settings {
  width: min(1040px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 20px;
  color: var(--ink); background: var(--white); box-shadow: 0 32px 80px -32px var(--ink-35);
}
.app-settings::backdrop { background: rgba(10, 35, 66, 0.45); }
.app-settings__head {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 28px; background: var(--white); border-bottom: 1px solid var(--divider);
}
.app-settings__head h2 { font-size: 22px; }
.app-settings__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin: 0; padding: 24px 28px 32px; align-items: start; }
.app-settings__col { display: grid; gap: 18px; }
.app-settings__col h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.app-form input:disabled { opacity: 0.5; }
/* Hero palettes, shown as small sample heroes */
.app-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.app-swatches legend { grid-column: 1 / -1; }
.app-swatch { position: relative; display: grid; gap: 6px; font-weight: 500; font-size: 14px; cursor: pointer; }
.app-swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.app-swatch__box {
  display: grid; gap: 6px; padding: 14px; border-radius: 12px; border: 2px solid var(--divider);
  background: var(--sw-bg); color: var(--sw-fg); min-height: 88px; align-content: start;
}
.app-swatch__box b { font-size: 15px; line-height: 1.2; }
.app-swatch__box i { display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--sw-rule); }
.app-swatch .app-swatch__box small { font-size: 12px; color: var(--sw-muted); font-weight: 400; }
/* The four hero palettes (same values as the .post[data-palette] rules in blog/blog.css) */
.app-swatch--navy { --sw-bg: #0A2342; --sw-fg: #F2F6FB; --sw-rule: #D9A441; --sw-muted: #C9D9EE; }
.app-swatch--blue { --sw-bg: #1F4E8C; --sw-fg: #FFFFFF; --sw-rule: #F2CD7E; --sw-muted: #DCE7F6; }
.app-swatch--mist { --sw-bg: #E3ECF8; --sw-fg: #0A2342; --sw-rule: #D9A441; --sw-muted: #44546A; }
.app-swatch--honey { --sw-bg: #FBF1DA; --sw-fg: #0A2342; --sw-rule: #D9A441; --sw-muted: #4F4A3E; }
/* Preview frame body */
.app-preview-body { margin: 0; }
.app-swatch input:checked + .app-swatch__box { border-color: var(--accent); outline: 2px solid var(--accent); }
.app-swatch input:focus-visible + .app-swatch__box { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (max-width: 760px) { .app-settings__grid { grid-template-columns: minmax(0, 1fr); } }
.app-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--canvas); font-size: 22px; cursor: pointer; }
.app-form { display: grid; gap: 18px; margin-top: 18px; font-size: 15px; }
.app-form label, .app-form fieldset { display: grid; gap: 6px; font-weight: 600; }
.app-form fieldset { border: 0; padding: 0; margin: 0; }
.app-form legend { padding: 0; margin-bottom: 6px; }
.app-form small { font-weight: 400; font-size: 13px; color: var(--slate); line-height: 1.4; }
.app-form input:not([type="radio"]):not([type="checkbox"]), .app-form select, .app-form textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--divider); border-radius: 10px; background: var(--canvas); color: var(--ink); font-weight: 400;
}
.app-form textarea { resize: vertical; }
.app-form .app-radio { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.app-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.app-url { display: flex; align-items: center; gap: 2px; font-weight: 400; font-size: 14px; color: var(--slate); }
.app-url input { flex: 1; min-width: 0; }
.app-form__danger { display: grid; gap: 10px; justify-items: start; padding-top: 16px; border-top: 1px solid var(--divider); }
.app-form__danger .app-link { color: #9B1C1C; }

/* Dialogs and messages */
.app-dialog { max-width: 480px; width: calc(100% - 32px); padding: 24px; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 24px 64px -24px var(--ink-35); }
.app-dialog::backdrop { background: rgba(10, 35, 66, 0.4); }
.app-dialog h2 { font-size: 22px; margin-bottom: 10px; }
.app-dialog__body { display: grid; gap: 10px; font-size: 16px; }
.app-dialog__body ul { list-style: disc; padding-left: 1.2em; display: grid; gap: 4px; }
.app-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.app-dialog .app-btn--ghost { color: var(--ink); }
.app-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translateX(-50%); display: flex; gap: 16px; align-items: center;
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--on-dark); font-size: 15px; box-shadow: 0 16px 32px -16px var(--ink-35);
}
.app-toast button { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 15px; }

@media (max-width: 1100px) {
  .app-saved { display: none; }
}

/* AI assistant: settings, article from text, progress */
.app-dialog.app-busy { max-width: 440px; }
.app-busy__bar { height: 6px; margin: 6px 0 12px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.app-busy__bar i { display: block; width: 35%; height: 100%; border-radius: 999px; background: var(--accent); animation: app-busy 1.4s var(--ease-io) infinite; }
@keyframes app-busy { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .app-busy__bar i { animation: none; width: 100%; opacity: 0.5; } }
.app-dialog .app-form { margin-top: 0; }
.app-dialog:has(.app-import), .app-dialog:has(.app-ai) { max-width: 640px; }
.app-ai__status { font-size: 14px; line-height: 1.45; }
.app-ai__status.is-ok { color: #1E6B3A; }
.app-ai__status.is-bad { color: #9B1C1C; }
.app-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-alt); justify-self: start; }
.app-tabs button { padding: 7px 14px; border: 0; border-radius: 999px; background: none; color: var(--slate); font-size: 14px; font-weight: 600; cursor: pointer; }
.app-tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px -4px var(--ink-35); }
.app-steps { list-style: decimal; padding-left: 1.3em; display: grid; gap: 6px; font-weight: 400; }
.app-form__danger .app-link--plain { color: var(--brand); }
.app-list .app-bar__actions { display: flex; gap: 8px; }

/* Calculator in the editor: amounts, terms and texts are typed straight onto the chips */
.post.is-editing .calc-form .ed-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border: 1px solid var(--b-line); border-radius: 999px; background: var(--b-bg); font-size: 0.95rem; }
.post.is-editing .calc-form .ed-chip > span { display: inline-flex; gap: 6px; align-items: baseline; padding: 0; border: 0; background: none; }
.post.is-editing .ed-chip.is-std { border-color: var(--b-blue); box-shadow: inset 0 0 0 1px var(--b-blue); }
.post.is-editing .ed-num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.post.is-editing .ed-chip em { font-style: normal; color: var(--b-muted); font-size: var(--b-step--1); }
.post.is-editing .ed-chip .ed-alt { color: var(--b-blue); }
.ed-std { padding: 2px 8px; border: 1px solid var(--b-line); border-radius: 999px; background: var(--b-surface); color: var(--b-muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.ed-std[aria-pressed="true"] { background: var(--b-blue); border-color: var(--b-blue); color: var(--b-bg); }
.ed-short { display: block; margin-top: 2px; font-weight: 400; }
.ed-exempt { align-items: flex-start; }
.ed-select { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: var(--b-step--1); color: var(--b-muted); }
.ed-select select { padding: 4px 8px; border: 1px solid var(--b-line); border-radius: 8px; background: var(--b-surface); color: var(--b-fg); font: inherit; }
.post.is-editing .calc-form > .b-field { position: relative; }

/* Members, revisions and the notice pages (signed out, not a member) */
.app-dialog:has(.app-members) { max-width: 760px; }
.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-table th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); padding: 6px 8px; border-bottom: 1px solid var(--divider); }
.app-table td { padding: 8px; border-bottom: 1px solid var(--divider); vertical-align: middle; overflow-wrap: anywhere; }
.app-table select { padding: 4px 8px; border: 1px solid var(--divider); border-radius: 8px; font: inherit; }
.app-form__row--3 { grid-template-columns: 2fr 1.5fr 1fr; }
.app-member-add { justify-items: start; padding-top: 12px; border-top: 1px solid var(--divider); }
.app-member-add .app-form__row { width: 100%; }
.app-link--danger { color: #9B1C1C; }
.app-settings__col--wide { grid-column: 1 / -1; }
.app-revisions { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; font-size: 14px; }
.app-revisions li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.app-revisions li:nth-child(odd) { background: var(--surface-alt); }
.app-revisions .app-link { font-size: 14px; }
/* Signing in and the notices (admin and CRM): one white card on the brand's navy */
body.app.app-notice { min-height: 100dvh; margin: 0; padding: 24px 16px; box-sizing: border-box; display: grid; place-items: center; background: var(--ink); }
.app-notice main, main.app-notice {
  width: min(480px, 100%); box-sizing: border-box; margin: 0; padding: clamp(24px, 5vw, 40px); display: grid; gap: 16px;
  background: var(--white); color: var(--ink); border-radius: 20px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}
.app-notice__brand { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-weight: 800; font-size: 17px; }
.app-notice h1 { font-size: clamp(24px, 6vw, 30px); line-height: 1.15; text-wrap: balance; }
.app-notice p { margin: 0; line-height: 1.5; }
.app-notice .app-form { margin-top: 0; gap: 14px; }
.app-notice a.app-btn { text-decoration: none; }
.app-notice .app-btn { min-height: 52px; justify-content: center; font-size: 16px; }
.app-btn--wide { width: 100%; box-sizing: border-box; }
.app-notice .app-btn--ghost { color: var(--ink); }
.app-notice__out { margin-top: 4px; }
/* The 6-digit code: six boxes over one real input (editor/signin.js sends the form at the sixth digit) */
.app-code { position: relative; }
.app-code__boxes { display: none; }
.is-live .app-code__boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; cursor: text; }
.app-code__boxes > span {
  height: 60px; display: grid; place-items: center; box-sizing: border-box; border: 2px solid var(--divider); border-radius: 12px;
  background: var(--canvas); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; transition: border-color 0.15s, box-shadow 0.15s;
}
.app-code__boxes > span.is-filled { border-color: var(--ink); background: var(--white); }
.app-code__boxes > span.is-current { border-color: var(--accent); border-width: 3px; }
.is-live .app-code__input { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; opacity: 0; font-size: 16px; }
.is-live .app-btn--wide[type="submit"] { display: none; }
.is-sending .app-code__boxes { opacity: 0.6; }
.app-code__status { min-height: 1.5em; color: var(--slate); font-size: 14px; font-weight: 600; }
.app-code__status:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .app-code__boxes > span { transition: none; } }
/* Signing in: the QR code and key of the authenticator app, the recovery codes */
.app-qr { width: 220px; max-width: 100%; padding: 8px; background: var(--white); border: 1px solid var(--divider); border-radius: 12px; }
.app-qr svg { display: block; width: 100%; height: auto; }
.app-secret { font-size: 15px; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.app-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; list-style: none; }
.app-codes code { display: block; padding: 8px 12px; border: 1px solid var(--divider); border-radius: 8px; background: var(--white); font-size: 16px; letter-spacing: 0.06em; text-align: center; }
@media (max-width: 760px) { .app-form__row--3 { grid-template-columns: minmax(0, 1fr); } .app-user { display: none; } }
.app-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; object-fit: cover; background: var(--white); border: 2px solid var(--accent); }
.app-avatar--sm { width: 24px; height: 24px; border-width: 1px; }
.app-avatar--lg { width: 96px; height: 96px; border-width: 3px; }
.app-avatar--empty { display: inline-grid; place-items: center; background: var(--ink); color: var(--on-dark); font-size: 12px; font-weight: 700; }
.app-avatar--lg.app-avatar--empty { font-size: 28px; }
.app-profile { display: grid; gap: 14px; }
.app-profile__photo { display: flex; align-items: center; gap: 18px; font-weight: 400; }
.app-profile__photo .app-link { font-size: 14px; }
.app-subhead { margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.app-table__actions { white-space: nowrap; text-align: right; }
.app-table small { color: var(--slate); }
.app-dialog__actions--start { justify-content: flex-start; margin-top: 4px; }
.app-requests li, .app-requests li:nth-child(odd) { background: var(--white); border: 1px solid var(--accent); margin-bottom: 6px; }
.app-requests__act { display: flex; align-items: center; gap: 10px; flex: none; }

/* The page address in Settings: what is on the site now; a pending change is marked until it is published */
.app-slug-note { display: block; margin-top: 4px; font-weight: 400; }
.app-slug-note.is-pending { padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: #FBF1DA; color: var(--ink); }
.app-count.is-pending { color: #A1361F; font-weight: 600; }

/* A site price in the text: a chip with the current amount; it reads back as [[pret:key]] */
.ed-price { display: inline-block; padding: 0 5px; border-radius: 6px; background: #FBF1DA; box-shadow: inset 0 -2px 0 var(--accent); color: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.ed-price.is-unknown { background: #FDE8E8; box-shadow: inset 0 -2px 0 #9B1C1C; }

/* Prices (admins): one row per amount, the changes listed before saving */
.app-dialog:has(.app-prices) { max-width: 640px; }
.app-prices .app-subhead { margin-top: 16px; }
.app-prices__note { margin-top: -6px; font-size: 13px; }
.app-prices__table td:first-child { width: 100%; }
.app-prices__table label { font-weight: 500; }
.app-prices__amount { white-space: nowrap; }
/* Above the editor's general input rule (.app-form input:not(…):not(…)) */
.app-form.app-prices .app-prices__amount input[data-price-key] { width: 10ch; padding: 6px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.app-form.app-prices .app-prices__amount input[aria-invalid="true"] { border-color: #9B1C1C; outline-color: #9B1C1C; }
.app-prices__def { min-width: 9.5em; white-space: nowrap; font-size: 13px; color: var(--slate); }
/* Save stays in sight while the list scrolls; it counts the changes */
.app-prices .app-dialog__actions, .app-contacts .app-dialog__actions { position: sticky; bottom: -24px; z-index: 1; margin-inline: -24px; margin-bottom: -24px; padding: 12px 24px 24px; border-top: 1px solid var(--divider); background: var(--white); }
@media (max-width: 760px) {
  .app-prices__def { min-width: 0; white-space: normal; }
  .app-prices .app-dialog__actions, .app-contacts .app-dialog__actions { bottom: -20px; margin-inline: -16px; margin-bottom: -20px; padding: 12px 16px 20px; }
}
/* Contacts (admins): the phone number and three app links, each with its example and a link to try it */
.app-dialog:has(.app-contacts) { max-width: 640px; }
.app-contacts__fields { display: grid; gap: 16px; }
.app-contacts__field { display: grid; gap: 4px; }
.app-contacts__field small { font-size: 13px; font-weight: 400; }
.app-contacts__input { display: flex; align-items: center; gap: 12px; }
.app-contacts__input input { flex: 1; min-width: 0; }
.app-form.app-contacts input[aria-invalid="true"], .app-form.app-contacts select[aria-invalid="true"] { border-color: #9B1C1C; outline-color: #9B1C1C; }
.app-contacts__schedule { min-width: 0; margin: 0; padding: 0; border: 0; gap: 6px; }
.app-contacts__pair { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; font-weight: 400; }
.app-contacts__pair > span:first-child { color: var(--slate); font-size: 14px; }
.app-contacts__input .app-link { flex: none; font-size: 14px; }
.app-contacts__def { color: var(--slate); }
.app-contacts__def:empty { display: none; }
.app-contacts__derive { justify-self: start; margin-top: 2px; font-size: 14px; text-align: left; }
.app-prices__diff:not(:empty) { padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--white); font-size: 14px; }
.app-prices__diff ul { display: grid; gap: 4px; margin-top: 6px; }
.app-prices__diff s { color: var(--slate); }
.app-requests__act .app-btn { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.app-requests__act select { padding: 4px 8px; border: 1px solid var(--divider); border-radius: 8px; font: inherit; font-size: 14px; }

/* Phones and narrow windows: the bar wraps into two rows, the palette becomes a sheet behind "+ Bloc",
   the page uses the whole width, handles and buttons are big enough for a finger and visible without hovering */
@media (max-width: 760px) {
  .app { --app-palette: 0px; }
  .app-editor { --app-bar: 108px; }
  .app-editor .app-bar { height: auto; min-height: var(--app-bar); flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .app-editor .app-bar__actions { order: 5; width: 100%; }
  .app-editor .app-bar__actions .app-btn { flex: 1; justify-content: center; padding-inline: 10px; }
  .app-list .app-bar { position: static; height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .app-list .app-bar__actions { flex-wrap: wrap; }
  .app-list__body { padding-top: 28px; }
  .app-list__body h1 { font-size: 28px; }

  .app-palette {
    top: auto; right: 0; width: auto; max-height: 72vh; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-right: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -16px 40px -20px var(--ink-35);
    transform: translateY(105%); transition: transform 0.25s var(--ease-io, ease); z-index: 55;
  }
  .sheet-open .app-palette { transform: none; }
  .app .app-palette__toggle { display: none; }
  .app:not(.palette-open) .app-palette__title, .app:not(.palette-open) .app-palette__hint, .app:not(.palette-open) .app-block span { display: revert; }
  .app .app-palette__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app .app-block { justify-content: flex-start; padding: 12px 10px; border-color: var(--divider); }
  .app-fab {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45;
    align-items: center; min-height: 52px; padding: 0 20px; border: 0; border-radius: 999px;
    background: var(--brand); color: var(--white); font-size: 16px; font-weight: 700; box-shadow: 0 0 0 2px var(--white), 0 12px 24px -12px var(--ink-35); cursor: pointer;
  }
  /* out of the way while previewing and while the formatting bar is up */
  .is-preview .app-fab, body:has(#fmt:not([hidden])) .app-fab { display: none; }
  .sheet-open .app-shade { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(10, 35, 66, 0.4); }

  .post.is-editing .wrap { padding-left: 16px; }
  .ed-block > .ed-tools .ed-grip { position: static; width: 32px; height: 32px; }
  .ed-tools { top: -22px; }
  .ed-tools button { padding: 8px 10px; font-size: 13px; }
  .ed-item-tools button { width: 32px; height: 32px; }
  /* The table of contents is edited above the article (on the page it is hidden on phones) */
  .post.is-editing .layout { display: grid; grid-template-columns: minmax(0, 1fr); }
  .post.is-editing .side { display: grid; order: -1; position: static; }
  .post.is-editing .side .comb, .post.is-editing .side .comb-label, .post.is-editing .side .count, .post.is-editing .side .reset { display: none; }

  .app-form__row { grid-template-columns: minmax(0, 1fr); }
  .app-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 20px 16px; }
  .app-dialog__actions { flex-wrap: wrap; }
  .app-frame.is-phone { width: 100%; margin: 0; border-radius: 0; border: 0; }
}
/* Touch screens: the block and item buttons do not wait for a hover that never comes */
@media (hover: none) {
  .ed-block:focus-within > .ed-tools, .ed-item-host:focus-within > .ed-item-tools { opacity: 1; }
  .ed-toc__toggle { opacity: 1; }
}
/* The site's phone rules (room for its menu bar, scroll snapping between sections) do not belong in the editor */
body.app { padding-top: 0; }
html:has(body.app) { scroll-snap-type: none; scroll-padding-top: calc(var(--app-bar) + 16px); }
/* With the six boxes the title already names the code: its label stays for screen readers only */
.is-live .app-code > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
