/*
 * LetsJam — application styles.
 * Art direction from the logo: magenta #F0047F, black, white; geometric
 * shapes (circle, quarter-circles, square grid); Poppins typography.
 * #F0047F is used for shapes and large surfaces; text and buttons use the
 * deeper #D1006E, which keeps a contrast ratio above 5:1 on white.
 */
@import url('assets/fonts/fonts.css');

:root {
  color-scheme: light dark;
  --brand: #f0047f;
  --brand-strong: #d1006e;
  --brand-soft: #fde6f2;
  --brand-ink: #ffffff;
  --ink: #111014;
  --bg: #faf7f9;
  --panel: #ffffff;
  --text: #16131a;
  --muted: #5f5866;
  --border: #e9e2e7;
  --danger: #c4231b;
  --warning: #9a6200;
  --success: #12804a;
  --focus: #f0047f;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 19, 26, 0.04), 0 8px 24px rgba(22, 19, 26, 0.06);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.55;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-strong: #ff5aa8;
    --brand-soft: #3a1028;
    --brand-ink: #1a0610;
    --ink: #ffffff;
    --bg: #121014;
    --panel: #1c181f;
    --text: #f3eef2;
    --muted: #b3a8b0;
    --border: #322b33;
    --danger: #ff7b72;
    --warning: #e3b341;
    --success: #4ac26b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--brand-strong); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code, .mono { font-family: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace; font-size: 0.9em; font-variant-ligatures: none; }
h1, h2, h3 { font-family: var(--font); color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0; }
h2 { font-size: 1.08rem; font-weight: 600; margin: 0 0 0.85rem; }
h3 { font-size: 0.98rem; font-weight: 600; margin: 1.2rem 0 0.5rem; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; z-index: 100; padding: 0.5rem 1rem; background: var(--panel); border-radius: 999px; }
.skip-link:focus { left: 0.5rem; }

/* ---- Shell ------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 0.9rem; background: var(--panel); border-right: 1px solid var(--border); }
.brand { display: block; padding: 0.25rem 0.5rem 0.5rem; }
.brand__logo { display: block; width: 7.5rem; height: auto; }
.sidebar__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar__nav a { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.85rem; border-radius: 999px; color: var(--text); text-decoration: none; font-family: var(--font); font-weight: 500; font-size: 0.94rem; }
.sidebar__nav a:hover { background: var(--brand-soft); }
.sidebar__nav a[aria-current="page"] { background: var(--brand); color: #fff; }
.nav-icon { width: 1.25rem; text-align: center; font-size: 1rem; opacity: 0.85; }
.main-column { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: 0.7rem 2rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.project-title { font-family: var(--font); font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-status { margin-left: auto; font-size: 0.82rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; }
.save-status::before { content: ''; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--success); }
.save-status[data-status="pending"]::before { background: var(--warning); }
.save-status[data-status="error"], .save-status[data-status="unavailable"] { color: var(--danger); font-weight: 600; }
.save-status[data-status="error"]::before, .save-status[data-status="unavailable"]::before { background: var(--danger); }
.language-select { width: auto; border-radius: 999px; padding: 0.35rem 2rem 0.35rem 0.9rem; font-size: 0.88rem; }
.content { padding: 1.75rem 2rem 4rem; max-width: 78rem; width: 100%; }
.content:focus { outline: none; }
.notices { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 2rem; margin-top: 1rem; }
.notices:empty { display: none; }

/* ---- Page structure --------------------------------------------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin: 0.5rem 0 1.25rem; }
.page-header h1 { position: relative; padding-left: 1.5rem; }
.page-header h1::before { content: ''; position: absolute; left: 0; top: 0.32em; width: 0.9rem; height: 0.9rem; background: var(--brand); border-radius: 0 0 0 100%; }
.page-header .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.breadcrumb { margin: 0; font-size: 0.9rem; }
.breadcrumb a { text-decoration: none; font-weight: 500; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card--muted { opacity: 0.8; box-shadow: none; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.help { color: var(--muted); font-size: 0.86rem; margin: 0.3rem 0 0; }
.grid-2, .grid-3 { display: grid; gap: 0 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.grid--cards { gap: 1.1rem; align-items: start; }
.grid--cards .card { margin: 0; }

/* Geometric motif from the logo mark: a 2×2 grid of quarter shapes. */
.hero__motif, .empty__motif { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hero__motif span, .empty__motif span { background: var(--brand); aspect-ratio: 1; }
.hero__motif span:nth-child(1), .empty__motif span:nth-child(1) { border-radius: 100% 0 0 0; }
.hero__motif span:nth-child(2), .empty__motif span:nth-child(2) { background: var(--panel); border: 3px solid var(--brand); border-radius: 0; }
.hero__motif span:nth-child(3), .empty__motif span:nth-child(3) { border-radius: 0 0 0 100%; }
.hero__motif span:nth-child(4), .empty__motif span:nth-child(4) { border-radius: 0 0 100% 0; }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2rem; padding: 2rem 2.25rem; margin-bottom: 1.5rem; border-radius: 28px; background: var(--ink); color: var(--bg); }
.hero h1 { color: inherit; font-size: 2rem; line-height: 1.2; max-width: 30ch; }
.hero__kicker { margin: 0 0 0.4rem; font-family: var(--font); font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; }
.hero__lead { max-width: 60ch; opacity: 0.85; margin: 0.75rem 0 1.25rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hero .btn--secondary { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 40%, transparent); }
.hero__motif { width: 9rem; }
.hero__motif span:nth-child(2) { background: var(--ink); }

.empty { text-align: center; padding: 2.5rem 1rem; background: var(--panel); border: 1.5px dashed var(--border); border-radius: var(--radius); }
.empty__motif { width: 3.5rem; margin: 0 auto 1rem; gap: 3px; }
.empty__motif span:nth-child(2) { border-width: 2px; }

/* ---- Controls ---------------------------------------------------------- */
.btn { font: inherit; font-family: var(--font); font-weight: 500; font-size: 0.9rem; padding: 0.5rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--panel); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); font-weight: 600; }
.btn--primary:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn--ghost { border-color: transparent; }

