:root {
  --blue: #1769e0;
  --blue-dark: #0d47a8;
  --blue-soft: #eaf3ff;
  --navy: #17233c;
  --text: #26334d;
  --muted: #68758b;
  --line: #dbe4f0;
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --coral: #f1685b;
  --coral-soft: #fff0ed;
  --green: #168b68;
  --green-soft: #e6f7f1;
  --amber: #b86a00;
  --amber-soft: #fff4dd;
  --danger: #c43b48;
  --shadow-sm: 0 2px 8px rgba(30, 61, 104, .08);
  --shadow: 0 14px 34px rgba(30, 61, 104, .13);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --tap: 46px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #f5f8fc; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  color: var(--text);
  background: #f5f8fc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(23, 105, 224, .26);
  outline-offset: 2px;
}

a { color: var(--blue-dark); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .4rem; color: var(--navy); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: .35rem; color: var(--navy); font-size: 1.3rem; line-height: 1.2; letter-spacing: -.02em; }
h3 { color: var(--navy); font-size: 1rem; line-height: 1.25; }

.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.view { min-height: 100dvh; }
.eyebrow { margin: 0 0 .55rem; color: var(--blue-dark); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--navy);
  font-size: 1.12rem;
  text-decoration: none;
}
.brand strong { color: var(--blue); font-weight: 850; }
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  border-radius: 14px;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(23, 105, 224, .22);
}
.brand-mark svg { width: 25px; height: 25px; stroke-width: 2; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; }
.brand-mark.small svg { width: 22px; height: 22px; }
.brand-button { padding: 0; border: 0; background: transparent; cursor: pointer; }

