:root {
  --bg: #f4f6f9; --panel: #fff; --text: #1c2230; --muted: #6b7280; --line: #e3e7ee;
  --primary: #1f3a5f; --primary-2: #2c5282; --danger: #b33a3a; --accent: #e8f0fb;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + .7rem) 1rem .7rem; background: var(--primary); color: #fff; }
.brand { color: #fff; font-weight: 700; letter-spacing: .3px; }
.agence { font-size: .85rem; opacity: .85; }
.demo { color: #ffd166; }
.container { max-width: 960px; margin: 0 auto; padding: 1rem; padding-bottom: 3rem; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.small-gap { gap: .4rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.btn { display: inline-flex; align-items: center; gap: .3rem; padding: .6rem 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-size: .95rem; cursor: pointer;
  white-space: nowrap; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-2); }
.btn.danger { color: var(--danger); }
.btn.small { padding: .4rem .7rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.file-btn { cursor: pointer; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 14px; padding: 2rem; text-align: center; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--text); }
.cover { height: 140px; background: var(--accent) center/cover no-repeat; }
.card-body { padding: .75rem; } .card-title { font-weight: 600; }
.form label, .tabpane label { display: block; margin-bottom: .8rem; font-size: .9rem; color: var(--muted); }
input, select, textarea { width: 100%; margin-top: .25rem; padding: .6rem .7rem; font-size: 1rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--text); font-family: inherit; }
textarea { resize: vertical; }
select.inline { width: auto; margin: 0; padding: .5rem .6rem; font-size: .9rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.check { display: flex !important; align-items: center; gap: .5rem; } .check input { width: auto; margin: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-top: 1rem; }
.photo { border: 1px solid var(--line); border-radius: 12px; padding: .6rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: .5rem; }
figure { margin: 0; } figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block; }
figcaption { font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.placeholder { aspect-ratio: 4/3; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: .8rem; color: var(--muted); text-align: center; padding: .5rem; }
.photo.busy { opacity: .6; }
.notice { background: var(--accent); border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; margin-top: 1rem; }
.tabs { display: flex; gap: .4rem; margin-bottom: .8rem; }
.tab { padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: #111; color: #fff;
  padding: .7rem 1.1rem; border-radius: 10px; font-size: .9rem; z-index: 10; max-width: 90vw; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } h1 { font-size: 1.25rem; } .row.between { flex-direction: column; } }
.nav { display: flex; gap: .8rem; align-items: center; font-size: .85rem; }
.nav a { color: #fff; opacity: .9; }
.inline-form { display: inline; margin: 0; }
.linkbtn { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: .3rem .6rem; cursor: pointer; font-size: .85rem; }
.langs a { margin-left: .4rem; opacity: .6; } .langs a.on { opacity: 1; font-weight: 700; text-decoration: underline; }
.login-box { max-width: 420px; margin: 2rem auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.wide { width: 100%; justify-content: center; }
.error { background: #fde8e8; color: var(--danger); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; padding: .4rem .3rem; border-bottom: 1px solid var(--line); }
.table td { padding: .55rem .3rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.off td { opacity: .45; }
.mini-logo { height: 22px; vertical-align: middle; margin-right: .4rem; }
.logo-preview { max-height: 70px; max-width: 220px; background: #fff; padding: .3rem; border: 1px solid var(--line); border-radius: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
h3 { font-size: 1rem; margin: 1.2rem 0 .6rem; }
@media (max-width: 560px) { .table thead { display: none; } .table td { display: block; border: 0; } .table tr { border-bottom: 1px solid var(--line); display: block; padding: .4rem 0; } .agence { display: none; } }

/* ---- galerie ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: .8rem; }
.tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--accent); cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .badge { position: absolute; top: 5px; left: 5px; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; padding: 2px 6px; border-radius: 999px; }
.tile .room { position: absolute; bottom: 5px; left: 5px; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; padding: 2px 6px; border-radius: 999px; text-transform: capitalize; }
.tile .check { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35);
  color: #fff; font-size: .85rem; display: none; align-items: center; justify-content: center; }
.tiles.selecting .tile .check { display: flex; }
.tile.sel { outline: 3px solid var(--primary); outline-offset: -3px; }
.tile.sel .check { background: var(--primary); border-color: var(--primary); }
.tile .spinner { display: none; position: absolute; inset: 0; background: rgba(255,255,255,.55); }
.tile .spinner::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  border: 3px solid var(--primary); border-top-color: transparent; animation: spin .8s linear infinite; }
.tile.busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: .5rem; align-items: center; padding: .7rem 1rem calc(env(safe-area-inset-bottom) + .7rem);
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08); overflow-x: auto; }
.actionbar span { font-size: .9rem; font-weight: 600; white-space: nowrap; min-width: 2.6rem; }
.actionbar .btn.small { padding: .45rem .6rem; }
.btn.small.primary { color: #fff; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-box { background: #fff; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 1rem 1rem calc(env(safe-area-inset-bottom) + 1rem); }
.sheet-box h3 { margin: 0 0 .8rem; }
.sheet-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .8rem; max-height: 50vh; overflow-y: auto; }
.viewer { position: fixed; inset: 0; z-index: 45; background: #000; color: #fff; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer-top, .viewer-bottom { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; }
.viewer-top { padding-top: calc(env(safe-area-inset-top) + .7rem); }
.viewer-top span { flex: 1; font-size: .9rem; }
.viewer-bottom { padding-bottom: calc(env(safe-area-inset-bottom) + .7rem); }
.viewer-bottom select { flex: 1; background: #222; color: #fff; border-color: #444; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer .btn-round { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 1.1rem; }
.viewer .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.viewer .btn.primary { background: var(--primary); }

[hidden] { display: none !important; }
.seg { display: inline-flex; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; }
.seg button { background: transparent; color: #fff; border: 0; padding: .4rem .8rem; font-size: .85rem; cursor: pointer; }
.seg button.on { background: #fff; color: #111; font-weight: 600; }

/* ---- réseaux sociaux ---- */
.thumbstrip { display: flex; gap: 6px; overflow-x: auto; padding: .5rem 0; }
.thumb { position: relative; flex: 0 0 72px; height: 72px; border-radius: 8px; overflow: hidden; cursor: pointer; opacity: .55; border: 3px solid transparent; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.in { opacity: 1; }
.thumb.main { border-color: var(--primary); }
.thumb .star { position: absolute; top: 2px; left: 4px; color: #fff; font-size: .8rem; text-shadow: 0 1px 2px #000; }
.thumb .num { position: absolute; bottom: 2px; right: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: 0 5px; border-radius: 999px; }
.mockups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: .8rem; align-items: start; }
.mock { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .9rem; }
.mock-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #f9a, #f5576c, #fc0); flex: 0 0 auto; }
.avatar.sq { border-radius: 50%; background: var(--primary); }
.mock-img { width: 100%; display: block; background: var(--accent); }
.mock.ig .mock-img { aspect-ratio: 1; object-fit: cover; }
.mock.fb .mock-img { aspect-ratio: 1200/628; object-fit: cover; }
.mock-actions { padding: .5rem .8rem; font-size: 1.1rem; }
.mock-caption { padding: 0 .8rem .6rem; white-space: pre-wrap; line-height: 1.35; max-height: 9rem; overflow: auto; }
.mock-caption.fb-text { padding: .2rem .8rem .6rem; }
.mock-foot { display: flex; gap: .4rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .6rem .8rem; border-top: 1px solid var(--line); background: #fafbfd; }
.mock.story { background: transparent; border: 0; }
.phone { position: relative; width: 100%; max-width: 250px; margin: 0 auto; aspect-ratio: 9/16.6; border-radius: 28px; background: #000; padding: 10px; }
.phone .mock-img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.story-bar { position: absolute; top: 18px; left: 22px; right: 22px; height: 3px; background: rgba(255,255,255,.9); border-radius: 2px; }
.mock.story .mock-foot { background: transparent; border: 0; justify-content: center; }
/* mobile : maquettes en carrousel horizontal compact */
.mock-caption { max-height: none; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) {
  .mockups { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: .8rem; padding-bottom: .4rem; -webkit-overflow-scrolling: touch; }
  .mock { flex: 0 0 72vw; max-width: 300px; scroll-snap-align: center; font-size: .8rem; }
  .mock-head { padding: .4rem .6rem; } .avatar { width: 26px; height: 26px; }
  .mock-actions { padding: .3rem .6rem; font-size: 1rem; }
  .mock-caption { padding: 0 .6rem .4rem; -webkit-line-clamp: 3; }
  .mock-foot { padding: .4rem .6rem; }
  .phone { max-width: 190px; padding: 7px; border-radius: 22px; }
  .phone .mock-img { border-radius: 16px; }
  .mock.story { flex-basis: 60vw; }
}

/* ---- simulateur réseaux ---- */
.simu { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.simu-bar { display: flex; align-items: center; gap: .6rem; padding: calc(env(safe-area-inset-top) + .5rem) .8rem .5rem; background: #111; }
.simu-bar .btn-round { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1rem; }
.simu-seg { margin-left: auto; }
.simu-body { flex: 1; min-height: 0; overflow: hidden; display: flex; justify-content: center; }
.net { width: 100%; max-width: 430px; height: 100%; overflow-y: auto; background: #fff; color: #111; font-size: 15px; position: relative; }
.net[hidden] { display: none; }
.dots { margin-left: auto; color: #333; letter-spacing: 1px; }
.simu-img { width: 100%; display: block; background: #eee; }
/* Instagram */
.ig-top { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; }
.ig-logo { font-family: "Brush Script MT", "Snell Roundhand", cursive; font-size: 1.6rem; }
.ig-stories { display: flex; gap: .9rem; padding: .3rem .8rem .7rem; overflow-x: auto; border-bottom: 1px solid #eee; }
.st { display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .7rem; flex: 0 0 auto; }
.st i { width: 58px; height: 58px; border-radius: 50%; background: #ddd; border: 3px solid #fff; box-shadow: 0 0 0 2px #f5576c; }
.st.me i { box-shadow: 0 0 0 2px #ccc; }
.ig-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; }
.ig-post .avatar { width: 34px; height: 34px; }
.ig-cta { display: flex; justify-content: space-between; padding: .6rem .8rem; background: #f6f6f6; font-weight: 600; font-size: .9rem; }
.ig-actions { display: flex; justify-content: space-between; padding: .6rem .8rem .3rem; font-size: 1.25rem; }
.ig-likes, .ig-caption { padding: .15rem .8rem; }
.ig-caption { white-space: pre-wrap; line-height: 1.35; }
.ig-time { padding: .3rem .8rem 4.5rem; }
.ig-nav { position: sticky; bottom: 0; display: flex; justify-content: space-around; align-items: center; padding: .6rem 0 calc(env(safe-area-inset-bottom) + .6rem); background: #fff; border-top: 1px solid #eee; font-size: 1.3rem; }
.avatar.mini { width: 26px; height: 26px; }
/* Story */
.story-view { background: #000; display: flex; align-items: center; overflow: hidden; }
.story-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-progress { position: absolute; top: 10px; left: 8px; right: 8px; display: flex; gap: 4px; }
.story-progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.4); }
.story-progress i.done { background: #fff; } .story-progress i.cur { background: linear-gradient(90deg, #fff 60%, rgba(255,255,255,.4) 60%); }
.story-head { position: absolute; top: 22px; left: 12px; right: 12px; display: flex; align-items: center; gap: .5rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.story-head .avatar { width: 32px; height: 32px; } .story-head .muted { color: rgba(255,255,255,.8); } .story-head .dots { color: #fff; }
.story-reply { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 14px); display: flex; justify-content: space-between; align-items: center; color: #fff; }
.story-reply span:first-child { flex: 1; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: .55rem .9rem; margin-right: .8rem; font-size: .9rem; }
/* Facebook */
.fb-feed { background: #f0f2f5; }
.fb-top { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; background: #fff; }
.fb-logo { color: #1877f2; font-weight: 800; font-size: 1.5rem; letter-spacing: -.5px; }
.fb-post { background: #fff; margin: .6rem 0; }
.fb-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem .4rem; }
.fb-head .avatar { width: 38px; height: 38px; }
.fb-text { padding: .2rem .8rem .6rem; white-space: pre-wrap; line-height: 1.35; }
.fb-link { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem .8rem; background: #f0f2f5; }
.fb-btn { background: #e4e6eb; border: 0; border-radius: 6px; padding: .5rem .8rem; font-weight: 600; white-space: nowrap; }
.fb-stats { padding: .5rem .8rem; border-bottom: 1px solid #eee; }
.fb-actions { display: flex; justify-content: space-around; padding: .5rem 0; color: #65676b; font-weight: 600; font-size: .9rem; }
.ghost .ph { display: inline-block; background: #e4e6eb; border-radius: 4px; height: .8rem; width: 8rem; }
.ghost .ph.short { width: 5rem; height: .6rem; margin-top: .2rem; } .ghost .ph.block { display: block; width: 100%; height: 180px; border-radius: 0; margin-top: .4rem; }
.avatar.grey { background: #e4e6eb; }