.form .field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem; }
.field--check { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.field--check label { margin: 0; font-weight: 500; }
.field--check .help { flex-basis: 100%; }
.field--title input { font-family: var(--font); font-size: 1.3rem; font-weight: 600; }
input[type="text"], input[type="search"], input[type="number"], input[type="datetime-local"], select, textarea {
  font: inherit; width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); transition: border-color 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-strong); width: 1.05rem; height: 1.05rem; }
input[type="color"] { width: 4rem; height: 2.4rem; padding: 0.15rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); }
textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: 0.85rem; margin: 0.3rem 0 0; }
.field-error:empty { display: none; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.inline-form input { flex: 1 1 10rem; width: auto; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; }

/* ---- Tables, badges, stats ------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 0.85rem; }
.table th, .table td { text-align: left; padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-family: var(--font); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.table .num { text-align: right; white-space: nowrap; }
.table--edit td { padding: 0.4rem; }
.row-link { font-weight: 600; text-decoration: none; color: var(--ink); }
.row-link:hover { color: var(--brand-strong); }
.badge { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; font-family: var(--font); }
.badge--published { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.badge--draft { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 1.1rem 1.25rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform 0.15s, border-color 0.15s; }
.stat::after { content: ''; position: absolute; right: -1.6rem; top: -1.6rem; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--brand-soft); }
.stat:hover { border-color: var(--brand); transform: translateY(-2px); }
.stat__value { font-family: var(--font); font-size: 2rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.stat__label { font-family: var(--font); font-weight: 500; }
.stat__sub { color: var(--muted); font-size: 0.84rem; }
.steps { padding-left: 1.2rem; margin: 0; }
.steps li { margin-bottom: 0.45rem; }
.steps li::marker { color: var(--brand-strong); font-family: var(--font); font-weight: 600; }
.report { max-height: 20rem; overflow: auto; font-size: 0.875rem; }

/* ---- Content editor ---------------------------------------------------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.1rem; align-items: start; }
.editor-side .card { margin-bottom: 1.1rem; }
.terms { border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin: 0 0 0.85rem; padding: 0.6rem 0.85rem; }
.terms legend { font-weight: 600; font-size: 0.88rem; padding: 0 0.3rem; }
.checklist { display: flex; flex-direction: column; gap: 0.25rem; max-height: 10rem; overflow: auto; }

.editor { border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem 0.5rem 1rem; border-bottom: 1px solid var(--border); }
.editor-label { font-weight: 600; font-size: 0.88rem; }
.editor-tabs { display: flex; gap: 0.25rem; background: var(--bg); padding: 0.2rem; border-radius: 999px; }
.editor-tab { font: inherit; font-family: var(--font); font-size: 0.8rem; font-weight: 500; padding: 0.25rem 0.8rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.editor-tab[aria-selected="true"] { background: var(--ink); color: var(--panel); }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 60%, var(--panel)); position: sticky; top: 3.4rem; z-index: 2; }
.editor-toolbar[hidden] { display: none; }
.tool { font: inherit; min-width: 2.1rem; height: 2.1rem; padding: 0 0.45rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font-weight: 600; }
.tool:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-strong); }
.tool[aria-pressed="true"] { background: var(--brand); color: #fff; }
.tool:disabled { opacity: 0.35; cursor: not-allowed; }
.tool-select { width: auto; padding: 0.3rem 1.8rem 0.3rem 0.6rem; font-size: 0.85rem; border-radius: 8px; }
.tool-sep { width: 1px; height: 1.4rem; background: var(--border); margin: 0 0.3rem; }
.editor-source { border: 0; border-radius: 0; min-height: 26rem; padding: 1rem; line-height: 1.6; }
.editor-source:focus { box-shadow: none; }

/* The visual surface uses the site theme (variables set from the project). */
.wysiwyg { min-height: 26rem; padding: 1.25rem 1.5rem; background: var(--lj-bg); color: var(--lj-text); font-family: var(--lj-font-body); font-size: 1.0625rem; line-height: 1.65; outline: none; overflow-wrap: anywhere; }
.wysiwyg--compact { min-height: 6rem; padding: 0.85rem 1rem; font-size: 1rem; }
.editor--compact { margin-bottom: 1rem; }
.wysiwyg > :first-child { margin-top: 0; }
.wysiwyg h1, .wysiwyg h2, .wysiwyg h3, .wysiwyg h4 { font-family: var(--lj-font-heading); color: var(--lj-text); line-height: 1.25; margin: 1.4em 0 0.5em; letter-spacing: 0; }
.wysiwyg h2 { font-size: 1.5rem; }
.wysiwyg h3 { font-size: 1.25rem; }
.wysiwyg h4 { font-size: 1.1rem; }
.wysiwyg a { color: var(--lj-primary); }
.wysiwyg blockquote { margin: 1.25rem 0; padding: 0.25rem 1rem; border-left: 4px solid var(--lj-border); color: var(--lj-muted); }
.wysiwyg pre { overflow-x: auto; padding: 1rem; background: var(--lj-surface); border: 1px solid var(--lj-border); border-radius: 6px; font-family: var(--lj-font-mono); font-size: 0.9em; }
.wysiwyg code { font-family: var(--lj-font-mono); font-size: 0.9em; padding: 0.1em 0.3em; background: var(--lj-surface); border-radius: 4px; }
.wysiwyg pre code { padding: 0; background: none; }
.wysiwyg img { max-width: 100%; height: auto; border-radius: 6px; outline: 2px solid transparent; }
.wysiwyg img:hover { outline-color: var(--brand); }
.wysiwyg img[data-src] { display: inline-block; min-width: 8rem; min-height: 3rem; border: 1px dashed var(--lj-border); }
.wysiwyg hr { border: 0; border-top: 1px solid var(--lj-border); margin: 1.5rem 0; }
.wysiwyg table { border-collapse: collapse; }
.wysiwyg th, .wysiwyg td { border: 1px solid var(--lj-border); padding: 0.35rem 0.6rem; }

.dialog { border: 0; border-radius: var(--radius); padding: 1.5rem; width: min(34rem, calc(100vw - 2rem)); background: var(--panel); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); }
.dialog::backdrop { background: rgba(17, 16, 20, 0.45); backdrop-filter: blur(2px); }
.dialog h2 { margin-bottom: 1rem; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
.image-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.6rem; max-height: 18rem; overflow: auto; margin-bottom: 1rem; }
.image-picker__item { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.4rem; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.75rem; word-break: break-all; }
.image-picker__item img { width: 100%; height: 5rem; object-fit: contain; background: var(--bg); border-radius: 6px; }
.image-picker__item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.image-picker__item:has(input:focus-visible) { outline: 3px solid var(--focus); }

