.moodboard-foundation {
  --moodboard-ink: #24332f;
  --moodboard-sage: #667063;
  --moodboard-sand: #d7c8b4;
  color: var(--moodboard-ink);
}

.moodboard-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: #5b6561;
}

.moodboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 32px;
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid #deddd7;
  border-radius: 20px;
  background:
    radial-gradient(circle at 86% 18%, rgba(215, 200, 180, .72), transparent 34%),
    linear-gradient(135deg, #fbfaf7, #f0f1ec);
  box-shadow: 0 18px 50px rgba(38, 51, 47, .08);
}

.moodboard-hero-copy {
  max-width: 760px;
}

.moodboard-eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e8e9e2;
  color: #465049;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
}

.moodboard-hero h1 {
  max-width: 720px;
  margin: 18px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.moodboard-hero p {
  max-width: 700px;
  color: #59635f;
  font-size: 17px;
  line-height: 1.65;
}

.moodboard-active-state {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding: 12px 15px;
  border: 1px solid #cdd4c9;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}

.moodboard-active-state i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--moodboard-sage);
  color: white;
  font-style: normal;
}

.moodboard-active-state strong,
.moodboard-active-state small {
  display: block;
}

.moodboard-active-state small {
  margin-top: 3px;
  color: #68716d;
}

.moodboard-foundation-mark {
  justify-self: end;
  display: grid;
  width: 190px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(145deg, #758074, #303933);
  color: white;
  box-shadow: 0 20px 45px rgba(40, 50, 45, .24);
  transform: rotate(3deg);
}

.moodboard-foundation-mark span {
  font-size: 52px;
  font-weight: 300;
  letter-spacing: -.06em;
}

.moodboard-foundation-mark b {
  margin-top: -48px;
  font-size: 11px;
  letter-spacing: .24em;
}

.moodboard-foundation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.moodboard-foundation-grid .panel {
  min-height: 190px;
  padding: 24px;
}

.moodboard-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 11px;
  background: #eef0ea;
  color: var(--moodboard-sage);
  font-size: 12px;
  font-weight: 800;
}

.moodboard-foundation-grid small {
  color: #777f7b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.moodboard-foundation-grid h2 {
  margin: 8px 0;
  font-size: 21px;
}

.moodboard-foundation-grid p {
  color: #66706b;
  line-height: 1.55;
}

.moodboard-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.moodboard-permissions span {
  padding: 6px 9px;
  border: 1px solid #d7dad4;
  border-radius: 999px;
  background: #fafbf8;
  color: #56605b;
  font-size: 12px;
}

.moodboard-transparency {
  margin: 18px 3px 0;
  color: #6d7672;
  font-size: 13px;
}

@media (max-width: 900px) {
  .moodboard-hero {
    grid-template-columns: 1fr;
  }

  .moodboard-foundation-mark {
    display: none;
  }

  .moodboard-foundation-grid {
    grid-template-columns: 1fr;
  }

  .moodboard-foundation-grid .panel {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .moodboard-hero {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .moodboard-hero h1 {
    font-size: 32px;
  }

  .moodboard-hero p {
    font-size: 15px;
  }

  .moodboard-active-state {
    align-items: flex-start;
  }
}

/* Phase 1 — bibliothèque et éditeur */
.mb-home {
  --mb-ink: #28332f;
  --mb-muted: #68716c;
  --mb-accent: #586457;
  --mb-border: #dedfd9;
  color: var(--mb-ink);
}

.mb-home-heading,
.mb-list-toolbar,
.mb-editor-toolbar,
.mb-panel-heading,
.mb-board-card footer,
.mb-form-row,
.mb-layer-actions,
.mb-page-actions {
  display: flex;
  align-items: center;
}

.mb-home-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.mb-home-heading h1 {
  margin: 5px 0 7px;
  font-size: clamp(30px, 4vw, 44px);
}

.mb-home-heading p,
.mb-board-card p,
.mb-panel-empty,
.mb-page-properties > p {
  color: var(--mb-muted);
}

.mb-list-toolbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mb-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--mb-border);
  border-radius: 12px;
  background: #f4f4f0;
}

.mb-tabs button,
.mb-card-action,
.mb-panel-heading button,
.mb-layer-actions button {
  border: 0;
  color: #4a5651;
  background: transparent;
  cursor: pointer;
}

.mb-tabs button {
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 700;
}

.mb-tabs button.active {
  color: #fff;
  background: var(--mb-accent);
  box-shadow: 0 5px 14px rgba(52, 64, 58, .18);
}