.button {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .68rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--surface);
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(23, 105, 224, .18); }
.button.primary:hover { background: #0f5dcc; }
.button.secondary { color: var(--blue-dark); border-color: #b9d3f8; background: var(--blue-soft); }
.button.secondary:hover { border-color: #88b6f3; }
.button.ghost { color: var(--text); border-color: var(--line); background: var(--surface); }
.button.small { min-height: 38px; padding: .5rem .8rem; font-size: .88rem; }
.button.compact { min-height: 42px; padding: .55rem .8rem; }
.button.wide { width: 100%; }
.button.danger { color: var(--danger); border-color: #f0c8cd; background: #fff4f5; }
.button svg { flex: none; }

.icon-button {
  width: var(--tap);
  height: var(--tap);
  display: inline-grid;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); }
.icon-button.bordered { border: 1px solid var(--line); background: var(--surface); }

/* Accueil */
.home-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(23, 105, 224, .12), transparent 27rem),
    radial-gradient(circle at 92% 92%, rgba(241, 104, 91, .11), transparent 25rem),
    #f7faff;
}
.home-view::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: radial-gradient(#97b5dc 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.home-header, .app-header {
  position: relative;
  z-index: 2;
  width: min(1160px, calc(100% - 2rem));
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
}
.network-badge, .sync-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 34px;
  padding: .35rem .65rem;
  color: #426077;
  border: 1px solid rgba(130, 161, 199, .32);
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  font-size: .82rem;
  font-weight: 720;
  backdrop-filter: blur(8px);
}
.network-badge > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.network-badge.offline > span:first-child { background: var(--amber); }
.sync-pill svg { width: 17px; height: 17px; color: var(--green); }
.sync-pill.pending { color: var(--amber); background: var(--amber-soft); border-color: #f0d398; }
.sync-pill.pending svg { color: var(--amber); }
.sync-pill.syncing { color: var(--blue); background: rgba(23,105,224,.10); border-color: rgba(23,105,224,.28); }
.sync-pill.syncing svg { color: var(--blue); animation: murSyncPulse 1s ease-in-out infinite alternate; }
@keyframes murSyncPulse { from { opacity: .45; } to { opacity: 1; } }

.home-shell {
  position: relative;
  z-index: 1;
  width: min(940px, calc(100% - 2rem));
  flex: 1;
  display: grid;
  align-content: center;
  gap: 2rem;
  margin: auto;
  padding: 2rem 0 4.5rem;
}
.home-heading { text-align: center; }
.home-heading .eyebrow { color: var(--coral); }
.entry-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 1.25rem; align-items: stretch; }
.entry-card {
  display: grid;
  align-content: start;
  gap: 1.15rem;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid rgba(176, 198, 225, .65);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.entry-card p { margin-bottom: 0; color: var(--muted); }
.entry-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; }
.entry-icon.coral { color: #ce493f; background: var(--coral-soft); }
.entry-icon.blue { color: var(--blue); background: var(--blue-soft); }
.entry-icon svg { width: 25px; height: 25px; stroke-width: 2; }
.field-label { display: block; margin-bottom: -.7rem; color: #43526a; font-size: .86rem; font-weight: 800; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; }
.code-input {
  width: 100%;
  min-height: 54px;
  padding: .7rem 1rem;
  border: 2px solid #c6d7eb;
  border-radius: 14px;
  color: var(--navy);
  background: #fbfdff;
  font-size: 1.22rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.code-input:focus { border-color: var(--blue); outline: 3px solid rgba(23, 105, 224, .13); }
.field-help { font-size: .8rem; line-height: 1.35; }
.teacher-card .button { margin-top: auto; }
.account-link { text-align: center; font-size: .83rem; }
.account-link a { font-weight: 750; text-underline-offset: 2px; }
.home-footer { position: relative; z-index: 1; padding: 1.25rem; color: var(--muted); font-size: .78rem; text-align: center; }

/* Liste des murs */
.dashboard-view { background: var(--surface-2); }
.app-header {
  width: 100%;
  min-height: 72px;
  padding: 0 max(1.25rem, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.header-actions { display: flex; align-items: center; gap: .7rem; }
.profile-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .45rem .3rem .35rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
}
.profile-button:hover { background: var(--surface-2); }
.profile-button > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; color: white; border-radius: 11px; background: var(--navy); font-size: .76rem; font-weight: 800; }
.profile-button > span:nth-child(2) { font-size: .9rem; font-weight: 750; }
.profile-button .chevron { width: 18px; height: 18px; color: var(--muted); }
.dashboard-shell { width: min(1160px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 0 5rem; }
.dashboard-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.dashboard-title-row h1 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 2.7rem); }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.segmented { display: inline-flex; gap: .2rem; padding: .25rem; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.segmented button { min-height: 38px; padding: .45rem .8rem; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: .86rem; font-weight: 750; cursor: pointer; }
.segmented button.active { color: var(--blue-dark); background: var(--blue-soft); }
.search-field input { width: 220px; min-height: 44px; padding: .6rem .85rem .6rem 2.45rem; border: 1px solid var(--line); border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2368758b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat .8rem center; }
.walls-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.wall-card {
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.wall-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.wall-card-cover { min-height: 112px; padding: 1rem; display: flex; align-items: flex-end; background: var(--cover, #dcecff); }
.wall-card-cover::after { content: ""; position: absolute; inset: 0 0 auto; height: 112px; background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1px); background-size: 16px 16px; opacity: .35; }
.wall-card-code { position: relative; z-index: 1; padding: .3rem .55rem; border-radius: 999px; color: rgba(17, 36, 67, .78); background: rgba(255,255,255,.78); font-size: .72rem; font-weight: 850; letter-spacing: .06em; }
.wall-card-body { flex: 1; display: flex; flex-direction: column; padding: 1rem; }
.wall-card-body h2 { margin-bottom: .35rem; font-size: 1.08rem; }
.wall-card-body p { margin: 0; color: var(--muted); font-size: .83rem; }
.wall-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: 1rem; }
.wall-card-status { display: inline-flex; align-items: center; gap: .35rem; color: var(--green); font-size: .76rem; font-weight: 750; }
.wall-card-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.wall-card-status.suspended { color: #b54747; }
.wall-card-actions { position: absolute; z-index: 2; top: .65rem; right: .65rem; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; color: var(--navy); background: rgba(255,255,255,.88); cursor: pointer; }
.wall-card-open { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.wall-card-open span { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.wall-card-actions, .wall-card-body > *, .wall-card-cover > * { pointer-events: auto; }
.wall-card-body, .wall-card-cover { pointer-events: none; }
.empty-state { grid-column: 1 / -1; padding: 4rem 1rem; color: var(--muted); text-align: center; border: 1px dashed #b8c9dc; border-radius: var(--radius); background: #fff; }
.empty-state svg { width: 38px; height: 38px; margin-bottom: .7rem; color: var(--blue); }

/* Éditeur */
.editor-view { height: 100dvh; min-height: 100dvh; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); overflow: hidden; background: #eef3fa; }
.editor-header { position: relative; z-index: 20; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 1rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.editor-header-left, .editor-header-actions { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.editor-title-block { min-width: 0; }
.editable-title { max-width: min(45vw, 520px); display: flex; align-items: center; gap: .4rem; padding: 0; border: 0; color: var(--navy); background: none; font-size: 1.05rem; font-weight: 850; cursor: pointer; }
.editable-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editable-title svg { width: 16px; height: 16px; color: var(--muted); }
.editor-meta { display: flex; align-items: center; gap: .38rem; margin-top: .08rem; color: var(--muted); font-size: .72rem; }
.editor-meta span:first-child { color: var(--blue-dark); font-weight: 850; letter-spacing: .06em; }
.preview-banner { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .35rem 1rem; color: #744200; border-bottom: 1px solid #f1d697; background: #fff5dc; font-size: .88rem; font-weight: 780; }
.tabs-bar { position: relative; z-index: 12; min-height: 55px; display: flex; align-items: stretch; gap: .3rem; padding: 0 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.tabs-list { min-width: 0; display: flex; align-items: stretch; gap: .15rem; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.tab-button { position: relative; min-width: max-content; min-height: 54px; display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .9rem; border: 0; color: var(--muted); background: transparent; font-size: .88rem; font-weight: 760; cursor: pointer; }
.tab-button::after { content: ""; position: absolute; right: .6rem; bottom: 0; left: .6rem; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.tab-button.active { color: var(--navy); }
.tab-button.active::after { background: var(--tab-accent, var(--blue)); }
.tab-button .tab-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--tab-accent, var(--blue)); }
.add-tab-button { min-height: 44px; align-self: center; display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 11px; color: var(--blue-dark); background: var(--surface); font-size: .82rem; font-weight: 780; cursor: pointer; }
.add-tab-button svg { width: 17px; height: 17px; }
.workspace { position: relative; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.workspace.readonly { grid-template-rows: minmax(0, 1fr); }
.editor-toolbar { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .65rem 1rem; border-bottom: 1px solid rgba(162, 181, 204, .55); background: rgba(246,249,253,.94); backdrop-filter: blur(10px); }
.toolbar-main { min-width: 0; display: flex; align-items: center; gap: .45rem; }
.tool-button { min-height: 48px; display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.tool-button > svg { color: var(--blue); }
.tool-button span { display: grid; text-align: left; }
.tool-button small { color: var(--muted); font-size: .65rem; line-height: 1.15; }
.tool-button strong { max-width: 150px; overflow: hidden; color: var(--text); font-size: .78rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.wall-canvas {
  --canvas-bg: #dcecff;
  min-height: 100%;
  overflow: auto;
  padding: clamp(1rem, 2.6vw, 2rem);
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  background-color: var(--canvas-bg);
  background-image: var(--canvas-image, none);
  background-position: center;
  background-size: cover;
  background-attachment: local;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
}
.wall-canvas::before { content: ""; position: absolute; pointer-events: none; }
.layout-surface { width: min(1380px, 100%); min-height: 100%; margin: 0 auto; }
.canvas-zoom-target { transform-origin: 0 0; }
.canvas-zoom-controls {
  position: absolute;
  z-index: 18;
  left: max(1rem, env(safe-area-inset-left));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem;
  border: 1px solid rgba(164,181,204,.78);
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 24px rgba(26,48,78,.18);
  backdrop-filter: blur(10px);
}
.canvas-zoom-controls[hidden] { display: none; }
.canvas-zoom-controls button, .canvas-zoom-controls output {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 .55rem;
  border: 0;
  border-radius: 10px;
  color: #34445d;
  background: transparent;
  font: inherit;
  font-size: .84rem;
  font-weight: 820;
}
.canvas-zoom-controls button { cursor: pointer; }
.canvas-zoom-controls button:hover, .canvas-zoom-controls button.active { color: var(--blue-dark); background: #eaf2ff; }
.canvas-zoom-controls button:disabled { opacity: .38; cursor: default; }
.canvas-zoom-controls output { min-width: 58px; color: var(--blue-dark); background: #f3f7fc; font-size: .76rem; }
.canvas-zoom-controls .zoom-text-button { min-width: auto; display: inline-flex; gap: .4rem; }
.canvas-zoom-controls .zoom-map-button { min-width: 42px; }
.canvas-zoom-controls svg { width: 18px; height: 18px; }
.canvas-minimap {
  position: absolute;
  z-index: 17;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(4.85rem + env(safe-area-inset-bottom));
  width: 220px;
  height: 138px;
  overflow: hidden;
  border: 1px solid rgba(154,173,199,.9);
  border-radius: 13px;
  background: rgba(245,248,252,.94);
  box-shadow: 0 8px 24px rgba(26,48,78,.18);
  cursor: crosshair;
  backdrop-filter: blur(8px);
}
.canvas-minimap[hidden] { display: none; }
.canvas-minimap svg { width: 100%; height: 100%; display: block; }
.minimap-card { fill: #7fa7df; stroke: #fff; stroke-width: 8; vector-effect: non-scaling-stroke; }
.minimap-viewport { fill: rgba(23,105,224,.1); stroke: #1769e0; stroke-width: 3; vector-effect: non-scaling-stroke; }
.wall-canvas.zoom-overview .post-author-row,
.wall-canvas.zoom-overview .post-card p,
.wall-canvas.zoom-overview .post-engagement,
.wall-canvas.zoom-overview .provider-label { display: none; }
.wall-canvas.zoom-overview .post-card h3 { margin: .35rem 0; }
.wall-canvas.zoom-overview .post-card-meta:empty { display: none; }

/* Publications */
.post-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(181, 198, 220, .82);
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 16px rgba(34, 65, 104, .1);
  break-inside: avoid;
}
.post-card[data-card-open-post] { cursor: pointer; }
.post-card-text { cursor: pointer; }
.post-card + .post-card { margin-top: .8rem; }
.post-card-accent { height: 5px; background: var(--post-color, var(--blue)); }
.post-card-body { padding: .95rem; }
.post-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.post-type-icon { width: 34px; height: 34px; display: grid; flex: none; place-items: center; border-radius: 10px; color: var(--post-color, var(--blue)); background: color-mix(in srgb, var(--post-color, var(--blue)) 11%, white); }
.post-type-icon svg { width: 18px; height: 18px; }
.post-card h3 { margin: .72rem 0 .35rem; font-size: 1rem; }
.post-card p { margin: 0; color: #5e6c81; font-size: .84rem; white-space: pre-line; }
.post-card-media { min-height: 126px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--post-color, #1769e0), color-mix(in srgb, var(--post-color, #1769e0) 64%, #17233c)); }
.post-card-media svg { width: 42px; height: 42px; opacity: .9; }
.post-card-image { width: 100%; max-height: 260px; display: block; object-fit: cover; background: #eef3f8; }
.post-card-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: .75rem; color: var(--blue-dark); font-size: .82rem; font-weight: 780; text-decoration: none; }
.post-card-link svg { width: 15px; height: 15px; }
.post-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .8rem; padding-top: .65rem; border-top: 1px solid #edf1f6; color: #7b8798; font-size: .7rem; }
.post-menu-button { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.post-menu-button:hover { background: var(--surface-2); }
.post-menu-button svg { width: 18px; height: 18px; }
.moderation-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .23rem .45rem; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: .68rem; font-weight: 780; }

/* Dispositions */
.layout-wall { columns: 4 250px; column-gap: .9rem; }
.layout-wall .post-card { width: 100%; display: inline-block; margin: 0 0 .9rem; }
.layout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: .9rem; align-items: stretch; }
.layout-grid .post-card { display: flex; flex-direction: column; margin: 0; }
.layout-grid .post-card-body { flex: 1; display: flex; flex-direction: column; }
.layout-grid .post-card-meta { margin-top: auto; }
.layout-columns { display: grid; grid-auto-columns: minmax(280px, 1fr); grid-auto-flow: column; gap: .9rem; align-items: start; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x proximity; }
.column-lane { min-width: 0; padding: .75rem; border: 1px solid rgba(161, 183, 210, .68); border-radius: 17px; background: rgba(244, 248, 253, .78); scroll-snap-align: start; backdrop-filter: blur(6px); }
.column-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; padding: .1rem .15rem; }
.column-header h2 { margin: 0; font-size: .94rem; }
.column-count { min-width: 26px; padding: .2rem .4rem; border-radius: 999px; color: var(--muted); background: #fff; font-size: .7rem; font-weight: 750; text-align: center; }
.column-add { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: .35rem; margin-top: .7rem; border: 1px dashed #9eb5d1; border-radius: 11px; color: var(--blue-dark); background: rgba(255,255,255,.72); font-size: .8rem; font-weight: 750; cursor: pointer; }
.column-add svg { width: 16px; height: 16px; }
.layout-rows { display: grid; gap: .75rem; }
.layout-rows .post-card { display: grid; grid-template-columns: 5px minmax(0, 1fr); margin: 0; }
.layout-rows .post-card-accent { width: 5px; height: 100%; }
.layout-rows .post-card-body { display: grid; grid-template-columns: auto minmax(170px, .7fr) minmax(240px, 1.3fr) auto; align-items: center; gap: .9rem; padding: .8rem 1rem; }
.layout-rows .post-card h3 { margin: 0; }
.layout-rows .post-card p { margin: 0; }
.layout-rows .post-card-meta { margin: 0; padding: 0; border: 0; }
.layout-stream { width: min(720px, 100%); display: grid; gap: 1rem; margin: 0 auto; }
.layout-stream .post-card { margin: 0; }
.stream-date { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 -.05rem; color: #43526a; }
.stream-date::before { content: none; }
.stream-date::after { content: ""; height: 1px; min-width: 34px; flex: 1; background: rgba(93, 116, 147, .35); }
.stream-date time { padding: .3rem .52rem; border-radius: 999px; color: #fff; background: #43526a; font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .035em; }
.stream-date strong { font-size: .85rem; font-weight: 850; }
.layout-table-wrap { overflow: auto; border: 1px solid rgba(170, 190, 214, .76); border-radius: 17px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-sm); }
.layout-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.layout-table caption { padding: 1rem; color: var(--navy); font-weight: 850; text-align: left; }
.layout-table th { padding: .75rem 1rem; color: #526179; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f6f9fd; font-size: .76rem; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.layout-table td { padding: .85rem 1rem; border-bottom: 1px solid #e9eef5; vertical-align: middle; font-size: .86rem; }
.layout-table tr:last-child td { border-bottom: 0; }
.table-resource { display: flex; align-items: center; gap: .65rem; min-width: 220px; font-weight: 760; color: var(--navy); }
.table-actions { width: 50px; text-align: right; }
.type-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .5rem; border-radius: 999px; color: #43526a; background: #edf3fa; font-size: .72rem; font-weight: 750; }
.wall-canvas[data-layout="mindmap"] { padding: 0; overscroll-behavior: contain; }
.mindmap-surface {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(88, 111, 141, .085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 111, 141, .085) 1px, transparent 1px);
  background-size: 28px 28px;
}
.mindmap-help {
  position: sticky;
  z-index: 8;
  top: 12px;
  left: 12px;
  width: max-content;
  max-width: calc(100vw - 24px);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 12px;
  padding: .48rem .65rem;
  border: 1px solid rgba(183, 197, 215, .82);
  border-radius: 11px;
  color: #4f5d72;
  background: rgba(255,255,255,.9);
  box-shadow: 0 5px 15px rgba(32,55,84,.1);
  backdrop-filter: blur(8px);
  font-size: .74rem;
  pointer-events: none;
}
.mindmap-help svg { width: 17px; height: 17px; flex: none; }
.mindmap-help strong { margin-left: .25rem; padding-left: .55rem; border-left: 1px solid #d8e0ea; color: #6b778a; white-space: nowrap; }
.mindmap-links { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mindmap-link-visible { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.mindmap-link-visible.dashed { stroke-dasharray: 11 9; }
.mindmap-link-hit { fill: none; stroke: transparent; stroke-width: 20; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: pointer; }
.mindmap-link-hit:focus { stroke: rgba(23,105,224,.2); outline: none; }
.mindmap-cards { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.mindmap-card-shell { position: absolute; width: 300px; pointer-events: auto; }
.mindmap-card-shell .post-card { width: 100%; margin: 0; box-shadow: 0 8px 24px rgba(30,52,82,.16); }
.mindmap-card-shell.moving { z-index: 6; filter: drop-shadow(0 16px 24px rgba(28,49,77,.22)); }
.mindmap-card-shell.moving .post-card { outline: 3px solid rgba(23,105,224,.28); outline-offset: 3px; }
.mindmap-move-handle {
  position: absolute;
  z-index: 7;
  top: -15px;
  left: 50%;
  width: 48px;
  height: 29px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #c4d0df;
  border-radius: 999px;
  color: #66758a;
  background: rgba(255,255,255,.96);
  box-shadow: 0 4px 11px rgba(31,51,78,.15);
  transform: translateX(-50%);
  cursor: grab;
  touch-action: none;
}
.mindmap-move-handle:hover { color: var(--blue); border-color: #9cb9df; }
.mindmap-move-handle:active { cursor: grabbing; }
.mindmap-move-handle svg { width: 19px; height: 19px; }
.mindmap-connections-block { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mindmap-connections-block h3 { margin: 0 0 .7rem; color: var(--navy); font-size: .92rem; }
.mindmap-connections-list { display: grid; gap: .55rem; }
.mindmap-connections-empty { margin: 0; padding: .8rem; border-radius: 10px; color: var(--muted); background: #f6f8fb; font-size: .82rem; }
.mindmap-connection-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .65rem; border: 1px solid var(--line); border-radius: 11px; }
.mindmap-connection-row > span:nth-child(2) { min-width: 0; display: grid; gap: .15rem; }
.mindmap-connection-row strong { overflow: hidden; color: #34445d; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.mindmap-connection-row small { color: #7a8798; font-size: .7rem; }
.mindmap-line-swatch { position: relative; height: 0; border-top: 3px solid var(--link-color, #64748b); }
.mindmap-line-swatch.dashed { border-top-style: dashed; }
.mindmap-line-swatch::after { content: ""; position: absolute; top: -6px; right: -1px; border-width: 4px 0 4px 7px; border-style: solid; border-color: transparent transparent transparent var(--link-color, #64748b); }
.mindmap-line-swatch.bidirectional::before { content: ""; position: absolute; top: -6px; left: -1px; border-width: 4px 7px 4px 0; border-style: solid; border-color: transparent var(--link-color, #64748b) transparent transparent; }
.mindmap-link-preview { display: grid; grid-template-columns: minmax(80px, .45fr) minmax(0, 1fr); align-items: center; gap: .8rem; padding: .9rem; border-radius: 12px; background: #f5f8fc; }
.mindmap-link-preview > span { position: relative; height: 0; border-top: 4px solid var(--link-color, #64748b); }
.mindmap-link-preview.dashed > span { border-top-style: dashed; }
.mindmap-link-preview > span::after { content: ""; position: absolute; top: -7px; right: -1px; border-width: 5px 0 5px 9px; border-style: solid; border-color: transparent transparent transparent var(--link-color, #64748b); }
.mindmap-link-preview.bidirectional > span::before { content: ""; position: absolute; top: -7px; left: -1px; border-width: 5px 9px 5px 0; border-style: solid; border-color: transparent var(--link-color, #64748b) transparent transparent; }
.mindmap-link-preview strong { overflow: hidden; color: #34445d; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.mindmap-link-modal .modal-footer { flex-wrap: wrap; }
.mindmap-link-modal #deleteMindmapLink { margin-right: auto; }
.floating-add {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 28px rgba(23, 105, 224, .3);
  font-weight: 800;
  cursor: pointer;
}
.floating-add svg { width: 20px; height: 20px; }

/* Modales et formulaires */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(17, 31, 54, .48); backdrop-filter: blur(5px); animation: fade-in .15s ease; }
.modal { width: min(620px, 100%); max-height: min(88dvh, 850px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 22px; background: #fff; box-shadow: 0 26px 70px rgba(14, 34, 65, .3); animation: rise .18s ease; }
.modal.wide { width: min(820px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.3rem .9rem; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 1.35rem; }
.modal-header .eyebrow { margin-bottom: .3rem; font-size: .68rem; }
.modal-body { overflow: auto; padding: 1.2rem 1.3rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; padding: .9rem 1.3rem; border-top: 1px solid var(--line); background: #fafcff; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-field { display: grid; gap: .4rem; }
.form-field > span, .form-field > label { color: #43526a; font-size: .82rem; font-weight: 800; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  min-height: 46px;
  padding: .65rem .75rem;
  border: 1px solid #c7d5e5;
  border-radius: 11px;
  color: var(--text);
  background: #fff;
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--blue); outline: 3px solid rgba(23,105,224,.11); }
.form-hint { margin: -.2rem 0 0; color: var(--muted); font-size: .75rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.choice-card { position: relative; min-height: 102px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: .75rem; padding: .8rem; border: 2px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; }
.choice-card:hover { border-color: #a9c9f3; }
.choice-card.selected { border-color: var(--blue); background: var(--blue-soft); }
.choice-card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: #edf4ff; }
.choice-card-icon svg { width: 23px; height: 23px; }
.choice-card strong { display: block; color: var(--navy); font-size: .9rem; }
.choice-card small { display: block; margin-top: .15rem; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.layout-thumbnail { width: 42px; height: 42px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 6px; border-radius: 10px; color: var(--blue); background: #e7f1ff; }
.layout-thumbnail span { border-radius: 2px; background: currentColor; opacity: .72; }
.layout-thumbnail.columns { grid-template-columns: repeat(3, 1fr); }
.layout-thumbnail.columns-subcategories { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.layout-thumbnail.grid { grid-template-columns: repeat(2, 1fr); }
.layout-thumbnail.table { grid-template-columns: 1fr; grid-template-rows: repeat(4, 1fr); }
.layout-thumbnail.rows { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); }
.layout-thumbnail.stream { grid-template-columns: 1fr; grid-template-rows: 1fr 1.6fr 1fr; }
.layout-thumbnail.mindmap { display: flex; align-items: center; gap: 4px; }
.layout-thumbnail.mindmap span:nth-child(2) { height: 3px; flex: 1; }
.layout-thumbnail.mindmap span:first-child, .layout-thumbnail.mindmap span:last-child { width: 12px; height: 20px; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: .65rem; }
.swatch { aspect-ratio: 1.25; position: relative; border: 3px solid transparent; border-radius: 13px; background: var(--swatch); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(24,48,83,.08); }
.swatch.selected { border-color: #fff; outline: 3px solid var(--blue); }
.swatch.selected::after { content: "✓"; position: absolute; right: .35rem; bottom: .25rem; width: 22px; height: 22px; display: grid; place-items: center; color: white; border-radius: 50%; background: var(--blue); font-size: .75rem; font-weight: 900; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid #edf1f6; }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; color: var(--navy); font-size: .9rem; }
.switch-row small { display: block; margin-top: .12rem; color: var(--muted); font-size: .75rem; }
.switch { width: 48px; height: 28px; position: relative; flex: none; border: 0; border-radius: 999px; background: #c8d2df; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(20px); }
.share-code-box { display: grid; grid-template-columns: 1fr auto; gap: .65rem; padding: .9rem; border: 1px solid #c9dcf6; border-radius: 14px; background: var(--blue-soft); }
.share-code-value { display: grid; gap: .15rem; }
.share-code-value small { color: var(--muted); font-size: .7rem; }
.share-code-value strong { color: var(--blue-dark); font-size: 1.35rem; letter-spacing: .12em; }
.share-settings { display: grid; gap: 1rem; }
.share-panel { padding: .1rem 1rem 1rem; border: 1px solid var(--line); border-radius: 15px; background: #fbfdff; }
.share-panel .separator-label:first-child { margin-top: .9rem; }
.share-access { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.share-option { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .55rem; padding: .72rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.share-option:has(input:checked) { border-color: #84b3f1; background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(23,105,224,.08); }
.share-option input { width: 18px; height: 18px; margin: .12rem 0 0; accent-color: var(--blue); }
.share-option strong, .share-option small, .class-option strong, .class-option small { display: block; }
.share-option strong, .class-option strong { color: var(--navy); }
.share-option small, .class-option small { margin-top: .12rem; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.share-link { display: flex; gap: .5rem; margin-top: .8rem; }
.share-link input { min-width: 0; flex: 1; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; color: #526179; background: #f8fafd; font-size: .78rem; }
.class-list { display: grid; gap: .5rem; margin-top: .75rem; }
.class-option { display: flex; align-items: center; gap: .65rem; padding: .7rem; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.class-option input { width: 19px; height: 19px; accent-color: var(--blue); }
.class-option strong { font-size: .86rem; }
.share-empty { margin: 0; padding: .75rem; color: var(--muted); border-radius: 10px; background: #f2f6fb; font-size: .8rem; }
.embed-code { min-height: 86px !important; color: #526179 !important; background: #f8fafd !important; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .73rem; }
.form-error { color: var(--danger) !important; font-weight: 700; }
.button:disabled { cursor: wait; opacity: .68; transform: none; }
.separator-label { display: flex; align-items: center; gap: .55rem; margin: 1.2rem 0 .65rem; color: #43526a; font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.separator-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.notice { display: flex; gap: .65rem; padding: .75rem; border-radius: 11px; color: #526179; background: #f2f6fb; font-size: .78rem; }
.notice svg { flex: none; color: var(--blue); }
.login-logo { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.login-logo .brand-mark { width: 42px; height: 42px; }
.login-logo strong { color: var(--navy); }
.profile-menu { position: fixed; z-index: 90; top: 66px; right: max(1rem, calc((100vw - 1160px) / 2)); width: min(280px, calc(100vw - 2rem)); overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.profile-menu-header { padding: .9rem; border-bottom: 1px solid var(--line); }
.profile-menu-header strong, .profile-menu-header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-header small { margin-top: .2rem; color: var(--muted); }
.profile-menu button { width: 100%; min-height: 46px; display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; border: 0; background: #fff; text-align: left; cursor: pointer; }
.profile-menu button:hover { background: var(--surface-2); }

.toast-region { position: fixed; z-index: 200; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); display: grid; gap: .5rem; pointer-events: none; }
.toast { min-width: min(340px, calc(100vw - 2rem)); display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: #fff; box-shadow: var(--shadow); font-size: .83rem; font-weight: 720; animation: rise .18s ease; }
.toast svg { color: var(--green); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }

@media (max-width: 950px) {
  .walls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-rows .post-card-body { grid-template-columns: auto minmax(150px, .7fr) minmax(200px, 1.3fr); }
  .layout-rows .post-card-meta { display: none; }
}

@media (max-width: 760px) {
  :root { --radius-lg: 21px; }
  .home-header { min-height: 68px; }
  .home-shell { align-content: start; gap: 1.4rem; padding-top: 2.2rem; }
  .home-heading { text-align: left; }
  .home-heading h1 { font-size: 2.25rem; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { gap: 1rem; }
  .dashboard-shell { padding-top: 2rem; }
  .profile-button > span:nth-child(2), .profile-button .chevron { display: none; }
  .dashboard-title-row { align-items: center; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .segmented { overflow-x: auto; }
  .segmented button { flex: 1; white-space: nowrap; }
  .search-field input { width: 100%; }
  .editor-header { min-height: 62px; padding: .45rem .55rem; }
  .editor-header-actions { gap: .25rem; }
  .editor-header-actions .button span { display: none; }
  .editor-header-actions .button { width: 42px; padding: 0; }
  .editable-title { max-width: 48vw; font-size: .95rem; }
  .editor-meta span:last-child { display: none; }
  .tabs-bar { min-height: 52px; padding: 0 .55rem; }
  .tab-button { min-height: 51px; padding-inline: .7rem; }
  .add-tab-button span { display: none; }
  .add-tab-button { width: 40px; justify-content: center; padding: 0; }
  .editor-toolbar { align-items: stretch; flex-direction: column; padding: .55rem; }
  .toolbar-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-button { min-width: 0; justify-content: center; padding: .4rem; }
  .tool-button > svg { width: 19px; height: 19px; }
  .tool-button span { min-width: 0; }
  .tool-button small { display: none; }
  .tool-button strong { max-width: 100%; font-size: .72rem; }
  .add-resource { width: 100%; }
  .wall-canvas { padding: .8rem; padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  .layout-columns { grid-auto-columns: minmax(86vw, 1fr); scroll-snap-type: x mandatory; }
  .layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-rows .post-card-body { grid-template-columns: auto 1fr auto; gap: .65rem; }
  .layout-rows .post-card-body > p { grid-column: 2 / -1; }
  .layout-rows .post-card-meta { display: none; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 93dvh; border-radius: 22px 22px 0 0; }
  .modal.wide { width: 100%; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .share-access { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .home-header, .home-shell { width: min(100% - 1.2rem, 940px); }
  .home-header .brand { font-size: 1rem; }
  .network-label { display: none; }
  .network-badge { width: 34px; justify-content: center; padding: 0; }
  .entry-card { padding: 1.15rem; }
  .code-row { grid-template-columns: 1fr; }
  .code-row .button { width: 100%; }
  .app-header { padding-inline: .7rem; }
  .app-header .brand > span:last-child { display: none; }
  .sync-pill span { display: none; }
  .sync-pill { width: 36px; justify-content: center; padding: 0; }
  .dashboard-shell { width: calc(100% - 1.2rem); }
  .dashboard-title-row { align-items: flex-start; }
  .dashboard-title-row .button { width: 46px; padding: 0; font-size: 0; }
  .dashboard-title-row .button svg { width: 21px; height: 21px; }
  .walls-grid { grid-template-columns: 1fr; }
  .wall-card { min-height: 238px; }
  .editor-title-block { max-width: calc(100vw - 220px); }
  .editable-title { max-width: 100%; }
  .editor-header-actions .button.ghost { display: none; }
  .preview-banner { justify-content: space-between; }
  .layout-grid { grid-template-columns: 1fr; }
  .layout-wall { columns: 1; }
  .layout-rows .post-card-body { grid-template-columns: auto 1fr auto; }
  .layout-rows .post-card-body > p { grid-column: 1 / -1; }
  .choice-grid { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .modal-header, .modal-body, .modal-footer { padding-inline: 1rem; }
  .modal-footer .button { flex: 1; }
  .share-code-box { grid-template-columns: 1fr; }
  .share-code-box .button { width: 100%; }
  .share-link { flex-direction: column; }
  .floating-add { right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .floating-add span { display: none; }
  .floating-add { width: 52px; padding: 0; justify-content: center; border-radius: 50%; }
}

/* ------------------------------------------------------------------
   V2 — surface plein écran et publications multimédias
   ------------------------------------------------------------------ */
.editor-header { grid-row: 1; }
.preview-banner { grid-row: 2; }
.tabs-bar { grid-row: 3; }
.workspace { grid-row: 4; }
.wall-canvas { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.layout-surface { width: 100%; max-width: none; min-height: 100%; margin: 0; }
.canvas-empty { width: min(560px, 100%); margin: 0 auto; }

.post-card {
  min-width: 0;
  border-color: rgba(151, 174, 204, .72);
  border-radius: 16px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 6px 18px rgba(30, 60, 100, .11);
}
.post-card.dragging { opacity: .48; transform: scale(.985); }
.post-card.drag-over { outline: 3px solid rgba(23,105,224,.42); outline-offset: 3px; }
.post-card-accent { height: 4px; }
.post-cover-button {
  width: 100%;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: white;
  background: #e8eef6;
  cursor: pointer;
}
.post-card-media-wrap { position: relative; overflow: hidden; background: #e8eef6; }
.card-carousel-controls {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  left: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  pointer-events: none;
}
.card-carousel-controls button, .card-carousel-controls span {
  color: #fff;
  background: rgba(16,27,45,.72);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.card-carousel-controls button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.card-carousel-controls span { padding: .25rem .4rem; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.card-carousel-controls svg { width: 17px; height: 17px; }
.post-cover-button.post-card-media { min-height: 150px; }
.post-cover-button.image-unavailable { min-height: 150px; background: linear-gradient(135deg, var(--post-color, #1769e0), #243651); }
.image-fallback-icon { display: grid; place-items: center; }
.image-fallback-icon svg { width: 42px; height: 42px; }
.post-card-image { width: 100%; height: auto; max-height: 310px; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card-image.custom-cover-image,
.post-card-image.document-cover-image,
.post-card-image.publication-image { object-fit: contain; background: #f7f9fc; }
.post-card-image.document-cover-image { padding: .35rem; }
.post-card-image.publication-image.is-portrait { max-height: 420px; aspect-ratio: 4 / 5; }
.media-type-badge {
  position: absolute;
  top: .6rem;
  right: .65rem;
  padding: .3rem .5rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(20,32,51,.78);
  backdrop-filter: blur(6px);
  font-size: .69rem;
  font-weight: 850;
}
.media-play {
  position: absolute;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(18,29,48,.78);
  box-shadow: 0 7px 18px rgba(0,0,0,.25);
}
.media-play svg { width: 25px; height: 25px; margin-left: 2px; }
.media-count {
  position: absolute;
  right: .65rem;
  bottom: .6rem;
  padding: .28rem .5rem;
  border-radius: 999px;
  color: white;
  background: rgba(20,32,51,.75);
  font-size: .75rem;
  font-weight: 800;
}
.post-card-body { padding: .8rem .85rem .7rem; }
.post-author-row { display: flex; align-items: center; gap: .5rem; min-height: 38px; }
.post-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  flex: none;
  place-items: center;
  border-radius: 10px;
  color: var(--post-color, var(--blue));
  background: color-mix(in srgb, var(--post-color, var(--blue)) 13%, white);
  font-size: .72rem;
  font-weight: 900;
}
.post-author-meta { min-width: 0; display: grid; margin-right: auto; line-height: 1.2; }
.post-author-meta strong { overflow: hidden; color: #33425a; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.post-author-meta small { margin-top: .15rem; color: #7a8798; font-size: .68rem; }
.drag-handle { display: grid; place-items: center; color: #8390a2; cursor: grab; }
.drag-handle svg { width: 18px; height: 18px; }
.post-title-button {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.post-title-button h3 { margin: .65rem 0 .28rem; font-size: 1rem; }
.provider-label {
  width: max-content;
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  margin: 0 0 .4rem;
  padding: .18rem .38rem;
  border-radius: 6px;
  color: #526179;
  background: #eef2f7;
  font-size: .69rem;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-card-body > p { font-size: .82rem; line-height: 1.45; }
.post-card-meta { min-height: 35px; margin-top: .7rem; padding-top: .52rem; }
.post-engagement { display: flex; align-items: center; gap: .3rem; }
.post-engagement button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .4rem;
  border: 0;
  border-radius: 9px;
  color: #5d6b80;
  background: transparent;
  font-size: .75rem;
  cursor: pointer;
}
.post-engagement button:hover { background: #eef3f8; }
.post-engagement svg { width: 17px; height: 17px; }

/* Les cartes du mur utilisent toute la largeur disponible. */
.layout-wall { width: 100%; columns: 280px auto; column-gap: 1rem; }
.layout-wall .post-card { display: inline-block; width: 100%; margin: 0 0 1rem; }
/* V3.7.1 — une grille ne doit pas étirer une publication unique sur toute la largeur. */
.layout-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 360px));
  justify-content: start;
}

/* Colonnes : la surface grandit et le défilement se fait au niveau du mur. */
.layout-columns {
  width: max-content;
  min-width: 100%;
  display: grid;
  grid-auto-columns: minmax(290px, 360px);
  grid-auto-flow: column;
  align-items: start;
  gap: 1rem;
  overflow: visible;
  padding-bottom: 1rem;
}
.column-lane {
  min-height: 180px;
  padding: .7rem;
  border-radius: 18px;
  background: rgba(247,250,254,.84);
}
.column-posts { display: grid; gap: .75rem; }
.column-posts .post-card { margin: 0; }
.section-header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .65rem; padding: .1rem .15rem; }
.section-header h2 { margin: 0; font-size: 1rem; }
.section-header > div { display: flex; align-items: center; gap: .25rem; }
.section-action {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.78);
  cursor: pointer;
}
.section-action:hover { background: #fff; }
.section-action svg { width: 18px; height: 18px; }
.add-section-card {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem;
  border: 2px dashed rgba(85,117,158,.4);
  border-radius: 17px;
  color: var(--blue-dark);
  background: rgba(255,255,255,.58);
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}
.add-section-card svg { width: 20px; height: 20px; }

/* Lignes : sections l’une sous l’autre, cartes dans chaque bande. */
.layout-row-sections { display: grid; align-content: start; gap: 1.25rem; }
.row-section {
  min-width: 0;
  padding: .8rem;
  border: 1px solid rgba(144,169,201,.55);
  border-radius: 18px;
  background: rgba(255,255,255,.48);
}
.row-section-header { margin-bottom: .7rem; }
.row-section-posts {
  min-width: 0;
  display: grid;
  grid-auto-columns: minmax(270px, 340px);
  grid-auto-flow: column;
  align-items: start;
  gap: .8rem;
  overflow-x: auto;
  padding: .15rem .1rem .55rem;
  scroll-snap-type: x proximity;
}
.row-section-posts .post-card { margin: 0; scroll-snap-align: start; }
.section-empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  padding: 1rem;
  border: 1px dashed rgba(90,120,160,.38);
  border-radius: 13px;
  color: #66758a;
  background: rgba(255,255,255,.5);
  font-size: .84rem;
}
.add-row-section {
  width: max-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem .9rem;
  border: 1px dashed #7898bf;
  border-radius: 12px;
  color: var(--blue-dark);
  background: rgba(255,255,255,.72);
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
}

/* Tableau croisé : une ou plusieurs cartes dans chaque cellule. */
.layout-table-wrap { width: max-content; min-width: 100%; overflow: visible; }
.matrix-table { width: max-content; min-width: 100%; table-layout: fixed; }
.matrix-table th, .matrix-table td { min-width: 270px; padding: .65rem; border: 1px solid #dbe4f0; vertical-align: top; }
.matrix-table th {
  background: var(--matrix-header-bg, #eef3fb);
  color: var(--matrix-header-color, #43526a);
}
.matrix-table .matrix-corner, .matrix-table .matrix-row-title {
  min-width: 150px;
  width: 150px;
  background: var(--matrix-header-bg, #f1f6fc);
  color: var(--matrix-header-color, #43526a);
}
.matrix-table th button {
  color: inherit;
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .45rem;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font-size: .8rem;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}
.matrix-table th button:hover { background: rgba(255,255,255,.18); }
.matrix-table th svg { width: 15px; height: 15px; }
.matrix-header-label {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .45rem;
  color: inherit;
  font-size: .8rem;
  font-weight: 850;
  text-align: center;
}
.matrix-cell {
  min-height: 140px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .6rem;
}
.matrix-cell .post-card { width: 250px; max-width: 100%; margin: 0 auto; }
.matrix-add {
  width: 250px;
  max-width: 100%;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px dashed #9db3ce;
  border-radius: 10px;
  color: var(--blue);
  background: #f8fbff;
  cursor: pointer;
}
.compact-card .post-card-image { max-height: 120px; }
.compact-card .post-author-row { min-height: 32px; }
.compact-card .post-avatar { width: 28px; height: 28px; }
.compact-card .post-card-meta { margin-top: .45rem; }

.layout-stream { width: min(760px, 100%); }

/* Éditeur d’une publication */
.publication-modal { width: min(1040px, calc(100vw - 2rem)); max-height: 94dvh; }
.publication-form { display: grid; gap: 1rem; }
.publication-author { width: min(420px, 100%); }
.publication-editor-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .8fr); gap: 1.2rem; }
.publication-main, .publication-assets { min-width: 0; display: grid; align-content: start; gap: 1rem; }
.rich-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .35rem;
  border: 1px solid #c7d5e5;
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
  background: #f6f9fd;
}
.rich-toolbar-group { display: inline-flex; align-items: center; gap: .16rem; padding-left: .28rem; border-left: 1px solid #d8e1ec; }
.rich-toolbar select { min-height: 36px; max-width: 128px; padding: .3rem 1.7rem .3rem .5rem; border: 0; border-radius: 8px; color: #34445d; background: #fff; font: inherit; font-size: .78rem; font-weight: 730; }
.rich-toolbar button {
  min-width: 38px;
  min-height: 36px;
  padding: .35rem .55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: .82rem;
  cursor: pointer;
}
.rich-toolbar button:hover { background: #e7eef7; }
.rich-toolbar button[title="Centrer"] { text-align: center; }
.rich-toolbar button[title="Aligner à droite"] { text-align: right; }
.rich-color { width: 38px; height: 36px; position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 8px; color: #34445d; background: transparent; font-weight: 850; cursor: pointer; }
.rich-color::after { content: ""; position: absolute; right: 7px; bottom: 5px; left: 7px; height: 3px; border-radius: 3px; background: var(--rich-color, #243550); }
.rich-color input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rich-editor {
  min-height: 185px;
  overflow: auto;
  padding: .8rem;
  border: 1px solid #c7d5e5;
  border-radius: 0 0 11px 11px;
  color: var(--text);
  background: #fff;
}
.rich-editor:empty::before { content: attr(data-placeholder); color: #8995a7; pointer-events: none; }
.rich-editor:focus { border-color: var(--blue); outline: 3px solid rgba(23,105,224,.11); }
.rich-editor h2, .rich-content h2 { margin: .75rem 0 .35rem; color: var(--navy); font-size: 1.3rem; line-height: 1.25; }
.rich-editor h3, .rich-content h3 { margin: .65rem 0 .3rem; color: var(--navy); font-size: 1.08rem; line-height: 1.3; }
.rich-editor blockquote, .rich-content blockquote { margin: .65rem 0; padding: .55rem .75rem; border-left: 4px solid #9cb9df; color: #50627b; background: #f4f7fb; }
.rich-editor ul, .rich-editor ol, .rich-content ul, .rich-content ol { padding-left: 1.5rem; }
.rich-editor a, .rich-content a { color: var(--blue-dark); text-decoration: underline; }
.link-input-wrap { position: relative; }
.link-input-wrap > svg { position: absolute; z-index: 1; top: 50%; left: .75rem; width: 18px; height: 18px; color: #6c7a8e; transform: translateY(-50%); }
.link-input-wrap input { padding-left: 2.4rem; }
.link-preview-card {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: .8rem;
  overflow: hidden;
  padding: .6rem;
  border: 1px solid #d5dfeb;
  border-radius: 13px;
  background: #f9fbfe;
}
.link-preview-card > img, .link-preview-fallback { width: 135px; height: 78px; display: grid; place-items: center; border-radius: 9px; object-fit: cover; color: white; background: linear-gradient(135deg, #1769e0, #624db2); }
.link-preview-card > div { min-width: 0; display: grid; align-content: center; }
.link-preview-card strong, .link-preview-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-preview-card strong { color: var(--navy); font-size: .9rem; }
.link-preview-card small { margin-top: .2rem; color: var(--muted); font-size: .75rem; }
.linked-wall-card { min-height: 150px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: .25rem; padding: 1rem; color: #102542; text-align: left; background-size: cover; }
.linked-wall-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 15%, rgba(255,255,255,.88)); pointer-events: none; }
.linked-wall-card > * { position: relative; z-index: 1; }
.linked-wall-card strong { font-size: 1rem; }
.linked-wall-card small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-wall-brand { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .45rem; border-radius: 999px; color: #fff; background: rgba(16,37,66,.72); font-size: .68rem; font-weight: 850; }
.linked-wall-brand svg, .linked-wall-cover svg { width: 16px; height: 16px; }
.linked-wall-editor-preview { grid-template-columns: 135px minmax(0, 1fr); }
.linked-wall-cover { width: 135px; height: 78px; display: grid; place-items: center; border-radius: 9px; color: #fff; background-size: cover; }
.wall-card-preview { display: grid; grid-template-columns: minmax(150px, .75fr) minmax(0, 1fr); align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.wall-card-preview .wall-card-cover { min-height: 130px; }
.wall-card-preview > div:last-child { display: grid; gap: .35rem; padding: 1rem; }
.wall-card-preview small { color: var(--muted); }
.wall-cover-palette { display: grid; grid-template-columns: repeat(10, minmax(30px, 1fr)); gap: .45rem; }
.wall-cover-palette button { aspect-ratio: 1; min-height: 34px; border: 2px solid #fff; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
@media (max-width: 860px) {
  .canvas-zoom-controls { max-width: calc(100% - 12.5rem); }
  .canvas-zoom-controls .zoom-text-button span { display: none; }
  .canvas-zoom-controls #zoomResetButton { display: none; }
}
@media (max-width: 620px) {
  .wall-card-preview { grid-template-columns: 1fr; }
  .wall-card-preview .wall-card-cover { min-height: 120px; }
  .wall-cover-palette { grid-template-columns: repeat(5, 1fr); }
  .linked-wall-editor-preview { grid-template-columns: 96px minmax(0, 1fr); }
  .linked-wall-cover { width: 96px; height: 72px; }
  .canvas-zoom-controls { left: .55rem; bottom: calc(.55rem + env(safe-area-inset-bottom)); max-width: calc(100% - 4.8rem); }
  .canvas-zoom-controls button, .canvas-zoom-controls output { min-width: 39px; height: 40px; padding-inline: .42rem; }
  .canvas-zoom-controls output { min-width: 52px; }
  .canvas-zoom-controls .zoom-text-button { min-width: 39px; font-size: .72rem; }
  .canvas-zoom-controls .zoom-text-button span { display: none; }
  .canvas-zoom-controls #zoomResetButton { display: none; }
  .canvas-minimap { left: .55rem; right: auto; bottom: calc(4.45rem + env(safe-area-inset-bottom)); width: 164px; height: 104px; }
}
.asset-block { display: grid; gap: .65rem; padding: .8rem; border: 1px solid #dbe4f0; border-radius: 14px; background: #f8fafd; }
.asset-heading { display: grid; }
.asset-heading strong { color: var(--navy); font-size: .86rem; }
.asset-heading small { color: var(--muted); font-size: .73rem; font-weight: 500; }
.asset-heading .quota-label { margin-top: .18rem; color: #426077; font-weight: 760; }
.asset-heading .quota-label.over-limit { color: var(--danger); }
.asset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.asset-upload {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem;
  border: 1px dashed #98b1d0;
  border-radius: 10px;
  color: var(--blue-dark);
  background: #fff;
  font-size: .75rem;
  font-weight: 780;
  text-align: center;
  cursor: pointer;
}
.asset-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.asset-upload svg { width: 18px; height: 18px; }
.compact-upload { width: 100%; }
.pending-media-list { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.media-empty { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .75rem; }
.pending-media-item { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 9px; background: #e8eef6; }
.pending-media-item img { width: 100%; height: 100%; object-fit: cover; }
.pending-media-item button, .pending-document button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--danger);
  background: rgba(255,255,255,.92);
  cursor: pointer;
}
.pending-media-item button { position: absolute; top: .3rem; right: .3rem; }
.pending-media-item button svg, .pending-document button svg { width: 16px; height: 16px; }
.pending-document { grid-column: 1 / -1; min-width: 0; display: flex; align-items: center; gap: .55rem; padding: .5rem; border-radius: 9px; background: #fff; }
.pending-document > img { width: 62px; height: 42px; flex: none; border-radius: 6px; object-fit: contain; background: #eef3f8; }
.pending-document > span { display: grid; color: var(--blue); }
.pending-document strong { min-width: 0; flex: 1; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.cover-placeholder { min-height: 82px; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem; border-radius: 10px; color: #6d7b8e; background: #edf2f8; font-size: .74rem; text-align: center; }
.cover-preview { position: relative; overflow: hidden; border-radius: 10px; background: #e8eef6; }
.cover-preview img { width: 100%; max-height: 155px; display: block; object-fit: cover; aspect-ratio: 16 / 9; }
.cover-preview img.custom-cover-image { object-fit: contain; background: #eef3f8; }
.cover-preview > span { position: absolute; top: .45rem; left: .45rem; padding: .25rem .4rem; border-radius: 7px; color: #fff; background: rgba(22,34,53,.72); font-size: .67rem; font-weight: 800; }
.cover-preview button { width: 100%; min-height: 36px; border: 0; color: var(--blue-dark); background: #fff; font-size: .72rem; font-weight: 780; cursor: pointer; }
.classification-block { gap: .75rem; }
.color-field input[type="color"] { min-height: 42px; padding: .25rem; cursor: pointer; }

/* Lecteur de publication */
.resource-viewer-backdrop { place-items: stretch; padding: 0; background: #fff; backdrop-filter: none; }
.modal.resource-viewer-modal { width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
.resource-viewer-modal .modal-body { min-height: 0; padding: 0; }
.resource-viewer-modal .modal-header { min-height: 58px; padding-block: .72rem; }
.resource-viewer-modal .modal-footer { display: none; }
.resource-detail-grid { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 20vw, 360px); }
.resource-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: #111827;
}
.video-frame { width: 100%; height: 100%; min-height: 0; }
.video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.detail-carousel { width: 100%; height: 100%; min-height: 360px; position: relative; display: grid; place-items: center; overflow: hidden; background: #0d1118; }
.detail-image-viewport { position: absolute; inset: 0; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 1rem; touch-action: none; }
.detail-image-viewport > img { width: auto; height: auto; max-width: 100%; max-height: 100%; display: block; object-fit: contain; transform-origin: center; transition: transform .12s ease-out; user-select: none; -webkit-user-drag: none; }
.detail-image-viewport.is-zoomed { cursor: grab; }
.detail-image-viewport.is-zoomed:active { cursor: grabbing; }
.detail-image-zoom { position: absolute; z-index: 5; bottom: 1rem; left: 1rem; display: flex; align-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; background: rgba(13,20,31,.84); box-shadow: 0 6px 20px rgba(0,0,0,.18); backdrop-filter: blur(8px); }
.detail-image-zoom button { min-width: 42px; height: 42px; padding: 0 .7rem; border: 0; color: #fff; background: transparent; font: inherit; font-weight: 850; cursor: pointer; }
.detail-image-zoom button + button { border-left: 1px solid rgba(255,255,255,.18); }
.detail-image-zoom [data-detail-zoom-reset] { min-width: 76px; font-size: .76rem; }
.carousel-controls { position: absolute; right: 1rem; bottom: 1rem; left: 1rem; display: flex; align-items: center; justify-content: center; gap: .7rem; pointer-events: none; }
.carousel-controls button, .carousel-controls span { color: #fff; background: rgba(13,20,31,.74); backdrop-filter: blur(7px); pointer-events: auto; }
.carousel-controls button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.carousel-controls span { padding: .35rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.document-viewer { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); padding: 0; }
.document-viewer iframe { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; }
.office-viewer { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; color: var(--text); background: #fff; }
.office-viewer iframe { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; }
.office-viewer p { margin: 0; padding: .48rem .75rem; border-top: 1px solid var(--line); color: #6d7b8e; background: #f8fafd; font-size: .72rem; text-align: center; }
.document-fallback-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .55rem; padding: .65rem; border-bottom: 1px solid var(--line); background: #f8fafd; }
.document-fallback-actions .button { width: auto; }
.document-placeholder .document-fallback-actions { border: 0; border-radius: 12px; background: rgba(255,255,255,.1); }
.embed-resource { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; color: var(--text); background: #fff; }
.embed-resource iframe { width: 100%; height: 100%; min-height: 420px; display: block; border: 0; background: #fff; }
.embed-resource-fallback { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .7rem; padding: .55rem .75rem; border-top: 1px solid var(--line); color: #637289; background: #f8fafd; font-size: .75rem; }
.embed-resource-fallback .button { width: auto; }
.embed-field textarea { min-height: 92px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .75rem; }

/* Intégration : l’iframe affiche uniquement le contenu de l’onglet partagé. */
body.embed-mode { min-width: 0; overflow: hidden; background: transparent; }
body.embed-mode .editor-view { grid-template-rows: minmax(0, 1fr); }
body.embed-mode .editor-header,
body.embed-mode .preview-banner,
body.embed-mode .tabs-bar { display: none !important; }
body.embed-mode .workspace { grid-row: 1; }
body.embed-mode .wall-canvas { padding-top: .8rem; }
body.embed-error .editor-view { background: #f7faff; }
.document-placeholder { display: grid; place-items: center; align-content: center; gap: .7rem; color: white; }
.document-placeholder svg { width: 54px; height: 54px; }
.document-placeholder img { width: min(620px, calc(100% - 2rem)); max-height: calc(100% - 8rem); border-radius: 14px; object-fit: contain; }
.document-placeholder span { width: min(540px, calc(100% - 2rem)); color: #cbd5e1; font-size: .82rem; text-align: center; }
.website-detail { width: min(760px, calc(100% - 2rem)); display: grid; grid-template-columns: minmax(220px, 1fr) 1fr; overflow: hidden; border-radius: 18px; color: var(--text); background: #fff; }
.website-detail > img, .website-icon { width: 100%; height: 100%; min-height: 280px; display: grid; place-items: center; object-fit: cover; color: #fff; background: linear-gradient(140deg, #1769e0, #654fbd); }
.website-icon svg { width: 60px; height: 60px; }
.website-detail > div { display: grid; align-content: center; gap: .8rem; padding: 1.4rem; }
.website-detail strong { color: var(--navy); font-size: 1.15rem; }
.website-detail p { color: var(--muted); }
.website-detail .button { width: max-content; }
.offline-resource, .text-resource-visual { display: grid; place-items: center; align-content: center; gap: .7rem; padding: 2rem; text-align: center; }
.offline-resource img { width: min(620px, 100%); border-radius: 14px; }
.offline-resource svg, .text-resource-visual svg { width: 58px; height: 58px; }
.offline-resource span { color: #cbd5e1; }
.text-resource-document { width: min(900px, calc(100% - 3rem)); max-height: calc(100% - 3rem); overflow: auto; padding: clamp(1.4rem, 4vw, 3.5rem); border-radius: 18px; color: var(--text); background: #fff; box-shadow: 0 18px 55px rgba(0,0,0,.22); }
.text-resource-document .rich-content { color: #24334a; font-size: clamp(1rem, 1.2vw, 1.22rem); line-height: 1.65; }
.resource-sidebar { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: auto; color: var(--text); background: #fff; }
.resource-copy, .detail-engagement, .detail-comments { padding: 1rem 1.05rem; border-bottom: 1px solid var(--line); }
.rich-content { color: #3c4a60; font-size: .9rem; line-height: 1.55; }
.rich-content p:last-child { margin-bottom: 0; }
.resource-date { margin: .65rem 0 0; color: #7a8798; font-size: .72rem; }
.detail-engagement h3, .detail-comments h3 { margin: 0 0 .65rem; font-size: .88rem; }
.detail-reaction-bar { min-height: 34px; display: flex; align-items: center; gap: .5rem; }
.detail-reaction-trigger,
.post-engagement .post-reaction-trigger {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #778293;
  background: transparent;
  cursor: pointer;
}
.detail-reaction-trigger:hover,
.post-engagement .post-reaction-trigger:hover { color: #566477; background: #eef2f6; }
.detail-reaction-trigger.selected,
.post-engagement .post-reaction-trigger.selected { color: var(--blue); background: var(--blue-soft); }
.detail-reaction-trigger svg,
.post-engagement .post-reaction-trigger svg { width: 19px; height: 19px; }
.reaction-summary { min-width: 0; display: inline-flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.reaction-count { display: inline-flex; align-items: center; gap: .15rem; color: #536176; font-size: .84rem; line-height: 1; }
.reaction-count strong { color: #6b778a; font-size: .7rem; font-weight: 760; }

/* Palette d'émojis flottante : elle ne ferme ni ne recharge le média ouvert. */
.emoji-popover {
  position: fixed;
  z-index: 240;
  width: min(370px, calc(100vw - 16px));
  max-height: min(430px, calc(100dvh - 16px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  padding: .72rem;
  border: 1px solid rgba(188, 199, 214, .82);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255,255,255,.97);
  box-shadow: 0 18px 42px rgba(28, 45, 71, .24), 0 3px 10px rgba(28, 45, 71, .1);
  backdrop-filter: blur(14px);
}
.emoji-popover:focus { outline: none; }
.emoji-search {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: 0 .65rem;
  border-radius: 999px;
  color: #687486;
  background: #eef1f4;
}
.emoji-search > svg { width: 18px; height: 18px; flex: none; }
.emoji-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .88rem; }
.emoji-category-title { margin: .65rem .18rem .38rem; color: #657286; font-size: .72rem; font-weight: 780; }
.emoji-grid { min-height: 196px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-content: start; gap: .15rem; overflow: auto; padding: .15rem .05rem .4rem; }
.emoji-choice {
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}
.emoji-choice:hover { background: #eef2f7; transform: scale(1.08); }
.emoji-choice.selected { outline: 2px solid #9dbef0; background: var(--blue-soft); }
.emoji-empty { grid-column: 1 / -1; margin: 1.4rem .5rem; color: #7b8798; font-size: .82rem; text-align: center; }
.emoji-categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; padding-top: .45rem; border-top: 1px solid var(--line); }
.emoji-categories button { min-height: 38px; padding: 0; border: 0; border-radius: 9px; background: transparent; font-size: 1.15rem; cursor: pointer; }
.emoji-categories button:hover { background: #f0f3f7; }
.emoji-categories button.active { background: #eee7ff; box-shadow: inset 0 -3px #8a62cf; }
.emoji-choice-hint { margin: .4rem 0 0; color: #8a95a5; font-size: .67rem; text-align: center; }
.comments-list { display: grid; gap: .55rem; }
.comments-empty, .engagement-disabled { margin: 0; color: #7a8798; font-size: .8rem; }
.comment-item { position: relative; padding: .65rem; border-radius: 10px; background: #f5f8fc; }
.comment-item > div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.comment-item strong { color: #34445d; font-size: .78rem; }
.comment-item small { color: #7a8798; font-size: .68rem; }
.comment-item p { margin: .35rem 0 0; color: #526179; font-size: .82rem; }
.comment-approve { margin-top: .45rem; padding: .3rem .48rem; border: 0; border-radius: 7px; color: #075d45; background: #dff5ed; font-size: .72rem; font-weight: 800; cursor: pointer; }
.comment-actions { display: flex; align-items: center; gap: .35rem; margin-top: .45rem; }
.comment-actions .comment-approve { margin-top: 0; }
.comment-delete { padding: .3rem .48rem; border: 0; border-radius: 7px; color: var(--danger); background: #fff0f2; font-size: .72rem; font-weight: 800; cursor: pointer; }
.comment-form { display: grid; gap: .45rem; margin-top: .8rem; }
.comment-form > input, .comment-form textarea { width: 100%; padding: .58rem .65rem; border: 1px solid #c7d5e5; border-radius: 9px; }
.comment-form > div { display: grid; gap: .45rem; }
.comment-form textarea { min-height: 72px; resize: vertical; }
.comment-form .button { min-height: 40px; justify-self: end; }
.comment-privacy-hint { margin: -.08rem 0 .05rem; color: #738197; font-size: .7rem; line-height: 1.35; }
.comment-identity { margin: 0; padding: .58rem .7rem; border-radius: 9px; color: #52627b; background: #eef4fb; font-size: .78rem; }
.post-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.danger-choice .choice-card-icon { color: var(--danger); background: #fff0f2; }

@media (max-width: 980px) {
  .publication-editor-grid { grid-template-columns: 1fr; }
  .resource-detail-grid { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 760px) {
  .toolbar-main { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow-x: auto; }
  .publication-modal { width: 100%; max-height: 96dvh; }
  .publication-modal .modal-body { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .modal.resource-viewer-modal { width: 100%; height: 100dvh; border-radius: 0; }
  .resource-viewer-modal .modal-header { padding-block: .65rem; }
  .resource-viewer-modal .modal-footer { display: none; }
  .resource-detail-grid { display: block; overflow: auto; }
  .resource-stage { min-height: 45dvh; }
  .video-frame { height: 45dvh; }
  .resource-sidebar { overflow: visible; }
  .detail-carousel { min-height: 45dvh; height: 45dvh; }
  .document-viewer iframe { min-height: 45dvh; }
  .office-viewer iframe { min-height: 52dvh; }
  .website-detail { grid-template-columns: 1fr; margin-block: 1rem; }
  .website-detail > img, .website-icon { min-height: 210px; max-height: 270px; }
  .emoji-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .mindmap-card-shell { width: 270px; }
  .mindmap-help span { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .layout-wall { columns: 245px auto; min-width: 760px; }
  .wall-canvas[data-layout="grid"] .layout-grid,
  .wall-canvas[data-layout="stream"] .layout-stream { min-width: 0; }
  .row-section-posts { grid-auto-columns: minmax(82vw, 330px); }
}

@media (max-width: 540px) {
  .toolbar-main { min-width: 520px; }
  .editor-toolbar { overflow-x: auto; }
  .publication-editor-grid { gap: .85rem; }
  .asset-buttons { grid-template-columns: 1fr; }
  .link-preview-card { grid-template-columns: 96px minmax(0, 1fr); }
  .link-preview-card > img, .link-preview-fallback { width: 96px; height: 72px; }
  .post-actions-grid { grid-template-columns: 1fr; }
  .mindmap-connection-row { grid-template-columns: 48px minmax(0, 1fr); }
  .mindmap-connection-row .button { grid-column: 2; justify-self: start; }
  .mindmap-link-preview { grid-template-columns: 1fr; }
  .mindmap-link-modal #deleteMindmapLink { width: 100%; margin-right: 0; }
  .matrix-table th, .matrix-table td { min-width: 245px; }
  .matrix-table .matrix-corner, .matrix-table .matrix-row-title { min-width: 125px; width: 125px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* V3.7.0 — réorganisation des onglets et des colonnes */
.tab-item {
  position: relative;
  min-width: max-content;
  display: inline-flex;
  align-items: stretch;
  border-radius: 11px 11px 0 0;
}
.tab-item.dragging-tab { opacity: .48; }
.tab-item.tab-drag-over { background: #eef5ff; }
.tab-item.tab-drag-over::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 8px;
  bottom: 8px;
  left: -2px;
  width: 3px;
  border-radius: 3px;
  background: var(--blue);
}
.tab-drag-handle {
  width: 26px;
  min-height: 54px;
  display: grid;
  place-items: center;
  color: #8a98ab;
  cursor: grab;
  touch-action: manipulation;
}
.tab-drag-handle:active { cursor: grabbing; }
.tab-drag-handle svg { width: 16px; height: 16px; }
.tab-item .tab-button { padding-inline: .38rem; }
.tab-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-menu-button {
  width: 32px;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: #748197;
  background: transparent;
  cursor: pointer;
}
.tab-menu-button:hover { color: var(--navy); background: #f1f5fa; }
.tab-menu-button svg { width: 18px; height: 18px; }

.tab-color-editor { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.tab-color-editor input[type="color"] {
  width: 54px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.tab-color-presets { display: flex; align-items: center; gap: .38rem; flex-wrap: wrap; }
.tab-color-swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  outline: 1px solid #c8d3e1;
  background: var(--swatch);
  cursor: pointer;
}
.tab-color-swatch:hover { transform: scale(1.08); }
.tab-order-actions, .section-order-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.section-title-group { min-width: 0; display: flex !important; align-items: center; gap: .35rem !important; }
.section-title-group h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-drag-handle {
  width: 30px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #8491a4;
  cursor: grab;
  touch-action: manipulation;
}
.section-drag-handle:hover { color: var(--navy); background: rgba(255,255,255,.8); }
.section-drag-handle:active { cursor: grabbing; }
.section-drag-handle svg { width: 18px; height: 18px; }
.column-lane.dragging-section { opacity: .5; }
.column-lane.section-drag-over {
  outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .tab-drag-handle { display: none; }
  .tab-item .tab-button { padding-inline: .55rem; }
  .tab-menu-button { width: 36px; }
  .section-drag-handle { display: none; }
}

/* V3.7.3 — navigation horizontale tactile des onglets et outils.
   Le canevas peut être plus large que l'écran (notamment en Colonnes),
   mais les barres d'interface doivent rester elles aussi parcourables au doigt. */
.tabs-bar {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: thin;
}
.tabs-list {
  flex: 0 0 auto;
  min-width: max-content;
  overflow: visible;
}
.tab-item,
.add-tab-button { flex: 0 0 auto; }

@media (max-width: 1100px) {
  .editor-toolbar {
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
  }
  .toolbar-main {
    min-width: max-content;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .45rem;
    overflow: visible;
  }
  .tool-button {
    min-width: 132px;
    flex: 0 0 auto;
    justify-content: flex-start;
  }
  .add-resource {
    width: auto;
    min-width: 112px;
    flex: 0 0 auto;
  }
}

@media (max-width: 540px) {
  .tool-button { min-width: 122px; }
  .add-resource { min-width: 104px; }
}

/* V3.7.6 — ciblage fiable d'un extrait YouTube / PeerTube */
.video-clip-options {
  display: grid;
  gap: .8rem;
  padding: .9rem;
  border: 1px solid #cbd9e8;
  border-radius: 14px;
  background: #f7faff;
}
.video-clip-options[hidden] { display: none !important; }
.video-clip-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.video-clip-heading strong { color: #253955; }
.video-clip-heading small { color: #718099; }
.video-clip-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.video-clip-summary { min-height: 1.2em; color: #49627d; font-size: .8rem; font-weight: 700; }
.video-clip-summary.invalid { color: #b42318; }
.video-excerpt-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: .35rem;
  padding: .22rem .5rem;
  border-radius: 999px;
  color: #214a78;
  background: #e6f1ff;
  font-size: .72rem;
  font-weight: 850;
}
@media (max-width: 620px) {
  .video-clip-fields { grid-template-columns: 1fr; }
}


/* V3.7.7 — cartes compactes type listview */
.post-card.listview-card .post-card-body { padding: .62rem .72rem .56rem; }
.post-card.listview-card .post-author-row { min-height: 28px; margin-bottom: .35rem; }
.post-card.listview-card .post-avatar { width: 26px; height: 26px; border-radius: 8px; font-size: .65rem; }
.post-card.listview-card .post-author-meta strong { font-size: .74rem; }
.post-card.listview-card .post-author-meta small { font-size: .65rem; }
.post-card.listview-card .post-actions-only { justify-content: flex-end; margin-bottom: .15rem; }
.compact-resource-row { display: grid; grid-template-columns: 34px minmax(0,1fr) 28px; align-items: center; gap: .65rem; }
.compact-resource-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--post-color, var(--blue)); background: color-mix(in srgb, var(--post-color, var(--blue)) 11%, white); }
.compact-resource-icon svg { width: 18px; height: 18px; }
.compact-resource-content { min-width: 0; }
.post-card.listview-card .post-title-button h3 { margin: 0 0 .2rem; font-size: .92rem; line-height: 1.25; }
.post-card.listview-card .compact-description { display: -webkit-box; overflow: hidden; margin: 0; color: #5f6e83; font-size: .76rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.compact-open-button { width: 28px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #6f7e92; background: transparent; cursor: pointer; }
.compact-open-button:hover { color: var(--blue); background: #edf4ff; }
.compact-open-button svg { width: 17px; height: 17px; }
.post-card.listview-card .post-card-meta { min-height: 0; margin-top: .35rem; padding-top: .35rem; }
.post-card.listview-card .post-card-meta:empty { display: none; }
.compact-card-setting { margin-top: .35rem; }
@media (max-width: 640px) {
  .compact-resource-row { grid-template-columns: 32px minmax(0,1fr) 26px; gap: .55rem; }
  .compact-resource-icon { width: 32px; height: 32px; }
}

/* V3.7.8 — badges réutilisables et filtres */
.badge-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  padding: .18rem .52rem;
  border-radius: 999px;
  background: var(--badge-bg, #1769e0);
  color: var(--badge-color, #fff);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.post-title-with-badge {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .42rem .55rem;
  min-width: 0;
}
.post-title-with-badge .post-title-button { min-width: 0; flex: 1 1 150px; }
.post-title-with-badge .post-badge { flex: 0 0 auto; margin-top: .68rem; }
.post-card.listview-card .post-title-with-badge { align-items: center; gap: .28rem .45rem; }
.post-card.listview-card .post-title-with-badge .post-badge { margin-top: 0; font-size: .62rem; min-height: 20px; padding: .15rem .45rem; }

.badge-filter-bar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: .45rem;
  width: max-content;
  min-width: 100%;
  max-width: none;
  margin: 0 0 .8rem;
  padding: .45rem .2rem .55rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.badge-filter-label { flex: 0 0 auto; color: #617087; font-size: .74rem; font-weight: 800; }
.badge-filter-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: .35rem .72rem;
  border: 1px solid #d6dfeb;
  border-radius: 999px;
  background: #fff;
  color: #43526a;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.badge-filter-button:not([data-badge-filter=""]) {
  border-color: color-mix(in srgb, var(--badge-bg, #1769e0) 55%, white);
  background: color-mix(in srgb, var(--badge-bg, #1769e0) 16%, white);
  color: color-mix(in srgb, var(--badge-bg, #1769e0) 72%, #16243a);
}
.badge-filter-button.active:not([data-badge-filter=""]) {
  border-color: var(--badge-bg, #1769e0);
  background: var(--badge-bg, #1769e0);
  color: var(--badge-color, #fff);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--badge-bg, #1769e0) 24%, transparent);
}
.badge-filter-button.active[data-badge-filter=""] {
  border-color: #1769e0;
  background: #1769e0;
  color: #fff;
}
.badge-filter-button:active { transform: scale(.97); }

.badge-editor-block { display: grid; gap: .55rem; padding: .7rem; border: 1px solid #e0e7f0; border-radius: 13px; background: #f9fbfe; }
.badge-editor-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.quick-badge-creator {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto auto;
  align-items: end;
  gap: .5rem;
  padding-top: .15rem;
}
.quick-badge-creator > input[type="text"] { min-height: 38px; }
.quick-badge-creator label { display: grid; gap: .2rem; color: #627188; font-size: .65rem; font-weight: 750; }
.quick-badge-creator input[type="color"] { width: 42px; height: 36px; padding: 2px; border: 1px solid #d7e0eb; border-radius: 9px; background: white; }
.post-badge-preview { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; min-height: 26px; }

.badge-manager { display: grid; gap: 1rem; }
.badge-new-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  align-items: end;
  gap: .65rem;
  padding: .8rem;
  border: 1px solid #e0e7f0;
  border-radius: 14px;
  background: #f9fbfe;
}
.badge-new-form > label:not(.form-field), .badge-manager-row > label { display: grid; gap: .2rem; color: #627188; font-size: .65rem; font-weight: 750; }
.badge-new-form input[type="color"], .badge-manager-row input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid #d7e0eb; border-radius: 9px; background: white; }
.badge-manager-list { display: grid; gap: .55rem; }
.badge-manager-row {
  display: grid;
  grid-template-columns: minmax(110px, .8fr) minmax(140px, 1.1fr) auto auto auto auto;
  align-items: center;
  gap: .5rem;
  padding: .6rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.badge-manager-preview { min-width: 0; }
.badge-manager-row > input[type="text"] { min-width: 0; }

@media (max-width: 720px) {
  .post-title-with-badge { display: grid; grid-template-columns: minmax(0,1fr); }
  .post-title-with-badge .post-badge { width: max-content; max-width: 100%; margin-top: 0; }
  .post-card.listview-card .post-title-with-badge { display: flex; }
  .badge-filter-bar { margin-left: -.2rem; margin-right: -.2rem; padding-left: .2rem; padding-right: .8rem; }
  .quick-badge-creator { grid-template-columns: minmax(0, 1fr) auto auto; }
  .quick-badge-creator .button { grid-column: 1 / -1; }
  .badge-new-form { grid-template-columns: minmax(0, 1fr) auto auto; }
  .badge-new-form .button { grid-column: 1 / -1; }
  .badge-manager-row { grid-template-columns: minmax(0,1fr) auto auto; }
  .badge-manager-preview { grid-column: 1 / -1; }
  .badge-manager-row > input[type="text"] { grid-column: 1 / -1; }
}


/* V3.7.9 — badge immédiat + modales sans débordement */
.modal, .modal-body, .publication-form, .publication-editor-grid, .publication-main, .publication-assets, .asset-block, .classification-block, .badge-editor-block {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.modal-body { overflow-x: hidden; }
.publication-modal .modal-body { overscroll-behavior: contain; }
.badge-editor-block select,
.badge-editor-block input[type="text"],
.badge-new-form input[type="text"],
.badge-manager-row input[type="text"] { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.quick-badge-creator {
  grid-template-columns: minmax(0, 1fr) auto auto;
  max-width: 100%;
}
.quick-badge-creator > input[type="text"] { grid-column: 1 / -1; width: 100%; }
.quick-badge-creator .button { min-width: 0; white-space: nowrap; }
.badge-new-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
  max-width: 100%;
}
.badge-new-form > .form-field { grid-column: 1 / -1; min-width: 0; }
.badge-new-form .button { min-width: 0; white-space: nowrap; }
.badge-manager-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  max-width: 100%;
}
.badge-manager-preview, .badge-manager-row > input[type="text"] { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .modal-header { padding: .9rem 1rem .7rem; }
  .modal-body { padding: .85rem 1rem; }
  .modal-footer { padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .publication-modal { max-height: 98dvh; }
  .quick-badge-creator, .badge-new-form, .badge-manager-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: .45rem; }
  .quick-badge-creator .button, .badge-new-form .button { grid-column: 1 / -1; width: 100%; }
}

/* V3.8.0 — publications multi-ressources */
.pending-media-actions {
  position: absolute;
  top: .3rem;
  right: .3rem;
  display: flex;
  gap: .28rem;
  z-index: 2;
}
.pending-media-item .pending-media-actions button,
.pending-document .pending-media-actions button {
  position: static;
  flex: 0 0 30px;
}
.pending-media-item .primary-resource-button,
.pending-document .primary-resource-button,
.link-preview-card .primary-resource-button {
  color: #66758a;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(116,134,158,.2);
  font-size: 1rem;
  line-height: 1;
}
.primary-resource-button.active {
  color: #9a6700 !important;
  background: #fff3c4 !important;
  border-color: #f0c54b !important;
  box-shadow: 0 0 0 2px rgba(240,197,75,.16);
}
.pending-document { position: relative; }
.pending-document .pending-media-actions { position: static; margin-left: auto; }
.pending-document.is-primary { outline: 2px solid rgba(240,197,75,.45); }
.link-preview-card { position: relative; }
.link-preview-card .primary-resource-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
}
.link-preview-card.is-primary-resource { outline: 2px solid rgba(240,197,75,.45); }

.post-secondary-resources { margin-top: .65rem; }
.secondary-resources-label {
  display: block;
  margin-bottom: .35rem;
  color: #728096;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.secondary-resource-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.secondary-resource-pill {
  max-width: 100%;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .52rem;
  border: 1px solid #dce4ee;
  border-radius: 999px;
  color: #40516a;
  background: #f8fafc;
  font-size: .69rem;
  font-weight: 750;
  cursor: pointer;
}
.secondary-resource-pill:hover { border-color: #b8c9de; background: #eef5ff; color: var(--blue); }
.secondary-resource-pill svg { width: 14px; height: 14px; flex: 0 0 auto; }
.secondary-resource-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-card.listview-card .post-secondary-resources { margin-top: .38rem; }
.post-card.listview-card .secondary-resources-label { display: none; }
.post-card.listview-card .secondary-resource-pill { min-height: 24px; padding: .22rem .42rem; font-size: .63rem; }

.detail-resource-nav {
  margin: 0 0 1rem;
  padding: .8rem;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
  background: #f8fafc;
}
.detail-resource-nav h3 { margin: 0 0 .55rem; font-size: .78rem; }
.detail-resource-list { display: grid; gap: .38rem; }
.detail-resource-button {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto;
  align-items: center;
  gap: .45rem;
  padding: .5rem .58rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #40516a;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.detail-resource-button.active { border-color: #98bde8; background: #edf5ff; color: #174f90; }
.detail-resource-button svg { width: 16px; height: 16px; }
.detail-resource-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; font-weight: 760; }
.detail-resource-button small { color: #77869a; font-size: .62rem; font-weight: 800; }

@media (max-width: 640px) {
  .secondary-resource-list { display: grid; grid-template-columns: 1fr; }
  .secondary-resource-pill { width: 100%; justify-content: flex-start; border-radius: 9px; }
}


.detail-resource-link {
  text-decoration: none;
  color: inherit;
}
.detail-resource-link:hover {
  border-color: rgba(23,105,224,.36);
  background: rgba(23,105,224,.06);
}


.detail-resource-thumb {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 0 10px;
  background: var(--surface-soft, #f4f7fb);
}


.local-video-viewer {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 260px;
  background: #0f172a;
  border-radius: 18px;
  overflow: hidden;
}
.local-video-viewer video {
  display: block;
  width: 100%;
  max-height: min(72vh, 760px);
  background: #000;
}
.share-code-value span {
  display: block;
  margin-top: .35rem;
  max-width: 36rem;
  color: var(--muted, #64748b);
  font-size: .82rem;
  font-weight: 500;
}
.pending-video small {
  color: var(--muted, #64748b);
}


.matrix-color-section {
  display: grid;
  gap: .55rem;
  min-width: 0;
}
.matrix-color-section > strong {
  font-size: .9rem;
}
.matrix-color-section > small {
  color: var(--muted, #64748b);
  line-height: 1.35;
}
.matrix-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .55rem;
  min-width: 0;
}
.matrix-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid var(--border, #d9e2ef);
  border-radius: 12px;
  background: var(--surface, #fff);
}
.matrix-color-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .84rem;
  font-weight: 750;
}
.matrix-color-row input[type="color"] {
  flex: 0 0 42px;
  width: 42px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border, #d9e2ef);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
@media (max-width: 620px) {
  .matrix-color-grid { grid-template-columns: 1fr; }
}


/* Colonnes + sous-catégories */
.nested-columns-layout { align-items: stretch; }
.nested-column-lane { display: flex; flex-direction: column; gap: .7rem; }
.nested-column-header { margin-bottom: 0; }
.nested-subcategories { display: grid; gap: .75rem; align-content: start; }
.subcategory-group {
  min-width: 0;
  padding: .65rem;
  border: 1px solid rgba(155, 178, 206, .58);
  border-radius: 14px;
  background: rgba(255,255,255,.74);
}
.subcategory-group.unassigned-subcategory {
  border-style: dashed;
  background: rgba(250,252,255,.62);
}
.subcategory-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  margin-bottom: .55rem;
}
.subcategory-title-group,
.subcategory-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.subcategory-title-group h3 {
  margin: 0;
  overflow: hidden;
  color: var(--navy);
  font-size: .87rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subcategory-count {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 .35rem;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(226,234,244,.86);
  font-size: .68rem;
  font-weight: 850;
}
.subcategory-drag-handle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.subcategory-drag-handle:active { cursor: grabbing; }
.subcategory-drag-handle svg { width: 15px; height: 15px; }
.subcategory-posts { display: grid; gap: .65rem; }
.subcategory-posts .post-card { margin: 0; }
.subcategory-add-post,
.add-subcategory-card {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin-top: .55rem;
  border: 1px dashed rgba(120,151,190,.65);
  border-radius: 10px;
  color: var(--blue-dark);
  background: rgba(255,255,255,.48);
  font-size: .76rem;
  font-weight: 780;
  cursor: pointer;
}
.add-subcategory-card { min-height: 42px; margin-top: auto; }
.subcategory-add-post svg,
.add-subcategory-card svg { width: 16px; height: 16px; }
.nested-column-empty {
  padding: 1rem .75rem;
  color: var(--muted);
  border: 1px dashed rgba(150,174,204,.6);
  border-radius: 12px;
  text-align: center;
  font-size: .78rem;
}
.subcategory-group.dragging-subcategory { opacity: .48; }
.subcategory-group.subcategory-drag-over {
  outline: 2px solid rgba(23,105,224,.55);
  outline-offset: 2px;
}
.nested-location-fields { align-items: end; }