/* ---- Menus, media, preview, export ----------------------------------- */
.menu-tree { list-style: none; margin: 0.5rem 0; padding: 0; }
.menu-tree .menu-tree { padding-left: 1.6rem; border-left: 2px solid var(--brand-soft); margin-left: 0.6rem; }
.menu-row { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 1.5fr) auto; gap: 0.5rem; align-items: start; padding: 0.4rem 0; }
.menu-link { display: flex; flex-direction: column; gap: 0.35rem; }
.menu-tools { display: flex; gap: 0.15rem; }

.media-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.media-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; display: flex; flex-direction: column; gap: 0.45rem; box-shadow: var(--shadow); }
.media-card img, .media-card__file { width: 100%; height: 9rem; object-fit: contain; background: var(--bg); border-radius: var(--radius-sm); }
.media-card__file { display: flex; align-items: center; justify-content: center; font-family: var(--font); font-weight: 600; color: var(--brand-strong); }
.media-card__name { margin: 0; font-weight: 600; word-break: break-all; }
.media-card .actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.preview-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.preview-toolbar select { width: auto; max-width: 100%; }
.preview-stage { background: var(--ink); border-radius: var(--radius); padding: 0.85rem; margin-top: 0.85rem; }
.preview-frame { display: block; width: 100%; height: 75vh; margin: 0 auto; border: 0; border-radius: 10px; background: #fff; transition: max-width 0.2s; }
.preview-frame--tablet { max-width: 768px; }
.preview-frame--mobile { max-width: 375px; }

.findings { list-style: none; padding: 0; }
.finding { padding: 0.5rem 0.75rem; border-left: 4px solid var(--border); margin-bottom: 0.4rem; background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.finding--error { border-color: var(--danger); }
.finding--warning { border-color: var(--warning); }
.finding--info { border-color: var(--brand); }
.vol--warn td:last-child { color: var(--warning); font-weight: 600; }
.vol--over td:last-child { color: var(--danger); font-weight: 600; }
.ok { color: var(--success); font-weight: 500; }
.check-result > :first-child { margin-top: 1.25rem; }
.check-result .btn--primary { margin-top: 0.75rem; }

.notice { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.7rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); border-left-width: 5px; box-shadow: var(--shadow); }
.notice span { flex: 1; overflow-wrap: anywhere; white-space: pre-line; }
.notice--error { border-left-color: var(--danger); }
.notice--warning { border-left-color: var(--warning); }
.notice--success { border-left-color: var(--success); }
.notice--info { border-left-color: var(--brand); }
.notice__close { font: inherit; font-size: 1.25rem; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 64rem) {
  .editor-layout { grid-template-columns: 1fr; }
  .menu-row { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero__motif { display: none; }
}
@media (max-width: 48rem) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0.6rem; }
  .brand__logo { width: 3.5rem; }
  .sidebar__nav ul { flex-direction: row; flex-wrap: wrap; }
  .sidebar__nav a { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
  .nav-icon { display: none; }
  .topbar { position: static; padding: 0.6rem 1rem; flex-wrap: wrap; }
  .content { padding: 1rem 1rem 3rem; }
  .notices { padding: 0 1rem; }
  .hero { padding: 1.5rem; }
  .hero h1 { font-size: 1.5rem; }
  .editor-toolbar { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- Page builder ------------------------------------------------------ */
.content-editor { display: flex; flex-direction: column; min-height: calc(100vh - 7rem); }
.page-header--compact { margin: 0 0 0.75rem; }
.page-header--compact h1 { font-size: 1.3rem; }
.page-header--compact .breadcrumb { flex-basis: 100%; }
.builder { --library-width: 15rem; --inspector-width: 21rem; display: grid; grid-template-columns: var(--library-width) minmax(0, 1fr) var(--inspector-width); gap: 1rem; align-items: start; }
.builder.builder--library-closed { --library-width: 2.25rem; }
.builder.builder--inspector-closed { --inspector-width: 2.25rem; }
.builder__side { position: sticky; top: 4.5rem; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; max-height: calc(100vh - 5.5rem); }
.side-toggle { align-self: flex-start; min-width: 2.25rem; height: 2.25rem; font-size: 1rem; border: 1px solid var(--border); background: var(--panel); }
.builder__side--end .side-toggle { align-self: flex-end; }
.library, .inspector-panel { min-height: 0; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.focus-toggle.is-active { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.library__tabs { display: flex; gap: 0.25rem; padding: 0.5rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.library__tab { flex: 1; font: inherit; font-family: var(--font); font-size: 0.82rem; font-weight: 500; padding: 0.4rem 0.5rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.library__tab[aria-selected="true"] { background: var(--ink); color: var(--panel); }
.library__tab:disabled { opacity: 0.4; cursor: not-allowed; }
.library__panel { padding: 0.75rem; }
.library__panel > input[type="search"] { margin: 0.5rem 0; }
.library__group h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1rem 0 0.4rem; }
.library__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.library__item { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.6rem 0.3rem; font: inherit; font-size: 0.78rem; line-height: 1.2; text-align: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); cursor: grab; }
.library__item:hover, .library__item:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.library__icon { font-size: 1.15rem; font-weight: 700; color: var(--brand-strong); }
.library__patterns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.library__pattern { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.6rem 0.75rem; font: inherit; text-align: left; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); cursor: grab; }
.library__pattern:hover, .library__pattern:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.library__pattern .help { margin: 0; font-size: 0.78rem; }
.outline { list-style: none; margin: 0; padding: 0; }
.outline__item button { width: 100%; text-align: left; font: inherit; font-size: 0.85rem; padding: 0.3rem 0.5rem; border: 0; border-radius: 6px; background: none; color: var(--text); cursor: pointer; }
.outline__item button:hover { background: var(--brand-soft); }
.outline__item--section button { font-weight: 600; margin-top: 0.35rem; }
.builder__center { min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.builder__toolbar, .format-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.4rem 0.6rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.format-bar { position: sticky; top: 4rem; z-index: 5; gap: 0.2rem; background: var(--ink); }
.format-bar .tool { color: var(--panel); }
.format-bar[hidden] { display: none; }
.tool-group { display: flex; align-items: center; gap: 0.25rem; }
.tool[aria-pressed="true"] { background: var(--brand); color: #fff; }
.btn--small { padding: 0.3rem 0.8rem; font-size: 0.82rem; }
.quality-button { margin-left: auto; font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.3rem 0.8rem; border-radius: 999px; border: 1.5px solid var(--success); background: transparent; color: var(--success); cursor: pointer; }
.quality-button[data-state="warn"] { border-color: var(--warning); color: var(--warning); }
.canvas-stage { background: repeating-conic-gradient(var(--border) 0% 25%, transparent 0% 50%) 50% / 16px 16px; border-radius: var(--radius); padding: 0.75rem; }
.canvas-box { height: calc(100vh - 13rem); min-height: 28rem; margin: 0 auto; overflow: hidden; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.canvas-frame { display: block; border: 0; background: #fff; transform-origin: 0 0; }
.builder__hint { margin: 0; }
.inspector-panel__body { padding: 0.9rem; }
.inspector h2 { font-size: 1rem; margin: 0; }
.inspector h3 { font-size: 0.9rem; margin-top: 1.25rem; }
.inspector .field { margin-bottom: 0.8rem; }
.inspector__head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.inspector__icon { display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; }
.inspector__advanced { margin: 1rem 0; }
.inspector__advanced summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; }
.inspector__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.field__label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem; }
.media-field { display: flex; align-items: center; gap: 0.6rem; }
.media-field__thumb { width: 4.5rem; height: 3.2rem; object-fit: cover; border-radius: 6px; background: var(--bg); }
.media-field__empty, .media-field__file { font-size: 0.82rem; color: var(--muted); }
.layout-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.layout-picker__option { display: flex; gap: 3px; height: 2rem; padding: 4px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--panel); cursor: pointer; }
.layout-picker__option[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.layout-picker__col { display: block; background: var(--muted); opacity: 0.45; border-radius: 2px; }
.layout-picker__col.w1 { flex: 1; }
.layout-picker__col.w2 { flex: 2; }
.items-field { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.6rem; margin: 0 0 0.8rem; }
.items-field legend { font-weight: 600; font-size: 0.88rem; padding: 0 0.25rem; }
.items { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.5rem; }
.item { border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.item summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; cursor: pointer; font-size: 0.85rem; }
.item__title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__tools .tool { min-width: 1.7rem; height: 1.7rem; font-size: 0.8rem; }
.item__body { padding: 0.5rem 0.6rem 0.2rem; }
.seo-preview { margin-top: 0.75rem; }
.serp { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-family: Arial, sans-serif; }
.serp__url { color: #202124; font-size: 0.78rem; overflow-wrap: anywhere; }
.serp__title { color: #1a0dab; font-size: 1.05rem; }
.serp__desc { color: #4d5156; font-size: 0.85rem; }
.link-button { font: inherit; text-align: left; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.row--home td { background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }

/* ---- Dialogs, templates, media, theme ---------------------------------- */
.dialog--wide { width: min(52rem, calc(100vw - 2rem)); }
.dialog .spacer { flex: 1; }
.dialog__actions { flex-wrap: wrap; }
.template-grid, .pattern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.template-card { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.8rem; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.template-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.template-card:has(input:focus-visible) { outline: 3px solid var(--focus); }
.template-card .help { margin: 0; }
.image-picker__file { display: flex; align-items: center; justify-content: center; height: 5rem; font-weight: 700; color: var(--brand-strong); background: var(--bg); border-radius: 6px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 1.75rem 1rem; margin: 1rem 0 1.25rem; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--panel); text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone__icon { font-size: 1.8rem; color: var(--brand-strong); }
.media-card__video { width: 100%; height: 9rem; background: #000; border-radius: var(--radius-sm); }
.contrast { margin-top: 1rem; }
.contrast__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.contrast__item { display: grid; grid-template-columns: 3rem 1fr auto auto; align-items: center; gap: 0.75rem; padding: 0.35rem 0.5rem; border-radius: 8px; background: var(--bg); font-size: 0.88rem; }
.contrast__sample { display: inline-flex; justify-content: center; padding: 0.15rem 0; border-radius: 6px; font-weight: 700; border: 1px solid var(--border); }
.contrast__item--ko { color: var(--danger); }
.contrast__item--ok > span:last-child { color: var(--success); }
.social-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.social-row { display: grid; grid-template-columns: 11rem 1fr auto; gap: 0.5rem; }

@media (max-width: 80rem) {
  .builder { --library-width: 13rem; --inspector-width: 18rem; }
}
@media (max-width: 64rem) {
  .builder { grid-template-columns: 1fr; }
  .builder__side { position: static; max-height: none; }
  .library__grid { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
  .social-row { grid-template-columns: 1fr; }
}
.content:has(.content-editor) { max-width: none; }

/* Focus mode of the page builder: application menus hidden, more room for the canvas. */
.app-focus .sidebar, .app-focus .topbar { display: none; }
.app-focus .shell { grid-template-columns: minmax(0, 1fr); }
.app-focus .content { padding: 0.75rem 1rem 1.5rem; }
.app-focus .builder__side { top: 0.75rem; max-height: calc(100vh - 1.5rem); }
.app-focus .format-bar { top: 0.5rem; }
.app-focus .canvas-box { height: calc(100vh - 10.5rem); }

/* Page builder in a separate window: placeholder in the main window, layout of the editor window. */
.popout-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; min-height: calc(100vh - 13rem); padding: 2rem; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius); background: repeating-linear-gradient(45deg, var(--bg) 0 12px, var(--panel) 12px 24px); }
.popout-placeholder__text { max-width: 34rem; margin: 0; font-size: 1.05rem; color: var(--text); }
.editor-window #editor-root { padding: 0.75rem 1rem 1rem; }
.editor-window__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.editor-window__bar h1 { margin: 0; font-size: 1.2rem; }
.editor-window .builder__side { top: 0.75rem; max-height: calc(100vh - 1.5rem); }
.editor-window .format-bar { top: 0.5rem; }
.editor-window .canvas-box { height: calc(100vh - 8.5rem); }

/* Project page: main column and "What's new" side panel. */
.content:has(.dashboard) { max-width: 96rem; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.5rem; align-items: start; }
.dashboard__side { position: sticky; top: 1rem; margin: 0; max-height: calc(100vh - 6rem); overflow-y: auto; }
.dashboard__side h2 { font-size: 1.15rem; }
.release + .release, .release-older { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.release-older .release { margin-top: 0.9rem; }
.release__title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 0.75rem; margin: 0 0 0.4rem; font-size: 0.95rem; }
.release__title time { font-family: var(--font-text); font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.release__items { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.release__items li { margin-bottom: 0.35rem; }
.release-older summary { cursor: pointer; font-family: var(--font); font-weight: 600; color: var(--brand-strong); }
@media (max-width: 72rem) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .dashboard__side { position: static; max-height: none; }
}

/* Help */
.help-lead { max-width: 70ch; margin: 0.25rem 0 1.25rem; font-size: 1.05rem; color: var(--muted); }
.help-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.6rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.help-topics li { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.help-topics a { font-family: var(--font); font-weight: 600; }
.help-topics__summary { font-size: 0.9rem; color: var(--muted); }
.help-article { max-width: 52rem; }
.help-article > h1 { margin-top: 0.35rem; }
.help-article > h2 { margin: 1.75rem 0 0.6rem; font-size: 1.2rem; }
.help-article li { margin-bottom: 0.45rem; }
.help-steps { padding-left: 1.4rem; }
.help-steps li::marker { color: var(--brand-strong); font-family: var(--font); font-weight: 600; }
.help-note { margin: 1rem 0; padding: 0.75rem 1rem; border-left: 4px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand-soft); }
.help-note p { margin: 0.2rem 0 0; }
.help-note__label { font-family: var(--font); }
.help-note--warning { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--panel)); }
.help-note--company { border-left-color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, var(--panel)); }
.help-next { margin: 2rem 0 1.25rem; font-family: var(--font); font-weight: 600; }
.help-siblings { margin: 0; padding-left: 1.1rem; }
.help-siblings a[aria-current] { color: var(--text); font-weight: 600; text-decoration: none; }
.ui-label { font-family: var(--font); font-weight: 600; }
.help-link { font-size: 0.92rem; }

/* Backup reminder: discreet, in a corner, takes no focus. */
.backup-reminder { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; width: min(22rem, calc(100vw - 2rem)); padding: 0.8rem 1rem; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-left: 5px solid var(--warning); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 0.9rem; }
.backup-reminder p { margin: 0 0 0.6rem; }
.backup-reminder__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .backup-reminder { animation: backup-in 0.25s ease-out; }
  @keyframes backup-in { from { opacity: 0; transform: translateY(0.5rem); } }
}

/* Feedback */
.feedback-button { white-space: nowrap; }
.feedback .field textarea { width: 100%; }