.mb-search {
  display: flex;
  align-items: center;
  width: min(320px, 40vw);
  padding: 0 12px;
  border: 1px solid var(--mb-border);
  border-radius: 11px;
  color: #7a827e;
  background: #fff;
}

.mb-search input {
  width: 100%;
  padding: 11px 8px;
  border: 0;
  outline: 0;
  background: transparent;
}

.mb-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.mb-board-card {
  overflow: hidden;
  border: 1px solid var(--mb-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(39, 51, 47, .05);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.mb-board-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(39, 51, 47, .1);
}

.mb-board-cover {
  position: relative;
  display: grid;
  min-height: 184px;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(78, 88, 79, .92), rgba(181, 164, 140, .68)),
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(255, 255, 255, .08) 16px 32px);
  background-position: center;
  background-size: cover;
}

.mb-board-cover.has-image::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 52%, rgba(22, 29, 26, .46));
}

.mb-board-cover > span {
  font-family: Georgia, serif;
  font-size: 42px;
  opacity: .8;
}

.mb-board-cover > small {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(31, 39, 35, .7);
  text-transform: uppercase;
}

.mb-board-cover.has-image > span { display: none; }

.mb-board-card-body { padding: 16px 17px 11px; }
.mb-board-card-body > span { color: #7b817d; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.mb-board-card h3 { margin: 5px 0; font-size: 19px; }
.mb-board-card p { min-height: 38px; margin: 0; font-size: 13px; line-height: 1.45; }

.mb-board-card footer {
  min-height: 48px;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #ecece8;
}

.mb-board-card footer > small { color: #7d8581; font-size: 11px; }
.mb-board-card footer > div { display: flex; gap: 4px; }
.mb-card-action { padding: 4px 6px; font-size: 11px; font-weight: 700; }
.mb-card-action:hover { text-decoration: underline; }
.mb-card-action.danger { color: #a4473d; }

.mb-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 260px;
  place-content: center;
  gap: 7px;
  border: 1px dashed #cfd2cb;
  border-radius: 16px;
  color: #6c746f;
  text-align: center;
  background: #fafaf7;
}

.mb-modal-backdrop {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(24, 31, 28, .56);
  backdrop-filter: blur(5px);
}

.mb-modal {
  position: relative;
  display: grid;
  width: min(600px, 100%);
  gap: 15px;
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(20, 27, 24, .28);
}

.mb-modal h2 { margin: -7px 0 4px; font-size: 28px; }
.mb-modal label,
.mb-property-form label,
.mb-page-properties label {
  display: grid;
  gap: 6px;
  color: #56605b;
  font-size: 12px;
  font-weight: 700;
}

.mb-modal input,
.mb-modal textarea,
.mb-modal select,
.mb-property-form input,
.mb-property-form textarea,
.mb-property-form select,
.mb-page-properties input {
  width: 100%;
  padding: 10px;
  border: 1px solid #daddd7;
  border-radius: 9px;
  color: #26322e;
  background: #fff;
}

.mb-modal input[type="color"],
.mb-property-form input[type="color"],
.mb-page-properties input[type="color"] { min-height: 40px; padding: 4px; }
.mb-modal-close { position: absolute; top: 15px; right: 17px; border: 0; font-size: 25px; background: transparent; cursor: pointer; }
.mb-form-row { gap: 12px; align-items: flex-start; }
.mb-form-row label { flex: 1; }
.mb-modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.mb-modal-wide { width: min(880px, 100%); max-height: min(88vh, 900px); overflow: hidden; }
.mb-modal-intro { margin: -4px 0 2px; color: #66716b; font-size: 13px; }
.mb-version-create { display: grid; grid-template-columns: 1.15fr 1.6fr auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid #dfe2dc; border-radius: 12px; background: #f7f8f4; }
.mb-version-create button { min-height: 39px; }
.mb-version-list,
.mb-access-list { display: grid; min-height: 80px; max-height: 52vh; gap: 8px; overflow: auto; padding-right: 4px; }
.mb-version-list article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px; border: 1px solid #e0e2dd; border-radius: 11px; background: #fff; }
.mb-version-list article > div:first-child { display: grid; flex: 1; grid-template-columns: auto 1fr; gap: 2px 9px; min-width: 0; }
.mb-version-list article strong { align-self: center; }
.mb-version-list article small,
.mb-version-list article p { grid-column: 2; margin: 0; color: #77807b; font-size: 11px; }
.mb-version-list article p { margin-top: 4px; color: #4e5b55; }
.mb-version-list article > div:last-child { display: grid; flex: 0 0 auto; gap: 7px; justify-items: end; text-align: right; }
.mb-version-number { display: grid; width: 34px; height: 28px; grid-row: 1 / span 3; place-items: center; border-radius: 7px; color: #fff; background: #596558; font-size: 11px; font-weight: 800; }
.mb-access-list article { display: grid; grid-template-columns: minmax(210px, 1fr) 190px auto auto; gap: 8px; align-items: center; padding: 11px; border: 1px solid #e0e2dd; border-radius: 11px; background: #fff; }
.mb-access-list article > div { display: grid; min-width: 0; gap: 2px; }
.mb-access-list article small,
.mb-access-list article span { overflow: hidden; color: #77807b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mb-access-list article span { color: #52645a; }
.mb-access-list select { width: 100%; padding: 8px; border: 1px solid #daddd7; border-radius: 8px; background: #fff; }

.mb-editor-shell {
  --mb-panel: #fbfbf8;
  --mb-line: #dedfd9;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(620px, 1fr);
  min-width: 0;
  height: calc(100vh - 72px);
  color: #28332f;
  border: 1px solid var(--mb-line);
  border-radius: 14px;
  overflow: hidden;
  background: #eef0ed;
}

.mb-editor-toolbar {
  position: relative;
  z-index: 4;
  min-height: 66px;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--mb-line);
  background: rgba(255, 255, 253, .96);
}

.mb-editor-title,
.mb-history-actions,
.mb-export-actions,
.mb-zoom {
  display: flex;
  align-items: center;
}

.mb-editor-title { min-width: 190px; gap: 10px; }
.mb-editor-title > div { display: grid; gap: 2px; }
.mb-editor-title input { width: min(260px, 22vw); padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; font-size: 16px; font-weight: 800; }
.mb-editor-title input:hover, .mb-editor-title input:focus { border-color: #cfd3cc; outline: 0; }
.mb-editor-title small { padding-left: 6px; color: #7a827e; font-size: 10px; }
.mb-history-actions, .mb-export-actions { gap: 6px; }
.mb-icon-button { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid #d9dcd6; border-radius: 8px; color: #3f4b46; background: #fff; cursor: pointer; }
.mb-icon-button:disabled { opacity: .4; cursor: default; }
.mb-zoom { gap: 7px; margin-left: 5px; color: #67706b; font-size: 11px; }
.mb-zoom input { width: 90px; accent-color: #596558; }
.mb-save-state { min-width: 82px; color: #52705b; font-size: 11px; text-align: right; }
.mb-save-state.pending { color: #916b2f; }
.mb-save-state.error { color: #a13e36; }

.mb-conflict {
  position: absolute;
  top: 66px;
  right: 0;
  left: 0;
  display: flex;
  z-index: 5;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 10px 16px;
  color: #702d27;
  border-bottom: 1px solid #e2aea8;
  background: #fff0ee;
  font-size: 13px;
}

.mb-conflict button { padding: 5px 11px; border: 1px solid #b25d55; border-radius: 7px; color: #702d27; background: #fff; cursor: pointer; }

.mb-editor-body {
  display: grid;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 230px minmax(350px, 1fr) 250px;
}

.mb-editor-left,
.mb-inspector {
  z-index: 2;
  min-width: 0;
  overflow: auto;
  background: var(--mb-panel);
}

.mb-editor-left { border-right: 1px solid var(--mb-line); }
.mb-inspector { border-left: 1px solid var(--mb-line); }
.mb-editor-left > section { padding: 14px; border-bottom: 1px solid var(--mb-line); }
.mb-panel-heading { justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.mb-panel-heading strong { font-size: 13px; }
.mb-panel-heading > span { overflow: hidden; color: #818783; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mb-panel-heading button { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #d6d9d3; border-radius: 7px; font-size: 18px; background: #fff; }

.mb-upload {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border: 1px dashed #aeb6ad;
  border-radius: 9px;
  color: #4d5b53;
  font-weight: 700;
  background: #f7f8f4;
  cursor: pointer;
}

.mb-asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.mb-asset { overflow: hidden; padding: 0; border: 1px solid #daddd6; border-radius: 8px; text-align: left; background: #fff; cursor: pointer; }
.mb-asset:disabled { opacity: .68; cursor: default; }
.mb-asset > span { display: grid; height: 64px; place-items: center; color: #7c837f; background: #ecece7; font-weight: 800; }
.mb-asset img { width: 100%; height: 100%; object-fit: cover; }
.mb-asset small { display: block; overflow: hidden; padding: 6px; color: #56605b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mb-panel-empty { margin: 10px 0 0; font-size: 11px; line-height: 1.45; }

.mb-tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mb-tool-grid button { display: grid; gap: 3px; place-items: center; padding: 8px 3px; border: 1px solid #daddd6; border-radius: 8px; color: #45514b; background: #fff; cursor: pointer; }
.mb-tool-grid button:disabled { opacity: .45; cursor: default; }
.mb-tool-grid i { display: grid; width: 27px; height: 27px; place-items: center; font-family: Georgia, serif; font-size: 20px; font-style: normal; }
.mb-tool-grid span { font-size: 9px; }

.mb-pages #mb-page-list { display: grid; gap: 5px; }
.mb-pages [data-page] { display: flex; align-items: center; gap: 8px; padding: 7px; border: 1px solid transparent; border-radius: 8px; color: #52605a; text-align: left; background: transparent; cursor: pointer; }
.mb-pages [data-page].active { border-color: #bbc3ba; background: #eef1eb; }
.mb-pages [data-page] span { display: grid; width: 24px; height: 19px; place-items: center; border: 1px solid #d2d5cf; border-radius: 4px; background: #fff; font-size: 9px; }
.mb-pages [data-page] strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.mb-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  background:
    linear-gradient(90deg, rgba(80, 92, 85, .035) 1px, transparent 1px),
    linear-gradient(rgba(80, 92, 85, .035) 1px, transparent 1px), #e8ebe7;
  background-size: 20px 20px;
}

.mb-canvas-scroll { min-width: 0; min-height: 0; overflow: auto; padding: 32px; }
.mb-canvas-wrap { position: relative; margin: auto; }
.mb-canvas { position: absolute; top: 0; left: 0; overflow: hidden; transform-origin: top left; box-shadow: 0 13px 38px rgba(35, 43, 39, .22); touch-action: none; }
.mb-canvas-hint { padding: 7px 12px; color: #737c77; text-align: center; background: rgba(246, 247, 244, .9); }

.mb-element { position: absolute; box-sizing: border-box; user-select: none; touch-action: none; cursor: move; }
.mb-element.selected::after { position: absolute; inset: -4px; content: ""; border: 2px solid #408dcb; pointer-events: none; }
.mb-element.locked { cursor: default; }
.mb-element img,
.mb-text-content,
.mb-color-content,
.mb-shape-content { display: block; width: 100%; height: 100%; box-sizing: border-box; }
.mb-element img { pointer-events: none; }
.mb-text-content { overflow: hidden; padding: 12px; line-height: 1.2; white-space: pre-wrap; }
.mb-note-content { box-shadow: 0 6px 16px rgba(52, 44, 28, .14); }
.mb-line-content { position: absolute; top: 50%; left: 0; width: 100%; transform: translateY(-50%); }
.mb-line-content i { position: absolute; top: 50%; right: -1px; width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid currentColor; transform: translateY(-50%); }
.mb-resize-handle { position: absolute; z-index: 4; right: -9px; bottom: -9px; width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; background: #408dcb; box-shadow: 0 1px 5px rgba(0, 0, 0, .25); cursor: nwse-resize; }
.mb-lock-mark { position: absolute; z-index: 3; top: 4px; right: 4px; display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .84); }

.mb-inspector { padding: 14px; }
.mb-property-form,
.mb-page-properties { display: grid; gap: 13px; }
.mb-property-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mb-property-grid .wide, .mb-property-form > .wide { grid-column: 1 / -1; }
.mb-property-form textarea { resize: vertical; }
.mb-type-badge { justify-self: start; padding: 4px 8px; border-radius: 20px; color: #4d5b54; background: #e9ede7; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.mb-property-form label.mb-check, .mb-layer-actions label.mb-check { display: flex; align-items: center; gap: 5px; }
.mb-check input { width: auto; }
.mb-layer-actions { flex-wrap: wrap; gap: 6px; padding: 10px 0; border-top: 1px solid #e4e5e0; border-bottom: 1px solid #e4e5e0; }
.mb-layer-actions button { padding: 6px 8px; border: 1px solid #d5d8d2; border-radius: 7px; background: #fff; }
.mb-layer-actions label { margin-left: auto; }
.mb-page-actions { gap: 7px; flex-wrap: wrap; }

@media (max-width: 1250px) {
  .mb-editor-body { grid-template-columns: 205px minmax(320px, 1fr) 220px; }
  .mb-save-state { display: none; }
  .mb-editor-title input { width: 180px; }
}

@media (max-width: 980px) {
  .mb-editor-shell { height: auto; min-height: calc(100vh - 70px); grid-template-rows: auto auto; overflow: visible; }
  .mb-editor-toolbar { flex-wrap: wrap; }
  .mb-editor-title { flex: 1; }
  .mb-history-actions { order: 3; width: 100%; justify-content: center; }
  .mb-editor-body { grid-template-columns: 180px minmax(340px, 1fr); grid-template-rows: minmax(560px, 70vh) auto; }
  .mb-inspector { grid-column: 1 / -1; border-top: 1px solid var(--mb-line); border-left: 0; }
  .mb-property-form, .mb-page-properties { max-width: 680px; margin: auto; }
  .mb-property-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 700px) {
  .mb-home-heading, .mb-list-toolbar { align-items: stretch; flex-direction: column; }
  .mb-search { width: 100%; }
  .mb-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .mb-tabs button { padding-inline: 8px; }
  .mb-board-grid { grid-template-columns: 1fr; }
  .mb-form-row { flex-direction: column; }
  .mb-form-row label { width: 100%; }
  .mb-editor-shell { margin: -8px; border-radius: 0; }
  .mb-editor-toolbar { align-items: flex-start; }
  .mb-editor-title input { width: 150px; }
  .mb-export-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .mb-editor-body { display: flex; flex-direction: column; }
  .mb-editor-left { display: grid; grid-template-columns: 1fr 1fr; border-right: 0; border-bottom: 1px solid var(--mb-line); }
  .mb-editor-left > section { padding: 11px; }
  .mb-editor-left > section:first-child { grid-column: 1 / -1; }
  .mb-asset-grid { display: flex; overflow-x: auto; }
  .mb-asset { min-width: 92px; }
  .mb-workspace { min-height: 62vh; order: 2; }
  .mb-inspector { order: 3; }
  .mb-property-grid { grid-template-columns: 1fr 1fr; }
  .mb-canvas-scroll { padding: 22px; }
  .mb-canvas-hint { font-size: 9px; }
  .mb-modal-wide { max-height: 92vh; padding: 22px 16px; }
  .mb-version-create { grid-template-columns: 1fr; }
  .mb-version-list, .mb-access-list { max-height: 48vh; }
  .mb-version-list article { align-items: stretch; flex-direction: column; gap: 10px; }
  .mb-version-list article > div:last-child { grid-template-columns: 1fr auto; align-items: center; justify-items: start; text-align: left; }
  .mb-access-list article { grid-template-columns: 1fr auto; }
  .mb-access-list article > div { grid-column: 1 / -1; }
  .mb-access-list select { grid-column: 1 / -1; }
}

/* Direction graphique ArchiBoards — limitée au module Moodboard. */
.page.mb-home {
  --mb-ink: #20231f;
  --mb-muted: #70756f;
  --mb-accent: #535b4f;
  --mb-soft: #f3f1ec;
  --mb-line: #deddd8;
  max-width: none;
  padding: 24px 28px 34px;
  color: var(--mb-ink);
  background: linear-gradient(145deg, #fbfaf7 0%, #f5f4ef 58%, #f9f8f5 100%);
}

.mb-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 18px;
}

.mb-studio-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.mb-ab-mark {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(145deg, #6c7369, #3f4944);
  box-shadow: 0 8px 18px rgba(47, 54, 49, .16);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: -.04em;
}

.mb-studio-brand > div { display: grid; min-width: 0; gap: 3px; }
.mb-studio-brand > div > span { color: #515750; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.mb-studio-brand h1 { overflow: hidden; margin: 0; font-size: clamp(24px, 2vw, 34px); letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }
.mb-studio-brand p { margin: 0; color: var(--mb-muted); font-size: 13px; }
.mb-new-board { min-height: 42px; border-radius: 7px; background: #50584d; box-shadow: 0 8px 18px rgba(63, 71, 62, .15); }
.page.mb-home .button.primary.mb-new-board,
.mb-editor-shell .button.primary { border-color: #50584d; background: #50584d; }
.page.mb-home .button.primary.mb-new-board:hover,
.mb-editor-shell .button.primary:hover { border-color: #414940; background: #414940; }

.mb-context-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  border-top: 1px solid var(--mb-line);
  border-bottom: 1px solid var(--mb-line);
  scrollbar-width: none;
}

.mb-context-tabs span {
  position: relative;
  flex: 0 0 auto;
  padding: 13px 15px 12px;
  color: #6d726c;
  font-size: 11px;
  white-space: nowrap;
}

.mb-context-tabs span.active { color: #20231f; font-weight: 800; }
.mb-context-tabs span.active::after { position: absolute; right: 13px; bottom: -1px; left: 13px; height: 2px; content: ""; background: #4f584e; }

.mb-overview-strip {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(320px, 1.3fr);
  margin: 18px 0;
  border: 1px solid var(--mb-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 28px rgba(57, 60, 55, .04);
}

.mb-overview-strip > div { display: grid; grid-template-columns: auto 1fr; gap: 2px 13px; align-items: center; padding: 16px 18px; }
.mb-overview-strip > div + div { border-left: 1px solid var(--mb-line); }
.mb-overview-strip span { grid-column: 1 / -1; color: #777c75; font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.mb-overview-strip strong { align-self: end; font-size: 24px; letter-spacing: -.04em; }
.mb-overview-strip small { align-self: end; padding-bottom: 3px; color: #71766f; font-size: 11px; }
.mb-overview-strip .mb-overview-note { display: flex; align-items: baseline; gap: 12px; }
.mb-overview-strip .mb-overview-note span { flex: 0 0 auto; }
.mb-overview-strip .mb-overview-note strong { font-size: 14px; letter-spacing: -.01em; }

.page.mb-home .mb-list-toolbar { margin: 0 0 14px; }
.page.mb-home .mb-tabs { padding: 3px; border: 1px solid var(--mb-line); border-radius: 7px; background: #efeee9; }
.page.mb-home .mb-tabs button { border-radius: 5px; color: #636861; }
.page.mb-home .mb-tabs button.active { color: #fff; background: #525a50; box-shadow: 0 3px 8px rgba(54, 60, 53, .16); }
.page.mb-home .mb-search { min-width: min(330px, 100%); border-radius: 7px; background: rgba(255, 255, 255, .8); }

.page.mb-home .mb-board-grid { grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 14px; }
.page.mb-home .mb-board-card { border-color: var(--mb-line); border-radius: 8px; background: rgba(255, 255, 255, .86); box-shadow: 0 7px 24px rgba(54, 59, 54, .055); }
.page.mb-home .mb-board-card:hover { border-color: #aeb3ac; box-shadow: 0 12px 30px rgba(51, 58, 52, .11); transform: translateY(-2px); }
.page.mb-home .mb-board-cover { height: auto; aspect-ratio: 16 / 8.8; border-radius: 7px 7px 0 0; background-color: #e7e4dd; }
.page.mb-home .mb-board-cover::before { position: absolute; inset: 0; content: ""; background: linear-gradient(145deg, rgba(105, 113, 103, .06), rgba(213, 201, 182, .18)); }
.page.mb-home .mb-board-cover > span { z-index: 1; font-family: Georgia, serif; font-weight: 400; }
.page.mb-home .mb-board-cover > small { z-index: 1; border-radius: 4px; letter-spacing: .03em; }
.page.mb-home .mb-board-card-body { padding: 12px 13px 8px; }
.page.mb-home .mb-board-card h3 { margin: 5px 0 3px; font-size: 15px; letter-spacing: -.02em; }
.page.mb-home .mb-board-card p { min-height: 32px; font-size: 11px; }
.page.mb-home .mb-board-card footer { padding: 9px 13px 11px; }
.mb-card-kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mb-card-kicker span { overflow: hidden; color: #7b817d; font-size: 9px; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.mb-card-kicker i { color: #777d76; font-size: 17px; font-style: normal; }

.mb-create-launcher {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(520px, 2fr) minmax(200px, .72fr);
  gap: 24px;
  align-items: center;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--mb-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
}

.mb-create-copy h2 { margin: 7px 0 7px; font-size: 18px; letter-spacing: -.025em; }
.mb-create-copy p { margin: 0; color: #737870; font-size: 11px; line-height: 1.55; }
.mb-format-grid { display: grid; grid-template-columns: repeat(6, minmax(70px, 1fr)); gap: 8px; }
.mb-format-card { display: grid; min-width: 0; min-height: 108px; place-items: end center; gap: 4px; padding: 12px 6px 9px; border: 1px solid #deded9; border-radius: 7px; color: #343934; background: #faf9f6; cursor: pointer; }
.mb-format-card:hover, .mb-format-card:focus-visible { border-color: #697467; outline: 2px solid rgba(87, 99, 85, .14); background: #fff; }
.mb-format-card strong { font-size: 10px; }
.mb-format-card small { color: #898d87; font-size: 8px; }
.mb-format-shape { display: block; width: 28px; height: 28px; border: 1px solid #aeb3ac; border-radius: 2px; background: #fff; box-shadow: inset 0 0 0 4px #f6f5f1; }
.mb-format-shape.portrait { width: 24px; height: 32px; }
.mb-format-shape.landscape { width: 34px; height: 24px; }
.mb-tool-promise { display: grid; gap: 7px; }
.mb-tool-promise strong { margin-bottom: 2px; font-size: 12px; }
.mb-tool-promise span { position: relative; padding-left: 16px; color: #666d66; font-size: 10px; }
.mb-tool-promise span::before { position: absolute; top: 2px; left: 1px; color: #555e53; content: "◇"; font-size: 9px; }

.mb-editor-shell {
  --mb-panel: #fbfaf7;
  --mb-line: #dfded9;
  grid-template-rows: 49px auto minmax(570px, 1fr);
  height: calc(100vh - 70px);
  border: 0;
  border-radius: 0;
  color: #262b27;
  background: #ecebe7;
}

.mb-editor-appbar {
  display: flex;
  z-index: 5;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 14px;
  border-bottom: 1px solid var(--mb-line);
  background: #faf9f6;
}

.mb-studio-brand.compact { gap: 9px; }
.mb-studio-brand.compact .mb-ab-mark { width: 31px; height: 31px; border-radius: 5px; font-size: 14px; box-shadow: none; }
.mb-studio-brand.compact > div { gap: 0; }
.mb-studio-brand.compact > div > span { font-size: 8px; }
.mb-studio-brand.compact strong { overflow: hidden; max-width: 190px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mb-context-tabs.compact { justify-content: flex-end; border: 0; }
.mb-context-tabs.compact span { padding: 16px 10px 14px; font-size: 9px; }

.mb-editor-toolbar { grid-row: 2; min-height: 61px; padding: 8px 12px; background: rgba(255, 255, 253, .98); }
.mb-editor-title input { font-size: 15px; }
.mb-editor-body { grid-row: 3; grid-template-columns: 285px minmax(410px, 1fr) 270px; }
.mb-conflict { top: 110px; }
.mb-icon-button { width: 32px; height: 32px; border-radius: 6px; }
.mb-export-actions .button { min-height: 32px; border-radius: 6px; }

.mb-editor-left {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid var(--mb-line);
  background: #f7f6f2;
}

.mb-tool-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 6px;
  border-right: 1px solid var(--mb-line);
  background: #f0efeb;
}

.mb-tool-rail button {
  display: grid;
  min-height: 51px;
  place-items: center;
  gap: 1px;
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #535a54;
  background: transparent;
  cursor: pointer;
}

.mb-tool-rail button:hover, .mb-tool-rail button.active { border-color: #d7d8d2; color: #2d332e; background: #fff; box-shadow: 0 3px 8px rgba(60, 65, 60, .06); }
.mb-tool-rail button:disabled { opacity: .38; cursor: default; }
.mb-tool-rail i { display: grid; height: 21px; place-items: center; font-family: Georgia, serif; font-size: 17px; font-style: normal; }
.mb-tool-rail span { font-size: 8px; }
.mb-library-pane { min-width: 0; overflow: auto; background: #fbfaf7; }
.mb-library-pane > section { padding: 12px; border-bottom: 1px solid var(--mb-line); }
.mb-library-pane .mb-upload { padding: 7px; border-radius: 6px; font-size: 10px; }
.mb-library-pane .mb-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.mb-library-pane .mb-asset { border-radius: 5px; }
.mb-library-pane .mb-asset > span { height: 70px; }

.mb-workspace { background-color: #e9e8e4; background-size: 24px 24px; }
.mb-canvas { box-shadow: 0 12px 32px rgba(35, 39, 35, .18); }
.mb-canvas-hint { color: #747a74; border-top: 1px solid #deded9; background: rgba(249, 248, 245, .94); }
.mb-element.selected::after { border-color: #3894d4; }
.mb-resize-handle { background: #3894d4; }

.mb-inspector { padding: 0 13px 16px; background: #fbfaf7; }
.mb-inspector-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 -13px 14px; border-bottom: 1px solid var(--mb-line); }
.mb-inspector-tabs button { position: relative; min-height: 42px; border: 0; color: #747a74; background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.mb-inspector-tabs button.active { color: #282d29; }
.mb-inspector-tabs button.active::after { position: absolute; right: 18px; bottom: -1px; left: 18px; height: 2px; content: ""; background: #50594f; }
.mb-inspector .mb-panel-heading { padding-bottom: 10px; border-bottom: 1px solid #e7e6e1; }
.mb-inspector-summary { display: grid; gap: 13px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--mb-line); }
.mb-inspector-summary > div { display: grid; gap: 4px; }
.mb-inspector-summary strong { font-size: 11px; }
.mb-inspector-summary small, .mb-inspector-summary p { margin: 0; color: #767c76; font-size: 9px; line-height: 1.45; }
.mb-palette-row { display: flex; flex-wrap: wrap; gap: 5px; }
.mb-palette-row i { width: 25px; height: 25px; border: 1px solid rgba(47, 51, 47, .13); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.mb-property-form, .mb-page-properties { gap: 10px; }
.mb-property-grid { gap: 7px; }
.mb-property-form label, .mb-page-properties label { font-size: 9px; }
.mb-property-form input, .mb-property-form textarea, .mb-property-form select, .mb-page-properties input { border-radius: 6px; background: #fff; }

@media (max-width: 1280px) {
  .page.mb-home .mb-board-grid { grid-template-columns: repeat(3, minmax(210px, 1fr)); }
  .mb-create-launcher { grid-template-columns: 1fr 2.2fr; }
  .mb-tool-promise { display: none; }
  .mb-editor-body { grid-template-columns: 245px minmax(360px, 1fr) 240px; }
  .mb-context-tabs.compact span { padding-inline: 7px; }
}

@media (max-width: 1020px) {
  .page.mb-home .mb-board-grid { grid-template-columns: repeat(2, minmax(210px, 1fr)); }
  .mb-context-tabs.compact span:not(.active) { display: none; }
  .mb-editor-shell { height: auto; min-height: calc(100vh - 70px); overflow: visible; }
  .mb-editor-toolbar { flex-wrap: wrap; }
  .mb-history-actions { order: 3; width: 100%; justify-content: center; }
  .mb-editor-body { grid-template-columns: 235px minmax(390px, 1fr); grid-template-rows: minmax(600px, 72vh) auto; }
  .mb-inspector { grid-column: 1 / -1; border-top: 1px solid var(--mb-line); border-left: 0; }
  .mb-inspector-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .page.mb-home { padding: 16px 14px 26px; }
  .mb-studio-header { align-items: flex-start; }
  .mb-studio-brand { align-items: flex-start; gap: 11px; }
  .mb-studio-brand .mb-ab-mark { width: 39px; height: 39px; font-size: 17px; }
  .mb-studio-brand p { display: none; }
  .mb-new-board { min-width: 42px; padding: 0 11px; font-size: 0; }
  .mb-new-board svg { margin: 0; }
  .mb-context-tabs { margin-inline: -14px; padding-inline: 7px; }
  .mb-context-tabs span { padding-inline: 11px; }
  .mb-overview-strip { grid-template-columns: 1fr; }
  .mb-overview-strip > div + div { border-top: 1px solid var(--mb-line); border-left: 0; }
  .mb-overview-strip .mb-overview-note { display: grid; }
  .mb-overview-strip .mb-overview-note { grid-template-columns: 1fr; align-items: start; }
  .mb-overview-strip .mb-overview-note > * { grid-column: 1; }
  .page.mb-home .mb-list-toolbar { align-items: stretch; flex-direction: column; }
  .page.mb-home .mb-board-grid { grid-template-columns: 1fr; }
  .mb-create-launcher { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .mb-format-grid { grid-template-columns: repeat(3, 1fr); }
  .mb-editor-appbar { padding: 0 10px; }
  .mb-context-tabs.compact { margin: 0; padding: 0; }
  .mb-editor-toolbar { display: grid; grid-template-columns: 1fr auto; align-items: start; padding: 8px; }
  .mb-editor-title { width: 100%; min-width: 0; grid-column: 1 / -1; }
  .mb-editor-title > div { min-width: 0; flex: 1; }
  .mb-editor-title input { width: 100%; box-sizing: border-box; }
  .mb-history-actions { width: 100%; order: initial; grid-column: 1 / -1; justify-content: center; }
  .mb-export-actions { margin: 0; grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-end; }
  .mb-export-actions #mb-export-png, .mb-export-actions #mb-export-pdf { display: none; }
  .mb-editor-body { display: flex; flex-direction: column; }
  .mb-editor-left { display: flex; flex-direction: column; overflow: visible; border-right: 0; border-bottom: 1px solid var(--mb-line); }
  .mb-tool-rail { display: grid; grid-template-columns: repeat(7, minmax(52px, 1fr)); order: 2; overflow-x: auto; padding: 5px; border-top: 1px solid var(--mb-line); border-right: 0; }
  .mb-tool-rail button { min-height: 47px; }
  .mb-library-pane { max-height: 230px; overflow: auto; }
  .mb-library-pane .mb-asset-grid { display: flex; overflow-x: auto; }
  .mb-library-pane .mb-asset { min-width: 92px; }
  .mb-library-pane .mb-pages { display: none; }
  .mb-workspace { min-height: 62vh; order: 2; }
  .mb-inspector { order: 3; }
  .mb-inspector-summary { grid-template-columns: 1fr; }
  .mb-canvas-scroll { padding: 20px; }
}
